1#![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 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 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 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 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
491pub 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 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 {
699 Some((responder))
700 } else {
701 None
702 }
703 }
704
705 #[allow(irrefutable_let_patterns)]
706 pub fn into_get_argument_count(self) -> Option<(UtilGetArgumentCountResponder)> {
707 if let UtilRequest::GetArgumentCount { responder } = self {
708 Some((responder))
709 } else {
710 None
711 }
712 }
713
714 #[allow(irrefutable_let_patterns)]
715 pub fn into_get_environment(self) -> Option<(UtilGetEnvironmentResponder)> {
716 if let UtilRequest::GetEnvironment { responder } = self {
717 Some((responder))
718 } else {
719 None
720 }
721 }
722
723 #[allow(irrefutable_let_patterns)]
724 pub fn into_get_environment_count(self) -> Option<(UtilGetEnvironmentCountResponder)> {
725 if let UtilRequest::GetEnvironmentCount { responder } = self {
726 Some((responder))
727 } else {
728 None
729 }
730 }
731
732 #[allow(irrefutable_let_patterns)]
733 pub fn into_dump_namespace(self) -> Option<(UtilDumpNamespaceResponder)> {
734 if let UtilRequest::DumpNamespace { responder } = self {
735 Some((responder))
736 } else {
737 None
738 }
739 }
740
741 #[allow(irrefutable_let_patterns)]
742 pub fn into_read_file(self) -> Option<(String, UtilReadFileResponder)> {
743 if let UtilRequest::ReadFile { path, responder } = self {
744 Some((path, responder))
745 } else {
746 None
747 }
748 }
749
750 #[allow(irrefutable_let_patterns)]
751 pub fn into_get_lifecycle_koid(self) -> Option<(UtilGetLifecycleKoidResponder)> {
752 if let UtilRequest::GetLifecycleKoid { responder } = self {
753 Some((responder))
754 } else {
755 None
756 }
757 }
758
759 pub fn method_name(&self) -> &'static str {
761 match *self {
762 UtilRequest::GetArguments { .. } => "get_arguments",
763 UtilRequest::GetArgumentCount { .. } => "get_argument_count",
764 UtilRequest::GetEnvironment { .. } => "get_environment",
765 UtilRequest::GetEnvironmentCount { .. } => "get_environment_count",
766 UtilRequest::DumpNamespace { .. } => "dump_namespace",
767 UtilRequest::ReadFile { .. } => "read_file",
768 UtilRequest::GetLifecycleKoid { .. } => "get_lifecycle_koid",
769 }
770 }
771}
772
773#[derive(Debug, Clone)]
774pub struct UtilControlHandle {
775 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
776}
777
778impl fidl::endpoints::ControlHandle for UtilControlHandle {
779 fn shutdown(&self) {
780 self.inner.shutdown()
781 }
782 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
783 self.inner.shutdown_with_epitaph(status)
784 }
785
786 fn is_closed(&self) -> bool {
787 self.inner.channel().is_closed()
788 }
789 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
790 self.inner.channel().on_closed()
791 }
792
793 #[cfg(target_os = "fuchsia")]
794 fn signal_peer(
795 &self,
796 clear_mask: zx::Signals,
797 set_mask: zx::Signals,
798 ) -> Result<(), zx_status::Status> {
799 use fidl::Peered;
800 self.inner.channel().signal_peer(clear_mask, set_mask)
801 }
802}
803
804impl UtilControlHandle {}
805
806#[must_use = "FIDL methods require a response to be sent"]
807#[derive(Debug)]
808pub struct UtilGetArgumentsResponder {
809 control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
810 tx_id: u32,
811}
812
813impl std::ops::Drop for UtilGetArgumentsResponder {
817 fn drop(&mut self) {
818 self.control_handle.shutdown();
819 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
821 }
822}
823
824impl fidl::endpoints::Responder for UtilGetArgumentsResponder {
825 type ControlHandle = UtilControlHandle;
826
827 fn control_handle(&self) -> &UtilControlHandle {
828 &self.control_handle
829 }
830
831 fn drop_without_shutdown(mut self) {
832 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
834 std::mem::forget(self);
836 }
837}
838
839impl UtilGetArgumentsResponder {
840 pub fn send(self, mut args: &[String]) -> Result<(), fidl::Error> {
844 let _result = self.send_raw(args);
845 if _result.is_err() {
846 self.control_handle.shutdown();
847 }
848 self.drop_without_shutdown();
849 _result
850 }
851
852 pub fn send_no_shutdown_on_err(self, mut args: &[String]) -> Result<(), fidl::Error> {
854 let _result = self.send_raw(args);
855 self.drop_without_shutdown();
856 _result
857 }
858
859 fn send_raw(&self, mut args: &[String]) -> Result<(), fidl::Error> {
860 self.control_handle.inner.send::<UtilGetArgumentsResponse>(
861 (args,),
862 self.tx_id,
863 0x50ff7f790c425519,
864 fidl::encoding::DynamicFlags::empty(),
865 )
866 }
867}
868
869#[must_use = "FIDL methods require a response to be sent"]
870#[derive(Debug)]
871pub struct UtilGetArgumentCountResponder {
872 control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
873 tx_id: u32,
874}
875
876impl std::ops::Drop for UtilGetArgumentCountResponder {
880 fn drop(&mut self) {
881 self.control_handle.shutdown();
882 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
884 }
885}
886
887impl fidl::endpoints::Responder for UtilGetArgumentCountResponder {
888 type ControlHandle = UtilControlHandle;
889
890 fn control_handle(&self) -> &UtilControlHandle {
891 &self.control_handle
892 }
893
894 fn drop_without_shutdown(mut self) {
895 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
897 std::mem::forget(self);
899 }
900}
901
902impl UtilGetArgumentCountResponder {
903 pub fn send(self, mut count: u64) -> Result<(), fidl::Error> {
907 let _result = self.send_raw(count);
908 if _result.is_err() {
909 self.control_handle.shutdown();
910 }
911 self.drop_without_shutdown();
912 _result
913 }
914
915 pub fn send_no_shutdown_on_err(self, mut count: u64) -> Result<(), fidl::Error> {
917 let _result = self.send_raw(count);
918 self.drop_without_shutdown();
919 _result
920 }
921
922 fn send_raw(&self, mut count: u64) -> Result<(), fidl::Error> {
923 self.control_handle.inner.send::<UtilGetArgumentCountResponse>(
924 (count,),
925 self.tx_id,
926 0x41ef27d234ed7098,
927 fidl::encoding::DynamicFlags::empty(),
928 )
929 }
930}
931
932#[must_use = "FIDL methods require a response to be sent"]
933#[derive(Debug)]
934pub struct UtilGetEnvironmentResponder {
935 control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
936 tx_id: u32,
937}
938
939impl std::ops::Drop for UtilGetEnvironmentResponder {
943 fn drop(&mut self) {
944 self.control_handle.shutdown();
945 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
947 }
948}
949
950impl fidl::endpoints::Responder for UtilGetEnvironmentResponder {
951 type ControlHandle = UtilControlHandle;
952
953 fn control_handle(&self) -> &UtilControlHandle {
954 &self.control_handle
955 }
956
957 fn drop_without_shutdown(mut self) {
958 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
960 std::mem::forget(self);
962 }
963}
964
965impl UtilGetEnvironmentResponder {
966 pub fn send(self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
970 let _result = self.send_raw(vars);
971 if _result.is_err() {
972 self.control_handle.shutdown();
973 }
974 self.drop_without_shutdown();
975 _result
976 }
977
978 pub fn send_no_shutdown_on_err(self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
980 let _result = self.send_raw(vars);
981 self.drop_without_shutdown();
982 _result
983 }
984
985 fn send_raw(&self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
986 self.control_handle.inner.send::<UtilGetEnvironmentResponse>(
987 (vars,),
988 self.tx_id,
989 0x451e633adf04ec23,
990 fidl::encoding::DynamicFlags::empty(),
991 )
992 }
993}
994
995#[must_use = "FIDL methods require a response to be sent"]
996#[derive(Debug)]
997pub struct UtilGetEnvironmentCountResponder {
998 control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
999 tx_id: u32,
1000}
1001
1002impl std::ops::Drop for UtilGetEnvironmentCountResponder {
1006 fn drop(&mut self) {
1007 self.control_handle.shutdown();
1008 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1010 }
1011}
1012
1013impl fidl::endpoints::Responder for UtilGetEnvironmentCountResponder {
1014 type ControlHandle = UtilControlHandle;
1015
1016 fn control_handle(&self) -> &UtilControlHandle {
1017 &self.control_handle
1018 }
1019
1020 fn drop_without_shutdown(mut self) {
1021 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1023 std::mem::forget(self);
1025 }
1026}
1027
1028impl UtilGetEnvironmentCountResponder {
1029 pub fn send(self, mut count: u64) -> Result<(), fidl::Error> {
1033 let _result = self.send_raw(count);
1034 if _result.is_err() {
1035 self.control_handle.shutdown();
1036 }
1037 self.drop_without_shutdown();
1038 _result
1039 }
1040
1041 pub fn send_no_shutdown_on_err(self, mut count: u64) -> Result<(), fidl::Error> {
1043 let _result = self.send_raw(count);
1044 self.drop_without_shutdown();
1045 _result
1046 }
1047
1048 fn send_raw(&self, mut count: u64) -> Result<(), fidl::Error> {
1049 self.control_handle.inner.send::<UtilGetEnvironmentCountResponse>(
1050 (count,),
1051 self.tx_id,
1052 0xe01fe768fb1be1a,
1053 fidl::encoding::DynamicFlags::empty(),
1054 )
1055 }
1056}
1057
1058#[must_use = "FIDL methods require a response to be sent"]
1059#[derive(Debug)]
1060pub struct UtilDumpNamespaceResponder {
1061 control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
1062 tx_id: u32,
1063}
1064
1065impl std::ops::Drop for UtilDumpNamespaceResponder {
1069 fn drop(&mut self) {
1070 self.control_handle.shutdown();
1071 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1073 }
1074}
1075
1076impl fidl::endpoints::Responder for UtilDumpNamespaceResponder {
1077 type ControlHandle = UtilControlHandle;
1078
1079 fn control_handle(&self) -> &UtilControlHandle {
1080 &self.control_handle
1081 }
1082
1083 fn drop_without_shutdown(mut self) {
1084 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1086 std::mem::forget(self);
1088 }
1089}
1090
1091impl UtilDumpNamespaceResponder {
1092 pub fn send(self, mut contents: &str) -> Result<(), fidl::Error> {
1096 let _result = self.send_raw(contents);
1097 if _result.is_err() {
1098 self.control_handle.shutdown();
1099 }
1100 self.drop_without_shutdown();
1101 _result
1102 }
1103
1104 pub fn send_no_shutdown_on_err(self, mut contents: &str) -> Result<(), fidl::Error> {
1106 let _result = self.send_raw(contents);
1107 self.drop_without_shutdown();
1108 _result
1109 }
1110
1111 fn send_raw(&self, mut contents: &str) -> Result<(), fidl::Error> {
1112 self.control_handle.inner.send::<UtilDumpNamespaceResponse>(
1113 (contents,),
1114 self.tx_id,
1115 0x73826cecc1a7f3a4,
1116 fidl::encoding::DynamicFlags::empty(),
1117 )
1118 }
1119}
1120
1121#[must_use = "FIDL methods require a response to be sent"]
1122#[derive(Debug)]
1123pub struct UtilReadFileResponder {
1124 control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
1125 tx_id: u32,
1126}
1127
1128impl std::ops::Drop for UtilReadFileResponder {
1132 fn drop(&mut self) {
1133 self.control_handle.shutdown();
1134 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1136 }
1137}
1138
1139impl fidl::endpoints::Responder for UtilReadFileResponder {
1140 type ControlHandle = UtilControlHandle;
1141
1142 fn control_handle(&self) -> &UtilControlHandle {
1143 &self.control_handle
1144 }
1145
1146 fn drop_without_shutdown(mut self) {
1147 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1149 std::mem::forget(self);
1151 }
1152}
1153
1154impl UtilReadFileResponder {
1155 pub fn send(self, mut contents: &str) -> Result<(), fidl::Error> {
1159 let _result = self.send_raw(contents);
1160 if _result.is_err() {
1161 self.control_handle.shutdown();
1162 }
1163 self.drop_without_shutdown();
1164 _result
1165 }
1166
1167 pub fn send_no_shutdown_on_err(self, mut contents: &str) -> Result<(), fidl::Error> {
1169 let _result = self.send_raw(contents);
1170 self.drop_without_shutdown();
1171 _result
1172 }
1173
1174 fn send_raw(&self, mut contents: &str) -> Result<(), fidl::Error> {
1175 self.control_handle.inner.send::<UtilReadFileResponse>(
1176 (contents,),
1177 self.tx_id,
1178 0x2ea8e2e4b427a391,
1179 fidl::encoding::DynamicFlags::empty(),
1180 )
1181 }
1182}
1183
1184#[must_use = "FIDL methods require a response to be sent"]
1185#[derive(Debug)]
1186pub struct UtilGetLifecycleKoidResponder {
1187 control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
1188 tx_id: u32,
1189}
1190
1191impl std::ops::Drop for UtilGetLifecycleKoidResponder {
1195 fn drop(&mut self) {
1196 self.control_handle.shutdown();
1197 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1199 }
1200}
1201
1202impl fidl::endpoints::Responder for UtilGetLifecycleKoidResponder {
1203 type ControlHandle = UtilControlHandle;
1204
1205 fn control_handle(&self) -> &UtilControlHandle {
1206 &self.control_handle
1207 }
1208
1209 fn drop_without_shutdown(mut self) {
1210 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1212 std::mem::forget(self);
1214 }
1215}
1216
1217impl UtilGetLifecycleKoidResponder {
1218 pub fn send(self, mut koid: u64) -> Result<(), fidl::Error> {
1222 let _result = self.send_raw(koid);
1223 if _result.is_err() {
1224 self.control_handle.shutdown();
1225 }
1226 self.drop_without_shutdown();
1227 _result
1228 }
1229
1230 pub fn send_no_shutdown_on_err(self, mut koid: u64) -> Result<(), fidl::Error> {
1232 let _result = self.send_raw(koid);
1233 self.drop_without_shutdown();
1234 _result
1235 }
1236
1237 fn send_raw(&self, mut koid: u64) -> Result<(), fidl::Error> {
1238 self.control_handle.inner.send::<UtilGetLifecycleKoidResponse>(
1239 (koid,),
1240 self.tx_id,
1241 0xdaecfc0fe4c8f60,
1242 fidl::encoding::DynamicFlags::empty(),
1243 )
1244 }
1245}
1246
1247mod internal {
1248 use super::*;
1249}