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