Skip to main content

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