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