fidl_diagnostics_validate/
fidl_diagnostics_validate.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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    /// Defaults to false
50    pub has_runner_node: Option<bool>,
51    /// Defaults to FULL
52    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    /// Waits until an event arrives and returns it. It is safe for other
136    /// threads to make concurrent requests while waiting for an event.
137    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    /// Initializes the Inspect library being tested by the puppet.
145    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    /// Provides configuration values for the validator.
164    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    /// Use instead of `Initialize` on puppets which support the Tree / Lazy method of getting VMOs.
182    /// The root VMO can be obtained via the returned Tree protocol.
183    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    /// Instruct the puppet to publish its current data over InspectSink.
205    ///
206    /// Note: It is an error for more than one Validate connection to
207    /// Publish at once. Unpublish must be called to cleanup.
208    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    /// Modifies the contents of the VMO.
223    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    /// Modifies the contents of a lazy node.
242    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    /// Checks that !Send lazy values work correctly, using a LazyAction similar to ActLazy.
261    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    /// Create a new Proxy for diagnostics.validate/InspectPuppet.
326    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    /// Get a Stream of events from the remote end of the protocol.
332    ///
333    /// # Panics
334    ///
335    /// Panics if the event stream was already taken.
336    pub fn take_event_stream(&self) -> InspectPuppetEventStream {
337        InspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
338    }
339
340    /// Initializes the Inspect library being tested by the puppet.
341    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    /// Provides configuration values for the validator.
352    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    /// Use instead of `Initialize` on puppets which support the Tree / Lazy method of getting VMOs.
362    /// The root VMO can be obtained via the returned Tree protocol.
363    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    /// Instruct the puppet to publish its current data over InspectSink.
374    ///
375    /// Note: It is an error for more than one Validate connection to
376    /// Publish at once. Unpublish must be called to cleanup.
377    pub fn r#publish(
378        &self,
379    ) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
380    {
381        InspectPuppetProxyInterface::r#publish(self)
382    }
383
384    /// Modifies the contents of the VMO.
385    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    /// Modifies the contents of a lazy node.
394    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    /// Checks that !Send lazy values work correctly, using a LazyAction similar to ActLazy.
403    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 of the event that was sent.
620        ordinal: u64,
621    },
622}
623
624impl InspectPuppetEvent {
625    /// Decodes a message buffer as a [`InspectPuppetEvent`].
626    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
644/// A Stream of incoming requests for diagnostics.validate/InspectPuppet.
645pub 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                // A message has been received from the channel
717                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    /// Initializes the Inspect library being tested by the puppet.
888    Initialize { params: InitializationParams, responder: InspectPuppetInitializeResponder },
889    /// Provides configuration values for the validator.
890    GetConfig { responder: InspectPuppetGetConfigResponder },
891    /// Use instead of `Initialize` on puppets which support the Tree / Lazy method of getting VMOs.
892    /// The root VMO can be obtained via the returned Tree protocol.
893    InitializeTree { params: InitializationParams, responder: InspectPuppetInitializeTreeResponder },
894    /// Instruct the puppet to publish its current data over InspectSink.
895    ///
896    /// Note: It is an error for more than one Validate connection to
897    /// Publish at once. Unpublish must be called to cleanup.
898    Publish { responder: InspectPuppetPublishResponder },
899    /// Modifies the contents of the VMO.
900    Act { action: Action, responder: InspectPuppetActResponder },
901    /// Modifies the contents of a lazy node.
902    ActLazy { lazy_action: LazyAction, responder: InspectPuppetActLazyResponder },
903    /// Checks that !Send lazy values work correctly, using a LazyAction similar to ActLazy.
904    ActLazyThreadLocal {
905        lazy_action: LazyAction,
906        responder: InspectPuppetActLazyThreadLocalResponder,
907    },
908    /// An interaction was received which does not match any known method.
909    #[non_exhaustive]
910    _UnknownMethod {
911        /// Ordinal of the method that was called.
912        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    /// Name of the method defined in FIDL
989    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
1018    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1019        self.inner.shutdown_with_epitaph(status)
1020    }
1021
1022    fn is_closed(&self) -> bool {
1023        self.inner.channel().is_closed()
1024    }
1025    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1026        self.inner.channel().on_closed()
1027    }
1028
1029    #[cfg(target_os = "fuchsia")]
1030    fn signal_peer(
1031        &self,
1032        clear_mask: zx::Signals,
1033        set_mask: zx::Signals,
1034    ) -> Result<(), zx_status::Status> {
1035        use fidl::Peered;
1036        self.inner.channel().signal_peer(clear_mask, set_mask)
1037    }
1038}
1039
1040impl InspectPuppetControlHandle {}
1041
1042#[must_use = "FIDL methods require a response to be sent"]
1043#[derive(Debug)]
1044pub struct InspectPuppetInitializeResponder {
1045    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1046    tx_id: u32,
1047}
1048
1049/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
1050/// if the responder is dropped without sending a response, so that the client
1051/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1052impl std::ops::Drop for InspectPuppetInitializeResponder {
1053    fn drop(&mut self) {
1054        self.control_handle.shutdown();
1055        // Safety: drops once, never accessed again
1056        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1057    }
1058}
1059
1060impl fidl::endpoints::Responder for InspectPuppetInitializeResponder {
1061    type ControlHandle = InspectPuppetControlHandle;
1062
1063    fn control_handle(&self) -> &InspectPuppetControlHandle {
1064        &self.control_handle
1065    }
1066
1067    fn drop_without_shutdown(mut self) {
1068        // Safety: drops once, never accessed again due to mem::forget
1069        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1070        // Prevent Drop from running (which would shut down the channel)
1071        std::mem::forget(self);
1072    }
1073}
1074
1075impl InspectPuppetInitializeResponder {
1076    /// Sends a response to the FIDL transaction.
1077    ///
1078    /// Sets the channel to shutdown if an error occurs.
1079    pub fn send(
1080        self,
1081        mut vmo: Option<fidl::NullableHandle>,
1082        mut result: TestResult,
1083    ) -> Result<(), fidl::Error> {
1084        let _result = self.send_raw(vmo, result);
1085        if _result.is_err() {
1086            self.control_handle.shutdown();
1087        }
1088        self.drop_without_shutdown();
1089        _result
1090    }
1091
1092    /// Similar to "send" but does not shutdown the channel if an error occurs.
1093    pub fn send_no_shutdown_on_err(
1094        self,
1095        mut vmo: Option<fidl::NullableHandle>,
1096        mut result: TestResult,
1097    ) -> Result<(), fidl::Error> {
1098        let _result = self.send_raw(vmo, result);
1099        self.drop_without_shutdown();
1100        _result
1101    }
1102
1103    fn send_raw(
1104        &self,
1105        mut vmo: Option<fidl::NullableHandle>,
1106        mut result: TestResult,
1107    ) -> Result<(), fidl::Error> {
1108        self.control_handle
1109            .inner
1110            .send::<fidl::encoding::FlexibleType<InspectPuppetInitializeResponse>>(
1111                fidl::encoding::Flexible::new((vmo, result)),
1112                self.tx_id,
1113                0x6f6c1f23e5665591,
1114                fidl::encoding::DynamicFlags::FLEXIBLE,
1115            )
1116    }
1117}
1118
1119#[must_use = "FIDL methods require a response to be sent"]
1120#[derive(Debug)]
1121pub struct InspectPuppetGetConfigResponder {
1122    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1123    tx_id: u32,
1124}
1125
1126/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
1127/// if the responder is dropped without sending a response, so that the client
1128/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1129impl std::ops::Drop for InspectPuppetGetConfigResponder {
1130    fn drop(&mut self) {
1131        self.control_handle.shutdown();
1132        // Safety: drops once, never accessed again
1133        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1134    }
1135}
1136
1137impl fidl::endpoints::Responder for InspectPuppetGetConfigResponder {
1138    type ControlHandle = InspectPuppetControlHandle;
1139
1140    fn control_handle(&self) -> &InspectPuppetControlHandle {
1141        &self.control_handle
1142    }
1143
1144    fn drop_without_shutdown(mut self) {
1145        // Safety: drops once, never accessed again due to mem::forget
1146        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1147        // Prevent Drop from running (which would shut down the channel)
1148        std::mem::forget(self);
1149    }
1150}
1151
1152impl InspectPuppetGetConfigResponder {
1153    /// Sends a response to the FIDL transaction.
1154    ///
1155    /// Sets the channel to shutdown if an error occurs.
1156    pub fn send(self, mut printable_name: &str, mut options: Options) -> Result<(), fidl::Error> {
1157        let _result = self.send_raw(printable_name, options);
1158        if _result.is_err() {
1159            self.control_handle.shutdown();
1160        }
1161        self.drop_without_shutdown();
1162        _result
1163    }
1164
1165    /// Similar to "send" but does not shutdown the channel if an error occurs.
1166    pub fn send_no_shutdown_on_err(
1167        self,
1168        mut printable_name: &str,
1169        mut options: Options,
1170    ) -> Result<(), fidl::Error> {
1171        let _result = self.send_raw(printable_name, options);
1172        self.drop_without_shutdown();
1173        _result
1174    }
1175
1176    fn send_raw(&self, mut printable_name: &str, mut options: Options) -> Result<(), fidl::Error> {
1177        self.control_handle
1178            .inner
1179            .send::<fidl::encoding::FlexibleType<InspectPuppetGetConfigResponse>>(
1180                fidl::encoding::Flexible::new((printable_name, &mut options)),
1181                self.tx_id,
1182                0x61588d76bae449fd,
1183                fidl::encoding::DynamicFlags::FLEXIBLE,
1184            )
1185    }
1186}
1187
1188#[must_use = "FIDL methods require a response to be sent"]
1189#[derive(Debug)]
1190pub struct InspectPuppetInitializeTreeResponder {
1191    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1192    tx_id: u32,
1193}
1194
1195/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
1196/// if the responder is dropped without sending a response, so that the client
1197/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1198impl std::ops::Drop for InspectPuppetInitializeTreeResponder {
1199    fn drop(&mut self) {
1200        self.control_handle.shutdown();
1201        // Safety: drops once, never accessed again
1202        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1203    }
1204}
1205
1206impl fidl::endpoints::Responder for InspectPuppetInitializeTreeResponder {
1207    type ControlHandle = InspectPuppetControlHandle;
1208
1209    fn control_handle(&self) -> &InspectPuppetControlHandle {
1210        &self.control_handle
1211    }
1212
1213    fn drop_without_shutdown(mut self) {
1214        // Safety: drops once, never accessed again due to mem::forget
1215        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1216        // Prevent Drop from running (which would shut down the channel)
1217        std::mem::forget(self);
1218    }
1219}
1220
1221impl InspectPuppetInitializeTreeResponder {
1222    /// Sends a response to the FIDL transaction.
1223    ///
1224    /// Sets the channel to shutdown if an error occurs.
1225    pub fn send(
1226        self,
1227        mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
1228        mut result: TestResult,
1229    ) -> Result<(), fidl::Error> {
1230        let _result = self.send_raw(tree, result);
1231        if _result.is_err() {
1232            self.control_handle.shutdown();
1233        }
1234        self.drop_without_shutdown();
1235        _result
1236    }
1237
1238    /// Similar to "send" but does not shutdown the channel if an error occurs.
1239    pub fn send_no_shutdown_on_err(
1240        self,
1241        mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
1242        mut result: TestResult,
1243    ) -> Result<(), fidl::Error> {
1244        let _result = self.send_raw(tree, result);
1245        self.drop_without_shutdown();
1246        _result
1247    }
1248
1249    fn send_raw(
1250        &self,
1251        mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
1252        mut result: TestResult,
1253    ) -> Result<(), fidl::Error> {
1254        self.control_handle
1255            .inner
1256            .send::<fidl::encoding::FlexibleType<InspectPuppetInitializeTreeResponse>>(
1257                fidl::encoding::Flexible::new((tree, result)),
1258                self.tx_id,
1259                0x1dba90332d970658,
1260                fidl::encoding::DynamicFlags::FLEXIBLE,
1261            )
1262    }
1263}
1264
1265#[must_use = "FIDL methods require a response to be sent"]
1266#[derive(Debug)]
1267pub struct InspectPuppetPublishResponder {
1268    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1269    tx_id: u32,
1270}
1271
1272/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
1273/// if the responder is dropped without sending a response, so that the client
1274/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1275impl std::ops::Drop for InspectPuppetPublishResponder {
1276    fn drop(&mut self) {
1277        self.control_handle.shutdown();
1278        // Safety: drops once, never accessed again
1279        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1280    }
1281}
1282
1283impl fidl::endpoints::Responder for InspectPuppetPublishResponder {
1284    type ControlHandle = InspectPuppetControlHandle;
1285
1286    fn control_handle(&self) -> &InspectPuppetControlHandle {
1287        &self.control_handle
1288    }
1289
1290    fn drop_without_shutdown(mut self) {
1291        // Safety: drops once, never accessed again due to mem::forget
1292        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1293        // Prevent Drop from running (which would shut down the channel)
1294        std::mem::forget(self);
1295    }
1296}
1297
1298impl InspectPuppetPublishResponder {
1299    /// Sends a response to the FIDL transaction.
1300    ///
1301    /// Sets the channel to shutdown if an error occurs.
1302    pub fn send(self, mut result: TestResult) -> Result<(), fidl::Error> {
1303        let _result = self.send_raw(result);
1304        if _result.is_err() {
1305            self.control_handle.shutdown();
1306        }
1307        self.drop_without_shutdown();
1308        _result
1309    }
1310
1311    /// Similar to "send" but does not shutdown the channel if an error occurs.
1312    pub fn send_no_shutdown_on_err(self, mut result: TestResult) -> Result<(), fidl::Error> {
1313        let _result = self.send_raw(result);
1314        self.drop_without_shutdown();
1315        _result
1316    }
1317
1318    fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
1319        self.control_handle
1320            .inner
1321            .send::<fidl::encoding::FlexibleType<InspectPuppetPublishResponse>>(
1322                fidl::encoding::Flexible::new((result,)),
1323                self.tx_id,
1324                0x2cb88b53aa897dd8,
1325                fidl::encoding::DynamicFlags::FLEXIBLE,
1326            )
1327    }
1328}
1329
1330#[must_use = "FIDL methods require a response to be sent"]
1331#[derive(Debug)]
1332pub struct InspectPuppetActResponder {
1333    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1334    tx_id: u32,
1335}
1336
1337/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
1338/// if the responder is dropped without sending a response, so that the client
1339/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1340impl std::ops::Drop for InspectPuppetActResponder {
1341    fn drop(&mut self) {
1342        self.control_handle.shutdown();
1343        // Safety: drops once, never accessed again
1344        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1345    }
1346}
1347
1348impl fidl::endpoints::Responder for InspectPuppetActResponder {
1349    type ControlHandle = InspectPuppetControlHandle;
1350
1351    fn control_handle(&self) -> &InspectPuppetControlHandle {
1352        &self.control_handle
1353    }
1354
1355    fn drop_without_shutdown(mut self) {
1356        // Safety: drops once, never accessed again due to mem::forget
1357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1358        // Prevent Drop from running (which would shut down the channel)
1359        std::mem::forget(self);
1360    }
1361}
1362
1363impl InspectPuppetActResponder {
1364    /// Sends a response to the FIDL transaction.
1365    ///
1366    /// Sets the channel to shutdown if an error occurs.
1367    pub fn send(self, mut result: TestResult) -> Result<(), fidl::Error> {
1368        let _result = self.send_raw(result);
1369        if _result.is_err() {
1370            self.control_handle.shutdown();
1371        }
1372        self.drop_without_shutdown();
1373        _result
1374    }
1375
1376    /// Similar to "send" but does not shutdown the channel if an error occurs.
1377    pub fn send_no_shutdown_on_err(self, mut result: TestResult) -> Result<(), fidl::Error> {
1378        let _result = self.send_raw(result);
1379        self.drop_without_shutdown();
1380        _result
1381    }
1382
1383    fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
1384        self.control_handle.inner.send::<fidl::encoding::FlexibleType<InspectPuppetActResponse>>(
1385            fidl::encoding::Flexible::new((result,)),
1386            self.tx_id,
1387            0x72760753739e292f,
1388            fidl::encoding::DynamicFlags::FLEXIBLE,
1389        )
1390    }
1391}
1392
1393#[must_use = "FIDL methods require a response to be sent"]
1394#[derive(Debug)]
1395pub struct InspectPuppetActLazyResponder {
1396    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1397    tx_id: u32,
1398}
1399
1400/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
1401/// if the responder is dropped without sending a response, so that the client
1402/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1403impl std::ops::Drop for InspectPuppetActLazyResponder {
1404    fn drop(&mut self) {
1405        self.control_handle.shutdown();
1406        // Safety: drops once, never accessed again
1407        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1408    }
1409}
1410
1411impl fidl::endpoints::Responder for InspectPuppetActLazyResponder {
1412    type ControlHandle = InspectPuppetControlHandle;
1413
1414    fn control_handle(&self) -> &InspectPuppetControlHandle {
1415        &self.control_handle
1416    }
1417
1418    fn drop_without_shutdown(mut self) {
1419        // Safety: drops once, never accessed again due to mem::forget
1420        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1421        // Prevent Drop from running (which would shut down the channel)
1422        std::mem::forget(self);
1423    }
1424}
1425
1426impl InspectPuppetActLazyResponder {
1427    /// Sends a response to the FIDL transaction.
1428    ///
1429    /// Sets the channel to shutdown if an error occurs.
1430    pub fn send(self, mut result: TestResult) -> Result<(), fidl::Error> {
1431        let _result = self.send_raw(result);
1432        if _result.is_err() {
1433            self.control_handle.shutdown();
1434        }
1435        self.drop_without_shutdown();
1436        _result
1437    }
1438
1439    /// Similar to "send" but does not shutdown the channel if an error occurs.
1440    pub fn send_no_shutdown_on_err(self, mut result: TestResult) -> Result<(), fidl::Error> {
1441        let _result = self.send_raw(result);
1442        self.drop_without_shutdown();
1443        _result
1444    }
1445
1446    fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
1447        self.control_handle
1448            .inner
1449            .send::<fidl::encoding::FlexibleType<InspectPuppetActLazyResponse>>(
1450                fidl::encoding::Flexible::new((result,)),
1451                self.tx_id,
1452                0x2d43263540a22a5f,
1453                fidl::encoding::DynamicFlags::FLEXIBLE,
1454            )
1455    }
1456}
1457
1458#[must_use = "FIDL methods require a response to be sent"]
1459#[derive(Debug)]
1460pub struct InspectPuppetActLazyThreadLocalResponder {
1461    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
1462    tx_id: u32,
1463}
1464
1465/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
1466/// if the responder is dropped without sending a response, so that the client
1467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1468impl std::ops::Drop for InspectPuppetActLazyThreadLocalResponder {
1469    fn drop(&mut self) {
1470        self.control_handle.shutdown();
1471        // Safety: drops once, never accessed again
1472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1473    }
1474}
1475
1476impl fidl::endpoints::Responder for InspectPuppetActLazyThreadLocalResponder {
1477    type ControlHandle = InspectPuppetControlHandle;
1478
1479    fn control_handle(&self) -> &InspectPuppetControlHandle {
1480        &self.control_handle
1481    }
1482
1483    fn drop_without_shutdown(mut self) {
1484        // Safety: drops once, never accessed again due to mem::forget
1485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1486        // Prevent Drop from running (which would shut down the channel)
1487        std::mem::forget(self);
1488    }
1489}
1490
1491impl InspectPuppetActLazyThreadLocalResponder {
1492    /// Sends a response to the FIDL transaction.
1493    ///
1494    /// Sets the channel to shutdown if an error occurs.
1495    pub fn send(self, mut result: TestResult) -> Result<(), fidl::Error> {
1496        let _result = self.send_raw(result);
1497        if _result.is_err() {
1498            self.control_handle.shutdown();
1499        }
1500        self.drop_without_shutdown();
1501        _result
1502    }
1503
1504    /// Similar to "send" but does not shutdown the channel if an error occurs.
1505    pub fn send_no_shutdown_on_err(self, mut result: TestResult) -> Result<(), fidl::Error> {
1506        let _result = self.send_raw(result);
1507        self.drop_without_shutdown();
1508        _result
1509    }
1510
1511    fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
1512        self.control_handle.inner.send::<fidl::encoding::FlexibleType<
1513            InspectPuppetActLazyThreadLocalResponse,
1514        >>(
1515            fidl::encoding::Flexible::new((result,)),
1516            self.tx_id,
1517            0x258a20305861670,
1518            fidl::encoding::DynamicFlags::FLEXIBLE,
1519        )
1520    }
1521}
1522
1523mod internal {
1524    use super::*;
1525
1526    impl fidl::encoding::ResourceTypeMarker for InspectPuppetGetConfigResponse {
1527        type Borrowed<'a> = &'a mut Self;
1528        fn take_or_borrow<'a>(
1529            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1530        ) -> Self::Borrowed<'a> {
1531            value
1532        }
1533    }
1534
1535    unsafe impl fidl::encoding::TypeMarker for InspectPuppetGetConfigResponse {
1536        type Owned = Self;
1537
1538        #[inline(always)]
1539        fn inline_align(_context: fidl::encoding::Context) -> usize {
1540            8
1541        }
1542
1543        #[inline(always)]
1544        fn inline_size(_context: fidl::encoding::Context) -> usize {
1545            32
1546        }
1547    }
1548
1549    unsafe impl
1550        fidl::encoding::Encode<
1551            InspectPuppetGetConfigResponse,
1552            fidl::encoding::DefaultFuchsiaResourceDialect,
1553        > for &mut InspectPuppetGetConfigResponse
1554    {
1555        #[inline]
1556        unsafe fn encode(
1557            self,
1558            encoder: &mut fidl::encoding::Encoder<
1559                '_,
1560                fidl::encoding::DefaultFuchsiaResourceDialect,
1561            >,
1562            offset: usize,
1563            _depth: fidl::encoding::Depth,
1564        ) -> fidl::Result<()> {
1565            encoder.debug_check_bounds::<InspectPuppetGetConfigResponse>(offset);
1566            // Delegate to tuple encoding.
1567            fidl::encoding::Encode::<
1568                InspectPuppetGetConfigResponse,
1569                fidl::encoding::DefaultFuchsiaResourceDialect,
1570            >::encode(
1571                (
1572                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1573                        &self.printable_name,
1574                    ),
1575                    <Options as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1576                        &mut self.options,
1577                    ),
1578                ),
1579                encoder,
1580                offset,
1581                _depth,
1582            )
1583        }
1584    }
1585    unsafe impl<
1586        T0: fidl::encoding::Encode<
1587                fidl::encoding::UnboundedString,
1588                fidl::encoding::DefaultFuchsiaResourceDialect,
1589            >,
1590        T1: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
1591    >
1592        fidl::encoding::Encode<
1593            InspectPuppetGetConfigResponse,
1594            fidl::encoding::DefaultFuchsiaResourceDialect,
1595        > for (T0, T1)
1596    {
1597        #[inline]
1598        unsafe fn encode(
1599            self,
1600            encoder: &mut fidl::encoding::Encoder<
1601                '_,
1602                fidl::encoding::DefaultFuchsiaResourceDialect,
1603            >,
1604            offset: usize,
1605            depth: fidl::encoding::Depth,
1606        ) -> fidl::Result<()> {
1607            encoder.debug_check_bounds::<InspectPuppetGetConfigResponse>(offset);
1608            // Zero out padding regions. There's no need to apply masks
1609            // because the unmasked parts will be overwritten by fields.
1610            // Write the fields.
1611            self.0.encode(encoder, offset + 0, depth)?;
1612            self.1.encode(encoder, offset + 16, depth)?;
1613            Ok(())
1614        }
1615    }
1616
1617    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1618        for InspectPuppetGetConfigResponse
1619    {
1620        #[inline(always)]
1621        fn new_empty() -> Self {
1622            Self {
1623                printable_name: fidl::new_empty!(
1624                    fidl::encoding::UnboundedString,
1625                    fidl::encoding::DefaultFuchsiaResourceDialect
1626                ),
1627                options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
1628            }
1629        }
1630
1631        #[inline]
1632        unsafe fn decode(
1633            &mut self,
1634            decoder: &mut fidl::encoding::Decoder<
1635                '_,
1636                fidl::encoding::DefaultFuchsiaResourceDialect,
1637            >,
1638            offset: usize,
1639            _depth: fidl::encoding::Depth,
1640        ) -> fidl::Result<()> {
1641            decoder.debug_check_bounds::<Self>(offset);
1642            // Verify that padding bytes are zero.
1643            fidl::decode!(
1644                fidl::encoding::UnboundedString,
1645                fidl::encoding::DefaultFuchsiaResourceDialect,
1646                &mut self.printable_name,
1647                decoder,
1648                offset + 0,
1649                _depth
1650            )?;
1651            fidl::decode!(
1652                Options,
1653                fidl::encoding::DefaultFuchsiaResourceDialect,
1654                &mut self.options,
1655                decoder,
1656                offset + 16,
1657                _depth
1658            )?;
1659            Ok(())
1660        }
1661    }
1662
1663    impl fidl::encoding::ResourceTypeMarker for InspectPuppetInitializeTreeResponse {
1664        type Borrowed<'a> = &'a mut Self;
1665        fn take_or_borrow<'a>(
1666            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1667        ) -> Self::Borrowed<'a> {
1668            value
1669        }
1670    }
1671
1672    unsafe impl fidl::encoding::TypeMarker for InspectPuppetInitializeTreeResponse {
1673        type Owned = Self;
1674
1675        #[inline(always)]
1676        fn inline_align(_context: fidl::encoding::Context) -> usize {
1677            4
1678        }
1679
1680        #[inline(always)]
1681        fn inline_size(_context: fidl::encoding::Context) -> usize {
1682            8
1683        }
1684    }
1685
1686    unsafe impl
1687        fidl::encoding::Encode<
1688            InspectPuppetInitializeTreeResponse,
1689            fidl::encoding::DefaultFuchsiaResourceDialect,
1690        > for &mut InspectPuppetInitializeTreeResponse
1691    {
1692        #[inline]
1693        unsafe fn encode(
1694            self,
1695            encoder: &mut fidl::encoding::Encoder<
1696                '_,
1697                fidl::encoding::DefaultFuchsiaResourceDialect,
1698            >,
1699            offset: usize,
1700            _depth: fidl::encoding::Depth,
1701        ) -> fidl::Result<()> {
1702            encoder.debug_check_bounds::<InspectPuppetInitializeTreeResponse>(offset);
1703            // Delegate to tuple encoding.
1704            fidl::encoding::Encode::<
1705                InspectPuppetInitializeTreeResponse,
1706                fidl::encoding::DefaultFuchsiaResourceDialect,
1707            >::encode(
1708                (
1709                    <fidl::encoding::Optional<
1710                        fidl::encoding::Endpoint<
1711                            fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
1712                        >,
1713                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1714                        &mut self.tree
1715                    ),
1716                    <TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),
1717                ),
1718                encoder,
1719                offset,
1720                _depth,
1721            )
1722        }
1723    }
1724    unsafe impl<
1725        T0: fidl::encoding::Encode<
1726                fidl::encoding::Optional<
1727                    fidl::encoding::Endpoint<
1728                        fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
1729                    >,
1730                >,
1731                fidl::encoding::DefaultFuchsiaResourceDialect,
1732            >,
1733        T1: fidl::encoding::Encode<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>,
1734    >
1735        fidl::encoding::Encode<
1736            InspectPuppetInitializeTreeResponse,
1737            fidl::encoding::DefaultFuchsiaResourceDialect,
1738        > for (T0, T1)
1739    {
1740        #[inline]
1741        unsafe fn encode(
1742            self,
1743            encoder: &mut fidl::encoding::Encoder<
1744                '_,
1745                fidl::encoding::DefaultFuchsiaResourceDialect,
1746            >,
1747            offset: usize,
1748            depth: fidl::encoding::Depth,
1749        ) -> fidl::Result<()> {
1750            encoder.debug_check_bounds::<InspectPuppetInitializeTreeResponse>(offset);
1751            // Zero out padding regions. There's no need to apply masks
1752            // because the unmasked parts will be overwritten by fields.
1753            // Write the fields.
1754            self.0.encode(encoder, offset + 0, depth)?;
1755            self.1.encode(encoder, offset + 4, depth)?;
1756            Ok(())
1757        }
1758    }
1759
1760    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1761        for InspectPuppetInitializeTreeResponse
1762    {
1763        #[inline(always)]
1764        fn new_empty() -> Self {
1765            Self {
1766                tree: fidl::new_empty!(
1767                    fidl::encoding::Optional<
1768                        fidl::encoding::Endpoint<
1769                            fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
1770                        >,
1771                    >,
1772                    fidl::encoding::DefaultFuchsiaResourceDialect
1773                ),
1774                result: fidl::new_empty!(TestResult, fidl::encoding::DefaultFuchsiaResourceDialect),
1775            }
1776        }
1777
1778        #[inline]
1779        unsafe fn decode(
1780            &mut self,
1781            decoder: &mut fidl::encoding::Decoder<
1782                '_,
1783                fidl::encoding::DefaultFuchsiaResourceDialect,
1784            >,
1785            offset: usize,
1786            _depth: fidl::encoding::Depth,
1787        ) -> fidl::Result<()> {
1788            decoder.debug_check_bounds::<Self>(offset);
1789            // Verify that padding bytes are zero.
1790            fidl::decode!(
1791                fidl::encoding::Optional<
1792                    fidl::encoding::Endpoint<
1793                        fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
1794                    >,
1795                >,
1796                fidl::encoding::DefaultFuchsiaResourceDialect,
1797                &mut self.tree,
1798                decoder,
1799                offset + 0,
1800                _depth
1801            )?;
1802            fidl::decode!(
1803                TestResult,
1804                fidl::encoding::DefaultFuchsiaResourceDialect,
1805                &mut self.result,
1806                decoder,
1807                offset + 4,
1808                _depth
1809            )?;
1810            Ok(())
1811        }
1812    }
1813
1814    impl fidl::encoding::ResourceTypeMarker for InspectPuppetInitializeResponse {
1815        type Borrowed<'a> = &'a mut Self;
1816        fn take_or_borrow<'a>(
1817            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1818        ) -> Self::Borrowed<'a> {
1819            value
1820        }
1821    }
1822
1823    unsafe impl fidl::encoding::TypeMarker for InspectPuppetInitializeResponse {
1824        type Owned = Self;
1825
1826        #[inline(always)]
1827        fn inline_align(_context: fidl::encoding::Context) -> usize {
1828            4
1829        }
1830
1831        #[inline(always)]
1832        fn inline_size(_context: fidl::encoding::Context) -> usize {
1833            8
1834        }
1835    }
1836
1837    unsafe impl
1838        fidl::encoding::Encode<
1839            InspectPuppetInitializeResponse,
1840            fidl::encoding::DefaultFuchsiaResourceDialect,
1841        > for &mut InspectPuppetInitializeResponse
1842    {
1843        #[inline]
1844        unsafe fn encode(
1845            self,
1846            encoder: &mut fidl::encoding::Encoder<
1847                '_,
1848                fidl::encoding::DefaultFuchsiaResourceDialect,
1849            >,
1850            offset: usize,
1851            _depth: fidl::encoding::Depth,
1852        ) -> fidl::Result<()> {
1853            encoder.debug_check_bounds::<InspectPuppetInitializeResponse>(offset);
1854            // Delegate to tuple encoding.
1855            fidl::encoding::Encode::<
1856                InspectPuppetInitializeResponse,
1857                fidl::encoding::DefaultFuchsiaResourceDialect,
1858            >::encode(
1859                (
1860                    <fidl::encoding::Optional<
1861                        fidl::encoding::HandleType<
1862                            fidl::NullableHandle,
1863                            { fidl::ObjectType::NONE.into_raw() },
1864                            2147483648,
1865                        >,
1866                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1867                        &mut self.vmo
1868                    ),
1869                    <TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),
1870                ),
1871                encoder,
1872                offset,
1873                _depth,
1874            )
1875        }
1876    }
1877    unsafe impl<
1878        T0: fidl::encoding::Encode<
1879                fidl::encoding::Optional<
1880                    fidl::encoding::HandleType<
1881                        fidl::NullableHandle,
1882                        { fidl::ObjectType::NONE.into_raw() },
1883                        2147483648,
1884                    >,
1885                >,
1886                fidl::encoding::DefaultFuchsiaResourceDialect,
1887            >,
1888        T1: fidl::encoding::Encode<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>,
1889    >
1890        fidl::encoding::Encode<
1891            InspectPuppetInitializeResponse,
1892            fidl::encoding::DefaultFuchsiaResourceDialect,
1893        > for (T0, T1)
1894    {
1895        #[inline]
1896        unsafe fn encode(
1897            self,
1898            encoder: &mut fidl::encoding::Encoder<
1899                '_,
1900                fidl::encoding::DefaultFuchsiaResourceDialect,
1901            >,
1902            offset: usize,
1903            depth: fidl::encoding::Depth,
1904        ) -> fidl::Result<()> {
1905            encoder.debug_check_bounds::<InspectPuppetInitializeResponse>(offset);
1906            // Zero out padding regions. There's no need to apply masks
1907            // because the unmasked parts will be overwritten by fields.
1908            // Write the fields.
1909            self.0.encode(encoder, offset + 0, depth)?;
1910            self.1.encode(encoder, offset + 4, depth)?;
1911            Ok(())
1912        }
1913    }
1914
1915    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1916        for InspectPuppetInitializeResponse
1917    {
1918        #[inline(always)]
1919        fn new_empty() -> Self {
1920            Self {
1921                vmo: fidl::new_empty!(
1922                    fidl::encoding::Optional<
1923                        fidl::encoding::HandleType<
1924                            fidl::NullableHandle,
1925                            { fidl::ObjectType::NONE.into_raw() },
1926                            2147483648,
1927                        >,
1928                    >,
1929                    fidl::encoding::DefaultFuchsiaResourceDialect
1930                ),
1931                result: fidl::new_empty!(TestResult, fidl::encoding::DefaultFuchsiaResourceDialect),
1932            }
1933        }
1934
1935        #[inline]
1936        unsafe fn decode(
1937            &mut self,
1938            decoder: &mut fidl::encoding::Decoder<
1939                '_,
1940                fidl::encoding::DefaultFuchsiaResourceDialect,
1941            >,
1942            offset: usize,
1943            _depth: fidl::encoding::Depth,
1944        ) -> fidl::Result<()> {
1945            decoder.debug_check_bounds::<Self>(offset);
1946            // Verify that padding bytes are zero.
1947            fidl::decode!(
1948                fidl::encoding::Optional<
1949                    fidl::encoding::HandleType<
1950                        fidl::NullableHandle,
1951                        { fidl::ObjectType::NONE.into_raw() },
1952                        2147483648,
1953                    >,
1954                >,
1955                fidl::encoding::DefaultFuchsiaResourceDialect,
1956                &mut self.vmo,
1957                decoder,
1958                offset + 0,
1959                _depth
1960            )?;
1961            fidl::decode!(
1962                TestResult,
1963                fidl::encoding::DefaultFuchsiaResourceDialect,
1964                &mut self.result,
1965                decoder,
1966                offset + 4,
1967                _depth
1968            )?;
1969            Ok(())
1970        }
1971    }
1972
1973    impl Options {
1974        #[inline(always)]
1975        fn max_ordinal_present(&self) -> u64 {
1976            if let Some(_) = self.diff_type {
1977                return 2;
1978            }
1979            if let Some(_) = self.has_runner_node {
1980                return 1;
1981            }
1982            0
1983        }
1984    }
1985
1986    impl fidl::encoding::ResourceTypeMarker for Options {
1987        type Borrowed<'a> = &'a mut Self;
1988        fn take_or_borrow<'a>(
1989            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1990        ) -> Self::Borrowed<'a> {
1991            value
1992        }
1993    }
1994
1995    unsafe impl fidl::encoding::TypeMarker for Options {
1996        type Owned = Self;
1997
1998        #[inline(always)]
1999        fn inline_align(_context: fidl::encoding::Context) -> usize {
2000            8
2001        }
2002
2003        #[inline(always)]
2004        fn inline_size(_context: fidl::encoding::Context) -> usize {
2005            16
2006        }
2007    }
2008
2009    unsafe impl fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>
2010        for &mut Options
2011    {
2012        unsafe fn encode(
2013            self,
2014            encoder: &mut fidl::encoding::Encoder<
2015                '_,
2016                fidl::encoding::DefaultFuchsiaResourceDialect,
2017            >,
2018            offset: usize,
2019            mut depth: fidl::encoding::Depth,
2020        ) -> fidl::Result<()> {
2021            encoder.debug_check_bounds::<Options>(offset);
2022            // Vector header
2023            let max_ordinal: u64 = self.max_ordinal_present();
2024            encoder.write_num(max_ordinal, offset);
2025            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2026            // Calling encoder.out_of_line_offset(0) is not allowed.
2027            if max_ordinal == 0 {
2028                return Ok(());
2029            }
2030            depth.increment()?;
2031            let envelope_size = 8;
2032            let bytes_len = max_ordinal as usize * envelope_size;
2033            #[allow(unused_variables)]
2034            let offset = encoder.out_of_line_offset(bytes_len);
2035            let mut _prev_end_offset: usize = 0;
2036            if 1 > max_ordinal {
2037                return Ok(());
2038            }
2039
2040            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2041            // are envelope_size bytes.
2042            let cur_offset: usize = (1 - 1) * envelope_size;
2043
2044            // Zero reserved fields.
2045            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2046
2047            // Safety:
2048            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2049            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2050            //   envelope_size bytes, there is always sufficient room.
2051            fidl::encoding::encode_in_envelope_optional::<
2052                bool,
2053                fidl::encoding::DefaultFuchsiaResourceDialect,
2054            >(
2055                self.has_runner_node
2056                    .as_ref()
2057                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2058                encoder,
2059                offset + cur_offset,
2060                depth,
2061            )?;
2062
2063            _prev_end_offset = cur_offset + envelope_size;
2064            if 2 > max_ordinal {
2065                return Ok(());
2066            }
2067
2068            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2069            // are envelope_size bytes.
2070            let cur_offset: usize = (2 - 1) * envelope_size;
2071
2072            // Zero reserved fields.
2073            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2074
2075            // Safety:
2076            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2077            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2078            //   envelope_size bytes, there is always sufficient room.
2079            fidl::encoding::encode_in_envelope_optional::<
2080                DiffType,
2081                fidl::encoding::DefaultFuchsiaResourceDialect,
2082            >(
2083                self.diff_type.as_ref().map(<DiffType as fidl::encoding::ValueTypeMarker>::borrow),
2084                encoder,
2085                offset + cur_offset,
2086                depth,
2087            )?;
2088
2089            _prev_end_offset = cur_offset + envelope_size;
2090
2091            Ok(())
2092        }
2093    }
2094
2095    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Options {
2096        #[inline(always)]
2097        fn new_empty() -> Self {
2098            Self::default()
2099        }
2100
2101        unsafe fn decode(
2102            &mut self,
2103            decoder: &mut fidl::encoding::Decoder<
2104                '_,
2105                fidl::encoding::DefaultFuchsiaResourceDialect,
2106            >,
2107            offset: usize,
2108            mut depth: fidl::encoding::Depth,
2109        ) -> fidl::Result<()> {
2110            decoder.debug_check_bounds::<Self>(offset);
2111            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2112                None => return Err(fidl::Error::NotNullable),
2113                Some(len) => len,
2114            };
2115            // Calling decoder.out_of_line_offset(0) is not allowed.
2116            if len == 0 {
2117                return Ok(());
2118            };
2119            depth.increment()?;
2120            let envelope_size = 8;
2121            let bytes_len = len * envelope_size;
2122            let offset = decoder.out_of_line_offset(bytes_len)?;
2123            // Decode the envelope for each type.
2124            let mut _next_ordinal_to_read = 0;
2125            let mut next_offset = offset;
2126            let end_offset = offset + bytes_len;
2127            _next_ordinal_to_read += 1;
2128            if next_offset >= end_offset {
2129                return Ok(());
2130            }
2131
2132            // Decode unknown envelopes for gaps in ordinals.
2133            while _next_ordinal_to_read < 1 {
2134                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2135                _next_ordinal_to_read += 1;
2136                next_offset += envelope_size;
2137            }
2138
2139            let next_out_of_line = decoder.next_out_of_line();
2140            let handles_before = decoder.remaining_handles();
2141            if let Some((inlined, num_bytes, num_handles)) =
2142                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2143            {
2144                let member_inline_size =
2145                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2146                if inlined != (member_inline_size <= 4) {
2147                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2148                }
2149                let inner_offset;
2150                let mut inner_depth = depth.clone();
2151                if inlined {
2152                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2153                    inner_offset = next_offset;
2154                } else {
2155                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2156                    inner_depth.increment()?;
2157                }
2158                let val_ref = self.has_runner_node.get_or_insert_with(|| {
2159                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
2160                });
2161                fidl::decode!(
2162                    bool,
2163                    fidl::encoding::DefaultFuchsiaResourceDialect,
2164                    val_ref,
2165                    decoder,
2166                    inner_offset,
2167                    inner_depth
2168                )?;
2169                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2170                {
2171                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2172                }
2173                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2174                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2175                }
2176            }
2177
2178            next_offset += envelope_size;
2179            _next_ordinal_to_read += 1;
2180            if next_offset >= end_offset {
2181                return Ok(());
2182            }
2183
2184            // Decode unknown envelopes for gaps in ordinals.
2185            while _next_ordinal_to_read < 2 {
2186                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2187                _next_ordinal_to_read += 1;
2188                next_offset += envelope_size;
2189            }
2190
2191            let next_out_of_line = decoder.next_out_of_line();
2192            let handles_before = decoder.remaining_handles();
2193            if let Some((inlined, num_bytes, num_handles)) =
2194                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2195            {
2196                let member_inline_size =
2197                    <DiffType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2198                if inlined != (member_inline_size <= 4) {
2199                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2200                }
2201                let inner_offset;
2202                let mut inner_depth = depth.clone();
2203                if inlined {
2204                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2205                    inner_offset = next_offset;
2206                } else {
2207                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2208                    inner_depth.increment()?;
2209                }
2210                let val_ref = self.diff_type.get_or_insert_with(|| {
2211                    fidl::new_empty!(DiffType, fidl::encoding::DefaultFuchsiaResourceDialect)
2212                });
2213                fidl::decode!(
2214                    DiffType,
2215                    fidl::encoding::DefaultFuchsiaResourceDialect,
2216                    val_ref,
2217                    decoder,
2218                    inner_offset,
2219                    inner_depth
2220                )?;
2221                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2222                {
2223                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2224                }
2225                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2226                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2227                }
2228            }
2229
2230            next_offset += envelope_size;
2231
2232            // Decode the remaining unknown envelopes.
2233            while next_offset < end_offset {
2234                _next_ordinal_to_read += 1;
2235                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2236                next_offset += envelope_size;
2237            }
2238
2239            Ok(())
2240        }
2241    }
2242}