fidl_fuchsia_archivist_test/
fidl_fuchsia_archivist_test.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_fuchsia_archivist_test__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct InspectPuppetCreateInspectorFromEscrowResponse {
16    pub writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
17    pub data: fidl::Vmo,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21    for InspectPuppetCreateInspectorFromEscrowResponse
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct InspectPuppetCreateInspectorResponse {
27    pub writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
31    for InspectPuppetCreateInspectorResponse
32{
33}
34
35#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub struct InspectWriterRecordLazyValuesResponse {
37    pub client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41    for InspectWriterRecordLazyValuesResponse
42{
43}
44
45#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct PuppetRecordLazyValuesResponse {
47    pub client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
51    for PuppetRecordLazyValuesResponse
52{
53}
54
55#[derive(Debug, PartialEq)]
56pub struct RealmFactoryCreateRealmRequest {
57    pub options: RealmOptions,
58    pub realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
59}
60
61impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
62    for RealmFactoryCreateRealmRequest
63{
64}
65
66#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
67pub struct StopWatcherWatchComponentResponse {
68    pub client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
69}
70
71impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
72    for StopWatcherWatchComponentResponse
73{
74}
75
76#[derive(Debug, Default, PartialEq)]
77pub struct InspectPuppetCreateInspectorFromEscrowRequest {
78    pub token: Option<fidl_fuchsia_inspect::EscrowToken>,
79    #[doc(hidden)]
80    pub __source_breaking: fidl::marker::SourceBreaking,
81}
82
83impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
84    for InspectPuppetCreateInspectorFromEscrowRequest
85{
86}
87
88#[derive(Debug, Default, PartialEq)]
89pub struct InspectWriterEscrowAndExitResponse {
90    pub token: Option<fidl_fuchsia_inspect::EscrowToken>,
91    #[doc(hidden)]
92    pub __source_breaking: fidl::marker::SourceBreaking,
93}
94
95impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
96    for InspectWriterEscrowAndExitResponse
97{
98}
99
100#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
101pub struct InspectPuppetMarker;
102
103impl fidl::endpoints::ProtocolMarker for InspectPuppetMarker {
104    type Proxy = InspectPuppetProxy;
105    type RequestStream = InspectPuppetRequestStream;
106    #[cfg(target_os = "fuchsia")]
107    type SynchronousProxy = InspectPuppetSynchronousProxy;
108
109    const DEBUG_NAME: &'static str = "fuchsia.archivist.test.InspectPuppet";
110}
111impl fidl::endpoints::DiscoverableProtocolMarker for InspectPuppetMarker {}
112
113pub trait InspectPuppetProxyInterface: Send + Sync {
114    type CreateInspectorResponseFut: std::future::Future<
115            Output = Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error>,
116        > + Send;
117    fn r#create_inspector(
118        &self,
119        payload: &InspectPuppetCreateInspectorRequest,
120    ) -> Self::CreateInspectorResponseFut;
121    type CreateInspectorFromEscrowResponseFut: std::future::Future<
122            Output = Result<
123                (fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo),
124                fidl::Error,
125            >,
126        > + Send;
127    fn r#create_inspector_from_escrow(
128        &self,
129        payload: InspectPuppetCreateInspectorFromEscrowRequest,
130    ) -> Self::CreateInspectorFromEscrowResponseFut;
131}
132#[derive(Debug)]
133#[cfg(target_os = "fuchsia")]
134pub struct InspectPuppetSynchronousProxy {
135    client: fidl::client::sync::Client,
136}
137
138#[cfg(target_os = "fuchsia")]
139impl fidl::endpoints::SynchronousProxy for InspectPuppetSynchronousProxy {
140    type Proxy = InspectPuppetProxy;
141    type Protocol = InspectPuppetMarker;
142
143    fn from_channel(inner: fidl::Channel) -> Self {
144        Self::new(inner)
145    }
146
147    fn into_channel(self) -> fidl::Channel {
148        self.client.into_channel()
149    }
150
151    fn as_channel(&self) -> &fidl::Channel {
152        self.client.as_channel()
153    }
154}
155
156#[cfg(target_os = "fuchsia")]
157impl InspectPuppetSynchronousProxy {
158    pub fn new(channel: fidl::Channel) -> Self {
159        let protocol_name = <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
160        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
161    }
162
163    pub fn into_channel(self) -> fidl::Channel {
164        self.client.into_channel()
165    }
166
167    /// Waits until an event arrives and returns it. It is safe for other
168    /// threads to make concurrent requests while waiting for an event.
169    pub fn wait_for_event(
170        &self,
171        deadline: zx::MonotonicInstant,
172    ) -> Result<InspectPuppetEvent, fidl::Error> {
173        InspectPuppetEvent::decode(self.client.wait_for_event(deadline)?)
174    }
175
176    /// Create and serve an Inspector with the provided name.
177    /// InspectWriters created this way are RAII.
178    pub fn r#create_inspector(
179        &self,
180        mut payload: &InspectPuppetCreateInspectorRequest,
181        ___deadline: zx::MonotonicInstant,
182    ) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
183        let _response = self.client.send_query::<
184            InspectPuppetCreateInspectorRequest,
185            fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
186        >(
187            payload,
188            0x2c0f807d7d159bb,
189            fidl::encoding::DynamicFlags::FLEXIBLE,
190            ___deadline,
191        )?
192        .into_result::<InspectPuppetMarker>("create_inspector")?;
193        Ok(_response.writer)
194    }
195
196    /// Create and serve an Inspector with the same name as a previous escrowed instance.
197    /// Also returns a VMO with the previously escrowed inspect data.
198    /// InspectWriters created this way are RAII.
199    pub fn r#create_inspector_from_escrow(
200        &self,
201        mut payload: InspectPuppetCreateInspectorFromEscrowRequest,
202        ___deadline: zx::MonotonicInstant,
203    ) -> Result<(fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo), fidl::Error> {
204        let _response = self.client.send_query::<
205            InspectPuppetCreateInspectorFromEscrowRequest,
206            fidl::encoding::FlexibleType<InspectPuppetCreateInspectorFromEscrowResponse>,
207        >(
208            &mut payload,
209            0xe79c0d0606c5df,
210            fidl::encoding::DynamicFlags::FLEXIBLE,
211            ___deadline,
212        )?
213        .into_result::<InspectPuppetMarker>("create_inspector_from_escrow")?;
214        Ok((_response.writer, _response.data))
215    }
216}
217
218#[cfg(target_os = "fuchsia")]
219impl From<InspectPuppetSynchronousProxy> for zx::Handle {
220    fn from(value: InspectPuppetSynchronousProxy) -> Self {
221        value.into_channel().into()
222    }
223}
224
225#[cfg(target_os = "fuchsia")]
226impl From<fidl::Channel> for InspectPuppetSynchronousProxy {
227    fn from(value: fidl::Channel) -> Self {
228        Self::new(value)
229    }
230}
231
232#[cfg(target_os = "fuchsia")]
233impl fidl::endpoints::FromClient for InspectPuppetSynchronousProxy {
234    type Protocol = InspectPuppetMarker;
235
236    fn from_client(value: fidl::endpoints::ClientEnd<InspectPuppetMarker>) -> Self {
237        Self::new(value.into_channel())
238    }
239}
240
241#[derive(Debug, Clone)]
242pub struct InspectPuppetProxy {
243    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
244}
245
246impl fidl::endpoints::Proxy for InspectPuppetProxy {
247    type Protocol = InspectPuppetMarker;
248
249    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
250        Self::new(inner)
251    }
252
253    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
254        self.client.into_channel().map_err(|client| Self { client })
255    }
256
257    fn as_channel(&self) -> &::fidl::AsyncChannel {
258        self.client.as_channel()
259    }
260}
261
262impl InspectPuppetProxy {
263    /// Create a new Proxy for fuchsia.archivist.test/InspectPuppet.
264    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
265        let protocol_name = <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
266        Self { client: fidl::client::Client::new(channel, protocol_name) }
267    }
268
269    /// Get a Stream of events from the remote end of the protocol.
270    ///
271    /// # Panics
272    ///
273    /// Panics if the event stream was already taken.
274    pub fn take_event_stream(&self) -> InspectPuppetEventStream {
275        InspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
276    }
277
278    /// Create and serve an Inspector with the provided name.
279    /// InspectWriters created this way are RAII.
280    pub fn r#create_inspector(
281        &self,
282        mut payload: &InspectPuppetCreateInspectorRequest,
283    ) -> fidl::client::QueryResponseFut<
284        fidl::endpoints::ClientEnd<InspectWriterMarker>,
285        fidl::encoding::DefaultFuchsiaResourceDialect,
286    > {
287        InspectPuppetProxyInterface::r#create_inspector(self, payload)
288    }
289
290    /// Create and serve an Inspector with the same name as a previous escrowed instance.
291    /// Also returns a VMO with the previously escrowed inspect data.
292    /// InspectWriters created this way are RAII.
293    pub fn r#create_inspector_from_escrow(
294        &self,
295        mut payload: InspectPuppetCreateInspectorFromEscrowRequest,
296    ) -> fidl::client::QueryResponseFut<
297        (fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo),
298        fidl::encoding::DefaultFuchsiaResourceDialect,
299    > {
300        InspectPuppetProxyInterface::r#create_inspector_from_escrow(self, payload)
301    }
302}
303
304impl InspectPuppetProxyInterface for InspectPuppetProxy {
305    type CreateInspectorResponseFut = fidl::client::QueryResponseFut<
306        fidl::endpoints::ClientEnd<InspectWriterMarker>,
307        fidl::encoding::DefaultFuchsiaResourceDialect,
308    >;
309    fn r#create_inspector(
310        &self,
311        mut payload: &InspectPuppetCreateInspectorRequest,
312    ) -> Self::CreateInspectorResponseFut {
313        fn _decode(
314            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
315        ) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
316            let _response = fidl::client::decode_transaction_body::<
317                fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
318                fidl::encoding::DefaultFuchsiaResourceDialect,
319                0x2c0f807d7d159bb,
320            >(_buf?)?
321            .into_result::<InspectPuppetMarker>("create_inspector")?;
322            Ok(_response.writer)
323        }
324        self.client.send_query_and_decode::<
325            InspectPuppetCreateInspectorRequest,
326            fidl::endpoints::ClientEnd<InspectWriterMarker>,
327        >(
328            payload,
329            0x2c0f807d7d159bb,
330            fidl::encoding::DynamicFlags::FLEXIBLE,
331            _decode,
332        )
333    }
334
335    type CreateInspectorFromEscrowResponseFut = fidl::client::QueryResponseFut<
336        (fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo),
337        fidl::encoding::DefaultFuchsiaResourceDialect,
338    >;
339    fn r#create_inspector_from_escrow(
340        &self,
341        mut payload: InspectPuppetCreateInspectorFromEscrowRequest,
342    ) -> Self::CreateInspectorFromEscrowResponseFut {
343        fn _decode(
344            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
345        ) -> Result<(fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo), fidl::Error>
346        {
347            let _response = fidl::client::decode_transaction_body::<
348                fidl::encoding::FlexibleType<InspectPuppetCreateInspectorFromEscrowResponse>,
349                fidl::encoding::DefaultFuchsiaResourceDialect,
350                0xe79c0d0606c5df,
351            >(_buf?)?
352            .into_result::<InspectPuppetMarker>("create_inspector_from_escrow")?;
353            Ok((_response.writer, _response.data))
354        }
355        self.client.send_query_and_decode::<
356            InspectPuppetCreateInspectorFromEscrowRequest,
357            (fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo),
358        >(
359            &mut payload,
360            0xe79c0d0606c5df,
361            fidl::encoding::DynamicFlags::FLEXIBLE,
362            _decode,
363        )
364    }
365}
366
367pub struct InspectPuppetEventStream {
368    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
369}
370
371impl std::marker::Unpin for InspectPuppetEventStream {}
372
373impl futures::stream::FusedStream for InspectPuppetEventStream {
374    fn is_terminated(&self) -> bool {
375        self.event_receiver.is_terminated()
376    }
377}
378
379impl futures::Stream for InspectPuppetEventStream {
380    type Item = Result<InspectPuppetEvent, fidl::Error>;
381
382    fn poll_next(
383        mut self: std::pin::Pin<&mut Self>,
384        cx: &mut std::task::Context<'_>,
385    ) -> std::task::Poll<Option<Self::Item>> {
386        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
387            &mut self.event_receiver,
388            cx
389        )?) {
390            Some(buf) => std::task::Poll::Ready(Some(InspectPuppetEvent::decode(buf))),
391            None => std::task::Poll::Ready(None),
392        }
393    }
394}
395
396#[derive(Debug)]
397pub enum InspectPuppetEvent {
398    #[non_exhaustive]
399    _UnknownEvent {
400        /// Ordinal of the event that was sent.
401        ordinal: u64,
402    },
403}
404
405impl InspectPuppetEvent {
406    /// Decodes a message buffer as a [`InspectPuppetEvent`].
407    fn decode(
408        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
409    ) -> Result<InspectPuppetEvent, fidl::Error> {
410        let (bytes, _handles) = buf.split_mut();
411        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
412        debug_assert_eq!(tx_header.tx_id, 0);
413        match tx_header.ordinal {
414            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
415                Ok(InspectPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
416            }
417            _ => Err(fidl::Error::UnknownOrdinal {
418                ordinal: tx_header.ordinal,
419                protocol_name: <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
420            }),
421        }
422    }
423}
424
425/// A Stream of incoming requests for fuchsia.archivist.test/InspectPuppet.
426pub struct InspectPuppetRequestStream {
427    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
428    is_terminated: bool,
429}
430
431impl std::marker::Unpin for InspectPuppetRequestStream {}
432
433impl futures::stream::FusedStream for InspectPuppetRequestStream {
434    fn is_terminated(&self) -> bool {
435        self.is_terminated
436    }
437}
438
439impl fidl::endpoints::RequestStream for InspectPuppetRequestStream {
440    type Protocol = InspectPuppetMarker;
441    type ControlHandle = InspectPuppetControlHandle;
442
443    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
444        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
445    }
446
447    fn control_handle(&self) -> Self::ControlHandle {
448        InspectPuppetControlHandle { inner: self.inner.clone() }
449    }
450
451    fn into_inner(
452        self,
453    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
454    {
455        (self.inner, self.is_terminated)
456    }
457
458    fn from_inner(
459        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
460        is_terminated: bool,
461    ) -> Self {
462        Self { inner, is_terminated }
463    }
464}
465
466impl futures::Stream for InspectPuppetRequestStream {
467    type Item = Result<InspectPuppetRequest, fidl::Error>;
468
469    fn poll_next(
470        mut self: std::pin::Pin<&mut Self>,
471        cx: &mut std::task::Context<'_>,
472    ) -> std::task::Poll<Option<Self::Item>> {
473        let this = &mut *self;
474        if this.inner.check_shutdown(cx) {
475            this.is_terminated = true;
476            return std::task::Poll::Ready(None);
477        }
478        if this.is_terminated {
479            panic!("polled InspectPuppetRequestStream after completion");
480        }
481        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
482            |bytes, handles| {
483                match this.inner.channel().read_etc(cx, bytes, handles) {
484                    std::task::Poll::Ready(Ok(())) => {}
485                    std::task::Poll::Pending => return std::task::Poll::Pending,
486                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
487                        this.is_terminated = true;
488                        return std::task::Poll::Ready(None);
489                    }
490                    std::task::Poll::Ready(Err(e)) => {
491                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
492                            e.into(),
493                        ))));
494                    }
495                }
496
497                // A message has been received from the channel
498                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
499
500                std::task::Poll::Ready(Some(match header.ordinal {
501                    0x2c0f807d7d159bb => {
502                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
503                        let mut req = fidl::new_empty!(
504                            InspectPuppetCreateInspectorRequest,
505                            fidl::encoding::DefaultFuchsiaResourceDialect
506                        );
507                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetCreateInspectorRequest>(&header, _body_bytes, handles, &mut req)?;
508                        let control_handle =
509                            InspectPuppetControlHandle { inner: this.inner.clone() };
510                        Ok(InspectPuppetRequest::CreateInspector {
511                            payload: req,
512                            responder: InspectPuppetCreateInspectorResponder {
513                                control_handle: std::mem::ManuallyDrop::new(control_handle),
514                                tx_id: header.tx_id,
515                            },
516                        })
517                    }
518                    0xe79c0d0606c5df => {
519                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
520                        let mut req = fidl::new_empty!(
521                            InspectPuppetCreateInspectorFromEscrowRequest,
522                            fidl::encoding::DefaultFuchsiaResourceDialect
523                        );
524                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetCreateInspectorFromEscrowRequest>(&header, _body_bytes, handles, &mut req)?;
525                        let control_handle =
526                            InspectPuppetControlHandle { inner: this.inner.clone() };
527                        Ok(InspectPuppetRequest::CreateInspectorFromEscrow {
528                            payload: req,
529                            responder: InspectPuppetCreateInspectorFromEscrowResponder {
530                                control_handle: std::mem::ManuallyDrop::new(control_handle),
531                                tx_id: header.tx_id,
532                            },
533                        })
534                    }
535                    _ if header.tx_id == 0
536                        && header
537                            .dynamic_flags()
538                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
539                    {
540                        Ok(InspectPuppetRequest::_UnknownMethod {
541                            ordinal: header.ordinal,
542                            control_handle: InspectPuppetControlHandle {
543                                inner: this.inner.clone(),
544                            },
545                            method_type: fidl::MethodType::OneWay,
546                        })
547                    }
548                    _ if header
549                        .dynamic_flags()
550                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
551                    {
552                        this.inner.send_framework_err(
553                            fidl::encoding::FrameworkErr::UnknownMethod,
554                            header.tx_id,
555                            header.ordinal,
556                            header.dynamic_flags(),
557                            (bytes, handles),
558                        )?;
559                        Ok(InspectPuppetRequest::_UnknownMethod {
560                            ordinal: header.ordinal,
561                            control_handle: InspectPuppetControlHandle {
562                                inner: this.inner.clone(),
563                            },
564                            method_type: fidl::MethodType::TwoWay,
565                        })
566                    }
567                    _ => Err(fidl::Error::UnknownOrdinal {
568                        ordinal: header.ordinal,
569                        protocol_name:
570                            <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
571                    }),
572                }))
573            },
574        )
575    }
576}
577
578/// InspectPuppet allows creating and serving Inspectors.
579#[derive(Debug)]
580pub enum InspectPuppetRequest {
581    /// Create and serve an Inspector with the provided name.
582    /// InspectWriters created this way are RAII.
583    CreateInspector {
584        payload: InspectPuppetCreateInspectorRequest,
585        responder: InspectPuppetCreateInspectorResponder,
586    },
587    /// Create and serve an Inspector with the same name as a previous escrowed instance.
588    /// Also returns a VMO with the previously escrowed inspect data.
589    /// InspectWriters created this way are RAII.
590    CreateInspectorFromEscrow {
591        payload: InspectPuppetCreateInspectorFromEscrowRequest,
592        responder: InspectPuppetCreateInspectorFromEscrowResponder,
593    },
594    /// An interaction was received which does not match any known method.
595    #[non_exhaustive]
596    _UnknownMethod {
597        /// Ordinal of the method that was called.
598        ordinal: u64,
599        control_handle: InspectPuppetControlHandle,
600        method_type: fidl::MethodType,
601    },
602}
603
604impl InspectPuppetRequest {
605    #[allow(irrefutable_let_patterns)]
606    pub fn into_create_inspector(
607        self,
608    ) -> Option<(InspectPuppetCreateInspectorRequest, InspectPuppetCreateInspectorResponder)> {
609        if let InspectPuppetRequest::CreateInspector { payload, responder } = self {
610            Some((payload, responder))
611        } else {
612            None
613        }
614    }
615
616    #[allow(irrefutable_let_patterns)]
617    pub fn into_create_inspector_from_escrow(
618        self,
619    ) -> Option<(
620        InspectPuppetCreateInspectorFromEscrowRequest,
621        InspectPuppetCreateInspectorFromEscrowResponder,
622    )> {
623        if let InspectPuppetRequest::CreateInspectorFromEscrow { payload, responder } = self {
624            Some((payload, responder))
625        } else {
626            None
627        }
628    }
629
630    /// Name of the method defined in FIDL
631    pub fn method_name(&self) -> &'static str {
632        match *self {
633            InspectPuppetRequest::CreateInspector { .. } => "create_inspector",
634            InspectPuppetRequest::CreateInspectorFromEscrow { .. } => {
635                "create_inspector_from_escrow"
636            }
637            InspectPuppetRequest::_UnknownMethod {
638                method_type: fidl::MethodType::OneWay, ..
639            } => "unknown one-way method",
640            InspectPuppetRequest::_UnknownMethod {
641                method_type: fidl::MethodType::TwoWay, ..
642            } => "unknown two-way method",
643        }
644    }
645}
646
647#[derive(Debug, Clone)]
648pub struct InspectPuppetControlHandle {
649    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
650}
651
652impl fidl::endpoints::ControlHandle for InspectPuppetControlHandle {
653    fn shutdown(&self) {
654        self.inner.shutdown()
655    }
656    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
657        self.inner.shutdown_with_epitaph(status)
658    }
659
660    fn is_closed(&self) -> bool {
661        self.inner.channel().is_closed()
662    }
663    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
664        self.inner.channel().on_closed()
665    }
666
667    #[cfg(target_os = "fuchsia")]
668    fn signal_peer(
669        &self,
670        clear_mask: zx::Signals,
671        set_mask: zx::Signals,
672    ) -> Result<(), zx_status::Status> {
673        use fidl::Peered;
674        self.inner.channel().signal_peer(clear_mask, set_mask)
675    }
676}
677
678impl InspectPuppetControlHandle {}
679
680#[must_use = "FIDL methods require a response to be sent"]
681#[derive(Debug)]
682pub struct InspectPuppetCreateInspectorResponder {
683    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
684    tx_id: u32,
685}
686
687/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
688/// if the responder is dropped without sending a response, so that the client
689/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
690impl std::ops::Drop for InspectPuppetCreateInspectorResponder {
691    fn drop(&mut self) {
692        self.control_handle.shutdown();
693        // Safety: drops once, never accessed again
694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
695    }
696}
697
698impl fidl::endpoints::Responder for InspectPuppetCreateInspectorResponder {
699    type ControlHandle = InspectPuppetControlHandle;
700
701    fn control_handle(&self) -> &InspectPuppetControlHandle {
702        &self.control_handle
703    }
704
705    fn drop_without_shutdown(mut self) {
706        // Safety: drops once, never accessed again due to mem::forget
707        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
708        // Prevent Drop from running (which would shut down the channel)
709        std::mem::forget(self);
710    }
711}
712
713impl InspectPuppetCreateInspectorResponder {
714    /// Sends a response to the FIDL transaction.
715    ///
716    /// Sets the channel to shutdown if an error occurs.
717    pub fn send(
718        self,
719        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
720    ) -> Result<(), fidl::Error> {
721        let _result = self.send_raw(writer);
722        if _result.is_err() {
723            self.control_handle.shutdown();
724        }
725        self.drop_without_shutdown();
726        _result
727    }
728
729    /// Similar to "send" but does not shutdown the channel if an error occurs.
730    pub fn send_no_shutdown_on_err(
731        self,
732        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
733    ) -> Result<(), fidl::Error> {
734        let _result = self.send_raw(writer);
735        self.drop_without_shutdown();
736        _result
737    }
738
739    fn send_raw(
740        &self,
741        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
742    ) -> Result<(), fidl::Error> {
743        self.control_handle
744            .inner
745            .send::<fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>>(
746                fidl::encoding::Flexible::new((writer,)),
747                self.tx_id,
748                0x2c0f807d7d159bb,
749                fidl::encoding::DynamicFlags::FLEXIBLE,
750            )
751    }
752}
753
754#[must_use = "FIDL methods require a response to be sent"]
755#[derive(Debug)]
756pub struct InspectPuppetCreateInspectorFromEscrowResponder {
757    control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
758    tx_id: u32,
759}
760
761/// Set the the channel to be shutdown (see [`InspectPuppetControlHandle::shutdown`])
762/// if the responder is dropped without sending a response, so that the client
763/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
764impl std::ops::Drop for InspectPuppetCreateInspectorFromEscrowResponder {
765    fn drop(&mut self) {
766        self.control_handle.shutdown();
767        // Safety: drops once, never accessed again
768        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
769    }
770}
771
772impl fidl::endpoints::Responder for InspectPuppetCreateInspectorFromEscrowResponder {
773    type ControlHandle = InspectPuppetControlHandle;
774
775    fn control_handle(&self) -> &InspectPuppetControlHandle {
776        &self.control_handle
777    }
778
779    fn drop_without_shutdown(mut self) {
780        // Safety: drops once, never accessed again due to mem::forget
781        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
782        // Prevent Drop from running (which would shut down the channel)
783        std::mem::forget(self);
784    }
785}
786
787impl InspectPuppetCreateInspectorFromEscrowResponder {
788    /// Sends a response to the FIDL transaction.
789    ///
790    /// Sets the channel to shutdown if an error occurs.
791    pub fn send(
792        self,
793        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
794        mut data: fidl::Vmo,
795    ) -> Result<(), fidl::Error> {
796        let _result = self.send_raw(writer, data);
797        if _result.is_err() {
798            self.control_handle.shutdown();
799        }
800        self.drop_without_shutdown();
801        _result
802    }
803
804    /// Similar to "send" but does not shutdown the channel if an error occurs.
805    pub fn send_no_shutdown_on_err(
806        self,
807        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
808        mut data: fidl::Vmo,
809    ) -> Result<(), fidl::Error> {
810        let _result = self.send_raw(writer, data);
811        self.drop_without_shutdown();
812        _result
813    }
814
815    fn send_raw(
816        &self,
817        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
818        mut data: fidl::Vmo,
819    ) -> Result<(), fidl::Error> {
820        self.control_handle.inner.send::<fidl::encoding::FlexibleType<
821            InspectPuppetCreateInspectorFromEscrowResponse,
822        >>(
823            fidl::encoding::Flexible::new((writer, data)),
824            self.tx_id,
825            0xe79c0d0606c5df,
826            fidl::encoding::DynamicFlags::FLEXIBLE,
827        )
828    }
829}
830
831#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
832pub struct InspectWriterMarker;
833
834impl fidl::endpoints::ProtocolMarker for InspectWriterMarker {
835    type Proxy = InspectWriterProxy;
836    type RequestStream = InspectWriterRequestStream;
837    #[cfg(target_os = "fuchsia")]
838    type SynchronousProxy = InspectWriterSynchronousProxy;
839
840    const DEBUG_NAME: &'static str = "(anonymous) InspectWriter";
841}
842
843pub trait InspectWriterProxyInterface: Send + Sync {
844    type SetHealthOkResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
845    fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut;
846    type SetHealthStartingUpResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
847        + Send;
848    fn r#set_health_starting_up(&self) -> Self::SetHealthStartingUpResponseFut;
849    type RecordStringResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
850    fn r#record_string(&self, key: &str, value: &str) -> Self::RecordStringResponseFut;
851    type RecordIntResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
852    fn r#record_int(&self, key: &str, value: i64) -> Self::RecordIntResponseFut;
853    type EmitExampleInspectDataResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
854        + Send;
855    fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut;
856    type EscrowAndExitResponseFut: std::future::Future<Output = Result<InspectWriterEscrowAndExitResponse, fidl::Error>>
857        + Send;
858    fn r#escrow_and_exit(
859        &self,
860        payload: &InspectWriterEscrowAndExitRequest,
861    ) -> Self::EscrowAndExitResponseFut;
862    type RecordLazyValuesResponseFut: std::future::Future<
863            Output = Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error>,
864        > + Send;
865    fn r#record_lazy_values(&self, key: &str) -> Self::RecordLazyValuesResponseFut;
866}
867#[derive(Debug)]
868#[cfg(target_os = "fuchsia")]
869pub struct InspectWriterSynchronousProxy {
870    client: fidl::client::sync::Client,
871}
872
873#[cfg(target_os = "fuchsia")]
874impl fidl::endpoints::SynchronousProxy for InspectWriterSynchronousProxy {
875    type Proxy = InspectWriterProxy;
876    type Protocol = InspectWriterMarker;
877
878    fn from_channel(inner: fidl::Channel) -> Self {
879        Self::new(inner)
880    }
881
882    fn into_channel(self) -> fidl::Channel {
883        self.client.into_channel()
884    }
885
886    fn as_channel(&self) -> &fidl::Channel {
887        self.client.as_channel()
888    }
889}
890
891#[cfg(target_os = "fuchsia")]
892impl InspectWriterSynchronousProxy {
893    pub fn new(channel: fidl::Channel) -> Self {
894        let protocol_name = <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
895        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
896    }
897
898    pub fn into_channel(self) -> fidl::Channel {
899        self.client.into_channel()
900    }
901
902    /// Waits until an event arrives and returns it. It is safe for other
903    /// threads to make concurrent requests while waiting for an event.
904    pub fn wait_for_event(
905        &self,
906        deadline: zx::MonotonicInstant,
907    ) -> Result<InspectWriterEvent, fidl::Error> {
908        InspectWriterEvent::decode(self.client.wait_for_event(deadline)?)
909    }
910
911    /// Emits a health inspect node with OK status.
912    pub fn r#set_health_ok(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
913        let _response = self.client.send_query::<
914            fidl::encoding::EmptyPayload,
915            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
916        >(
917            (),
918            0xe7510549d99075e,
919            fidl::encoding::DynamicFlags::FLEXIBLE,
920            ___deadline,
921        )?
922        .into_result::<InspectWriterMarker>("set_health_ok")?;
923        Ok(_response)
924    }
925
926    /// Emits a health inspect node with STARTING_UP status.
927    pub fn r#set_health_starting_up(
928        &self,
929        ___deadline: zx::MonotonicInstant,
930    ) -> Result<(), fidl::Error> {
931        let _response = self.client.send_query::<
932            fidl::encoding::EmptyPayload,
933            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
934        >(
935            (),
936            0x6a7dbea8c4f52015,
937            fidl::encoding::DynamicFlags::FLEXIBLE,
938            ___deadline,
939        )?
940        .into_result::<InspectWriterMarker>("set_health_starting_up")?;
941        Ok(_response)
942    }
943
944    /// Records a string inspect property.
945    pub fn r#record_string(
946        &self,
947        mut key: &str,
948        mut value: &str,
949        ___deadline: zx::MonotonicInstant,
950    ) -> Result<(), fidl::Error> {
951        let _response = self.client.send_query::<
952            InspectWriterRecordStringRequest,
953            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
954        >(
955            (key, value,),
956            0x195be230721d712b,
957            fidl::encoding::DynamicFlags::FLEXIBLE,
958            ___deadline,
959        )?
960        .into_result::<InspectWriterMarker>("record_string")?;
961        Ok(_response)
962    }
963
964    /// Records an integer inspect property.
965    pub fn r#record_int(
966        &self,
967        mut key: &str,
968        mut value: i64,
969        ___deadline: zx::MonotonicInstant,
970    ) -> Result<(), fidl::Error> {
971        let _response = self.client.send_query::<
972            InspectWriterRecordIntRequest,
973            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
974        >(
975            (key, value,),
976            0xa2c6cbf0df0949,
977            fidl::encoding::DynamicFlags::FLEXIBLE,
978            ___deadline,
979        )?
980        .into_result::<InspectWriterMarker>("record_int")?;
981        Ok(_response)
982    }
983
984    /// Emits a collection of example of inspect data.
985    ///
986    /// TODO(https://fuchsia.dev/302716196): Split this into several methods
987    /// tests can call to explicitly emit the same data as this method.
988    pub fn r#emit_example_inspect_data(
989        &self,
990        ___deadline: zx::MonotonicInstant,
991    ) -> Result<(), fidl::Error> {
992        let _response = self.client.send_query::<
993            fidl::encoding::EmptyPayload,
994            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
995        >(
996            (),
997            0x228ae4647773fd94,
998            fidl::encoding::DynamicFlags::FLEXIBLE,
999            ___deadline,
1000        )?
1001        .into_result::<InspectWriterMarker>("emit_example_inspect_data")?;
1002        Ok(_response)
1003    }
1004
1005    /// Escrow the current inspect data and immediately exit afterwards.
1006    pub fn r#escrow_and_exit(
1007        &self,
1008        mut payload: &InspectWriterEscrowAndExitRequest,
1009        ___deadline: zx::MonotonicInstant,
1010    ) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
1011        let _response = self.client.send_query::<
1012            InspectWriterEscrowAndExitRequest,
1013            fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
1014        >(
1015            payload,
1016            0x60e24adbd0e588ff,
1017            fidl::encoding::DynamicFlags::FLEXIBLE,
1018            ___deadline,
1019        )?
1020        .into_result::<InspectWriterMarker>("escrow_and_exit")?;
1021        Ok(_response)
1022    }
1023
1024    /// Returns a LazyInspectPuppet client for recording lazy values.
1025    pub fn r#record_lazy_values(
1026        &self,
1027        mut key: &str,
1028        ___deadline: zx::MonotonicInstant,
1029    ) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
1030        let _response = self.client.send_query::<
1031            InspectWriterRecordLazyValuesRequest,
1032            fidl::encoding::FlexibleType<InspectWriterRecordLazyValuesResponse>,
1033        >(
1034            (key,),
1035            0xc637cf5d48e9063,
1036            fidl::encoding::DynamicFlags::FLEXIBLE,
1037            ___deadline,
1038        )?
1039        .into_result::<InspectWriterMarker>("record_lazy_values")?;
1040        Ok(_response.client)
1041    }
1042}
1043
1044#[cfg(target_os = "fuchsia")]
1045impl From<InspectWriterSynchronousProxy> for zx::Handle {
1046    fn from(value: InspectWriterSynchronousProxy) -> Self {
1047        value.into_channel().into()
1048    }
1049}
1050
1051#[cfg(target_os = "fuchsia")]
1052impl From<fidl::Channel> for InspectWriterSynchronousProxy {
1053    fn from(value: fidl::Channel) -> Self {
1054        Self::new(value)
1055    }
1056}
1057
1058#[cfg(target_os = "fuchsia")]
1059impl fidl::endpoints::FromClient for InspectWriterSynchronousProxy {
1060    type Protocol = InspectWriterMarker;
1061
1062    fn from_client(value: fidl::endpoints::ClientEnd<InspectWriterMarker>) -> Self {
1063        Self::new(value.into_channel())
1064    }
1065}
1066
1067#[derive(Debug, Clone)]
1068pub struct InspectWriterProxy {
1069    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1070}
1071
1072impl fidl::endpoints::Proxy for InspectWriterProxy {
1073    type Protocol = InspectWriterMarker;
1074
1075    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1076        Self::new(inner)
1077    }
1078
1079    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1080        self.client.into_channel().map_err(|client| Self { client })
1081    }
1082
1083    fn as_channel(&self) -> &::fidl::AsyncChannel {
1084        self.client.as_channel()
1085    }
1086}
1087
1088impl InspectWriterProxy {
1089    /// Create a new Proxy for fuchsia.archivist.test/InspectWriter.
1090    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1091        let protocol_name = <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1092        Self { client: fidl::client::Client::new(channel, protocol_name) }
1093    }
1094
1095    /// Get a Stream of events from the remote end of the protocol.
1096    ///
1097    /// # Panics
1098    ///
1099    /// Panics if the event stream was already taken.
1100    pub fn take_event_stream(&self) -> InspectWriterEventStream {
1101        InspectWriterEventStream { event_receiver: self.client.take_event_receiver() }
1102    }
1103
1104    /// Emits a health inspect node with OK status.
1105    pub fn r#set_health_ok(
1106        &self,
1107    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1108        InspectWriterProxyInterface::r#set_health_ok(self)
1109    }
1110
1111    /// Emits a health inspect node with STARTING_UP status.
1112    pub fn r#set_health_starting_up(
1113        &self,
1114    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1115        InspectWriterProxyInterface::r#set_health_starting_up(self)
1116    }
1117
1118    /// Records a string inspect property.
1119    pub fn r#record_string(
1120        &self,
1121        mut key: &str,
1122        mut value: &str,
1123    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1124        InspectWriterProxyInterface::r#record_string(self, key, value)
1125    }
1126
1127    /// Records an integer inspect property.
1128    pub fn r#record_int(
1129        &self,
1130        mut key: &str,
1131        mut value: i64,
1132    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1133        InspectWriterProxyInterface::r#record_int(self, key, value)
1134    }
1135
1136    /// Emits a collection of example of inspect data.
1137    ///
1138    /// TODO(https://fuchsia.dev/302716196): Split this into several methods
1139    /// tests can call to explicitly emit the same data as this method.
1140    pub fn r#emit_example_inspect_data(
1141        &self,
1142    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1143        InspectWriterProxyInterface::r#emit_example_inspect_data(self)
1144    }
1145
1146    /// Escrow the current inspect data and immediately exit afterwards.
1147    pub fn r#escrow_and_exit(
1148        &self,
1149        mut payload: &InspectWriterEscrowAndExitRequest,
1150    ) -> fidl::client::QueryResponseFut<
1151        InspectWriterEscrowAndExitResponse,
1152        fidl::encoding::DefaultFuchsiaResourceDialect,
1153    > {
1154        InspectWriterProxyInterface::r#escrow_and_exit(self, payload)
1155    }
1156
1157    /// Returns a LazyInspectPuppet client for recording lazy values.
1158    pub fn r#record_lazy_values(
1159        &self,
1160        mut key: &str,
1161    ) -> fidl::client::QueryResponseFut<
1162        fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
1163        fidl::encoding::DefaultFuchsiaResourceDialect,
1164    > {
1165        InspectWriterProxyInterface::r#record_lazy_values(self, key)
1166    }
1167}
1168
1169impl InspectWriterProxyInterface for InspectWriterProxy {
1170    type SetHealthOkResponseFut =
1171        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1172    fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut {
1173        fn _decode(
1174            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1175        ) -> Result<(), fidl::Error> {
1176            let _response = fidl::client::decode_transaction_body::<
1177                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1178                fidl::encoding::DefaultFuchsiaResourceDialect,
1179                0xe7510549d99075e,
1180            >(_buf?)?
1181            .into_result::<InspectWriterMarker>("set_health_ok")?;
1182            Ok(_response)
1183        }
1184        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1185            (),
1186            0xe7510549d99075e,
1187            fidl::encoding::DynamicFlags::FLEXIBLE,
1188            _decode,
1189        )
1190    }
1191
1192    type SetHealthStartingUpResponseFut =
1193        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1194    fn r#set_health_starting_up(&self) -> Self::SetHealthStartingUpResponseFut {
1195        fn _decode(
1196            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1197        ) -> Result<(), fidl::Error> {
1198            let _response = fidl::client::decode_transaction_body::<
1199                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1200                fidl::encoding::DefaultFuchsiaResourceDialect,
1201                0x6a7dbea8c4f52015,
1202            >(_buf?)?
1203            .into_result::<InspectWriterMarker>("set_health_starting_up")?;
1204            Ok(_response)
1205        }
1206        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1207            (),
1208            0x6a7dbea8c4f52015,
1209            fidl::encoding::DynamicFlags::FLEXIBLE,
1210            _decode,
1211        )
1212    }
1213
1214    type RecordStringResponseFut =
1215        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1216    fn r#record_string(&self, mut key: &str, mut value: &str) -> Self::RecordStringResponseFut {
1217        fn _decode(
1218            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1219        ) -> Result<(), fidl::Error> {
1220            let _response = fidl::client::decode_transaction_body::<
1221                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1222                fidl::encoding::DefaultFuchsiaResourceDialect,
1223                0x195be230721d712b,
1224            >(_buf?)?
1225            .into_result::<InspectWriterMarker>("record_string")?;
1226            Ok(_response)
1227        }
1228        self.client.send_query_and_decode::<InspectWriterRecordStringRequest, ()>(
1229            (key, value),
1230            0x195be230721d712b,
1231            fidl::encoding::DynamicFlags::FLEXIBLE,
1232            _decode,
1233        )
1234    }
1235
1236    type RecordIntResponseFut =
1237        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1238    fn r#record_int(&self, mut key: &str, mut value: i64) -> Self::RecordIntResponseFut {
1239        fn _decode(
1240            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1241        ) -> Result<(), fidl::Error> {
1242            let _response = fidl::client::decode_transaction_body::<
1243                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1244                fidl::encoding::DefaultFuchsiaResourceDialect,
1245                0xa2c6cbf0df0949,
1246            >(_buf?)?
1247            .into_result::<InspectWriterMarker>("record_int")?;
1248            Ok(_response)
1249        }
1250        self.client.send_query_and_decode::<InspectWriterRecordIntRequest, ()>(
1251            (key, value),
1252            0xa2c6cbf0df0949,
1253            fidl::encoding::DynamicFlags::FLEXIBLE,
1254            _decode,
1255        )
1256    }
1257
1258    type EmitExampleInspectDataResponseFut =
1259        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1260    fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut {
1261        fn _decode(
1262            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1263        ) -> Result<(), fidl::Error> {
1264            let _response = fidl::client::decode_transaction_body::<
1265                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1266                fidl::encoding::DefaultFuchsiaResourceDialect,
1267                0x228ae4647773fd94,
1268            >(_buf?)?
1269            .into_result::<InspectWriterMarker>("emit_example_inspect_data")?;
1270            Ok(_response)
1271        }
1272        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1273            (),
1274            0x228ae4647773fd94,
1275            fidl::encoding::DynamicFlags::FLEXIBLE,
1276            _decode,
1277        )
1278    }
1279
1280    type EscrowAndExitResponseFut = fidl::client::QueryResponseFut<
1281        InspectWriterEscrowAndExitResponse,
1282        fidl::encoding::DefaultFuchsiaResourceDialect,
1283    >;
1284    fn r#escrow_and_exit(
1285        &self,
1286        mut payload: &InspectWriterEscrowAndExitRequest,
1287    ) -> Self::EscrowAndExitResponseFut {
1288        fn _decode(
1289            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1290        ) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
1291            let _response = fidl::client::decode_transaction_body::<
1292                fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
1293                fidl::encoding::DefaultFuchsiaResourceDialect,
1294                0x60e24adbd0e588ff,
1295            >(_buf?)?
1296            .into_result::<InspectWriterMarker>("escrow_and_exit")?;
1297            Ok(_response)
1298        }
1299        self.client.send_query_and_decode::<
1300            InspectWriterEscrowAndExitRequest,
1301            InspectWriterEscrowAndExitResponse,
1302        >(
1303            payload,
1304            0x60e24adbd0e588ff,
1305            fidl::encoding::DynamicFlags::FLEXIBLE,
1306            _decode,
1307        )
1308    }
1309
1310    type RecordLazyValuesResponseFut = fidl::client::QueryResponseFut<
1311        fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
1312        fidl::encoding::DefaultFuchsiaResourceDialect,
1313    >;
1314    fn r#record_lazy_values(&self, mut key: &str) -> Self::RecordLazyValuesResponseFut {
1315        fn _decode(
1316            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1317        ) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
1318            let _response = fidl::client::decode_transaction_body::<
1319                fidl::encoding::FlexibleType<InspectWriterRecordLazyValuesResponse>,
1320                fidl::encoding::DefaultFuchsiaResourceDialect,
1321                0xc637cf5d48e9063,
1322            >(_buf?)?
1323            .into_result::<InspectWriterMarker>("record_lazy_values")?;
1324            Ok(_response.client)
1325        }
1326        self.client.send_query_and_decode::<
1327            InspectWriterRecordLazyValuesRequest,
1328            fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
1329        >(
1330            (key,),
1331            0xc637cf5d48e9063,
1332            fidl::encoding::DynamicFlags::FLEXIBLE,
1333            _decode,
1334        )
1335    }
1336}
1337
1338pub struct InspectWriterEventStream {
1339    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1340}
1341
1342impl std::marker::Unpin for InspectWriterEventStream {}
1343
1344impl futures::stream::FusedStream for InspectWriterEventStream {
1345    fn is_terminated(&self) -> bool {
1346        self.event_receiver.is_terminated()
1347    }
1348}
1349
1350impl futures::Stream for InspectWriterEventStream {
1351    type Item = Result<InspectWriterEvent, fidl::Error>;
1352
1353    fn poll_next(
1354        mut self: std::pin::Pin<&mut Self>,
1355        cx: &mut std::task::Context<'_>,
1356    ) -> std::task::Poll<Option<Self::Item>> {
1357        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1358            &mut self.event_receiver,
1359            cx
1360        )?) {
1361            Some(buf) => std::task::Poll::Ready(Some(InspectWriterEvent::decode(buf))),
1362            None => std::task::Poll::Ready(None),
1363        }
1364    }
1365}
1366
1367#[derive(Debug)]
1368pub enum InspectWriterEvent {
1369    #[non_exhaustive]
1370    _UnknownEvent {
1371        /// Ordinal of the event that was sent.
1372        ordinal: u64,
1373    },
1374}
1375
1376impl InspectWriterEvent {
1377    /// Decodes a message buffer as a [`InspectWriterEvent`].
1378    fn decode(
1379        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1380    ) -> Result<InspectWriterEvent, fidl::Error> {
1381        let (bytes, _handles) = buf.split_mut();
1382        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1383        debug_assert_eq!(tx_header.tx_id, 0);
1384        match tx_header.ordinal {
1385            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1386                Ok(InspectWriterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1387            }
1388            _ => Err(fidl::Error::UnknownOrdinal {
1389                ordinal: tx_header.ordinal,
1390                protocol_name: <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1391            }),
1392        }
1393    }
1394}
1395
1396/// A Stream of incoming requests for fuchsia.archivist.test/InspectWriter.
1397pub struct InspectWriterRequestStream {
1398    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1399    is_terminated: bool,
1400}
1401
1402impl std::marker::Unpin for InspectWriterRequestStream {}
1403
1404impl futures::stream::FusedStream for InspectWriterRequestStream {
1405    fn is_terminated(&self) -> bool {
1406        self.is_terminated
1407    }
1408}
1409
1410impl fidl::endpoints::RequestStream for InspectWriterRequestStream {
1411    type Protocol = InspectWriterMarker;
1412    type ControlHandle = InspectWriterControlHandle;
1413
1414    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1415        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1416    }
1417
1418    fn control_handle(&self) -> Self::ControlHandle {
1419        InspectWriterControlHandle { inner: self.inner.clone() }
1420    }
1421
1422    fn into_inner(
1423        self,
1424    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1425    {
1426        (self.inner, self.is_terminated)
1427    }
1428
1429    fn from_inner(
1430        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1431        is_terminated: bool,
1432    ) -> Self {
1433        Self { inner, is_terminated }
1434    }
1435}
1436
1437impl futures::Stream for InspectWriterRequestStream {
1438    type Item = Result<InspectWriterRequest, fidl::Error>;
1439
1440    fn poll_next(
1441        mut self: std::pin::Pin<&mut Self>,
1442        cx: &mut std::task::Context<'_>,
1443    ) -> std::task::Poll<Option<Self::Item>> {
1444        let this = &mut *self;
1445        if this.inner.check_shutdown(cx) {
1446            this.is_terminated = true;
1447            return std::task::Poll::Ready(None);
1448        }
1449        if this.is_terminated {
1450            panic!("polled InspectWriterRequestStream after completion");
1451        }
1452        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1453            |bytes, handles| {
1454                match this.inner.channel().read_etc(cx, bytes, handles) {
1455                    std::task::Poll::Ready(Ok(())) => {}
1456                    std::task::Poll::Pending => return std::task::Poll::Pending,
1457                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1458                        this.is_terminated = true;
1459                        return std::task::Poll::Ready(None);
1460                    }
1461                    std::task::Poll::Ready(Err(e)) => {
1462                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1463                            e.into(),
1464                        ))));
1465                    }
1466                }
1467
1468                // A message has been received from the channel
1469                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1470
1471                std::task::Poll::Ready(Some(match header.ordinal {
1472                    0xe7510549d99075e => {
1473                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1474                        let mut req = fidl::new_empty!(
1475                            fidl::encoding::EmptyPayload,
1476                            fidl::encoding::DefaultFuchsiaResourceDialect
1477                        );
1478                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1479                        let control_handle =
1480                            InspectWriterControlHandle { inner: this.inner.clone() };
1481                        Ok(InspectWriterRequest::SetHealthOk {
1482                            responder: InspectWriterSetHealthOkResponder {
1483                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1484                                tx_id: header.tx_id,
1485                            },
1486                        })
1487                    }
1488                    0x6a7dbea8c4f52015 => {
1489                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1490                        let mut req = fidl::new_empty!(
1491                            fidl::encoding::EmptyPayload,
1492                            fidl::encoding::DefaultFuchsiaResourceDialect
1493                        );
1494                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1495                        let control_handle =
1496                            InspectWriterControlHandle { inner: this.inner.clone() };
1497                        Ok(InspectWriterRequest::SetHealthStartingUp {
1498                            responder: InspectWriterSetHealthStartingUpResponder {
1499                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1500                                tx_id: header.tx_id,
1501                            },
1502                        })
1503                    }
1504                    0x195be230721d712b => {
1505                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1506                        let mut req = fidl::new_empty!(
1507                            InspectWriterRecordStringRequest,
1508                            fidl::encoding::DefaultFuchsiaResourceDialect
1509                        );
1510                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordStringRequest>(&header, _body_bytes, handles, &mut req)?;
1511                        let control_handle =
1512                            InspectWriterControlHandle { inner: this.inner.clone() };
1513                        Ok(InspectWriterRequest::RecordString {
1514                            key: req.key,
1515                            value: req.value,
1516
1517                            responder: InspectWriterRecordStringResponder {
1518                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1519                                tx_id: header.tx_id,
1520                            },
1521                        })
1522                    }
1523                    0xa2c6cbf0df0949 => {
1524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1525                        let mut req = fidl::new_empty!(
1526                            InspectWriterRecordIntRequest,
1527                            fidl::encoding::DefaultFuchsiaResourceDialect
1528                        );
1529                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordIntRequest>(&header, _body_bytes, handles, &mut req)?;
1530                        let control_handle =
1531                            InspectWriterControlHandle { inner: this.inner.clone() };
1532                        Ok(InspectWriterRequest::RecordInt {
1533                            key: req.key,
1534                            value: req.value,
1535
1536                            responder: InspectWriterRecordIntResponder {
1537                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1538                                tx_id: header.tx_id,
1539                            },
1540                        })
1541                    }
1542                    0x228ae4647773fd94 => {
1543                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1544                        let mut req = fidl::new_empty!(
1545                            fidl::encoding::EmptyPayload,
1546                            fidl::encoding::DefaultFuchsiaResourceDialect
1547                        );
1548                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1549                        let control_handle =
1550                            InspectWriterControlHandle { inner: this.inner.clone() };
1551                        Ok(InspectWriterRequest::EmitExampleInspectData {
1552                            responder: InspectWriterEmitExampleInspectDataResponder {
1553                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1554                                tx_id: header.tx_id,
1555                            },
1556                        })
1557                    }
1558                    0x60e24adbd0e588ff => {
1559                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1560                        let mut req = fidl::new_empty!(
1561                            InspectWriterEscrowAndExitRequest,
1562                            fidl::encoding::DefaultFuchsiaResourceDialect
1563                        );
1564                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterEscrowAndExitRequest>(&header, _body_bytes, handles, &mut req)?;
1565                        let control_handle =
1566                            InspectWriterControlHandle { inner: this.inner.clone() };
1567                        Ok(InspectWriterRequest::EscrowAndExit {
1568                            payload: req,
1569                            responder: InspectWriterEscrowAndExitResponder {
1570                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1571                                tx_id: header.tx_id,
1572                            },
1573                        })
1574                    }
1575                    0xc637cf5d48e9063 => {
1576                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1577                        let mut req = fidl::new_empty!(
1578                            InspectWriterRecordLazyValuesRequest,
1579                            fidl::encoding::DefaultFuchsiaResourceDialect
1580                        );
1581                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordLazyValuesRequest>(&header, _body_bytes, handles, &mut req)?;
1582                        let control_handle =
1583                            InspectWriterControlHandle { inner: this.inner.clone() };
1584                        Ok(InspectWriterRequest::RecordLazyValues {
1585                            key: req.key,
1586
1587                            responder: InspectWriterRecordLazyValuesResponder {
1588                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1589                                tx_id: header.tx_id,
1590                            },
1591                        })
1592                    }
1593                    _ if header.tx_id == 0
1594                        && header
1595                            .dynamic_flags()
1596                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1597                    {
1598                        Ok(InspectWriterRequest::_UnknownMethod {
1599                            ordinal: header.ordinal,
1600                            control_handle: InspectWriterControlHandle {
1601                                inner: this.inner.clone(),
1602                            },
1603                            method_type: fidl::MethodType::OneWay,
1604                        })
1605                    }
1606                    _ if header
1607                        .dynamic_flags()
1608                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1609                    {
1610                        this.inner.send_framework_err(
1611                            fidl::encoding::FrameworkErr::UnknownMethod,
1612                            header.tx_id,
1613                            header.ordinal,
1614                            header.dynamic_flags(),
1615                            (bytes, handles),
1616                        )?;
1617                        Ok(InspectWriterRequest::_UnknownMethod {
1618                            ordinal: header.ordinal,
1619                            control_handle: InspectWriterControlHandle {
1620                                inner: this.inner.clone(),
1621                            },
1622                            method_type: fidl::MethodType::TwoWay,
1623                        })
1624                    }
1625                    _ => Err(fidl::Error::UnknownOrdinal {
1626                        ordinal: header.ordinal,
1627                        protocol_name:
1628                            <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1629                    }),
1630                }))
1631            },
1632        )
1633    }
1634}
1635
1636/// InspectWriter emits inspect data when requested.
1637///
1638/// Values are always reported on the root inspect node.
1639#[derive(Debug)]
1640pub enum InspectWriterRequest {
1641    /// Emits a health inspect node with OK status.
1642    SetHealthOk { responder: InspectWriterSetHealthOkResponder },
1643    /// Emits a health inspect node with STARTING_UP status.
1644    SetHealthStartingUp { responder: InspectWriterSetHealthStartingUpResponder },
1645    /// Records a string inspect property.
1646    RecordString { key: String, value: String, responder: InspectWriterRecordStringResponder },
1647    /// Records an integer inspect property.
1648    RecordInt { key: String, value: i64, responder: InspectWriterRecordIntResponder },
1649    /// Emits a collection of example of inspect data.
1650    ///
1651    /// TODO(https://fuchsia.dev/302716196): Split this into several methods
1652    /// tests can call to explicitly emit the same data as this method.
1653    EmitExampleInspectData { responder: InspectWriterEmitExampleInspectDataResponder },
1654    /// Escrow the current inspect data and immediately exit afterwards.
1655    EscrowAndExit {
1656        payload: InspectWriterEscrowAndExitRequest,
1657        responder: InspectWriterEscrowAndExitResponder,
1658    },
1659    /// Returns a LazyInspectPuppet client for recording lazy values.
1660    RecordLazyValues { key: String, responder: InspectWriterRecordLazyValuesResponder },
1661    /// An interaction was received which does not match any known method.
1662    #[non_exhaustive]
1663    _UnknownMethod {
1664        /// Ordinal of the method that was called.
1665        ordinal: u64,
1666        control_handle: InspectWriterControlHandle,
1667        method_type: fidl::MethodType,
1668    },
1669}
1670
1671impl InspectWriterRequest {
1672    #[allow(irrefutable_let_patterns)]
1673    pub fn into_set_health_ok(self) -> Option<(InspectWriterSetHealthOkResponder)> {
1674        if let InspectWriterRequest::SetHealthOk { responder } = self {
1675            Some((responder))
1676        } else {
1677            None
1678        }
1679    }
1680
1681    #[allow(irrefutable_let_patterns)]
1682    pub fn into_set_health_starting_up(
1683        self,
1684    ) -> Option<(InspectWriterSetHealthStartingUpResponder)> {
1685        if let InspectWriterRequest::SetHealthStartingUp { responder } = self {
1686            Some((responder))
1687        } else {
1688            None
1689        }
1690    }
1691
1692    #[allow(irrefutable_let_patterns)]
1693    pub fn into_record_string(
1694        self,
1695    ) -> Option<(String, String, InspectWriterRecordStringResponder)> {
1696        if let InspectWriterRequest::RecordString { key, value, responder } = self {
1697            Some((key, value, responder))
1698        } else {
1699            None
1700        }
1701    }
1702
1703    #[allow(irrefutable_let_patterns)]
1704    pub fn into_record_int(self) -> Option<(String, i64, InspectWriterRecordIntResponder)> {
1705        if let InspectWriterRequest::RecordInt { key, value, responder } = self {
1706            Some((key, value, responder))
1707        } else {
1708            None
1709        }
1710    }
1711
1712    #[allow(irrefutable_let_patterns)]
1713    pub fn into_emit_example_inspect_data(
1714        self,
1715    ) -> Option<(InspectWriterEmitExampleInspectDataResponder)> {
1716        if let InspectWriterRequest::EmitExampleInspectData { responder } = self {
1717            Some((responder))
1718        } else {
1719            None
1720        }
1721    }
1722
1723    #[allow(irrefutable_let_patterns)]
1724    pub fn into_escrow_and_exit(
1725        self,
1726    ) -> Option<(InspectWriterEscrowAndExitRequest, InspectWriterEscrowAndExitResponder)> {
1727        if let InspectWriterRequest::EscrowAndExit { payload, responder } = self {
1728            Some((payload, responder))
1729        } else {
1730            None
1731        }
1732    }
1733
1734    #[allow(irrefutable_let_patterns)]
1735    pub fn into_record_lazy_values(
1736        self,
1737    ) -> Option<(String, InspectWriterRecordLazyValuesResponder)> {
1738        if let InspectWriterRequest::RecordLazyValues { key, responder } = self {
1739            Some((key, responder))
1740        } else {
1741            None
1742        }
1743    }
1744
1745    /// Name of the method defined in FIDL
1746    pub fn method_name(&self) -> &'static str {
1747        match *self {
1748            InspectWriterRequest::SetHealthOk { .. } => "set_health_ok",
1749            InspectWriterRequest::SetHealthStartingUp { .. } => "set_health_starting_up",
1750            InspectWriterRequest::RecordString { .. } => "record_string",
1751            InspectWriterRequest::RecordInt { .. } => "record_int",
1752            InspectWriterRequest::EmitExampleInspectData { .. } => "emit_example_inspect_data",
1753            InspectWriterRequest::EscrowAndExit { .. } => "escrow_and_exit",
1754            InspectWriterRequest::RecordLazyValues { .. } => "record_lazy_values",
1755            InspectWriterRequest::_UnknownMethod {
1756                method_type: fidl::MethodType::OneWay, ..
1757            } => "unknown one-way method",
1758            InspectWriterRequest::_UnknownMethod {
1759                method_type: fidl::MethodType::TwoWay, ..
1760            } => "unknown two-way method",
1761        }
1762    }
1763}
1764
1765#[derive(Debug, Clone)]
1766pub struct InspectWriterControlHandle {
1767    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1768}
1769
1770impl fidl::endpoints::ControlHandle for InspectWriterControlHandle {
1771    fn shutdown(&self) {
1772        self.inner.shutdown()
1773    }
1774    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1775        self.inner.shutdown_with_epitaph(status)
1776    }
1777
1778    fn is_closed(&self) -> bool {
1779        self.inner.channel().is_closed()
1780    }
1781    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1782        self.inner.channel().on_closed()
1783    }
1784
1785    #[cfg(target_os = "fuchsia")]
1786    fn signal_peer(
1787        &self,
1788        clear_mask: zx::Signals,
1789        set_mask: zx::Signals,
1790    ) -> Result<(), zx_status::Status> {
1791        use fidl::Peered;
1792        self.inner.channel().signal_peer(clear_mask, set_mask)
1793    }
1794}
1795
1796impl InspectWriterControlHandle {}
1797
1798#[must_use = "FIDL methods require a response to be sent"]
1799#[derive(Debug)]
1800pub struct InspectWriterSetHealthOkResponder {
1801    control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1802    tx_id: u32,
1803}
1804
1805/// Set the the channel to be shutdown (see [`InspectWriterControlHandle::shutdown`])
1806/// if the responder is dropped without sending a response, so that the client
1807/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1808impl std::ops::Drop for InspectWriterSetHealthOkResponder {
1809    fn drop(&mut self) {
1810        self.control_handle.shutdown();
1811        // Safety: drops once, never accessed again
1812        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1813    }
1814}
1815
1816impl fidl::endpoints::Responder for InspectWriterSetHealthOkResponder {
1817    type ControlHandle = InspectWriterControlHandle;
1818
1819    fn control_handle(&self) -> &InspectWriterControlHandle {
1820        &self.control_handle
1821    }
1822
1823    fn drop_without_shutdown(mut self) {
1824        // Safety: drops once, never accessed again due to mem::forget
1825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1826        // Prevent Drop from running (which would shut down the channel)
1827        std::mem::forget(self);
1828    }
1829}
1830
1831impl InspectWriterSetHealthOkResponder {
1832    /// Sends a response to the FIDL transaction.
1833    ///
1834    /// Sets the channel to shutdown if an error occurs.
1835    pub fn send(self) -> Result<(), fidl::Error> {
1836        let _result = self.send_raw();
1837        if _result.is_err() {
1838            self.control_handle.shutdown();
1839        }
1840        self.drop_without_shutdown();
1841        _result
1842    }
1843
1844    /// Similar to "send" but does not shutdown the channel if an error occurs.
1845    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1846        let _result = self.send_raw();
1847        self.drop_without_shutdown();
1848        _result
1849    }
1850
1851    fn send_raw(&self) -> Result<(), fidl::Error> {
1852        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
1853            fidl::encoding::Flexible::new(()),
1854            self.tx_id,
1855            0xe7510549d99075e,
1856            fidl::encoding::DynamicFlags::FLEXIBLE,
1857        )
1858    }
1859}
1860
1861#[must_use = "FIDL methods require a response to be sent"]
1862#[derive(Debug)]
1863pub struct InspectWriterSetHealthStartingUpResponder {
1864    control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1865    tx_id: u32,
1866}
1867
1868/// Set the the channel to be shutdown (see [`InspectWriterControlHandle::shutdown`])
1869/// if the responder is dropped without sending a response, so that the client
1870/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1871impl std::ops::Drop for InspectWriterSetHealthStartingUpResponder {
1872    fn drop(&mut self) {
1873        self.control_handle.shutdown();
1874        // Safety: drops once, never accessed again
1875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1876    }
1877}
1878
1879impl fidl::endpoints::Responder for InspectWriterSetHealthStartingUpResponder {
1880    type ControlHandle = InspectWriterControlHandle;
1881
1882    fn control_handle(&self) -> &InspectWriterControlHandle {
1883        &self.control_handle
1884    }
1885
1886    fn drop_without_shutdown(mut self) {
1887        // Safety: drops once, never accessed again due to mem::forget
1888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1889        // Prevent Drop from running (which would shut down the channel)
1890        std::mem::forget(self);
1891    }
1892}
1893
1894impl InspectWriterSetHealthStartingUpResponder {
1895    /// Sends a response to the FIDL transaction.
1896    ///
1897    /// Sets the channel to shutdown if an error occurs.
1898    pub fn send(self) -> Result<(), fidl::Error> {
1899        let _result = self.send_raw();
1900        if _result.is_err() {
1901            self.control_handle.shutdown();
1902        }
1903        self.drop_without_shutdown();
1904        _result
1905    }
1906
1907    /// Similar to "send" but does not shutdown the channel if an error occurs.
1908    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1909        let _result = self.send_raw();
1910        self.drop_without_shutdown();
1911        _result
1912    }
1913
1914    fn send_raw(&self) -> Result<(), fidl::Error> {
1915        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
1916            fidl::encoding::Flexible::new(()),
1917            self.tx_id,
1918            0x6a7dbea8c4f52015,
1919            fidl::encoding::DynamicFlags::FLEXIBLE,
1920        )
1921    }
1922}
1923
1924#[must_use = "FIDL methods require a response to be sent"]
1925#[derive(Debug)]
1926pub struct InspectWriterRecordStringResponder {
1927    control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1928    tx_id: u32,
1929}
1930
1931/// Set the the channel to be shutdown (see [`InspectWriterControlHandle::shutdown`])
1932/// if the responder is dropped without sending a response, so that the client
1933/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1934impl std::ops::Drop for InspectWriterRecordStringResponder {
1935    fn drop(&mut self) {
1936        self.control_handle.shutdown();
1937        // Safety: drops once, never accessed again
1938        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1939    }
1940}
1941
1942impl fidl::endpoints::Responder for InspectWriterRecordStringResponder {
1943    type ControlHandle = InspectWriterControlHandle;
1944
1945    fn control_handle(&self) -> &InspectWriterControlHandle {
1946        &self.control_handle
1947    }
1948
1949    fn drop_without_shutdown(mut self) {
1950        // Safety: drops once, never accessed again due to mem::forget
1951        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1952        // Prevent Drop from running (which would shut down the channel)
1953        std::mem::forget(self);
1954    }
1955}
1956
1957impl InspectWriterRecordStringResponder {
1958    /// Sends a response to the FIDL transaction.
1959    ///
1960    /// Sets the channel to shutdown if an error occurs.
1961    pub fn send(self) -> Result<(), fidl::Error> {
1962        let _result = self.send_raw();
1963        if _result.is_err() {
1964            self.control_handle.shutdown();
1965        }
1966        self.drop_without_shutdown();
1967        _result
1968    }
1969
1970    /// Similar to "send" but does not shutdown the channel if an error occurs.
1971    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1972        let _result = self.send_raw();
1973        self.drop_without_shutdown();
1974        _result
1975    }
1976
1977    fn send_raw(&self) -> Result<(), fidl::Error> {
1978        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
1979            fidl::encoding::Flexible::new(()),
1980            self.tx_id,
1981            0x195be230721d712b,
1982            fidl::encoding::DynamicFlags::FLEXIBLE,
1983        )
1984    }
1985}
1986
1987#[must_use = "FIDL methods require a response to be sent"]
1988#[derive(Debug)]
1989pub struct InspectWriterRecordIntResponder {
1990    control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1991    tx_id: u32,
1992}
1993
1994/// Set the the channel to be shutdown (see [`InspectWriterControlHandle::shutdown`])
1995/// if the responder is dropped without sending a response, so that the client
1996/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1997impl std::ops::Drop for InspectWriterRecordIntResponder {
1998    fn drop(&mut self) {
1999        self.control_handle.shutdown();
2000        // Safety: drops once, never accessed again
2001        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2002    }
2003}
2004
2005impl fidl::endpoints::Responder for InspectWriterRecordIntResponder {
2006    type ControlHandle = InspectWriterControlHandle;
2007
2008    fn control_handle(&self) -> &InspectWriterControlHandle {
2009        &self.control_handle
2010    }
2011
2012    fn drop_without_shutdown(mut self) {
2013        // Safety: drops once, never accessed again due to mem::forget
2014        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2015        // Prevent Drop from running (which would shut down the channel)
2016        std::mem::forget(self);
2017    }
2018}
2019
2020impl InspectWriterRecordIntResponder {
2021    /// Sends a response to the FIDL transaction.
2022    ///
2023    /// Sets the channel to shutdown if an error occurs.
2024    pub fn send(self) -> Result<(), fidl::Error> {
2025        let _result = self.send_raw();
2026        if _result.is_err() {
2027            self.control_handle.shutdown();
2028        }
2029        self.drop_without_shutdown();
2030        _result
2031    }
2032
2033    /// Similar to "send" but does not shutdown the channel if an error occurs.
2034    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2035        let _result = self.send_raw();
2036        self.drop_without_shutdown();
2037        _result
2038    }
2039
2040    fn send_raw(&self) -> Result<(), fidl::Error> {
2041        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2042            fidl::encoding::Flexible::new(()),
2043            self.tx_id,
2044            0xa2c6cbf0df0949,
2045            fidl::encoding::DynamicFlags::FLEXIBLE,
2046        )
2047    }
2048}
2049
2050#[must_use = "FIDL methods require a response to be sent"]
2051#[derive(Debug)]
2052pub struct InspectWriterEmitExampleInspectDataResponder {
2053    control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
2054    tx_id: u32,
2055}
2056
2057/// Set the the channel to be shutdown (see [`InspectWriterControlHandle::shutdown`])
2058/// if the responder is dropped without sending a response, so that the client
2059/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2060impl std::ops::Drop for InspectWriterEmitExampleInspectDataResponder {
2061    fn drop(&mut self) {
2062        self.control_handle.shutdown();
2063        // Safety: drops once, never accessed again
2064        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2065    }
2066}
2067
2068impl fidl::endpoints::Responder for InspectWriterEmitExampleInspectDataResponder {
2069    type ControlHandle = InspectWriterControlHandle;
2070
2071    fn control_handle(&self) -> &InspectWriterControlHandle {
2072        &self.control_handle
2073    }
2074
2075    fn drop_without_shutdown(mut self) {
2076        // Safety: drops once, never accessed again due to mem::forget
2077        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2078        // Prevent Drop from running (which would shut down the channel)
2079        std::mem::forget(self);
2080    }
2081}
2082
2083impl InspectWriterEmitExampleInspectDataResponder {
2084    /// Sends a response to the FIDL transaction.
2085    ///
2086    /// Sets the channel to shutdown if an error occurs.
2087    pub fn send(self) -> Result<(), fidl::Error> {
2088        let _result = self.send_raw();
2089        if _result.is_err() {
2090            self.control_handle.shutdown();
2091        }
2092        self.drop_without_shutdown();
2093        _result
2094    }
2095
2096    /// Similar to "send" but does not shutdown the channel if an error occurs.
2097    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2098        let _result = self.send_raw();
2099        self.drop_without_shutdown();
2100        _result
2101    }
2102
2103    fn send_raw(&self) -> Result<(), fidl::Error> {
2104        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2105            fidl::encoding::Flexible::new(()),
2106            self.tx_id,
2107            0x228ae4647773fd94,
2108            fidl::encoding::DynamicFlags::FLEXIBLE,
2109        )
2110    }
2111}
2112
2113#[must_use = "FIDL methods require a response to be sent"]
2114#[derive(Debug)]
2115pub struct InspectWriterEscrowAndExitResponder {
2116    control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
2117    tx_id: u32,
2118}
2119
2120/// Set the the channel to be shutdown (see [`InspectWriterControlHandle::shutdown`])
2121/// if the responder is dropped without sending a response, so that the client
2122/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2123impl std::ops::Drop for InspectWriterEscrowAndExitResponder {
2124    fn drop(&mut self) {
2125        self.control_handle.shutdown();
2126        // Safety: drops once, never accessed again
2127        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2128    }
2129}
2130
2131impl fidl::endpoints::Responder for InspectWriterEscrowAndExitResponder {
2132    type ControlHandle = InspectWriterControlHandle;
2133
2134    fn control_handle(&self) -> &InspectWriterControlHandle {
2135        &self.control_handle
2136    }
2137
2138    fn drop_without_shutdown(mut self) {
2139        // Safety: drops once, never accessed again due to mem::forget
2140        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2141        // Prevent Drop from running (which would shut down the channel)
2142        std::mem::forget(self);
2143    }
2144}
2145
2146impl InspectWriterEscrowAndExitResponder {
2147    /// Sends a response to the FIDL transaction.
2148    ///
2149    /// Sets the channel to shutdown if an error occurs.
2150    pub fn send(self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
2151        let _result = self.send_raw(payload);
2152        if _result.is_err() {
2153            self.control_handle.shutdown();
2154        }
2155        self.drop_without_shutdown();
2156        _result
2157    }
2158
2159    /// Similar to "send" but does not shutdown the channel if an error occurs.
2160    pub fn send_no_shutdown_on_err(
2161        self,
2162        mut payload: InspectWriterEscrowAndExitResponse,
2163    ) -> Result<(), fidl::Error> {
2164        let _result = self.send_raw(payload);
2165        self.drop_without_shutdown();
2166        _result
2167    }
2168
2169    fn send_raw(&self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
2170        self.control_handle
2171            .inner
2172            .send::<fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>>(
2173                fidl::encoding::Flexible::new(&mut payload),
2174                self.tx_id,
2175                0x60e24adbd0e588ff,
2176                fidl::encoding::DynamicFlags::FLEXIBLE,
2177            )
2178    }
2179}
2180
2181#[must_use = "FIDL methods require a response to be sent"]
2182#[derive(Debug)]
2183pub struct InspectWriterRecordLazyValuesResponder {
2184    control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
2185    tx_id: u32,
2186}
2187
2188/// Set the the channel to be shutdown (see [`InspectWriterControlHandle::shutdown`])
2189/// if the responder is dropped without sending a response, so that the client
2190/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2191impl std::ops::Drop for InspectWriterRecordLazyValuesResponder {
2192    fn drop(&mut self) {
2193        self.control_handle.shutdown();
2194        // Safety: drops once, never accessed again
2195        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2196    }
2197}
2198
2199impl fidl::endpoints::Responder for InspectWriterRecordLazyValuesResponder {
2200    type ControlHandle = InspectWriterControlHandle;
2201
2202    fn control_handle(&self) -> &InspectWriterControlHandle {
2203        &self.control_handle
2204    }
2205
2206    fn drop_without_shutdown(mut self) {
2207        // Safety: drops once, never accessed again due to mem::forget
2208        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2209        // Prevent Drop from running (which would shut down the channel)
2210        std::mem::forget(self);
2211    }
2212}
2213
2214impl InspectWriterRecordLazyValuesResponder {
2215    /// Sends a response to the FIDL transaction.
2216    ///
2217    /// Sets the channel to shutdown if an error occurs.
2218    pub fn send(
2219        self,
2220        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
2221    ) -> Result<(), fidl::Error> {
2222        let _result = self.send_raw(client);
2223        if _result.is_err() {
2224            self.control_handle.shutdown();
2225        }
2226        self.drop_without_shutdown();
2227        _result
2228    }
2229
2230    /// Similar to "send" but does not shutdown the channel if an error occurs.
2231    pub fn send_no_shutdown_on_err(
2232        self,
2233        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
2234    ) -> Result<(), fidl::Error> {
2235        let _result = self.send_raw(client);
2236        self.drop_without_shutdown();
2237        _result
2238    }
2239
2240    fn send_raw(
2241        &self,
2242        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
2243    ) -> Result<(), fidl::Error> {
2244        self.control_handle
2245            .inner
2246            .send::<fidl::encoding::FlexibleType<InspectWriterRecordLazyValuesResponse>>(
2247                fidl::encoding::Flexible::new((client,)),
2248                self.tx_id,
2249                0xc637cf5d48e9063,
2250                fidl::encoding::DynamicFlags::FLEXIBLE,
2251            )
2252    }
2253}
2254
2255#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2256pub struct LazyInspectPuppetMarker;
2257
2258impl fidl::endpoints::ProtocolMarker for LazyInspectPuppetMarker {
2259    type Proxy = LazyInspectPuppetProxy;
2260    type RequestStream = LazyInspectPuppetRequestStream;
2261    #[cfg(target_os = "fuchsia")]
2262    type SynchronousProxy = LazyInspectPuppetSynchronousProxy;
2263
2264    const DEBUG_NAME: &'static str = "(anonymous) LazyInspectPuppet";
2265}
2266
2267pub trait LazyInspectPuppetProxyInterface: Send + Sync {
2268    type SetHealthOkResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2269    fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut;
2270    type SetHealthStartingUpResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2271        + Send;
2272    fn r#set_health_starting_up(&self) -> Self::SetHealthStartingUpResponseFut;
2273    type RecordStringResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2274    fn r#record_string(&self, key: &str, value: &str) -> Self::RecordStringResponseFut;
2275    type RecordIntResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2276    fn r#record_int(&self, key: &str, value: i64) -> Self::RecordIntResponseFut;
2277    type EmitExampleInspectDataResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2278        + Send;
2279    fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut;
2280    type EscrowAndExitResponseFut: std::future::Future<Output = Result<InspectWriterEscrowAndExitResponse, fidl::Error>>
2281        + Send;
2282    fn r#escrow_and_exit(
2283        &self,
2284        payload: &InspectWriterEscrowAndExitRequest,
2285    ) -> Self::EscrowAndExitResponseFut;
2286    type RecordLazyValuesResponseFut: std::future::Future<
2287            Output = Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error>,
2288        > + Send;
2289    fn r#record_lazy_values(&self, key: &str) -> Self::RecordLazyValuesResponseFut;
2290    type CommitResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2291    fn r#commit(&self, options: &CommitOptions) -> Self::CommitResponseFut;
2292}
2293#[derive(Debug)]
2294#[cfg(target_os = "fuchsia")]
2295pub struct LazyInspectPuppetSynchronousProxy {
2296    client: fidl::client::sync::Client,
2297}
2298
2299#[cfg(target_os = "fuchsia")]
2300impl fidl::endpoints::SynchronousProxy for LazyInspectPuppetSynchronousProxy {
2301    type Proxy = LazyInspectPuppetProxy;
2302    type Protocol = LazyInspectPuppetMarker;
2303
2304    fn from_channel(inner: fidl::Channel) -> Self {
2305        Self::new(inner)
2306    }
2307
2308    fn into_channel(self) -> fidl::Channel {
2309        self.client.into_channel()
2310    }
2311
2312    fn as_channel(&self) -> &fidl::Channel {
2313        self.client.as_channel()
2314    }
2315}
2316
2317#[cfg(target_os = "fuchsia")]
2318impl LazyInspectPuppetSynchronousProxy {
2319    pub fn new(channel: fidl::Channel) -> Self {
2320        let protocol_name =
2321            <LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2322        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2323    }
2324
2325    pub fn into_channel(self) -> fidl::Channel {
2326        self.client.into_channel()
2327    }
2328
2329    /// Waits until an event arrives and returns it. It is safe for other
2330    /// threads to make concurrent requests while waiting for an event.
2331    pub fn wait_for_event(
2332        &self,
2333        deadline: zx::MonotonicInstant,
2334    ) -> Result<LazyInspectPuppetEvent, fidl::Error> {
2335        LazyInspectPuppetEvent::decode(self.client.wait_for_event(deadline)?)
2336    }
2337
2338    /// Emits a health inspect node with OK status.
2339    pub fn r#set_health_ok(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2340        let _response = self.client.send_query::<
2341            fidl::encoding::EmptyPayload,
2342            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2343        >(
2344            (),
2345            0xe7510549d99075e,
2346            fidl::encoding::DynamicFlags::FLEXIBLE,
2347            ___deadline,
2348        )?
2349        .into_result::<LazyInspectPuppetMarker>("set_health_ok")?;
2350        Ok(_response)
2351    }
2352
2353    /// Emits a health inspect node with STARTING_UP status.
2354    pub fn r#set_health_starting_up(
2355        &self,
2356        ___deadline: zx::MonotonicInstant,
2357    ) -> Result<(), fidl::Error> {
2358        let _response = self.client.send_query::<
2359            fidl::encoding::EmptyPayload,
2360            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2361        >(
2362            (),
2363            0x6a7dbea8c4f52015,
2364            fidl::encoding::DynamicFlags::FLEXIBLE,
2365            ___deadline,
2366        )?
2367        .into_result::<LazyInspectPuppetMarker>("set_health_starting_up")?;
2368        Ok(_response)
2369    }
2370
2371    /// Records a string inspect property.
2372    pub fn r#record_string(
2373        &self,
2374        mut key: &str,
2375        mut value: &str,
2376        ___deadline: zx::MonotonicInstant,
2377    ) -> Result<(), fidl::Error> {
2378        let _response = self.client.send_query::<
2379            InspectWriterRecordStringRequest,
2380            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2381        >(
2382            (key, value,),
2383            0x195be230721d712b,
2384            fidl::encoding::DynamicFlags::FLEXIBLE,
2385            ___deadline,
2386        )?
2387        .into_result::<LazyInspectPuppetMarker>("record_string")?;
2388        Ok(_response)
2389    }
2390
2391    /// Records an integer inspect property.
2392    pub fn r#record_int(
2393        &self,
2394        mut key: &str,
2395        mut value: i64,
2396        ___deadline: zx::MonotonicInstant,
2397    ) -> Result<(), fidl::Error> {
2398        let _response = self.client.send_query::<
2399            InspectWriterRecordIntRequest,
2400            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2401        >(
2402            (key, value,),
2403            0xa2c6cbf0df0949,
2404            fidl::encoding::DynamicFlags::FLEXIBLE,
2405            ___deadline,
2406        )?
2407        .into_result::<LazyInspectPuppetMarker>("record_int")?;
2408        Ok(_response)
2409    }
2410
2411    /// Emits a collection of example of inspect data.
2412    ///
2413    /// TODO(https://fuchsia.dev/302716196): Split this into several methods
2414    /// tests can call to explicitly emit the same data as this method.
2415    pub fn r#emit_example_inspect_data(
2416        &self,
2417        ___deadline: zx::MonotonicInstant,
2418    ) -> Result<(), fidl::Error> {
2419        let _response = self.client.send_query::<
2420            fidl::encoding::EmptyPayload,
2421            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2422        >(
2423            (),
2424            0x228ae4647773fd94,
2425            fidl::encoding::DynamicFlags::FLEXIBLE,
2426            ___deadline,
2427        )?
2428        .into_result::<LazyInspectPuppetMarker>("emit_example_inspect_data")?;
2429        Ok(_response)
2430    }
2431
2432    /// Escrow the current inspect data and immediately exit afterwards.
2433    pub fn r#escrow_and_exit(
2434        &self,
2435        mut payload: &InspectWriterEscrowAndExitRequest,
2436        ___deadline: zx::MonotonicInstant,
2437    ) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
2438        let _response = self.client.send_query::<
2439            InspectWriterEscrowAndExitRequest,
2440            fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
2441        >(
2442            payload,
2443            0x60e24adbd0e588ff,
2444            fidl::encoding::DynamicFlags::FLEXIBLE,
2445            ___deadline,
2446        )?
2447        .into_result::<LazyInspectPuppetMarker>("escrow_and_exit")?;
2448        Ok(_response)
2449    }
2450
2451    /// Returns a LazyInspectPuppet client for recording lazy values.
2452    pub fn r#record_lazy_values(
2453        &self,
2454        mut key: &str,
2455        ___deadline: zx::MonotonicInstant,
2456    ) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
2457        let _response = self.client.send_query::<
2458            InspectWriterRecordLazyValuesRequest,
2459            fidl::encoding::FlexibleType<InspectWriterRecordLazyValuesResponse>,
2460        >(
2461            (key,),
2462            0xc637cf5d48e9063,
2463            fidl::encoding::DynamicFlags::FLEXIBLE,
2464            ___deadline,
2465        )?
2466        .into_result::<LazyInspectPuppetMarker>("record_lazy_values")?;
2467        Ok(_response.client)
2468    }
2469
2470    /// Reports all recorded values on the root node.
2471    ///
2472    /// The server will close the connection after this method is called.
2473    pub fn r#commit(
2474        &self,
2475        mut options: &CommitOptions,
2476        ___deadline: zx::MonotonicInstant,
2477    ) -> Result<(), fidl::Error> {
2478        let _response = self.client.send_query::<
2479            LazyInspectPuppetCommitRequest,
2480            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2481        >(
2482            (options,),
2483            0x79524e5e00cbf03f,
2484            fidl::encoding::DynamicFlags::FLEXIBLE,
2485            ___deadline,
2486        )?
2487        .into_result::<LazyInspectPuppetMarker>("commit")?;
2488        Ok(_response)
2489    }
2490}
2491
2492#[cfg(target_os = "fuchsia")]
2493impl From<LazyInspectPuppetSynchronousProxy> for zx::Handle {
2494    fn from(value: LazyInspectPuppetSynchronousProxy) -> Self {
2495        value.into_channel().into()
2496    }
2497}
2498
2499#[cfg(target_os = "fuchsia")]
2500impl From<fidl::Channel> for LazyInspectPuppetSynchronousProxy {
2501    fn from(value: fidl::Channel) -> Self {
2502        Self::new(value)
2503    }
2504}
2505
2506#[cfg(target_os = "fuchsia")]
2507impl fidl::endpoints::FromClient for LazyInspectPuppetSynchronousProxy {
2508    type Protocol = LazyInspectPuppetMarker;
2509
2510    fn from_client(value: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>) -> Self {
2511        Self::new(value.into_channel())
2512    }
2513}
2514
2515#[derive(Debug, Clone)]
2516pub struct LazyInspectPuppetProxy {
2517    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2518}
2519
2520impl fidl::endpoints::Proxy for LazyInspectPuppetProxy {
2521    type Protocol = LazyInspectPuppetMarker;
2522
2523    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2524        Self::new(inner)
2525    }
2526
2527    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2528        self.client.into_channel().map_err(|client| Self { client })
2529    }
2530
2531    fn as_channel(&self) -> &::fidl::AsyncChannel {
2532        self.client.as_channel()
2533    }
2534}
2535
2536impl LazyInspectPuppetProxy {
2537    /// Create a new Proxy for fuchsia.archivist.test/LazyInspectPuppet.
2538    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2539        let protocol_name =
2540            <LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2541        Self { client: fidl::client::Client::new(channel, protocol_name) }
2542    }
2543
2544    /// Get a Stream of events from the remote end of the protocol.
2545    ///
2546    /// # Panics
2547    ///
2548    /// Panics if the event stream was already taken.
2549    pub fn take_event_stream(&self) -> LazyInspectPuppetEventStream {
2550        LazyInspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
2551    }
2552
2553    /// Emits a health inspect node with OK status.
2554    pub fn r#set_health_ok(
2555        &self,
2556    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2557        LazyInspectPuppetProxyInterface::r#set_health_ok(self)
2558    }
2559
2560    /// Emits a health inspect node with STARTING_UP status.
2561    pub fn r#set_health_starting_up(
2562        &self,
2563    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2564        LazyInspectPuppetProxyInterface::r#set_health_starting_up(self)
2565    }
2566
2567    /// Records a string inspect property.
2568    pub fn r#record_string(
2569        &self,
2570        mut key: &str,
2571        mut value: &str,
2572    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2573        LazyInspectPuppetProxyInterface::r#record_string(self, key, value)
2574    }
2575
2576    /// Records an integer inspect property.
2577    pub fn r#record_int(
2578        &self,
2579        mut key: &str,
2580        mut value: i64,
2581    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2582        LazyInspectPuppetProxyInterface::r#record_int(self, key, value)
2583    }
2584
2585    /// Emits a collection of example of inspect data.
2586    ///
2587    /// TODO(https://fuchsia.dev/302716196): Split this into several methods
2588    /// tests can call to explicitly emit the same data as this method.
2589    pub fn r#emit_example_inspect_data(
2590        &self,
2591    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2592        LazyInspectPuppetProxyInterface::r#emit_example_inspect_data(self)
2593    }
2594
2595    /// Escrow the current inspect data and immediately exit afterwards.
2596    pub fn r#escrow_and_exit(
2597        &self,
2598        mut payload: &InspectWriterEscrowAndExitRequest,
2599    ) -> fidl::client::QueryResponseFut<
2600        InspectWriterEscrowAndExitResponse,
2601        fidl::encoding::DefaultFuchsiaResourceDialect,
2602    > {
2603        LazyInspectPuppetProxyInterface::r#escrow_and_exit(self, payload)
2604    }
2605
2606    /// Returns a LazyInspectPuppet client for recording lazy values.
2607    pub fn r#record_lazy_values(
2608        &self,
2609        mut key: &str,
2610    ) -> fidl::client::QueryResponseFut<
2611        fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
2612        fidl::encoding::DefaultFuchsiaResourceDialect,
2613    > {
2614        LazyInspectPuppetProxyInterface::r#record_lazy_values(self, key)
2615    }
2616
2617    /// Reports all recorded values on the root node.
2618    ///
2619    /// The server will close the connection after this method is called.
2620    pub fn r#commit(
2621        &self,
2622        mut options: &CommitOptions,
2623    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2624        LazyInspectPuppetProxyInterface::r#commit(self, options)
2625    }
2626}
2627
2628impl LazyInspectPuppetProxyInterface for LazyInspectPuppetProxy {
2629    type SetHealthOkResponseFut =
2630        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2631    fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut {
2632        fn _decode(
2633            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2634        ) -> Result<(), fidl::Error> {
2635            let _response = fidl::client::decode_transaction_body::<
2636                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2637                fidl::encoding::DefaultFuchsiaResourceDialect,
2638                0xe7510549d99075e,
2639            >(_buf?)?
2640            .into_result::<LazyInspectPuppetMarker>("set_health_ok")?;
2641            Ok(_response)
2642        }
2643        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2644            (),
2645            0xe7510549d99075e,
2646            fidl::encoding::DynamicFlags::FLEXIBLE,
2647            _decode,
2648        )
2649    }
2650
2651    type SetHealthStartingUpResponseFut =
2652        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2653    fn r#set_health_starting_up(&self) -> Self::SetHealthStartingUpResponseFut {
2654        fn _decode(
2655            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2656        ) -> Result<(), fidl::Error> {
2657            let _response = fidl::client::decode_transaction_body::<
2658                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2659                fidl::encoding::DefaultFuchsiaResourceDialect,
2660                0x6a7dbea8c4f52015,
2661            >(_buf?)?
2662            .into_result::<LazyInspectPuppetMarker>("set_health_starting_up")?;
2663            Ok(_response)
2664        }
2665        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2666            (),
2667            0x6a7dbea8c4f52015,
2668            fidl::encoding::DynamicFlags::FLEXIBLE,
2669            _decode,
2670        )
2671    }
2672
2673    type RecordStringResponseFut =
2674        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2675    fn r#record_string(&self, mut key: &str, mut value: &str) -> Self::RecordStringResponseFut {
2676        fn _decode(
2677            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2678        ) -> Result<(), fidl::Error> {
2679            let _response = fidl::client::decode_transaction_body::<
2680                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2681                fidl::encoding::DefaultFuchsiaResourceDialect,
2682                0x195be230721d712b,
2683            >(_buf?)?
2684            .into_result::<LazyInspectPuppetMarker>("record_string")?;
2685            Ok(_response)
2686        }
2687        self.client.send_query_and_decode::<InspectWriterRecordStringRequest, ()>(
2688            (key, value),
2689            0x195be230721d712b,
2690            fidl::encoding::DynamicFlags::FLEXIBLE,
2691            _decode,
2692        )
2693    }
2694
2695    type RecordIntResponseFut =
2696        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2697    fn r#record_int(&self, mut key: &str, mut value: i64) -> Self::RecordIntResponseFut {
2698        fn _decode(
2699            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2700        ) -> Result<(), fidl::Error> {
2701            let _response = fidl::client::decode_transaction_body::<
2702                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2703                fidl::encoding::DefaultFuchsiaResourceDialect,
2704                0xa2c6cbf0df0949,
2705            >(_buf?)?
2706            .into_result::<LazyInspectPuppetMarker>("record_int")?;
2707            Ok(_response)
2708        }
2709        self.client.send_query_and_decode::<InspectWriterRecordIntRequest, ()>(
2710            (key, value),
2711            0xa2c6cbf0df0949,
2712            fidl::encoding::DynamicFlags::FLEXIBLE,
2713            _decode,
2714        )
2715    }
2716
2717    type EmitExampleInspectDataResponseFut =
2718        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2719    fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut {
2720        fn _decode(
2721            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2722        ) -> Result<(), fidl::Error> {
2723            let _response = fidl::client::decode_transaction_body::<
2724                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2725                fidl::encoding::DefaultFuchsiaResourceDialect,
2726                0x228ae4647773fd94,
2727            >(_buf?)?
2728            .into_result::<LazyInspectPuppetMarker>("emit_example_inspect_data")?;
2729            Ok(_response)
2730        }
2731        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2732            (),
2733            0x228ae4647773fd94,
2734            fidl::encoding::DynamicFlags::FLEXIBLE,
2735            _decode,
2736        )
2737    }
2738
2739    type EscrowAndExitResponseFut = fidl::client::QueryResponseFut<
2740        InspectWriterEscrowAndExitResponse,
2741        fidl::encoding::DefaultFuchsiaResourceDialect,
2742    >;
2743    fn r#escrow_and_exit(
2744        &self,
2745        mut payload: &InspectWriterEscrowAndExitRequest,
2746    ) -> Self::EscrowAndExitResponseFut {
2747        fn _decode(
2748            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2749        ) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
2750            let _response = fidl::client::decode_transaction_body::<
2751                fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
2752                fidl::encoding::DefaultFuchsiaResourceDialect,
2753                0x60e24adbd0e588ff,
2754            >(_buf?)?
2755            .into_result::<LazyInspectPuppetMarker>("escrow_and_exit")?;
2756            Ok(_response)
2757        }
2758        self.client.send_query_and_decode::<
2759            InspectWriterEscrowAndExitRequest,
2760            InspectWriterEscrowAndExitResponse,
2761        >(
2762            payload,
2763            0x60e24adbd0e588ff,
2764            fidl::encoding::DynamicFlags::FLEXIBLE,
2765            _decode,
2766        )
2767    }
2768
2769    type RecordLazyValuesResponseFut = fidl::client::QueryResponseFut<
2770        fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
2771        fidl::encoding::DefaultFuchsiaResourceDialect,
2772    >;
2773    fn r#record_lazy_values(&self, mut key: &str) -> Self::RecordLazyValuesResponseFut {
2774        fn _decode(
2775            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2776        ) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
2777            let _response = fidl::client::decode_transaction_body::<
2778                fidl::encoding::FlexibleType<InspectWriterRecordLazyValuesResponse>,
2779                fidl::encoding::DefaultFuchsiaResourceDialect,
2780                0xc637cf5d48e9063,
2781            >(_buf?)?
2782            .into_result::<LazyInspectPuppetMarker>("record_lazy_values")?;
2783            Ok(_response.client)
2784        }
2785        self.client.send_query_and_decode::<
2786            InspectWriterRecordLazyValuesRequest,
2787            fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
2788        >(
2789            (key,),
2790            0xc637cf5d48e9063,
2791            fidl::encoding::DynamicFlags::FLEXIBLE,
2792            _decode,
2793        )
2794    }
2795
2796    type CommitResponseFut =
2797        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2798    fn r#commit(&self, mut options: &CommitOptions) -> Self::CommitResponseFut {
2799        fn _decode(
2800            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2801        ) -> Result<(), fidl::Error> {
2802            let _response = fidl::client::decode_transaction_body::<
2803                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2804                fidl::encoding::DefaultFuchsiaResourceDialect,
2805                0x79524e5e00cbf03f,
2806            >(_buf?)?
2807            .into_result::<LazyInspectPuppetMarker>("commit")?;
2808            Ok(_response)
2809        }
2810        self.client.send_query_and_decode::<LazyInspectPuppetCommitRequest, ()>(
2811            (options,),
2812            0x79524e5e00cbf03f,
2813            fidl::encoding::DynamicFlags::FLEXIBLE,
2814            _decode,
2815        )
2816    }
2817}
2818
2819pub struct LazyInspectPuppetEventStream {
2820    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2821}
2822
2823impl std::marker::Unpin for LazyInspectPuppetEventStream {}
2824
2825impl futures::stream::FusedStream for LazyInspectPuppetEventStream {
2826    fn is_terminated(&self) -> bool {
2827        self.event_receiver.is_terminated()
2828    }
2829}
2830
2831impl futures::Stream for LazyInspectPuppetEventStream {
2832    type Item = Result<LazyInspectPuppetEvent, fidl::Error>;
2833
2834    fn poll_next(
2835        mut self: std::pin::Pin<&mut Self>,
2836        cx: &mut std::task::Context<'_>,
2837    ) -> std::task::Poll<Option<Self::Item>> {
2838        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2839            &mut self.event_receiver,
2840            cx
2841        )?) {
2842            Some(buf) => std::task::Poll::Ready(Some(LazyInspectPuppetEvent::decode(buf))),
2843            None => std::task::Poll::Ready(None),
2844        }
2845    }
2846}
2847
2848#[derive(Debug)]
2849pub enum LazyInspectPuppetEvent {
2850    #[non_exhaustive]
2851    _UnknownEvent {
2852        /// Ordinal of the event that was sent.
2853        ordinal: u64,
2854    },
2855}
2856
2857impl LazyInspectPuppetEvent {
2858    /// Decodes a message buffer as a [`LazyInspectPuppetEvent`].
2859    fn decode(
2860        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2861    ) -> Result<LazyInspectPuppetEvent, fidl::Error> {
2862        let (bytes, _handles) = buf.split_mut();
2863        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2864        debug_assert_eq!(tx_header.tx_id, 0);
2865        match tx_header.ordinal {
2866            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2867                Ok(LazyInspectPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2868            }
2869            _ => Err(fidl::Error::UnknownOrdinal {
2870                ordinal: tx_header.ordinal,
2871                protocol_name:
2872                    <LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2873            }),
2874        }
2875    }
2876}
2877
2878/// A Stream of incoming requests for fuchsia.archivist.test/LazyInspectPuppet.
2879pub struct LazyInspectPuppetRequestStream {
2880    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2881    is_terminated: bool,
2882}
2883
2884impl std::marker::Unpin for LazyInspectPuppetRequestStream {}
2885
2886impl futures::stream::FusedStream for LazyInspectPuppetRequestStream {
2887    fn is_terminated(&self) -> bool {
2888        self.is_terminated
2889    }
2890}
2891
2892impl fidl::endpoints::RequestStream for LazyInspectPuppetRequestStream {
2893    type Protocol = LazyInspectPuppetMarker;
2894    type ControlHandle = LazyInspectPuppetControlHandle;
2895
2896    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2897        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2898    }
2899
2900    fn control_handle(&self) -> Self::ControlHandle {
2901        LazyInspectPuppetControlHandle { inner: self.inner.clone() }
2902    }
2903
2904    fn into_inner(
2905        self,
2906    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2907    {
2908        (self.inner, self.is_terminated)
2909    }
2910
2911    fn from_inner(
2912        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2913        is_terminated: bool,
2914    ) -> Self {
2915        Self { inner, is_terminated }
2916    }
2917}
2918
2919impl futures::Stream for LazyInspectPuppetRequestStream {
2920    type Item = Result<LazyInspectPuppetRequest, fidl::Error>;
2921
2922    fn poll_next(
2923        mut self: std::pin::Pin<&mut Self>,
2924        cx: &mut std::task::Context<'_>,
2925    ) -> std::task::Poll<Option<Self::Item>> {
2926        let this = &mut *self;
2927        if this.inner.check_shutdown(cx) {
2928            this.is_terminated = true;
2929            return std::task::Poll::Ready(None);
2930        }
2931        if this.is_terminated {
2932            panic!("polled LazyInspectPuppetRequestStream after completion");
2933        }
2934        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2935            |bytes, handles| {
2936                match this.inner.channel().read_etc(cx, bytes, handles) {
2937                    std::task::Poll::Ready(Ok(())) => {}
2938                    std::task::Poll::Pending => return std::task::Poll::Pending,
2939                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2940                        this.is_terminated = true;
2941                        return std::task::Poll::Ready(None);
2942                    }
2943                    std::task::Poll::Ready(Err(e)) => {
2944                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2945                            e.into(),
2946                        ))));
2947                    }
2948                }
2949
2950                // A message has been received from the channel
2951                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2952
2953                std::task::Poll::Ready(Some(match header.ordinal {
2954                    0xe7510549d99075e => {
2955                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2956                        let mut req = fidl::new_empty!(
2957                            fidl::encoding::EmptyPayload,
2958                            fidl::encoding::DefaultFuchsiaResourceDialect
2959                        );
2960                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2961                        let control_handle =
2962                            LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2963                        Ok(LazyInspectPuppetRequest::SetHealthOk {
2964                            responder: LazyInspectPuppetSetHealthOkResponder {
2965                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2966                                tx_id: header.tx_id,
2967                            },
2968                        })
2969                    }
2970                    0x6a7dbea8c4f52015 => {
2971                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2972                        let mut req = fidl::new_empty!(
2973                            fidl::encoding::EmptyPayload,
2974                            fidl::encoding::DefaultFuchsiaResourceDialect
2975                        );
2976                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2977                        let control_handle =
2978                            LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2979                        Ok(LazyInspectPuppetRequest::SetHealthStartingUp {
2980                            responder: LazyInspectPuppetSetHealthStartingUpResponder {
2981                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2982                                tx_id: header.tx_id,
2983                            },
2984                        })
2985                    }
2986                    0x195be230721d712b => {
2987                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2988                        let mut req = fidl::new_empty!(
2989                            InspectWriterRecordStringRequest,
2990                            fidl::encoding::DefaultFuchsiaResourceDialect
2991                        );
2992                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordStringRequest>(&header, _body_bytes, handles, &mut req)?;
2993                        let control_handle =
2994                            LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2995                        Ok(LazyInspectPuppetRequest::RecordString {
2996                            key: req.key,
2997                            value: req.value,
2998
2999                            responder: LazyInspectPuppetRecordStringResponder {
3000                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3001                                tx_id: header.tx_id,
3002                            },
3003                        })
3004                    }
3005                    0xa2c6cbf0df0949 => {
3006                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3007                        let mut req = fidl::new_empty!(
3008                            InspectWriterRecordIntRequest,
3009                            fidl::encoding::DefaultFuchsiaResourceDialect
3010                        );
3011                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordIntRequest>(&header, _body_bytes, handles, &mut req)?;
3012                        let control_handle =
3013                            LazyInspectPuppetControlHandle { inner: this.inner.clone() };
3014                        Ok(LazyInspectPuppetRequest::RecordInt {
3015                            key: req.key,
3016                            value: req.value,
3017
3018                            responder: LazyInspectPuppetRecordIntResponder {
3019                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3020                                tx_id: header.tx_id,
3021                            },
3022                        })
3023                    }
3024                    0x228ae4647773fd94 => {
3025                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3026                        let mut req = fidl::new_empty!(
3027                            fidl::encoding::EmptyPayload,
3028                            fidl::encoding::DefaultFuchsiaResourceDialect
3029                        );
3030                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3031                        let control_handle =
3032                            LazyInspectPuppetControlHandle { inner: this.inner.clone() };
3033                        Ok(LazyInspectPuppetRequest::EmitExampleInspectData {
3034                            responder: LazyInspectPuppetEmitExampleInspectDataResponder {
3035                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3036                                tx_id: header.tx_id,
3037                            },
3038                        })
3039                    }
3040                    0x60e24adbd0e588ff => {
3041                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3042                        let mut req = fidl::new_empty!(
3043                            InspectWriterEscrowAndExitRequest,
3044                            fidl::encoding::DefaultFuchsiaResourceDialect
3045                        );
3046                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterEscrowAndExitRequest>(&header, _body_bytes, handles, &mut req)?;
3047                        let control_handle =
3048                            LazyInspectPuppetControlHandle { inner: this.inner.clone() };
3049                        Ok(LazyInspectPuppetRequest::EscrowAndExit {
3050                            payload: req,
3051                            responder: LazyInspectPuppetEscrowAndExitResponder {
3052                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3053                                tx_id: header.tx_id,
3054                            },
3055                        })
3056                    }
3057                    0xc637cf5d48e9063 => {
3058                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3059                        let mut req = fidl::new_empty!(
3060                            InspectWriterRecordLazyValuesRequest,
3061                            fidl::encoding::DefaultFuchsiaResourceDialect
3062                        );
3063                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordLazyValuesRequest>(&header, _body_bytes, handles, &mut req)?;
3064                        let control_handle =
3065                            LazyInspectPuppetControlHandle { inner: this.inner.clone() };
3066                        Ok(LazyInspectPuppetRequest::RecordLazyValues {
3067                            key: req.key,
3068
3069                            responder: LazyInspectPuppetRecordLazyValuesResponder {
3070                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3071                                tx_id: header.tx_id,
3072                            },
3073                        })
3074                    }
3075                    0x79524e5e00cbf03f => {
3076                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3077                        let mut req = fidl::new_empty!(
3078                            LazyInspectPuppetCommitRequest,
3079                            fidl::encoding::DefaultFuchsiaResourceDialect
3080                        );
3081                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LazyInspectPuppetCommitRequest>(&header, _body_bytes, handles, &mut req)?;
3082                        let control_handle =
3083                            LazyInspectPuppetControlHandle { inner: this.inner.clone() };
3084                        Ok(LazyInspectPuppetRequest::Commit {
3085                            options: req.options,
3086
3087                            responder: LazyInspectPuppetCommitResponder {
3088                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3089                                tx_id: header.tx_id,
3090                            },
3091                        })
3092                    }
3093                    _ if header.tx_id == 0
3094                        && header
3095                            .dynamic_flags()
3096                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3097                    {
3098                        Ok(LazyInspectPuppetRequest::_UnknownMethod {
3099                            ordinal: header.ordinal,
3100                            control_handle: LazyInspectPuppetControlHandle {
3101                                inner: this.inner.clone(),
3102                            },
3103                            method_type: fidl::MethodType::OneWay,
3104                        })
3105                    }
3106                    _ if header
3107                        .dynamic_flags()
3108                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3109                    {
3110                        this.inner.send_framework_err(
3111                            fidl::encoding::FrameworkErr::UnknownMethod,
3112                            header.tx_id,
3113                            header.ordinal,
3114                            header.dynamic_flags(),
3115                            (bytes, handles),
3116                        )?;
3117                        Ok(LazyInspectPuppetRequest::_UnknownMethod {
3118                            ordinal: header.ordinal,
3119                            control_handle: LazyInspectPuppetControlHandle {
3120                                inner: this.inner.clone(),
3121                            },
3122                            method_type: fidl::MethodType::TwoWay,
3123                        })
3124                    }
3125                    _ => Err(fidl::Error::UnknownOrdinal {
3126                        ordinal: header.ordinal,
3127                        protocol_name:
3128                            <LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3129                    }),
3130                }))
3131            },
3132        )
3133    }
3134}
3135
3136/// Records values on a lazy inspect node.
3137///
3138/// If this connection is dropped before [`CommitLazyValues`] is called, no
3139/// values are recorded.
3140///
3141/// Values are always reported on the root inspect node.
3142#[derive(Debug)]
3143pub enum LazyInspectPuppetRequest {
3144    /// Emits a health inspect node with OK status.
3145    SetHealthOk { responder: LazyInspectPuppetSetHealthOkResponder },
3146    /// Emits a health inspect node with STARTING_UP status.
3147    SetHealthStartingUp { responder: LazyInspectPuppetSetHealthStartingUpResponder },
3148    /// Records a string inspect property.
3149    RecordString { key: String, value: String, responder: LazyInspectPuppetRecordStringResponder },
3150    /// Records an integer inspect property.
3151    RecordInt { key: String, value: i64, responder: LazyInspectPuppetRecordIntResponder },
3152    /// Emits a collection of example of inspect data.
3153    ///
3154    /// TODO(https://fuchsia.dev/302716196): Split this into several methods
3155    /// tests can call to explicitly emit the same data as this method.
3156    EmitExampleInspectData { responder: LazyInspectPuppetEmitExampleInspectDataResponder },
3157    /// Escrow the current inspect data and immediately exit afterwards.
3158    EscrowAndExit {
3159        payload: InspectWriterEscrowAndExitRequest,
3160        responder: LazyInspectPuppetEscrowAndExitResponder,
3161    },
3162    /// Returns a LazyInspectPuppet client for recording lazy values.
3163    RecordLazyValues { key: String, responder: LazyInspectPuppetRecordLazyValuesResponder },
3164    /// Reports all recorded values on the root node.
3165    ///
3166    /// The server will close the connection after this method is called.
3167    Commit { options: CommitOptions, responder: LazyInspectPuppetCommitResponder },
3168    /// An interaction was received which does not match any known method.
3169    #[non_exhaustive]
3170    _UnknownMethod {
3171        /// Ordinal of the method that was called.
3172        ordinal: u64,
3173        control_handle: LazyInspectPuppetControlHandle,
3174        method_type: fidl::MethodType,
3175    },
3176}
3177
3178impl LazyInspectPuppetRequest {
3179    #[allow(irrefutable_let_patterns)]
3180    pub fn into_set_health_ok(self) -> Option<(LazyInspectPuppetSetHealthOkResponder)> {
3181        if let LazyInspectPuppetRequest::SetHealthOk { responder } = self {
3182            Some((responder))
3183        } else {
3184            None
3185        }
3186    }
3187
3188    #[allow(irrefutable_let_patterns)]
3189    pub fn into_set_health_starting_up(
3190        self,
3191    ) -> Option<(LazyInspectPuppetSetHealthStartingUpResponder)> {
3192        if let LazyInspectPuppetRequest::SetHealthStartingUp { responder } = self {
3193            Some((responder))
3194        } else {
3195            None
3196        }
3197    }
3198
3199    #[allow(irrefutable_let_patterns)]
3200    pub fn into_record_string(
3201        self,
3202    ) -> Option<(String, String, LazyInspectPuppetRecordStringResponder)> {
3203        if let LazyInspectPuppetRequest::RecordString { key, value, responder } = self {
3204            Some((key, value, responder))
3205        } else {
3206            None
3207        }
3208    }
3209
3210    #[allow(irrefutable_let_patterns)]
3211    pub fn into_record_int(self) -> Option<(String, i64, LazyInspectPuppetRecordIntResponder)> {
3212        if let LazyInspectPuppetRequest::RecordInt { key, value, responder } = self {
3213            Some((key, value, responder))
3214        } else {
3215            None
3216        }
3217    }
3218
3219    #[allow(irrefutable_let_patterns)]
3220    pub fn into_emit_example_inspect_data(
3221        self,
3222    ) -> Option<(LazyInspectPuppetEmitExampleInspectDataResponder)> {
3223        if let LazyInspectPuppetRequest::EmitExampleInspectData { responder } = self {
3224            Some((responder))
3225        } else {
3226            None
3227        }
3228    }
3229
3230    #[allow(irrefutable_let_patterns)]
3231    pub fn into_escrow_and_exit(
3232        self,
3233    ) -> Option<(InspectWriterEscrowAndExitRequest, LazyInspectPuppetEscrowAndExitResponder)> {
3234        if let LazyInspectPuppetRequest::EscrowAndExit { payload, responder } = self {
3235            Some((payload, responder))
3236        } else {
3237            None
3238        }
3239    }
3240
3241    #[allow(irrefutable_let_patterns)]
3242    pub fn into_record_lazy_values(
3243        self,
3244    ) -> Option<(String, LazyInspectPuppetRecordLazyValuesResponder)> {
3245        if let LazyInspectPuppetRequest::RecordLazyValues { key, responder } = self {
3246            Some((key, responder))
3247        } else {
3248            None
3249        }
3250    }
3251
3252    #[allow(irrefutable_let_patterns)]
3253    pub fn into_commit(self) -> Option<(CommitOptions, LazyInspectPuppetCommitResponder)> {
3254        if let LazyInspectPuppetRequest::Commit { options, responder } = self {
3255            Some((options, responder))
3256        } else {
3257            None
3258        }
3259    }
3260
3261    /// Name of the method defined in FIDL
3262    pub fn method_name(&self) -> &'static str {
3263        match *self {
3264            LazyInspectPuppetRequest::SetHealthOk { .. } => "set_health_ok",
3265            LazyInspectPuppetRequest::SetHealthStartingUp { .. } => "set_health_starting_up",
3266            LazyInspectPuppetRequest::RecordString { .. } => "record_string",
3267            LazyInspectPuppetRequest::RecordInt { .. } => "record_int",
3268            LazyInspectPuppetRequest::EmitExampleInspectData { .. } => "emit_example_inspect_data",
3269            LazyInspectPuppetRequest::EscrowAndExit { .. } => "escrow_and_exit",
3270            LazyInspectPuppetRequest::RecordLazyValues { .. } => "record_lazy_values",
3271            LazyInspectPuppetRequest::Commit { .. } => "commit",
3272            LazyInspectPuppetRequest::_UnknownMethod {
3273                method_type: fidl::MethodType::OneWay,
3274                ..
3275            } => "unknown one-way method",
3276            LazyInspectPuppetRequest::_UnknownMethod {
3277                method_type: fidl::MethodType::TwoWay,
3278                ..
3279            } => "unknown two-way method",
3280        }
3281    }
3282}
3283
3284#[derive(Debug, Clone)]
3285pub struct LazyInspectPuppetControlHandle {
3286    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3287}
3288
3289impl fidl::endpoints::ControlHandle for LazyInspectPuppetControlHandle {
3290    fn shutdown(&self) {
3291        self.inner.shutdown()
3292    }
3293    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3294        self.inner.shutdown_with_epitaph(status)
3295    }
3296
3297    fn is_closed(&self) -> bool {
3298        self.inner.channel().is_closed()
3299    }
3300    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3301        self.inner.channel().on_closed()
3302    }
3303
3304    #[cfg(target_os = "fuchsia")]
3305    fn signal_peer(
3306        &self,
3307        clear_mask: zx::Signals,
3308        set_mask: zx::Signals,
3309    ) -> Result<(), zx_status::Status> {
3310        use fidl::Peered;
3311        self.inner.channel().signal_peer(clear_mask, set_mask)
3312    }
3313}
3314
3315impl LazyInspectPuppetControlHandle {}
3316
3317#[must_use = "FIDL methods require a response to be sent"]
3318#[derive(Debug)]
3319pub struct LazyInspectPuppetSetHealthOkResponder {
3320    control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
3321    tx_id: u32,
3322}
3323
3324/// Set the the channel to be shutdown (see [`LazyInspectPuppetControlHandle::shutdown`])
3325/// if the responder is dropped without sending a response, so that the client
3326/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3327impl std::ops::Drop for LazyInspectPuppetSetHealthOkResponder {
3328    fn drop(&mut self) {
3329        self.control_handle.shutdown();
3330        // Safety: drops once, never accessed again
3331        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3332    }
3333}
3334
3335impl fidl::endpoints::Responder for LazyInspectPuppetSetHealthOkResponder {
3336    type ControlHandle = LazyInspectPuppetControlHandle;
3337
3338    fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
3339        &self.control_handle
3340    }
3341
3342    fn drop_without_shutdown(mut self) {
3343        // Safety: drops once, never accessed again due to mem::forget
3344        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3345        // Prevent Drop from running (which would shut down the channel)
3346        std::mem::forget(self);
3347    }
3348}
3349
3350impl LazyInspectPuppetSetHealthOkResponder {
3351    /// Sends a response to the FIDL transaction.
3352    ///
3353    /// Sets the channel to shutdown if an error occurs.
3354    pub fn send(self) -> Result<(), fidl::Error> {
3355        let _result = self.send_raw();
3356        if _result.is_err() {
3357            self.control_handle.shutdown();
3358        }
3359        self.drop_without_shutdown();
3360        _result
3361    }
3362
3363    /// Similar to "send" but does not shutdown the channel if an error occurs.
3364    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3365        let _result = self.send_raw();
3366        self.drop_without_shutdown();
3367        _result
3368    }
3369
3370    fn send_raw(&self) -> Result<(), fidl::Error> {
3371        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3372            fidl::encoding::Flexible::new(()),
3373            self.tx_id,
3374            0xe7510549d99075e,
3375            fidl::encoding::DynamicFlags::FLEXIBLE,
3376        )
3377    }
3378}
3379
3380#[must_use = "FIDL methods require a response to be sent"]
3381#[derive(Debug)]
3382pub struct LazyInspectPuppetSetHealthStartingUpResponder {
3383    control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
3384    tx_id: u32,
3385}
3386
3387/// Set the the channel to be shutdown (see [`LazyInspectPuppetControlHandle::shutdown`])
3388/// if the responder is dropped without sending a response, so that the client
3389/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3390impl std::ops::Drop for LazyInspectPuppetSetHealthStartingUpResponder {
3391    fn drop(&mut self) {
3392        self.control_handle.shutdown();
3393        // Safety: drops once, never accessed again
3394        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3395    }
3396}
3397
3398impl fidl::endpoints::Responder for LazyInspectPuppetSetHealthStartingUpResponder {
3399    type ControlHandle = LazyInspectPuppetControlHandle;
3400
3401    fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
3402        &self.control_handle
3403    }
3404
3405    fn drop_without_shutdown(mut self) {
3406        // Safety: drops once, never accessed again due to mem::forget
3407        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3408        // Prevent Drop from running (which would shut down the channel)
3409        std::mem::forget(self);
3410    }
3411}
3412
3413impl LazyInspectPuppetSetHealthStartingUpResponder {
3414    /// Sends a response to the FIDL transaction.
3415    ///
3416    /// Sets the channel to shutdown if an error occurs.
3417    pub fn send(self) -> Result<(), fidl::Error> {
3418        let _result = self.send_raw();
3419        if _result.is_err() {
3420            self.control_handle.shutdown();
3421        }
3422        self.drop_without_shutdown();
3423        _result
3424    }
3425
3426    /// Similar to "send" but does not shutdown the channel if an error occurs.
3427    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3428        let _result = self.send_raw();
3429        self.drop_without_shutdown();
3430        _result
3431    }
3432
3433    fn send_raw(&self) -> Result<(), fidl::Error> {
3434        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3435            fidl::encoding::Flexible::new(()),
3436            self.tx_id,
3437            0x6a7dbea8c4f52015,
3438            fidl::encoding::DynamicFlags::FLEXIBLE,
3439        )
3440    }
3441}
3442
3443#[must_use = "FIDL methods require a response to be sent"]
3444#[derive(Debug)]
3445pub struct LazyInspectPuppetRecordStringResponder {
3446    control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
3447    tx_id: u32,
3448}
3449
3450/// Set the the channel to be shutdown (see [`LazyInspectPuppetControlHandle::shutdown`])
3451/// if the responder is dropped without sending a response, so that the client
3452/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3453impl std::ops::Drop for LazyInspectPuppetRecordStringResponder {
3454    fn drop(&mut self) {
3455        self.control_handle.shutdown();
3456        // Safety: drops once, never accessed again
3457        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3458    }
3459}
3460
3461impl fidl::endpoints::Responder for LazyInspectPuppetRecordStringResponder {
3462    type ControlHandle = LazyInspectPuppetControlHandle;
3463
3464    fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
3465        &self.control_handle
3466    }
3467
3468    fn drop_without_shutdown(mut self) {
3469        // Safety: drops once, never accessed again due to mem::forget
3470        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3471        // Prevent Drop from running (which would shut down the channel)
3472        std::mem::forget(self);
3473    }
3474}
3475
3476impl LazyInspectPuppetRecordStringResponder {
3477    /// Sends a response to the FIDL transaction.
3478    ///
3479    /// Sets the channel to shutdown if an error occurs.
3480    pub fn send(self) -> Result<(), fidl::Error> {
3481        let _result = self.send_raw();
3482        if _result.is_err() {
3483            self.control_handle.shutdown();
3484        }
3485        self.drop_without_shutdown();
3486        _result
3487    }
3488
3489    /// Similar to "send" but does not shutdown the channel if an error occurs.
3490    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3491        let _result = self.send_raw();
3492        self.drop_without_shutdown();
3493        _result
3494    }
3495
3496    fn send_raw(&self) -> Result<(), fidl::Error> {
3497        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3498            fidl::encoding::Flexible::new(()),
3499            self.tx_id,
3500            0x195be230721d712b,
3501            fidl::encoding::DynamicFlags::FLEXIBLE,
3502        )
3503    }
3504}
3505
3506#[must_use = "FIDL methods require a response to be sent"]
3507#[derive(Debug)]
3508pub struct LazyInspectPuppetRecordIntResponder {
3509    control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
3510    tx_id: u32,
3511}
3512
3513/// Set the the channel to be shutdown (see [`LazyInspectPuppetControlHandle::shutdown`])
3514/// if the responder is dropped without sending a response, so that the client
3515/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3516impl std::ops::Drop for LazyInspectPuppetRecordIntResponder {
3517    fn drop(&mut self) {
3518        self.control_handle.shutdown();
3519        // Safety: drops once, never accessed again
3520        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3521    }
3522}
3523
3524impl fidl::endpoints::Responder for LazyInspectPuppetRecordIntResponder {
3525    type ControlHandle = LazyInspectPuppetControlHandle;
3526
3527    fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
3528        &self.control_handle
3529    }
3530
3531    fn drop_without_shutdown(mut self) {
3532        // Safety: drops once, never accessed again due to mem::forget
3533        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3534        // Prevent Drop from running (which would shut down the channel)
3535        std::mem::forget(self);
3536    }
3537}
3538
3539impl LazyInspectPuppetRecordIntResponder {
3540    /// Sends a response to the FIDL transaction.
3541    ///
3542    /// Sets the channel to shutdown if an error occurs.
3543    pub fn send(self) -> Result<(), fidl::Error> {
3544        let _result = self.send_raw();
3545        if _result.is_err() {
3546            self.control_handle.shutdown();
3547        }
3548        self.drop_without_shutdown();
3549        _result
3550    }
3551
3552    /// Similar to "send" but does not shutdown the channel if an error occurs.
3553    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3554        let _result = self.send_raw();
3555        self.drop_without_shutdown();
3556        _result
3557    }
3558
3559    fn send_raw(&self) -> Result<(), fidl::Error> {
3560        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3561            fidl::encoding::Flexible::new(()),
3562            self.tx_id,
3563            0xa2c6cbf0df0949,
3564            fidl::encoding::DynamicFlags::FLEXIBLE,
3565        )
3566    }
3567}
3568
3569#[must_use = "FIDL methods require a response to be sent"]
3570#[derive(Debug)]
3571pub struct LazyInspectPuppetEmitExampleInspectDataResponder {
3572    control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
3573    tx_id: u32,
3574}
3575
3576/// Set the the channel to be shutdown (see [`LazyInspectPuppetControlHandle::shutdown`])
3577/// if the responder is dropped without sending a response, so that the client
3578/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3579impl std::ops::Drop for LazyInspectPuppetEmitExampleInspectDataResponder {
3580    fn drop(&mut self) {
3581        self.control_handle.shutdown();
3582        // Safety: drops once, never accessed again
3583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3584    }
3585}
3586
3587impl fidl::endpoints::Responder for LazyInspectPuppetEmitExampleInspectDataResponder {
3588    type ControlHandle = LazyInspectPuppetControlHandle;
3589
3590    fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
3591        &self.control_handle
3592    }
3593
3594    fn drop_without_shutdown(mut self) {
3595        // Safety: drops once, never accessed again due to mem::forget
3596        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3597        // Prevent Drop from running (which would shut down the channel)
3598        std::mem::forget(self);
3599    }
3600}
3601
3602impl LazyInspectPuppetEmitExampleInspectDataResponder {
3603    /// Sends a response to the FIDL transaction.
3604    ///
3605    /// Sets the channel to shutdown if an error occurs.
3606    pub fn send(self) -> Result<(), fidl::Error> {
3607        let _result = self.send_raw();
3608        if _result.is_err() {
3609            self.control_handle.shutdown();
3610        }
3611        self.drop_without_shutdown();
3612        _result
3613    }
3614
3615    /// Similar to "send" but does not shutdown the channel if an error occurs.
3616    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3617        let _result = self.send_raw();
3618        self.drop_without_shutdown();
3619        _result
3620    }
3621
3622    fn send_raw(&self) -> Result<(), fidl::Error> {
3623        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3624            fidl::encoding::Flexible::new(()),
3625            self.tx_id,
3626            0x228ae4647773fd94,
3627            fidl::encoding::DynamicFlags::FLEXIBLE,
3628        )
3629    }
3630}
3631
3632#[must_use = "FIDL methods require a response to be sent"]
3633#[derive(Debug)]
3634pub struct LazyInspectPuppetEscrowAndExitResponder {
3635    control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
3636    tx_id: u32,
3637}
3638
3639/// Set the the channel to be shutdown (see [`LazyInspectPuppetControlHandle::shutdown`])
3640/// if the responder is dropped without sending a response, so that the client
3641/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3642impl std::ops::Drop for LazyInspectPuppetEscrowAndExitResponder {
3643    fn drop(&mut self) {
3644        self.control_handle.shutdown();
3645        // Safety: drops once, never accessed again
3646        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3647    }
3648}
3649
3650impl fidl::endpoints::Responder for LazyInspectPuppetEscrowAndExitResponder {
3651    type ControlHandle = LazyInspectPuppetControlHandle;
3652
3653    fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
3654        &self.control_handle
3655    }
3656
3657    fn drop_without_shutdown(mut self) {
3658        // Safety: drops once, never accessed again due to mem::forget
3659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3660        // Prevent Drop from running (which would shut down the channel)
3661        std::mem::forget(self);
3662    }
3663}
3664
3665impl LazyInspectPuppetEscrowAndExitResponder {
3666    /// Sends a response to the FIDL transaction.
3667    ///
3668    /// Sets the channel to shutdown if an error occurs.
3669    pub fn send(self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
3670        let _result = self.send_raw(payload);
3671        if _result.is_err() {
3672            self.control_handle.shutdown();
3673        }
3674        self.drop_without_shutdown();
3675        _result
3676    }
3677
3678    /// Similar to "send" but does not shutdown the channel if an error occurs.
3679    pub fn send_no_shutdown_on_err(
3680        self,
3681        mut payload: InspectWriterEscrowAndExitResponse,
3682    ) -> Result<(), fidl::Error> {
3683        let _result = self.send_raw(payload);
3684        self.drop_without_shutdown();
3685        _result
3686    }
3687
3688    fn send_raw(&self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
3689        self.control_handle
3690            .inner
3691            .send::<fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>>(
3692                fidl::encoding::Flexible::new(&mut payload),
3693                self.tx_id,
3694                0x60e24adbd0e588ff,
3695                fidl::encoding::DynamicFlags::FLEXIBLE,
3696            )
3697    }
3698}
3699
3700#[must_use = "FIDL methods require a response to be sent"]
3701#[derive(Debug)]
3702pub struct LazyInspectPuppetRecordLazyValuesResponder {
3703    control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
3704    tx_id: u32,
3705}
3706
3707/// Set the the channel to be shutdown (see [`LazyInspectPuppetControlHandle::shutdown`])
3708/// if the responder is dropped without sending a response, so that the client
3709/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3710impl std::ops::Drop for LazyInspectPuppetRecordLazyValuesResponder {
3711    fn drop(&mut self) {
3712        self.control_handle.shutdown();
3713        // Safety: drops once, never accessed again
3714        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3715    }
3716}
3717
3718impl fidl::endpoints::Responder for LazyInspectPuppetRecordLazyValuesResponder {
3719    type ControlHandle = LazyInspectPuppetControlHandle;
3720
3721    fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
3722        &self.control_handle
3723    }
3724
3725    fn drop_without_shutdown(mut self) {
3726        // Safety: drops once, never accessed again due to mem::forget
3727        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3728        // Prevent Drop from running (which would shut down the channel)
3729        std::mem::forget(self);
3730    }
3731}
3732
3733impl LazyInspectPuppetRecordLazyValuesResponder {
3734    /// Sends a response to the FIDL transaction.
3735    ///
3736    /// Sets the channel to shutdown if an error occurs.
3737    pub fn send(
3738        self,
3739        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
3740    ) -> Result<(), fidl::Error> {
3741        let _result = self.send_raw(client);
3742        if _result.is_err() {
3743            self.control_handle.shutdown();
3744        }
3745        self.drop_without_shutdown();
3746        _result
3747    }
3748
3749    /// Similar to "send" but does not shutdown the channel if an error occurs.
3750    pub fn send_no_shutdown_on_err(
3751        self,
3752        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
3753    ) -> Result<(), fidl::Error> {
3754        let _result = self.send_raw(client);
3755        self.drop_without_shutdown();
3756        _result
3757    }
3758
3759    fn send_raw(
3760        &self,
3761        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
3762    ) -> Result<(), fidl::Error> {
3763        self.control_handle
3764            .inner
3765            .send::<fidl::encoding::FlexibleType<InspectWriterRecordLazyValuesResponse>>(
3766                fidl::encoding::Flexible::new((client,)),
3767                self.tx_id,
3768                0xc637cf5d48e9063,
3769                fidl::encoding::DynamicFlags::FLEXIBLE,
3770            )
3771    }
3772}
3773
3774#[must_use = "FIDL methods require a response to be sent"]
3775#[derive(Debug)]
3776pub struct LazyInspectPuppetCommitResponder {
3777    control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
3778    tx_id: u32,
3779}
3780
3781/// Set the the channel to be shutdown (see [`LazyInspectPuppetControlHandle::shutdown`])
3782/// if the responder is dropped without sending a response, so that the client
3783/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3784impl std::ops::Drop for LazyInspectPuppetCommitResponder {
3785    fn drop(&mut self) {
3786        self.control_handle.shutdown();
3787        // Safety: drops once, never accessed again
3788        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3789    }
3790}
3791
3792impl fidl::endpoints::Responder for LazyInspectPuppetCommitResponder {
3793    type ControlHandle = LazyInspectPuppetControlHandle;
3794
3795    fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
3796        &self.control_handle
3797    }
3798
3799    fn drop_without_shutdown(mut self) {
3800        // Safety: drops once, never accessed again due to mem::forget
3801        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3802        // Prevent Drop from running (which would shut down the channel)
3803        std::mem::forget(self);
3804    }
3805}
3806
3807impl LazyInspectPuppetCommitResponder {
3808    /// Sends a response to the FIDL transaction.
3809    ///
3810    /// Sets the channel to shutdown if an error occurs.
3811    pub fn send(self) -> Result<(), fidl::Error> {
3812        let _result = self.send_raw();
3813        if _result.is_err() {
3814            self.control_handle.shutdown();
3815        }
3816        self.drop_without_shutdown();
3817        _result
3818    }
3819
3820    /// Similar to "send" but does not shutdown the channel if an error occurs.
3821    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3822        let _result = self.send_raw();
3823        self.drop_without_shutdown();
3824        _result
3825    }
3826
3827    fn send_raw(&self) -> Result<(), fidl::Error> {
3828        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3829            fidl::encoding::Flexible::new(()),
3830            self.tx_id,
3831            0x79524e5e00cbf03f,
3832            fidl::encoding::DynamicFlags::FLEXIBLE,
3833        )
3834    }
3835}
3836
3837#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3838pub struct LogPuppetMarker;
3839
3840impl fidl::endpoints::ProtocolMarker for LogPuppetMarker {
3841    type Proxy = LogPuppetProxy;
3842    type RequestStream = LogPuppetRequestStream;
3843    #[cfg(target_os = "fuchsia")]
3844    type SynchronousProxy = LogPuppetSynchronousProxy;
3845
3846    const DEBUG_NAME: &'static str = "(anonymous) LogPuppet";
3847}
3848
3849pub trait LogPuppetProxyInterface: Send + Sync {
3850    type PrintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3851    fn r#println(&self, message: &str) -> Self::PrintlnResponseFut;
3852    type EprintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3853    fn r#eprintln(&self, message: &str) -> Self::EprintlnResponseFut;
3854    type LogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3855    fn r#log(&self, payload: &LogPuppetLogRequest) -> Self::LogResponseFut;
3856    type WaitForInterestChangeResponseFut: std::future::Future<Output = Result<LogPuppetWaitForInterestChangeResponse, fidl::Error>>
3857        + Send;
3858    fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut;
3859}
3860#[derive(Debug)]
3861#[cfg(target_os = "fuchsia")]
3862pub struct LogPuppetSynchronousProxy {
3863    client: fidl::client::sync::Client,
3864}
3865
3866#[cfg(target_os = "fuchsia")]
3867impl fidl::endpoints::SynchronousProxy for LogPuppetSynchronousProxy {
3868    type Proxy = LogPuppetProxy;
3869    type Protocol = LogPuppetMarker;
3870
3871    fn from_channel(inner: fidl::Channel) -> Self {
3872        Self::new(inner)
3873    }
3874
3875    fn into_channel(self) -> fidl::Channel {
3876        self.client.into_channel()
3877    }
3878
3879    fn as_channel(&self) -> &fidl::Channel {
3880        self.client.as_channel()
3881    }
3882}
3883
3884#[cfg(target_os = "fuchsia")]
3885impl LogPuppetSynchronousProxy {
3886    pub fn new(channel: fidl::Channel) -> Self {
3887        let protocol_name = <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3888        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3889    }
3890
3891    pub fn into_channel(self) -> fidl::Channel {
3892        self.client.into_channel()
3893    }
3894
3895    /// Waits until an event arrives and returns it. It is safe for other
3896    /// threads to make concurrent requests while waiting for an event.
3897    pub fn wait_for_event(
3898        &self,
3899        deadline: zx::MonotonicInstant,
3900    ) -> Result<LogPuppetEvent, fidl::Error> {
3901        LogPuppetEvent::decode(self.client.wait_for_event(deadline)?)
3902    }
3903
3904    /// Prints a message to stdout and appends a newline.
3905    pub fn r#println(
3906        &self,
3907        mut message: &str,
3908        ___deadline: zx::MonotonicInstant,
3909    ) -> Result<(), fidl::Error> {
3910        let _response = self.client.send_query::<
3911            LogPuppetPrintlnRequest,
3912            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3913        >(
3914            (message,),
3915            0x6584cb93e1978da0,
3916            fidl::encoding::DynamicFlags::FLEXIBLE,
3917            ___deadline,
3918        )?
3919        .into_result::<LogPuppetMarker>("println")?;
3920        Ok(_response)
3921    }
3922
3923    /// Prints a message stderr and appends a newline.
3924    pub fn r#eprintln(
3925        &self,
3926        mut message: &str,
3927        ___deadline: zx::MonotonicInstant,
3928    ) -> Result<(), fidl::Error> {
3929        let _response = self.client.send_query::<
3930            LogPuppetEprintlnRequest,
3931            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3932        >(
3933            (message,),
3934            0x770e4524f6b093ef,
3935            fidl::encoding::DynamicFlags::FLEXIBLE,
3936            ___deadline,
3937        )?
3938        .into_result::<LogPuppetMarker>("eprintln")?;
3939        Ok(_response)
3940    }
3941
3942    /// Emits a tracing event at the specified severity level.
3943    pub fn r#log(
3944        &self,
3945        mut payload: &LogPuppetLogRequest,
3946        ___deadline: zx::MonotonicInstant,
3947    ) -> Result<(), fidl::Error> {
3948        let _response = self.client.send_query::<
3949            LogPuppetLogRequest,
3950            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3951        >(
3952            payload,
3953            0x34d3dd4225e79a8b,
3954            fidl::encoding::DynamicFlags::FLEXIBLE,
3955            ___deadline,
3956        )?
3957        .into_result::<LogPuppetMarker>("log")?;
3958        Ok(_response)
3959    }
3960
3961    /// Blocks the caller until the next time an interest change event is observed.
3962    /// Messages are lost if they are emitted using LogPuppet.Log before the
3963    /// puppet has observed the the interest change.
3964    pub fn r#wait_for_interest_change(
3965        &self,
3966        ___deadline: zx::MonotonicInstant,
3967    ) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
3968        let _response = self.client.send_query::<
3969            fidl::encoding::EmptyPayload,
3970            fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
3971        >(
3972            (),
3973            0x3645d3ad544bc546,
3974            fidl::encoding::DynamicFlags::FLEXIBLE,
3975            ___deadline,
3976        )?
3977        .into_result::<LogPuppetMarker>("wait_for_interest_change")?;
3978        Ok(_response)
3979    }
3980}
3981
3982#[cfg(target_os = "fuchsia")]
3983impl From<LogPuppetSynchronousProxy> for zx::Handle {
3984    fn from(value: LogPuppetSynchronousProxy) -> Self {
3985        value.into_channel().into()
3986    }
3987}
3988
3989#[cfg(target_os = "fuchsia")]
3990impl From<fidl::Channel> for LogPuppetSynchronousProxy {
3991    fn from(value: fidl::Channel) -> Self {
3992        Self::new(value)
3993    }
3994}
3995
3996#[cfg(target_os = "fuchsia")]
3997impl fidl::endpoints::FromClient for LogPuppetSynchronousProxy {
3998    type Protocol = LogPuppetMarker;
3999
4000    fn from_client(value: fidl::endpoints::ClientEnd<LogPuppetMarker>) -> Self {
4001        Self::new(value.into_channel())
4002    }
4003}
4004
4005#[derive(Debug, Clone)]
4006pub struct LogPuppetProxy {
4007    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4008}
4009
4010impl fidl::endpoints::Proxy for LogPuppetProxy {
4011    type Protocol = LogPuppetMarker;
4012
4013    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4014        Self::new(inner)
4015    }
4016
4017    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4018        self.client.into_channel().map_err(|client| Self { client })
4019    }
4020
4021    fn as_channel(&self) -> &::fidl::AsyncChannel {
4022        self.client.as_channel()
4023    }
4024}
4025
4026impl LogPuppetProxy {
4027    /// Create a new Proxy for fuchsia.archivist.test/LogPuppet.
4028    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4029        let protocol_name = <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4030        Self { client: fidl::client::Client::new(channel, protocol_name) }
4031    }
4032
4033    /// Get a Stream of events from the remote end of the protocol.
4034    ///
4035    /// # Panics
4036    ///
4037    /// Panics if the event stream was already taken.
4038    pub fn take_event_stream(&self) -> LogPuppetEventStream {
4039        LogPuppetEventStream { event_receiver: self.client.take_event_receiver() }
4040    }
4041
4042    /// Prints a message to stdout and appends a newline.
4043    pub fn r#println(
4044        &self,
4045        mut message: &str,
4046    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4047        LogPuppetProxyInterface::r#println(self, message)
4048    }
4049
4050    /// Prints a message stderr and appends a newline.
4051    pub fn r#eprintln(
4052        &self,
4053        mut message: &str,
4054    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4055        LogPuppetProxyInterface::r#eprintln(self, message)
4056    }
4057
4058    /// Emits a tracing event at the specified severity level.
4059    pub fn r#log(
4060        &self,
4061        mut payload: &LogPuppetLogRequest,
4062    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4063        LogPuppetProxyInterface::r#log(self, payload)
4064    }
4065
4066    /// Blocks the caller until the next time an interest change event is observed.
4067    /// Messages are lost if they are emitted using LogPuppet.Log before the
4068    /// puppet has observed the the interest change.
4069    pub fn r#wait_for_interest_change(
4070        &self,
4071    ) -> fidl::client::QueryResponseFut<
4072        LogPuppetWaitForInterestChangeResponse,
4073        fidl::encoding::DefaultFuchsiaResourceDialect,
4074    > {
4075        LogPuppetProxyInterface::r#wait_for_interest_change(self)
4076    }
4077}
4078
4079impl LogPuppetProxyInterface for LogPuppetProxy {
4080    type PrintlnResponseFut =
4081        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4082    fn r#println(&self, mut message: &str) -> Self::PrintlnResponseFut {
4083        fn _decode(
4084            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4085        ) -> Result<(), fidl::Error> {
4086            let _response = fidl::client::decode_transaction_body::<
4087                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4088                fidl::encoding::DefaultFuchsiaResourceDialect,
4089                0x6584cb93e1978da0,
4090            >(_buf?)?
4091            .into_result::<LogPuppetMarker>("println")?;
4092            Ok(_response)
4093        }
4094        self.client.send_query_and_decode::<LogPuppetPrintlnRequest, ()>(
4095            (message,),
4096            0x6584cb93e1978da0,
4097            fidl::encoding::DynamicFlags::FLEXIBLE,
4098            _decode,
4099        )
4100    }
4101
4102    type EprintlnResponseFut =
4103        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4104    fn r#eprintln(&self, mut message: &str) -> Self::EprintlnResponseFut {
4105        fn _decode(
4106            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4107        ) -> Result<(), fidl::Error> {
4108            let _response = fidl::client::decode_transaction_body::<
4109                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4110                fidl::encoding::DefaultFuchsiaResourceDialect,
4111                0x770e4524f6b093ef,
4112            >(_buf?)?
4113            .into_result::<LogPuppetMarker>("eprintln")?;
4114            Ok(_response)
4115        }
4116        self.client.send_query_and_decode::<LogPuppetEprintlnRequest, ()>(
4117            (message,),
4118            0x770e4524f6b093ef,
4119            fidl::encoding::DynamicFlags::FLEXIBLE,
4120            _decode,
4121        )
4122    }
4123
4124    type LogResponseFut =
4125        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4126    fn r#log(&self, mut payload: &LogPuppetLogRequest) -> Self::LogResponseFut {
4127        fn _decode(
4128            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4129        ) -> Result<(), fidl::Error> {
4130            let _response = fidl::client::decode_transaction_body::<
4131                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4132                fidl::encoding::DefaultFuchsiaResourceDialect,
4133                0x34d3dd4225e79a8b,
4134            >(_buf?)?
4135            .into_result::<LogPuppetMarker>("log")?;
4136            Ok(_response)
4137        }
4138        self.client.send_query_and_decode::<LogPuppetLogRequest, ()>(
4139            payload,
4140            0x34d3dd4225e79a8b,
4141            fidl::encoding::DynamicFlags::FLEXIBLE,
4142            _decode,
4143        )
4144    }
4145
4146    type WaitForInterestChangeResponseFut = fidl::client::QueryResponseFut<
4147        LogPuppetWaitForInterestChangeResponse,
4148        fidl::encoding::DefaultFuchsiaResourceDialect,
4149    >;
4150    fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut {
4151        fn _decode(
4152            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4153        ) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
4154            let _response = fidl::client::decode_transaction_body::<
4155                fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
4156                fidl::encoding::DefaultFuchsiaResourceDialect,
4157                0x3645d3ad544bc546,
4158            >(_buf?)?
4159            .into_result::<LogPuppetMarker>("wait_for_interest_change")?;
4160            Ok(_response)
4161        }
4162        self.client.send_query_and_decode::<
4163            fidl::encoding::EmptyPayload,
4164            LogPuppetWaitForInterestChangeResponse,
4165        >(
4166            (),
4167            0x3645d3ad544bc546,
4168            fidl::encoding::DynamicFlags::FLEXIBLE,
4169            _decode,
4170        )
4171    }
4172}
4173
4174pub struct LogPuppetEventStream {
4175    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4176}
4177
4178impl std::marker::Unpin for LogPuppetEventStream {}
4179
4180impl futures::stream::FusedStream for LogPuppetEventStream {
4181    fn is_terminated(&self) -> bool {
4182        self.event_receiver.is_terminated()
4183    }
4184}
4185
4186impl futures::Stream for LogPuppetEventStream {
4187    type Item = Result<LogPuppetEvent, fidl::Error>;
4188
4189    fn poll_next(
4190        mut self: std::pin::Pin<&mut Self>,
4191        cx: &mut std::task::Context<'_>,
4192    ) -> std::task::Poll<Option<Self::Item>> {
4193        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4194            &mut self.event_receiver,
4195            cx
4196        )?) {
4197            Some(buf) => std::task::Poll::Ready(Some(LogPuppetEvent::decode(buf))),
4198            None => std::task::Poll::Ready(None),
4199        }
4200    }
4201}
4202
4203#[derive(Debug)]
4204pub enum LogPuppetEvent {
4205    #[non_exhaustive]
4206    _UnknownEvent {
4207        /// Ordinal of the event that was sent.
4208        ordinal: u64,
4209    },
4210}
4211
4212impl LogPuppetEvent {
4213    /// Decodes a message buffer as a [`LogPuppetEvent`].
4214    fn decode(
4215        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4216    ) -> Result<LogPuppetEvent, fidl::Error> {
4217        let (bytes, _handles) = buf.split_mut();
4218        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4219        debug_assert_eq!(tx_header.tx_id, 0);
4220        match tx_header.ordinal {
4221            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4222                Ok(LogPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4223            }
4224            _ => Err(fidl::Error::UnknownOrdinal {
4225                ordinal: tx_header.ordinal,
4226                protocol_name: <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4227            }),
4228        }
4229    }
4230}
4231
4232/// A Stream of incoming requests for fuchsia.archivist.test/LogPuppet.
4233pub struct LogPuppetRequestStream {
4234    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4235    is_terminated: bool,
4236}
4237
4238impl std::marker::Unpin for LogPuppetRequestStream {}
4239
4240impl futures::stream::FusedStream for LogPuppetRequestStream {
4241    fn is_terminated(&self) -> bool {
4242        self.is_terminated
4243    }
4244}
4245
4246impl fidl::endpoints::RequestStream for LogPuppetRequestStream {
4247    type Protocol = LogPuppetMarker;
4248    type ControlHandle = LogPuppetControlHandle;
4249
4250    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4251        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4252    }
4253
4254    fn control_handle(&self) -> Self::ControlHandle {
4255        LogPuppetControlHandle { inner: self.inner.clone() }
4256    }
4257
4258    fn into_inner(
4259        self,
4260    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4261    {
4262        (self.inner, self.is_terminated)
4263    }
4264
4265    fn from_inner(
4266        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4267        is_terminated: bool,
4268    ) -> Self {
4269        Self { inner, is_terminated }
4270    }
4271}
4272
4273impl futures::Stream for LogPuppetRequestStream {
4274    type Item = Result<LogPuppetRequest, fidl::Error>;
4275
4276    fn poll_next(
4277        mut self: std::pin::Pin<&mut Self>,
4278        cx: &mut std::task::Context<'_>,
4279    ) -> std::task::Poll<Option<Self::Item>> {
4280        let this = &mut *self;
4281        if this.inner.check_shutdown(cx) {
4282            this.is_terminated = true;
4283            return std::task::Poll::Ready(None);
4284        }
4285        if this.is_terminated {
4286            panic!("polled LogPuppetRequestStream after completion");
4287        }
4288        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4289            |bytes, handles| {
4290                match this.inner.channel().read_etc(cx, bytes, handles) {
4291                    std::task::Poll::Ready(Ok(())) => {}
4292                    std::task::Poll::Pending => return std::task::Poll::Pending,
4293                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4294                        this.is_terminated = true;
4295                        return std::task::Poll::Ready(None);
4296                    }
4297                    std::task::Poll::Ready(Err(e)) => {
4298                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4299                            e.into(),
4300                        ))));
4301                    }
4302                }
4303
4304                // A message has been received from the channel
4305                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4306
4307                std::task::Poll::Ready(Some(match header.ordinal {
4308                    0x6584cb93e1978da0 => {
4309                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4310                        let mut req = fidl::new_empty!(
4311                            LogPuppetPrintlnRequest,
4312                            fidl::encoding::DefaultFuchsiaResourceDialect
4313                        );
4314                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetPrintlnRequest>(&header, _body_bytes, handles, &mut req)?;
4315                        let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
4316                        Ok(LogPuppetRequest::Println {
4317                            message: req.message,
4318
4319                            responder: LogPuppetPrintlnResponder {
4320                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4321                                tx_id: header.tx_id,
4322                            },
4323                        })
4324                    }
4325                    0x770e4524f6b093ef => {
4326                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4327                        let mut req = fidl::new_empty!(
4328                            LogPuppetEprintlnRequest,
4329                            fidl::encoding::DefaultFuchsiaResourceDialect
4330                        );
4331                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetEprintlnRequest>(&header, _body_bytes, handles, &mut req)?;
4332                        let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
4333                        Ok(LogPuppetRequest::Eprintln {
4334                            message: req.message,
4335
4336                            responder: LogPuppetEprintlnResponder {
4337                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4338                                tx_id: header.tx_id,
4339                            },
4340                        })
4341                    }
4342                    0x34d3dd4225e79a8b => {
4343                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4344                        let mut req = fidl::new_empty!(
4345                            LogPuppetLogRequest,
4346                            fidl::encoding::DefaultFuchsiaResourceDialect
4347                        );
4348                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetLogRequest>(&header, _body_bytes, handles, &mut req)?;
4349                        let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
4350                        Ok(LogPuppetRequest::Log {
4351                            payload: req,
4352                            responder: LogPuppetLogResponder {
4353                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4354                                tx_id: header.tx_id,
4355                            },
4356                        })
4357                    }
4358                    0x3645d3ad544bc546 => {
4359                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4360                        let mut req = fidl::new_empty!(
4361                            fidl::encoding::EmptyPayload,
4362                            fidl::encoding::DefaultFuchsiaResourceDialect
4363                        );
4364                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4365                        let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
4366                        Ok(LogPuppetRequest::WaitForInterestChange {
4367                            responder: LogPuppetWaitForInterestChangeResponder {
4368                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4369                                tx_id: header.tx_id,
4370                            },
4371                        })
4372                    }
4373                    _ if header.tx_id == 0
4374                        && header
4375                            .dynamic_flags()
4376                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4377                    {
4378                        Ok(LogPuppetRequest::_UnknownMethod {
4379                            ordinal: header.ordinal,
4380                            control_handle: LogPuppetControlHandle { inner: this.inner.clone() },
4381                            method_type: fidl::MethodType::OneWay,
4382                        })
4383                    }
4384                    _ if header
4385                        .dynamic_flags()
4386                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4387                    {
4388                        this.inner.send_framework_err(
4389                            fidl::encoding::FrameworkErr::UnknownMethod,
4390                            header.tx_id,
4391                            header.ordinal,
4392                            header.dynamic_flags(),
4393                            (bytes, handles),
4394                        )?;
4395                        Ok(LogPuppetRequest::_UnknownMethod {
4396                            ordinal: header.ordinal,
4397                            control_handle: LogPuppetControlHandle { inner: this.inner.clone() },
4398                            method_type: fidl::MethodType::TwoWay,
4399                        })
4400                    }
4401                    _ => Err(fidl::Error::UnknownOrdinal {
4402                        ordinal: header.ordinal,
4403                        protocol_name:
4404                            <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4405                    }),
4406                }))
4407            },
4408        )
4409    }
4410}
4411
4412/// LoggerPuppet emits log messages when requested.
4413#[derive(Debug)]
4414pub enum LogPuppetRequest {
4415    /// Prints a message to stdout and appends a newline.
4416    Println { message: String, responder: LogPuppetPrintlnResponder },
4417    /// Prints a message stderr and appends a newline.
4418    Eprintln { message: String, responder: LogPuppetEprintlnResponder },
4419    /// Emits a tracing event at the specified severity level.
4420    Log { payload: LogPuppetLogRequest, responder: LogPuppetLogResponder },
4421    /// Blocks the caller until the next time an interest change event is observed.
4422    /// Messages are lost if they are emitted using LogPuppet.Log before the
4423    /// puppet has observed the the interest change.
4424    WaitForInterestChange { responder: LogPuppetWaitForInterestChangeResponder },
4425    /// An interaction was received which does not match any known method.
4426    #[non_exhaustive]
4427    _UnknownMethod {
4428        /// Ordinal of the method that was called.
4429        ordinal: u64,
4430        control_handle: LogPuppetControlHandle,
4431        method_type: fidl::MethodType,
4432    },
4433}
4434
4435impl LogPuppetRequest {
4436    #[allow(irrefutable_let_patterns)]
4437    pub fn into_println(self) -> Option<(String, LogPuppetPrintlnResponder)> {
4438        if let LogPuppetRequest::Println { message, responder } = self {
4439            Some((message, responder))
4440        } else {
4441            None
4442        }
4443    }
4444
4445    #[allow(irrefutable_let_patterns)]
4446    pub fn into_eprintln(self) -> Option<(String, LogPuppetEprintlnResponder)> {
4447        if let LogPuppetRequest::Eprintln { message, responder } = self {
4448            Some((message, responder))
4449        } else {
4450            None
4451        }
4452    }
4453
4454    #[allow(irrefutable_let_patterns)]
4455    pub fn into_log(self) -> Option<(LogPuppetLogRequest, LogPuppetLogResponder)> {
4456        if let LogPuppetRequest::Log { payload, responder } = self {
4457            Some((payload, responder))
4458        } else {
4459            None
4460        }
4461    }
4462
4463    #[allow(irrefutable_let_patterns)]
4464    pub fn into_wait_for_interest_change(
4465        self,
4466    ) -> Option<(LogPuppetWaitForInterestChangeResponder)> {
4467        if let LogPuppetRequest::WaitForInterestChange { responder } = self {
4468            Some((responder))
4469        } else {
4470            None
4471        }
4472    }
4473
4474    /// Name of the method defined in FIDL
4475    pub fn method_name(&self) -> &'static str {
4476        match *self {
4477            LogPuppetRequest::Println { .. } => "println",
4478            LogPuppetRequest::Eprintln { .. } => "eprintln",
4479            LogPuppetRequest::Log { .. } => "log",
4480            LogPuppetRequest::WaitForInterestChange { .. } => "wait_for_interest_change",
4481            LogPuppetRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4482                "unknown one-way method"
4483            }
4484            LogPuppetRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4485                "unknown two-way method"
4486            }
4487        }
4488    }
4489}
4490
4491#[derive(Debug, Clone)]
4492pub struct LogPuppetControlHandle {
4493    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4494}
4495
4496impl fidl::endpoints::ControlHandle for LogPuppetControlHandle {
4497    fn shutdown(&self) {
4498        self.inner.shutdown()
4499    }
4500    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4501        self.inner.shutdown_with_epitaph(status)
4502    }
4503
4504    fn is_closed(&self) -> bool {
4505        self.inner.channel().is_closed()
4506    }
4507    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4508        self.inner.channel().on_closed()
4509    }
4510
4511    #[cfg(target_os = "fuchsia")]
4512    fn signal_peer(
4513        &self,
4514        clear_mask: zx::Signals,
4515        set_mask: zx::Signals,
4516    ) -> Result<(), zx_status::Status> {
4517        use fidl::Peered;
4518        self.inner.channel().signal_peer(clear_mask, set_mask)
4519    }
4520}
4521
4522impl LogPuppetControlHandle {}
4523
4524#[must_use = "FIDL methods require a response to be sent"]
4525#[derive(Debug)]
4526pub struct LogPuppetPrintlnResponder {
4527    control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
4528    tx_id: u32,
4529}
4530
4531/// Set the the channel to be shutdown (see [`LogPuppetControlHandle::shutdown`])
4532/// if the responder is dropped without sending a response, so that the client
4533/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4534impl std::ops::Drop for LogPuppetPrintlnResponder {
4535    fn drop(&mut self) {
4536        self.control_handle.shutdown();
4537        // Safety: drops once, never accessed again
4538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4539    }
4540}
4541
4542impl fidl::endpoints::Responder for LogPuppetPrintlnResponder {
4543    type ControlHandle = LogPuppetControlHandle;
4544
4545    fn control_handle(&self) -> &LogPuppetControlHandle {
4546        &self.control_handle
4547    }
4548
4549    fn drop_without_shutdown(mut self) {
4550        // Safety: drops once, never accessed again due to mem::forget
4551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4552        // Prevent Drop from running (which would shut down the channel)
4553        std::mem::forget(self);
4554    }
4555}
4556
4557impl LogPuppetPrintlnResponder {
4558    /// Sends a response to the FIDL transaction.
4559    ///
4560    /// Sets the channel to shutdown if an error occurs.
4561    pub fn send(self) -> Result<(), fidl::Error> {
4562        let _result = self.send_raw();
4563        if _result.is_err() {
4564            self.control_handle.shutdown();
4565        }
4566        self.drop_without_shutdown();
4567        _result
4568    }
4569
4570    /// Similar to "send" but does not shutdown the channel if an error occurs.
4571    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
4572        let _result = self.send_raw();
4573        self.drop_without_shutdown();
4574        _result
4575    }
4576
4577    fn send_raw(&self) -> Result<(), fidl::Error> {
4578        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
4579            fidl::encoding::Flexible::new(()),
4580            self.tx_id,
4581            0x6584cb93e1978da0,
4582            fidl::encoding::DynamicFlags::FLEXIBLE,
4583        )
4584    }
4585}
4586
4587#[must_use = "FIDL methods require a response to be sent"]
4588#[derive(Debug)]
4589pub struct LogPuppetEprintlnResponder {
4590    control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
4591    tx_id: u32,
4592}
4593
4594/// Set the the channel to be shutdown (see [`LogPuppetControlHandle::shutdown`])
4595/// if the responder is dropped without sending a response, so that the client
4596/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4597impl std::ops::Drop for LogPuppetEprintlnResponder {
4598    fn drop(&mut self) {
4599        self.control_handle.shutdown();
4600        // Safety: drops once, never accessed again
4601        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4602    }
4603}
4604
4605impl fidl::endpoints::Responder for LogPuppetEprintlnResponder {
4606    type ControlHandle = LogPuppetControlHandle;
4607
4608    fn control_handle(&self) -> &LogPuppetControlHandle {
4609        &self.control_handle
4610    }
4611
4612    fn drop_without_shutdown(mut self) {
4613        // Safety: drops once, never accessed again due to mem::forget
4614        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4615        // Prevent Drop from running (which would shut down the channel)
4616        std::mem::forget(self);
4617    }
4618}
4619
4620impl LogPuppetEprintlnResponder {
4621    /// Sends a response to the FIDL transaction.
4622    ///
4623    /// Sets the channel to shutdown if an error occurs.
4624    pub fn send(self) -> Result<(), fidl::Error> {
4625        let _result = self.send_raw();
4626        if _result.is_err() {
4627            self.control_handle.shutdown();
4628        }
4629        self.drop_without_shutdown();
4630        _result
4631    }
4632
4633    /// Similar to "send" but does not shutdown the channel if an error occurs.
4634    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
4635        let _result = self.send_raw();
4636        self.drop_without_shutdown();
4637        _result
4638    }
4639
4640    fn send_raw(&self) -> Result<(), fidl::Error> {
4641        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
4642            fidl::encoding::Flexible::new(()),
4643            self.tx_id,
4644            0x770e4524f6b093ef,
4645            fidl::encoding::DynamicFlags::FLEXIBLE,
4646        )
4647    }
4648}
4649
4650#[must_use = "FIDL methods require a response to be sent"]
4651#[derive(Debug)]
4652pub struct LogPuppetLogResponder {
4653    control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
4654    tx_id: u32,
4655}
4656
4657/// Set the the channel to be shutdown (see [`LogPuppetControlHandle::shutdown`])
4658/// if the responder is dropped without sending a response, so that the client
4659/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4660impl std::ops::Drop for LogPuppetLogResponder {
4661    fn drop(&mut self) {
4662        self.control_handle.shutdown();
4663        // Safety: drops once, never accessed again
4664        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4665    }
4666}
4667
4668impl fidl::endpoints::Responder for LogPuppetLogResponder {
4669    type ControlHandle = LogPuppetControlHandle;
4670
4671    fn control_handle(&self) -> &LogPuppetControlHandle {
4672        &self.control_handle
4673    }
4674
4675    fn drop_without_shutdown(mut self) {
4676        // Safety: drops once, never accessed again due to mem::forget
4677        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4678        // Prevent Drop from running (which would shut down the channel)
4679        std::mem::forget(self);
4680    }
4681}
4682
4683impl LogPuppetLogResponder {
4684    /// Sends a response to the FIDL transaction.
4685    ///
4686    /// Sets the channel to shutdown if an error occurs.
4687    pub fn send(self) -> Result<(), fidl::Error> {
4688        let _result = self.send_raw();
4689        if _result.is_err() {
4690            self.control_handle.shutdown();
4691        }
4692        self.drop_without_shutdown();
4693        _result
4694    }
4695
4696    /// Similar to "send" but does not shutdown the channel if an error occurs.
4697    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
4698        let _result = self.send_raw();
4699        self.drop_without_shutdown();
4700        _result
4701    }
4702
4703    fn send_raw(&self) -> Result<(), fidl::Error> {
4704        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
4705            fidl::encoding::Flexible::new(()),
4706            self.tx_id,
4707            0x34d3dd4225e79a8b,
4708            fidl::encoding::DynamicFlags::FLEXIBLE,
4709        )
4710    }
4711}
4712
4713#[must_use = "FIDL methods require a response to be sent"]
4714#[derive(Debug)]
4715pub struct LogPuppetWaitForInterestChangeResponder {
4716    control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
4717    tx_id: u32,
4718}
4719
4720/// Set the the channel to be shutdown (see [`LogPuppetControlHandle::shutdown`])
4721/// if the responder is dropped without sending a response, so that the client
4722/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4723impl std::ops::Drop for LogPuppetWaitForInterestChangeResponder {
4724    fn drop(&mut self) {
4725        self.control_handle.shutdown();
4726        // Safety: drops once, never accessed again
4727        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4728    }
4729}
4730
4731impl fidl::endpoints::Responder for LogPuppetWaitForInterestChangeResponder {
4732    type ControlHandle = LogPuppetControlHandle;
4733
4734    fn control_handle(&self) -> &LogPuppetControlHandle {
4735        &self.control_handle
4736    }
4737
4738    fn drop_without_shutdown(mut self) {
4739        // Safety: drops once, never accessed again due to mem::forget
4740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4741        // Prevent Drop from running (which would shut down the channel)
4742        std::mem::forget(self);
4743    }
4744}
4745
4746impl LogPuppetWaitForInterestChangeResponder {
4747    /// Sends a response to the FIDL transaction.
4748    ///
4749    /// Sets the channel to shutdown if an error occurs.
4750    pub fn send(
4751        self,
4752        mut payload: &LogPuppetWaitForInterestChangeResponse,
4753    ) -> Result<(), fidl::Error> {
4754        let _result = self.send_raw(payload);
4755        if _result.is_err() {
4756            self.control_handle.shutdown();
4757        }
4758        self.drop_without_shutdown();
4759        _result
4760    }
4761
4762    /// Similar to "send" but does not shutdown the channel if an error occurs.
4763    pub fn send_no_shutdown_on_err(
4764        self,
4765        mut payload: &LogPuppetWaitForInterestChangeResponse,
4766    ) -> Result<(), fidl::Error> {
4767        let _result = self.send_raw(payload);
4768        self.drop_without_shutdown();
4769        _result
4770    }
4771
4772    fn send_raw(
4773        &self,
4774        mut payload: &LogPuppetWaitForInterestChangeResponse,
4775    ) -> Result<(), fidl::Error> {
4776        self.control_handle.inner.send::<fidl::encoding::FlexibleType<
4777            LogPuppetWaitForInterestChangeResponse,
4778        >>(
4779            fidl::encoding::Flexible::new(payload),
4780            self.tx_id,
4781            0x3645d3ad544bc546,
4782            fidl::encoding::DynamicFlags::FLEXIBLE,
4783        )
4784    }
4785}
4786
4787#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4788pub struct PuppetMarker;
4789
4790impl fidl::endpoints::ProtocolMarker for PuppetMarker {
4791    type Proxy = PuppetProxy;
4792    type RequestStream = PuppetRequestStream;
4793    #[cfg(target_os = "fuchsia")]
4794    type SynchronousProxy = PuppetSynchronousProxy;
4795
4796    const DEBUG_NAME: &'static str = "fuchsia.archivist.test.Puppet";
4797}
4798impl fidl::endpoints::DiscoverableProtocolMarker for PuppetMarker {}
4799
4800pub trait PuppetProxyInterface: Send + Sync {
4801    type CreateInspectorResponseFut: std::future::Future<
4802            Output = Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error>,
4803        > + Send;
4804    fn r#create_inspector(
4805        &self,
4806        payload: &InspectPuppetCreateInspectorRequest,
4807    ) -> Self::CreateInspectorResponseFut;
4808    type CreateInspectorFromEscrowResponseFut: std::future::Future<
4809            Output = Result<
4810                (fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo),
4811                fidl::Error,
4812            >,
4813        > + Send;
4814    fn r#create_inspector_from_escrow(
4815        &self,
4816        payload: InspectPuppetCreateInspectorFromEscrowRequest,
4817    ) -> Self::CreateInspectorFromEscrowResponseFut;
4818    type PrintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
4819    fn r#println(&self, message: &str) -> Self::PrintlnResponseFut;
4820    type EprintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
4821    fn r#eprintln(&self, message: &str) -> Self::EprintlnResponseFut;
4822    type LogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
4823    fn r#log(&self, payload: &LogPuppetLogRequest) -> Self::LogResponseFut;
4824    type WaitForInterestChangeResponseFut: std::future::Future<Output = Result<LogPuppetWaitForInterestChangeResponse, fidl::Error>>
4825        + Send;
4826    fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut;
4827    type RecordLazyValuesResponseFut: std::future::Future<
4828            Output = Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error>,
4829        > + Send;
4830    fn r#record_lazy_values(&self, key: &str) -> Self::RecordLazyValuesResponseFut;
4831    fn r#crash(&self, message: &str) -> Result<(), fidl::Error>;
4832}
4833#[derive(Debug)]
4834#[cfg(target_os = "fuchsia")]
4835pub struct PuppetSynchronousProxy {
4836    client: fidl::client::sync::Client,
4837}
4838
4839#[cfg(target_os = "fuchsia")]
4840impl fidl::endpoints::SynchronousProxy for PuppetSynchronousProxy {
4841    type Proxy = PuppetProxy;
4842    type Protocol = PuppetMarker;
4843
4844    fn from_channel(inner: fidl::Channel) -> Self {
4845        Self::new(inner)
4846    }
4847
4848    fn into_channel(self) -> fidl::Channel {
4849        self.client.into_channel()
4850    }
4851
4852    fn as_channel(&self) -> &fidl::Channel {
4853        self.client.as_channel()
4854    }
4855}
4856
4857#[cfg(target_os = "fuchsia")]
4858impl PuppetSynchronousProxy {
4859    pub fn new(channel: fidl::Channel) -> Self {
4860        let protocol_name = <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4861        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4862    }
4863
4864    pub fn into_channel(self) -> fidl::Channel {
4865        self.client.into_channel()
4866    }
4867
4868    /// Waits until an event arrives and returns it. It is safe for other
4869    /// threads to make concurrent requests while waiting for an event.
4870    pub fn wait_for_event(
4871        &self,
4872        deadline: zx::MonotonicInstant,
4873    ) -> Result<PuppetEvent, fidl::Error> {
4874        PuppetEvent::decode(self.client.wait_for_event(deadline)?)
4875    }
4876
4877    /// Create and serve an Inspector with the provided name.
4878    /// InspectWriters created this way are RAII.
4879    pub fn r#create_inspector(
4880        &self,
4881        mut payload: &InspectPuppetCreateInspectorRequest,
4882        ___deadline: zx::MonotonicInstant,
4883    ) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
4884        let _response = self.client.send_query::<
4885            InspectPuppetCreateInspectorRequest,
4886            fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
4887        >(
4888            payload,
4889            0x2c0f807d7d159bb,
4890            fidl::encoding::DynamicFlags::FLEXIBLE,
4891            ___deadline,
4892        )?
4893        .into_result::<PuppetMarker>("create_inspector")?;
4894        Ok(_response.writer)
4895    }
4896
4897    /// Create and serve an Inspector with the same name as a previous escrowed instance.
4898    /// Also returns a VMO with the previously escrowed inspect data.
4899    /// InspectWriters created this way are RAII.
4900    pub fn r#create_inspector_from_escrow(
4901        &self,
4902        mut payload: InspectPuppetCreateInspectorFromEscrowRequest,
4903        ___deadline: zx::MonotonicInstant,
4904    ) -> Result<(fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo), fidl::Error> {
4905        let _response = self.client.send_query::<
4906            InspectPuppetCreateInspectorFromEscrowRequest,
4907            fidl::encoding::FlexibleType<InspectPuppetCreateInspectorFromEscrowResponse>,
4908        >(
4909            &mut payload,
4910            0xe79c0d0606c5df,
4911            fidl::encoding::DynamicFlags::FLEXIBLE,
4912            ___deadline,
4913        )?
4914        .into_result::<PuppetMarker>("create_inspector_from_escrow")?;
4915        Ok((_response.writer, _response.data))
4916    }
4917
4918    /// Prints a message to stdout and appends a newline.
4919    pub fn r#println(
4920        &self,
4921        mut message: &str,
4922        ___deadline: zx::MonotonicInstant,
4923    ) -> Result<(), fidl::Error> {
4924        let _response = self.client.send_query::<
4925            LogPuppetPrintlnRequest,
4926            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4927        >(
4928            (message,),
4929            0x6584cb93e1978da0,
4930            fidl::encoding::DynamicFlags::FLEXIBLE,
4931            ___deadline,
4932        )?
4933        .into_result::<PuppetMarker>("println")?;
4934        Ok(_response)
4935    }
4936
4937    /// Prints a message stderr and appends a newline.
4938    pub fn r#eprintln(
4939        &self,
4940        mut message: &str,
4941        ___deadline: zx::MonotonicInstant,
4942    ) -> Result<(), fidl::Error> {
4943        let _response = self.client.send_query::<
4944            LogPuppetEprintlnRequest,
4945            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4946        >(
4947            (message,),
4948            0x770e4524f6b093ef,
4949            fidl::encoding::DynamicFlags::FLEXIBLE,
4950            ___deadline,
4951        )?
4952        .into_result::<PuppetMarker>("eprintln")?;
4953        Ok(_response)
4954    }
4955
4956    /// Emits a tracing event at the specified severity level.
4957    pub fn r#log(
4958        &self,
4959        mut payload: &LogPuppetLogRequest,
4960        ___deadline: zx::MonotonicInstant,
4961    ) -> Result<(), fidl::Error> {
4962        let _response = self.client.send_query::<
4963            LogPuppetLogRequest,
4964            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4965        >(
4966            payload,
4967            0x34d3dd4225e79a8b,
4968            fidl::encoding::DynamicFlags::FLEXIBLE,
4969            ___deadline,
4970        )?
4971        .into_result::<PuppetMarker>("log")?;
4972        Ok(_response)
4973    }
4974
4975    /// Blocks the caller until the next time an interest change event is observed.
4976    /// Messages are lost if they are emitted using LogPuppet.Log before the
4977    /// puppet has observed the the interest change.
4978    pub fn r#wait_for_interest_change(
4979        &self,
4980        ___deadline: zx::MonotonicInstant,
4981    ) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
4982        let _response = self.client.send_query::<
4983            fidl::encoding::EmptyPayload,
4984            fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
4985        >(
4986            (),
4987            0x3645d3ad544bc546,
4988            fidl::encoding::DynamicFlags::FLEXIBLE,
4989            ___deadline,
4990        )?
4991        .into_result::<PuppetMarker>("wait_for_interest_change")?;
4992        Ok(_response)
4993    }
4994
4995    /// Returns a LazyInspectPuppet client for recording lazy values.
4996    pub fn r#record_lazy_values(
4997        &self,
4998        mut key: &str,
4999        ___deadline: zx::MonotonicInstant,
5000    ) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
5001        let _response = self.client.send_query::<
5002            PuppetRecordLazyValuesRequest,
5003            fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>,
5004        >(
5005            (key,),
5006            0x339951b623dc9d7d,
5007            fidl::encoding::DynamicFlags::FLEXIBLE,
5008            ___deadline,
5009        )?
5010        .into_result::<PuppetMarker>("record_lazy_values")?;
5011        Ok(_response.client)
5012    }
5013
5014    /// Causes the puppet to crash with an optional error message.
5015    ///
5016    /// The connection will be closed after this is called.
5017    pub fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
5018        self.client.send::<PuppetCrashRequest>(
5019            (message,),
5020            0x2aeef488fb79c9db,
5021            fidl::encoding::DynamicFlags::FLEXIBLE,
5022        )
5023    }
5024}
5025
5026#[cfg(target_os = "fuchsia")]
5027impl From<PuppetSynchronousProxy> for zx::Handle {
5028    fn from(value: PuppetSynchronousProxy) -> Self {
5029        value.into_channel().into()
5030    }
5031}
5032
5033#[cfg(target_os = "fuchsia")]
5034impl From<fidl::Channel> for PuppetSynchronousProxy {
5035    fn from(value: fidl::Channel) -> Self {
5036        Self::new(value)
5037    }
5038}
5039
5040#[cfg(target_os = "fuchsia")]
5041impl fidl::endpoints::FromClient for PuppetSynchronousProxy {
5042    type Protocol = PuppetMarker;
5043
5044    fn from_client(value: fidl::endpoints::ClientEnd<PuppetMarker>) -> Self {
5045        Self::new(value.into_channel())
5046    }
5047}
5048
5049#[derive(Debug, Clone)]
5050pub struct PuppetProxy {
5051    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5052}
5053
5054impl fidl::endpoints::Proxy for PuppetProxy {
5055    type Protocol = PuppetMarker;
5056
5057    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5058        Self::new(inner)
5059    }
5060
5061    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5062        self.client.into_channel().map_err(|client| Self { client })
5063    }
5064
5065    fn as_channel(&self) -> &::fidl::AsyncChannel {
5066        self.client.as_channel()
5067    }
5068}
5069
5070impl PuppetProxy {
5071    /// Create a new Proxy for fuchsia.archivist.test/Puppet.
5072    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5073        let protocol_name = <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5074        Self { client: fidl::client::Client::new(channel, protocol_name) }
5075    }
5076
5077    /// Get a Stream of events from the remote end of the protocol.
5078    ///
5079    /// # Panics
5080    ///
5081    /// Panics if the event stream was already taken.
5082    pub fn take_event_stream(&self) -> PuppetEventStream {
5083        PuppetEventStream { event_receiver: self.client.take_event_receiver() }
5084    }
5085
5086    /// Create and serve an Inspector with the provided name.
5087    /// InspectWriters created this way are RAII.
5088    pub fn r#create_inspector(
5089        &self,
5090        mut payload: &InspectPuppetCreateInspectorRequest,
5091    ) -> fidl::client::QueryResponseFut<
5092        fidl::endpoints::ClientEnd<InspectWriterMarker>,
5093        fidl::encoding::DefaultFuchsiaResourceDialect,
5094    > {
5095        PuppetProxyInterface::r#create_inspector(self, payload)
5096    }
5097
5098    /// Create and serve an Inspector with the same name as a previous escrowed instance.
5099    /// Also returns a VMO with the previously escrowed inspect data.
5100    /// InspectWriters created this way are RAII.
5101    pub fn r#create_inspector_from_escrow(
5102        &self,
5103        mut payload: InspectPuppetCreateInspectorFromEscrowRequest,
5104    ) -> fidl::client::QueryResponseFut<
5105        (fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo),
5106        fidl::encoding::DefaultFuchsiaResourceDialect,
5107    > {
5108        PuppetProxyInterface::r#create_inspector_from_escrow(self, payload)
5109    }
5110
5111    /// Prints a message to stdout and appends a newline.
5112    pub fn r#println(
5113        &self,
5114        mut message: &str,
5115    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5116        PuppetProxyInterface::r#println(self, message)
5117    }
5118
5119    /// Prints a message stderr and appends a newline.
5120    pub fn r#eprintln(
5121        &self,
5122        mut message: &str,
5123    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5124        PuppetProxyInterface::r#eprintln(self, message)
5125    }
5126
5127    /// Emits a tracing event at the specified severity level.
5128    pub fn r#log(
5129        &self,
5130        mut payload: &LogPuppetLogRequest,
5131    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5132        PuppetProxyInterface::r#log(self, payload)
5133    }
5134
5135    /// Blocks the caller until the next time an interest change event is observed.
5136    /// Messages are lost if they are emitted using LogPuppet.Log before the
5137    /// puppet has observed the the interest change.
5138    pub fn r#wait_for_interest_change(
5139        &self,
5140    ) -> fidl::client::QueryResponseFut<
5141        LogPuppetWaitForInterestChangeResponse,
5142        fidl::encoding::DefaultFuchsiaResourceDialect,
5143    > {
5144        PuppetProxyInterface::r#wait_for_interest_change(self)
5145    }
5146
5147    /// Returns a LazyInspectPuppet client for recording lazy values.
5148    pub fn r#record_lazy_values(
5149        &self,
5150        mut key: &str,
5151    ) -> fidl::client::QueryResponseFut<
5152        fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
5153        fidl::encoding::DefaultFuchsiaResourceDialect,
5154    > {
5155        PuppetProxyInterface::r#record_lazy_values(self, key)
5156    }
5157
5158    /// Causes the puppet to crash with an optional error message.
5159    ///
5160    /// The connection will be closed after this is called.
5161    pub fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
5162        PuppetProxyInterface::r#crash(self, message)
5163    }
5164}
5165
5166impl PuppetProxyInterface for PuppetProxy {
5167    type CreateInspectorResponseFut = fidl::client::QueryResponseFut<
5168        fidl::endpoints::ClientEnd<InspectWriterMarker>,
5169        fidl::encoding::DefaultFuchsiaResourceDialect,
5170    >;
5171    fn r#create_inspector(
5172        &self,
5173        mut payload: &InspectPuppetCreateInspectorRequest,
5174    ) -> Self::CreateInspectorResponseFut {
5175        fn _decode(
5176            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5177        ) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
5178            let _response = fidl::client::decode_transaction_body::<
5179                fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
5180                fidl::encoding::DefaultFuchsiaResourceDialect,
5181                0x2c0f807d7d159bb,
5182            >(_buf?)?
5183            .into_result::<PuppetMarker>("create_inspector")?;
5184            Ok(_response.writer)
5185        }
5186        self.client.send_query_and_decode::<
5187            InspectPuppetCreateInspectorRequest,
5188            fidl::endpoints::ClientEnd<InspectWriterMarker>,
5189        >(
5190            payload,
5191            0x2c0f807d7d159bb,
5192            fidl::encoding::DynamicFlags::FLEXIBLE,
5193            _decode,
5194        )
5195    }
5196
5197    type CreateInspectorFromEscrowResponseFut = fidl::client::QueryResponseFut<
5198        (fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo),
5199        fidl::encoding::DefaultFuchsiaResourceDialect,
5200    >;
5201    fn r#create_inspector_from_escrow(
5202        &self,
5203        mut payload: InspectPuppetCreateInspectorFromEscrowRequest,
5204    ) -> Self::CreateInspectorFromEscrowResponseFut {
5205        fn _decode(
5206            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5207        ) -> Result<(fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo), fidl::Error>
5208        {
5209            let _response = fidl::client::decode_transaction_body::<
5210                fidl::encoding::FlexibleType<InspectPuppetCreateInspectorFromEscrowResponse>,
5211                fidl::encoding::DefaultFuchsiaResourceDialect,
5212                0xe79c0d0606c5df,
5213            >(_buf?)?
5214            .into_result::<PuppetMarker>("create_inspector_from_escrow")?;
5215            Ok((_response.writer, _response.data))
5216        }
5217        self.client.send_query_and_decode::<
5218            InspectPuppetCreateInspectorFromEscrowRequest,
5219            (fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Vmo),
5220        >(
5221            &mut payload,
5222            0xe79c0d0606c5df,
5223            fidl::encoding::DynamicFlags::FLEXIBLE,
5224            _decode,
5225        )
5226    }
5227
5228    type PrintlnResponseFut =
5229        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5230    fn r#println(&self, mut message: &str) -> Self::PrintlnResponseFut {
5231        fn _decode(
5232            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5233        ) -> Result<(), fidl::Error> {
5234            let _response = fidl::client::decode_transaction_body::<
5235                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
5236                fidl::encoding::DefaultFuchsiaResourceDialect,
5237                0x6584cb93e1978da0,
5238            >(_buf?)?
5239            .into_result::<PuppetMarker>("println")?;
5240            Ok(_response)
5241        }
5242        self.client.send_query_and_decode::<LogPuppetPrintlnRequest, ()>(
5243            (message,),
5244            0x6584cb93e1978da0,
5245            fidl::encoding::DynamicFlags::FLEXIBLE,
5246            _decode,
5247        )
5248    }
5249
5250    type EprintlnResponseFut =
5251        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5252    fn r#eprintln(&self, mut message: &str) -> Self::EprintlnResponseFut {
5253        fn _decode(
5254            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5255        ) -> Result<(), fidl::Error> {
5256            let _response = fidl::client::decode_transaction_body::<
5257                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
5258                fidl::encoding::DefaultFuchsiaResourceDialect,
5259                0x770e4524f6b093ef,
5260            >(_buf?)?
5261            .into_result::<PuppetMarker>("eprintln")?;
5262            Ok(_response)
5263        }
5264        self.client.send_query_and_decode::<LogPuppetEprintlnRequest, ()>(
5265            (message,),
5266            0x770e4524f6b093ef,
5267            fidl::encoding::DynamicFlags::FLEXIBLE,
5268            _decode,
5269        )
5270    }
5271
5272    type LogResponseFut =
5273        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5274    fn r#log(&self, mut payload: &LogPuppetLogRequest) -> Self::LogResponseFut {
5275        fn _decode(
5276            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5277        ) -> Result<(), fidl::Error> {
5278            let _response = fidl::client::decode_transaction_body::<
5279                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
5280                fidl::encoding::DefaultFuchsiaResourceDialect,
5281                0x34d3dd4225e79a8b,
5282            >(_buf?)?
5283            .into_result::<PuppetMarker>("log")?;
5284            Ok(_response)
5285        }
5286        self.client.send_query_and_decode::<LogPuppetLogRequest, ()>(
5287            payload,
5288            0x34d3dd4225e79a8b,
5289            fidl::encoding::DynamicFlags::FLEXIBLE,
5290            _decode,
5291        )
5292    }
5293
5294    type WaitForInterestChangeResponseFut = fidl::client::QueryResponseFut<
5295        LogPuppetWaitForInterestChangeResponse,
5296        fidl::encoding::DefaultFuchsiaResourceDialect,
5297    >;
5298    fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut {
5299        fn _decode(
5300            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5301        ) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
5302            let _response = fidl::client::decode_transaction_body::<
5303                fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
5304                fidl::encoding::DefaultFuchsiaResourceDialect,
5305                0x3645d3ad544bc546,
5306            >(_buf?)?
5307            .into_result::<PuppetMarker>("wait_for_interest_change")?;
5308            Ok(_response)
5309        }
5310        self.client.send_query_and_decode::<
5311            fidl::encoding::EmptyPayload,
5312            LogPuppetWaitForInterestChangeResponse,
5313        >(
5314            (),
5315            0x3645d3ad544bc546,
5316            fidl::encoding::DynamicFlags::FLEXIBLE,
5317            _decode,
5318        )
5319    }
5320
5321    type RecordLazyValuesResponseFut = fidl::client::QueryResponseFut<
5322        fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
5323        fidl::encoding::DefaultFuchsiaResourceDialect,
5324    >;
5325    fn r#record_lazy_values(&self, mut key: &str) -> Self::RecordLazyValuesResponseFut {
5326        fn _decode(
5327            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5328        ) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
5329            let _response = fidl::client::decode_transaction_body::<
5330                fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>,
5331                fidl::encoding::DefaultFuchsiaResourceDialect,
5332                0x339951b623dc9d7d,
5333            >(_buf?)?
5334            .into_result::<PuppetMarker>("record_lazy_values")?;
5335            Ok(_response.client)
5336        }
5337        self.client.send_query_and_decode::<
5338            PuppetRecordLazyValuesRequest,
5339            fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
5340        >(
5341            (key,),
5342            0x339951b623dc9d7d,
5343            fidl::encoding::DynamicFlags::FLEXIBLE,
5344            _decode,
5345        )
5346    }
5347
5348    fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
5349        self.client.send::<PuppetCrashRequest>(
5350            (message,),
5351            0x2aeef488fb79c9db,
5352            fidl::encoding::DynamicFlags::FLEXIBLE,
5353        )
5354    }
5355}
5356
5357pub struct PuppetEventStream {
5358    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5359}
5360
5361impl std::marker::Unpin for PuppetEventStream {}
5362
5363impl futures::stream::FusedStream for PuppetEventStream {
5364    fn is_terminated(&self) -> bool {
5365        self.event_receiver.is_terminated()
5366    }
5367}
5368
5369impl futures::Stream for PuppetEventStream {
5370    type Item = Result<PuppetEvent, fidl::Error>;
5371
5372    fn poll_next(
5373        mut self: std::pin::Pin<&mut Self>,
5374        cx: &mut std::task::Context<'_>,
5375    ) -> std::task::Poll<Option<Self::Item>> {
5376        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5377            &mut self.event_receiver,
5378            cx
5379        )?) {
5380            Some(buf) => std::task::Poll::Ready(Some(PuppetEvent::decode(buf))),
5381            None => std::task::Poll::Ready(None),
5382        }
5383    }
5384}
5385
5386#[derive(Debug)]
5387pub enum PuppetEvent {
5388    #[non_exhaustive]
5389    _UnknownEvent {
5390        /// Ordinal of the event that was sent.
5391        ordinal: u64,
5392    },
5393}
5394
5395impl PuppetEvent {
5396    /// Decodes a message buffer as a [`PuppetEvent`].
5397    fn decode(
5398        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5399    ) -> Result<PuppetEvent, fidl::Error> {
5400        let (bytes, _handles) = buf.split_mut();
5401        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5402        debug_assert_eq!(tx_header.tx_id, 0);
5403        match tx_header.ordinal {
5404            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5405                Ok(PuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5406            }
5407            _ => Err(fidl::Error::UnknownOrdinal {
5408                ordinal: tx_header.ordinal,
5409                protocol_name: <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5410            }),
5411        }
5412    }
5413}
5414
5415/// A Stream of incoming requests for fuchsia.archivist.test/Puppet.
5416pub struct PuppetRequestStream {
5417    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5418    is_terminated: bool,
5419}
5420
5421impl std::marker::Unpin for PuppetRequestStream {}
5422
5423impl futures::stream::FusedStream for PuppetRequestStream {
5424    fn is_terminated(&self) -> bool {
5425        self.is_terminated
5426    }
5427}
5428
5429impl fidl::endpoints::RequestStream for PuppetRequestStream {
5430    type Protocol = PuppetMarker;
5431    type ControlHandle = PuppetControlHandle;
5432
5433    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5434        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5435    }
5436
5437    fn control_handle(&self) -> Self::ControlHandle {
5438        PuppetControlHandle { inner: self.inner.clone() }
5439    }
5440
5441    fn into_inner(
5442        self,
5443    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5444    {
5445        (self.inner, self.is_terminated)
5446    }
5447
5448    fn from_inner(
5449        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5450        is_terminated: bool,
5451    ) -> Self {
5452        Self { inner, is_terminated }
5453    }
5454}
5455
5456impl futures::Stream for PuppetRequestStream {
5457    type Item = Result<PuppetRequest, fidl::Error>;
5458
5459    fn poll_next(
5460        mut self: std::pin::Pin<&mut Self>,
5461        cx: &mut std::task::Context<'_>,
5462    ) -> std::task::Poll<Option<Self::Item>> {
5463        let this = &mut *self;
5464        if this.inner.check_shutdown(cx) {
5465            this.is_terminated = true;
5466            return std::task::Poll::Ready(None);
5467        }
5468        if this.is_terminated {
5469            panic!("polled PuppetRequestStream after completion");
5470        }
5471        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5472            |bytes, handles| {
5473                match this.inner.channel().read_etc(cx, bytes, handles) {
5474                    std::task::Poll::Ready(Ok(())) => {}
5475                    std::task::Poll::Pending => return std::task::Poll::Pending,
5476                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5477                        this.is_terminated = true;
5478                        return std::task::Poll::Ready(None);
5479                    }
5480                    std::task::Poll::Ready(Err(e)) => {
5481                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5482                            e.into(),
5483                        ))));
5484                    }
5485                }
5486
5487                // A message has been received from the channel
5488                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5489
5490                std::task::Poll::Ready(Some(match header.ordinal {
5491                    0x2c0f807d7d159bb => {
5492                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5493                        let mut req = fidl::new_empty!(
5494                            InspectPuppetCreateInspectorRequest,
5495                            fidl::encoding::DefaultFuchsiaResourceDialect
5496                        );
5497                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetCreateInspectorRequest>(&header, _body_bytes, handles, &mut req)?;
5498                        let control_handle = PuppetControlHandle { inner: this.inner.clone() };
5499                        Ok(PuppetRequest::CreateInspector {
5500                            payload: req,
5501                            responder: PuppetCreateInspectorResponder {
5502                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5503                                tx_id: header.tx_id,
5504                            },
5505                        })
5506                    }
5507                    0xe79c0d0606c5df => {
5508                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5509                        let mut req = fidl::new_empty!(
5510                            InspectPuppetCreateInspectorFromEscrowRequest,
5511                            fidl::encoding::DefaultFuchsiaResourceDialect
5512                        );
5513                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetCreateInspectorFromEscrowRequest>(&header, _body_bytes, handles, &mut req)?;
5514                        let control_handle = PuppetControlHandle { inner: this.inner.clone() };
5515                        Ok(PuppetRequest::CreateInspectorFromEscrow {
5516                            payload: req,
5517                            responder: PuppetCreateInspectorFromEscrowResponder {
5518                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5519                                tx_id: header.tx_id,
5520                            },
5521                        })
5522                    }
5523                    0x6584cb93e1978da0 => {
5524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5525                        let mut req = fidl::new_empty!(
5526                            LogPuppetPrintlnRequest,
5527                            fidl::encoding::DefaultFuchsiaResourceDialect
5528                        );
5529                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetPrintlnRequest>(&header, _body_bytes, handles, &mut req)?;
5530                        let control_handle = PuppetControlHandle { inner: this.inner.clone() };
5531                        Ok(PuppetRequest::Println {
5532                            message: req.message,
5533
5534                            responder: PuppetPrintlnResponder {
5535                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5536                                tx_id: header.tx_id,
5537                            },
5538                        })
5539                    }
5540                    0x770e4524f6b093ef => {
5541                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5542                        let mut req = fidl::new_empty!(
5543                            LogPuppetEprintlnRequest,
5544                            fidl::encoding::DefaultFuchsiaResourceDialect
5545                        );
5546                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetEprintlnRequest>(&header, _body_bytes, handles, &mut req)?;
5547                        let control_handle = PuppetControlHandle { inner: this.inner.clone() };
5548                        Ok(PuppetRequest::Eprintln {
5549                            message: req.message,
5550
5551                            responder: PuppetEprintlnResponder {
5552                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5553                                tx_id: header.tx_id,
5554                            },
5555                        })
5556                    }
5557                    0x34d3dd4225e79a8b => {
5558                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5559                        let mut req = fidl::new_empty!(
5560                            LogPuppetLogRequest,
5561                            fidl::encoding::DefaultFuchsiaResourceDialect
5562                        );
5563                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetLogRequest>(&header, _body_bytes, handles, &mut req)?;
5564                        let control_handle = PuppetControlHandle { inner: this.inner.clone() };
5565                        Ok(PuppetRequest::Log {
5566                            payload: req,
5567                            responder: PuppetLogResponder {
5568                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5569                                tx_id: header.tx_id,
5570                            },
5571                        })
5572                    }
5573                    0x3645d3ad544bc546 => {
5574                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5575                        let mut req = fidl::new_empty!(
5576                            fidl::encoding::EmptyPayload,
5577                            fidl::encoding::DefaultFuchsiaResourceDialect
5578                        );
5579                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5580                        let control_handle = PuppetControlHandle { inner: this.inner.clone() };
5581                        Ok(PuppetRequest::WaitForInterestChange {
5582                            responder: PuppetWaitForInterestChangeResponder {
5583                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5584                                tx_id: header.tx_id,
5585                            },
5586                        })
5587                    }
5588                    0x339951b623dc9d7d => {
5589                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5590                        let mut req = fidl::new_empty!(
5591                            PuppetRecordLazyValuesRequest,
5592                            fidl::encoding::DefaultFuchsiaResourceDialect
5593                        );
5594                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PuppetRecordLazyValuesRequest>(&header, _body_bytes, handles, &mut req)?;
5595                        let control_handle = PuppetControlHandle { inner: this.inner.clone() };
5596                        Ok(PuppetRequest::RecordLazyValues {
5597                            key: req.key,
5598
5599                            responder: PuppetRecordLazyValuesResponder {
5600                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5601                                tx_id: header.tx_id,
5602                            },
5603                        })
5604                    }
5605                    0x2aeef488fb79c9db => {
5606                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5607                        let mut req = fidl::new_empty!(
5608                            PuppetCrashRequest,
5609                            fidl::encoding::DefaultFuchsiaResourceDialect
5610                        );
5611                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PuppetCrashRequest>(&header, _body_bytes, handles, &mut req)?;
5612                        let control_handle = PuppetControlHandle { inner: this.inner.clone() };
5613                        Ok(PuppetRequest::Crash { message: req.message, control_handle })
5614                    }
5615                    _ if header.tx_id == 0
5616                        && header
5617                            .dynamic_flags()
5618                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5619                    {
5620                        Ok(PuppetRequest::_UnknownMethod {
5621                            ordinal: header.ordinal,
5622                            control_handle: PuppetControlHandle { inner: this.inner.clone() },
5623                            method_type: fidl::MethodType::OneWay,
5624                        })
5625                    }
5626                    _ if header
5627                        .dynamic_flags()
5628                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5629                    {
5630                        this.inner.send_framework_err(
5631                            fidl::encoding::FrameworkErr::UnknownMethod,
5632                            header.tx_id,
5633                            header.ordinal,
5634                            header.dynamic_flags(),
5635                            (bytes, handles),
5636                        )?;
5637                        Ok(PuppetRequest::_UnknownMethod {
5638                            ordinal: header.ordinal,
5639                            control_handle: PuppetControlHandle { inner: this.inner.clone() },
5640                            method_type: fidl::MethodType::TwoWay,
5641                        })
5642                    }
5643                    _ => Err(fidl::Error::UnknownOrdinal {
5644                        ordinal: header.ordinal,
5645                        protocol_name:
5646                            <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5647                    }),
5648                }))
5649            },
5650        )
5651    }
5652}
5653
5654/// Puppet is testing component that interacts with Archivist.
5655///
5656/// For full documentation see //src/diagnostics/testing/realm-factory/README.md.
5657#[derive(Debug)]
5658pub enum PuppetRequest {
5659    /// Create and serve an Inspector with the provided name.
5660    /// InspectWriters created this way are RAII.
5661    CreateInspector {
5662        payload: InspectPuppetCreateInspectorRequest,
5663        responder: PuppetCreateInspectorResponder,
5664    },
5665    /// Create and serve an Inspector with the same name as a previous escrowed instance.
5666    /// Also returns a VMO with the previously escrowed inspect data.
5667    /// InspectWriters created this way are RAII.
5668    CreateInspectorFromEscrow {
5669        payload: InspectPuppetCreateInspectorFromEscrowRequest,
5670        responder: PuppetCreateInspectorFromEscrowResponder,
5671    },
5672    /// Prints a message to stdout and appends a newline.
5673    Println { message: String, responder: PuppetPrintlnResponder },
5674    /// Prints a message stderr and appends a newline.
5675    Eprintln { message: String, responder: PuppetEprintlnResponder },
5676    /// Emits a tracing event at the specified severity level.
5677    Log { payload: LogPuppetLogRequest, responder: PuppetLogResponder },
5678    /// Blocks the caller until the next time an interest change event is observed.
5679    /// Messages are lost if they are emitted using LogPuppet.Log before the
5680    /// puppet has observed the the interest change.
5681    WaitForInterestChange { responder: PuppetWaitForInterestChangeResponder },
5682    /// Returns a LazyInspectPuppet client for recording lazy values.
5683    RecordLazyValues { key: String, responder: PuppetRecordLazyValuesResponder },
5684    /// Causes the puppet to crash with an optional error message.
5685    ///
5686    /// The connection will be closed after this is called.
5687    Crash { message: String, control_handle: PuppetControlHandle },
5688    /// An interaction was received which does not match any known method.
5689    #[non_exhaustive]
5690    _UnknownMethod {
5691        /// Ordinal of the method that was called.
5692        ordinal: u64,
5693        control_handle: PuppetControlHandle,
5694        method_type: fidl::MethodType,
5695    },
5696}
5697
5698impl PuppetRequest {
5699    #[allow(irrefutable_let_patterns)]
5700    pub fn into_create_inspector(
5701        self,
5702    ) -> Option<(InspectPuppetCreateInspectorRequest, PuppetCreateInspectorResponder)> {
5703        if let PuppetRequest::CreateInspector { payload, responder } = self {
5704            Some((payload, responder))
5705        } else {
5706            None
5707        }
5708    }
5709
5710    #[allow(irrefutable_let_patterns)]
5711    pub fn into_create_inspector_from_escrow(
5712        self,
5713    ) -> Option<(
5714        InspectPuppetCreateInspectorFromEscrowRequest,
5715        PuppetCreateInspectorFromEscrowResponder,
5716    )> {
5717        if let PuppetRequest::CreateInspectorFromEscrow { payload, responder } = self {
5718            Some((payload, responder))
5719        } else {
5720            None
5721        }
5722    }
5723
5724    #[allow(irrefutable_let_patterns)]
5725    pub fn into_println(self) -> Option<(String, PuppetPrintlnResponder)> {
5726        if let PuppetRequest::Println { message, responder } = self {
5727            Some((message, responder))
5728        } else {
5729            None
5730        }
5731    }
5732
5733    #[allow(irrefutable_let_patterns)]
5734    pub fn into_eprintln(self) -> Option<(String, PuppetEprintlnResponder)> {
5735        if let PuppetRequest::Eprintln { message, responder } = self {
5736            Some((message, responder))
5737        } else {
5738            None
5739        }
5740    }
5741
5742    #[allow(irrefutable_let_patterns)]
5743    pub fn into_log(self) -> Option<(LogPuppetLogRequest, PuppetLogResponder)> {
5744        if let PuppetRequest::Log { payload, responder } = self {
5745            Some((payload, responder))
5746        } else {
5747            None
5748        }
5749    }
5750
5751    #[allow(irrefutable_let_patterns)]
5752    pub fn into_wait_for_interest_change(self) -> Option<(PuppetWaitForInterestChangeResponder)> {
5753        if let PuppetRequest::WaitForInterestChange { responder } = self {
5754            Some((responder))
5755        } else {
5756            None
5757        }
5758    }
5759
5760    #[allow(irrefutable_let_patterns)]
5761    pub fn into_record_lazy_values(self) -> Option<(String, PuppetRecordLazyValuesResponder)> {
5762        if let PuppetRequest::RecordLazyValues { key, responder } = self {
5763            Some((key, responder))
5764        } else {
5765            None
5766        }
5767    }
5768
5769    #[allow(irrefutable_let_patterns)]
5770    pub fn into_crash(self) -> Option<(String, PuppetControlHandle)> {
5771        if let PuppetRequest::Crash { message, control_handle } = self {
5772            Some((message, control_handle))
5773        } else {
5774            None
5775        }
5776    }
5777
5778    /// Name of the method defined in FIDL
5779    pub fn method_name(&self) -> &'static str {
5780        match *self {
5781            PuppetRequest::CreateInspector { .. } => "create_inspector",
5782            PuppetRequest::CreateInspectorFromEscrow { .. } => "create_inspector_from_escrow",
5783            PuppetRequest::Println { .. } => "println",
5784            PuppetRequest::Eprintln { .. } => "eprintln",
5785            PuppetRequest::Log { .. } => "log",
5786            PuppetRequest::WaitForInterestChange { .. } => "wait_for_interest_change",
5787            PuppetRequest::RecordLazyValues { .. } => "record_lazy_values",
5788            PuppetRequest::Crash { .. } => "crash",
5789            PuppetRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5790                "unknown one-way method"
5791            }
5792            PuppetRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5793                "unknown two-way method"
5794            }
5795        }
5796    }
5797}
5798
5799#[derive(Debug, Clone)]
5800pub struct PuppetControlHandle {
5801    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5802}
5803
5804impl fidl::endpoints::ControlHandle for PuppetControlHandle {
5805    fn shutdown(&self) {
5806        self.inner.shutdown()
5807    }
5808    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5809        self.inner.shutdown_with_epitaph(status)
5810    }
5811
5812    fn is_closed(&self) -> bool {
5813        self.inner.channel().is_closed()
5814    }
5815    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5816        self.inner.channel().on_closed()
5817    }
5818
5819    #[cfg(target_os = "fuchsia")]
5820    fn signal_peer(
5821        &self,
5822        clear_mask: zx::Signals,
5823        set_mask: zx::Signals,
5824    ) -> Result<(), zx_status::Status> {
5825        use fidl::Peered;
5826        self.inner.channel().signal_peer(clear_mask, set_mask)
5827    }
5828}
5829
5830impl PuppetControlHandle {}
5831
5832#[must_use = "FIDL methods require a response to be sent"]
5833#[derive(Debug)]
5834pub struct PuppetCreateInspectorResponder {
5835    control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
5836    tx_id: u32,
5837}
5838
5839/// Set the the channel to be shutdown (see [`PuppetControlHandle::shutdown`])
5840/// if the responder is dropped without sending a response, so that the client
5841/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5842impl std::ops::Drop for PuppetCreateInspectorResponder {
5843    fn drop(&mut self) {
5844        self.control_handle.shutdown();
5845        // Safety: drops once, never accessed again
5846        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5847    }
5848}
5849
5850impl fidl::endpoints::Responder for PuppetCreateInspectorResponder {
5851    type ControlHandle = PuppetControlHandle;
5852
5853    fn control_handle(&self) -> &PuppetControlHandle {
5854        &self.control_handle
5855    }
5856
5857    fn drop_without_shutdown(mut self) {
5858        // Safety: drops once, never accessed again due to mem::forget
5859        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5860        // Prevent Drop from running (which would shut down the channel)
5861        std::mem::forget(self);
5862    }
5863}
5864
5865impl PuppetCreateInspectorResponder {
5866    /// Sends a response to the FIDL transaction.
5867    ///
5868    /// Sets the channel to shutdown if an error occurs.
5869    pub fn send(
5870        self,
5871        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
5872    ) -> Result<(), fidl::Error> {
5873        let _result = self.send_raw(writer);
5874        if _result.is_err() {
5875            self.control_handle.shutdown();
5876        }
5877        self.drop_without_shutdown();
5878        _result
5879    }
5880
5881    /// Similar to "send" but does not shutdown the channel if an error occurs.
5882    pub fn send_no_shutdown_on_err(
5883        self,
5884        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
5885    ) -> Result<(), fidl::Error> {
5886        let _result = self.send_raw(writer);
5887        self.drop_without_shutdown();
5888        _result
5889    }
5890
5891    fn send_raw(
5892        &self,
5893        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
5894    ) -> Result<(), fidl::Error> {
5895        self.control_handle
5896            .inner
5897            .send::<fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>>(
5898                fidl::encoding::Flexible::new((writer,)),
5899                self.tx_id,
5900                0x2c0f807d7d159bb,
5901                fidl::encoding::DynamicFlags::FLEXIBLE,
5902            )
5903    }
5904}
5905
5906#[must_use = "FIDL methods require a response to be sent"]
5907#[derive(Debug)]
5908pub struct PuppetCreateInspectorFromEscrowResponder {
5909    control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
5910    tx_id: u32,
5911}
5912
5913/// Set the the channel to be shutdown (see [`PuppetControlHandle::shutdown`])
5914/// if the responder is dropped without sending a response, so that the client
5915/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5916impl std::ops::Drop for PuppetCreateInspectorFromEscrowResponder {
5917    fn drop(&mut self) {
5918        self.control_handle.shutdown();
5919        // Safety: drops once, never accessed again
5920        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5921    }
5922}
5923
5924impl fidl::endpoints::Responder for PuppetCreateInspectorFromEscrowResponder {
5925    type ControlHandle = PuppetControlHandle;
5926
5927    fn control_handle(&self) -> &PuppetControlHandle {
5928        &self.control_handle
5929    }
5930
5931    fn drop_without_shutdown(mut self) {
5932        // Safety: drops once, never accessed again due to mem::forget
5933        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5934        // Prevent Drop from running (which would shut down the channel)
5935        std::mem::forget(self);
5936    }
5937}
5938
5939impl PuppetCreateInspectorFromEscrowResponder {
5940    /// Sends a response to the FIDL transaction.
5941    ///
5942    /// Sets the channel to shutdown if an error occurs.
5943    pub fn send(
5944        self,
5945        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
5946        mut data: fidl::Vmo,
5947    ) -> Result<(), fidl::Error> {
5948        let _result = self.send_raw(writer, data);
5949        if _result.is_err() {
5950            self.control_handle.shutdown();
5951        }
5952        self.drop_without_shutdown();
5953        _result
5954    }
5955
5956    /// Similar to "send" but does not shutdown the channel if an error occurs.
5957    pub fn send_no_shutdown_on_err(
5958        self,
5959        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
5960        mut data: fidl::Vmo,
5961    ) -> Result<(), fidl::Error> {
5962        let _result = self.send_raw(writer, data);
5963        self.drop_without_shutdown();
5964        _result
5965    }
5966
5967    fn send_raw(
5968        &self,
5969        mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
5970        mut data: fidl::Vmo,
5971    ) -> Result<(), fidl::Error> {
5972        self.control_handle.inner.send::<fidl::encoding::FlexibleType<
5973            InspectPuppetCreateInspectorFromEscrowResponse,
5974        >>(
5975            fidl::encoding::Flexible::new((writer, data)),
5976            self.tx_id,
5977            0xe79c0d0606c5df,
5978            fidl::encoding::DynamicFlags::FLEXIBLE,
5979        )
5980    }
5981}
5982
5983#[must_use = "FIDL methods require a response to be sent"]
5984#[derive(Debug)]
5985pub struct PuppetPrintlnResponder {
5986    control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
5987    tx_id: u32,
5988}
5989
5990/// Set the the channel to be shutdown (see [`PuppetControlHandle::shutdown`])
5991/// if the responder is dropped without sending a response, so that the client
5992/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5993impl std::ops::Drop for PuppetPrintlnResponder {
5994    fn drop(&mut self) {
5995        self.control_handle.shutdown();
5996        // Safety: drops once, never accessed again
5997        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5998    }
5999}
6000
6001impl fidl::endpoints::Responder for PuppetPrintlnResponder {
6002    type ControlHandle = PuppetControlHandle;
6003
6004    fn control_handle(&self) -> &PuppetControlHandle {
6005        &self.control_handle
6006    }
6007
6008    fn drop_without_shutdown(mut self) {
6009        // Safety: drops once, never accessed again due to mem::forget
6010        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6011        // Prevent Drop from running (which would shut down the channel)
6012        std::mem::forget(self);
6013    }
6014}
6015
6016impl PuppetPrintlnResponder {
6017    /// Sends a response to the FIDL transaction.
6018    ///
6019    /// Sets the channel to shutdown if an error occurs.
6020    pub fn send(self) -> Result<(), fidl::Error> {
6021        let _result = self.send_raw();
6022        if _result.is_err() {
6023            self.control_handle.shutdown();
6024        }
6025        self.drop_without_shutdown();
6026        _result
6027    }
6028
6029    /// Similar to "send" but does not shutdown the channel if an error occurs.
6030    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
6031        let _result = self.send_raw();
6032        self.drop_without_shutdown();
6033        _result
6034    }
6035
6036    fn send_raw(&self) -> Result<(), fidl::Error> {
6037        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
6038            fidl::encoding::Flexible::new(()),
6039            self.tx_id,
6040            0x6584cb93e1978da0,
6041            fidl::encoding::DynamicFlags::FLEXIBLE,
6042        )
6043    }
6044}
6045
6046#[must_use = "FIDL methods require a response to be sent"]
6047#[derive(Debug)]
6048pub struct PuppetEprintlnResponder {
6049    control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
6050    tx_id: u32,
6051}
6052
6053/// Set the the channel to be shutdown (see [`PuppetControlHandle::shutdown`])
6054/// if the responder is dropped without sending a response, so that the client
6055/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6056impl std::ops::Drop for PuppetEprintlnResponder {
6057    fn drop(&mut self) {
6058        self.control_handle.shutdown();
6059        // Safety: drops once, never accessed again
6060        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6061    }
6062}
6063
6064impl fidl::endpoints::Responder for PuppetEprintlnResponder {
6065    type ControlHandle = PuppetControlHandle;
6066
6067    fn control_handle(&self) -> &PuppetControlHandle {
6068        &self.control_handle
6069    }
6070
6071    fn drop_without_shutdown(mut self) {
6072        // Safety: drops once, never accessed again due to mem::forget
6073        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6074        // Prevent Drop from running (which would shut down the channel)
6075        std::mem::forget(self);
6076    }
6077}
6078
6079impl PuppetEprintlnResponder {
6080    /// Sends a response to the FIDL transaction.
6081    ///
6082    /// Sets the channel to shutdown if an error occurs.
6083    pub fn send(self) -> Result<(), fidl::Error> {
6084        let _result = self.send_raw();
6085        if _result.is_err() {
6086            self.control_handle.shutdown();
6087        }
6088        self.drop_without_shutdown();
6089        _result
6090    }
6091
6092    /// Similar to "send" but does not shutdown the channel if an error occurs.
6093    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
6094        let _result = self.send_raw();
6095        self.drop_without_shutdown();
6096        _result
6097    }
6098
6099    fn send_raw(&self) -> Result<(), fidl::Error> {
6100        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
6101            fidl::encoding::Flexible::new(()),
6102            self.tx_id,
6103            0x770e4524f6b093ef,
6104            fidl::encoding::DynamicFlags::FLEXIBLE,
6105        )
6106    }
6107}
6108
6109#[must_use = "FIDL methods require a response to be sent"]
6110#[derive(Debug)]
6111pub struct PuppetLogResponder {
6112    control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
6113    tx_id: u32,
6114}
6115
6116/// Set the the channel to be shutdown (see [`PuppetControlHandle::shutdown`])
6117/// if the responder is dropped without sending a response, so that the client
6118/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6119impl std::ops::Drop for PuppetLogResponder {
6120    fn drop(&mut self) {
6121        self.control_handle.shutdown();
6122        // Safety: drops once, never accessed again
6123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6124    }
6125}
6126
6127impl fidl::endpoints::Responder for PuppetLogResponder {
6128    type ControlHandle = PuppetControlHandle;
6129
6130    fn control_handle(&self) -> &PuppetControlHandle {
6131        &self.control_handle
6132    }
6133
6134    fn drop_without_shutdown(mut self) {
6135        // Safety: drops once, never accessed again due to mem::forget
6136        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6137        // Prevent Drop from running (which would shut down the channel)
6138        std::mem::forget(self);
6139    }
6140}
6141
6142impl PuppetLogResponder {
6143    /// Sends a response to the FIDL transaction.
6144    ///
6145    /// Sets the channel to shutdown if an error occurs.
6146    pub fn send(self) -> Result<(), fidl::Error> {
6147        let _result = self.send_raw();
6148        if _result.is_err() {
6149            self.control_handle.shutdown();
6150        }
6151        self.drop_without_shutdown();
6152        _result
6153    }
6154
6155    /// Similar to "send" but does not shutdown the channel if an error occurs.
6156    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
6157        let _result = self.send_raw();
6158        self.drop_without_shutdown();
6159        _result
6160    }
6161
6162    fn send_raw(&self) -> Result<(), fidl::Error> {
6163        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
6164            fidl::encoding::Flexible::new(()),
6165            self.tx_id,
6166            0x34d3dd4225e79a8b,
6167            fidl::encoding::DynamicFlags::FLEXIBLE,
6168        )
6169    }
6170}
6171
6172#[must_use = "FIDL methods require a response to be sent"]
6173#[derive(Debug)]
6174pub struct PuppetWaitForInterestChangeResponder {
6175    control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
6176    tx_id: u32,
6177}
6178
6179/// Set the the channel to be shutdown (see [`PuppetControlHandle::shutdown`])
6180/// if the responder is dropped without sending a response, so that the client
6181/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6182impl std::ops::Drop for PuppetWaitForInterestChangeResponder {
6183    fn drop(&mut self) {
6184        self.control_handle.shutdown();
6185        // Safety: drops once, never accessed again
6186        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6187    }
6188}
6189
6190impl fidl::endpoints::Responder for PuppetWaitForInterestChangeResponder {
6191    type ControlHandle = PuppetControlHandle;
6192
6193    fn control_handle(&self) -> &PuppetControlHandle {
6194        &self.control_handle
6195    }
6196
6197    fn drop_without_shutdown(mut self) {
6198        // Safety: drops once, never accessed again due to mem::forget
6199        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6200        // Prevent Drop from running (which would shut down the channel)
6201        std::mem::forget(self);
6202    }
6203}
6204
6205impl PuppetWaitForInterestChangeResponder {
6206    /// Sends a response to the FIDL transaction.
6207    ///
6208    /// Sets the channel to shutdown if an error occurs.
6209    pub fn send(
6210        self,
6211        mut payload: &LogPuppetWaitForInterestChangeResponse,
6212    ) -> Result<(), fidl::Error> {
6213        let _result = self.send_raw(payload);
6214        if _result.is_err() {
6215            self.control_handle.shutdown();
6216        }
6217        self.drop_without_shutdown();
6218        _result
6219    }
6220
6221    /// Similar to "send" but does not shutdown the channel if an error occurs.
6222    pub fn send_no_shutdown_on_err(
6223        self,
6224        mut payload: &LogPuppetWaitForInterestChangeResponse,
6225    ) -> Result<(), fidl::Error> {
6226        let _result = self.send_raw(payload);
6227        self.drop_without_shutdown();
6228        _result
6229    }
6230
6231    fn send_raw(
6232        &self,
6233        mut payload: &LogPuppetWaitForInterestChangeResponse,
6234    ) -> Result<(), fidl::Error> {
6235        self.control_handle.inner.send::<fidl::encoding::FlexibleType<
6236            LogPuppetWaitForInterestChangeResponse,
6237        >>(
6238            fidl::encoding::Flexible::new(payload),
6239            self.tx_id,
6240            0x3645d3ad544bc546,
6241            fidl::encoding::DynamicFlags::FLEXIBLE,
6242        )
6243    }
6244}
6245
6246#[must_use = "FIDL methods require a response to be sent"]
6247#[derive(Debug)]
6248pub struct PuppetRecordLazyValuesResponder {
6249    control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
6250    tx_id: u32,
6251}
6252
6253/// Set the the channel to be shutdown (see [`PuppetControlHandle::shutdown`])
6254/// if the responder is dropped without sending a response, so that the client
6255/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6256impl std::ops::Drop for PuppetRecordLazyValuesResponder {
6257    fn drop(&mut self) {
6258        self.control_handle.shutdown();
6259        // Safety: drops once, never accessed again
6260        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6261    }
6262}
6263
6264impl fidl::endpoints::Responder for PuppetRecordLazyValuesResponder {
6265    type ControlHandle = PuppetControlHandle;
6266
6267    fn control_handle(&self) -> &PuppetControlHandle {
6268        &self.control_handle
6269    }
6270
6271    fn drop_without_shutdown(mut self) {
6272        // Safety: drops once, never accessed again due to mem::forget
6273        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6274        // Prevent Drop from running (which would shut down the channel)
6275        std::mem::forget(self);
6276    }
6277}
6278
6279impl PuppetRecordLazyValuesResponder {
6280    /// Sends a response to the FIDL transaction.
6281    ///
6282    /// Sets the channel to shutdown if an error occurs.
6283    pub fn send(
6284        self,
6285        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
6286    ) -> Result<(), fidl::Error> {
6287        let _result = self.send_raw(client);
6288        if _result.is_err() {
6289            self.control_handle.shutdown();
6290        }
6291        self.drop_without_shutdown();
6292        _result
6293    }
6294
6295    /// Similar to "send" but does not shutdown the channel if an error occurs.
6296    pub fn send_no_shutdown_on_err(
6297        self,
6298        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
6299    ) -> Result<(), fidl::Error> {
6300        let _result = self.send_raw(client);
6301        self.drop_without_shutdown();
6302        _result
6303    }
6304
6305    fn send_raw(
6306        &self,
6307        mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
6308    ) -> Result<(), fidl::Error> {
6309        self.control_handle
6310            .inner
6311            .send::<fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>>(
6312                fidl::encoding::Flexible::new((client,)),
6313                self.tx_id,
6314                0x339951b623dc9d7d,
6315                fidl::encoding::DynamicFlags::FLEXIBLE,
6316            )
6317    }
6318}
6319
6320#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6321pub struct RealmFactoryMarker;
6322
6323impl fidl::endpoints::ProtocolMarker for RealmFactoryMarker {
6324    type Proxy = RealmFactoryProxy;
6325    type RequestStream = RealmFactoryRequestStream;
6326    #[cfg(target_os = "fuchsia")]
6327    type SynchronousProxy = RealmFactorySynchronousProxy;
6328
6329    const DEBUG_NAME: &'static str = "fuchsia.archivist.test.RealmFactory";
6330}
6331impl fidl::endpoints::DiscoverableProtocolMarker for RealmFactoryMarker {}
6332pub type RealmFactoryCreateRealmResult = Result<(), fidl_fuchsia_testing_harness::OperationError>;
6333
6334pub trait RealmFactoryProxyInterface: Send + Sync {
6335    type CreateRealmResponseFut: std::future::Future<Output = Result<RealmFactoryCreateRealmResult, fidl::Error>>
6336        + Send;
6337    fn r#create_realm(
6338        &self,
6339        options: &RealmOptions,
6340        realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
6341    ) -> Self::CreateRealmResponseFut;
6342}
6343#[derive(Debug)]
6344#[cfg(target_os = "fuchsia")]
6345pub struct RealmFactorySynchronousProxy {
6346    client: fidl::client::sync::Client,
6347}
6348
6349#[cfg(target_os = "fuchsia")]
6350impl fidl::endpoints::SynchronousProxy for RealmFactorySynchronousProxy {
6351    type Proxy = RealmFactoryProxy;
6352    type Protocol = RealmFactoryMarker;
6353
6354    fn from_channel(inner: fidl::Channel) -> Self {
6355        Self::new(inner)
6356    }
6357
6358    fn into_channel(self) -> fidl::Channel {
6359        self.client.into_channel()
6360    }
6361
6362    fn as_channel(&self) -> &fidl::Channel {
6363        self.client.as_channel()
6364    }
6365}
6366
6367#[cfg(target_os = "fuchsia")]
6368impl RealmFactorySynchronousProxy {
6369    pub fn new(channel: fidl::Channel) -> Self {
6370        let protocol_name = <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6371        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6372    }
6373
6374    pub fn into_channel(self) -> fidl::Channel {
6375        self.client.into_channel()
6376    }
6377
6378    /// Waits until an event arrives and returns it. It is safe for other
6379    /// threads to make concurrent requests while waiting for an event.
6380    pub fn wait_for_event(
6381        &self,
6382        deadline: zx::MonotonicInstant,
6383    ) -> Result<RealmFactoryEvent, fidl::Error> {
6384        RealmFactoryEvent::decode(self.client.wait_for_event(deadline)?)
6385    }
6386
6387    /// Specifies the options to use when creating the realm.
6388    ///
6389    /// Returns OperationError.INVALID if called more than once.
6390    pub fn r#create_realm(
6391        &self,
6392        mut options: &RealmOptions,
6393        mut realm_server: fidl::endpoints::ServerEnd<
6394            fidl_fuchsia_testing_harness::RealmProxy_Marker,
6395        >,
6396        ___deadline: zx::MonotonicInstant,
6397    ) -> Result<RealmFactoryCreateRealmResult, fidl::Error> {
6398        let _response = self
6399            .client
6400            .send_query::<RealmFactoryCreateRealmRequest, fidl::encoding::FlexibleResultType<
6401                fidl::encoding::EmptyStruct,
6402                fidl_fuchsia_testing_harness::OperationError,
6403            >>(
6404                (options, realm_server),
6405                0x176832ac7263ab99,
6406                fidl::encoding::DynamicFlags::FLEXIBLE,
6407                ___deadline,
6408            )?
6409            .into_result::<RealmFactoryMarker>("create_realm")?;
6410        Ok(_response.map(|x| x))
6411    }
6412}
6413
6414#[cfg(target_os = "fuchsia")]
6415impl From<RealmFactorySynchronousProxy> for zx::Handle {
6416    fn from(value: RealmFactorySynchronousProxy) -> Self {
6417        value.into_channel().into()
6418    }
6419}
6420
6421#[cfg(target_os = "fuchsia")]
6422impl From<fidl::Channel> for RealmFactorySynchronousProxy {
6423    fn from(value: fidl::Channel) -> Self {
6424        Self::new(value)
6425    }
6426}
6427
6428#[cfg(target_os = "fuchsia")]
6429impl fidl::endpoints::FromClient for RealmFactorySynchronousProxy {
6430    type Protocol = RealmFactoryMarker;
6431
6432    fn from_client(value: fidl::endpoints::ClientEnd<RealmFactoryMarker>) -> Self {
6433        Self::new(value.into_channel())
6434    }
6435}
6436
6437#[derive(Debug, Clone)]
6438pub struct RealmFactoryProxy {
6439    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6440}
6441
6442impl fidl::endpoints::Proxy for RealmFactoryProxy {
6443    type Protocol = RealmFactoryMarker;
6444
6445    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6446        Self::new(inner)
6447    }
6448
6449    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6450        self.client.into_channel().map_err(|client| Self { client })
6451    }
6452
6453    fn as_channel(&self) -> &::fidl::AsyncChannel {
6454        self.client.as_channel()
6455    }
6456}
6457
6458impl RealmFactoryProxy {
6459    /// Create a new Proxy for fuchsia.archivist.test/RealmFactory.
6460    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6461        let protocol_name = <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6462        Self { client: fidl::client::Client::new(channel, protocol_name) }
6463    }
6464
6465    /// Get a Stream of events from the remote end of the protocol.
6466    ///
6467    /// # Panics
6468    ///
6469    /// Panics if the event stream was already taken.
6470    pub fn take_event_stream(&self) -> RealmFactoryEventStream {
6471        RealmFactoryEventStream { event_receiver: self.client.take_event_receiver() }
6472    }
6473
6474    /// Specifies the options to use when creating the realm.
6475    ///
6476    /// Returns OperationError.INVALID if called more than once.
6477    pub fn r#create_realm(
6478        &self,
6479        mut options: &RealmOptions,
6480        mut realm_server: fidl::endpoints::ServerEnd<
6481            fidl_fuchsia_testing_harness::RealmProxy_Marker,
6482        >,
6483    ) -> fidl::client::QueryResponseFut<
6484        RealmFactoryCreateRealmResult,
6485        fidl::encoding::DefaultFuchsiaResourceDialect,
6486    > {
6487        RealmFactoryProxyInterface::r#create_realm(self, options, realm_server)
6488    }
6489}
6490
6491impl RealmFactoryProxyInterface for RealmFactoryProxy {
6492    type CreateRealmResponseFut = fidl::client::QueryResponseFut<
6493        RealmFactoryCreateRealmResult,
6494        fidl::encoding::DefaultFuchsiaResourceDialect,
6495    >;
6496    fn r#create_realm(
6497        &self,
6498        mut options: &RealmOptions,
6499        mut realm_server: fidl::endpoints::ServerEnd<
6500            fidl_fuchsia_testing_harness::RealmProxy_Marker,
6501        >,
6502    ) -> Self::CreateRealmResponseFut {
6503        fn _decode(
6504            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6505        ) -> Result<RealmFactoryCreateRealmResult, fidl::Error> {
6506            let _response = fidl::client::decode_transaction_body::<
6507                fidl::encoding::FlexibleResultType<
6508                    fidl::encoding::EmptyStruct,
6509                    fidl_fuchsia_testing_harness::OperationError,
6510                >,
6511                fidl::encoding::DefaultFuchsiaResourceDialect,
6512                0x176832ac7263ab99,
6513            >(_buf?)?
6514            .into_result::<RealmFactoryMarker>("create_realm")?;
6515            Ok(_response.map(|x| x))
6516        }
6517        self.client
6518            .send_query_and_decode::<RealmFactoryCreateRealmRequest, RealmFactoryCreateRealmResult>(
6519                (options, realm_server),
6520                0x176832ac7263ab99,
6521                fidl::encoding::DynamicFlags::FLEXIBLE,
6522                _decode,
6523            )
6524    }
6525}
6526
6527pub struct RealmFactoryEventStream {
6528    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6529}
6530
6531impl std::marker::Unpin for RealmFactoryEventStream {}
6532
6533impl futures::stream::FusedStream for RealmFactoryEventStream {
6534    fn is_terminated(&self) -> bool {
6535        self.event_receiver.is_terminated()
6536    }
6537}
6538
6539impl futures::Stream for RealmFactoryEventStream {
6540    type Item = Result<RealmFactoryEvent, fidl::Error>;
6541
6542    fn poll_next(
6543        mut self: std::pin::Pin<&mut Self>,
6544        cx: &mut std::task::Context<'_>,
6545    ) -> std::task::Poll<Option<Self::Item>> {
6546        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6547            &mut self.event_receiver,
6548            cx
6549        )?) {
6550            Some(buf) => std::task::Poll::Ready(Some(RealmFactoryEvent::decode(buf))),
6551            None => std::task::Poll::Ready(None),
6552        }
6553    }
6554}
6555
6556#[derive(Debug)]
6557pub enum RealmFactoryEvent {
6558    #[non_exhaustive]
6559    _UnknownEvent {
6560        /// Ordinal of the event that was sent.
6561        ordinal: u64,
6562    },
6563}
6564
6565impl RealmFactoryEvent {
6566    /// Decodes a message buffer as a [`RealmFactoryEvent`].
6567    fn decode(
6568        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6569    ) -> Result<RealmFactoryEvent, fidl::Error> {
6570        let (bytes, _handles) = buf.split_mut();
6571        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6572        debug_assert_eq!(tx_header.tx_id, 0);
6573        match tx_header.ordinal {
6574            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6575                Ok(RealmFactoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6576            }
6577            _ => Err(fidl::Error::UnknownOrdinal {
6578                ordinal: tx_header.ordinal,
6579                protocol_name: <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6580            }),
6581        }
6582    }
6583}
6584
6585/// A Stream of incoming requests for fuchsia.archivist.test/RealmFactory.
6586pub struct RealmFactoryRequestStream {
6587    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6588    is_terminated: bool,
6589}
6590
6591impl std::marker::Unpin for RealmFactoryRequestStream {}
6592
6593impl futures::stream::FusedStream for RealmFactoryRequestStream {
6594    fn is_terminated(&self) -> bool {
6595        self.is_terminated
6596    }
6597}
6598
6599impl fidl::endpoints::RequestStream for RealmFactoryRequestStream {
6600    type Protocol = RealmFactoryMarker;
6601    type ControlHandle = RealmFactoryControlHandle;
6602
6603    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6604        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6605    }
6606
6607    fn control_handle(&self) -> Self::ControlHandle {
6608        RealmFactoryControlHandle { inner: self.inner.clone() }
6609    }
6610
6611    fn into_inner(
6612        self,
6613    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6614    {
6615        (self.inner, self.is_terminated)
6616    }
6617
6618    fn from_inner(
6619        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6620        is_terminated: bool,
6621    ) -> Self {
6622        Self { inner, is_terminated }
6623    }
6624}
6625
6626impl futures::Stream for RealmFactoryRequestStream {
6627    type Item = Result<RealmFactoryRequest, fidl::Error>;
6628
6629    fn poll_next(
6630        mut self: std::pin::Pin<&mut Self>,
6631        cx: &mut std::task::Context<'_>,
6632    ) -> std::task::Poll<Option<Self::Item>> {
6633        let this = &mut *self;
6634        if this.inner.check_shutdown(cx) {
6635            this.is_terminated = true;
6636            return std::task::Poll::Ready(None);
6637        }
6638        if this.is_terminated {
6639            panic!("polled RealmFactoryRequestStream after completion");
6640        }
6641        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6642            |bytes, handles| {
6643                match this.inner.channel().read_etc(cx, bytes, handles) {
6644                    std::task::Poll::Ready(Ok(())) => {}
6645                    std::task::Poll::Pending => return std::task::Poll::Pending,
6646                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6647                        this.is_terminated = true;
6648                        return std::task::Poll::Ready(None);
6649                    }
6650                    std::task::Poll::Ready(Err(e)) => {
6651                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6652                            e.into(),
6653                        ))));
6654                    }
6655                }
6656
6657                // A message has been received from the channel
6658                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6659
6660                std::task::Poll::Ready(Some(match header.ordinal {
6661                    0x176832ac7263ab99 => {
6662                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6663                        let mut req = fidl::new_empty!(
6664                            RealmFactoryCreateRealmRequest,
6665                            fidl::encoding::DefaultFuchsiaResourceDialect
6666                        );
6667                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmFactoryCreateRealmRequest>(&header, _body_bytes, handles, &mut req)?;
6668                        let control_handle =
6669                            RealmFactoryControlHandle { inner: this.inner.clone() };
6670                        Ok(RealmFactoryRequest::CreateRealm {
6671                            options: req.options,
6672                            realm_server: req.realm_server,
6673
6674                            responder: RealmFactoryCreateRealmResponder {
6675                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6676                                tx_id: header.tx_id,
6677                            },
6678                        })
6679                    }
6680                    _ if header.tx_id == 0
6681                        && header
6682                            .dynamic_flags()
6683                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6684                    {
6685                        Ok(RealmFactoryRequest::_UnknownMethod {
6686                            ordinal: header.ordinal,
6687                            control_handle: RealmFactoryControlHandle { inner: this.inner.clone() },
6688                            method_type: fidl::MethodType::OneWay,
6689                        })
6690                    }
6691                    _ if header
6692                        .dynamic_flags()
6693                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6694                    {
6695                        this.inner.send_framework_err(
6696                            fidl::encoding::FrameworkErr::UnknownMethod,
6697                            header.tx_id,
6698                            header.ordinal,
6699                            header.dynamic_flags(),
6700                            (bytes, handles),
6701                        )?;
6702                        Ok(RealmFactoryRequest::_UnknownMethod {
6703                            ordinal: header.ordinal,
6704                            control_handle: RealmFactoryControlHandle { inner: this.inner.clone() },
6705                            method_type: fidl::MethodType::TwoWay,
6706                        })
6707                    }
6708                    _ => Err(fidl::Error::UnknownOrdinal {
6709                        ordinal: header.ordinal,
6710                        protocol_name:
6711                            <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6712                    }),
6713                }))
6714            },
6715        )
6716    }
6717}
6718
6719/// The test realm factory protocol for archivist integration tests.
6720///
6721/// This protocol allows clients to build an archivist component in a hermetic
6722/// test realm that also includes several "puppet" components.
6723///
6724/// For full documentation see //src/diagnostics/testing/realm-factory/README.md.
6725#[derive(Debug)]
6726pub enum RealmFactoryRequest {
6727    /// Specifies the options to use when creating the realm.
6728    ///
6729    /// Returns OperationError.INVALID if called more than once.
6730    CreateRealm {
6731        options: RealmOptions,
6732        realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
6733        responder: RealmFactoryCreateRealmResponder,
6734    },
6735    /// An interaction was received which does not match any known method.
6736    #[non_exhaustive]
6737    _UnknownMethod {
6738        /// Ordinal of the method that was called.
6739        ordinal: u64,
6740        control_handle: RealmFactoryControlHandle,
6741        method_type: fidl::MethodType,
6742    },
6743}
6744
6745impl RealmFactoryRequest {
6746    #[allow(irrefutable_let_patterns)]
6747    pub fn into_create_realm(
6748        self,
6749    ) -> Option<(
6750        RealmOptions,
6751        fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
6752        RealmFactoryCreateRealmResponder,
6753    )> {
6754        if let RealmFactoryRequest::CreateRealm { options, realm_server, responder } = self {
6755            Some((options, realm_server, responder))
6756        } else {
6757            None
6758        }
6759    }
6760
6761    /// Name of the method defined in FIDL
6762    pub fn method_name(&self) -> &'static str {
6763        match *self {
6764            RealmFactoryRequest::CreateRealm { .. } => "create_realm",
6765            RealmFactoryRequest::_UnknownMethod {
6766                method_type: fidl::MethodType::OneWay, ..
6767            } => "unknown one-way method",
6768            RealmFactoryRequest::_UnknownMethod {
6769                method_type: fidl::MethodType::TwoWay, ..
6770            } => "unknown two-way method",
6771        }
6772    }
6773}
6774
6775#[derive(Debug, Clone)]
6776pub struct RealmFactoryControlHandle {
6777    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6778}
6779
6780impl fidl::endpoints::ControlHandle for RealmFactoryControlHandle {
6781    fn shutdown(&self) {
6782        self.inner.shutdown()
6783    }
6784    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6785        self.inner.shutdown_with_epitaph(status)
6786    }
6787
6788    fn is_closed(&self) -> bool {
6789        self.inner.channel().is_closed()
6790    }
6791    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6792        self.inner.channel().on_closed()
6793    }
6794
6795    #[cfg(target_os = "fuchsia")]
6796    fn signal_peer(
6797        &self,
6798        clear_mask: zx::Signals,
6799        set_mask: zx::Signals,
6800    ) -> Result<(), zx_status::Status> {
6801        use fidl::Peered;
6802        self.inner.channel().signal_peer(clear_mask, set_mask)
6803    }
6804}
6805
6806impl RealmFactoryControlHandle {}
6807
6808#[must_use = "FIDL methods require a response to be sent"]
6809#[derive(Debug)]
6810pub struct RealmFactoryCreateRealmResponder {
6811    control_handle: std::mem::ManuallyDrop<RealmFactoryControlHandle>,
6812    tx_id: u32,
6813}
6814
6815/// Set the the channel to be shutdown (see [`RealmFactoryControlHandle::shutdown`])
6816/// if the responder is dropped without sending a response, so that the client
6817/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6818impl std::ops::Drop for RealmFactoryCreateRealmResponder {
6819    fn drop(&mut self) {
6820        self.control_handle.shutdown();
6821        // Safety: drops once, never accessed again
6822        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6823    }
6824}
6825
6826impl fidl::endpoints::Responder for RealmFactoryCreateRealmResponder {
6827    type ControlHandle = RealmFactoryControlHandle;
6828
6829    fn control_handle(&self) -> &RealmFactoryControlHandle {
6830        &self.control_handle
6831    }
6832
6833    fn drop_without_shutdown(mut self) {
6834        // Safety: drops once, never accessed again due to mem::forget
6835        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6836        // Prevent Drop from running (which would shut down the channel)
6837        std::mem::forget(self);
6838    }
6839}
6840
6841impl RealmFactoryCreateRealmResponder {
6842    /// Sends a response to the FIDL transaction.
6843    ///
6844    /// Sets the channel to shutdown if an error occurs.
6845    pub fn send(
6846        self,
6847        mut result: Result<(), fidl_fuchsia_testing_harness::OperationError>,
6848    ) -> Result<(), fidl::Error> {
6849        let _result = self.send_raw(result);
6850        if _result.is_err() {
6851            self.control_handle.shutdown();
6852        }
6853        self.drop_without_shutdown();
6854        _result
6855    }
6856
6857    /// Similar to "send" but does not shutdown the channel if an error occurs.
6858    pub fn send_no_shutdown_on_err(
6859        self,
6860        mut result: Result<(), fidl_fuchsia_testing_harness::OperationError>,
6861    ) -> Result<(), fidl::Error> {
6862        let _result = self.send_raw(result);
6863        self.drop_without_shutdown();
6864        _result
6865    }
6866
6867    fn send_raw(
6868        &self,
6869        mut result: Result<(), fidl_fuchsia_testing_harness::OperationError>,
6870    ) -> Result<(), fidl::Error> {
6871        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6872            fidl::encoding::EmptyStruct,
6873            fidl_fuchsia_testing_harness::OperationError,
6874        >>(
6875            fidl::encoding::FlexibleResult::new(result),
6876            self.tx_id,
6877            0x176832ac7263ab99,
6878            fidl::encoding::DynamicFlags::FLEXIBLE,
6879        )
6880    }
6881}
6882
6883#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6884pub struct StopWaiterMarker;
6885
6886impl fidl::endpoints::ProtocolMarker for StopWaiterMarker {
6887    type Proxy = StopWaiterProxy;
6888    type RequestStream = StopWaiterRequestStream;
6889    #[cfg(target_os = "fuchsia")]
6890    type SynchronousProxy = StopWaiterSynchronousProxy;
6891
6892    const DEBUG_NAME: &'static str = "(anonymous) StopWaiter";
6893}
6894
6895pub trait StopWaiterProxyInterface: Send + Sync {
6896    type WaitResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
6897    fn r#wait(&self) -> Self::WaitResponseFut;
6898}
6899#[derive(Debug)]
6900#[cfg(target_os = "fuchsia")]
6901pub struct StopWaiterSynchronousProxy {
6902    client: fidl::client::sync::Client,
6903}
6904
6905#[cfg(target_os = "fuchsia")]
6906impl fidl::endpoints::SynchronousProxy for StopWaiterSynchronousProxy {
6907    type Proxy = StopWaiterProxy;
6908    type Protocol = StopWaiterMarker;
6909
6910    fn from_channel(inner: fidl::Channel) -> Self {
6911        Self::new(inner)
6912    }
6913
6914    fn into_channel(self) -> fidl::Channel {
6915        self.client.into_channel()
6916    }
6917
6918    fn as_channel(&self) -> &fidl::Channel {
6919        self.client.as_channel()
6920    }
6921}
6922
6923#[cfg(target_os = "fuchsia")]
6924impl StopWaiterSynchronousProxy {
6925    pub fn new(channel: fidl::Channel) -> Self {
6926        let protocol_name = <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6927        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6928    }
6929
6930    pub fn into_channel(self) -> fidl::Channel {
6931        self.client.into_channel()
6932    }
6933
6934    /// Waits until an event arrives and returns it. It is safe for other
6935    /// threads to make concurrent requests while waiting for an event.
6936    pub fn wait_for_event(
6937        &self,
6938        deadline: zx::MonotonicInstant,
6939    ) -> Result<StopWaiterEvent, fidl::Error> {
6940        StopWaiterEvent::decode(self.client.wait_for_event(deadline)?)
6941    }
6942
6943    /// Returns when the component this subscription is about stops. This will
6944    /// always resolve once it did for the first time it called more than once.
6945    pub fn r#wait(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
6946        let _response = self.client.send_query::<
6947            fidl::encoding::EmptyPayload,
6948            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6949        >(
6950            (),
6951            0x12d62812fe8aa263,
6952            fidl::encoding::DynamicFlags::FLEXIBLE,
6953            ___deadline,
6954        )?
6955        .into_result::<StopWaiterMarker>("wait")?;
6956        Ok(_response)
6957    }
6958}
6959
6960#[cfg(target_os = "fuchsia")]
6961impl From<StopWaiterSynchronousProxy> for zx::Handle {
6962    fn from(value: StopWaiterSynchronousProxy) -> Self {
6963        value.into_channel().into()
6964    }
6965}
6966
6967#[cfg(target_os = "fuchsia")]
6968impl From<fidl::Channel> for StopWaiterSynchronousProxy {
6969    fn from(value: fidl::Channel) -> Self {
6970        Self::new(value)
6971    }
6972}
6973
6974#[cfg(target_os = "fuchsia")]
6975impl fidl::endpoints::FromClient for StopWaiterSynchronousProxy {
6976    type Protocol = StopWaiterMarker;
6977
6978    fn from_client(value: fidl::endpoints::ClientEnd<StopWaiterMarker>) -> Self {
6979        Self::new(value.into_channel())
6980    }
6981}
6982
6983#[derive(Debug, Clone)]
6984pub struct StopWaiterProxy {
6985    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6986}
6987
6988impl fidl::endpoints::Proxy for StopWaiterProxy {
6989    type Protocol = StopWaiterMarker;
6990
6991    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6992        Self::new(inner)
6993    }
6994
6995    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6996        self.client.into_channel().map_err(|client| Self { client })
6997    }
6998
6999    fn as_channel(&self) -> &::fidl::AsyncChannel {
7000        self.client.as_channel()
7001    }
7002}
7003
7004impl StopWaiterProxy {
7005    /// Create a new Proxy for fuchsia.archivist.test/StopWaiter.
7006    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7007        let protocol_name = <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7008        Self { client: fidl::client::Client::new(channel, protocol_name) }
7009    }
7010
7011    /// Get a Stream of events from the remote end of the protocol.
7012    ///
7013    /// # Panics
7014    ///
7015    /// Panics if the event stream was already taken.
7016    pub fn take_event_stream(&self) -> StopWaiterEventStream {
7017        StopWaiterEventStream { event_receiver: self.client.take_event_receiver() }
7018    }
7019
7020    /// Returns when the component this subscription is about stops. This will
7021    /// always resolve once it did for the first time it called more than once.
7022    pub fn r#wait(
7023        &self,
7024    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
7025        StopWaiterProxyInterface::r#wait(self)
7026    }
7027}
7028
7029impl StopWaiterProxyInterface for StopWaiterProxy {
7030    type WaitResponseFut =
7031        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7032    fn r#wait(&self) -> Self::WaitResponseFut {
7033        fn _decode(
7034            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7035        ) -> Result<(), fidl::Error> {
7036            let _response = fidl::client::decode_transaction_body::<
7037                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
7038                fidl::encoding::DefaultFuchsiaResourceDialect,
7039                0x12d62812fe8aa263,
7040            >(_buf?)?
7041            .into_result::<StopWaiterMarker>("wait")?;
7042            Ok(_response)
7043        }
7044        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
7045            (),
7046            0x12d62812fe8aa263,
7047            fidl::encoding::DynamicFlags::FLEXIBLE,
7048            _decode,
7049        )
7050    }
7051}
7052
7053pub struct StopWaiterEventStream {
7054    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7055}
7056
7057impl std::marker::Unpin for StopWaiterEventStream {}
7058
7059impl futures::stream::FusedStream for StopWaiterEventStream {
7060    fn is_terminated(&self) -> bool {
7061        self.event_receiver.is_terminated()
7062    }
7063}
7064
7065impl futures::Stream for StopWaiterEventStream {
7066    type Item = Result<StopWaiterEvent, fidl::Error>;
7067
7068    fn poll_next(
7069        mut self: std::pin::Pin<&mut Self>,
7070        cx: &mut std::task::Context<'_>,
7071    ) -> std::task::Poll<Option<Self::Item>> {
7072        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7073            &mut self.event_receiver,
7074            cx
7075        )?) {
7076            Some(buf) => std::task::Poll::Ready(Some(StopWaiterEvent::decode(buf))),
7077            None => std::task::Poll::Ready(None),
7078        }
7079    }
7080}
7081
7082#[derive(Debug)]
7083pub enum StopWaiterEvent {
7084    #[non_exhaustive]
7085    _UnknownEvent {
7086        /// Ordinal of the event that was sent.
7087        ordinal: u64,
7088    },
7089}
7090
7091impl StopWaiterEvent {
7092    /// Decodes a message buffer as a [`StopWaiterEvent`].
7093    fn decode(
7094        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7095    ) -> Result<StopWaiterEvent, fidl::Error> {
7096        let (bytes, _handles) = buf.split_mut();
7097        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7098        debug_assert_eq!(tx_header.tx_id, 0);
7099        match tx_header.ordinal {
7100            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7101                Ok(StopWaiterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7102            }
7103            _ => Err(fidl::Error::UnknownOrdinal {
7104                ordinal: tx_header.ordinal,
7105                protocol_name: <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7106            }),
7107        }
7108    }
7109}
7110
7111/// A Stream of incoming requests for fuchsia.archivist.test/StopWaiter.
7112pub struct StopWaiterRequestStream {
7113    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7114    is_terminated: bool,
7115}
7116
7117impl std::marker::Unpin for StopWaiterRequestStream {}
7118
7119impl futures::stream::FusedStream for StopWaiterRequestStream {
7120    fn is_terminated(&self) -> bool {
7121        self.is_terminated
7122    }
7123}
7124
7125impl fidl::endpoints::RequestStream for StopWaiterRequestStream {
7126    type Protocol = StopWaiterMarker;
7127    type ControlHandle = StopWaiterControlHandle;
7128
7129    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7130        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7131    }
7132
7133    fn control_handle(&self) -> Self::ControlHandle {
7134        StopWaiterControlHandle { inner: self.inner.clone() }
7135    }
7136
7137    fn into_inner(
7138        self,
7139    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7140    {
7141        (self.inner, self.is_terminated)
7142    }
7143
7144    fn from_inner(
7145        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7146        is_terminated: bool,
7147    ) -> Self {
7148        Self { inner, is_terminated }
7149    }
7150}
7151
7152impl futures::Stream for StopWaiterRequestStream {
7153    type Item = Result<StopWaiterRequest, fidl::Error>;
7154
7155    fn poll_next(
7156        mut self: std::pin::Pin<&mut Self>,
7157        cx: &mut std::task::Context<'_>,
7158    ) -> std::task::Poll<Option<Self::Item>> {
7159        let this = &mut *self;
7160        if this.inner.check_shutdown(cx) {
7161            this.is_terminated = true;
7162            return std::task::Poll::Ready(None);
7163        }
7164        if this.is_terminated {
7165            panic!("polled StopWaiterRequestStream after completion");
7166        }
7167        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7168            |bytes, handles| {
7169                match this.inner.channel().read_etc(cx, bytes, handles) {
7170                    std::task::Poll::Ready(Ok(())) => {}
7171                    std::task::Poll::Pending => return std::task::Poll::Pending,
7172                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7173                        this.is_terminated = true;
7174                        return std::task::Poll::Ready(None);
7175                    }
7176                    std::task::Poll::Ready(Err(e)) => {
7177                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7178                            e.into(),
7179                        ))));
7180                    }
7181                }
7182
7183                // A message has been received from the channel
7184                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7185
7186                std::task::Poll::Ready(Some(match header.ordinal {
7187                    0x12d62812fe8aa263 => {
7188                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7189                        let mut req = fidl::new_empty!(
7190                            fidl::encoding::EmptyPayload,
7191                            fidl::encoding::DefaultFuchsiaResourceDialect
7192                        );
7193                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7194                        let control_handle = StopWaiterControlHandle { inner: this.inner.clone() };
7195                        Ok(StopWaiterRequest::Wait {
7196                            responder: StopWaiterWaitResponder {
7197                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7198                                tx_id: header.tx_id,
7199                            },
7200                        })
7201                    }
7202                    _ if header.tx_id == 0
7203                        && header
7204                            .dynamic_flags()
7205                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7206                    {
7207                        Ok(StopWaiterRequest::_UnknownMethod {
7208                            ordinal: header.ordinal,
7209                            control_handle: StopWaiterControlHandle { inner: this.inner.clone() },
7210                            method_type: fidl::MethodType::OneWay,
7211                        })
7212                    }
7213                    _ if header
7214                        .dynamic_flags()
7215                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7216                    {
7217                        this.inner.send_framework_err(
7218                            fidl::encoding::FrameworkErr::UnknownMethod,
7219                            header.tx_id,
7220                            header.ordinal,
7221                            header.dynamic_flags(),
7222                            (bytes, handles),
7223                        )?;
7224                        Ok(StopWaiterRequest::_UnknownMethod {
7225                            ordinal: header.ordinal,
7226                            control_handle: StopWaiterControlHandle { inner: this.inner.clone() },
7227                            method_type: fidl::MethodType::TwoWay,
7228                        })
7229                    }
7230                    _ => Err(fidl::Error::UnknownOrdinal {
7231                        ordinal: header.ordinal,
7232                        protocol_name:
7233                            <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7234                    }),
7235                }))
7236            },
7237        )
7238    }
7239}
7240
7241/// Provides functionality to await on specific stop events on components.
7242#[derive(Debug)]
7243pub enum StopWaiterRequest {
7244    /// Returns when the component this subscription is about stops. This will
7245    /// always resolve once it did for the first time it called more than once.
7246    Wait { responder: StopWaiterWaitResponder },
7247    /// An interaction was received which does not match any known method.
7248    #[non_exhaustive]
7249    _UnknownMethod {
7250        /// Ordinal of the method that was called.
7251        ordinal: u64,
7252        control_handle: StopWaiterControlHandle,
7253        method_type: fidl::MethodType,
7254    },
7255}
7256
7257impl StopWaiterRequest {
7258    #[allow(irrefutable_let_patterns)]
7259    pub fn into_wait(self) -> Option<(StopWaiterWaitResponder)> {
7260        if let StopWaiterRequest::Wait { responder } = self { Some((responder)) } else { None }
7261    }
7262
7263    /// Name of the method defined in FIDL
7264    pub fn method_name(&self) -> &'static str {
7265        match *self {
7266            StopWaiterRequest::Wait { .. } => "wait",
7267            StopWaiterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7268                "unknown one-way method"
7269            }
7270            StopWaiterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7271                "unknown two-way method"
7272            }
7273        }
7274    }
7275}
7276
7277#[derive(Debug, Clone)]
7278pub struct StopWaiterControlHandle {
7279    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7280}
7281
7282impl fidl::endpoints::ControlHandle for StopWaiterControlHandle {
7283    fn shutdown(&self) {
7284        self.inner.shutdown()
7285    }
7286    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7287        self.inner.shutdown_with_epitaph(status)
7288    }
7289
7290    fn is_closed(&self) -> bool {
7291        self.inner.channel().is_closed()
7292    }
7293    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7294        self.inner.channel().on_closed()
7295    }
7296
7297    #[cfg(target_os = "fuchsia")]
7298    fn signal_peer(
7299        &self,
7300        clear_mask: zx::Signals,
7301        set_mask: zx::Signals,
7302    ) -> Result<(), zx_status::Status> {
7303        use fidl::Peered;
7304        self.inner.channel().signal_peer(clear_mask, set_mask)
7305    }
7306}
7307
7308impl StopWaiterControlHandle {}
7309
7310#[must_use = "FIDL methods require a response to be sent"]
7311#[derive(Debug)]
7312pub struct StopWaiterWaitResponder {
7313    control_handle: std::mem::ManuallyDrop<StopWaiterControlHandle>,
7314    tx_id: u32,
7315}
7316
7317/// Set the the channel to be shutdown (see [`StopWaiterControlHandle::shutdown`])
7318/// if the responder is dropped without sending a response, so that the client
7319/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7320impl std::ops::Drop for StopWaiterWaitResponder {
7321    fn drop(&mut self) {
7322        self.control_handle.shutdown();
7323        // Safety: drops once, never accessed again
7324        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7325    }
7326}
7327
7328impl fidl::endpoints::Responder for StopWaiterWaitResponder {
7329    type ControlHandle = StopWaiterControlHandle;
7330
7331    fn control_handle(&self) -> &StopWaiterControlHandle {
7332        &self.control_handle
7333    }
7334
7335    fn drop_without_shutdown(mut self) {
7336        // Safety: drops once, never accessed again due to mem::forget
7337        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7338        // Prevent Drop from running (which would shut down the channel)
7339        std::mem::forget(self);
7340    }
7341}
7342
7343impl StopWaiterWaitResponder {
7344    /// Sends a response to the FIDL transaction.
7345    ///
7346    /// Sets the channel to shutdown if an error occurs.
7347    pub fn send(self) -> Result<(), fidl::Error> {
7348        let _result = self.send_raw();
7349        if _result.is_err() {
7350            self.control_handle.shutdown();
7351        }
7352        self.drop_without_shutdown();
7353        _result
7354    }
7355
7356    /// Similar to "send" but does not shutdown the channel if an error occurs.
7357    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
7358        let _result = self.send_raw();
7359        self.drop_without_shutdown();
7360        _result
7361    }
7362
7363    fn send_raw(&self) -> Result<(), fidl::Error> {
7364        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
7365            fidl::encoding::Flexible::new(()),
7366            self.tx_id,
7367            0x12d62812fe8aa263,
7368            fidl::encoding::DynamicFlags::FLEXIBLE,
7369        )
7370    }
7371}
7372
7373#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7374pub struct StopWatcherMarker;
7375
7376impl fidl::endpoints::ProtocolMarker for StopWatcherMarker {
7377    type Proxy = StopWatcherProxy;
7378    type RequestStream = StopWatcherRequestStream;
7379    #[cfg(target_os = "fuchsia")]
7380    type SynchronousProxy = StopWatcherSynchronousProxy;
7381
7382    const DEBUG_NAME: &'static str = "fuchsia.archivist.test.StopWatcher";
7383}
7384impl fidl::endpoints::DiscoverableProtocolMarker for StopWatcherMarker {}
7385
7386pub trait StopWatcherProxyInterface: Send + Sync {
7387    type WatchComponentResponseFut: std::future::Future<
7388            Output = Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error>,
7389        > + Send;
7390    fn r#watch_component(
7391        &self,
7392        moniker: &str,
7393        expected_exit: ExitStatus,
7394    ) -> Self::WatchComponentResponseFut;
7395}
7396#[derive(Debug)]
7397#[cfg(target_os = "fuchsia")]
7398pub struct StopWatcherSynchronousProxy {
7399    client: fidl::client::sync::Client,
7400}
7401
7402#[cfg(target_os = "fuchsia")]
7403impl fidl::endpoints::SynchronousProxy for StopWatcherSynchronousProxy {
7404    type Proxy = StopWatcherProxy;
7405    type Protocol = StopWatcherMarker;
7406
7407    fn from_channel(inner: fidl::Channel) -> Self {
7408        Self::new(inner)
7409    }
7410
7411    fn into_channel(self) -> fidl::Channel {
7412        self.client.into_channel()
7413    }
7414
7415    fn as_channel(&self) -> &fidl::Channel {
7416        self.client.as_channel()
7417    }
7418}
7419
7420#[cfg(target_os = "fuchsia")]
7421impl StopWatcherSynchronousProxy {
7422    pub fn new(channel: fidl::Channel) -> Self {
7423        let protocol_name = <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7424        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7425    }
7426
7427    pub fn into_channel(self) -> fidl::Channel {
7428        self.client.into_channel()
7429    }
7430
7431    /// Waits until an event arrives and returns it. It is safe for other
7432    /// threads to make concurrent requests while waiting for an event.
7433    pub fn wait_for_event(
7434        &self,
7435        deadline: zx::MonotonicInstant,
7436    ) -> Result<StopWatcherEvent, fidl::Error> {
7437        StopWatcherEvent::decode(self.client.wait_for_event(deadline)?)
7438    }
7439
7440    /// Subscribes to an underlying event stream notifying the server when a
7441    /// component identified by the given moniker stops with the given status.
7442    ///
7443    /// Returns the watcher protocol that can be used to actually get the
7444    /// notification. This is done so that we ensure that the subscription is
7445    /// established before the component could even crash and prevent the client
7446    /// from missing any event.
7447    pub fn r#watch_component(
7448        &self,
7449        mut moniker: &str,
7450        mut expected_exit: ExitStatus,
7451        ___deadline: zx::MonotonicInstant,
7452    ) -> Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error> {
7453        let _response = self.client.send_query::<
7454            StopWatcherWatchComponentRequest,
7455            fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>,
7456        >(
7457            (moniker, expected_exit,),
7458            0x844f88ddd954e8e,
7459            fidl::encoding::DynamicFlags::FLEXIBLE,
7460            ___deadline,
7461        )?
7462        .into_result::<StopWatcherMarker>("watch_component")?;
7463        Ok(_response.client)
7464    }
7465}
7466
7467#[cfg(target_os = "fuchsia")]
7468impl From<StopWatcherSynchronousProxy> for zx::Handle {
7469    fn from(value: StopWatcherSynchronousProxy) -> Self {
7470        value.into_channel().into()
7471    }
7472}
7473
7474#[cfg(target_os = "fuchsia")]
7475impl From<fidl::Channel> for StopWatcherSynchronousProxy {
7476    fn from(value: fidl::Channel) -> Self {
7477        Self::new(value)
7478    }
7479}
7480
7481#[cfg(target_os = "fuchsia")]
7482impl fidl::endpoints::FromClient for StopWatcherSynchronousProxy {
7483    type Protocol = StopWatcherMarker;
7484
7485    fn from_client(value: fidl::endpoints::ClientEnd<StopWatcherMarker>) -> Self {
7486        Self::new(value.into_channel())
7487    }
7488}
7489
7490#[derive(Debug, Clone)]
7491pub struct StopWatcherProxy {
7492    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7493}
7494
7495impl fidl::endpoints::Proxy for StopWatcherProxy {
7496    type Protocol = StopWatcherMarker;
7497
7498    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7499        Self::new(inner)
7500    }
7501
7502    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7503        self.client.into_channel().map_err(|client| Self { client })
7504    }
7505
7506    fn as_channel(&self) -> &::fidl::AsyncChannel {
7507        self.client.as_channel()
7508    }
7509}
7510
7511impl StopWatcherProxy {
7512    /// Create a new Proxy for fuchsia.archivist.test/StopWatcher.
7513    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7514        let protocol_name = <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7515        Self { client: fidl::client::Client::new(channel, protocol_name) }
7516    }
7517
7518    /// Get a Stream of events from the remote end of the protocol.
7519    ///
7520    /// # Panics
7521    ///
7522    /// Panics if the event stream was already taken.
7523    pub fn take_event_stream(&self) -> StopWatcherEventStream {
7524        StopWatcherEventStream { event_receiver: self.client.take_event_receiver() }
7525    }
7526
7527    /// Subscribes to an underlying event stream notifying the server when a
7528    /// component identified by the given moniker stops with the given status.
7529    ///
7530    /// Returns the watcher protocol that can be used to actually get the
7531    /// notification. This is done so that we ensure that the subscription is
7532    /// established before the component could even crash and prevent the client
7533    /// from missing any event.
7534    pub fn r#watch_component(
7535        &self,
7536        mut moniker: &str,
7537        mut expected_exit: ExitStatus,
7538    ) -> fidl::client::QueryResponseFut<
7539        fidl::endpoints::ClientEnd<StopWaiterMarker>,
7540        fidl::encoding::DefaultFuchsiaResourceDialect,
7541    > {
7542        StopWatcherProxyInterface::r#watch_component(self, moniker, expected_exit)
7543    }
7544}
7545
7546impl StopWatcherProxyInterface for StopWatcherProxy {
7547    type WatchComponentResponseFut = fidl::client::QueryResponseFut<
7548        fidl::endpoints::ClientEnd<StopWaiterMarker>,
7549        fidl::encoding::DefaultFuchsiaResourceDialect,
7550    >;
7551    fn r#watch_component(
7552        &self,
7553        mut moniker: &str,
7554        mut expected_exit: ExitStatus,
7555    ) -> Self::WatchComponentResponseFut {
7556        fn _decode(
7557            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7558        ) -> Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error> {
7559            let _response = fidl::client::decode_transaction_body::<
7560                fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>,
7561                fidl::encoding::DefaultFuchsiaResourceDialect,
7562                0x844f88ddd954e8e,
7563            >(_buf?)?
7564            .into_result::<StopWatcherMarker>("watch_component")?;
7565            Ok(_response.client)
7566        }
7567        self.client.send_query_and_decode::<
7568            StopWatcherWatchComponentRequest,
7569            fidl::endpoints::ClientEnd<StopWaiterMarker>,
7570        >(
7571            (moniker, expected_exit,),
7572            0x844f88ddd954e8e,
7573            fidl::encoding::DynamicFlags::FLEXIBLE,
7574            _decode,
7575        )
7576    }
7577}
7578
7579pub struct StopWatcherEventStream {
7580    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7581}
7582
7583impl std::marker::Unpin for StopWatcherEventStream {}
7584
7585impl futures::stream::FusedStream for StopWatcherEventStream {
7586    fn is_terminated(&self) -> bool {
7587        self.event_receiver.is_terminated()
7588    }
7589}
7590
7591impl futures::Stream for StopWatcherEventStream {
7592    type Item = Result<StopWatcherEvent, fidl::Error>;
7593
7594    fn poll_next(
7595        mut self: std::pin::Pin<&mut Self>,
7596        cx: &mut std::task::Context<'_>,
7597    ) -> std::task::Poll<Option<Self::Item>> {
7598        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7599            &mut self.event_receiver,
7600            cx
7601        )?) {
7602            Some(buf) => std::task::Poll::Ready(Some(StopWatcherEvent::decode(buf))),
7603            None => std::task::Poll::Ready(None),
7604        }
7605    }
7606}
7607
7608#[derive(Debug)]
7609pub enum StopWatcherEvent {
7610    #[non_exhaustive]
7611    _UnknownEvent {
7612        /// Ordinal of the event that was sent.
7613        ordinal: u64,
7614    },
7615}
7616
7617impl StopWatcherEvent {
7618    /// Decodes a message buffer as a [`StopWatcherEvent`].
7619    fn decode(
7620        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7621    ) -> Result<StopWatcherEvent, fidl::Error> {
7622        let (bytes, _handles) = buf.split_mut();
7623        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7624        debug_assert_eq!(tx_header.tx_id, 0);
7625        match tx_header.ordinal {
7626            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7627                Ok(StopWatcherEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7628            }
7629            _ => Err(fidl::Error::UnknownOrdinal {
7630                ordinal: tx_header.ordinal,
7631                protocol_name: <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7632            }),
7633        }
7634    }
7635}
7636
7637/// A Stream of incoming requests for fuchsia.archivist.test/StopWatcher.
7638pub struct StopWatcherRequestStream {
7639    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7640    is_terminated: bool,
7641}
7642
7643impl std::marker::Unpin for StopWatcherRequestStream {}
7644
7645impl futures::stream::FusedStream for StopWatcherRequestStream {
7646    fn is_terminated(&self) -> bool {
7647        self.is_terminated
7648    }
7649}
7650
7651impl fidl::endpoints::RequestStream for StopWatcherRequestStream {
7652    type Protocol = StopWatcherMarker;
7653    type ControlHandle = StopWatcherControlHandle;
7654
7655    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7656        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7657    }
7658
7659    fn control_handle(&self) -> Self::ControlHandle {
7660        StopWatcherControlHandle { inner: self.inner.clone() }
7661    }
7662
7663    fn into_inner(
7664        self,
7665    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7666    {
7667        (self.inner, self.is_terminated)
7668    }
7669
7670    fn from_inner(
7671        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7672        is_terminated: bool,
7673    ) -> Self {
7674        Self { inner, is_terminated }
7675    }
7676}
7677
7678impl futures::Stream for StopWatcherRequestStream {
7679    type Item = Result<StopWatcherRequest, fidl::Error>;
7680
7681    fn poll_next(
7682        mut self: std::pin::Pin<&mut Self>,
7683        cx: &mut std::task::Context<'_>,
7684    ) -> std::task::Poll<Option<Self::Item>> {
7685        let this = &mut *self;
7686        if this.inner.check_shutdown(cx) {
7687            this.is_terminated = true;
7688            return std::task::Poll::Ready(None);
7689        }
7690        if this.is_terminated {
7691            panic!("polled StopWatcherRequestStream after completion");
7692        }
7693        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7694            |bytes, handles| {
7695                match this.inner.channel().read_etc(cx, bytes, handles) {
7696                    std::task::Poll::Ready(Ok(())) => {}
7697                    std::task::Poll::Pending => return std::task::Poll::Pending,
7698                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7699                        this.is_terminated = true;
7700                        return std::task::Poll::Ready(None);
7701                    }
7702                    std::task::Poll::Ready(Err(e)) => {
7703                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7704                            e.into(),
7705                        ))));
7706                    }
7707                }
7708
7709                // A message has been received from the channel
7710                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7711
7712                std::task::Poll::Ready(Some(match header.ordinal {
7713                    0x844f88ddd954e8e => {
7714                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7715                        let mut req = fidl::new_empty!(
7716                            StopWatcherWatchComponentRequest,
7717                            fidl::encoding::DefaultFuchsiaResourceDialect
7718                        );
7719                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StopWatcherWatchComponentRequest>(&header, _body_bytes, handles, &mut req)?;
7720                        let control_handle = StopWatcherControlHandle { inner: this.inner.clone() };
7721                        Ok(StopWatcherRequest::WatchComponent {
7722                            moniker: req.moniker,
7723                            expected_exit: req.expected_exit,
7724
7725                            responder: StopWatcherWatchComponentResponder {
7726                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7727                                tx_id: header.tx_id,
7728                            },
7729                        })
7730                    }
7731                    _ if header.tx_id == 0
7732                        && header
7733                            .dynamic_flags()
7734                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7735                    {
7736                        Ok(StopWatcherRequest::_UnknownMethod {
7737                            ordinal: header.ordinal,
7738                            control_handle: StopWatcherControlHandle { inner: this.inner.clone() },
7739                            method_type: fidl::MethodType::OneWay,
7740                        })
7741                    }
7742                    _ if header
7743                        .dynamic_flags()
7744                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7745                    {
7746                        this.inner.send_framework_err(
7747                            fidl::encoding::FrameworkErr::UnknownMethod,
7748                            header.tx_id,
7749                            header.ordinal,
7750                            header.dynamic_flags(),
7751                            (bytes, handles),
7752                        )?;
7753                        Ok(StopWatcherRequest::_UnknownMethod {
7754                            ordinal: header.ordinal,
7755                            control_handle: StopWatcherControlHandle { inner: this.inner.clone() },
7756                            method_type: fidl::MethodType::TwoWay,
7757                        })
7758                    }
7759                    _ => Err(fidl::Error::UnknownOrdinal {
7760                        ordinal: header.ordinal,
7761                        protocol_name:
7762                            <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7763                    }),
7764                }))
7765            },
7766        )
7767    }
7768}
7769
7770/// Provides functionality to await on specific stop events on components.
7771#[derive(Debug)]
7772pub enum StopWatcherRequest {
7773    /// Subscribes to an underlying event stream notifying the server when a
7774    /// component identified by the given moniker stops with the given status.
7775    ///
7776    /// Returns the watcher protocol that can be used to actually get the
7777    /// notification. This is done so that we ensure that the subscription is
7778    /// established before the component could even crash and prevent the client
7779    /// from missing any event.
7780    WatchComponent {
7781        moniker: String,
7782        expected_exit: ExitStatus,
7783        responder: StopWatcherWatchComponentResponder,
7784    },
7785    /// An interaction was received which does not match any known method.
7786    #[non_exhaustive]
7787    _UnknownMethod {
7788        /// Ordinal of the method that was called.
7789        ordinal: u64,
7790        control_handle: StopWatcherControlHandle,
7791        method_type: fidl::MethodType,
7792    },
7793}
7794
7795impl StopWatcherRequest {
7796    #[allow(irrefutable_let_patterns)]
7797    pub fn into_watch_component(
7798        self,
7799    ) -> Option<(String, ExitStatus, StopWatcherWatchComponentResponder)> {
7800        if let StopWatcherRequest::WatchComponent { moniker, expected_exit, responder } = self {
7801            Some((moniker, expected_exit, responder))
7802        } else {
7803            None
7804        }
7805    }
7806
7807    /// Name of the method defined in FIDL
7808    pub fn method_name(&self) -> &'static str {
7809        match *self {
7810            StopWatcherRequest::WatchComponent { .. } => "watch_component",
7811            StopWatcherRequest::_UnknownMethod {
7812                method_type: fidl::MethodType::OneWay, ..
7813            } => "unknown one-way method",
7814            StopWatcherRequest::_UnknownMethod {
7815                method_type: fidl::MethodType::TwoWay, ..
7816            } => "unknown two-way method",
7817        }
7818    }
7819}
7820
7821#[derive(Debug, Clone)]
7822pub struct StopWatcherControlHandle {
7823    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7824}
7825
7826impl fidl::endpoints::ControlHandle for StopWatcherControlHandle {
7827    fn shutdown(&self) {
7828        self.inner.shutdown()
7829    }
7830    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7831        self.inner.shutdown_with_epitaph(status)
7832    }
7833
7834    fn is_closed(&self) -> bool {
7835        self.inner.channel().is_closed()
7836    }
7837    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7838        self.inner.channel().on_closed()
7839    }
7840
7841    #[cfg(target_os = "fuchsia")]
7842    fn signal_peer(
7843        &self,
7844        clear_mask: zx::Signals,
7845        set_mask: zx::Signals,
7846    ) -> Result<(), zx_status::Status> {
7847        use fidl::Peered;
7848        self.inner.channel().signal_peer(clear_mask, set_mask)
7849    }
7850}
7851
7852impl StopWatcherControlHandle {}
7853
7854#[must_use = "FIDL methods require a response to be sent"]
7855#[derive(Debug)]
7856pub struct StopWatcherWatchComponentResponder {
7857    control_handle: std::mem::ManuallyDrop<StopWatcherControlHandle>,
7858    tx_id: u32,
7859}
7860
7861/// Set the the channel to be shutdown (see [`StopWatcherControlHandle::shutdown`])
7862/// if the responder is dropped without sending a response, so that the client
7863/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7864impl std::ops::Drop for StopWatcherWatchComponentResponder {
7865    fn drop(&mut self) {
7866        self.control_handle.shutdown();
7867        // Safety: drops once, never accessed again
7868        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7869    }
7870}
7871
7872impl fidl::endpoints::Responder for StopWatcherWatchComponentResponder {
7873    type ControlHandle = StopWatcherControlHandle;
7874
7875    fn control_handle(&self) -> &StopWatcherControlHandle {
7876        &self.control_handle
7877    }
7878
7879    fn drop_without_shutdown(mut self) {
7880        // Safety: drops once, never accessed again due to mem::forget
7881        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7882        // Prevent Drop from running (which would shut down the channel)
7883        std::mem::forget(self);
7884    }
7885}
7886
7887impl StopWatcherWatchComponentResponder {
7888    /// Sends a response to the FIDL transaction.
7889    ///
7890    /// Sets the channel to shutdown if an error occurs.
7891    pub fn send(
7892        self,
7893        mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
7894    ) -> Result<(), fidl::Error> {
7895        let _result = self.send_raw(client);
7896        if _result.is_err() {
7897            self.control_handle.shutdown();
7898        }
7899        self.drop_without_shutdown();
7900        _result
7901    }
7902
7903    /// Similar to "send" but does not shutdown the channel if an error occurs.
7904    pub fn send_no_shutdown_on_err(
7905        self,
7906        mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
7907    ) -> Result<(), fidl::Error> {
7908        let _result = self.send_raw(client);
7909        self.drop_without_shutdown();
7910        _result
7911    }
7912
7913    fn send_raw(
7914        &self,
7915        mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
7916    ) -> Result<(), fidl::Error> {
7917        self.control_handle
7918            .inner
7919            .send::<fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>>(
7920                fidl::encoding::Flexible::new((client,)),
7921                self.tx_id,
7922                0x844f88ddd954e8e,
7923                fidl::encoding::DynamicFlags::FLEXIBLE,
7924            )
7925    }
7926}
7927
7928mod internal {
7929    use super::*;
7930
7931    impl fidl::encoding::ResourceTypeMarker for InspectPuppetCreateInspectorFromEscrowResponse {
7932        type Borrowed<'a> = &'a mut Self;
7933        fn take_or_borrow<'a>(
7934            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7935        ) -> Self::Borrowed<'a> {
7936            value
7937        }
7938    }
7939
7940    unsafe impl fidl::encoding::TypeMarker for InspectPuppetCreateInspectorFromEscrowResponse {
7941        type Owned = Self;
7942
7943        #[inline(always)]
7944        fn inline_align(_context: fidl::encoding::Context) -> usize {
7945            4
7946        }
7947
7948        #[inline(always)]
7949        fn inline_size(_context: fidl::encoding::Context) -> usize {
7950            8
7951        }
7952    }
7953
7954    unsafe impl
7955        fidl::encoding::Encode<
7956            InspectPuppetCreateInspectorFromEscrowResponse,
7957            fidl::encoding::DefaultFuchsiaResourceDialect,
7958        > for &mut InspectPuppetCreateInspectorFromEscrowResponse
7959    {
7960        #[inline]
7961        unsafe fn encode(
7962            self,
7963            encoder: &mut fidl::encoding::Encoder<
7964                '_,
7965                fidl::encoding::DefaultFuchsiaResourceDialect,
7966            >,
7967            offset: usize,
7968            _depth: fidl::encoding::Depth,
7969        ) -> fidl::Result<()> {
7970            encoder.debug_check_bounds::<InspectPuppetCreateInspectorFromEscrowResponse>(offset);
7971            // Delegate to tuple encoding.
7972            fidl::encoding::Encode::<InspectPuppetCreateInspectorFromEscrowResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7973                (
7974                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
7975                    <fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49383> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
7976                ),
7977                encoder, offset, _depth
7978            )
7979        }
7980    }
7981    unsafe impl<
7982        T0: fidl::encoding::Encode<
7983                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
7984                fidl::encoding::DefaultFuchsiaResourceDialect,
7985            >,
7986        T1: fidl::encoding::Encode<
7987                fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49383>,
7988                fidl::encoding::DefaultFuchsiaResourceDialect,
7989            >,
7990    >
7991        fidl::encoding::Encode<
7992            InspectPuppetCreateInspectorFromEscrowResponse,
7993            fidl::encoding::DefaultFuchsiaResourceDialect,
7994        > for (T0, T1)
7995    {
7996        #[inline]
7997        unsafe fn encode(
7998            self,
7999            encoder: &mut fidl::encoding::Encoder<
8000                '_,
8001                fidl::encoding::DefaultFuchsiaResourceDialect,
8002            >,
8003            offset: usize,
8004            depth: fidl::encoding::Depth,
8005        ) -> fidl::Result<()> {
8006            encoder.debug_check_bounds::<InspectPuppetCreateInspectorFromEscrowResponse>(offset);
8007            // Zero out padding regions. There's no need to apply masks
8008            // because the unmasked parts will be overwritten by fields.
8009            // Write the fields.
8010            self.0.encode(encoder, offset + 0, depth)?;
8011            self.1.encode(encoder, offset + 4, depth)?;
8012            Ok(())
8013        }
8014    }
8015
8016    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8017        for InspectPuppetCreateInspectorFromEscrowResponse
8018    {
8019        #[inline(always)]
8020        fn new_empty() -> Self {
8021            Self {
8022                writer: fidl::new_empty!(
8023                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
8024                    fidl::encoding::DefaultFuchsiaResourceDialect
8025                ),
8026                data: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49383>, fidl::encoding::DefaultFuchsiaResourceDialect),
8027            }
8028        }
8029
8030        #[inline]
8031        unsafe fn decode(
8032            &mut self,
8033            decoder: &mut fidl::encoding::Decoder<
8034                '_,
8035                fidl::encoding::DefaultFuchsiaResourceDialect,
8036            >,
8037            offset: usize,
8038            _depth: fidl::encoding::Depth,
8039        ) -> fidl::Result<()> {
8040            decoder.debug_check_bounds::<Self>(offset);
8041            // Verify that padding bytes are zero.
8042            fidl::decode!(
8043                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
8044                fidl::encoding::DefaultFuchsiaResourceDialect,
8045                &mut self.writer,
8046                decoder,
8047                offset + 0,
8048                _depth
8049            )?;
8050            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 49383>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data, decoder, offset + 4, _depth)?;
8051            Ok(())
8052        }
8053    }
8054
8055    impl fidl::encoding::ResourceTypeMarker for InspectPuppetCreateInspectorResponse {
8056        type Borrowed<'a> = &'a mut Self;
8057        fn take_or_borrow<'a>(
8058            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8059        ) -> Self::Borrowed<'a> {
8060            value
8061        }
8062    }
8063
8064    unsafe impl fidl::encoding::TypeMarker for InspectPuppetCreateInspectorResponse {
8065        type Owned = Self;
8066
8067        #[inline(always)]
8068        fn inline_align(_context: fidl::encoding::Context) -> usize {
8069            4
8070        }
8071
8072        #[inline(always)]
8073        fn inline_size(_context: fidl::encoding::Context) -> usize {
8074            4
8075        }
8076    }
8077
8078    unsafe impl
8079        fidl::encoding::Encode<
8080            InspectPuppetCreateInspectorResponse,
8081            fidl::encoding::DefaultFuchsiaResourceDialect,
8082        > for &mut InspectPuppetCreateInspectorResponse
8083    {
8084        #[inline]
8085        unsafe fn encode(
8086            self,
8087            encoder: &mut fidl::encoding::Encoder<
8088                '_,
8089                fidl::encoding::DefaultFuchsiaResourceDialect,
8090            >,
8091            offset: usize,
8092            _depth: fidl::encoding::Depth,
8093        ) -> fidl::Result<()> {
8094            encoder.debug_check_bounds::<InspectPuppetCreateInspectorResponse>(offset);
8095            // Delegate to tuple encoding.
8096            fidl::encoding::Encode::<InspectPuppetCreateInspectorResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8097                (
8098                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
8099                ),
8100                encoder, offset, _depth
8101            )
8102        }
8103    }
8104    unsafe impl<
8105        T0: fidl::encoding::Encode<
8106                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
8107                fidl::encoding::DefaultFuchsiaResourceDialect,
8108            >,
8109    >
8110        fidl::encoding::Encode<
8111            InspectPuppetCreateInspectorResponse,
8112            fidl::encoding::DefaultFuchsiaResourceDialect,
8113        > for (T0,)
8114    {
8115        #[inline]
8116        unsafe fn encode(
8117            self,
8118            encoder: &mut fidl::encoding::Encoder<
8119                '_,
8120                fidl::encoding::DefaultFuchsiaResourceDialect,
8121            >,
8122            offset: usize,
8123            depth: fidl::encoding::Depth,
8124        ) -> fidl::Result<()> {
8125            encoder.debug_check_bounds::<InspectPuppetCreateInspectorResponse>(offset);
8126            // Zero out padding regions. There's no need to apply masks
8127            // because the unmasked parts will be overwritten by fields.
8128            // Write the fields.
8129            self.0.encode(encoder, offset + 0, depth)?;
8130            Ok(())
8131        }
8132    }
8133
8134    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8135        for InspectPuppetCreateInspectorResponse
8136    {
8137        #[inline(always)]
8138        fn new_empty() -> Self {
8139            Self {
8140                writer: fidl::new_empty!(
8141                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
8142                    fidl::encoding::DefaultFuchsiaResourceDialect
8143                ),
8144            }
8145        }
8146
8147        #[inline]
8148        unsafe fn decode(
8149            &mut self,
8150            decoder: &mut fidl::encoding::Decoder<
8151                '_,
8152                fidl::encoding::DefaultFuchsiaResourceDialect,
8153            >,
8154            offset: usize,
8155            _depth: fidl::encoding::Depth,
8156        ) -> fidl::Result<()> {
8157            decoder.debug_check_bounds::<Self>(offset);
8158            // Verify that padding bytes are zero.
8159            fidl::decode!(
8160                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
8161                fidl::encoding::DefaultFuchsiaResourceDialect,
8162                &mut self.writer,
8163                decoder,
8164                offset + 0,
8165                _depth
8166            )?;
8167            Ok(())
8168        }
8169    }
8170
8171    impl fidl::encoding::ResourceTypeMarker for InspectWriterRecordLazyValuesResponse {
8172        type Borrowed<'a> = &'a mut Self;
8173        fn take_or_borrow<'a>(
8174            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8175        ) -> Self::Borrowed<'a> {
8176            value
8177        }
8178    }
8179
8180    unsafe impl fidl::encoding::TypeMarker for InspectWriterRecordLazyValuesResponse {
8181        type Owned = Self;
8182
8183        #[inline(always)]
8184        fn inline_align(_context: fidl::encoding::Context) -> usize {
8185            4
8186        }
8187
8188        #[inline(always)]
8189        fn inline_size(_context: fidl::encoding::Context) -> usize {
8190            4
8191        }
8192    }
8193
8194    unsafe impl
8195        fidl::encoding::Encode<
8196            InspectWriterRecordLazyValuesResponse,
8197            fidl::encoding::DefaultFuchsiaResourceDialect,
8198        > for &mut InspectWriterRecordLazyValuesResponse
8199    {
8200        #[inline]
8201        unsafe fn encode(
8202            self,
8203            encoder: &mut fidl::encoding::Encoder<
8204                '_,
8205                fidl::encoding::DefaultFuchsiaResourceDialect,
8206            >,
8207            offset: usize,
8208            _depth: fidl::encoding::Depth,
8209        ) -> fidl::Result<()> {
8210            encoder.debug_check_bounds::<InspectWriterRecordLazyValuesResponse>(offset);
8211            // Delegate to tuple encoding.
8212            fidl::encoding::Encode::<InspectWriterRecordLazyValuesResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8213                (
8214                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
8215                ),
8216                encoder, offset, _depth
8217            )
8218        }
8219    }
8220    unsafe impl<
8221        T0: fidl::encoding::Encode<
8222                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
8223                fidl::encoding::DefaultFuchsiaResourceDialect,
8224            >,
8225    >
8226        fidl::encoding::Encode<
8227            InspectWriterRecordLazyValuesResponse,
8228            fidl::encoding::DefaultFuchsiaResourceDialect,
8229        > for (T0,)
8230    {
8231        #[inline]
8232        unsafe fn encode(
8233            self,
8234            encoder: &mut fidl::encoding::Encoder<
8235                '_,
8236                fidl::encoding::DefaultFuchsiaResourceDialect,
8237            >,
8238            offset: usize,
8239            depth: fidl::encoding::Depth,
8240        ) -> fidl::Result<()> {
8241            encoder.debug_check_bounds::<InspectWriterRecordLazyValuesResponse>(offset);
8242            // Zero out padding regions. There's no need to apply masks
8243            // because the unmasked parts will be overwritten by fields.
8244            // Write the fields.
8245            self.0.encode(encoder, offset + 0, depth)?;
8246            Ok(())
8247        }
8248    }
8249
8250    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8251        for InspectWriterRecordLazyValuesResponse
8252    {
8253        #[inline(always)]
8254        fn new_empty() -> Self {
8255            Self {
8256                client: fidl::new_empty!(
8257                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
8258                    fidl::encoding::DefaultFuchsiaResourceDialect
8259                ),
8260            }
8261        }
8262
8263        #[inline]
8264        unsafe fn decode(
8265            &mut self,
8266            decoder: &mut fidl::encoding::Decoder<
8267                '_,
8268                fidl::encoding::DefaultFuchsiaResourceDialect,
8269            >,
8270            offset: usize,
8271            _depth: fidl::encoding::Depth,
8272        ) -> fidl::Result<()> {
8273            decoder.debug_check_bounds::<Self>(offset);
8274            // Verify that padding bytes are zero.
8275            fidl::decode!(
8276                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
8277                fidl::encoding::DefaultFuchsiaResourceDialect,
8278                &mut self.client,
8279                decoder,
8280                offset + 0,
8281                _depth
8282            )?;
8283            Ok(())
8284        }
8285    }
8286
8287    impl fidl::encoding::ResourceTypeMarker for PuppetRecordLazyValuesResponse {
8288        type Borrowed<'a> = &'a mut Self;
8289        fn take_or_borrow<'a>(
8290            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8291        ) -> Self::Borrowed<'a> {
8292            value
8293        }
8294    }
8295
8296    unsafe impl fidl::encoding::TypeMarker for PuppetRecordLazyValuesResponse {
8297        type Owned = Self;
8298
8299        #[inline(always)]
8300        fn inline_align(_context: fidl::encoding::Context) -> usize {
8301            4
8302        }
8303
8304        #[inline(always)]
8305        fn inline_size(_context: fidl::encoding::Context) -> usize {
8306            4
8307        }
8308    }
8309
8310    unsafe impl
8311        fidl::encoding::Encode<
8312            PuppetRecordLazyValuesResponse,
8313            fidl::encoding::DefaultFuchsiaResourceDialect,
8314        > for &mut PuppetRecordLazyValuesResponse
8315    {
8316        #[inline]
8317        unsafe fn encode(
8318            self,
8319            encoder: &mut fidl::encoding::Encoder<
8320                '_,
8321                fidl::encoding::DefaultFuchsiaResourceDialect,
8322            >,
8323            offset: usize,
8324            _depth: fidl::encoding::Depth,
8325        ) -> fidl::Result<()> {
8326            encoder.debug_check_bounds::<PuppetRecordLazyValuesResponse>(offset);
8327            // Delegate to tuple encoding.
8328            fidl::encoding::Encode::<PuppetRecordLazyValuesResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8329                (
8330                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
8331                ),
8332                encoder, offset, _depth
8333            )
8334        }
8335    }
8336    unsafe impl<
8337        T0: fidl::encoding::Encode<
8338                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
8339                fidl::encoding::DefaultFuchsiaResourceDialect,
8340            >,
8341    >
8342        fidl::encoding::Encode<
8343            PuppetRecordLazyValuesResponse,
8344            fidl::encoding::DefaultFuchsiaResourceDialect,
8345        > for (T0,)
8346    {
8347        #[inline]
8348        unsafe fn encode(
8349            self,
8350            encoder: &mut fidl::encoding::Encoder<
8351                '_,
8352                fidl::encoding::DefaultFuchsiaResourceDialect,
8353            >,
8354            offset: usize,
8355            depth: fidl::encoding::Depth,
8356        ) -> fidl::Result<()> {
8357            encoder.debug_check_bounds::<PuppetRecordLazyValuesResponse>(offset);
8358            // Zero out padding regions. There's no need to apply masks
8359            // because the unmasked parts will be overwritten by fields.
8360            // Write the fields.
8361            self.0.encode(encoder, offset + 0, depth)?;
8362            Ok(())
8363        }
8364    }
8365
8366    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8367        for PuppetRecordLazyValuesResponse
8368    {
8369        #[inline(always)]
8370        fn new_empty() -> Self {
8371            Self {
8372                client: fidl::new_empty!(
8373                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
8374                    fidl::encoding::DefaultFuchsiaResourceDialect
8375                ),
8376            }
8377        }
8378
8379        #[inline]
8380        unsafe fn decode(
8381            &mut self,
8382            decoder: &mut fidl::encoding::Decoder<
8383                '_,
8384                fidl::encoding::DefaultFuchsiaResourceDialect,
8385            >,
8386            offset: usize,
8387            _depth: fidl::encoding::Depth,
8388        ) -> fidl::Result<()> {
8389            decoder.debug_check_bounds::<Self>(offset);
8390            // Verify that padding bytes are zero.
8391            fidl::decode!(
8392                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
8393                fidl::encoding::DefaultFuchsiaResourceDialect,
8394                &mut self.client,
8395                decoder,
8396                offset + 0,
8397                _depth
8398            )?;
8399            Ok(())
8400        }
8401    }
8402
8403    impl fidl::encoding::ResourceTypeMarker for RealmFactoryCreateRealmRequest {
8404        type Borrowed<'a> = &'a mut Self;
8405        fn take_or_borrow<'a>(
8406            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8407        ) -> Self::Borrowed<'a> {
8408            value
8409        }
8410    }
8411
8412    unsafe impl fidl::encoding::TypeMarker for RealmFactoryCreateRealmRequest {
8413        type Owned = Self;
8414
8415        #[inline(always)]
8416        fn inline_align(_context: fidl::encoding::Context) -> usize {
8417            8
8418        }
8419
8420        #[inline(always)]
8421        fn inline_size(_context: fidl::encoding::Context) -> usize {
8422            24
8423        }
8424    }
8425
8426    unsafe impl
8427        fidl::encoding::Encode<
8428            RealmFactoryCreateRealmRequest,
8429            fidl::encoding::DefaultFuchsiaResourceDialect,
8430        > for &mut RealmFactoryCreateRealmRequest
8431    {
8432        #[inline]
8433        unsafe fn encode(
8434            self,
8435            encoder: &mut fidl::encoding::Encoder<
8436                '_,
8437                fidl::encoding::DefaultFuchsiaResourceDialect,
8438            >,
8439            offset: usize,
8440            _depth: fidl::encoding::Depth,
8441        ) -> fidl::Result<()> {
8442            encoder.debug_check_bounds::<RealmFactoryCreateRealmRequest>(offset);
8443            // Delegate to tuple encoding.
8444            fidl::encoding::Encode::<
8445                RealmFactoryCreateRealmRequest,
8446                fidl::encoding::DefaultFuchsiaResourceDialect,
8447            >::encode(
8448                (
8449                    <RealmOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
8450                    <fidl::encoding::Endpoint<
8451                        fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
8452                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8453                        &mut self.realm_server,
8454                    ),
8455                ),
8456                encoder,
8457                offset,
8458                _depth,
8459            )
8460        }
8461    }
8462    unsafe impl<
8463        T0: fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
8464        T1: fidl::encoding::Encode<
8465                fidl::encoding::Endpoint<
8466                    fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
8467                >,
8468                fidl::encoding::DefaultFuchsiaResourceDialect,
8469            >,
8470    >
8471        fidl::encoding::Encode<
8472            RealmFactoryCreateRealmRequest,
8473            fidl::encoding::DefaultFuchsiaResourceDialect,
8474        > for (T0, T1)
8475    {
8476        #[inline]
8477        unsafe fn encode(
8478            self,
8479            encoder: &mut fidl::encoding::Encoder<
8480                '_,
8481                fidl::encoding::DefaultFuchsiaResourceDialect,
8482            >,
8483            offset: usize,
8484            depth: fidl::encoding::Depth,
8485        ) -> fidl::Result<()> {
8486            encoder.debug_check_bounds::<RealmFactoryCreateRealmRequest>(offset);
8487            // Zero out padding regions. There's no need to apply masks
8488            // because the unmasked parts will be overwritten by fields.
8489            unsafe {
8490                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8491                (ptr as *mut u64).write_unaligned(0);
8492            }
8493            // Write the fields.
8494            self.0.encode(encoder, offset + 0, depth)?;
8495            self.1.encode(encoder, offset + 16, depth)?;
8496            Ok(())
8497        }
8498    }
8499
8500    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8501        for RealmFactoryCreateRealmRequest
8502    {
8503        #[inline(always)]
8504        fn new_empty() -> Self {
8505            Self {
8506                options: fidl::new_empty!(
8507                    RealmOptions,
8508                    fidl::encoding::DefaultFuchsiaResourceDialect
8509                ),
8510                realm_server: fidl::new_empty!(
8511                    fidl::encoding::Endpoint<
8512                        fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
8513                    >,
8514                    fidl::encoding::DefaultFuchsiaResourceDialect
8515                ),
8516            }
8517        }
8518
8519        #[inline]
8520        unsafe fn decode(
8521            &mut self,
8522            decoder: &mut fidl::encoding::Decoder<
8523                '_,
8524                fidl::encoding::DefaultFuchsiaResourceDialect,
8525            >,
8526            offset: usize,
8527            _depth: fidl::encoding::Depth,
8528        ) -> fidl::Result<()> {
8529            decoder.debug_check_bounds::<Self>(offset);
8530            // Verify that padding bytes are zero.
8531            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8532            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8533            let mask = 0xffffffff00000000u64;
8534            let maskedval = padval & mask;
8535            if maskedval != 0 {
8536                return Err(fidl::Error::NonZeroPadding {
8537                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8538                });
8539            }
8540            fidl::decode!(
8541                RealmOptions,
8542                fidl::encoding::DefaultFuchsiaResourceDialect,
8543                &mut self.options,
8544                decoder,
8545                offset + 0,
8546                _depth
8547            )?;
8548            fidl::decode!(
8549                fidl::encoding::Endpoint<
8550                    fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
8551                >,
8552                fidl::encoding::DefaultFuchsiaResourceDialect,
8553                &mut self.realm_server,
8554                decoder,
8555                offset + 16,
8556                _depth
8557            )?;
8558            Ok(())
8559        }
8560    }
8561
8562    impl fidl::encoding::ResourceTypeMarker for StopWatcherWatchComponentResponse {
8563        type Borrowed<'a> = &'a mut Self;
8564        fn take_or_borrow<'a>(
8565            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8566        ) -> Self::Borrowed<'a> {
8567            value
8568        }
8569    }
8570
8571    unsafe impl fidl::encoding::TypeMarker for StopWatcherWatchComponentResponse {
8572        type Owned = Self;
8573
8574        #[inline(always)]
8575        fn inline_align(_context: fidl::encoding::Context) -> usize {
8576            4
8577        }
8578
8579        #[inline(always)]
8580        fn inline_size(_context: fidl::encoding::Context) -> usize {
8581            4
8582        }
8583    }
8584
8585    unsafe impl
8586        fidl::encoding::Encode<
8587            StopWatcherWatchComponentResponse,
8588            fidl::encoding::DefaultFuchsiaResourceDialect,
8589        > for &mut StopWatcherWatchComponentResponse
8590    {
8591        #[inline]
8592        unsafe fn encode(
8593            self,
8594            encoder: &mut fidl::encoding::Encoder<
8595                '_,
8596                fidl::encoding::DefaultFuchsiaResourceDialect,
8597            >,
8598            offset: usize,
8599            _depth: fidl::encoding::Depth,
8600        ) -> fidl::Result<()> {
8601            encoder.debug_check_bounds::<StopWatcherWatchComponentResponse>(offset);
8602            // Delegate to tuple encoding.
8603            fidl::encoding::Encode::<StopWatcherWatchComponentResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8604                (
8605                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
8606                ),
8607                encoder, offset, _depth
8608            )
8609        }
8610    }
8611    unsafe impl<
8612        T0: fidl::encoding::Encode<
8613                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
8614                fidl::encoding::DefaultFuchsiaResourceDialect,
8615            >,
8616    >
8617        fidl::encoding::Encode<
8618            StopWatcherWatchComponentResponse,
8619            fidl::encoding::DefaultFuchsiaResourceDialect,
8620        > for (T0,)
8621    {
8622        #[inline]
8623        unsafe fn encode(
8624            self,
8625            encoder: &mut fidl::encoding::Encoder<
8626                '_,
8627                fidl::encoding::DefaultFuchsiaResourceDialect,
8628            >,
8629            offset: usize,
8630            depth: fidl::encoding::Depth,
8631        ) -> fidl::Result<()> {
8632            encoder.debug_check_bounds::<StopWatcherWatchComponentResponse>(offset);
8633            // Zero out padding regions. There's no need to apply masks
8634            // because the unmasked parts will be overwritten by fields.
8635            // Write the fields.
8636            self.0.encode(encoder, offset + 0, depth)?;
8637            Ok(())
8638        }
8639    }
8640
8641    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8642        for StopWatcherWatchComponentResponse
8643    {
8644        #[inline(always)]
8645        fn new_empty() -> Self {
8646            Self {
8647                client: fidl::new_empty!(
8648                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
8649                    fidl::encoding::DefaultFuchsiaResourceDialect
8650                ),
8651            }
8652        }
8653
8654        #[inline]
8655        unsafe fn decode(
8656            &mut self,
8657            decoder: &mut fidl::encoding::Decoder<
8658                '_,
8659                fidl::encoding::DefaultFuchsiaResourceDialect,
8660            >,
8661            offset: usize,
8662            _depth: fidl::encoding::Depth,
8663        ) -> fidl::Result<()> {
8664            decoder.debug_check_bounds::<Self>(offset);
8665            // Verify that padding bytes are zero.
8666            fidl::decode!(
8667                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
8668                fidl::encoding::DefaultFuchsiaResourceDialect,
8669                &mut self.client,
8670                decoder,
8671                offset + 0,
8672                _depth
8673            )?;
8674            Ok(())
8675        }
8676    }
8677
8678    impl InspectPuppetCreateInspectorFromEscrowRequest {
8679        #[inline(always)]
8680        fn max_ordinal_present(&self) -> u64 {
8681            if let Some(_) = self.token {
8682                return 1;
8683            }
8684            0
8685        }
8686    }
8687
8688    impl fidl::encoding::ResourceTypeMarker for InspectPuppetCreateInspectorFromEscrowRequest {
8689        type Borrowed<'a> = &'a mut Self;
8690        fn take_or_borrow<'a>(
8691            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8692        ) -> Self::Borrowed<'a> {
8693            value
8694        }
8695    }
8696
8697    unsafe impl fidl::encoding::TypeMarker for InspectPuppetCreateInspectorFromEscrowRequest {
8698        type Owned = Self;
8699
8700        #[inline(always)]
8701        fn inline_align(_context: fidl::encoding::Context) -> usize {
8702            8
8703        }
8704
8705        #[inline(always)]
8706        fn inline_size(_context: fidl::encoding::Context) -> usize {
8707            16
8708        }
8709    }
8710
8711    unsafe impl
8712        fidl::encoding::Encode<
8713            InspectPuppetCreateInspectorFromEscrowRequest,
8714            fidl::encoding::DefaultFuchsiaResourceDialect,
8715        > for &mut InspectPuppetCreateInspectorFromEscrowRequest
8716    {
8717        unsafe fn encode(
8718            self,
8719            encoder: &mut fidl::encoding::Encoder<
8720                '_,
8721                fidl::encoding::DefaultFuchsiaResourceDialect,
8722            >,
8723            offset: usize,
8724            mut depth: fidl::encoding::Depth,
8725        ) -> fidl::Result<()> {
8726            encoder.debug_check_bounds::<InspectPuppetCreateInspectorFromEscrowRequest>(offset);
8727            // Vector header
8728            let max_ordinal: u64 = self.max_ordinal_present();
8729            encoder.write_num(max_ordinal, offset);
8730            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8731            // Calling encoder.out_of_line_offset(0) is not allowed.
8732            if max_ordinal == 0 {
8733                return Ok(());
8734            }
8735            depth.increment()?;
8736            let envelope_size = 8;
8737            let bytes_len = max_ordinal as usize * envelope_size;
8738            #[allow(unused_variables)]
8739            let offset = encoder.out_of_line_offset(bytes_len);
8740            let mut _prev_end_offset: usize = 0;
8741            if 1 > max_ordinal {
8742                return Ok(());
8743            }
8744
8745            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8746            // are envelope_size bytes.
8747            let cur_offset: usize = (1 - 1) * envelope_size;
8748
8749            // Zero reserved fields.
8750            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8751
8752            // Safety:
8753            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8754            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8755            //   envelope_size bytes, there is always sufficient room.
8756            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_inspect::EscrowToken, fidl::encoding::DefaultFuchsiaResourceDialect>(
8757            self.token.as_mut().map(<fidl_fuchsia_inspect::EscrowToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
8758            encoder, offset + cur_offset, depth
8759        )?;
8760
8761            _prev_end_offset = cur_offset + envelope_size;
8762
8763            Ok(())
8764        }
8765    }
8766
8767    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8768        for InspectPuppetCreateInspectorFromEscrowRequest
8769    {
8770        #[inline(always)]
8771        fn new_empty() -> Self {
8772            Self::default()
8773        }
8774
8775        unsafe fn decode(
8776            &mut self,
8777            decoder: &mut fidl::encoding::Decoder<
8778                '_,
8779                fidl::encoding::DefaultFuchsiaResourceDialect,
8780            >,
8781            offset: usize,
8782            mut depth: fidl::encoding::Depth,
8783        ) -> fidl::Result<()> {
8784            decoder.debug_check_bounds::<Self>(offset);
8785            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8786                None => return Err(fidl::Error::NotNullable),
8787                Some(len) => len,
8788            };
8789            // Calling decoder.out_of_line_offset(0) is not allowed.
8790            if len == 0 {
8791                return Ok(());
8792            };
8793            depth.increment()?;
8794            let envelope_size = 8;
8795            let bytes_len = len * envelope_size;
8796            let offset = decoder.out_of_line_offset(bytes_len)?;
8797            // Decode the envelope for each type.
8798            let mut _next_ordinal_to_read = 0;
8799            let mut next_offset = offset;
8800            let end_offset = offset + bytes_len;
8801            _next_ordinal_to_read += 1;
8802            if next_offset >= end_offset {
8803                return Ok(());
8804            }
8805
8806            // Decode unknown envelopes for gaps in ordinals.
8807            while _next_ordinal_to_read < 1 {
8808                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8809                _next_ordinal_to_read += 1;
8810                next_offset += envelope_size;
8811            }
8812
8813            let next_out_of_line = decoder.next_out_of_line();
8814            let handles_before = decoder.remaining_handles();
8815            if let Some((inlined, num_bytes, num_handles)) =
8816                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8817            {
8818                let member_inline_size =
8819                    <fidl_fuchsia_inspect::EscrowToken as fidl::encoding::TypeMarker>::inline_size(
8820                        decoder.context,
8821                    );
8822                if inlined != (member_inline_size <= 4) {
8823                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8824                }
8825                let inner_offset;
8826                let mut inner_depth = depth.clone();
8827                if inlined {
8828                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8829                    inner_offset = next_offset;
8830                } else {
8831                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8832                    inner_depth.increment()?;
8833                }
8834                let val_ref = self.token.get_or_insert_with(|| {
8835                    fidl::new_empty!(
8836                        fidl_fuchsia_inspect::EscrowToken,
8837                        fidl::encoding::DefaultFuchsiaResourceDialect
8838                    )
8839                });
8840                fidl::decode!(
8841                    fidl_fuchsia_inspect::EscrowToken,
8842                    fidl::encoding::DefaultFuchsiaResourceDialect,
8843                    val_ref,
8844                    decoder,
8845                    inner_offset,
8846                    inner_depth
8847                )?;
8848                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8849                {
8850                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8851                }
8852                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8853                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8854                }
8855            }
8856
8857            next_offset += envelope_size;
8858
8859            // Decode the remaining unknown envelopes.
8860            while next_offset < end_offset {
8861                _next_ordinal_to_read += 1;
8862                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8863                next_offset += envelope_size;
8864            }
8865
8866            Ok(())
8867        }
8868    }
8869
8870    impl InspectWriterEscrowAndExitResponse {
8871        #[inline(always)]
8872        fn max_ordinal_present(&self) -> u64 {
8873            if let Some(_) = self.token {
8874                return 1;
8875            }
8876            0
8877        }
8878    }
8879
8880    impl fidl::encoding::ResourceTypeMarker for InspectWriterEscrowAndExitResponse {
8881        type Borrowed<'a> = &'a mut Self;
8882        fn take_or_borrow<'a>(
8883            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8884        ) -> Self::Borrowed<'a> {
8885            value
8886        }
8887    }
8888
8889    unsafe impl fidl::encoding::TypeMarker for InspectWriterEscrowAndExitResponse {
8890        type Owned = Self;
8891
8892        #[inline(always)]
8893        fn inline_align(_context: fidl::encoding::Context) -> usize {
8894            8
8895        }
8896
8897        #[inline(always)]
8898        fn inline_size(_context: fidl::encoding::Context) -> usize {
8899            16
8900        }
8901    }
8902
8903    unsafe impl
8904        fidl::encoding::Encode<
8905            InspectWriterEscrowAndExitResponse,
8906            fidl::encoding::DefaultFuchsiaResourceDialect,
8907        > for &mut InspectWriterEscrowAndExitResponse
8908    {
8909        unsafe fn encode(
8910            self,
8911            encoder: &mut fidl::encoding::Encoder<
8912                '_,
8913                fidl::encoding::DefaultFuchsiaResourceDialect,
8914            >,
8915            offset: usize,
8916            mut depth: fidl::encoding::Depth,
8917        ) -> fidl::Result<()> {
8918            encoder.debug_check_bounds::<InspectWriterEscrowAndExitResponse>(offset);
8919            // Vector header
8920            let max_ordinal: u64 = self.max_ordinal_present();
8921            encoder.write_num(max_ordinal, offset);
8922            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8923            // Calling encoder.out_of_line_offset(0) is not allowed.
8924            if max_ordinal == 0 {
8925                return Ok(());
8926            }
8927            depth.increment()?;
8928            let envelope_size = 8;
8929            let bytes_len = max_ordinal as usize * envelope_size;
8930            #[allow(unused_variables)]
8931            let offset = encoder.out_of_line_offset(bytes_len);
8932            let mut _prev_end_offset: usize = 0;
8933            if 1 > max_ordinal {
8934                return Ok(());
8935            }
8936
8937            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8938            // are envelope_size bytes.
8939            let cur_offset: usize = (1 - 1) * envelope_size;
8940
8941            // Zero reserved fields.
8942            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8943
8944            // Safety:
8945            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8946            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8947            //   envelope_size bytes, there is always sufficient room.
8948            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_inspect::EscrowToken, fidl::encoding::DefaultFuchsiaResourceDialect>(
8949            self.token.as_mut().map(<fidl_fuchsia_inspect::EscrowToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
8950            encoder, offset + cur_offset, depth
8951        )?;
8952
8953            _prev_end_offset = cur_offset + envelope_size;
8954
8955            Ok(())
8956        }
8957    }
8958
8959    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8960        for InspectWriterEscrowAndExitResponse
8961    {
8962        #[inline(always)]
8963        fn new_empty() -> Self {
8964            Self::default()
8965        }
8966
8967        unsafe fn decode(
8968            &mut self,
8969            decoder: &mut fidl::encoding::Decoder<
8970                '_,
8971                fidl::encoding::DefaultFuchsiaResourceDialect,
8972            >,
8973            offset: usize,
8974            mut depth: fidl::encoding::Depth,
8975        ) -> fidl::Result<()> {
8976            decoder.debug_check_bounds::<Self>(offset);
8977            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8978                None => return Err(fidl::Error::NotNullable),
8979                Some(len) => len,
8980            };
8981            // Calling decoder.out_of_line_offset(0) is not allowed.
8982            if len == 0 {
8983                return Ok(());
8984            };
8985            depth.increment()?;
8986            let envelope_size = 8;
8987            let bytes_len = len * envelope_size;
8988            let offset = decoder.out_of_line_offset(bytes_len)?;
8989            // Decode the envelope for each type.
8990            let mut _next_ordinal_to_read = 0;
8991            let mut next_offset = offset;
8992            let end_offset = offset + bytes_len;
8993            _next_ordinal_to_read += 1;
8994            if next_offset >= end_offset {
8995                return Ok(());
8996            }
8997
8998            // Decode unknown envelopes for gaps in ordinals.
8999            while _next_ordinal_to_read < 1 {
9000                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9001                _next_ordinal_to_read += 1;
9002                next_offset += envelope_size;
9003            }
9004
9005            let next_out_of_line = decoder.next_out_of_line();
9006            let handles_before = decoder.remaining_handles();
9007            if let Some((inlined, num_bytes, num_handles)) =
9008                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9009            {
9010                let member_inline_size =
9011                    <fidl_fuchsia_inspect::EscrowToken as fidl::encoding::TypeMarker>::inline_size(
9012                        decoder.context,
9013                    );
9014                if inlined != (member_inline_size <= 4) {
9015                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9016                }
9017                let inner_offset;
9018                let mut inner_depth = depth.clone();
9019                if inlined {
9020                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9021                    inner_offset = next_offset;
9022                } else {
9023                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9024                    inner_depth.increment()?;
9025                }
9026                let val_ref = self.token.get_or_insert_with(|| {
9027                    fidl::new_empty!(
9028                        fidl_fuchsia_inspect::EscrowToken,
9029                        fidl::encoding::DefaultFuchsiaResourceDialect
9030                    )
9031                });
9032                fidl::decode!(
9033                    fidl_fuchsia_inspect::EscrowToken,
9034                    fidl::encoding::DefaultFuchsiaResourceDialect,
9035                    val_ref,
9036                    decoder,
9037                    inner_offset,
9038                    inner_depth
9039                )?;
9040                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9041                {
9042                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9043                }
9044                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9045                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9046                }
9047            }
9048
9049            next_offset += envelope_size;
9050
9051            // Decode the remaining unknown envelopes.
9052            while next_offset < end_offset {
9053                _next_ordinal_to_read += 1;
9054                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9055                next_offset += envelope_size;
9056            }
9057
9058            Ok(())
9059        }
9060    }
9061}