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