fidl_test_processbuilder/
fidl_test_processbuilder.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_test_processbuilder__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct UtilMarker;
16
17impl fidl::endpoints::ProtocolMarker for UtilMarker {
18    type Proxy = UtilProxy;
19    type RequestStream = UtilRequestStream;
20    #[cfg(target_os = "fuchsia")]
21    type SynchronousProxy = UtilSynchronousProxy;
22
23    const DEBUG_NAME: &'static str = "test.processbuilder.Util";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for UtilMarker {}
26
27pub trait UtilProxyInterface: Send + Sync {
28    type GetArgumentsResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>>
29        + Send;
30    fn r#get_arguments(&self) -> Self::GetArgumentsResponseFut;
31    type GetArgumentCountResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
32    fn r#get_argument_count(&self) -> Self::GetArgumentCountResponseFut;
33    type GetEnvironmentResponseFut: std::future::Future<Output = Result<Vec<EnvVar>, fidl::Error>>
34        + Send;
35    fn r#get_environment(&self) -> Self::GetEnvironmentResponseFut;
36    type GetEnvironmentCountResponseFut: std::future::Future<Output = Result<u64, fidl::Error>>
37        + Send;
38    fn r#get_environment_count(&self) -> Self::GetEnvironmentCountResponseFut;
39    type DumpNamespaceResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
40    fn r#dump_namespace(&self) -> Self::DumpNamespaceResponseFut;
41    type ReadFileResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
42    fn r#read_file(&self, path: &str) -> Self::ReadFileResponseFut;
43    type GetLifecycleKoidResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
44    fn r#get_lifecycle_koid(&self) -> Self::GetLifecycleKoidResponseFut;
45}
46#[derive(Debug)]
47#[cfg(target_os = "fuchsia")]
48pub struct UtilSynchronousProxy {
49    client: fidl::client::sync::Client,
50}
51
52#[cfg(target_os = "fuchsia")]
53impl fidl::endpoints::SynchronousProxy for UtilSynchronousProxy {
54    type Proxy = UtilProxy;
55    type Protocol = UtilMarker;
56
57    fn from_channel(inner: fidl::Channel) -> Self {
58        Self::new(inner)
59    }
60
61    fn into_channel(self) -> fidl::Channel {
62        self.client.into_channel()
63    }
64
65    fn as_channel(&self) -> &fidl::Channel {
66        self.client.as_channel()
67    }
68}
69
70#[cfg(target_os = "fuchsia")]
71impl UtilSynchronousProxy {
72    pub fn new(channel: fidl::Channel) -> Self {
73        let protocol_name = <UtilMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
74        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
75    }
76
77    pub fn into_channel(self) -> fidl::Channel {
78        self.client.into_channel()
79    }
80
81    /// Waits until an event arrives and returns it. It is safe for other
82    /// threads to make concurrent requests while waiting for an event.
83    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<UtilEvent, fidl::Error> {
84        UtilEvent::decode(self.client.wait_for_event(deadline)?)
85    }
86
87    pub fn r#get_arguments(
88        &self,
89        ___deadline: zx::MonotonicInstant,
90    ) -> Result<Vec<String>, fidl::Error> {
91        let _response =
92            self.client.send_query::<fidl::encoding::EmptyPayload, UtilGetArgumentsResponse>(
93                (),
94                0x50ff7f790c425519,
95                fidl::encoding::DynamicFlags::empty(),
96                ___deadline,
97            )?;
98        Ok(_response.args)
99    }
100
101    pub fn r#get_argument_count(
102        &self,
103        ___deadline: zx::MonotonicInstant,
104    ) -> Result<u64, fidl::Error> {
105        let _response =
106            self.client.send_query::<fidl::encoding::EmptyPayload, UtilGetArgumentCountResponse>(
107                (),
108                0x41ef27d234ed7098,
109                fidl::encoding::DynamicFlags::empty(),
110                ___deadline,
111            )?;
112        Ok(_response.count)
113    }
114
115    pub fn r#get_environment(
116        &self,
117        ___deadline: zx::MonotonicInstant,
118    ) -> Result<Vec<EnvVar>, fidl::Error> {
119        let _response =
120            self.client.send_query::<fidl::encoding::EmptyPayload, UtilGetEnvironmentResponse>(
121                (),
122                0x451e633adf04ec23,
123                fidl::encoding::DynamicFlags::empty(),
124                ___deadline,
125            )?;
126        Ok(_response.vars)
127    }
128
129    pub fn r#get_environment_count(
130        &self,
131        ___deadline: zx::MonotonicInstant,
132    ) -> Result<u64, fidl::Error> {
133        let _response = self
134            .client
135            .send_query::<fidl::encoding::EmptyPayload, UtilGetEnvironmentCountResponse>(
136                (),
137                0xe01fe768fb1be1a,
138                fidl::encoding::DynamicFlags::empty(),
139                ___deadline,
140            )?;
141        Ok(_response.count)
142    }
143
144    pub fn r#dump_namespace(
145        &self,
146        ___deadline: zx::MonotonicInstant,
147    ) -> Result<String, fidl::Error> {
148        let _response =
149            self.client.send_query::<fidl::encoding::EmptyPayload, UtilDumpNamespaceResponse>(
150                (),
151                0x73826cecc1a7f3a4,
152                fidl::encoding::DynamicFlags::empty(),
153                ___deadline,
154            )?;
155        Ok(_response.contents)
156    }
157
158    pub fn r#read_file(
159        &self,
160        mut path: &str,
161        ___deadline: zx::MonotonicInstant,
162    ) -> Result<String, fidl::Error> {
163        let _response = self.client.send_query::<UtilReadFileRequest, UtilReadFileResponse>(
164            (path,),
165            0x2ea8e2e4b427a391,
166            fidl::encoding::DynamicFlags::empty(),
167            ___deadline,
168        )?;
169        Ok(_response.contents)
170    }
171
172    pub fn r#get_lifecycle_koid(
173        &self,
174        ___deadline: zx::MonotonicInstant,
175    ) -> Result<u64, fidl::Error> {
176        let _response =
177            self.client.send_query::<fidl::encoding::EmptyPayload, UtilGetLifecycleKoidResponse>(
178                (),
179                0xdaecfc0fe4c8f60,
180                fidl::encoding::DynamicFlags::empty(),
181                ___deadline,
182            )?;
183        Ok(_response.koid)
184    }
185}
186
187#[cfg(target_os = "fuchsia")]
188impl From<UtilSynchronousProxy> for zx::Handle {
189    fn from(value: UtilSynchronousProxy) -> Self {
190        value.into_channel().into()
191    }
192}
193
194#[cfg(target_os = "fuchsia")]
195impl From<fidl::Channel> for UtilSynchronousProxy {
196    fn from(value: fidl::Channel) -> Self {
197        Self::new(value)
198    }
199}
200
201#[cfg(target_os = "fuchsia")]
202impl fidl::endpoints::FromClient for UtilSynchronousProxy {
203    type Protocol = UtilMarker;
204
205    fn from_client(value: fidl::endpoints::ClientEnd<UtilMarker>) -> Self {
206        Self::new(value.into_channel())
207    }
208}
209
210#[derive(Debug, Clone)]
211pub struct UtilProxy {
212    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
213}
214
215impl fidl::endpoints::Proxy for UtilProxy {
216    type Protocol = UtilMarker;
217
218    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
219        Self::new(inner)
220    }
221
222    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
223        self.client.into_channel().map_err(|client| Self { client })
224    }
225
226    fn as_channel(&self) -> &::fidl::AsyncChannel {
227        self.client.as_channel()
228    }
229}
230
231impl UtilProxy {
232    /// Create a new Proxy for test.processbuilder/Util.
233    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
234        let protocol_name = <UtilMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
235        Self { client: fidl::client::Client::new(channel, protocol_name) }
236    }
237
238    /// Get a Stream of events from the remote end of the protocol.
239    ///
240    /// # Panics
241    ///
242    /// Panics if the event stream was already taken.
243    pub fn take_event_stream(&self) -> UtilEventStream {
244        UtilEventStream { event_receiver: self.client.take_event_receiver() }
245    }
246
247    pub fn r#get_arguments(
248        &self,
249    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
250    {
251        UtilProxyInterface::r#get_arguments(self)
252    }
253
254    pub fn r#get_argument_count(
255        &self,
256    ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
257        UtilProxyInterface::r#get_argument_count(self)
258    }
259
260    pub fn r#get_environment(
261        &self,
262    ) -> fidl::client::QueryResponseFut<Vec<EnvVar>, fidl::encoding::DefaultFuchsiaResourceDialect>
263    {
264        UtilProxyInterface::r#get_environment(self)
265    }
266
267    pub fn r#get_environment_count(
268        &self,
269    ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
270        UtilProxyInterface::r#get_environment_count(self)
271    }
272
273    pub fn r#dump_namespace(
274        &self,
275    ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
276        UtilProxyInterface::r#dump_namespace(self)
277    }
278
279    pub fn r#read_file(
280        &self,
281        mut path: &str,
282    ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
283        UtilProxyInterface::r#read_file(self, path)
284    }
285
286    pub fn r#get_lifecycle_koid(
287        &self,
288    ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
289        UtilProxyInterface::r#get_lifecycle_koid(self)
290    }
291}
292
293impl UtilProxyInterface for UtilProxy {
294    type GetArgumentsResponseFut =
295        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
296    fn r#get_arguments(&self) -> Self::GetArgumentsResponseFut {
297        fn _decode(
298            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
299        ) -> Result<Vec<String>, fidl::Error> {
300            let _response = fidl::client::decode_transaction_body::<
301                UtilGetArgumentsResponse,
302                fidl::encoding::DefaultFuchsiaResourceDialect,
303                0x50ff7f790c425519,
304            >(_buf?)?;
305            Ok(_response.args)
306        }
307        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
308            (),
309            0x50ff7f790c425519,
310            fidl::encoding::DynamicFlags::empty(),
311            _decode,
312        )
313    }
314
315    type GetArgumentCountResponseFut =
316        fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
317    fn r#get_argument_count(&self) -> Self::GetArgumentCountResponseFut {
318        fn _decode(
319            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
320        ) -> Result<u64, fidl::Error> {
321            let _response = fidl::client::decode_transaction_body::<
322                UtilGetArgumentCountResponse,
323                fidl::encoding::DefaultFuchsiaResourceDialect,
324                0x41ef27d234ed7098,
325            >(_buf?)?;
326            Ok(_response.count)
327        }
328        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
329            (),
330            0x41ef27d234ed7098,
331            fidl::encoding::DynamicFlags::empty(),
332            _decode,
333        )
334    }
335
336    type GetEnvironmentResponseFut =
337        fidl::client::QueryResponseFut<Vec<EnvVar>, fidl::encoding::DefaultFuchsiaResourceDialect>;
338    fn r#get_environment(&self) -> Self::GetEnvironmentResponseFut {
339        fn _decode(
340            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
341        ) -> Result<Vec<EnvVar>, fidl::Error> {
342            let _response = fidl::client::decode_transaction_body::<
343                UtilGetEnvironmentResponse,
344                fidl::encoding::DefaultFuchsiaResourceDialect,
345                0x451e633adf04ec23,
346            >(_buf?)?;
347            Ok(_response.vars)
348        }
349        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<EnvVar>>(
350            (),
351            0x451e633adf04ec23,
352            fidl::encoding::DynamicFlags::empty(),
353            _decode,
354        )
355    }
356
357    type GetEnvironmentCountResponseFut =
358        fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
359    fn r#get_environment_count(&self) -> Self::GetEnvironmentCountResponseFut {
360        fn _decode(
361            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
362        ) -> Result<u64, fidl::Error> {
363            let _response = fidl::client::decode_transaction_body::<
364                UtilGetEnvironmentCountResponse,
365                fidl::encoding::DefaultFuchsiaResourceDialect,
366                0xe01fe768fb1be1a,
367            >(_buf?)?;
368            Ok(_response.count)
369        }
370        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
371            (),
372            0xe01fe768fb1be1a,
373            fidl::encoding::DynamicFlags::empty(),
374            _decode,
375        )
376    }
377
378    type DumpNamespaceResponseFut =
379        fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
380    fn r#dump_namespace(&self) -> Self::DumpNamespaceResponseFut {
381        fn _decode(
382            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
383        ) -> Result<String, fidl::Error> {
384            let _response = fidl::client::decode_transaction_body::<
385                UtilDumpNamespaceResponse,
386                fidl::encoding::DefaultFuchsiaResourceDialect,
387                0x73826cecc1a7f3a4,
388            >(_buf?)?;
389            Ok(_response.contents)
390        }
391        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, String>(
392            (),
393            0x73826cecc1a7f3a4,
394            fidl::encoding::DynamicFlags::empty(),
395            _decode,
396        )
397    }
398
399    type ReadFileResponseFut =
400        fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
401    fn r#read_file(&self, mut path: &str) -> Self::ReadFileResponseFut {
402        fn _decode(
403            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
404        ) -> Result<String, fidl::Error> {
405            let _response = fidl::client::decode_transaction_body::<
406                UtilReadFileResponse,
407                fidl::encoding::DefaultFuchsiaResourceDialect,
408                0x2ea8e2e4b427a391,
409            >(_buf?)?;
410            Ok(_response.contents)
411        }
412        self.client.send_query_and_decode::<UtilReadFileRequest, String>(
413            (path,),
414            0x2ea8e2e4b427a391,
415            fidl::encoding::DynamicFlags::empty(),
416            _decode,
417        )
418    }
419
420    type GetLifecycleKoidResponseFut =
421        fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
422    fn r#get_lifecycle_koid(&self) -> Self::GetLifecycleKoidResponseFut {
423        fn _decode(
424            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
425        ) -> Result<u64, fidl::Error> {
426            let _response = fidl::client::decode_transaction_body::<
427                UtilGetLifecycleKoidResponse,
428                fidl::encoding::DefaultFuchsiaResourceDialect,
429                0xdaecfc0fe4c8f60,
430            >(_buf?)?;
431            Ok(_response.koid)
432        }
433        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
434            (),
435            0xdaecfc0fe4c8f60,
436            fidl::encoding::DynamicFlags::empty(),
437            _decode,
438        )
439    }
440}
441
442pub struct UtilEventStream {
443    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
444}
445
446impl std::marker::Unpin for UtilEventStream {}
447
448impl futures::stream::FusedStream for UtilEventStream {
449    fn is_terminated(&self) -> bool {
450        self.event_receiver.is_terminated()
451    }
452}
453
454impl futures::Stream for UtilEventStream {
455    type Item = Result<UtilEvent, fidl::Error>;
456
457    fn poll_next(
458        mut self: std::pin::Pin<&mut Self>,
459        cx: &mut std::task::Context<'_>,
460    ) -> std::task::Poll<Option<Self::Item>> {
461        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
462            &mut self.event_receiver,
463            cx
464        )?) {
465            Some(buf) => std::task::Poll::Ready(Some(UtilEvent::decode(buf))),
466            None => std::task::Poll::Ready(None),
467        }
468    }
469}
470
471#[derive(Debug)]
472pub enum UtilEvent {}
473
474impl UtilEvent {
475    /// Decodes a message buffer as a [`UtilEvent`].
476    fn decode(
477        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
478    ) -> Result<UtilEvent, fidl::Error> {
479        let (bytes, _handles) = buf.split_mut();
480        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
481        debug_assert_eq!(tx_header.tx_id, 0);
482        match tx_header.ordinal {
483            _ => Err(fidl::Error::UnknownOrdinal {
484                ordinal: tx_header.ordinal,
485                protocol_name: <UtilMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
486            }),
487        }
488    }
489}
490
491/// A Stream of incoming requests for test.processbuilder/Util.
492pub struct UtilRequestStream {
493    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
494    is_terminated: bool,
495}
496
497impl std::marker::Unpin for UtilRequestStream {}
498
499impl futures::stream::FusedStream for UtilRequestStream {
500    fn is_terminated(&self) -> bool {
501        self.is_terminated
502    }
503}
504
505impl fidl::endpoints::RequestStream for UtilRequestStream {
506    type Protocol = UtilMarker;
507    type ControlHandle = UtilControlHandle;
508
509    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
510        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
511    }
512
513    fn control_handle(&self) -> Self::ControlHandle {
514        UtilControlHandle { inner: self.inner.clone() }
515    }
516
517    fn into_inner(
518        self,
519    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
520    {
521        (self.inner, self.is_terminated)
522    }
523
524    fn from_inner(
525        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
526        is_terminated: bool,
527    ) -> Self {
528        Self { inner, is_terminated }
529    }
530}
531
532impl futures::Stream for UtilRequestStream {
533    type Item = Result<UtilRequest, fidl::Error>;
534
535    fn poll_next(
536        mut self: std::pin::Pin<&mut Self>,
537        cx: &mut std::task::Context<'_>,
538    ) -> std::task::Poll<Option<Self::Item>> {
539        let this = &mut *self;
540        if this.inner.check_shutdown(cx) {
541            this.is_terminated = true;
542            return std::task::Poll::Ready(None);
543        }
544        if this.is_terminated {
545            panic!("polled UtilRequestStream after completion");
546        }
547        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
548            |bytes, handles| {
549                match this.inner.channel().read_etc(cx, bytes, handles) {
550                    std::task::Poll::Ready(Ok(())) => {}
551                    std::task::Poll::Pending => return std::task::Poll::Pending,
552                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
553                        this.is_terminated = true;
554                        return std::task::Poll::Ready(None);
555                    }
556                    std::task::Poll::Ready(Err(e)) => {
557                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
558                            e.into(),
559                        ))));
560                    }
561                }
562
563                // A message has been received from the channel
564                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
565
566                std::task::Poll::Ready(Some(match header.ordinal {
567                    0x50ff7f790c425519 => {
568                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
569                        let mut req = fidl::new_empty!(
570                            fidl::encoding::EmptyPayload,
571                            fidl::encoding::DefaultFuchsiaResourceDialect
572                        );
573                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
574                        let control_handle = UtilControlHandle { inner: this.inner.clone() };
575                        Ok(UtilRequest::GetArguments {
576                            responder: UtilGetArgumentsResponder {
577                                control_handle: std::mem::ManuallyDrop::new(control_handle),
578                                tx_id: header.tx_id,
579                            },
580                        })
581                    }
582                    0x41ef27d234ed7098 => {
583                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
584                        let mut req = fidl::new_empty!(
585                            fidl::encoding::EmptyPayload,
586                            fidl::encoding::DefaultFuchsiaResourceDialect
587                        );
588                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
589                        let control_handle = UtilControlHandle { inner: this.inner.clone() };
590                        Ok(UtilRequest::GetArgumentCount {
591                            responder: UtilGetArgumentCountResponder {
592                                control_handle: std::mem::ManuallyDrop::new(control_handle),
593                                tx_id: header.tx_id,
594                            },
595                        })
596                    }
597                    0x451e633adf04ec23 => {
598                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
599                        let mut req = fidl::new_empty!(
600                            fidl::encoding::EmptyPayload,
601                            fidl::encoding::DefaultFuchsiaResourceDialect
602                        );
603                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
604                        let control_handle = UtilControlHandle { inner: this.inner.clone() };
605                        Ok(UtilRequest::GetEnvironment {
606                            responder: UtilGetEnvironmentResponder {
607                                control_handle: std::mem::ManuallyDrop::new(control_handle),
608                                tx_id: header.tx_id,
609                            },
610                        })
611                    }
612                    0xe01fe768fb1be1a => {
613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
614                        let mut req = fidl::new_empty!(
615                            fidl::encoding::EmptyPayload,
616                            fidl::encoding::DefaultFuchsiaResourceDialect
617                        );
618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
619                        let control_handle = UtilControlHandle { inner: this.inner.clone() };
620                        Ok(UtilRequest::GetEnvironmentCount {
621                            responder: UtilGetEnvironmentCountResponder {
622                                control_handle: std::mem::ManuallyDrop::new(control_handle),
623                                tx_id: header.tx_id,
624                            },
625                        })
626                    }
627                    0x73826cecc1a7f3a4 => {
628                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
629                        let mut req = fidl::new_empty!(
630                            fidl::encoding::EmptyPayload,
631                            fidl::encoding::DefaultFuchsiaResourceDialect
632                        );
633                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
634                        let control_handle = UtilControlHandle { inner: this.inner.clone() };
635                        Ok(UtilRequest::DumpNamespace {
636                            responder: UtilDumpNamespaceResponder {
637                                control_handle: std::mem::ManuallyDrop::new(control_handle),
638                                tx_id: header.tx_id,
639                            },
640                        })
641                    }
642                    0x2ea8e2e4b427a391 => {
643                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
644                        let mut req = fidl::new_empty!(
645                            UtilReadFileRequest,
646                            fidl::encoding::DefaultFuchsiaResourceDialect
647                        );
648                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UtilReadFileRequest>(&header, _body_bytes, handles, &mut req)?;
649                        let control_handle = UtilControlHandle { inner: this.inner.clone() };
650                        Ok(UtilRequest::ReadFile {
651                            path: req.path,
652
653                            responder: UtilReadFileResponder {
654                                control_handle: std::mem::ManuallyDrop::new(control_handle),
655                                tx_id: header.tx_id,
656                            },
657                        })
658                    }
659                    0xdaecfc0fe4c8f60 => {
660                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
661                        let mut req = fidl::new_empty!(
662                            fidl::encoding::EmptyPayload,
663                            fidl::encoding::DefaultFuchsiaResourceDialect
664                        );
665                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
666                        let control_handle = UtilControlHandle { inner: this.inner.clone() };
667                        Ok(UtilRequest::GetLifecycleKoid {
668                            responder: UtilGetLifecycleKoidResponder {
669                                control_handle: std::mem::ManuallyDrop::new(control_handle),
670                                tx_id: header.tx_id,
671                            },
672                        })
673                    }
674                    _ => Err(fidl::Error::UnknownOrdinal {
675                        ordinal: header.ordinal,
676                        protocol_name: <UtilMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
677                    }),
678                }))
679            },
680        )
681    }
682}
683
684#[derive(Debug)]
685pub enum UtilRequest {
686    GetArguments { responder: UtilGetArgumentsResponder },
687    GetArgumentCount { responder: UtilGetArgumentCountResponder },
688    GetEnvironment { responder: UtilGetEnvironmentResponder },
689    GetEnvironmentCount { responder: UtilGetEnvironmentCountResponder },
690    DumpNamespace { responder: UtilDumpNamespaceResponder },
691    ReadFile { path: String, responder: UtilReadFileResponder },
692    GetLifecycleKoid { responder: UtilGetLifecycleKoidResponder },
693}
694
695impl UtilRequest {
696    #[allow(irrefutable_let_patterns)]
697    pub fn into_get_arguments(self) -> Option<(UtilGetArgumentsResponder)> {
698        if let UtilRequest::GetArguments { responder } = self { Some((responder)) } else { None }
699    }
700
701    #[allow(irrefutable_let_patterns)]
702    pub fn into_get_argument_count(self) -> Option<(UtilGetArgumentCountResponder)> {
703        if let UtilRequest::GetArgumentCount { responder } = self {
704            Some((responder))
705        } else {
706            None
707        }
708    }
709
710    #[allow(irrefutable_let_patterns)]
711    pub fn into_get_environment(self) -> Option<(UtilGetEnvironmentResponder)> {
712        if let UtilRequest::GetEnvironment { responder } = self { Some((responder)) } else { None }
713    }
714
715    #[allow(irrefutable_let_patterns)]
716    pub fn into_get_environment_count(self) -> Option<(UtilGetEnvironmentCountResponder)> {
717        if let UtilRequest::GetEnvironmentCount { responder } = self {
718            Some((responder))
719        } else {
720            None
721        }
722    }
723
724    #[allow(irrefutable_let_patterns)]
725    pub fn into_dump_namespace(self) -> Option<(UtilDumpNamespaceResponder)> {
726        if let UtilRequest::DumpNamespace { responder } = self { Some((responder)) } else { None }
727    }
728
729    #[allow(irrefutable_let_patterns)]
730    pub fn into_read_file(self) -> Option<(String, UtilReadFileResponder)> {
731        if let UtilRequest::ReadFile { path, responder } = self {
732            Some((path, responder))
733        } else {
734            None
735        }
736    }
737
738    #[allow(irrefutable_let_patterns)]
739    pub fn into_get_lifecycle_koid(self) -> Option<(UtilGetLifecycleKoidResponder)> {
740        if let UtilRequest::GetLifecycleKoid { responder } = self {
741            Some((responder))
742        } else {
743            None
744        }
745    }
746
747    /// Name of the method defined in FIDL
748    pub fn method_name(&self) -> &'static str {
749        match *self {
750            UtilRequest::GetArguments { .. } => "get_arguments",
751            UtilRequest::GetArgumentCount { .. } => "get_argument_count",
752            UtilRequest::GetEnvironment { .. } => "get_environment",
753            UtilRequest::GetEnvironmentCount { .. } => "get_environment_count",
754            UtilRequest::DumpNamespace { .. } => "dump_namespace",
755            UtilRequest::ReadFile { .. } => "read_file",
756            UtilRequest::GetLifecycleKoid { .. } => "get_lifecycle_koid",
757        }
758    }
759}
760
761#[derive(Debug, Clone)]
762pub struct UtilControlHandle {
763    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
764}
765
766impl fidl::endpoints::ControlHandle for UtilControlHandle {
767    fn shutdown(&self) {
768        self.inner.shutdown()
769    }
770    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
771        self.inner.shutdown_with_epitaph(status)
772    }
773
774    fn is_closed(&self) -> bool {
775        self.inner.channel().is_closed()
776    }
777    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
778        self.inner.channel().on_closed()
779    }
780
781    #[cfg(target_os = "fuchsia")]
782    fn signal_peer(
783        &self,
784        clear_mask: zx::Signals,
785        set_mask: zx::Signals,
786    ) -> Result<(), zx_status::Status> {
787        use fidl::Peered;
788        self.inner.channel().signal_peer(clear_mask, set_mask)
789    }
790}
791
792impl UtilControlHandle {}
793
794#[must_use = "FIDL methods require a response to be sent"]
795#[derive(Debug)]
796pub struct UtilGetArgumentsResponder {
797    control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
798    tx_id: u32,
799}
800
801/// Set the the channel to be shutdown (see [`UtilControlHandle::shutdown`])
802/// if the responder is dropped without sending a response, so that the client
803/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
804impl std::ops::Drop for UtilGetArgumentsResponder {
805    fn drop(&mut self) {
806        self.control_handle.shutdown();
807        // Safety: drops once, never accessed again
808        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
809    }
810}
811
812impl fidl::endpoints::Responder for UtilGetArgumentsResponder {
813    type ControlHandle = UtilControlHandle;
814
815    fn control_handle(&self) -> &UtilControlHandle {
816        &self.control_handle
817    }
818
819    fn drop_without_shutdown(mut self) {
820        // Safety: drops once, never accessed again due to mem::forget
821        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
822        // Prevent Drop from running (which would shut down the channel)
823        std::mem::forget(self);
824    }
825}
826
827impl UtilGetArgumentsResponder {
828    /// Sends a response to the FIDL transaction.
829    ///
830    /// Sets the channel to shutdown if an error occurs.
831    pub fn send(self, mut args: &[String]) -> Result<(), fidl::Error> {
832        let _result = self.send_raw(args);
833        if _result.is_err() {
834            self.control_handle.shutdown();
835        }
836        self.drop_without_shutdown();
837        _result
838    }
839
840    /// Similar to "send" but does not shutdown the channel if an error occurs.
841    pub fn send_no_shutdown_on_err(self, mut args: &[String]) -> Result<(), fidl::Error> {
842        let _result = self.send_raw(args);
843        self.drop_without_shutdown();
844        _result
845    }
846
847    fn send_raw(&self, mut args: &[String]) -> Result<(), fidl::Error> {
848        self.control_handle.inner.send::<UtilGetArgumentsResponse>(
849            (args,),
850            self.tx_id,
851            0x50ff7f790c425519,
852            fidl::encoding::DynamicFlags::empty(),
853        )
854    }
855}
856
857#[must_use = "FIDL methods require a response to be sent"]
858#[derive(Debug)]
859pub struct UtilGetArgumentCountResponder {
860    control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
861    tx_id: u32,
862}
863
864/// Set the the channel to be shutdown (see [`UtilControlHandle::shutdown`])
865/// if the responder is dropped without sending a response, so that the client
866/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
867impl std::ops::Drop for UtilGetArgumentCountResponder {
868    fn drop(&mut self) {
869        self.control_handle.shutdown();
870        // Safety: drops once, never accessed again
871        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
872    }
873}
874
875impl fidl::endpoints::Responder for UtilGetArgumentCountResponder {
876    type ControlHandle = UtilControlHandle;
877
878    fn control_handle(&self) -> &UtilControlHandle {
879        &self.control_handle
880    }
881
882    fn drop_without_shutdown(mut self) {
883        // Safety: drops once, never accessed again due to mem::forget
884        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
885        // Prevent Drop from running (which would shut down the channel)
886        std::mem::forget(self);
887    }
888}
889
890impl UtilGetArgumentCountResponder {
891    /// Sends a response to the FIDL transaction.
892    ///
893    /// Sets the channel to shutdown if an error occurs.
894    pub fn send(self, mut count: u64) -> Result<(), fidl::Error> {
895        let _result = self.send_raw(count);
896        if _result.is_err() {
897            self.control_handle.shutdown();
898        }
899        self.drop_without_shutdown();
900        _result
901    }
902
903    /// Similar to "send" but does not shutdown the channel if an error occurs.
904    pub fn send_no_shutdown_on_err(self, mut count: u64) -> Result<(), fidl::Error> {
905        let _result = self.send_raw(count);
906        self.drop_without_shutdown();
907        _result
908    }
909
910    fn send_raw(&self, mut count: u64) -> Result<(), fidl::Error> {
911        self.control_handle.inner.send::<UtilGetArgumentCountResponse>(
912            (count,),
913            self.tx_id,
914            0x41ef27d234ed7098,
915            fidl::encoding::DynamicFlags::empty(),
916        )
917    }
918}
919
920#[must_use = "FIDL methods require a response to be sent"]
921#[derive(Debug)]
922pub struct UtilGetEnvironmentResponder {
923    control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
924    tx_id: u32,
925}
926
927/// Set the the channel to be shutdown (see [`UtilControlHandle::shutdown`])
928/// if the responder is dropped without sending a response, so that the client
929/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
930impl std::ops::Drop for UtilGetEnvironmentResponder {
931    fn drop(&mut self) {
932        self.control_handle.shutdown();
933        // Safety: drops once, never accessed again
934        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
935    }
936}
937
938impl fidl::endpoints::Responder for UtilGetEnvironmentResponder {
939    type ControlHandle = UtilControlHandle;
940
941    fn control_handle(&self) -> &UtilControlHandle {
942        &self.control_handle
943    }
944
945    fn drop_without_shutdown(mut self) {
946        // Safety: drops once, never accessed again due to mem::forget
947        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
948        // Prevent Drop from running (which would shut down the channel)
949        std::mem::forget(self);
950    }
951}
952
953impl UtilGetEnvironmentResponder {
954    /// Sends a response to the FIDL transaction.
955    ///
956    /// Sets the channel to shutdown if an error occurs.
957    pub fn send(self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
958        let _result = self.send_raw(vars);
959        if _result.is_err() {
960            self.control_handle.shutdown();
961        }
962        self.drop_without_shutdown();
963        _result
964    }
965
966    /// Similar to "send" but does not shutdown the channel if an error occurs.
967    pub fn send_no_shutdown_on_err(self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
968        let _result = self.send_raw(vars);
969        self.drop_without_shutdown();
970        _result
971    }
972
973    fn send_raw(&self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
974        self.control_handle.inner.send::<UtilGetEnvironmentResponse>(
975            (vars,),
976            self.tx_id,
977            0x451e633adf04ec23,
978            fidl::encoding::DynamicFlags::empty(),
979        )
980    }
981}
982
983#[must_use = "FIDL methods require a response to be sent"]
984#[derive(Debug)]
985pub struct UtilGetEnvironmentCountResponder {
986    control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
987    tx_id: u32,
988}
989
990/// Set the the channel to be shutdown (see [`UtilControlHandle::shutdown`])
991/// if the responder is dropped without sending a response, so that the client
992/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
993impl std::ops::Drop for UtilGetEnvironmentCountResponder {
994    fn drop(&mut self) {
995        self.control_handle.shutdown();
996        // Safety: drops once, never accessed again
997        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
998    }
999}
1000
1001impl fidl::endpoints::Responder for UtilGetEnvironmentCountResponder {
1002    type ControlHandle = UtilControlHandle;
1003
1004    fn control_handle(&self) -> &UtilControlHandle {
1005        &self.control_handle
1006    }
1007
1008    fn drop_without_shutdown(mut self) {
1009        // Safety: drops once, never accessed again due to mem::forget
1010        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1011        // Prevent Drop from running (which would shut down the channel)
1012        std::mem::forget(self);
1013    }
1014}
1015
1016impl UtilGetEnvironmentCountResponder {
1017    /// Sends a response to the FIDL transaction.
1018    ///
1019    /// Sets the channel to shutdown if an error occurs.
1020    pub fn send(self, mut count: u64) -> Result<(), fidl::Error> {
1021        let _result = self.send_raw(count);
1022        if _result.is_err() {
1023            self.control_handle.shutdown();
1024        }
1025        self.drop_without_shutdown();
1026        _result
1027    }
1028
1029    /// Similar to "send" but does not shutdown the channel if an error occurs.
1030    pub fn send_no_shutdown_on_err(self, mut count: u64) -> Result<(), fidl::Error> {
1031        let _result = self.send_raw(count);
1032        self.drop_without_shutdown();
1033        _result
1034    }
1035
1036    fn send_raw(&self, mut count: u64) -> Result<(), fidl::Error> {
1037        self.control_handle.inner.send::<UtilGetEnvironmentCountResponse>(
1038            (count,),
1039            self.tx_id,
1040            0xe01fe768fb1be1a,
1041            fidl::encoding::DynamicFlags::empty(),
1042        )
1043    }
1044}
1045
1046#[must_use = "FIDL methods require a response to be sent"]
1047#[derive(Debug)]
1048pub struct UtilDumpNamespaceResponder {
1049    control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
1050    tx_id: u32,
1051}
1052
1053/// Set the the channel to be shutdown (see [`UtilControlHandle::shutdown`])
1054/// if the responder is dropped without sending a response, so that the client
1055/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1056impl std::ops::Drop for UtilDumpNamespaceResponder {
1057    fn drop(&mut self) {
1058        self.control_handle.shutdown();
1059        // Safety: drops once, never accessed again
1060        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1061    }
1062}
1063
1064impl fidl::endpoints::Responder for UtilDumpNamespaceResponder {
1065    type ControlHandle = UtilControlHandle;
1066
1067    fn control_handle(&self) -> &UtilControlHandle {
1068        &self.control_handle
1069    }
1070
1071    fn drop_without_shutdown(mut self) {
1072        // Safety: drops once, never accessed again due to mem::forget
1073        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1074        // Prevent Drop from running (which would shut down the channel)
1075        std::mem::forget(self);
1076    }
1077}
1078
1079impl UtilDumpNamespaceResponder {
1080    /// Sends a response to the FIDL transaction.
1081    ///
1082    /// Sets the channel to shutdown if an error occurs.
1083    pub fn send(self, mut contents: &str) -> Result<(), fidl::Error> {
1084        let _result = self.send_raw(contents);
1085        if _result.is_err() {
1086            self.control_handle.shutdown();
1087        }
1088        self.drop_without_shutdown();
1089        _result
1090    }
1091
1092    /// Similar to "send" but does not shutdown the channel if an error occurs.
1093    pub fn send_no_shutdown_on_err(self, mut contents: &str) -> Result<(), fidl::Error> {
1094        let _result = self.send_raw(contents);
1095        self.drop_without_shutdown();
1096        _result
1097    }
1098
1099    fn send_raw(&self, mut contents: &str) -> Result<(), fidl::Error> {
1100        self.control_handle.inner.send::<UtilDumpNamespaceResponse>(
1101            (contents,),
1102            self.tx_id,
1103            0x73826cecc1a7f3a4,
1104            fidl::encoding::DynamicFlags::empty(),
1105        )
1106    }
1107}
1108
1109#[must_use = "FIDL methods require a response to be sent"]
1110#[derive(Debug)]
1111pub struct UtilReadFileResponder {
1112    control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
1113    tx_id: u32,
1114}
1115
1116/// Set the the channel to be shutdown (see [`UtilControlHandle::shutdown`])
1117/// if the responder is dropped without sending a response, so that the client
1118/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1119impl std::ops::Drop for UtilReadFileResponder {
1120    fn drop(&mut self) {
1121        self.control_handle.shutdown();
1122        // Safety: drops once, never accessed again
1123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1124    }
1125}
1126
1127impl fidl::endpoints::Responder for UtilReadFileResponder {
1128    type ControlHandle = UtilControlHandle;
1129
1130    fn control_handle(&self) -> &UtilControlHandle {
1131        &self.control_handle
1132    }
1133
1134    fn drop_without_shutdown(mut self) {
1135        // Safety: drops once, never accessed again due to mem::forget
1136        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1137        // Prevent Drop from running (which would shut down the channel)
1138        std::mem::forget(self);
1139    }
1140}
1141
1142impl UtilReadFileResponder {
1143    /// Sends a response to the FIDL transaction.
1144    ///
1145    /// Sets the channel to shutdown if an error occurs.
1146    pub fn send(self, mut contents: &str) -> Result<(), fidl::Error> {
1147        let _result = self.send_raw(contents);
1148        if _result.is_err() {
1149            self.control_handle.shutdown();
1150        }
1151        self.drop_without_shutdown();
1152        _result
1153    }
1154
1155    /// Similar to "send" but does not shutdown the channel if an error occurs.
1156    pub fn send_no_shutdown_on_err(self, mut contents: &str) -> Result<(), fidl::Error> {
1157        let _result = self.send_raw(contents);
1158        self.drop_without_shutdown();
1159        _result
1160    }
1161
1162    fn send_raw(&self, mut contents: &str) -> Result<(), fidl::Error> {
1163        self.control_handle.inner.send::<UtilReadFileResponse>(
1164            (contents,),
1165            self.tx_id,
1166            0x2ea8e2e4b427a391,
1167            fidl::encoding::DynamicFlags::empty(),
1168        )
1169    }
1170}
1171
1172#[must_use = "FIDL methods require a response to be sent"]
1173#[derive(Debug)]
1174pub struct UtilGetLifecycleKoidResponder {
1175    control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
1176    tx_id: u32,
1177}
1178
1179/// Set the the channel to be shutdown (see [`UtilControlHandle::shutdown`])
1180/// if the responder is dropped without sending a response, so that the client
1181/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1182impl std::ops::Drop for UtilGetLifecycleKoidResponder {
1183    fn drop(&mut self) {
1184        self.control_handle.shutdown();
1185        // Safety: drops once, never accessed again
1186        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1187    }
1188}
1189
1190impl fidl::endpoints::Responder for UtilGetLifecycleKoidResponder {
1191    type ControlHandle = UtilControlHandle;
1192
1193    fn control_handle(&self) -> &UtilControlHandle {
1194        &self.control_handle
1195    }
1196
1197    fn drop_without_shutdown(mut self) {
1198        // Safety: drops once, never accessed again due to mem::forget
1199        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1200        // Prevent Drop from running (which would shut down the channel)
1201        std::mem::forget(self);
1202    }
1203}
1204
1205impl UtilGetLifecycleKoidResponder {
1206    /// Sends a response to the FIDL transaction.
1207    ///
1208    /// Sets the channel to shutdown if an error occurs.
1209    pub fn send(self, mut koid: u64) -> Result<(), fidl::Error> {
1210        let _result = self.send_raw(koid);
1211        if _result.is_err() {
1212            self.control_handle.shutdown();
1213        }
1214        self.drop_without_shutdown();
1215        _result
1216    }
1217
1218    /// Similar to "send" but does not shutdown the channel if an error occurs.
1219    pub fn send_no_shutdown_on_err(self, mut koid: u64) -> Result<(), fidl::Error> {
1220        let _result = self.send_raw(koid);
1221        self.drop_without_shutdown();
1222        _result
1223    }
1224
1225    fn send_raw(&self, mut koid: u64) -> Result<(), fidl::Error> {
1226        self.control_handle.inner.send::<UtilGetLifecycleKoidResponse>(
1227            (koid,),
1228            self.tx_id,
1229            0xdaecfc0fe4c8f60,
1230            fidl::encoding::DynamicFlags::empty(),
1231        )
1232    }
1233}
1234
1235mod internal {
1236    use super::*;
1237}