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_fuchsia_driver_playground_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ToolRunnerRunToolRequest {
16 pub tool: String,
18 pub args: Option<Vec<String>>,
20 pub stdio_params: StdioParams,
22 pub close_controller: fidl::endpoints::ServerEnd<CloseControllerMarker>,
24}
25
26impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ToolRunnerRunToolRequest {}
27
28#[derive(Debug, Default, PartialEq)]
29pub struct StdioParams {
30 pub standard_in: Option<fidl::Socket>,
31 pub standard_out: Option<fidl::Socket>,
32 pub standard_err: Option<fidl::Socket>,
33 #[doc(hidden)]
34 pub __source_breaking: fidl::marker::SourceBreaking,
35}
36
37impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StdioParams {}
38
39#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
40pub struct CloseControllerMarker;
41
42impl fidl::endpoints::ProtocolMarker for CloseControllerMarker {
43 type Proxy = CloseControllerProxy;
44 type RequestStream = CloseControllerRequestStream;
45 #[cfg(target_os = "fuchsia")]
46 type SynchronousProxy = CloseControllerSynchronousProxy;
47
48 const DEBUG_NAME: &'static str = "(anonymous) CloseController";
49}
50
51pub trait CloseControllerProxyInterface: Send + Sync {}
52#[derive(Debug)]
53#[cfg(target_os = "fuchsia")]
54pub struct CloseControllerSynchronousProxy {
55 client: fidl::client::sync::Client,
56}
57
58#[cfg(target_os = "fuchsia")]
59impl fidl::endpoints::SynchronousProxy for CloseControllerSynchronousProxy {
60 type Proxy = CloseControllerProxy;
61 type Protocol = CloseControllerMarker;
62
63 fn from_channel(inner: fidl::Channel) -> Self {
64 Self::new(inner)
65 }
66
67 fn into_channel(self) -> fidl::Channel {
68 self.client.into_channel()
69 }
70
71 fn as_channel(&self) -> &fidl::Channel {
72 self.client.as_channel()
73 }
74}
75
76#[cfg(target_os = "fuchsia")]
77impl CloseControllerSynchronousProxy {
78 pub fn new(channel: fidl::Channel) -> Self {
79 let protocol_name = <CloseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
80 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
81 }
82
83 pub fn into_channel(self) -> fidl::Channel {
84 self.client.into_channel()
85 }
86
87 pub fn wait_for_event(
90 &self,
91 deadline: zx::MonotonicInstant,
92 ) -> Result<CloseControllerEvent, fidl::Error> {
93 CloseControllerEvent::decode(self.client.wait_for_event(deadline)?)
94 }
95}
96
97#[cfg(target_os = "fuchsia")]
98impl From<CloseControllerSynchronousProxy> for zx::Handle {
99 fn from(value: CloseControllerSynchronousProxy) -> Self {
100 value.into_channel().into()
101 }
102}
103
104#[cfg(target_os = "fuchsia")]
105impl From<fidl::Channel> for CloseControllerSynchronousProxy {
106 fn from(value: fidl::Channel) -> Self {
107 Self::new(value)
108 }
109}
110
111#[derive(Debug, Clone)]
112pub struct CloseControllerProxy {
113 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
114}
115
116impl fidl::endpoints::Proxy for CloseControllerProxy {
117 type Protocol = CloseControllerMarker;
118
119 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
120 Self::new(inner)
121 }
122
123 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
124 self.client.into_channel().map_err(|client| Self { client })
125 }
126
127 fn as_channel(&self) -> &::fidl::AsyncChannel {
128 self.client.as_channel()
129 }
130}
131
132impl CloseControllerProxy {
133 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
135 let protocol_name = <CloseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
136 Self { client: fidl::client::Client::new(channel, protocol_name) }
137 }
138
139 pub fn take_event_stream(&self) -> CloseControllerEventStream {
145 CloseControllerEventStream { event_receiver: self.client.take_event_receiver() }
146 }
147}
148
149impl CloseControllerProxyInterface for CloseControllerProxy {}
150
151pub struct CloseControllerEventStream {
152 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
153}
154
155impl std::marker::Unpin for CloseControllerEventStream {}
156
157impl futures::stream::FusedStream for CloseControllerEventStream {
158 fn is_terminated(&self) -> bool {
159 self.event_receiver.is_terminated()
160 }
161}
162
163impl futures::Stream for CloseControllerEventStream {
164 type Item = Result<CloseControllerEvent, fidl::Error>;
165
166 fn poll_next(
167 mut self: std::pin::Pin<&mut Self>,
168 cx: &mut std::task::Context<'_>,
169 ) -> std::task::Poll<Option<Self::Item>> {
170 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
171 &mut self.event_receiver,
172 cx
173 )?) {
174 Some(buf) => std::task::Poll::Ready(Some(CloseControllerEvent::decode(buf))),
175 None => std::task::Poll::Ready(None),
176 }
177 }
178}
179
180#[derive(Debug)]
181pub enum CloseControllerEvent {
182 OnTerminated { return_code: i32 },
183}
184
185impl CloseControllerEvent {
186 #[allow(irrefutable_let_patterns)]
187 pub fn into_on_terminated(self) -> Option<i32> {
188 if let CloseControllerEvent::OnTerminated { return_code } = self {
189 Some((return_code))
190 } else {
191 None
192 }
193 }
194
195 fn decode(
197 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
198 ) -> Result<CloseControllerEvent, fidl::Error> {
199 let (bytes, _handles) = buf.split_mut();
200 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
201 debug_assert_eq!(tx_header.tx_id, 0);
202 match tx_header.ordinal {
203 0x23d595be4577ece0 => {
204 let mut out = fidl::new_empty!(
205 CloseControllerOnTerminatedRequest,
206 fidl::encoding::DefaultFuchsiaResourceDialect
207 );
208 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CloseControllerOnTerminatedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
209 Ok((CloseControllerEvent::OnTerminated { return_code: out.return_code }))
210 }
211 _ => Err(fidl::Error::UnknownOrdinal {
212 ordinal: tx_header.ordinal,
213 protocol_name:
214 <CloseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
215 }),
216 }
217 }
218}
219
220pub struct CloseControllerRequestStream {
222 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
223 is_terminated: bool,
224}
225
226impl std::marker::Unpin for CloseControllerRequestStream {}
227
228impl futures::stream::FusedStream for CloseControllerRequestStream {
229 fn is_terminated(&self) -> bool {
230 self.is_terminated
231 }
232}
233
234impl fidl::endpoints::RequestStream for CloseControllerRequestStream {
235 type Protocol = CloseControllerMarker;
236 type ControlHandle = CloseControllerControlHandle;
237
238 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
239 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
240 }
241
242 fn control_handle(&self) -> Self::ControlHandle {
243 CloseControllerControlHandle { inner: self.inner.clone() }
244 }
245
246 fn into_inner(
247 self,
248 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
249 {
250 (self.inner, self.is_terminated)
251 }
252
253 fn from_inner(
254 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
255 is_terminated: bool,
256 ) -> Self {
257 Self { inner, is_terminated }
258 }
259}
260
261impl futures::Stream for CloseControllerRequestStream {
262 type Item = Result<CloseControllerRequest, fidl::Error>;
263
264 fn poll_next(
265 mut self: std::pin::Pin<&mut Self>,
266 cx: &mut std::task::Context<'_>,
267 ) -> std::task::Poll<Option<Self::Item>> {
268 let this = &mut *self;
269 if this.inner.check_shutdown(cx) {
270 this.is_terminated = true;
271 return std::task::Poll::Ready(None);
272 }
273 if this.is_terminated {
274 panic!("polled CloseControllerRequestStream after completion");
275 }
276 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
277 |bytes, handles| {
278 match this.inner.channel().read_etc(cx, bytes, handles) {
279 std::task::Poll::Ready(Ok(())) => {}
280 std::task::Poll::Pending => return std::task::Poll::Pending,
281 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
282 this.is_terminated = true;
283 return std::task::Poll::Ready(None);
284 }
285 std::task::Poll::Ready(Err(e)) => {
286 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
287 e.into(),
288 ))))
289 }
290 }
291
292 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
294
295 std::task::Poll::Ready(Some(match header.ordinal {
296 _ => Err(fidl::Error::UnknownOrdinal {
297 ordinal: header.ordinal,
298 protocol_name:
299 <CloseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
300 }),
301 }))
302 },
303 )
304 }
305}
306
307#[derive(Debug)]
309pub enum CloseControllerRequest {}
310
311impl CloseControllerRequest {
312 pub fn method_name(&self) -> &'static str {
314 match *self {}
315 }
316}
317
318#[derive(Debug, Clone)]
319pub struct CloseControllerControlHandle {
320 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
321}
322
323impl fidl::endpoints::ControlHandle for CloseControllerControlHandle {
324 fn shutdown(&self) {
325 self.inner.shutdown()
326 }
327 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
328 self.inner.shutdown_with_epitaph(status)
329 }
330
331 fn is_closed(&self) -> bool {
332 self.inner.channel().is_closed()
333 }
334 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
335 self.inner.channel().on_closed()
336 }
337
338 #[cfg(target_os = "fuchsia")]
339 fn signal_peer(
340 &self,
341 clear_mask: zx::Signals,
342 set_mask: zx::Signals,
343 ) -> Result<(), zx_status::Status> {
344 use fidl::Peered;
345 self.inner.channel().signal_peer(clear_mask, set_mask)
346 }
347}
348
349impl CloseControllerControlHandle {
350 pub fn send_on_terminated(&self, mut return_code: i32) -> Result<(), fidl::Error> {
351 self.inner.send::<CloseControllerOnTerminatedRequest>(
352 (return_code,),
353 0,
354 0x23d595be4577ece0,
355 fidl::encoding::DynamicFlags::empty(),
356 )
357 }
358}
359
360#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
361pub struct ToolRunnerMarker;
362
363impl fidl::endpoints::ProtocolMarker for ToolRunnerMarker {
364 type Proxy = ToolRunnerProxy;
365 type RequestStream = ToolRunnerRequestStream;
366 #[cfg(target_os = "fuchsia")]
367 type SynchronousProxy = ToolRunnerSynchronousProxy;
368
369 const DEBUG_NAME: &'static str = "fuchsia.driver.playground.ToolRunner";
370}
371impl fidl::endpoints::DiscoverableProtocolMarker for ToolRunnerMarker {}
372pub type ToolRunnerRunToolResult = Result<(), i32>;
373
374pub trait ToolRunnerProxyInterface: Send + Sync {
375 type RunToolResponseFut: std::future::Future<Output = Result<ToolRunnerRunToolResult, fidl::Error>>
376 + Send;
377 fn r#run_tool(
378 &self,
379 tool: &str,
380 args: Option<&[String]>,
381 stdio_params: StdioParams,
382 close_controller: fidl::endpoints::ServerEnd<CloseControllerMarker>,
383 ) -> Self::RunToolResponseFut;
384}
385#[derive(Debug)]
386#[cfg(target_os = "fuchsia")]
387pub struct ToolRunnerSynchronousProxy {
388 client: fidl::client::sync::Client,
389}
390
391#[cfg(target_os = "fuchsia")]
392impl fidl::endpoints::SynchronousProxy for ToolRunnerSynchronousProxy {
393 type Proxy = ToolRunnerProxy;
394 type Protocol = ToolRunnerMarker;
395
396 fn from_channel(inner: fidl::Channel) -> Self {
397 Self::new(inner)
398 }
399
400 fn into_channel(self) -> fidl::Channel {
401 self.client.into_channel()
402 }
403
404 fn as_channel(&self) -> &fidl::Channel {
405 self.client.as_channel()
406 }
407}
408
409#[cfg(target_os = "fuchsia")]
410impl ToolRunnerSynchronousProxy {
411 pub fn new(channel: fidl::Channel) -> Self {
412 let protocol_name = <ToolRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
413 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
414 }
415
416 pub fn into_channel(self) -> fidl::Channel {
417 self.client.into_channel()
418 }
419
420 pub fn wait_for_event(
423 &self,
424 deadline: zx::MonotonicInstant,
425 ) -> Result<ToolRunnerEvent, fidl::Error> {
426 ToolRunnerEvent::decode(self.client.wait_for_event(deadline)?)
427 }
428
429 pub fn r#run_tool(
431 &self,
432 mut tool: &str,
433 mut args: Option<&[String]>,
434 mut stdio_params: StdioParams,
435 mut close_controller: fidl::endpoints::ServerEnd<CloseControllerMarker>,
436 ___deadline: zx::MonotonicInstant,
437 ) -> Result<ToolRunnerRunToolResult, fidl::Error> {
438 let _response = self.client.send_query::<
439 ToolRunnerRunToolRequest,
440 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
441 >(
442 (tool, args, &mut stdio_params, close_controller,),
443 0x6b25aa05c43aaf3e,
444 fidl::encoding::DynamicFlags::empty(),
445 ___deadline,
446 )?;
447 Ok(_response.map(|x| x))
448 }
449}
450
451#[cfg(target_os = "fuchsia")]
452impl From<ToolRunnerSynchronousProxy> for zx::Handle {
453 fn from(value: ToolRunnerSynchronousProxy) -> Self {
454 value.into_channel().into()
455 }
456}
457
458#[cfg(target_os = "fuchsia")]
459impl From<fidl::Channel> for ToolRunnerSynchronousProxy {
460 fn from(value: fidl::Channel) -> Self {
461 Self::new(value)
462 }
463}
464
465#[derive(Debug, Clone)]
466pub struct ToolRunnerProxy {
467 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
468}
469
470impl fidl::endpoints::Proxy for ToolRunnerProxy {
471 type Protocol = ToolRunnerMarker;
472
473 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
474 Self::new(inner)
475 }
476
477 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
478 self.client.into_channel().map_err(|client| Self { client })
479 }
480
481 fn as_channel(&self) -> &::fidl::AsyncChannel {
482 self.client.as_channel()
483 }
484}
485
486impl ToolRunnerProxy {
487 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
489 let protocol_name = <ToolRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
490 Self { client: fidl::client::Client::new(channel, protocol_name) }
491 }
492
493 pub fn take_event_stream(&self) -> ToolRunnerEventStream {
499 ToolRunnerEventStream { event_receiver: self.client.take_event_receiver() }
500 }
501
502 pub fn r#run_tool(
504 &self,
505 mut tool: &str,
506 mut args: Option<&[String]>,
507 mut stdio_params: StdioParams,
508 mut close_controller: fidl::endpoints::ServerEnd<CloseControllerMarker>,
509 ) -> fidl::client::QueryResponseFut<
510 ToolRunnerRunToolResult,
511 fidl::encoding::DefaultFuchsiaResourceDialect,
512 > {
513 ToolRunnerProxyInterface::r#run_tool(self, tool, args, stdio_params, close_controller)
514 }
515}
516
517impl ToolRunnerProxyInterface for ToolRunnerProxy {
518 type RunToolResponseFut = fidl::client::QueryResponseFut<
519 ToolRunnerRunToolResult,
520 fidl::encoding::DefaultFuchsiaResourceDialect,
521 >;
522 fn r#run_tool(
523 &self,
524 mut tool: &str,
525 mut args: Option<&[String]>,
526 mut stdio_params: StdioParams,
527 mut close_controller: fidl::endpoints::ServerEnd<CloseControllerMarker>,
528 ) -> Self::RunToolResponseFut {
529 fn _decode(
530 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
531 ) -> Result<ToolRunnerRunToolResult, fidl::Error> {
532 let _response = fidl::client::decode_transaction_body::<
533 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
534 fidl::encoding::DefaultFuchsiaResourceDialect,
535 0x6b25aa05c43aaf3e,
536 >(_buf?)?;
537 Ok(_response.map(|x| x))
538 }
539 self.client.send_query_and_decode::<ToolRunnerRunToolRequest, ToolRunnerRunToolResult>(
540 (tool, args, &mut stdio_params, close_controller),
541 0x6b25aa05c43aaf3e,
542 fidl::encoding::DynamicFlags::empty(),
543 _decode,
544 )
545 }
546}
547
548pub struct ToolRunnerEventStream {
549 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
550}
551
552impl std::marker::Unpin for ToolRunnerEventStream {}
553
554impl futures::stream::FusedStream for ToolRunnerEventStream {
555 fn is_terminated(&self) -> bool {
556 self.event_receiver.is_terminated()
557 }
558}
559
560impl futures::Stream for ToolRunnerEventStream {
561 type Item = Result<ToolRunnerEvent, fidl::Error>;
562
563 fn poll_next(
564 mut self: std::pin::Pin<&mut Self>,
565 cx: &mut std::task::Context<'_>,
566 ) -> std::task::Poll<Option<Self::Item>> {
567 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
568 &mut self.event_receiver,
569 cx
570 )?) {
571 Some(buf) => std::task::Poll::Ready(Some(ToolRunnerEvent::decode(buf))),
572 None => std::task::Poll::Ready(None),
573 }
574 }
575}
576
577#[derive(Debug)]
578pub enum ToolRunnerEvent {}
579
580impl ToolRunnerEvent {
581 fn decode(
583 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
584 ) -> Result<ToolRunnerEvent, fidl::Error> {
585 let (bytes, _handles) = buf.split_mut();
586 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
587 debug_assert_eq!(tx_header.tx_id, 0);
588 match tx_header.ordinal {
589 _ => Err(fidl::Error::UnknownOrdinal {
590 ordinal: tx_header.ordinal,
591 protocol_name: <ToolRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
592 }),
593 }
594 }
595}
596
597pub struct ToolRunnerRequestStream {
599 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
600 is_terminated: bool,
601}
602
603impl std::marker::Unpin for ToolRunnerRequestStream {}
604
605impl futures::stream::FusedStream for ToolRunnerRequestStream {
606 fn is_terminated(&self) -> bool {
607 self.is_terminated
608 }
609}
610
611impl fidl::endpoints::RequestStream for ToolRunnerRequestStream {
612 type Protocol = ToolRunnerMarker;
613 type ControlHandle = ToolRunnerControlHandle;
614
615 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
616 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
617 }
618
619 fn control_handle(&self) -> Self::ControlHandle {
620 ToolRunnerControlHandle { inner: self.inner.clone() }
621 }
622
623 fn into_inner(
624 self,
625 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
626 {
627 (self.inner, self.is_terminated)
628 }
629
630 fn from_inner(
631 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
632 is_terminated: bool,
633 ) -> Self {
634 Self { inner, is_terminated }
635 }
636}
637
638impl futures::Stream for ToolRunnerRequestStream {
639 type Item = Result<ToolRunnerRequest, fidl::Error>;
640
641 fn poll_next(
642 mut self: std::pin::Pin<&mut Self>,
643 cx: &mut std::task::Context<'_>,
644 ) -> std::task::Poll<Option<Self::Item>> {
645 let this = &mut *self;
646 if this.inner.check_shutdown(cx) {
647 this.is_terminated = true;
648 return std::task::Poll::Ready(None);
649 }
650 if this.is_terminated {
651 panic!("polled ToolRunnerRequestStream after completion");
652 }
653 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
654 |bytes, handles| {
655 match this.inner.channel().read_etc(cx, bytes, handles) {
656 std::task::Poll::Ready(Ok(())) => {}
657 std::task::Poll::Pending => return std::task::Poll::Pending,
658 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
659 this.is_terminated = true;
660 return std::task::Poll::Ready(None);
661 }
662 std::task::Poll::Ready(Err(e)) => {
663 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
664 e.into(),
665 ))))
666 }
667 }
668
669 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
671
672 std::task::Poll::Ready(Some(match header.ordinal {
673 0x6b25aa05c43aaf3e => {
674 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
675 let mut req = fidl::new_empty!(
676 ToolRunnerRunToolRequest,
677 fidl::encoding::DefaultFuchsiaResourceDialect
678 );
679 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ToolRunnerRunToolRequest>(&header, _body_bytes, handles, &mut req)?;
680 let control_handle = ToolRunnerControlHandle { inner: this.inner.clone() };
681 Ok(ToolRunnerRequest::RunTool {
682 tool: req.tool,
683 args: req.args,
684 stdio_params: req.stdio_params,
685 close_controller: req.close_controller,
686
687 responder: ToolRunnerRunToolResponder {
688 control_handle: std::mem::ManuallyDrop::new(control_handle),
689 tx_id: header.tx_id,
690 },
691 })
692 }
693 _ => Err(fidl::Error::UnknownOrdinal {
694 ordinal: header.ordinal,
695 protocol_name:
696 <ToolRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
697 }),
698 }))
699 },
700 )
701 }
702}
703
704#[derive(Debug)]
706pub enum ToolRunnerRequest {
707 RunTool {
709 tool: String,
710 args: Option<Vec<String>>,
711 stdio_params: StdioParams,
712 close_controller: fidl::endpoints::ServerEnd<CloseControllerMarker>,
713 responder: ToolRunnerRunToolResponder,
714 },
715}
716
717impl ToolRunnerRequest {
718 #[allow(irrefutable_let_patterns)]
719 pub fn into_run_tool(
720 self,
721 ) -> Option<(
722 String,
723 Option<Vec<String>>,
724 StdioParams,
725 fidl::endpoints::ServerEnd<CloseControllerMarker>,
726 ToolRunnerRunToolResponder,
727 )> {
728 if let ToolRunnerRequest::RunTool {
729 tool,
730 args,
731 stdio_params,
732 close_controller,
733 responder,
734 } = self
735 {
736 Some((tool, args, stdio_params, close_controller, responder))
737 } else {
738 None
739 }
740 }
741
742 pub fn method_name(&self) -> &'static str {
744 match *self {
745 ToolRunnerRequest::RunTool { .. } => "run_tool",
746 }
747 }
748}
749
750#[derive(Debug, Clone)]
751pub struct ToolRunnerControlHandle {
752 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
753}
754
755impl fidl::endpoints::ControlHandle for ToolRunnerControlHandle {
756 fn shutdown(&self) {
757 self.inner.shutdown()
758 }
759 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
760 self.inner.shutdown_with_epitaph(status)
761 }
762
763 fn is_closed(&self) -> bool {
764 self.inner.channel().is_closed()
765 }
766 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
767 self.inner.channel().on_closed()
768 }
769
770 #[cfg(target_os = "fuchsia")]
771 fn signal_peer(
772 &self,
773 clear_mask: zx::Signals,
774 set_mask: zx::Signals,
775 ) -> Result<(), zx_status::Status> {
776 use fidl::Peered;
777 self.inner.channel().signal_peer(clear_mask, set_mask)
778 }
779}
780
781impl ToolRunnerControlHandle {}
782
783#[must_use = "FIDL methods require a response to be sent"]
784#[derive(Debug)]
785pub struct ToolRunnerRunToolResponder {
786 control_handle: std::mem::ManuallyDrop<ToolRunnerControlHandle>,
787 tx_id: u32,
788}
789
790impl std::ops::Drop for ToolRunnerRunToolResponder {
794 fn drop(&mut self) {
795 self.control_handle.shutdown();
796 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
798 }
799}
800
801impl fidl::endpoints::Responder for ToolRunnerRunToolResponder {
802 type ControlHandle = ToolRunnerControlHandle;
803
804 fn control_handle(&self) -> &ToolRunnerControlHandle {
805 &self.control_handle
806 }
807
808 fn drop_without_shutdown(mut self) {
809 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
811 std::mem::forget(self);
813 }
814}
815
816impl ToolRunnerRunToolResponder {
817 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
821 let _result = self.send_raw(result);
822 if _result.is_err() {
823 self.control_handle.shutdown();
824 }
825 self.drop_without_shutdown();
826 _result
827 }
828
829 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
831 let _result = self.send_raw(result);
832 self.drop_without_shutdown();
833 _result
834 }
835
836 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
837 self.control_handle
838 .inner
839 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
840 result,
841 self.tx_id,
842 0x6b25aa05c43aaf3e,
843 fidl::encoding::DynamicFlags::empty(),
844 )
845 }
846}
847
848mod internal {
849 use super::*;
850
851 impl fidl::encoding::ResourceTypeMarker for ToolRunnerRunToolRequest {
852 type Borrowed<'a> = &'a mut Self;
853 fn take_or_borrow<'a>(
854 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
855 ) -> Self::Borrowed<'a> {
856 value
857 }
858 }
859
860 unsafe impl fidl::encoding::TypeMarker for ToolRunnerRunToolRequest {
861 type Owned = Self;
862
863 #[inline(always)]
864 fn inline_align(_context: fidl::encoding::Context) -> usize {
865 8
866 }
867
868 #[inline(always)]
869 fn inline_size(_context: fidl::encoding::Context) -> usize {
870 56
871 }
872 }
873
874 unsafe impl
875 fidl::encoding::Encode<
876 ToolRunnerRunToolRequest,
877 fidl::encoding::DefaultFuchsiaResourceDialect,
878 > for &mut ToolRunnerRunToolRequest
879 {
880 #[inline]
881 unsafe fn encode(
882 self,
883 encoder: &mut fidl::encoding::Encoder<
884 '_,
885 fidl::encoding::DefaultFuchsiaResourceDialect,
886 >,
887 offset: usize,
888 _depth: fidl::encoding::Depth,
889 ) -> fidl::Result<()> {
890 encoder.debug_check_bounds::<ToolRunnerRunToolRequest>(offset);
891 fidl::encoding::Encode::<ToolRunnerRunToolRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
893 (
894 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool),
895 <fidl::encoding::Optional<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 256>> as fidl::encoding::ValueTypeMarker>::borrow(&self.args),
896 <StdioParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stdio_params),
897 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CloseControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.close_controller),
898 ),
899 encoder, offset, _depth
900 )
901 }
902 }
903 unsafe impl<
904 T0: fidl::encoding::Encode<
905 fidl::encoding::BoundedString<4096>,
906 fidl::encoding::DefaultFuchsiaResourceDialect,
907 >,
908 T1: fidl::encoding::Encode<
909 fidl::encoding::Optional<
910 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 256>,
911 >,
912 fidl::encoding::DefaultFuchsiaResourceDialect,
913 >,
914 T2: fidl::encoding::Encode<StdioParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
915 T3: fidl::encoding::Encode<
916 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CloseControllerMarker>>,
917 fidl::encoding::DefaultFuchsiaResourceDialect,
918 >,
919 >
920 fidl::encoding::Encode<
921 ToolRunnerRunToolRequest,
922 fidl::encoding::DefaultFuchsiaResourceDialect,
923 > for (T0, T1, T2, T3)
924 {
925 #[inline]
926 unsafe fn encode(
927 self,
928 encoder: &mut fidl::encoding::Encoder<
929 '_,
930 fidl::encoding::DefaultFuchsiaResourceDialect,
931 >,
932 offset: usize,
933 depth: fidl::encoding::Depth,
934 ) -> fidl::Result<()> {
935 encoder.debug_check_bounds::<ToolRunnerRunToolRequest>(offset);
936 unsafe {
939 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
940 (ptr as *mut u64).write_unaligned(0);
941 }
942 self.0.encode(encoder, offset + 0, depth)?;
944 self.1.encode(encoder, offset + 16, depth)?;
945 self.2.encode(encoder, offset + 32, depth)?;
946 self.3.encode(encoder, offset + 48, depth)?;
947 Ok(())
948 }
949 }
950
951 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
952 for ToolRunnerRunToolRequest
953 {
954 #[inline(always)]
955 fn new_empty() -> Self {
956 Self {
957 tool: fidl::new_empty!(
958 fidl::encoding::BoundedString<4096>,
959 fidl::encoding::DefaultFuchsiaResourceDialect
960 ),
961 args: fidl::new_empty!(
962 fidl::encoding::Optional<
963 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 256>,
964 >,
965 fidl::encoding::DefaultFuchsiaResourceDialect
966 ),
967 stdio_params: fidl::new_empty!(
968 StdioParams,
969 fidl::encoding::DefaultFuchsiaResourceDialect
970 ),
971 close_controller: fidl::new_empty!(
972 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CloseControllerMarker>>,
973 fidl::encoding::DefaultFuchsiaResourceDialect
974 ),
975 }
976 }
977
978 #[inline]
979 unsafe fn decode(
980 &mut self,
981 decoder: &mut fidl::encoding::Decoder<
982 '_,
983 fidl::encoding::DefaultFuchsiaResourceDialect,
984 >,
985 offset: usize,
986 _depth: fidl::encoding::Depth,
987 ) -> fidl::Result<()> {
988 decoder.debug_check_bounds::<Self>(offset);
989 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
991 let padval = unsafe { (ptr as *const u64).read_unaligned() };
992 let mask = 0xffffffff00000000u64;
993 let maskedval = padval & mask;
994 if maskedval != 0 {
995 return Err(fidl::Error::NonZeroPadding {
996 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
997 });
998 }
999 fidl::decode!(
1000 fidl::encoding::BoundedString<4096>,
1001 fidl::encoding::DefaultFuchsiaResourceDialect,
1002 &mut self.tool,
1003 decoder,
1004 offset + 0,
1005 _depth
1006 )?;
1007 fidl::decode!(
1008 fidl::encoding::Optional<
1009 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 256>,
1010 >,
1011 fidl::encoding::DefaultFuchsiaResourceDialect,
1012 &mut self.args,
1013 decoder,
1014 offset + 16,
1015 _depth
1016 )?;
1017 fidl::decode!(
1018 StdioParams,
1019 fidl::encoding::DefaultFuchsiaResourceDialect,
1020 &mut self.stdio_params,
1021 decoder,
1022 offset + 32,
1023 _depth
1024 )?;
1025 fidl::decode!(
1026 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CloseControllerMarker>>,
1027 fidl::encoding::DefaultFuchsiaResourceDialect,
1028 &mut self.close_controller,
1029 decoder,
1030 offset + 48,
1031 _depth
1032 )?;
1033 Ok(())
1034 }
1035 }
1036
1037 impl StdioParams {
1038 #[inline(always)]
1039 fn max_ordinal_present(&self) -> u64 {
1040 if let Some(_) = self.standard_err {
1041 return 3;
1042 }
1043 if let Some(_) = self.standard_out {
1044 return 2;
1045 }
1046 if let Some(_) = self.standard_in {
1047 return 1;
1048 }
1049 0
1050 }
1051 }
1052
1053 impl fidl::encoding::ResourceTypeMarker for StdioParams {
1054 type Borrowed<'a> = &'a mut Self;
1055 fn take_or_borrow<'a>(
1056 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1057 ) -> Self::Borrowed<'a> {
1058 value
1059 }
1060 }
1061
1062 unsafe impl fidl::encoding::TypeMarker for StdioParams {
1063 type Owned = Self;
1064
1065 #[inline(always)]
1066 fn inline_align(_context: fidl::encoding::Context) -> usize {
1067 8
1068 }
1069
1070 #[inline(always)]
1071 fn inline_size(_context: fidl::encoding::Context) -> usize {
1072 16
1073 }
1074 }
1075
1076 unsafe impl fidl::encoding::Encode<StdioParams, fidl::encoding::DefaultFuchsiaResourceDialect>
1077 for &mut StdioParams
1078 {
1079 unsafe fn encode(
1080 self,
1081 encoder: &mut fidl::encoding::Encoder<
1082 '_,
1083 fidl::encoding::DefaultFuchsiaResourceDialect,
1084 >,
1085 offset: usize,
1086 mut depth: fidl::encoding::Depth,
1087 ) -> fidl::Result<()> {
1088 encoder.debug_check_bounds::<StdioParams>(offset);
1089 let max_ordinal: u64 = self.max_ordinal_present();
1091 encoder.write_num(max_ordinal, offset);
1092 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1093 if max_ordinal == 0 {
1095 return Ok(());
1096 }
1097 depth.increment()?;
1098 let envelope_size = 8;
1099 let bytes_len = max_ordinal as usize * envelope_size;
1100 #[allow(unused_variables)]
1101 let offset = encoder.out_of_line_offset(bytes_len);
1102 let mut _prev_end_offset: usize = 0;
1103 if 1 > max_ordinal {
1104 return Ok(());
1105 }
1106
1107 let cur_offset: usize = (1 - 1) * envelope_size;
1110
1111 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1113
1114 fidl::encoding::encode_in_envelope_optional::<
1119 fidl::encoding::HandleType<
1120 fidl::Socket,
1121 { fidl::ObjectType::SOCKET.into_raw() },
1122 2147483648,
1123 >,
1124 fidl::encoding::DefaultFuchsiaResourceDialect,
1125 >(
1126 self.standard_in.as_mut().map(
1127 <fidl::encoding::HandleType<
1128 fidl::Socket,
1129 { fidl::ObjectType::SOCKET.into_raw() },
1130 2147483648,
1131 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
1132 ),
1133 encoder,
1134 offset + cur_offset,
1135 depth,
1136 )?;
1137
1138 _prev_end_offset = cur_offset + envelope_size;
1139 if 2 > max_ordinal {
1140 return Ok(());
1141 }
1142
1143 let cur_offset: usize = (2 - 1) * envelope_size;
1146
1147 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1149
1150 fidl::encoding::encode_in_envelope_optional::<
1155 fidl::encoding::HandleType<
1156 fidl::Socket,
1157 { fidl::ObjectType::SOCKET.into_raw() },
1158 2147483648,
1159 >,
1160 fidl::encoding::DefaultFuchsiaResourceDialect,
1161 >(
1162 self.standard_out.as_mut().map(
1163 <fidl::encoding::HandleType<
1164 fidl::Socket,
1165 { fidl::ObjectType::SOCKET.into_raw() },
1166 2147483648,
1167 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
1168 ),
1169 encoder,
1170 offset + cur_offset,
1171 depth,
1172 )?;
1173
1174 _prev_end_offset = cur_offset + envelope_size;
1175 if 3 > max_ordinal {
1176 return Ok(());
1177 }
1178
1179 let cur_offset: usize = (3 - 1) * envelope_size;
1182
1183 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1185
1186 fidl::encoding::encode_in_envelope_optional::<
1191 fidl::encoding::HandleType<
1192 fidl::Socket,
1193 { fidl::ObjectType::SOCKET.into_raw() },
1194 2147483648,
1195 >,
1196 fidl::encoding::DefaultFuchsiaResourceDialect,
1197 >(
1198 self.standard_err.as_mut().map(
1199 <fidl::encoding::HandleType<
1200 fidl::Socket,
1201 { fidl::ObjectType::SOCKET.into_raw() },
1202 2147483648,
1203 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
1204 ),
1205 encoder,
1206 offset + cur_offset,
1207 depth,
1208 )?;
1209
1210 _prev_end_offset = cur_offset + envelope_size;
1211
1212 Ok(())
1213 }
1214 }
1215
1216 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for StdioParams {
1217 #[inline(always)]
1218 fn new_empty() -> Self {
1219 Self::default()
1220 }
1221
1222 unsafe fn decode(
1223 &mut self,
1224 decoder: &mut fidl::encoding::Decoder<
1225 '_,
1226 fidl::encoding::DefaultFuchsiaResourceDialect,
1227 >,
1228 offset: usize,
1229 mut depth: fidl::encoding::Depth,
1230 ) -> fidl::Result<()> {
1231 decoder.debug_check_bounds::<Self>(offset);
1232 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1233 None => return Err(fidl::Error::NotNullable),
1234 Some(len) => len,
1235 };
1236 if len == 0 {
1238 return Ok(());
1239 };
1240 depth.increment()?;
1241 let envelope_size = 8;
1242 let bytes_len = len * envelope_size;
1243 let offset = decoder.out_of_line_offset(bytes_len)?;
1244 let mut _next_ordinal_to_read = 0;
1246 let mut next_offset = offset;
1247 let end_offset = offset + bytes_len;
1248 _next_ordinal_to_read += 1;
1249 if next_offset >= end_offset {
1250 return Ok(());
1251 }
1252
1253 while _next_ordinal_to_read < 1 {
1255 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1256 _next_ordinal_to_read += 1;
1257 next_offset += envelope_size;
1258 }
1259
1260 let next_out_of_line = decoder.next_out_of_line();
1261 let handles_before = decoder.remaining_handles();
1262 if let Some((inlined, num_bytes, num_handles)) =
1263 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1264 {
1265 let member_inline_size = <fidl::encoding::HandleType<
1266 fidl::Socket,
1267 { fidl::ObjectType::SOCKET.into_raw() },
1268 2147483648,
1269 > as fidl::encoding::TypeMarker>::inline_size(
1270 decoder.context
1271 );
1272 if inlined != (member_inline_size <= 4) {
1273 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1274 }
1275 let inner_offset;
1276 let mut inner_depth = depth.clone();
1277 if inlined {
1278 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1279 inner_offset = next_offset;
1280 } else {
1281 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1282 inner_depth.increment()?;
1283 }
1284 let val_ref =
1285 self.standard_in.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
1286 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
1287 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1288 {
1289 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1290 }
1291 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1292 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1293 }
1294 }
1295
1296 next_offset += envelope_size;
1297 _next_ordinal_to_read += 1;
1298 if next_offset >= end_offset {
1299 return Ok(());
1300 }
1301
1302 while _next_ordinal_to_read < 2 {
1304 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1305 _next_ordinal_to_read += 1;
1306 next_offset += envelope_size;
1307 }
1308
1309 let next_out_of_line = decoder.next_out_of_line();
1310 let handles_before = decoder.remaining_handles();
1311 if let Some((inlined, num_bytes, num_handles)) =
1312 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1313 {
1314 let member_inline_size = <fidl::encoding::HandleType<
1315 fidl::Socket,
1316 { fidl::ObjectType::SOCKET.into_raw() },
1317 2147483648,
1318 > as fidl::encoding::TypeMarker>::inline_size(
1319 decoder.context
1320 );
1321 if inlined != (member_inline_size <= 4) {
1322 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1323 }
1324 let inner_offset;
1325 let mut inner_depth = depth.clone();
1326 if inlined {
1327 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1328 inner_offset = next_offset;
1329 } else {
1330 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1331 inner_depth.increment()?;
1332 }
1333 let val_ref =
1334 self.standard_out.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
1335 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
1336 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1337 {
1338 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1339 }
1340 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1341 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1342 }
1343 }
1344
1345 next_offset += envelope_size;
1346 _next_ordinal_to_read += 1;
1347 if next_offset >= end_offset {
1348 return Ok(());
1349 }
1350
1351 while _next_ordinal_to_read < 3 {
1353 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1354 _next_ordinal_to_read += 1;
1355 next_offset += envelope_size;
1356 }
1357
1358 let next_out_of_line = decoder.next_out_of_line();
1359 let handles_before = decoder.remaining_handles();
1360 if let Some((inlined, num_bytes, num_handles)) =
1361 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1362 {
1363 let member_inline_size = <fidl::encoding::HandleType<
1364 fidl::Socket,
1365 { fidl::ObjectType::SOCKET.into_raw() },
1366 2147483648,
1367 > as fidl::encoding::TypeMarker>::inline_size(
1368 decoder.context
1369 );
1370 if inlined != (member_inline_size <= 4) {
1371 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1372 }
1373 let inner_offset;
1374 let mut inner_depth = depth.clone();
1375 if inlined {
1376 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1377 inner_offset = next_offset;
1378 } else {
1379 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1380 inner_depth.increment()?;
1381 }
1382 let val_ref =
1383 self.standard_err.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
1384 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
1385 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1386 {
1387 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1388 }
1389 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1390 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1391 }
1392 }
1393
1394 next_offset += envelope_size;
1395
1396 while next_offset < end_offset {
1398 _next_ordinal_to_read += 1;
1399 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1400 next_offset += envelope_size;
1401 }
1402
1403 Ok(())
1404 }
1405 }
1406}