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_diagnostics_validate__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct InspectPuppetGetConfigResponse {
16 pub printable_name: String,
17 pub options: Options,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for InspectPuppetGetConfigResponse
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct InspectPuppetInitializeTreeResponse {
27 pub tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
28 pub result: TestResult,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32 for InspectPuppetInitializeTreeResponse
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct InspectPuppetInitializeResponse {
38 pub vmo: Option<fidl::Handle>,
39 pub result: TestResult,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for InspectPuppetInitializeResponse
44{
45}
46
47#[derive(Debug, Default, PartialEq)]
48pub struct Options {
49 pub has_runner_node: Option<bool>,
51 pub diff_type: Option<DiffType>,
53 #[doc(hidden)]
54 pub __source_breaking: fidl::marker::SourceBreaking,
55}
56
57impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Options {}
58
59#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
60pub struct InspectPuppetMarker;
61
62impl fidl::endpoints::ProtocolMarker for InspectPuppetMarker {
63 type Proxy = InspectPuppetProxy;
64 type RequestStream = InspectPuppetRequestStream;
65 #[cfg(target_os = "fuchsia")]
66 type SynchronousProxy = InspectPuppetSynchronousProxy;
67
68 const DEBUG_NAME: &'static str = "diagnostics.validate.InspectPuppet";
69}
70impl fidl::endpoints::DiscoverableProtocolMarker for InspectPuppetMarker {}
71
72pub trait InspectPuppetProxyInterface: Send + Sync {
73 type InitializeResponseFut: std::future::Future<Output = Result<(Option<fidl::Handle>, TestResult), fidl::Error>>
74 + Send;
75 fn r#initialize(&self, params: &InitializationParams) -> Self::InitializeResponseFut;
76 type GetConfigResponseFut: std::future::Future<Output = Result<(String, Options), fidl::Error>>
77 + Send;
78 fn r#get_config(&self) -> Self::GetConfigResponseFut;
79 type InitializeTreeResponseFut: std::future::Future<
80 Output = Result<
81 (Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
82 fidl::Error,
83 >,
84 > + Send;
85 fn r#initialize_tree(&self, params: &InitializationParams) -> Self::InitializeTreeResponseFut;
86 type PublishResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>> + Send;
87 fn r#publish(&self) -> Self::PublishResponseFut;
88 type ActResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>> + Send;
89 fn r#act(&self, action: &Action) -> Self::ActResponseFut;
90 type ActLazyResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>> + Send;
91 fn r#act_lazy(&self, lazy_action: &LazyAction) -> Self::ActLazyResponseFut;
92 type ActLazyThreadLocalResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>>
93 + Send;
94 fn r#act_lazy_thread_local(
95 &self,
96 lazy_action: &LazyAction,
97 ) -> Self::ActLazyThreadLocalResponseFut;
98}
99#[derive(Debug)]
100#[cfg(target_os = "fuchsia")]
101pub struct InspectPuppetSynchronousProxy {
102 client: fidl::client::sync::Client,
103}
104
105#[cfg(target_os = "fuchsia")]
106impl fidl::endpoints::SynchronousProxy for InspectPuppetSynchronousProxy {
107 type Proxy = InspectPuppetProxy;
108 type Protocol = InspectPuppetMarker;
109
110 fn from_channel(inner: fidl::Channel) -> Self {
111 Self::new(inner)
112 }
113
114 fn into_channel(self) -> fidl::Channel {
115 self.client.into_channel()
116 }
117
118 fn as_channel(&self) -> &fidl::Channel {
119 self.client.as_channel()
120 }
121}
122
123#[cfg(target_os = "fuchsia")]
124impl InspectPuppetSynchronousProxy {
125 pub fn new(channel: fidl::Channel) -> Self {
126 let protocol_name = <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
127 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
128 }
129
130 pub fn into_channel(self) -> fidl::Channel {
131 self.client.into_channel()
132 }
133
134 pub fn wait_for_event(
137 &self,
138 deadline: zx::MonotonicInstant,
139 ) -> Result<InspectPuppetEvent, fidl::Error> {
140 InspectPuppetEvent::decode(self.client.wait_for_event(deadline)?)
141 }
142
143 pub fn r#initialize(
145 &self,
146 mut params: &InitializationParams,
147 ___deadline: zx::MonotonicInstant,
148 ) -> Result<(Option<fidl::Handle>, TestResult), fidl::Error> {
149 let _response = self.client.send_query::<
150 InspectPuppetInitializeRequest,
151 fidl::encoding::FlexibleType<InspectPuppetInitializeResponse>,
152 >(
153 (params,),
154 0x6f6c1f23e5665591,
155 fidl::encoding::DynamicFlags::FLEXIBLE,
156 ___deadline,
157 )?
158 .into_result::<InspectPuppetMarker>("initialize")?;
159 Ok((_response.vmo, _response.result))
160 }
161
162 pub fn r#get_config(
164 &self,
165 ___deadline: zx::MonotonicInstant,
166 ) -> Result<(String, Options), fidl::Error> {
167 let _response = self.client.send_query::<
168 fidl::encoding::EmptyPayload,
169 fidl::encoding::FlexibleType<InspectPuppetGetConfigResponse>,
170 >(
171 (),
172 0x61588d76bae449fd,
173 fidl::encoding::DynamicFlags::FLEXIBLE,
174 ___deadline,
175 )?
176 .into_result::<InspectPuppetMarker>("get_config")?;
177 Ok((_response.printable_name, _response.options))
178 }
179
180 pub fn r#initialize_tree(
183 &self,
184 mut params: &InitializationParams,
185 ___deadline: zx::MonotonicInstant,
186 ) -> Result<
187 (Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
188 fidl::Error,
189 > {
190 let _response = self.client.send_query::<
191 InspectPuppetInitializeTreeRequest,
192 fidl::encoding::FlexibleType<InspectPuppetInitializeTreeResponse>,
193 >(
194 (params,),
195 0x1dba90332d970658,
196 fidl::encoding::DynamicFlags::FLEXIBLE,
197 ___deadline,
198 )?
199 .into_result::<InspectPuppetMarker>("initialize_tree")?;
200 Ok((_response.tree, _response.result))
201 }
202
203 pub fn r#publish(&self, ___deadline: zx::MonotonicInstant) -> Result<TestResult, fidl::Error> {
208 let _response = self.client.send_query::<
209 fidl::encoding::EmptyPayload,
210 fidl::encoding::FlexibleType<InspectPuppetPublishResponse>,
211 >(
212 (),
213 0x2cb88b53aa897dd8,
214 fidl::encoding::DynamicFlags::FLEXIBLE,
215 ___deadline,
216 )?
217 .into_result::<InspectPuppetMarker>("publish")?;
218 Ok(_response.result)
219 }
220
221 pub fn r#act(
223 &self,
224 mut action: &Action,
225 ___deadline: zx::MonotonicInstant,
226 ) -> Result<TestResult, fidl::Error> {
227 let _response = self.client.send_query::<
228 InspectPuppetActRequest,
229 fidl::encoding::FlexibleType<InspectPuppetActResponse>,
230 >(
231 (action,),
232 0x72760753739e292f,
233 fidl::encoding::DynamicFlags::FLEXIBLE,
234 ___deadline,
235 )?
236 .into_result::<InspectPuppetMarker>("act")?;
237 Ok(_response.result)
238 }
239
240 pub fn r#act_lazy(
242 &self,
243 mut lazy_action: &LazyAction,
244 ___deadline: zx::MonotonicInstant,
245 ) -> Result<TestResult, fidl::Error> {
246 let _response = self.client.send_query::<
247 InspectPuppetActLazyRequest,
248 fidl::encoding::FlexibleType<InspectPuppetActLazyResponse>,
249 >(
250 (lazy_action,),
251 0x2d43263540a22a5f,
252 fidl::encoding::DynamicFlags::FLEXIBLE,
253 ___deadline,
254 )?
255 .into_result::<InspectPuppetMarker>("act_lazy")?;
256 Ok(_response.result)
257 }
258
259 pub fn r#act_lazy_thread_local(
261 &self,
262 mut lazy_action: &LazyAction,
263 ___deadline: zx::MonotonicInstant,
264 ) -> Result<TestResult, fidl::Error> {
265 let _response = self.client.send_query::<
266 InspectPuppetActLazyThreadLocalRequest,
267 fidl::encoding::FlexibleType<InspectPuppetActLazyThreadLocalResponse>,
268 >(
269 (lazy_action,),
270 0x258a20305861670,
271 fidl::encoding::DynamicFlags::FLEXIBLE,
272 ___deadline,
273 )?
274 .into_result::<InspectPuppetMarker>("act_lazy_thread_local")?;
275 Ok(_response.result)
276 }
277}
278
279#[cfg(target_os = "fuchsia")]
280impl From<InspectPuppetSynchronousProxy> for zx::Handle {
281 fn from(value: InspectPuppetSynchronousProxy) -> Self {
282 value.into_channel().into()
283 }
284}
285
286#[cfg(target_os = "fuchsia")]
287impl From<fidl::Channel> for InspectPuppetSynchronousProxy {
288 fn from(value: fidl::Channel) -> Self {
289 Self::new(value)
290 }
291}
292
293#[cfg(target_os = "fuchsia")]
294impl fidl::endpoints::FromClient for InspectPuppetSynchronousProxy {
295 type Protocol = InspectPuppetMarker;
296
297 fn from_client(value: fidl::endpoints::ClientEnd<InspectPuppetMarker>) -> Self {
298 Self::new(value.into_channel())
299 }
300}
301
302#[derive(Debug, Clone)]
303pub struct InspectPuppetProxy {
304 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
305}
306
307impl fidl::endpoints::Proxy for InspectPuppetProxy {
308 type Protocol = InspectPuppetMarker;
309
310 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
311 Self::new(inner)
312 }
313
314 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
315 self.client.into_channel().map_err(|client| Self { client })
316 }
317
318 fn as_channel(&self) -> &::fidl::AsyncChannel {
319 self.client.as_channel()
320 }
321}
322
323impl InspectPuppetProxy {
324 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
326 let protocol_name = <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
327 Self { client: fidl::client::Client::new(channel, protocol_name) }
328 }
329
330 pub fn take_event_stream(&self) -> InspectPuppetEventStream {
336 InspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
337 }
338
339 pub fn r#initialize(
341 &self,
342 mut params: &InitializationParams,
343 ) -> fidl::client::QueryResponseFut<
344 (Option<fidl::Handle>, TestResult),
345 fidl::encoding::DefaultFuchsiaResourceDialect,
346 > {
347 InspectPuppetProxyInterface::r#initialize(self, params)
348 }
349
350 pub fn r#get_config(
352 &self,
353 ) -> fidl::client::QueryResponseFut<
354 (String, Options),
355 fidl::encoding::DefaultFuchsiaResourceDialect,
356 > {
357 InspectPuppetProxyInterface::r#get_config(self)
358 }
359
360 pub fn r#initialize_tree(
363 &self,
364 mut params: &InitializationParams,
365 ) -> fidl::client::QueryResponseFut<
366 (Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
367 fidl::encoding::DefaultFuchsiaResourceDialect,
368 > {
369 InspectPuppetProxyInterface::r#initialize_tree(self, params)
370 }
371
372 pub fn r#publish(
377 &self,
378 ) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
379 {
380 InspectPuppetProxyInterface::r#publish(self)
381 }
382
383 pub fn r#act(
385 &self,
386 mut action: &Action,
387 ) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
388 {
389 InspectPuppetProxyInterface::r#act(self, action)
390 }
391
392 pub fn r#act_lazy(
394 &self,
395 mut lazy_action: &LazyAction,
396 ) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
397 {
398 InspectPuppetProxyInterface::r#act_lazy(self, lazy_action)
399 }
400
401 pub fn r#act_lazy_thread_local(
403 &self,
404 mut lazy_action: &LazyAction,
405 ) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
406 {
407 InspectPuppetProxyInterface::r#act_lazy_thread_local(self, lazy_action)
408 }
409}
410
411impl InspectPuppetProxyInterface for InspectPuppetProxy {
412 type InitializeResponseFut = fidl::client::QueryResponseFut<
413 (Option<fidl::Handle>, TestResult),
414 fidl::encoding::DefaultFuchsiaResourceDialect,
415 >;
416 fn r#initialize(&self, mut params: &InitializationParams) -> Self::InitializeResponseFut {
417 fn _decode(
418 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
419 ) -> Result<(Option<fidl::Handle>, TestResult), fidl::Error> {
420 let _response = fidl::client::decode_transaction_body::<
421 fidl::encoding::FlexibleType<InspectPuppetInitializeResponse>,
422 fidl::encoding::DefaultFuchsiaResourceDialect,
423 0x6f6c1f23e5665591,
424 >(_buf?)?
425 .into_result::<InspectPuppetMarker>("initialize")?;
426 Ok((_response.vmo, _response.result))
427 }
428 self.client.send_query_and_decode::<
429 InspectPuppetInitializeRequest,
430 (Option<fidl::Handle>, TestResult),
431 >(
432 (params,),
433 0x6f6c1f23e5665591,
434 fidl::encoding::DynamicFlags::FLEXIBLE,
435 _decode,
436 )
437 }
438
439 type GetConfigResponseFut = fidl::client::QueryResponseFut<
440 (String, Options),
441 fidl::encoding::DefaultFuchsiaResourceDialect,
442 >;
443 fn r#get_config(&self) -> Self::GetConfigResponseFut {
444 fn _decode(
445 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
446 ) -> Result<(String, Options), fidl::Error> {
447 let _response = fidl::client::decode_transaction_body::<
448 fidl::encoding::FlexibleType<InspectPuppetGetConfigResponse>,
449 fidl::encoding::DefaultFuchsiaResourceDialect,
450 0x61588d76bae449fd,
451 >(_buf?)?
452 .into_result::<InspectPuppetMarker>("get_config")?;
453 Ok((_response.printable_name, _response.options))
454 }
455 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (String, Options)>(
456 (),
457 0x61588d76bae449fd,
458 fidl::encoding::DynamicFlags::FLEXIBLE,
459 _decode,
460 )
461 }
462
463 type InitializeTreeResponseFut = fidl::client::QueryResponseFut<
464 (Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
465 fidl::encoding::DefaultFuchsiaResourceDialect,
466 >;
467 fn r#initialize_tree(
468 &self,
469 mut params: &InitializationParams,
470 ) -> Self::InitializeTreeResponseFut {
471 fn _decode(
472 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
473 ) -> Result<
474 (Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
475 fidl::Error,
476 > {
477 let _response = fidl::client::decode_transaction_body::<
478 fidl::encoding::FlexibleType<InspectPuppetInitializeTreeResponse>,
479 fidl::encoding::DefaultFuchsiaResourceDialect,
480 0x1dba90332d970658,
481 >(_buf?)?
482 .into_result::<InspectPuppetMarker>("initialize_tree")?;
483 Ok((_response.tree, _response.result))
484 }
485 self.client.send_query_and_decode::<InspectPuppetInitializeTreeRequest, (
486 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
487 TestResult,
488 )>(
489 (params,), 0x1dba90332d970658, fidl::encoding::DynamicFlags::FLEXIBLE, _decode
490 )
491 }
492
493 type PublishResponseFut =
494 fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
495 fn r#publish(&self) -> Self::PublishResponseFut {
496 fn _decode(
497 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
498 ) -> Result<TestResult, fidl::Error> {
499 let _response = fidl::client::decode_transaction_body::<
500 fidl::encoding::FlexibleType<InspectPuppetPublishResponse>,
501 fidl::encoding::DefaultFuchsiaResourceDialect,
502 0x2cb88b53aa897dd8,
503 >(_buf?)?
504 .into_result::<InspectPuppetMarker>("publish")?;
505 Ok(_response.result)
506 }
507 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, TestResult>(
508 (),
509 0x2cb88b53aa897dd8,
510 fidl::encoding::DynamicFlags::FLEXIBLE,
511 _decode,
512 )
513 }
514
515 type ActResponseFut =
516 fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
517 fn r#act(&self, mut action: &Action) -> Self::ActResponseFut {
518 fn _decode(
519 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
520 ) -> Result<TestResult, fidl::Error> {
521 let _response = fidl::client::decode_transaction_body::<
522 fidl::encoding::FlexibleType<InspectPuppetActResponse>,
523 fidl::encoding::DefaultFuchsiaResourceDialect,
524 0x72760753739e292f,
525 >(_buf?)?
526 .into_result::<InspectPuppetMarker>("act")?;
527 Ok(_response.result)
528 }
529 self.client.send_query_and_decode::<InspectPuppetActRequest, TestResult>(
530 (action,),
531 0x72760753739e292f,
532 fidl::encoding::DynamicFlags::FLEXIBLE,
533 _decode,
534 )
535 }
536
537 type ActLazyResponseFut =
538 fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
539 fn r#act_lazy(&self, mut lazy_action: &LazyAction) -> Self::ActLazyResponseFut {
540 fn _decode(
541 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
542 ) -> Result<TestResult, fidl::Error> {
543 let _response = fidl::client::decode_transaction_body::<
544 fidl::encoding::FlexibleType<InspectPuppetActLazyResponse>,
545 fidl::encoding::DefaultFuchsiaResourceDialect,
546 0x2d43263540a22a5f,
547 >(_buf?)?
548 .into_result::<InspectPuppetMarker>("act_lazy")?;
549 Ok(_response.result)
550 }
551 self.client.send_query_and_decode::<InspectPuppetActLazyRequest, TestResult>(
552 (lazy_action,),
553 0x2d43263540a22a5f,
554 fidl::encoding::DynamicFlags::FLEXIBLE,
555 _decode,
556 )
557 }
558
559 type ActLazyThreadLocalResponseFut =
560 fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
561 fn r#act_lazy_thread_local(
562 &self,
563 mut lazy_action: &LazyAction,
564 ) -> Self::ActLazyThreadLocalResponseFut {
565 fn _decode(
566 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
567 ) -> Result<TestResult, fidl::Error> {
568 let _response = fidl::client::decode_transaction_body::<
569 fidl::encoding::FlexibleType<InspectPuppetActLazyThreadLocalResponse>,
570 fidl::encoding::DefaultFuchsiaResourceDialect,
571 0x258a20305861670,
572 >(_buf?)?
573 .into_result::<InspectPuppetMarker>("act_lazy_thread_local")?;
574 Ok(_response.result)
575 }
576 self.client.send_query_and_decode::<InspectPuppetActLazyThreadLocalRequest, TestResult>(
577 (lazy_action,),
578 0x258a20305861670,
579 fidl::encoding::DynamicFlags::FLEXIBLE,
580 _decode,
581 )
582 }
583}
584
585pub struct InspectPuppetEventStream {
586 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
587}
588
589impl std::marker::Unpin for InspectPuppetEventStream {}
590
591impl futures::stream::FusedStream for InspectPuppetEventStream {
592 fn is_terminated(&self) -> bool {
593 self.event_receiver.is_terminated()
594 }
595}
596
597impl futures::Stream for InspectPuppetEventStream {
598 type Item = Result<InspectPuppetEvent, fidl::Error>;
599
600 fn poll_next(
601 mut self: std::pin::Pin<&mut Self>,
602 cx: &mut std::task::Context<'_>,
603 ) -> std::task::Poll<Option<Self::Item>> {
604 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
605 &mut self.event_receiver,
606 cx
607 )?) {
608 Some(buf) => std::task::Poll::Ready(Some(InspectPuppetEvent::decode(buf))),
609 None => std::task::Poll::Ready(None),
610 }
611 }
612}
613
614#[derive(Debug)]
615pub enum InspectPuppetEvent {
616 #[non_exhaustive]
617 _UnknownEvent {
618 ordinal: u64,
620 },
621}
622
623impl InspectPuppetEvent {
624 fn decode(
626 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
627 ) -> Result<InspectPuppetEvent, fidl::Error> {
628 let (bytes, _handles) = buf.split_mut();
629 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
630 debug_assert_eq!(tx_header.tx_id, 0);
631 match tx_header.ordinal {
632 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
633 Ok(InspectPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
634 }
635 _ => Err(fidl::Error::UnknownOrdinal {
636 ordinal: tx_header.ordinal,
637 protocol_name: <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
638 }),
639 }
640 }
641}
642
643pub struct InspectPuppetRequestStream {
645 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
646 is_terminated: bool,
647}
648
649impl std::marker::Unpin for InspectPuppetRequestStream {}
650
651impl futures::stream::FusedStream for InspectPuppetRequestStream {
652 fn is_terminated(&self) -> bool {
653 self.is_terminated
654 }
655}
656
657impl fidl::endpoints::RequestStream for InspectPuppetRequestStream {
658 type Protocol = InspectPuppetMarker;
659 type ControlHandle = InspectPuppetControlHandle;
660
661 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
662 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
663 }
664
665 fn control_handle(&self) -> Self::ControlHandle {
666 InspectPuppetControlHandle { inner: self.inner.clone() }
667 }
668
669 fn into_inner(
670 self,
671 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
672 {
673 (self.inner, self.is_terminated)
674 }
675
676 fn from_inner(
677 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
678 is_terminated: bool,
679 ) -> Self {
680 Self { inner, is_terminated }
681 }
682}
683
684impl futures::Stream for InspectPuppetRequestStream {
685 type Item = Result<InspectPuppetRequest, fidl::Error>;
686
687 fn poll_next(
688 mut self: std::pin::Pin<&mut Self>,
689 cx: &mut std::task::Context<'_>,
690 ) -> std::task::Poll<Option<Self::Item>> {
691 let this = &mut *self;
692 if this.inner.check_shutdown(cx) {
693 this.is_terminated = true;
694 return std::task::Poll::Ready(None);
695 }
696 if this.is_terminated {
697 panic!("polled InspectPuppetRequestStream after completion");
698 }
699 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
700 |bytes, handles| {
701 match this.inner.channel().read_etc(cx, bytes, handles) {
702 std::task::Poll::Ready(Ok(())) => {}
703 std::task::Poll::Pending => return std::task::Poll::Pending,
704 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
705 this.is_terminated = true;
706 return std::task::Poll::Ready(None);
707 }
708 std::task::Poll::Ready(Err(e)) => {
709 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
710 e.into(),
711 ))));
712 }
713 }
714
715 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
717
718 std::task::Poll::Ready(Some(match header.ordinal {
719 0x6f6c1f23e5665591 => {
720 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
721 let mut req = fidl::new_empty!(
722 InspectPuppetInitializeRequest,
723 fidl::encoding::DefaultFuchsiaResourceDialect
724 );
725 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetInitializeRequest>(&header, _body_bytes, handles, &mut req)?;
726 let control_handle =
727 InspectPuppetControlHandle { inner: this.inner.clone() };
728 Ok(InspectPuppetRequest::Initialize {
729 params: req.params,
730
731 responder: InspectPuppetInitializeResponder {
732 control_handle: std::mem::ManuallyDrop::new(control_handle),
733 tx_id: header.tx_id,
734 },
735 })
736 }
737 0x61588d76bae449fd => {
738 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
739 let mut req = fidl::new_empty!(
740 fidl::encoding::EmptyPayload,
741 fidl::encoding::DefaultFuchsiaResourceDialect
742 );
743 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
744 let control_handle =
745 InspectPuppetControlHandle { inner: this.inner.clone() };
746 Ok(InspectPuppetRequest::GetConfig {
747 responder: InspectPuppetGetConfigResponder {
748 control_handle: std::mem::ManuallyDrop::new(control_handle),
749 tx_id: header.tx_id,
750 },
751 })
752 }
753 0x1dba90332d970658 => {
754 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
755 let mut req = fidl::new_empty!(
756 InspectPuppetInitializeTreeRequest,
757 fidl::encoding::DefaultFuchsiaResourceDialect
758 );
759 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetInitializeTreeRequest>(&header, _body_bytes, handles, &mut req)?;
760 let control_handle =
761 InspectPuppetControlHandle { inner: this.inner.clone() };
762 Ok(InspectPuppetRequest::InitializeTree {
763 params: req.params,
764
765 responder: InspectPuppetInitializeTreeResponder {
766 control_handle: std::mem::ManuallyDrop::new(control_handle),
767 tx_id: header.tx_id,
768 },
769 })
770 }
771 0x2cb88b53aa897dd8 => {
772 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
773 let mut req = fidl::new_empty!(
774 fidl::encoding::EmptyPayload,
775 fidl::encoding::DefaultFuchsiaResourceDialect
776 );
777 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
778 let control_handle =
779 InspectPuppetControlHandle { inner: this.inner.clone() };
780 Ok(InspectPuppetRequest::Publish {
781 responder: InspectPuppetPublishResponder {
782 control_handle: std::mem::ManuallyDrop::new(control_handle),
783 tx_id: header.tx_id,
784 },
785 })
786 }
787 0x72760753739e292f => {
788 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
789 let mut req = fidl::new_empty!(
790 InspectPuppetActRequest,
791 fidl::encoding::DefaultFuchsiaResourceDialect
792 );
793 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetActRequest>(&header, _body_bytes, handles, &mut req)?;
794 let control_handle =
795 InspectPuppetControlHandle { inner: this.inner.clone() };
796 Ok(InspectPuppetRequest::Act {
797 action: req.action,
798
799 responder: InspectPuppetActResponder {
800 control_handle: std::mem::ManuallyDrop::new(control_handle),
801 tx_id: header.tx_id,
802 },
803 })
804 }
805 0x2d43263540a22a5f => {
806 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
807 let mut req = fidl::new_empty!(
808 InspectPuppetActLazyRequest,
809 fidl::encoding::DefaultFuchsiaResourceDialect
810 );
811 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetActLazyRequest>(&header, _body_bytes, handles, &mut req)?;
812 let control_handle =
813 InspectPuppetControlHandle { inner: this.inner.clone() };
814 Ok(InspectPuppetRequest::ActLazy {
815 lazy_action: req.lazy_action,
816
817 responder: InspectPuppetActLazyResponder {
818 control_handle: std::mem::ManuallyDrop::new(control_handle),
819 tx_id: header.tx_id,
820 },
821 })
822 }
823 0x258a20305861670 => {
824 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
825 let mut req = fidl::new_empty!(
826 InspectPuppetActLazyThreadLocalRequest,
827 fidl::encoding::DefaultFuchsiaResourceDialect
828 );
829 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetActLazyThreadLocalRequest>(&header, _body_bytes, handles, &mut req)?;
830 let control_handle =
831 InspectPuppetControlHandle { inner: this.inner.clone() };
832 Ok(InspectPuppetRequest::ActLazyThreadLocal {
833 lazy_action: req.lazy_action,
834
835 responder: InspectPuppetActLazyThreadLocalResponder {
836 control_handle: std::mem::ManuallyDrop::new(control_handle),
837 tx_id: header.tx_id,
838 },
839 })
840 }
841 _ if header.tx_id == 0
842 && header
843 .dynamic_flags()
844 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
845 {
846 Ok(InspectPuppetRequest::_UnknownMethod {
847 ordinal: header.ordinal,
848 control_handle: InspectPuppetControlHandle {
849 inner: this.inner.clone(),
850 },
851 method_type: fidl::MethodType::OneWay,
852 })
853 }
854 _ if header
855 .dynamic_flags()
856 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
857 {
858 this.inner.send_framework_err(
859 fidl::encoding::FrameworkErr::UnknownMethod,
860 header.tx_id,
861 header.ordinal,
862 header.dynamic_flags(),
863 (bytes, handles),
864 )?;
865 Ok(InspectPuppetRequest::_UnknownMethod {
866 ordinal: header.ordinal,
867 control_handle: InspectPuppetControlHandle {
868 inner: this.inner.clone(),
869 },
870 method_type: fidl::MethodType::TwoWay,
871 })
872 }
873 _ => Err(fidl::Error::UnknownOrdinal {
874 ordinal: header.ordinal,
875 protocol_name:
876 <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
877 }),
878 }))
879 },
880 )
881 }
882}
883
884#[derive(Debug)]
885pub enum InspectPuppetRequest {
886 Initialize { params: InitializationParams, responder: InspectPuppetInitializeResponder },
888 GetConfig { responder: InspectPuppetGetConfigResponder },
890 InitializeTree { params: InitializationParams, responder: InspectPuppetInitializeTreeResponder },
893 Publish { responder: InspectPuppetPublishResponder },
898 Act { action: Action, responder: InspectPuppetActResponder },
900 ActLazy { lazy_action: LazyAction, responder: InspectPuppetActLazyResponder },
902 ActLazyThreadLocal {
904 lazy_action: LazyAction,
905 responder: InspectPuppetActLazyThreadLocalResponder,
906 },
907 #[non_exhaustive]
909 _UnknownMethod {
910 ordinal: u64,
912 control_handle: InspectPuppetControlHandle,
913 method_type: fidl::MethodType,
914 },
915}
916
917impl InspectPuppetRequest {
918 #[allow(irrefutable_let_patterns)]
919 pub fn into_initialize(
920 self,
921 ) -> Option<(InitializationParams, InspectPuppetInitializeResponder)> {
922 if let InspectPuppetRequest::Initialize { params, responder } = self {
923 Some((params, responder))
924 } else {
925 None
926 }
927 }
928
929 #[allow(irrefutable_let_patterns)]
930 pub fn into_get_config(self) -> Option<(InspectPuppetGetConfigResponder)> {
931 if let InspectPuppetRequest::GetConfig { responder } = self {
932 Some((responder))
933 } else {
934 None
935 }
936 }
937
938 #[allow(irrefutable_let_patterns)]
939 pub fn into_initialize_tree(
940 self,
941 ) -> Option<(InitializationParams, InspectPuppetInitializeTreeResponder)> {
942 if let InspectPuppetRequest::InitializeTree { params, responder } = self {
943 Some((params, responder))
944 } else {
945 None
946 }
947 }
948
949 #[allow(irrefutable_let_patterns)]
950 pub fn into_publish(self) -> Option<(InspectPuppetPublishResponder)> {
951 if let InspectPuppetRequest::Publish { responder } = self {
952 Some((responder))
953 } else {
954 None
955 }
956 }
957
958 #[allow(irrefutable_let_patterns)]
959 pub fn into_act(self) -> Option<(Action, InspectPuppetActResponder)> {
960 if let InspectPuppetRequest::Act { action, responder } = self {
961 Some((action, responder))
962 } else {
963 None
964 }
965 }
966
967 #[allow(irrefutable_let_patterns)]
968 pub fn into_act_lazy(self) -> Option<(LazyAction, InspectPuppetActLazyResponder)> {
969 if let InspectPuppetRequest::ActLazy { lazy_action, responder } = self {
970 Some((lazy_action, responder))
971 } else {
972 None
973 }
974 }
975
976 #[allow(irrefutable_let_patterns)]
977 pub fn into_act_lazy_thread_local(
978 self,
979 ) -> Option<(LazyAction, InspectPuppetActLazyThreadLocalResponder)> {
980 if let InspectPuppetRequest::ActLazyThreadLocal { lazy_action, responder } = self {
981 Some((lazy_action, responder))
982 } else {
983 None
984 }
985 }
986
987 pub fn method_name(&self) -> &'static str {
989 match *self {
990 InspectPuppetRequest::Initialize { .. } => "initialize",
991 InspectPuppetRequest::GetConfig { .. } => "get_config",
992 InspectPuppetRequest::InitializeTree { .. } => "initialize_tree",
993 InspectPuppetRequest::Publish { .. } => "publish",
994 InspectPuppetRequest::Act { .. } => "act",
995 InspectPuppetRequest::ActLazy { .. } => "act_lazy",
996 InspectPuppetRequest::ActLazyThreadLocal { .. } => "act_lazy_thread_local",
997 InspectPuppetRequest::_UnknownMethod {
998 method_type: fidl::MethodType::OneWay, ..
999 } => "unknown one-way method",
1000 InspectPuppetRequest::_UnknownMethod {
1001 method_type: fidl::MethodType::TwoWay, ..
1002 } => "unknown two-way method",
1003 }
1004 }
1005}
1006
1007#[derive(Debug, Clone)]
1008pub struct InspectPuppetControlHandle {
1009 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1010}
1011
1012impl fidl::endpoints::ControlHandle for InspectPuppetControlHandle {
1013 fn shutdown(&self) {
1014 self.inner.shutdown()
1015 }
1016 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1017 self.inner.shutdown_with_epitaph(status)
1018 }
1019
1020 fn is_closed(&self) -> bool {
1021 self.inner.channel().is_closed()
1022 }
1023 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1024 self.inner.channel().on_closed()
1025 }
1026
1027 #[cfg(target_os = "fuchsia")]
1028 fn signal_peer(
1029 &self,
1030 clear_mask: zx::Signals,
1031 set_mask: zx::Signals,
1032 ) -> Result<(), zx_status::Status> {
1033 use fidl::Peered;
1034 self.inner.channel().signal_peer(clear_mask, set_mask)
1035 }
1036}
1037
1038impl InspectPuppetControlHandle {}
1039
1040#[must_use = "FIDL methods require a response to be sent"]
1041#[derive(Debug)]
1042pub struct InspectPuppetInitializeResponder {
1043 control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1044 tx_id: u32,
1045}
1046
1047impl std::ops::Drop for InspectPuppetInitializeResponder {
1051 fn drop(&mut self) {
1052 self.control_handle.shutdown();
1053 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1055 }
1056}
1057
1058impl fidl::endpoints::Responder for InspectPuppetInitializeResponder {
1059 type ControlHandle = InspectPuppetControlHandle;
1060
1061 fn control_handle(&self) -> &InspectPuppetControlHandle {
1062 &self.control_handle
1063 }
1064
1065 fn drop_without_shutdown(mut self) {
1066 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1068 std::mem::forget(self);
1070 }
1071}
1072
1073impl InspectPuppetInitializeResponder {
1074 pub fn send(
1078 self,
1079 mut vmo: Option<fidl::Handle>,
1080 mut result: TestResult,
1081 ) -> Result<(), fidl::Error> {
1082 let _result = self.send_raw(vmo, result);
1083 if _result.is_err() {
1084 self.control_handle.shutdown();
1085 }
1086 self.drop_without_shutdown();
1087 _result
1088 }
1089
1090 pub fn send_no_shutdown_on_err(
1092 self,
1093 mut vmo: Option<fidl::Handle>,
1094 mut result: TestResult,
1095 ) -> Result<(), fidl::Error> {
1096 let _result = self.send_raw(vmo, result);
1097 self.drop_without_shutdown();
1098 _result
1099 }
1100
1101 fn send_raw(
1102 &self,
1103 mut vmo: Option<fidl::Handle>,
1104 mut result: TestResult,
1105 ) -> Result<(), fidl::Error> {
1106 self.control_handle
1107 .inner
1108 .send::<fidl::encoding::FlexibleType<InspectPuppetInitializeResponse>>(
1109 fidl::encoding::Flexible::new((vmo, result)),
1110 self.tx_id,
1111 0x6f6c1f23e5665591,
1112 fidl::encoding::DynamicFlags::FLEXIBLE,
1113 )
1114 }
1115}
1116
1117#[must_use = "FIDL methods require a response to be sent"]
1118#[derive(Debug)]
1119pub struct InspectPuppetGetConfigResponder {
1120 control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1121 tx_id: u32,
1122}
1123
1124impl std::ops::Drop for InspectPuppetGetConfigResponder {
1128 fn drop(&mut self) {
1129 self.control_handle.shutdown();
1130 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1132 }
1133}
1134
1135impl fidl::endpoints::Responder for InspectPuppetGetConfigResponder {
1136 type ControlHandle = InspectPuppetControlHandle;
1137
1138 fn control_handle(&self) -> &InspectPuppetControlHandle {
1139 &self.control_handle
1140 }
1141
1142 fn drop_without_shutdown(mut self) {
1143 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1145 std::mem::forget(self);
1147 }
1148}
1149
1150impl InspectPuppetGetConfigResponder {
1151 pub fn send(self, mut printable_name: &str, mut options: Options) -> Result<(), fidl::Error> {
1155 let _result = self.send_raw(printable_name, options);
1156 if _result.is_err() {
1157 self.control_handle.shutdown();
1158 }
1159 self.drop_without_shutdown();
1160 _result
1161 }
1162
1163 pub fn send_no_shutdown_on_err(
1165 self,
1166 mut printable_name: &str,
1167 mut options: Options,
1168 ) -> Result<(), fidl::Error> {
1169 let _result = self.send_raw(printable_name, options);
1170 self.drop_without_shutdown();
1171 _result
1172 }
1173
1174 fn send_raw(&self, mut printable_name: &str, mut options: Options) -> Result<(), fidl::Error> {
1175 self.control_handle
1176 .inner
1177 .send::<fidl::encoding::FlexibleType<InspectPuppetGetConfigResponse>>(
1178 fidl::encoding::Flexible::new((printable_name, &mut options)),
1179 self.tx_id,
1180 0x61588d76bae449fd,
1181 fidl::encoding::DynamicFlags::FLEXIBLE,
1182 )
1183 }
1184}
1185
1186#[must_use = "FIDL methods require a response to be sent"]
1187#[derive(Debug)]
1188pub struct InspectPuppetInitializeTreeResponder {
1189 control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1190 tx_id: u32,
1191}
1192
1193impl std::ops::Drop for InspectPuppetInitializeTreeResponder {
1197 fn drop(&mut self) {
1198 self.control_handle.shutdown();
1199 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1201 }
1202}
1203
1204impl fidl::endpoints::Responder for InspectPuppetInitializeTreeResponder {
1205 type ControlHandle = InspectPuppetControlHandle;
1206
1207 fn control_handle(&self) -> &InspectPuppetControlHandle {
1208 &self.control_handle
1209 }
1210
1211 fn drop_without_shutdown(mut self) {
1212 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1214 std::mem::forget(self);
1216 }
1217}
1218
1219impl InspectPuppetInitializeTreeResponder {
1220 pub fn send(
1224 self,
1225 mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
1226 mut result: TestResult,
1227 ) -> Result<(), fidl::Error> {
1228 let _result = self.send_raw(tree, result);
1229 if _result.is_err() {
1230 self.control_handle.shutdown();
1231 }
1232 self.drop_without_shutdown();
1233 _result
1234 }
1235
1236 pub fn send_no_shutdown_on_err(
1238 self,
1239 mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
1240 mut result: TestResult,
1241 ) -> Result<(), fidl::Error> {
1242 let _result = self.send_raw(tree, result);
1243 self.drop_without_shutdown();
1244 _result
1245 }
1246
1247 fn send_raw(
1248 &self,
1249 mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
1250 mut result: TestResult,
1251 ) -> Result<(), fidl::Error> {
1252 self.control_handle
1253 .inner
1254 .send::<fidl::encoding::FlexibleType<InspectPuppetInitializeTreeResponse>>(
1255 fidl::encoding::Flexible::new((tree, result)),
1256 self.tx_id,
1257 0x1dba90332d970658,
1258 fidl::encoding::DynamicFlags::FLEXIBLE,
1259 )
1260 }
1261}
1262
1263#[must_use = "FIDL methods require a response to be sent"]
1264#[derive(Debug)]
1265pub struct InspectPuppetPublishResponder {
1266 control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1267 tx_id: u32,
1268}
1269
1270impl std::ops::Drop for InspectPuppetPublishResponder {
1274 fn drop(&mut self) {
1275 self.control_handle.shutdown();
1276 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1278 }
1279}
1280
1281impl fidl::endpoints::Responder for InspectPuppetPublishResponder {
1282 type ControlHandle = InspectPuppetControlHandle;
1283
1284 fn control_handle(&self) -> &InspectPuppetControlHandle {
1285 &self.control_handle
1286 }
1287
1288 fn drop_without_shutdown(mut self) {
1289 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1291 std::mem::forget(self);
1293 }
1294}
1295
1296impl InspectPuppetPublishResponder {
1297 pub fn send(self, mut result: TestResult) -> Result<(), fidl::Error> {
1301 let _result = self.send_raw(result);
1302 if _result.is_err() {
1303 self.control_handle.shutdown();
1304 }
1305 self.drop_without_shutdown();
1306 _result
1307 }
1308
1309 pub fn send_no_shutdown_on_err(self, mut result: TestResult) -> Result<(), fidl::Error> {
1311 let _result = self.send_raw(result);
1312 self.drop_without_shutdown();
1313 _result
1314 }
1315
1316 fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
1317 self.control_handle
1318 .inner
1319 .send::<fidl::encoding::FlexibleType<InspectPuppetPublishResponse>>(
1320 fidl::encoding::Flexible::new((result,)),
1321 self.tx_id,
1322 0x2cb88b53aa897dd8,
1323 fidl::encoding::DynamicFlags::FLEXIBLE,
1324 )
1325 }
1326}
1327
1328#[must_use = "FIDL methods require a response to be sent"]
1329#[derive(Debug)]
1330pub struct InspectPuppetActResponder {
1331 control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1332 tx_id: u32,
1333}
1334
1335impl std::ops::Drop for InspectPuppetActResponder {
1339 fn drop(&mut self) {
1340 self.control_handle.shutdown();
1341 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1343 }
1344}
1345
1346impl fidl::endpoints::Responder for InspectPuppetActResponder {
1347 type ControlHandle = InspectPuppetControlHandle;
1348
1349 fn control_handle(&self) -> &InspectPuppetControlHandle {
1350 &self.control_handle
1351 }
1352
1353 fn drop_without_shutdown(mut self) {
1354 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1356 std::mem::forget(self);
1358 }
1359}
1360
1361impl InspectPuppetActResponder {
1362 pub fn send(self, mut result: TestResult) -> Result<(), fidl::Error> {
1366 let _result = self.send_raw(result);
1367 if _result.is_err() {
1368 self.control_handle.shutdown();
1369 }
1370 self.drop_without_shutdown();
1371 _result
1372 }
1373
1374 pub fn send_no_shutdown_on_err(self, mut result: TestResult) -> Result<(), fidl::Error> {
1376 let _result = self.send_raw(result);
1377 self.drop_without_shutdown();
1378 _result
1379 }
1380
1381 fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
1382 self.control_handle.inner.send::<fidl::encoding::FlexibleType<InspectPuppetActResponse>>(
1383 fidl::encoding::Flexible::new((result,)),
1384 self.tx_id,
1385 0x72760753739e292f,
1386 fidl::encoding::DynamicFlags::FLEXIBLE,
1387 )
1388 }
1389}
1390
1391#[must_use = "FIDL methods require a response to be sent"]
1392#[derive(Debug)]
1393pub struct InspectPuppetActLazyResponder {
1394 control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1395 tx_id: u32,
1396}
1397
1398impl std::ops::Drop for InspectPuppetActLazyResponder {
1402 fn drop(&mut self) {
1403 self.control_handle.shutdown();
1404 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1406 }
1407}
1408
1409impl fidl::endpoints::Responder for InspectPuppetActLazyResponder {
1410 type ControlHandle = InspectPuppetControlHandle;
1411
1412 fn control_handle(&self) -> &InspectPuppetControlHandle {
1413 &self.control_handle
1414 }
1415
1416 fn drop_without_shutdown(mut self) {
1417 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1419 std::mem::forget(self);
1421 }
1422}
1423
1424impl InspectPuppetActLazyResponder {
1425 pub fn send(self, mut result: TestResult) -> Result<(), fidl::Error> {
1429 let _result = self.send_raw(result);
1430 if _result.is_err() {
1431 self.control_handle.shutdown();
1432 }
1433 self.drop_without_shutdown();
1434 _result
1435 }
1436
1437 pub fn send_no_shutdown_on_err(self, mut result: TestResult) -> Result<(), fidl::Error> {
1439 let _result = self.send_raw(result);
1440 self.drop_without_shutdown();
1441 _result
1442 }
1443
1444 fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
1445 self.control_handle
1446 .inner
1447 .send::<fidl::encoding::FlexibleType<InspectPuppetActLazyResponse>>(
1448 fidl::encoding::Flexible::new((result,)),
1449 self.tx_id,
1450 0x2d43263540a22a5f,
1451 fidl::encoding::DynamicFlags::FLEXIBLE,
1452 )
1453 }
1454}
1455
1456#[must_use = "FIDL methods require a response to be sent"]
1457#[derive(Debug)]
1458pub struct InspectPuppetActLazyThreadLocalResponder {
1459 control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1460 tx_id: u32,
1461}
1462
1463impl std::ops::Drop for InspectPuppetActLazyThreadLocalResponder {
1467 fn drop(&mut self) {
1468 self.control_handle.shutdown();
1469 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1471 }
1472}
1473
1474impl fidl::endpoints::Responder for InspectPuppetActLazyThreadLocalResponder {
1475 type ControlHandle = InspectPuppetControlHandle;
1476
1477 fn control_handle(&self) -> &InspectPuppetControlHandle {
1478 &self.control_handle
1479 }
1480
1481 fn drop_without_shutdown(mut self) {
1482 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1484 std::mem::forget(self);
1486 }
1487}
1488
1489impl InspectPuppetActLazyThreadLocalResponder {
1490 pub fn send(self, mut result: TestResult) -> Result<(), fidl::Error> {
1494 let _result = self.send_raw(result);
1495 if _result.is_err() {
1496 self.control_handle.shutdown();
1497 }
1498 self.drop_without_shutdown();
1499 _result
1500 }
1501
1502 pub fn send_no_shutdown_on_err(self, mut result: TestResult) -> Result<(), fidl::Error> {
1504 let _result = self.send_raw(result);
1505 self.drop_without_shutdown();
1506 _result
1507 }
1508
1509 fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
1510 self.control_handle.inner.send::<fidl::encoding::FlexibleType<
1511 InspectPuppetActLazyThreadLocalResponse,
1512 >>(
1513 fidl::encoding::Flexible::new((result,)),
1514 self.tx_id,
1515 0x258a20305861670,
1516 fidl::encoding::DynamicFlags::FLEXIBLE,
1517 )
1518 }
1519}
1520
1521mod internal {
1522 use super::*;
1523
1524 impl fidl::encoding::ResourceTypeMarker for InspectPuppetGetConfigResponse {
1525 type Borrowed<'a> = &'a mut Self;
1526 fn take_or_borrow<'a>(
1527 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1528 ) -> Self::Borrowed<'a> {
1529 value
1530 }
1531 }
1532
1533 unsafe impl fidl::encoding::TypeMarker for InspectPuppetGetConfigResponse {
1534 type Owned = Self;
1535
1536 #[inline(always)]
1537 fn inline_align(_context: fidl::encoding::Context) -> usize {
1538 8
1539 }
1540
1541 #[inline(always)]
1542 fn inline_size(_context: fidl::encoding::Context) -> usize {
1543 32
1544 }
1545 }
1546
1547 unsafe impl
1548 fidl::encoding::Encode<
1549 InspectPuppetGetConfigResponse,
1550 fidl::encoding::DefaultFuchsiaResourceDialect,
1551 > for &mut InspectPuppetGetConfigResponse
1552 {
1553 #[inline]
1554 unsafe fn encode(
1555 self,
1556 encoder: &mut fidl::encoding::Encoder<
1557 '_,
1558 fidl::encoding::DefaultFuchsiaResourceDialect,
1559 >,
1560 offset: usize,
1561 _depth: fidl::encoding::Depth,
1562 ) -> fidl::Result<()> {
1563 encoder.debug_check_bounds::<InspectPuppetGetConfigResponse>(offset);
1564 fidl::encoding::Encode::<
1566 InspectPuppetGetConfigResponse,
1567 fidl::encoding::DefaultFuchsiaResourceDialect,
1568 >::encode(
1569 (
1570 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1571 &self.printable_name,
1572 ),
1573 <Options as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1574 &mut self.options,
1575 ),
1576 ),
1577 encoder,
1578 offset,
1579 _depth,
1580 )
1581 }
1582 }
1583 unsafe impl<
1584 T0: fidl::encoding::Encode<
1585 fidl::encoding::UnboundedString,
1586 fidl::encoding::DefaultFuchsiaResourceDialect,
1587 >,
1588 T1: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
1589 >
1590 fidl::encoding::Encode<
1591 InspectPuppetGetConfigResponse,
1592 fidl::encoding::DefaultFuchsiaResourceDialect,
1593 > for (T0, T1)
1594 {
1595 #[inline]
1596 unsafe fn encode(
1597 self,
1598 encoder: &mut fidl::encoding::Encoder<
1599 '_,
1600 fidl::encoding::DefaultFuchsiaResourceDialect,
1601 >,
1602 offset: usize,
1603 depth: fidl::encoding::Depth,
1604 ) -> fidl::Result<()> {
1605 encoder.debug_check_bounds::<InspectPuppetGetConfigResponse>(offset);
1606 self.0.encode(encoder, offset + 0, depth)?;
1610 self.1.encode(encoder, offset + 16, depth)?;
1611 Ok(())
1612 }
1613 }
1614
1615 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1616 for InspectPuppetGetConfigResponse
1617 {
1618 #[inline(always)]
1619 fn new_empty() -> Self {
1620 Self {
1621 printable_name: fidl::new_empty!(
1622 fidl::encoding::UnboundedString,
1623 fidl::encoding::DefaultFuchsiaResourceDialect
1624 ),
1625 options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
1626 }
1627 }
1628
1629 #[inline]
1630 unsafe fn decode(
1631 &mut self,
1632 decoder: &mut fidl::encoding::Decoder<
1633 '_,
1634 fidl::encoding::DefaultFuchsiaResourceDialect,
1635 >,
1636 offset: usize,
1637 _depth: fidl::encoding::Depth,
1638 ) -> fidl::Result<()> {
1639 decoder.debug_check_bounds::<Self>(offset);
1640 fidl::decode!(
1642 fidl::encoding::UnboundedString,
1643 fidl::encoding::DefaultFuchsiaResourceDialect,
1644 &mut self.printable_name,
1645 decoder,
1646 offset + 0,
1647 _depth
1648 )?;
1649 fidl::decode!(
1650 Options,
1651 fidl::encoding::DefaultFuchsiaResourceDialect,
1652 &mut self.options,
1653 decoder,
1654 offset + 16,
1655 _depth
1656 )?;
1657 Ok(())
1658 }
1659 }
1660
1661 impl fidl::encoding::ResourceTypeMarker for InspectPuppetInitializeTreeResponse {
1662 type Borrowed<'a> = &'a mut Self;
1663 fn take_or_borrow<'a>(
1664 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1665 ) -> Self::Borrowed<'a> {
1666 value
1667 }
1668 }
1669
1670 unsafe impl fidl::encoding::TypeMarker for InspectPuppetInitializeTreeResponse {
1671 type Owned = Self;
1672
1673 #[inline(always)]
1674 fn inline_align(_context: fidl::encoding::Context) -> usize {
1675 4
1676 }
1677
1678 #[inline(always)]
1679 fn inline_size(_context: fidl::encoding::Context) -> usize {
1680 8
1681 }
1682 }
1683
1684 unsafe impl
1685 fidl::encoding::Encode<
1686 InspectPuppetInitializeTreeResponse,
1687 fidl::encoding::DefaultFuchsiaResourceDialect,
1688 > for &mut InspectPuppetInitializeTreeResponse
1689 {
1690 #[inline]
1691 unsafe fn encode(
1692 self,
1693 encoder: &mut fidl::encoding::Encoder<
1694 '_,
1695 fidl::encoding::DefaultFuchsiaResourceDialect,
1696 >,
1697 offset: usize,
1698 _depth: fidl::encoding::Depth,
1699 ) -> fidl::Result<()> {
1700 encoder.debug_check_bounds::<InspectPuppetInitializeTreeResponse>(offset);
1701 fidl::encoding::Encode::<
1703 InspectPuppetInitializeTreeResponse,
1704 fidl::encoding::DefaultFuchsiaResourceDialect,
1705 >::encode(
1706 (
1707 <fidl::encoding::Optional<
1708 fidl::encoding::Endpoint<
1709 fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
1710 >,
1711 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1712 &mut self.tree
1713 ),
1714 <TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),
1715 ),
1716 encoder,
1717 offset,
1718 _depth,
1719 )
1720 }
1721 }
1722 unsafe impl<
1723 T0: fidl::encoding::Encode<
1724 fidl::encoding::Optional<
1725 fidl::encoding::Endpoint<
1726 fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
1727 >,
1728 >,
1729 fidl::encoding::DefaultFuchsiaResourceDialect,
1730 >,
1731 T1: fidl::encoding::Encode<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>,
1732 >
1733 fidl::encoding::Encode<
1734 InspectPuppetInitializeTreeResponse,
1735 fidl::encoding::DefaultFuchsiaResourceDialect,
1736 > for (T0, T1)
1737 {
1738 #[inline]
1739 unsafe fn encode(
1740 self,
1741 encoder: &mut fidl::encoding::Encoder<
1742 '_,
1743 fidl::encoding::DefaultFuchsiaResourceDialect,
1744 >,
1745 offset: usize,
1746 depth: fidl::encoding::Depth,
1747 ) -> fidl::Result<()> {
1748 encoder.debug_check_bounds::<InspectPuppetInitializeTreeResponse>(offset);
1749 self.0.encode(encoder, offset + 0, depth)?;
1753 self.1.encode(encoder, offset + 4, depth)?;
1754 Ok(())
1755 }
1756 }
1757
1758 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1759 for InspectPuppetInitializeTreeResponse
1760 {
1761 #[inline(always)]
1762 fn new_empty() -> Self {
1763 Self {
1764 tree: fidl::new_empty!(
1765 fidl::encoding::Optional<
1766 fidl::encoding::Endpoint<
1767 fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
1768 >,
1769 >,
1770 fidl::encoding::DefaultFuchsiaResourceDialect
1771 ),
1772 result: fidl::new_empty!(TestResult, fidl::encoding::DefaultFuchsiaResourceDialect),
1773 }
1774 }
1775
1776 #[inline]
1777 unsafe fn decode(
1778 &mut self,
1779 decoder: &mut fidl::encoding::Decoder<
1780 '_,
1781 fidl::encoding::DefaultFuchsiaResourceDialect,
1782 >,
1783 offset: usize,
1784 _depth: fidl::encoding::Depth,
1785 ) -> fidl::Result<()> {
1786 decoder.debug_check_bounds::<Self>(offset);
1787 fidl::decode!(
1789 fidl::encoding::Optional<
1790 fidl::encoding::Endpoint<
1791 fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
1792 >,
1793 >,
1794 fidl::encoding::DefaultFuchsiaResourceDialect,
1795 &mut self.tree,
1796 decoder,
1797 offset + 0,
1798 _depth
1799 )?;
1800 fidl::decode!(
1801 TestResult,
1802 fidl::encoding::DefaultFuchsiaResourceDialect,
1803 &mut self.result,
1804 decoder,
1805 offset + 4,
1806 _depth
1807 )?;
1808 Ok(())
1809 }
1810 }
1811
1812 impl fidl::encoding::ResourceTypeMarker for InspectPuppetInitializeResponse {
1813 type Borrowed<'a> = &'a mut Self;
1814 fn take_or_borrow<'a>(
1815 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1816 ) -> Self::Borrowed<'a> {
1817 value
1818 }
1819 }
1820
1821 unsafe impl fidl::encoding::TypeMarker for InspectPuppetInitializeResponse {
1822 type Owned = Self;
1823
1824 #[inline(always)]
1825 fn inline_align(_context: fidl::encoding::Context) -> usize {
1826 4
1827 }
1828
1829 #[inline(always)]
1830 fn inline_size(_context: fidl::encoding::Context) -> usize {
1831 8
1832 }
1833 }
1834
1835 unsafe impl
1836 fidl::encoding::Encode<
1837 InspectPuppetInitializeResponse,
1838 fidl::encoding::DefaultFuchsiaResourceDialect,
1839 > for &mut InspectPuppetInitializeResponse
1840 {
1841 #[inline]
1842 unsafe fn encode(
1843 self,
1844 encoder: &mut fidl::encoding::Encoder<
1845 '_,
1846 fidl::encoding::DefaultFuchsiaResourceDialect,
1847 >,
1848 offset: usize,
1849 _depth: fidl::encoding::Depth,
1850 ) -> fidl::Result<()> {
1851 encoder.debug_check_bounds::<InspectPuppetInitializeResponse>(offset);
1852 fidl::encoding::Encode::<
1854 InspectPuppetInitializeResponse,
1855 fidl::encoding::DefaultFuchsiaResourceDialect,
1856 >::encode(
1857 (
1858 <fidl::encoding::Optional<
1859 fidl::encoding::HandleType<
1860 fidl::Handle,
1861 { fidl::ObjectType::NONE.into_raw() },
1862 2147483648,
1863 >,
1864 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1865 &mut self.vmo
1866 ),
1867 <TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),
1868 ),
1869 encoder,
1870 offset,
1871 _depth,
1872 )
1873 }
1874 }
1875 unsafe impl<
1876 T0: fidl::encoding::Encode<
1877 fidl::encoding::Optional<
1878 fidl::encoding::HandleType<
1879 fidl::Handle,
1880 { fidl::ObjectType::NONE.into_raw() },
1881 2147483648,
1882 >,
1883 >,
1884 fidl::encoding::DefaultFuchsiaResourceDialect,
1885 >,
1886 T1: fidl::encoding::Encode<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>,
1887 >
1888 fidl::encoding::Encode<
1889 InspectPuppetInitializeResponse,
1890 fidl::encoding::DefaultFuchsiaResourceDialect,
1891 > for (T0, T1)
1892 {
1893 #[inline]
1894 unsafe fn encode(
1895 self,
1896 encoder: &mut fidl::encoding::Encoder<
1897 '_,
1898 fidl::encoding::DefaultFuchsiaResourceDialect,
1899 >,
1900 offset: usize,
1901 depth: fidl::encoding::Depth,
1902 ) -> fidl::Result<()> {
1903 encoder.debug_check_bounds::<InspectPuppetInitializeResponse>(offset);
1904 self.0.encode(encoder, offset + 0, depth)?;
1908 self.1.encode(encoder, offset + 4, depth)?;
1909 Ok(())
1910 }
1911 }
1912
1913 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1914 for InspectPuppetInitializeResponse
1915 {
1916 #[inline(always)]
1917 fn new_empty() -> Self {
1918 Self {
1919 vmo: fidl::new_empty!(
1920 fidl::encoding::Optional<
1921 fidl::encoding::HandleType<
1922 fidl::Handle,
1923 { fidl::ObjectType::NONE.into_raw() },
1924 2147483648,
1925 >,
1926 >,
1927 fidl::encoding::DefaultFuchsiaResourceDialect
1928 ),
1929 result: fidl::new_empty!(TestResult, fidl::encoding::DefaultFuchsiaResourceDialect),
1930 }
1931 }
1932
1933 #[inline]
1934 unsafe fn decode(
1935 &mut self,
1936 decoder: &mut fidl::encoding::Decoder<
1937 '_,
1938 fidl::encoding::DefaultFuchsiaResourceDialect,
1939 >,
1940 offset: usize,
1941 _depth: fidl::encoding::Depth,
1942 ) -> fidl::Result<()> {
1943 decoder.debug_check_bounds::<Self>(offset);
1944 fidl::decode!(
1946 fidl::encoding::Optional<
1947 fidl::encoding::HandleType<
1948 fidl::Handle,
1949 { fidl::ObjectType::NONE.into_raw() },
1950 2147483648,
1951 >,
1952 >,
1953 fidl::encoding::DefaultFuchsiaResourceDialect,
1954 &mut self.vmo,
1955 decoder,
1956 offset + 0,
1957 _depth
1958 )?;
1959 fidl::decode!(
1960 TestResult,
1961 fidl::encoding::DefaultFuchsiaResourceDialect,
1962 &mut self.result,
1963 decoder,
1964 offset + 4,
1965 _depth
1966 )?;
1967 Ok(())
1968 }
1969 }
1970
1971 impl Options {
1972 #[inline(always)]
1973 fn max_ordinal_present(&self) -> u64 {
1974 if let Some(_) = self.diff_type {
1975 return 2;
1976 }
1977 if let Some(_) = self.has_runner_node {
1978 return 1;
1979 }
1980 0
1981 }
1982 }
1983
1984 impl fidl::encoding::ResourceTypeMarker for Options {
1985 type Borrowed<'a> = &'a mut Self;
1986 fn take_or_borrow<'a>(
1987 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1988 ) -> Self::Borrowed<'a> {
1989 value
1990 }
1991 }
1992
1993 unsafe impl fidl::encoding::TypeMarker for Options {
1994 type Owned = Self;
1995
1996 #[inline(always)]
1997 fn inline_align(_context: fidl::encoding::Context) -> usize {
1998 8
1999 }
2000
2001 #[inline(always)]
2002 fn inline_size(_context: fidl::encoding::Context) -> usize {
2003 16
2004 }
2005 }
2006
2007 unsafe impl fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>
2008 for &mut Options
2009 {
2010 unsafe fn encode(
2011 self,
2012 encoder: &mut fidl::encoding::Encoder<
2013 '_,
2014 fidl::encoding::DefaultFuchsiaResourceDialect,
2015 >,
2016 offset: usize,
2017 mut depth: fidl::encoding::Depth,
2018 ) -> fidl::Result<()> {
2019 encoder.debug_check_bounds::<Options>(offset);
2020 let max_ordinal: u64 = self.max_ordinal_present();
2022 encoder.write_num(max_ordinal, offset);
2023 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2024 if max_ordinal == 0 {
2026 return Ok(());
2027 }
2028 depth.increment()?;
2029 let envelope_size = 8;
2030 let bytes_len = max_ordinal as usize * envelope_size;
2031 #[allow(unused_variables)]
2032 let offset = encoder.out_of_line_offset(bytes_len);
2033 let mut _prev_end_offset: usize = 0;
2034 if 1 > max_ordinal {
2035 return Ok(());
2036 }
2037
2038 let cur_offset: usize = (1 - 1) * envelope_size;
2041
2042 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2044
2045 fidl::encoding::encode_in_envelope_optional::<
2050 bool,
2051 fidl::encoding::DefaultFuchsiaResourceDialect,
2052 >(
2053 self.has_runner_node
2054 .as_ref()
2055 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2056 encoder,
2057 offset + cur_offset,
2058 depth,
2059 )?;
2060
2061 _prev_end_offset = cur_offset + envelope_size;
2062 if 2 > max_ordinal {
2063 return Ok(());
2064 }
2065
2066 let cur_offset: usize = (2 - 1) * envelope_size;
2069
2070 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2072
2073 fidl::encoding::encode_in_envelope_optional::<
2078 DiffType,
2079 fidl::encoding::DefaultFuchsiaResourceDialect,
2080 >(
2081 self.diff_type.as_ref().map(<DiffType as fidl::encoding::ValueTypeMarker>::borrow),
2082 encoder,
2083 offset + cur_offset,
2084 depth,
2085 )?;
2086
2087 _prev_end_offset = cur_offset + envelope_size;
2088
2089 Ok(())
2090 }
2091 }
2092
2093 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Options {
2094 #[inline(always)]
2095 fn new_empty() -> Self {
2096 Self::default()
2097 }
2098
2099 unsafe fn decode(
2100 &mut self,
2101 decoder: &mut fidl::encoding::Decoder<
2102 '_,
2103 fidl::encoding::DefaultFuchsiaResourceDialect,
2104 >,
2105 offset: usize,
2106 mut depth: fidl::encoding::Depth,
2107 ) -> fidl::Result<()> {
2108 decoder.debug_check_bounds::<Self>(offset);
2109 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2110 None => return Err(fidl::Error::NotNullable),
2111 Some(len) => len,
2112 };
2113 if len == 0 {
2115 return Ok(());
2116 };
2117 depth.increment()?;
2118 let envelope_size = 8;
2119 let bytes_len = len * envelope_size;
2120 let offset = decoder.out_of_line_offset(bytes_len)?;
2121 let mut _next_ordinal_to_read = 0;
2123 let mut next_offset = offset;
2124 let end_offset = offset + bytes_len;
2125 _next_ordinal_to_read += 1;
2126 if next_offset >= end_offset {
2127 return Ok(());
2128 }
2129
2130 while _next_ordinal_to_read < 1 {
2132 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2133 _next_ordinal_to_read += 1;
2134 next_offset += envelope_size;
2135 }
2136
2137 let next_out_of_line = decoder.next_out_of_line();
2138 let handles_before = decoder.remaining_handles();
2139 if let Some((inlined, num_bytes, num_handles)) =
2140 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2141 {
2142 let member_inline_size =
2143 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2144 if inlined != (member_inline_size <= 4) {
2145 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2146 }
2147 let inner_offset;
2148 let mut inner_depth = depth.clone();
2149 if inlined {
2150 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2151 inner_offset = next_offset;
2152 } else {
2153 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2154 inner_depth.increment()?;
2155 }
2156 let val_ref = self.has_runner_node.get_or_insert_with(|| {
2157 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
2158 });
2159 fidl::decode!(
2160 bool,
2161 fidl::encoding::DefaultFuchsiaResourceDialect,
2162 val_ref,
2163 decoder,
2164 inner_offset,
2165 inner_depth
2166 )?;
2167 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2168 {
2169 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2170 }
2171 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2172 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2173 }
2174 }
2175
2176 next_offset += envelope_size;
2177 _next_ordinal_to_read += 1;
2178 if next_offset >= end_offset {
2179 return Ok(());
2180 }
2181
2182 while _next_ordinal_to_read < 2 {
2184 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2185 _next_ordinal_to_read += 1;
2186 next_offset += envelope_size;
2187 }
2188
2189 let next_out_of_line = decoder.next_out_of_line();
2190 let handles_before = decoder.remaining_handles();
2191 if let Some((inlined, num_bytes, num_handles)) =
2192 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2193 {
2194 let member_inline_size =
2195 <DiffType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2196 if inlined != (member_inline_size <= 4) {
2197 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2198 }
2199 let inner_offset;
2200 let mut inner_depth = depth.clone();
2201 if inlined {
2202 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2203 inner_offset = next_offset;
2204 } else {
2205 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2206 inner_depth.increment()?;
2207 }
2208 let val_ref = self.diff_type.get_or_insert_with(|| {
2209 fidl::new_empty!(DiffType, fidl::encoding::DefaultFuchsiaResourceDialect)
2210 });
2211 fidl::decode!(
2212 DiffType,
2213 fidl::encoding::DefaultFuchsiaResourceDialect,
2214 val_ref,
2215 decoder,
2216 inner_offset,
2217 inner_depth
2218 )?;
2219 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2220 {
2221 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2222 }
2223 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2224 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2225 }
2226 }
2227
2228 next_offset += envelope_size;
2229
2230 while next_offset < end_offset {
2232 _next_ordinal_to_read += 1;
2233 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2234 next_offset += envelope_size;
2235 }
2236
2237 Ok(())
2238 }
2239 }
2240}