fidl_fuchsia_validate_logs/
fidl_fuchsia_validate_logs.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 _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13/// Maximum number of arguments that can be encoded per record, as specified by the tracing format:
14///
15/// https://fuchsia.dev/fuchsia-src/development/tracing/trace-format#arguments
16pub const MAX_ARGS: u32 = 15;
17
18/// A small(ish) limit on the length of argument names is used because argument names are expected
19/// to be used repeatedly, many times.
20pub const MAX_ARG_NAME_LENGTH: u32 = 256;
21
22/// The maximum string length which we can encode into the tracing format.
23pub const MAX_TEXT_ARG_LENGTH: u32 = 32768;
24
25#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
26#[repr(u32)]
27pub enum PuppetError {
28    UnsupportedRecord = 1,
29}
30
31impl PuppetError {
32    #[inline]
33    pub fn from_primitive(prim: u32) -> Option<Self> {
34        match prim {
35            1 => Some(Self::UnsupportedRecord),
36            _ => None,
37        }
38    }
39
40    #[inline]
41    pub const fn into_primitive(self) -> u32 {
42        self as u32
43    }
44
45    #[deprecated = "Strict enums should not use `is_unknown`"]
46    #[inline]
47    pub fn is_unknown(&self) -> bool {
48        false
49    }
50}
51
52/// A named key-value pair in the diagnostic record.
53#[derive(Clone, Debug, PartialEq)]
54pub struct Argument {
55    /// The name of the argument.
56    pub name: String,
57    /// The value of the argument.
58    pub value: Value,
59}
60
61impl fidl::Persistable for Argument {}
62
63#[derive(Clone, Debug, PartialEq)]
64pub struct EncodingPuppetEncodeRequest {
65    pub record: Record,
66}
67
68impl fidl::Persistable for EncodingPuppetEncodeRequest {}
69
70#[derive(Debug, PartialEq)]
71pub struct EncodingPuppetEncodeResponse {
72    pub result: fidl_fuchsia_mem::Buffer,
73}
74
75impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
76    for EncodingPuppetEncodeResponse
77{
78}
79
80#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
81pub struct EncodingValidatorValidateRequest {
82    pub results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
83}
84
85impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
86    for EncodingValidatorValidateRequest
87{
88}
89
90#[derive(Clone, Debug, PartialEq)]
91pub struct LogSinkPuppetEmitLogRequest {
92    pub spec: RecordSpec,
93}
94
95impl fidl::Persistable for LogSinkPuppetEmitLogRequest {}
96
97#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
98pub struct LogSinkPuppetGetInfoResponse {
99    pub info: PuppetInfo,
100}
101
102impl fidl::Persistable for LogSinkPuppetGetInfoResponse {}
103
104#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105pub struct PuppetInfo {
106    pub tag: Option<String>,
107    pub pid: u64,
108    pub tid: u64,
109}
110
111impl fidl::Persistable for PuppetInfo {}
112
113/// A record in the diagnostic stream.
114#[derive(Clone, Debug, PartialEq)]
115pub struct Record {
116    /// The time at which the record was generated measured in nanoseconds since
117    /// boot.
118    pub timestamp: fidl::BootInstant,
119    /// Severity of the record.
120    pub severity: fidl_fuchsia_diagnostics::Severity,
121    /// The key-value pairs which make up this record.
122    pub arguments: Vec<Argument>,
123}
124
125impl fidl::Persistable for Record {}
126
127#[derive(Clone, Debug, PartialEq)]
128pub struct RecordSpec {
129    pub file: String,
130    pub line: u32,
131    pub record: Record,
132}
133
134impl fidl::Persistable for RecordSpec {}
135
136#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137pub struct TestFailure {
138    /// The name of the test case.
139    pub test_name: String,
140    /// The reason the test case failed.
141    pub reason: String,
142}
143
144impl fidl::Persistable for TestFailure {}
145
146#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
147pub struct TestSuccess {
148    /// The name of the test case.
149    pub test_name: String,
150}
151
152impl fidl::Persistable for TestSuccess {}
153
154#[derive(Debug, Default, PartialEq)]
155pub struct ValidateResultsIteratorGetNextResponse {
156    pub result: Option<ValidateResult>,
157    #[doc(hidden)]
158    pub __source_breaking: fidl::marker::SourceBreaking,
159}
160
161impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
162    for ValidateResultsIteratorGetNextResponse
163{
164}
165
166#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
167pub enum ValidateResult {
168    /// Set when the test case passed.
169    Success(TestSuccess),
170    /// Set when the test case failed.
171    Failure(TestFailure),
172}
173
174impl ValidateResult {
175    #[inline]
176    pub fn ordinal(&self) -> u64 {
177        match *self {
178            Self::Success(_) => 1,
179            Self::Failure(_) => 2,
180        }
181    }
182
183    #[deprecated = "Strict unions should not use `is_unknown`"]
184    #[inline]
185    pub fn is_unknown(&self) -> bool {
186        false
187    }
188}
189
190impl fidl::Persistable for ValidateResult {}
191
192/// An argument value which can be one of several types.
193#[derive(Clone, Debug)]
194pub enum Value {
195    /// A signed integral argument.
196    SignedInt(i64),
197    /// An unsigned integral argument.
198    UnsignedInt(u64),
199    /// A double-precision floating-point argument.
200    Floating(f64),
201    /// A UTF8 text argument.
202    Text(String),
203    /// A boolean argument.
204    Boolean(bool),
205    #[doc(hidden)]
206    __SourceBreaking { unknown_ordinal: u64 },
207}
208
209/// Pattern that matches an unknown `Value` member.
210#[macro_export]
211macro_rules! ValueUnknown {
212    () => {
213        _
214    };
215}
216
217// Custom PartialEq so that unknown variants are not equal to themselves.
218impl PartialEq for Value {
219    fn eq(&self, other: &Self) -> bool {
220        match (self, other) {
221            (Self::SignedInt(x), Self::SignedInt(y)) => *x == *y,
222            (Self::UnsignedInt(x), Self::UnsignedInt(y)) => *x == *y,
223            (Self::Floating(x), Self::Floating(y)) => *x == *y,
224            (Self::Text(x), Self::Text(y)) => *x == *y,
225            (Self::Boolean(x), Self::Boolean(y)) => *x == *y,
226            _ => false,
227        }
228    }
229}
230
231impl Value {
232    #[inline]
233    pub fn ordinal(&self) -> u64 {
234        match *self {
235            Self::SignedInt(_) => 1,
236            Self::UnsignedInt(_) => 2,
237            Self::Floating(_) => 3,
238            Self::Text(_) => 4,
239            Self::Boolean(_) => 5,
240            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
241        }
242    }
243
244    #[inline]
245    pub fn unknown_variant_for_testing() -> Self {
246        Self::__SourceBreaking { unknown_ordinal: 0 }
247    }
248
249    #[inline]
250    pub fn is_unknown(&self) -> bool {
251        match self {
252            Self::__SourceBreaking { .. } => true,
253            _ => false,
254        }
255    }
256}
257
258impl fidl::Persistable for Value {}
259
260#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
261pub struct EncodingPuppetMarker;
262
263impl fidl::endpoints::ProtocolMarker for EncodingPuppetMarker {
264    type Proxy = EncodingPuppetProxy;
265    type RequestStream = EncodingPuppetRequestStream;
266    #[cfg(target_os = "fuchsia")]
267    type SynchronousProxy = EncodingPuppetSynchronousProxy;
268
269    const DEBUG_NAME: &'static str = "fuchsia.validate.logs.EncodingPuppet";
270}
271impl fidl::endpoints::DiscoverableProtocolMarker for EncodingPuppetMarker {}
272pub type EncodingPuppetEncodeResult = Result<fidl_fuchsia_mem::Buffer, PuppetError>;
273
274pub trait EncodingPuppetProxyInterface: Send + Sync {
275    type EncodeResponseFut: std::future::Future<Output = Result<EncodingPuppetEncodeResult, fidl::Error>>
276        + Send;
277    fn r#encode(&self, record: &Record) -> Self::EncodeResponseFut;
278}
279#[derive(Debug)]
280#[cfg(target_os = "fuchsia")]
281pub struct EncodingPuppetSynchronousProxy {
282    client: fidl::client::sync::Client,
283}
284
285#[cfg(target_os = "fuchsia")]
286impl fidl::endpoints::SynchronousProxy for EncodingPuppetSynchronousProxy {
287    type Proxy = EncodingPuppetProxy;
288    type Protocol = EncodingPuppetMarker;
289
290    fn from_channel(inner: fidl::Channel) -> Self {
291        Self::new(inner)
292    }
293
294    fn into_channel(self) -> fidl::Channel {
295        self.client.into_channel()
296    }
297
298    fn as_channel(&self) -> &fidl::Channel {
299        self.client.as_channel()
300    }
301}
302
303#[cfg(target_os = "fuchsia")]
304impl EncodingPuppetSynchronousProxy {
305    pub fn new(channel: fidl::Channel) -> Self {
306        let protocol_name = <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
307        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
308    }
309
310    pub fn into_channel(self) -> fidl::Channel {
311        self.client.into_channel()
312    }
313
314    /// Waits until an event arrives and returns it. It is safe for other
315    /// threads to make concurrent requests while waiting for an event.
316    pub fn wait_for_event(
317        &self,
318        deadline: zx::MonotonicInstant,
319    ) -> Result<EncodingPuppetEvent, fidl::Error> {
320        EncodingPuppetEvent::decode(self.client.wait_for_event(deadline)?)
321    }
322
323    /// Log takes a record and converts it into a buffer.
324    /// Returns an error if record contains unsupported type
325    pub fn r#encode(
326        &self,
327        mut record: &Record,
328        ___deadline: zx::MonotonicInstant,
329    ) -> Result<EncodingPuppetEncodeResult, fidl::Error> {
330        let _response = self.client.send_query::<
331            EncodingPuppetEncodeRequest,
332            fidl::encoding::ResultType<EncodingPuppetEncodeResponse, PuppetError>,
333        >(
334            (record,),
335            0x4486ab9d1bb462f8,
336            fidl::encoding::DynamicFlags::empty(),
337            ___deadline,
338        )?;
339        Ok(_response.map(|x| x.result))
340    }
341}
342
343#[derive(Debug, Clone)]
344pub struct EncodingPuppetProxy {
345    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
346}
347
348impl fidl::endpoints::Proxy for EncodingPuppetProxy {
349    type Protocol = EncodingPuppetMarker;
350
351    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
352        Self::new(inner)
353    }
354
355    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
356        self.client.into_channel().map_err(|client| Self { client })
357    }
358
359    fn as_channel(&self) -> &::fidl::AsyncChannel {
360        self.client.as_channel()
361    }
362}
363
364impl EncodingPuppetProxy {
365    /// Create a new Proxy for fuchsia.validate.logs/EncodingPuppet.
366    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
367        let protocol_name = <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
368        Self { client: fidl::client::Client::new(channel, protocol_name) }
369    }
370
371    /// Get a Stream of events from the remote end of the protocol.
372    ///
373    /// # Panics
374    ///
375    /// Panics if the event stream was already taken.
376    pub fn take_event_stream(&self) -> EncodingPuppetEventStream {
377        EncodingPuppetEventStream { event_receiver: self.client.take_event_receiver() }
378    }
379
380    /// Log takes a record and converts it into a buffer.
381    /// Returns an error if record contains unsupported type
382    pub fn r#encode(
383        &self,
384        mut record: &Record,
385    ) -> fidl::client::QueryResponseFut<
386        EncodingPuppetEncodeResult,
387        fidl::encoding::DefaultFuchsiaResourceDialect,
388    > {
389        EncodingPuppetProxyInterface::r#encode(self, record)
390    }
391}
392
393impl EncodingPuppetProxyInterface for EncodingPuppetProxy {
394    type EncodeResponseFut = fidl::client::QueryResponseFut<
395        EncodingPuppetEncodeResult,
396        fidl::encoding::DefaultFuchsiaResourceDialect,
397    >;
398    fn r#encode(&self, mut record: &Record) -> Self::EncodeResponseFut {
399        fn _decode(
400            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
401        ) -> Result<EncodingPuppetEncodeResult, fidl::Error> {
402            let _response = fidl::client::decode_transaction_body::<
403                fidl::encoding::ResultType<EncodingPuppetEncodeResponse, PuppetError>,
404                fidl::encoding::DefaultFuchsiaResourceDialect,
405                0x4486ab9d1bb462f8,
406            >(_buf?)?;
407            Ok(_response.map(|x| x.result))
408        }
409        self.client
410            .send_query_and_decode::<EncodingPuppetEncodeRequest, EncodingPuppetEncodeResult>(
411                (record,),
412                0x4486ab9d1bb462f8,
413                fidl::encoding::DynamicFlags::empty(),
414                _decode,
415            )
416    }
417}
418
419pub struct EncodingPuppetEventStream {
420    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
421}
422
423impl std::marker::Unpin for EncodingPuppetEventStream {}
424
425impl futures::stream::FusedStream for EncodingPuppetEventStream {
426    fn is_terminated(&self) -> bool {
427        self.event_receiver.is_terminated()
428    }
429}
430
431impl futures::Stream for EncodingPuppetEventStream {
432    type Item = Result<EncodingPuppetEvent, fidl::Error>;
433
434    fn poll_next(
435        mut self: std::pin::Pin<&mut Self>,
436        cx: &mut std::task::Context<'_>,
437    ) -> std::task::Poll<Option<Self::Item>> {
438        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
439            &mut self.event_receiver,
440            cx
441        )?) {
442            Some(buf) => std::task::Poll::Ready(Some(EncodingPuppetEvent::decode(buf))),
443            None => std::task::Poll::Ready(None),
444        }
445    }
446}
447
448#[derive(Debug)]
449pub enum EncodingPuppetEvent {}
450
451impl EncodingPuppetEvent {
452    /// Decodes a message buffer as a [`EncodingPuppetEvent`].
453    fn decode(
454        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
455    ) -> Result<EncodingPuppetEvent, fidl::Error> {
456        let (bytes, _handles) = buf.split_mut();
457        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
458        debug_assert_eq!(tx_header.tx_id, 0);
459        match tx_header.ordinal {
460            _ => Err(fidl::Error::UnknownOrdinal {
461                ordinal: tx_header.ordinal,
462                protocol_name:
463                    <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
464            }),
465        }
466    }
467}
468
469/// A Stream of incoming requests for fuchsia.validate.logs/EncodingPuppet.
470pub struct EncodingPuppetRequestStream {
471    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
472    is_terminated: bool,
473}
474
475impl std::marker::Unpin for EncodingPuppetRequestStream {}
476
477impl futures::stream::FusedStream for EncodingPuppetRequestStream {
478    fn is_terminated(&self) -> bool {
479        self.is_terminated
480    }
481}
482
483impl fidl::endpoints::RequestStream for EncodingPuppetRequestStream {
484    type Protocol = EncodingPuppetMarker;
485    type ControlHandle = EncodingPuppetControlHandle;
486
487    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
488        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
489    }
490
491    fn control_handle(&self) -> Self::ControlHandle {
492        EncodingPuppetControlHandle { inner: self.inner.clone() }
493    }
494
495    fn into_inner(
496        self,
497    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
498    {
499        (self.inner, self.is_terminated)
500    }
501
502    fn from_inner(
503        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
504        is_terminated: bool,
505    ) -> Self {
506        Self { inner, is_terminated }
507    }
508}
509
510impl futures::Stream for EncodingPuppetRequestStream {
511    type Item = Result<EncodingPuppetRequest, fidl::Error>;
512
513    fn poll_next(
514        mut self: std::pin::Pin<&mut Self>,
515        cx: &mut std::task::Context<'_>,
516    ) -> std::task::Poll<Option<Self::Item>> {
517        let this = &mut *self;
518        if this.inner.check_shutdown(cx) {
519            this.is_terminated = true;
520            return std::task::Poll::Ready(None);
521        }
522        if this.is_terminated {
523            panic!("polled EncodingPuppetRequestStream after completion");
524        }
525        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
526            |bytes, handles| {
527                match this.inner.channel().read_etc(cx, bytes, handles) {
528                    std::task::Poll::Ready(Ok(())) => {}
529                    std::task::Poll::Pending => return std::task::Poll::Pending,
530                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
531                        this.is_terminated = true;
532                        return std::task::Poll::Ready(None);
533                    }
534                    std::task::Poll::Ready(Err(e)) => {
535                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
536                            e.into(),
537                        ))))
538                    }
539                }
540
541                // A message has been received from the channel
542                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
543
544                std::task::Poll::Ready(Some(match header.ordinal {
545                    0x4486ab9d1bb462f8 => {
546                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
547                        let mut req = fidl::new_empty!(
548                            EncodingPuppetEncodeRequest,
549                            fidl::encoding::DefaultFuchsiaResourceDialect
550                        );
551                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EncodingPuppetEncodeRequest>(&header, _body_bytes, handles, &mut req)?;
552                        let control_handle =
553                            EncodingPuppetControlHandle { inner: this.inner.clone() };
554                        Ok(EncodingPuppetRequest::Encode {
555                            record: req.record,
556
557                            responder: EncodingPuppetEncodeResponder {
558                                control_handle: std::mem::ManuallyDrop::new(control_handle),
559                                tx_id: header.tx_id,
560                            },
561                        })
562                    }
563                    _ => Err(fidl::Error::UnknownOrdinal {
564                        ordinal: header.ordinal,
565                        protocol_name:
566                            <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
567                    }),
568                }))
569            },
570        )
571    }
572}
573
574#[derive(Debug)]
575pub enum EncodingPuppetRequest {
576    /// Log takes a record and converts it into a buffer.
577    /// Returns an error if record contains unsupported type
578    Encode { record: Record, responder: EncodingPuppetEncodeResponder },
579}
580
581impl EncodingPuppetRequest {
582    #[allow(irrefutable_let_patterns)]
583    pub fn into_encode(self) -> Option<(Record, EncodingPuppetEncodeResponder)> {
584        if let EncodingPuppetRequest::Encode { record, responder } = self {
585            Some((record, responder))
586        } else {
587            None
588        }
589    }
590
591    /// Name of the method defined in FIDL
592    pub fn method_name(&self) -> &'static str {
593        match *self {
594            EncodingPuppetRequest::Encode { .. } => "encode",
595        }
596    }
597}
598
599#[derive(Debug, Clone)]
600pub struct EncodingPuppetControlHandle {
601    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
602}
603
604impl fidl::endpoints::ControlHandle for EncodingPuppetControlHandle {
605    fn shutdown(&self) {
606        self.inner.shutdown()
607    }
608    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
609        self.inner.shutdown_with_epitaph(status)
610    }
611
612    fn is_closed(&self) -> bool {
613        self.inner.channel().is_closed()
614    }
615    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
616        self.inner.channel().on_closed()
617    }
618
619    #[cfg(target_os = "fuchsia")]
620    fn signal_peer(
621        &self,
622        clear_mask: zx::Signals,
623        set_mask: zx::Signals,
624    ) -> Result<(), zx_status::Status> {
625        use fidl::Peered;
626        self.inner.channel().signal_peer(clear_mask, set_mask)
627    }
628}
629
630impl EncodingPuppetControlHandle {}
631
632#[must_use = "FIDL methods require a response to be sent"]
633#[derive(Debug)]
634pub struct EncodingPuppetEncodeResponder {
635    control_handle: std::mem::ManuallyDrop<EncodingPuppetControlHandle>,
636    tx_id: u32,
637}
638
639/// Set the the channel to be shutdown (see [`EncodingPuppetControlHandle::shutdown`])
640/// if the responder is dropped without sending a response, so that the client
641/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
642impl std::ops::Drop for EncodingPuppetEncodeResponder {
643    fn drop(&mut self) {
644        self.control_handle.shutdown();
645        // Safety: drops once, never accessed again
646        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
647    }
648}
649
650impl fidl::endpoints::Responder for EncodingPuppetEncodeResponder {
651    type ControlHandle = EncodingPuppetControlHandle;
652
653    fn control_handle(&self) -> &EncodingPuppetControlHandle {
654        &self.control_handle
655    }
656
657    fn drop_without_shutdown(mut self) {
658        // Safety: drops once, never accessed again due to mem::forget
659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
660        // Prevent Drop from running (which would shut down the channel)
661        std::mem::forget(self);
662    }
663}
664
665impl EncodingPuppetEncodeResponder {
666    /// Sends a response to the FIDL transaction.
667    ///
668    /// Sets the channel to shutdown if an error occurs.
669    pub fn send(
670        self,
671        mut result: Result<fidl_fuchsia_mem::Buffer, PuppetError>,
672    ) -> Result<(), fidl::Error> {
673        let _result = self.send_raw(result);
674        if _result.is_err() {
675            self.control_handle.shutdown();
676        }
677        self.drop_without_shutdown();
678        _result
679    }
680
681    /// Similar to "send" but does not shutdown the channel if an error occurs.
682    pub fn send_no_shutdown_on_err(
683        self,
684        mut result: Result<fidl_fuchsia_mem::Buffer, PuppetError>,
685    ) -> Result<(), fidl::Error> {
686        let _result = self.send_raw(result);
687        self.drop_without_shutdown();
688        _result
689    }
690
691    fn send_raw(
692        &self,
693        mut result: Result<fidl_fuchsia_mem::Buffer, PuppetError>,
694    ) -> Result<(), fidl::Error> {
695        self.control_handle.inner.send::<fidl::encoding::ResultType<
696            EncodingPuppetEncodeResponse,
697            PuppetError,
698        >>(
699            result.as_mut().map_err(|e| *e).map(|result| (result,)),
700            self.tx_id,
701            0x4486ab9d1bb462f8,
702            fidl::encoding::DynamicFlags::empty(),
703        )
704    }
705}
706
707#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
708pub struct EncodingValidatorMarker;
709
710impl fidl::endpoints::ProtocolMarker for EncodingValidatorMarker {
711    type Proxy = EncodingValidatorProxy;
712    type RequestStream = EncodingValidatorRequestStream;
713    #[cfg(target_os = "fuchsia")]
714    type SynchronousProxy = EncodingValidatorSynchronousProxy;
715
716    const DEBUG_NAME: &'static str = "fuchsia.validate.logs.EncodingValidator";
717}
718impl fidl::endpoints::DiscoverableProtocolMarker for EncodingValidatorMarker {}
719
720pub trait EncodingValidatorProxyInterface: Send + Sync {
721    fn r#validate(
722        &self,
723        results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
724    ) -> Result<(), fidl::Error>;
725}
726#[derive(Debug)]
727#[cfg(target_os = "fuchsia")]
728pub struct EncodingValidatorSynchronousProxy {
729    client: fidl::client::sync::Client,
730}
731
732#[cfg(target_os = "fuchsia")]
733impl fidl::endpoints::SynchronousProxy for EncodingValidatorSynchronousProxy {
734    type Proxy = EncodingValidatorProxy;
735    type Protocol = EncodingValidatorMarker;
736
737    fn from_channel(inner: fidl::Channel) -> Self {
738        Self::new(inner)
739    }
740
741    fn into_channel(self) -> fidl::Channel {
742        self.client.into_channel()
743    }
744
745    fn as_channel(&self) -> &fidl::Channel {
746        self.client.as_channel()
747    }
748}
749
750#[cfg(target_os = "fuchsia")]
751impl EncodingValidatorSynchronousProxy {
752    pub fn new(channel: fidl::Channel) -> Self {
753        let protocol_name =
754            <EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
755        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
756    }
757
758    pub fn into_channel(self) -> fidl::Channel {
759        self.client.into_channel()
760    }
761
762    /// Waits until an event arrives and returns it. It is safe for other
763    /// threads to make concurrent requests while waiting for an event.
764    pub fn wait_for_event(
765        &self,
766        deadline: zx::MonotonicInstant,
767    ) -> Result<EncodingValidatorEvent, fidl::Error> {
768        EncodingValidatorEvent::decode(self.client.wait_for_event(deadline)?)
769    }
770
771    /// Runs the encoding validation test suite and reports the results on the
772    /// given channel.
773    pub fn r#validate(
774        &self,
775        mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
776    ) -> Result<(), fidl::Error> {
777        self.client.send::<EncodingValidatorValidateRequest>(
778            (results,),
779            0x1ac204a62465f23c,
780            fidl::encoding::DynamicFlags::empty(),
781        )
782    }
783}
784
785#[derive(Debug, Clone)]
786pub struct EncodingValidatorProxy {
787    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
788}
789
790impl fidl::endpoints::Proxy for EncodingValidatorProxy {
791    type Protocol = EncodingValidatorMarker;
792
793    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
794        Self::new(inner)
795    }
796
797    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
798        self.client.into_channel().map_err(|client| Self { client })
799    }
800
801    fn as_channel(&self) -> &::fidl::AsyncChannel {
802        self.client.as_channel()
803    }
804}
805
806impl EncodingValidatorProxy {
807    /// Create a new Proxy for fuchsia.validate.logs/EncodingValidator.
808    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
809        let protocol_name =
810            <EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
811        Self { client: fidl::client::Client::new(channel, protocol_name) }
812    }
813
814    /// Get a Stream of events from the remote end of the protocol.
815    ///
816    /// # Panics
817    ///
818    /// Panics if the event stream was already taken.
819    pub fn take_event_stream(&self) -> EncodingValidatorEventStream {
820        EncodingValidatorEventStream { event_receiver: self.client.take_event_receiver() }
821    }
822
823    /// Runs the encoding validation test suite and reports the results on the
824    /// given channel.
825    pub fn r#validate(
826        &self,
827        mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
828    ) -> Result<(), fidl::Error> {
829        EncodingValidatorProxyInterface::r#validate(self, results)
830    }
831}
832
833impl EncodingValidatorProxyInterface for EncodingValidatorProxy {
834    fn r#validate(
835        &self,
836        mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
837    ) -> Result<(), fidl::Error> {
838        self.client.send::<EncodingValidatorValidateRequest>(
839            (results,),
840            0x1ac204a62465f23c,
841            fidl::encoding::DynamicFlags::empty(),
842        )
843    }
844}
845
846pub struct EncodingValidatorEventStream {
847    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
848}
849
850impl std::marker::Unpin for EncodingValidatorEventStream {}
851
852impl futures::stream::FusedStream for EncodingValidatorEventStream {
853    fn is_terminated(&self) -> bool {
854        self.event_receiver.is_terminated()
855    }
856}
857
858impl futures::Stream for EncodingValidatorEventStream {
859    type Item = Result<EncodingValidatorEvent, fidl::Error>;
860
861    fn poll_next(
862        mut self: std::pin::Pin<&mut Self>,
863        cx: &mut std::task::Context<'_>,
864    ) -> std::task::Poll<Option<Self::Item>> {
865        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
866            &mut self.event_receiver,
867            cx
868        )?) {
869            Some(buf) => std::task::Poll::Ready(Some(EncodingValidatorEvent::decode(buf))),
870            None => std::task::Poll::Ready(None),
871        }
872    }
873}
874
875#[derive(Debug)]
876pub enum EncodingValidatorEvent {}
877
878impl EncodingValidatorEvent {
879    /// Decodes a message buffer as a [`EncodingValidatorEvent`].
880    fn decode(
881        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
882    ) -> Result<EncodingValidatorEvent, fidl::Error> {
883        let (bytes, _handles) = buf.split_mut();
884        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
885        debug_assert_eq!(tx_header.tx_id, 0);
886        match tx_header.ordinal {
887            _ => Err(fidl::Error::UnknownOrdinal {
888                ordinal: tx_header.ordinal,
889                protocol_name:
890                    <EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
891            }),
892        }
893    }
894}
895
896/// A Stream of incoming requests for fuchsia.validate.logs/EncodingValidator.
897pub struct EncodingValidatorRequestStream {
898    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
899    is_terminated: bool,
900}
901
902impl std::marker::Unpin for EncodingValidatorRequestStream {}
903
904impl futures::stream::FusedStream for EncodingValidatorRequestStream {
905    fn is_terminated(&self) -> bool {
906        self.is_terminated
907    }
908}
909
910impl fidl::endpoints::RequestStream for EncodingValidatorRequestStream {
911    type Protocol = EncodingValidatorMarker;
912    type ControlHandle = EncodingValidatorControlHandle;
913
914    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
915        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
916    }
917
918    fn control_handle(&self) -> Self::ControlHandle {
919        EncodingValidatorControlHandle { inner: self.inner.clone() }
920    }
921
922    fn into_inner(
923        self,
924    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
925    {
926        (self.inner, self.is_terminated)
927    }
928
929    fn from_inner(
930        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
931        is_terminated: bool,
932    ) -> Self {
933        Self { inner, is_terminated }
934    }
935}
936
937impl futures::Stream for EncodingValidatorRequestStream {
938    type Item = Result<EncodingValidatorRequest, fidl::Error>;
939
940    fn poll_next(
941        mut self: std::pin::Pin<&mut Self>,
942        cx: &mut std::task::Context<'_>,
943    ) -> std::task::Poll<Option<Self::Item>> {
944        let this = &mut *self;
945        if this.inner.check_shutdown(cx) {
946            this.is_terminated = true;
947            return std::task::Poll::Ready(None);
948        }
949        if this.is_terminated {
950            panic!("polled EncodingValidatorRequestStream after completion");
951        }
952        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
953            |bytes, handles| {
954                match this.inner.channel().read_etc(cx, bytes, handles) {
955                    std::task::Poll::Ready(Ok(())) => {}
956                    std::task::Poll::Pending => return std::task::Poll::Pending,
957                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
958                        this.is_terminated = true;
959                        return std::task::Poll::Ready(None);
960                    }
961                    std::task::Poll::Ready(Err(e)) => {
962                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
963                            e.into(),
964                        ))))
965                    }
966                }
967
968                // A message has been received from the channel
969                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
970
971                std::task::Poll::Ready(Some(match header.ordinal {
972                    0x1ac204a62465f23c => {
973                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
974                        let mut req = fidl::new_empty!(
975                            EncodingValidatorValidateRequest,
976                            fidl::encoding::DefaultFuchsiaResourceDialect
977                        );
978                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EncodingValidatorValidateRequest>(&header, _body_bytes, handles, &mut req)?;
979                        let control_handle =
980                            EncodingValidatorControlHandle { inner: this.inner.clone() };
981                        Ok(EncodingValidatorRequest::Validate {
982                            results: req.results,
983
984                            control_handle,
985                        })
986                    }
987                    _ => Err(fidl::Error::UnknownOrdinal {
988                        ordinal: header.ordinal,
989                        protocol_name:
990                            <EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
991                    }),
992                }))
993            },
994        )
995    }
996}
997
998#[derive(Debug)]
999pub enum EncodingValidatorRequest {
1000    /// Runs the encoding validation test suite and reports the results on the
1001    /// given channel.
1002    Validate {
1003        results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
1004        control_handle: EncodingValidatorControlHandle,
1005    },
1006}
1007
1008impl EncodingValidatorRequest {
1009    #[allow(irrefutable_let_patterns)]
1010    pub fn into_validate(
1011        self,
1012    ) -> Option<(
1013        fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
1014        EncodingValidatorControlHandle,
1015    )> {
1016        if let EncodingValidatorRequest::Validate { results, control_handle } = self {
1017            Some((results, control_handle))
1018        } else {
1019            None
1020        }
1021    }
1022
1023    /// Name of the method defined in FIDL
1024    pub fn method_name(&self) -> &'static str {
1025        match *self {
1026            EncodingValidatorRequest::Validate { .. } => "validate",
1027        }
1028    }
1029}
1030
1031#[derive(Debug, Clone)]
1032pub struct EncodingValidatorControlHandle {
1033    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1034}
1035
1036impl fidl::endpoints::ControlHandle for EncodingValidatorControlHandle {
1037    fn shutdown(&self) {
1038        self.inner.shutdown()
1039    }
1040    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1041        self.inner.shutdown_with_epitaph(status)
1042    }
1043
1044    fn is_closed(&self) -> bool {
1045        self.inner.channel().is_closed()
1046    }
1047    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1048        self.inner.channel().on_closed()
1049    }
1050
1051    #[cfg(target_os = "fuchsia")]
1052    fn signal_peer(
1053        &self,
1054        clear_mask: zx::Signals,
1055        set_mask: zx::Signals,
1056    ) -> Result<(), zx_status::Status> {
1057        use fidl::Peered;
1058        self.inner.channel().signal_peer(clear_mask, set_mask)
1059    }
1060}
1061
1062impl EncodingValidatorControlHandle {}
1063
1064#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1065pub struct LogSinkPuppetMarker;
1066
1067impl fidl::endpoints::ProtocolMarker for LogSinkPuppetMarker {
1068    type Proxy = LogSinkPuppetProxy;
1069    type RequestStream = LogSinkPuppetRequestStream;
1070    #[cfg(target_os = "fuchsia")]
1071    type SynchronousProxy = LogSinkPuppetSynchronousProxy;
1072
1073    const DEBUG_NAME: &'static str = "fuchsia.validate.logs.LogSinkPuppet";
1074}
1075impl fidl::endpoints::DiscoverableProtocolMarker for LogSinkPuppetMarker {}
1076
1077pub trait LogSinkPuppetProxyInterface: Send + Sync {
1078    type GetInfoResponseFut: std::future::Future<Output = Result<PuppetInfo, fidl::Error>> + Send;
1079    fn r#get_info(&self) -> Self::GetInfoResponseFut;
1080    type EmitLogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1081    fn r#emit_log(&self, spec: &RecordSpec) -> Self::EmitLogResponseFut;
1082    type StopInterestListenerResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1083        + Send;
1084    fn r#stop_interest_listener(&self) -> Self::StopInterestListenerResponseFut;
1085}
1086#[derive(Debug)]
1087#[cfg(target_os = "fuchsia")]
1088pub struct LogSinkPuppetSynchronousProxy {
1089    client: fidl::client::sync::Client,
1090}
1091
1092#[cfg(target_os = "fuchsia")]
1093impl fidl::endpoints::SynchronousProxy for LogSinkPuppetSynchronousProxy {
1094    type Proxy = LogSinkPuppetProxy;
1095    type Protocol = LogSinkPuppetMarker;
1096
1097    fn from_channel(inner: fidl::Channel) -> Self {
1098        Self::new(inner)
1099    }
1100
1101    fn into_channel(self) -> fidl::Channel {
1102        self.client.into_channel()
1103    }
1104
1105    fn as_channel(&self) -> &fidl::Channel {
1106        self.client.as_channel()
1107    }
1108}
1109
1110#[cfg(target_os = "fuchsia")]
1111impl LogSinkPuppetSynchronousProxy {
1112    pub fn new(channel: fidl::Channel) -> Self {
1113        let protocol_name = <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1114        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1115    }
1116
1117    pub fn into_channel(self) -> fidl::Channel {
1118        self.client.into_channel()
1119    }
1120
1121    /// Waits until an event arrives and returns it. It is safe for other
1122    /// threads to make concurrent requests while waiting for an event.
1123    pub fn wait_for_event(
1124        &self,
1125        deadline: zx::MonotonicInstant,
1126    ) -> Result<LogSinkPuppetEvent, fidl::Error> {
1127        LogSinkPuppetEvent::decode(self.client.wait_for_event(deadline)?)
1128    }
1129
1130    /// Returns the information the puppet knows about itself.
1131    pub fn r#get_info(&self, ___deadline: zx::MonotonicInstant) -> Result<PuppetInfo, fidl::Error> {
1132        let _response =
1133            self.client.send_query::<fidl::encoding::EmptyPayload, LogSinkPuppetGetInfoResponse>(
1134                (),
1135                0x5b1c3dac76c26425,
1136                fidl::encoding::DynamicFlags::empty(),
1137                ___deadline,
1138            )?;
1139        Ok(_response.info)
1140    }
1141
1142    /// Logs a record.
1143    pub fn r#emit_log(
1144        &self,
1145        mut spec: &RecordSpec,
1146        ___deadline: zx::MonotonicInstant,
1147    ) -> Result<(), fidl::Error> {
1148        let _response =
1149            self.client.send_query::<LogSinkPuppetEmitLogRequest, fidl::encoding::EmptyPayload>(
1150                (spec,),
1151                0x58b64b6672ed66de,
1152                fidl::encoding::DynamicFlags::empty(),
1153                ___deadline,
1154            )?;
1155        Ok(_response)
1156    }
1157
1158    /// Disables the interest listener
1159    pub fn r#stop_interest_listener(
1160        &self,
1161        ___deadline: zx::MonotonicInstant,
1162    ) -> Result<(), fidl::Error> {
1163        let _response =
1164            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
1165                (),
1166                0x4c69520a50828cbd,
1167                fidl::encoding::DynamicFlags::empty(),
1168                ___deadline,
1169            )?;
1170        Ok(_response)
1171    }
1172}
1173
1174#[derive(Debug, Clone)]
1175pub struct LogSinkPuppetProxy {
1176    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1177}
1178
1179impl fidl::endpoints::Proxy for LogSinkPuppetProxy {
1180    type Protocol = LogSinkPuppetMarker;
1181
1182    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1183        Self::new(inner)
1184    }
1185
1186    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1187        self.client.into_channel().map_err(|client| Self { client })
1188    }
1189
1190    fn as_channel(&self) -> &::fidl::AsyncChannel {
1191        self.client.as_channel()
1192    }
1193}
1194
1195impl LogSinkPuppetProxy {
1196    /// Create a new Proxy for fuchsia.validate.logs/LogSinkPuppet.
1197    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1198        let protocol_name = <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1199        Self { client: fidl::client::Client::new(channel, protocol_name) }
1200    }
1201
1202    /// Get a Stream of events from the remote end of the protocol.
1203    ///
1204    /// # Panics
1205    ///
1206    /// Panics if the event stream was already taken.
1207    pub fn take_event_stream(&self) -> LogSinkPuppetEventStream {
1208        LogSinkPuppetEventStream { event_receiver: self.client.take_event_receiver() }
1209    }
1210
1211    /// Returns the information the puppet knows about itself.
1212    pub fn r#get_info(
1213        &self,
1214    ) -> fidl::client::QueryResponseFut<PuppetInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
1215    {
1216        LogSinkPuppetProxyInterface::r#get_info(self)
1217    }
1218
1219    /// Logs a record.
1220    pub fn r#emit_log(
1221        &self,
1222        mut spec: &RecordSpec,
1223    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1224        LogSinkPuppetProxyInterface::r#emit_log(self, spec)
1225    }
1226
1227    /// Disables the interest listener
1228    pub fn r#stop_interest_listener(
1229        &self,
1230    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1231        LogSinkPuppetProxyInterface::r#stop_interest_listener(self)
1232    }
1233}
1234
1235impl LogSinkPuppetProxyInterface for LogSinkPuppetProxy {
1236    type GetInfoResponseFut =
1237        fidl::client::QueryResponseFut<PuppetInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
1238    fn r#get_info(&self) -> Self::GetInfoResponseFut {
1239        fn _decode(
1240            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1241        ) -> Result<PuppetInfo, fidl::Error> {
1242            let _response = fidl::client::decode_transaction_body::<
1243                LogSinkPuppetGetInfoResponse,
1244                fidl::encoding::DefaultFuchsiaResourceDialect,
1245                0x5b1c3dac76c26425,
1246            >(_buf?)?;
1247            Ok(_response.info)
1248        }
1249        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PuppetInfo>(
1250            (),
1251            0x5b1c3dac76c26425,
1252            fidl::encoding::DynamicFlags::empty(),
1253            _decode,
1254        )
1255    }
1256
1257    type EmitLogResponseFut =
1258        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1259    fn r#emit_log(&self, mut spec: &RecordSpec) -> Self::EmitLogResponseFut {
1260        fn _decode(
1261            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1262        ) -> Result<(), fidl::Error> {
1263            let _response = fidl::client::decode_transaction_body::<
1264                fidl::encoding::EmptyPayload,
1265                fidl::encoding::DefaultFuchsiaResourceDialect,
1266                0x58b64b6672ed66de,
1267            >(_buf?)?;
1268            Ok(_response)
1269        }
1270        self.client.send_query_and_decode::<LogSinkPuppetEmitLogRequest, ()>(
1271            (spec,),
1272            0x58b64b6672ed66de,
1273            fidl::encoding::DynamicFlags::empty(),
1274            _decode,
1275        )
1276    }
1277
1278    type StopInterestListenerResponseFut =
1279        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1280    fn r#stop_interest_listener(&self) -> Self::StopInterestListenerResponseFut {
1281        fn _decode(
1282            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1283        ) -> Result<(), fidl::Error> {
1284            let _response = fidl::client::decode_transaction_body::<
1285                fidl::encoding::EmptyPayload,
1286                fidl::encoding::DefaultFuchsiaResourceDialect,
1287                0x4c69520a50828cbd,
1288            >(_buf?)?;
1289            Ok(_response)
1290        }
1291        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1292            (),
1293            0x4c69520a50828cbd,
1294            fidl::encoding::DynamicFlags::empty(),
1295            _decode,
1296        )
1297    }
1298}
1299
1300pub struct LogSinkPuppetEventStream {
1301    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1302}
1303
1304impl std::marker::Unpin for LogSinkPuppetEventStream {}
1305
1306impl futures::stream::FusedStream for LogSinkPuppetEventStream {
1307    fn is_terminated(&self) -> bool {
1308        self.event_receiver.is_terminated()
1309    }
1310}
1311
1312impl futures::Stream for LogSinkPuppetEventStream {
1313    type Item = Result<LogSinkPuppetEvent, fidl::Error>;
1314
1315    fn poll_next(
1316        mut self: std::pin::Pin<&mut Self>,
1317        cx: &mut std::task::Context<'_>,
1318    ) -> std::task::Poll<Option<Self::Item>> {
1319        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1320            &mut self.event_receiver,
1321            cx
1322        )?) {
1323            Some(buf) => std::task::Poll::Ready(Some(LogSinkPuppetEvent::decode(buf))),
1324            None => std::task::Poll::Ready(None),
1325        }
1326    }
1327}
1328
1329#[derive(Debug)]
1330pub enum LogSinkPuppetEvent {}
1331
1332impl LogSinkPuppetEvent {
1333    /// Decodes a message buffer as a [`LogSinkPuppetEvent`].
1334    fn decode(
1335        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1336    ) -> Result<LogSinkPuppetEvent, fidl::Error> {
1337        let (bytes, _handles) = buf.split_mut();
1338        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1339        debug_assert_eq!(tx_header.tx_id, 0);
1340        match tx_header.ordinal {
1341            _ => Err(fidl::Error::UnknownOrdinal {
1342                ordinal: tx_header.ordinal,
1343                protocol_name: <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1344            }),
1345        }
1346    }
1347}
1348
1349/// A Stream of incoming requests for fuchsia.validate.logs/LogSinkPuppet.
1350pub struct LogSinkPuppetRequestStream {
1351    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1352    is_terminated: bool,
1353}
1354
1355impl std::marker::Unpin for LogSinkPuppetRequestStream {}
1356
1357impl futures::stream::FusedStream for LogSinkPuppetRequestStream {
1358    fn is_terminated(&self) -> bool {
1359        self.is_terminated
1360    }
1361}
1362
1363impl fidl::endpoints::RequestStream for LogSinkPuppetRequestStream {
1364    type Protocol = LogSinkPuppetMarker;
1365    type ControlHandle = LogSinkPuppetControlHandle;
1366
1367    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1368        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1369    }
1370
1371    fn control_handle(&self) -> Self::ControlHandle {
1372        LogSinkPuppetControlHandle { inner: self.inner.clone() }
1373    }
1374
1375    fn into_inner(
1376        self,
1377    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1378    {
1379        (self.inner, self.is_terminated)
1380    }
1381
1382    fn from_inner(
1383        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1384        is_terminated: bool,
1385    ) -> Self {
1386        Self { inner, is_terminated }
1387    }
1388}
1389
1390impl futures::Stream for LogSinkPuppetRequestStream {
1391    type Item = Result<LogSinkPuppetRequest, fidl::Error>;
1392
1393    fn poll_next(
1394        mut self: std::pin::Pin<&mut Self>,
1395        cx: &mut std::task::Context<'_>,
1396    ) -> std::task::Poll<Option<Self::Item>> {
1397        let this = &mut *self;
1398        if this.inner.check_shutdown(cx) {
1399            this.is_terminated = true;
1400            return std::task::Poll::Ready(None);
1401        }
1402        if this.is_terminated {
1403            panic!("polled LogSinkPuppetRequestStream after completion");
1404        }
1405        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1406            |bytes, handles| {
1407                match this.inner.channel().read_etc(cx, bytes, handles) {
1408                    std::task::Poll::Ready(Ok(())) => {}
1409                    std::task::Poll::Pending => return std::task::Poll::Pending,
1410                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1411                        this.is_terminated = true;
1412                        return std::task::Poll::Ready(None);
1413                    }
1414                    std::task::Poll::Ready(Err(e)) => {
1415                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1416                            e.into(),
1417                        ))))
1418                    }
1419                }
1420
1421                // A message has been received from the channel
1422                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1423
1424                std::task::Poll::Ready(Some(match header.ordinal {
1425                    0x5b1c3dac76c26425 => {
1426                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1427                        let mut req = fidl::new_empty!(
1428                            fidl::encoding::EmptyPayload,
1429                            fidl::encoding::DefaultFuchsiaResourceDialect
1430                        );
1431                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1432                        let control_handle =
1433                            LogSinkPuppetControlHandle { inner: this.inner.clone() };
1434                        Ok(LogSinkPuppetRequest::GetInfo {
1435                            responder: LogSinkPuppetGetInfoResponder {
1436                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1437                                tx_id: header.tx_id,
1438                            },
1439                        })
1440                    }
1441                    0x58b64b6672ed66de => {
1442                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1443                        let mut req = fidl::new_empty!(
1444                            LogSinkPuppetEmitLogRequest,
1445                            fidl::encoding::DefaultFuchsiaResourceDialect
1446                        );
1447                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogSinkPuppetEmitLogRequest>(&header, _body_bytes, handles, &mut req)?;
1448                        let control_handle =
1449                            LogSinkPuppetControlHandle { inner: this.inner.clone() };
1450                        Ok(LogSinkPuppetRequest::EmitLog {
1451                            spec: req.spec,
1452
1453                            responder: LogSinkPuppetEmitLogResponder {
1454                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1455                                tx_id: header.tx_id,
1456                            },
1457                        })
1458                    }
1459                    0x4c69520a50828cbd => {
1460                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1461                        let mut req = fidl::new_empty!(
1462                            fidl::encoding::EmptyPayload,
1463                            fidl::encoding::DefaultFuchsiaResourceDialect
1464                        );
1465                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1466                        let control_handle =
1467                            LogSinkPuppetControlHandle { inner: this.inner.clone() };
1468                        Ok(LogSinkPuppetRequest::StopInterestListener {
1469                            responder: LogSinkPuppetStopInterestListenerResponder {
1470                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1471                                tx_id: header.tx_id,
1472                            },
1473                        })
1474                    }
1475                    _ => Err(fidl::Error::UnknownOrdinal {
1476                        ordinal: header.ordinal,
1477                        protocol_name:
1478                            <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1479                    }),
1480                }))
1481            },
1482        )
1483    }
1484}
1485
1486#[derive(Debug)]
1487pub enum LogSinkPuppetRequest {
1488    /// Returns the information the puppet knows about itself.
1489    GetInfo { responder: LogSinkPuppetGetInfoResponder },
1490    /// Logs a record.
1491    EmitLog { spec: RecordSpec, responder: LogSinkPuppetEmitLogResponder },
1492    /// Disables the interest listener
1493    StopInterestListener { responder: LogSinkPuppetStopInterestListenerResponder },
1494}
1495
1496impl LogSinkPuppetRequest {
1497    #[allow(irrefutable_let_patterns)]
1498    pub fn into_get_info(self) -> Option<(LogSinkPuppetGetInfoResponder)> {
1499        if let LogSinkPuppetRequest::GetInfo { responder } = self {
1500            Some((responder))
1501        } else {
1502            None
1503        }
1504    }
1505
1506    #[allow(irrefutable_let_patterns)]
1507    pub fn into_emit_log(self) -> Option<(RecordSpec, LogSinkPuppetEmitLogResponder)> {
1508        if let LogSinkPuppetRequest::EmitLog { spec, responder } = self {
1509            Some((spec, responder))
1510        } else {
1511            None
1512        }
1513    }
1514
1515    #[allow(irrefutable_let_patterns)]
1516    pub fn into_stop_interest_listener(
1517        self,
1518    ) -> Option<(LogSinkPuppetStopInterestListenerResponder)> {
1519        if let LogSinkPuppetRequest::StopInterestListener { responder } = self {
1520            Some((responder))
1521        } else {
1522            None
1523        }
1524    }
1525
1526    /// Name of the method defined in FIDL
1527    pub fn method_name(&self) -> &'static str {
1528        match *self {
1529            LogSinkPuppetRequest::GetInfo { .. } => "get_info",
1530            LogSinkPuppetRequest::EmitLog { .. } => "emit_log",
1531            LogSinkPuppetRequest::StopInterestListener { .. } => "stop_interest_listener",
1532        }
1533    }
1534}
1535
1536#[derive(Debug, Clone)]
1537pub struct LogSinkPuppetControlHandle {
1538    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1539}
1540
1541impl fidl::endpoints::ControlHandle for LogSinkPuppetControlHandle {
1542    fn shutdown(&self) {
1543        self.inner.shutdown()
1544    }
1545    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1546        self.inner.shutdown_with_epitaph(status)
1547    }
1548
1549    fn is_closed(&self) -> bool {
1550        self.inner.channel().is_closed()
1551    }
1552    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1553        self.inner.channel().on_closed()
1554    }
1555
1556    #[cfg(target_os = "fuchsia")]
1557    fn signal_peer(
1558        &self,
1559        clear_mask: zx::Signals,
1560        set_mask: zx::Signals,
1561    ) -> Result<(), zx_status::Status> {
1562        use fidl::Peered;
1563        self.inner.channel().signal_peer(clear_mask, set_mask)
1564    }
1565}
1566
1567impl LogSinkPuppetControlHandle {}
1568
1569#[must_use = "FIDL methods require a response to be sent"]
1570#[derive(Debug)]
1571pub struct LogSinkPuppetGetInfoResponder {
1572    control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
1573    tx_id: u32,
1574}
1575
1576/// Set the the channel to be shutdown (see [`LogSinkPuppetControlHandle::shutdown`])
1577/// if the responder is dropped without sending a response, so that the client
1578/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1579impl std::ops::Drop for LogSinkPuppetGetInfoResponder {
1580    fn drop(&mut self) {
1581        self.control_handle.shutdown();
1582        // Safety: drops once, never accessed again
1583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1584    }
1585}
1586
1587impl fidl::endpoints::Responder for LogSinkPuppetGetInfoResponder {
1588    type ControlHandle = LogSinkPuppetControlHandle;
1589
1590    fn control_handle(&self) -> &LogSinkPuppetControlHandle {
1591        &self.control_handle
1592    }
1593
1594    fn drop_without_shutdown(mut self) {
1595        // Safety: drops once, never accessed again due to mem::forget
1596        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1597        // Prevent Drop from running (which would shut down the channel)
1598        std::mem::forget(self);
1599    }
1600}
1601
1602impl LogSinkPuppetGetInfoResponder {
1603    /// Sends a response to the FIDL transaction.
1604    ///
1605    /// Sets the channel to shutdown if an error occurs.
1606    pub fn send(self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
1607        let _result = self.send_raw(info);
1608        if _result.is_err() {
1609            self.control_handle.shutdown();
1610        }
1611        self.drop_without_shutdown();
1612        _result
1613    }
1614
1615    /// Similar to "send" but does not shutdown the channel if an error occurs.
1616    pub fn send_no_shutdown_on_err(self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
1617        let _result = self.send_raw(info);
1618        self.drop_without_shutdown();
1619        _result
1620    }
1621
1622    fn send_raw(&self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
1623        self.control_handle.inner.send::<LogSinkPuppetGetInfoResponse>(
1624            (info,),
1625            self.tx_id,
1626            0x5b1c3dac76c26425,
1627            fidl::encoding::DynamicFlags::empty(),
1628        )
1629    }
1630}
1631
1632#[must_use = "FIDL methods require a response to be sent"]
1633#[derive(Debug)]
1634pub struct LogSinkPuppetEmitLogResponder {
1635    control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
1636    tx_id: u32,
1637}
1638
1639/// Set the the channel to be shutdown (see [`LogSinkPuppetControlHandle::shutdown`])
1640/// if the responder is dropped without sending a response, so that the client
1641/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1642impl std::ops::Drop for LogSinkPuppetEmitLogResponder {
1643    fn drop(&mut self) {
1644        self.control_handle.shutdown();
1645        // Safety: drops once, never accessed again
1646        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1647    }
1648}
1649
1650impl fidl::endpoints::Responder for LogSinkPuppetEmitLogResponder {
1651    type ControlHandle = LogSinkPuppetControlHandle;
1652
1653    fn control_handle(&self) -> &LogSinkPuppetControlHandle {
1654        &self.control_handle
1655    }
1656
1657    fn drop_without_shutdown(mut self) {
1658        // Safety: drops once, never accessed again due to mem::forget
1659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1660        // Prevent Drop from running (which would shut down the channel)
1661        std::mem::forget(self);
1662    }
1663}
1664
1665impl LogSinkPuppetEmitLogResponder {
1666    /// Sends a response to the FIDL transaction.
1667    ///
1668    /// Sets the channel to shutdown if an error occurs.
1669    pub fn send(self) -> Result<(), fidl::Error> {
1670        let _result = self.send_raw();
1671        if _result.is_err() {
1672            self.control_handle.shutdown();
1673        }
1674        self.drop_without_shutdown();
1675        _result
1676    }
1677
1678    /// Similar to "send" but does not shutdown the channel if an error occurs.
1679    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1680        let _result = self.send_raw();
1681        self.drop_without_shutdown();
1682        _result
1683    }
1684
1685    fn send_raw(&self) -> Result<(), fidl::Error> {
1686        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1687            (),
1688            self.tx_id,
1689            0x58b64b6672ed66de,
1690            fidl::encoding::DynamicFlags::empty(),
1691        )
1692    }
1693}
1694
1695#[must_use = "FIDL methods require a response to be sent"]
1696#[derive(Debug)]
1697pub struct LogSinkPuppetStopInterestListenerResponder {
1698    control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
1699    tx_id: u32,
1700}
1701
1702/// Set the the channel to be shutdown (see [`LogSinkPuppetControlHandle::shutdown`])
1703/// if the responder is dropped without sending a response, so that the client
1704/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1705impl std::ops::Drop for LogSinkPuppetStopInterestListenerResponder {
1706    fn drop(&mut self) {
1707        self.control_handle.shutdown();
1708        // Safety: drops once, never accessed again
1709        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1710    }
1711}
1712
1713impl fidl::endpoints::Responder for LogSinkPuppetStopInterestListenerResponder {
1714    type ControlHandle = LogSinkPuppetControlHandle;
1715
1716    fn control_handle(&self) -> &LogSinkPuppetControlHandle {
1717        &self.control_handle
1718    }
1719
1720    fn drop_without_shutdown(mut self) {
1721        // Safety: drops once, never accessed again due to mem::forget
1722        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1723        // Prevent Drop from running (which would shut down the channel)
1724        std::mem::forget(self);
1725    }
1726}
1727
1728impl LogSinkPuppetStopInterestListenerResponder {
1729    /// Sends a response to the FIDL transaction.
1730    ///
1731    /// Sets the channel to shutdown if an error occurs.
1732    pub fn send(self) -> Result<(), fidl::Error> {
1733        let _result = self.send_raw();
1734        if _result.is_err() {
1735            self.control_handle.shutdown();
1736        }
1737        self.drop_without_shutdown();
1738        _result
1739    }
1740
1741    /// Similar to "send" but does not shutdown the channel if an error occurs.
1742    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1743        let _result = self.send_raw();
1744        self.drop_without_shutdown();
1745        _result
1746    }
1747
1748    fn send_raw(&self) -> Result<(), fidl::Error> {
1749        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1750            (),
1751            self.tx_id,
1752            0x4c69520a50828cbd,
1753            fidl::encoding::DynamicFlags::empty(),
1754        )
1755    }
1756}
1757
1758#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1759pub struct ValidateResultsIteratorMarker;
1760
1761impl fidl::endpoints::ProtocolMarker for ValidateResultsIteratorMarker {
1762    type Proxy = ValidateResultsIteratorProxy;
1763    type RequestStream = ValidateResultsIteratorRequestStream;
1764    #[cfg(target_os = "fuchsia")]
1765    type SynchronousProxy = ValidateResultsIteratorSynchronousProxy;
1766
1767    const DEBUG_NAME: &'static str = "(anonymous) ValidateResultsIterator";
1768}
1769
1770pub trait ValidateResultsIteratorProxyInterface: Send + Sync {
1771    type GetNextResponseFut: std::future::Future<Output = Result<ValidateResultsIteratorGetNextResponse, fidl::Error>>
1772        + Send;
1773    fn r#get_next(&self) -> Self::GetNextResponseFut;
1774}
1775#[derive(Debug)]
1776#[cfg(target_os = "fuchsia")]
1777pub struct ValidateResultsIteratorSynchronousProxy {
1778    client: fidl::client::sync::Client,
1779}
1780
1781#[cfg(target_os = "fuchsia")]
1782impl fidl::endpoints::SynchronousProxy for ValidateResultsIteratorSynchronousProxy {
1783    type Proxy = ValidateResultsIteratorProxy;
1784    type Protocol = ValidateResultsIteratorMarker;
1785
1786    fn from_channel(inner: fidl::Channel) -> Self {
1787        Self::new(inner)
1788    }
1789
1790    fn into_channel(self) -> fidl::Channel {
1791        self.client.into_channel()
1792    }
1793
1794    fn as_channel(&self) -> &fidl::Channel {
1795        self.client.as_channel()
1796    }
1797}
1798
1799#[cfg(target_os = "fuchsia")]
1800impl ValidateResultsIteratorSynchronousProxy {
1801    pub fn new(channel: fidl::Channel) -> Self {
1802        let protocol_name =
1803            <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1804        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1805    }
1806
1807    pub fn into_channel(self) -> fidl::Channel {
1808        self.client.into_channel()
1809    }
1810
1811    /// Waits until an event arrives and returns it. It is safe for other
1812    /// threads to make concurrent requests while waiting for an event.
1813    pub fn wait_for_event(
1814        &self,
1815        deadline: zx::MonotonicInstant,
1816    ) -> Result<ValidateResultsIteratorEvent, fidl::Error> {
1817        ValidateResultsIteratorEvent::decode(self.client.wait_for_event(deadline)?)
1818    }
1819
1820    /// Returns the result of a test case execution.
1821    pub fn r#get_next(
1822        &self,
1823        ___deadline: zx::MonotonicInstant,
1824    ) -> Result<ValidateResultsIteratorGetNextResponse, fidl::Error> {
1825        let _response = self
1826            .client
1827            .send_query::<fidl::encoding::EmptyPayload, ValidateResultsIteratorGetNextResponse>(
1828                (),
1829                0x1b1573e93311e8b7,
1830                fidl::encoding::DynamicFlags::empty(),
1831                ___deadline,
1832            )?;
1833        Ok(_response)
1834    }
1835}
1836
1837#[derive(Debug, Clone)]
1838pub struct ValidateResultsIteratorProxy {
1839    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1840}
1841
1842impl fidl::endpoints::Proxy for ValidateResultsIteratorProxy {
1843    type Protocol = ValidateResultsIteratorMarker;
1844
1845    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1846        Self::new(inner)
1847    }
1848
1849    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1850        self.client.into_channel().map_err(|client| Self { client })
1851    }
1852
1853    fn as_channel(&self) -> &::fidl::AsyncChannel {
1854        self.client.as_channel()
1855    }
1856}
1857
1858impl ValidateResultsIteratorProxy {
1859    /// Create a new Proxy for fuchsia.validate.logs/ValidateResultsIterator.
1860    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1861        let protocol_name =
1862            <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1863        Self { client: fidl::client::Client::new(channel, protocol_name) }
1864    }
1865
1866    /// Get a Stream of events from the remote end of the protocol.
1867    ///
1868    /// # Panics
1869    ///
1870    /// Panics if the event stream was already taken.
1871    pub fn take_event_stream(&self) -> ValidateResultsIteratorEventStream {
1872        ValidateResultsIteratorEventStream { event_receiver: self.client.take_event_receiver() }
1873    }
1874
1875    /// Returns the result of a test case execution.
1876    pub fn r#get_next(
1877        &self,
1878    ) -> fidl::client::QueryResponseFut<
1879        ValidateResultsIteratorGetNextResponse,
1880        fidl::encoding::DefaultFuchsiaResourceDialect,
1881    > {
1882        ValidateResultsIteratorProxyInterface::r#get_next(self)
1883    }
1884}
1885
1886impl ValidateResultsIteratorProxyInterface for ValidateResultsIteratorProxy {
1887    type GetNextResponseFut = fidl::client::QueryResponseFut<
1888        ValidateResultsIteratorGetNextResponse,
1889        fidl::encoding::DefaultFuchsiaResourceDialect,
1890    >;
1891    fn r#get_next(&self) -> Self::GetNextResponseFut {
1892        fn _decode(
1893            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1894        ) -> Result<ValidateResultsIteratorGetNextResponse, fidl::Error> {
1895            let _response = fidl::client::decode_transaction_body::<
1896                ValidateResultsIteratorGetNextResponse,
1897                fidl::encoding::DefaultFuchsiaResourceDialect,
1898                0x1b1573e93311e8b7,
1899            >(_buf?)?;
1900            Ok(_response)
1901        }
1902        self.client.send_query_and_decode::<
1903            fidl::encoding::EmptyPayload,
1904            ValidateResultsIteratorGetNextResponse,
1905        >(
1906            (),
1907            0x1b1573e93311e8b7,
1908            fidl::encoding::DynamicFlags::empty(),
1909            _decode,
1910        )
1911    }
1912}
1913
1914pub struct ValidateResultsIteratorEventStream {
1915    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1916}
1917
1918impl std::marker::Unpin for ValidateResultsIteratorEventStream {}
1919
1920impl futures::stream::FusedStream for ValidateResultsIteratorEventStream {
1921    fn is_terminated(&self) -> bool {
1922        self.event_receiver.is_terminated()
1923    }
1924}
1925
1926impl futures::Stream for ValidateResultsIteratorEventStream {
1927    type Item = Result<ValidateResultsIteratorEvent, fidl::Error>;
1928
1929    fn poll_next(
1930        mut self: std::pin::Pin<&mut Self>,
1931        cx: &mut std::task::Context<'_>,
1932    ) -> std::task::Poll<Option<Self::Item>> {
1933        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1934            &mut self.event_receiver,
1935            cx
1936        )?) {
1937            Some(buf) => std::task::Poll::Ready(Some(ValidateResultsIteratorEvent::decode(buf))),
1938            None => std::task::Poll::Ready(None),
1939        }
1940    }
1941}
1942
1943#[derive(Debug)]
1944pub enum ValidateResultsIteratorEvent {}
1945
1946impl ValidateResultsIteratorEvent {
1947    /// Decodes a message buffer as a [`ValidateResultsIteratorEvent`].
1948    fn decode(
1949        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1950    ) -> Result<ValidateResultsIteratorEvent, fidl::Error> {
1951        let (bytes, _handles) = buf.split_mut();
1952        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1953        debug_assert_eq!(tx_header.tx_id, 0);
1954        match tx_header.ordinal {
1955            _ => Err(fidl::Error::UnknownOrdinal {
1956                ordinal: tx_header.ordinal,
1957                protocol_name:
1958                    <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1959            }),
1960        }
1961    }
1962}
1963
1964/// A Stream of incoming requests for fuchsia.validate.logs/ValidateResultsIterator.
1965pub struct ValidateResultsIteratorRequestStream {
1966    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1967    is_terminated: bool,
1968}
1969
1970impl std::marker::Unpin for ValidateResultsIteratorRequestStream {}
1971
1972impl futures::stream::FusedStream for ValidateResultsIteratorRequestStream {
1973    fn is_terminated(&self) -> bool {
1974        self.is_terminated
1975    }
1976}
1977
1978impl fidl::endpoints::RequestStream for ValidateResultsIteratorRequestStream {
1979    type Protocol = ValidateResultsIteratorMarker;
1980    type ControlHandle = ValidateResultsIteratorControlHandle;
1981
1982    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1983        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1984    }
1985
1986    fn control_handle(&self) -> Self::ControlHandle {
1987        ValidateResultsIteratorControlHandle { inner: self.inner.clone() }
1988    }
1989
1990    fn into_inner(
1991        self,
1992    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1993    {
1994        (self.inner, self.is_terminated)
1995    }
1996
1997    fn from_inner(
1998        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1999        is_terminated: bool,
2000    ) -> Self {
2001        Self { inner, is_terminated }
2002    }
2003}
2004
2005impl futures::Stream for ValidateResultsIteratorRequestStream {
2006    type Item = Result<ValidateResultsIteratorRequest, fidl::Error>;
2007
2008    fn poll_next(
2009        mut self: std::pin::Pin<&mut Self>,
2010        cx: &mut std::task::Context<'_>,
2011    ) -> std::task::Poll<Option<Self::Item>> {
2012        let this = &mut *self;
2013        if this.inner.check_shutdown(cx) {
2014            this.is_terminated = true;
2015            return std::task::Poll::Ready(None);
2016        }
2017        if this.is_terminated {
2018            panic!("polled ValidateResultsIteratorRequestStream after completion");
2019        }
2020        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2021            |bytes, handles| {
2022                match this.inner.channel().read_etc(cx, bytes, handles) {
2023                    std::task::Poll::Ready(Ok(())) => {}
2024                    std::task::Poll::Pending => return std::task::Poll::Pending,
2025                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2026                        this.is_terminated = true;
2027                        return std::task::Poll::Ready(None);
2028                    }
2029                    std::task::Poll::Ready(Err(e)) => {
2030                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2031                            e.into(),
2032                        ))))
2033                    }
2034                }
2035
2036                // A message has been received from the channel
2037                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2038
2039                std::task::Poll::Ready(Some(match header.ordinal {
2040                0x1b1573e93311e8b7 => {
2041                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2042                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2043                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2044                    let control_handle = ValidateResultsIteratorControlHandle {
2045                        inner: this.inner.clone(),
2046                    };
2047                    Ok(ValidateResultsIteratorRequest::GetNext {
2048                        responder: ValidateResultsIteratorGetNextResponder {
2049                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2050                            tx_id: header.tx_id,
2051                        },
2052                    })
2053                }
2054                _ => Err(fidl::Error::UnknownOrdinal {
2055                    ordinal: header.ordinal,
2056                    protocol_name: <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2057                }),
2058            }))
2059            },
2060        )
2061    }
2062}
2063
2064#[derive(Debug)]
2065pub enum ValidateResultsIteratorRequest {
2066    /// Returns the result of a test case execution.
2067    GetNext { responder: ValidateResultsIteratorGetNextResponder },
2068}
2069
2070impl ValidateResultsIteratorRequest {
2071    #[allow(irrefutable_let_patterns)]
2072    pub fn into_get_next(self) -> Option<(ValidateResultsIteratorGetNextResponder)> {
2073        if let ValidateResultsIteratorRequest::GetNext { responder } = self {
2074            Some((responder))
2075        } else {
2076            None
2077        }
2078    }
2079
2080    /// Name of the method defined in FIDL
2081    pub fn method_name(&self) -> &'static str {
2082        match *self {
2083            ValidateResultsIteratorRequest::GetNext { .. } => "get_next",
2084        }
2085    }
2086}
2087
2088#[derive(Debug, Clone)]
2089pub struct ValidateResultsIteratorControlHandle {
2090    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2091}
2092
2093impl fidl::endpoints::ControlHandle for ValidateResultsIteratorControlHandle {
2094    fn shutdown(&self) {
2095        self.inner.shutdown()
2096    }
2097    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2098        self.inner.shutdown_with_epitaph(status)
2099    }
2100
2101    fn is_closed(&self) -> bool {
2102        self.inner.channel().is_closed()
2103    }
2104    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2105        self.inner.channel().on_closed()
2106    }
2107
2108    #[cfg(target_os = "fuchsia")]
2109    fn signal_peer(
2110        &self,
2111        clear_mask: zx::Signals,
2112        set_mask: zx::Signals,
2113    ) -> Result<(), zx_status::Status> {
2114        use fidl::Peered;
2115        self.inner.channel().signal_peer(clear_mask, set_mask)
2116    }
2117}
2118
2119impl ValidateResultsIteratorControlHandle {}
2120
2121#[must_use = "FIDL methods require a response to be sent"]
2122#[derive(Debug)]
2123pub struct ValidateResultsIteratorGetNextResponder {
2124    control_handle: std::mem::ManuallyDrop<ValidateResultsIteratorControlHandle>,
2125    tx_id: u32,
2126}
2127
2128/// Set the the channel to be shutdown (see [`ValidateResultsIteratorControlHandle::shutdown`])
2129/// if the responder is dropped without sending a response, so that the client
2130/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2131impl std::ops::Drop for ValidateResultsIteratorGetNextResponder {
2132    fn drop(&mut self) {
2133        self.control_handle.shutdown();
2134        // Safety: drops once, never accessed again
2135        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2136    }
2137}
2138
2139impl fidl::endpoints::Responder for ValidateResultsIteratorGetNextResponder {
2140    type ControlHandle = ValidateResultsIteratorControlHandle;
2141
2142    fn control_handle(&self) -> &ValidateResultsIteratorControlHandle {
2143        &self.control_handle
2144    }
2145
2146    fn drop_without_shutdown(mut self) {
2147        // Safety: drops once, never accessed again due to mem::forget
2148        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2149        // Prevent Drop from running (which would shut down the channel)
2150        std::mem::forget(self);
2151    }
2152}
2153
2154impl ValidateResultsIteratorGetNextResponder {
2155    /// Sends a response to the FIDL transaction.
2156    ///
2157    /// Sets the channel to shutdown if an error occurs.
2158    pub fn send(
2159        self,
2160        mut payload: ValidateResultsIteratorGetNextResponse,
2161    ) -> Result<(), fidl::Error> {
2162        let _result = self.send_raw(payload);
2163        if _result.is_err() {
2164            self.control_handle.shutdown();
2165        }
2166        self.drop_without_shutdown();
2167        _result
2168    }
2169
2170    /// Similar to "send" but does not shutdown the channel if an error occurs.
2171    pub fn send_no_shutdown_on_err(
2172        self,
2173        mut payload: ValidateResultsIteratorGetNextResponse,
2174    ) -> Result<(), fidl::Error> {
2175        let _result = self.send_raw(payload);
2176        self.drop_without_shutdown();
2177        _result
2178    }
2179
2180    fn send_raw(
2181        &self,
2182        mut payload: ValidateResultsIteratorGetNextResponse,
2183    ) -> Result<(), fidl::Error> {
2184        self.control_handle.inner.send::<ValidateResultsIteratorGetNextResponse>(
2185            &mut payload,
2186            self.tx_id,
2187            0x1b1573e93311e8b7,
2188            fidl::encoding::DynamicFlags::empty(),
2189        )
2190    }
2191}
2192
2193mod internal {
2194    use super::*;
2195    unsafe impl fidl::encoding::TypeMarker for PuppetError {
2196        type Owned = Self;
2197
2198        #[inline(always)]
2199        fn inline_align(_context: fidl::encoding::Context) -> usize {
2200            std::mem::align_of::<u32>()
2201        }
2202
2203        #[inline(always)]
2204        fn inline_size(_context: fidl::encoding::Context) -> usize {
2205            std::mem::size_of::<u32>()
2206        }
2207
2208        #[inline(always)]
2209        fn encode_is_copy() -> bool {
2210            true
2211        }
2212
2213        #[inline(always)]
2214        fn decode_is_copy() -> bool {
2215            false
2216        }
2217    }
2218
2219    impl fidl::encoding::ValueTypeMarker for PuppetError {
2220        type Borrowed<'a> = Self;
2221        #[inline(always)]
2222        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2223            *value
2224        }
2225    }
2226
2227    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PuppetError {
2228        #[inline]
2229        unsafe fn encode(
2230            self,
2231            encoder: &mut fidl::encoding::Encoder<'_, D>,
2232            offset: usize,
2233            _depth: fidl::encoding::Depth,
2234        ) -> fidl::Result<()> {
2235            encoder.debug_check_bounds::<Self>(offset);
2236            encoder.write_num(self.into_primitive(), offset);
2237            Ok(())
2238        }
2239    }
2240
2241    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PuppetError {
2242        #[inline(always)]
2243        fn new_empty() -> Self {
2244            Self::UnsupportedRecord
2245        }
2246
2247        #[inline]
2248        unsafe fn decode(
2249            &mut self,
2250            decoder: &mut fidl::encoding::Decoder<'_, D>,
2251            offset: usize,
2252            _depth: fidl::encoding::Depth,
2253        ) -> fidl::Result<()> {
2254            decoder.debug_check_bounds::<Self>(offset);
2255            let prim = decoder.read_num::<u32>(offset);
2256
2257            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2258            Ok(())
2259        }
2260    }
2261
2262    impl fidl::encoding::ValueTypeMarker for Argument {
2263        type Borrowed<'a> = &'a Self;
2264        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2265            value
2266        }
2267    }
2268
2269    unsafe impl fidl::encoding::TypeMarker for Argument {
2270        type Owned = Self;
2271
2272        #[inline(always)]
2273        fn inline_align(_context: fidl::encoding::Context) -> usize {
2274            8
2275        }
2276
2277        #[inline(always)]
2278        fn inline_size(_context: fidl::encoding::Context) -> usize {
2279            32
2280        }
2281    }
2282
2283    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Argument, D> for &Argument {
2284        #[inline]
2285        unsafe fn encode(
2286            self,
2287            encoder: &mut fidl::encoding::Encoder<'_, D>,
2288            offset: usize,
2289            _depth: fidl::encoding::Depth,
2290        ) -> fidl::Result<()> {
2291            encoder.debug_check_bounds::<Argument>(offset);
2292            // Delegate to tuple encoding.
2293            fidl::encoding::Encode::<Argument, D>::encode(
2294                (
2295                    <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
2296                        &self.name,
2297                    ),
2298                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2299                ),
2300                encoder,
2301                offset,
2302                _depth,
2303            )
2304        }
2305    }
2306    unsafe impl<
2307            D: fidl::encoding::ResourceDialect,
2308            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
2309            T1: fidl::encoding::Encode<Value, D>,
2310        > fidl::encoding::Encode<Argument, D> for (T0, T1)
2311    {
2312        #[inline]
2313        unsafe fn encode(
2314            self,
2315            encoder: &mut fidl::encoding::Encoder<'_, D>,
2316            offset: usize,
2317            depth: fidl::encoding::Depth,
2318        ) -> fidl::Result<()> {
2319            encoder.debug_check_bounds::<Argument>(offset);
2320            // Zero out padding regions. There's no need to apply masks
2321            // because the unmasked parts will be overwritten by fields.
2322            // Write the fields.
2323            self.0.encode(encoder, offset + 0, depth)?;
2324            self.1.encode(encoder, offset + 16, depth)?;
2325            Ok(())
2326        }
2327    }
2328
2329    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Argument {
2330        #[inline(always)]
2331        fn new_empty() -> Self {
2332            Self {
2333                name: fidl::new_empty!(fidl::encoding::BoundedString<256>, D),
2334                value: fidl::new_empty!(Value, D),
2335            }
2336        }
2337
2338        #[inline]
2339        unsafe fn decode(
2340            &mut self,
2341            decoder: &mut fidl::encoding::Decoder<'_, D>,
2342            offset: usize,
2343            _depth: fidl::encoding::Depth,
2344        ) -> fidl::Result<()> {
2345            decoder.debug_check_bounds::<Self>(offset);
2346            // Verify that padding bytes are zero.
2347            fidl::decode!(
2348                fidl::encoding::BoundedString<256>,
2349                D,
2350                &mut self.name,
2351                decoder,
2352                offset + 0,
2353                _depth
2354            )?;
2355            fidl::decode!(Value, D, &mut self.value, decoder, offset + 16, _depth)?;
2356            Ok(())
2357        }
2358    }
2359
2360    impl fidl::encoding::ValueTypeMarker for EncodingPuppetEncodeRequest {
2361        type Borrowed<'a> = &'a Self;
2362        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2363            value
2364        }
2365    }
2366
2367    unsafe impl fidl::encoding::TypeMarker for EncodingPuppetEncodeRequest {
2368        type Owned = Self;
2369
2370        #[inline(always)]
2371        fn inline_align(_context: fidl::encoding::Context) -> usize {
2372            8
2373        }
2374
2375        #[inline(always)]
2376        fn inline_size(_context: fidl::encoding::Context) -> usize {
2377            32
2378        }
2379    }
2380
2381    unsafe impl<D: fidl::encoding::ResourceDialect>
2382        fidl::encoding::Encode<EncodingPuppetEncodeRequest, D> for &EncodingPuppetEncodeRequest
2383    {
2384        #[inline]
2385        unsafe fn encode(
2386            self,
2387            encoder: &mut fidl::encoding::Encoder<'_, D>,
2388            offset: usize,
2389            _depth: fidl::encoding::Depth,
2390        ) -> fidl::Result<()> {
2391            encoder.debug_check_bounds::<EncodingPuppetEncodeRequest>(offset);
2392            // Delegate to tuple encoding.
2393            fidl::encoding::Encode::<EncodingPuppetEncodeRequest, D>::encode(
2394                (<Record as fidl::encoding::ValueTypeMarker>::borrow(&self.record),),
2395                encoder,
2396                offset,
2397                _depth,
2398            )
2399        }
2400    }
2401    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Record, D>>
2402        fidl::encoding::Encode<EncodingPuppetEncodeRequest, D> for (T0,)
2403    {
2404        #[inline]
2405        unsafe fn encode(
2406            self,
2407            encoder: &mut fidl::encoding::Encoder<'_, D>,
2408            offset: usize,
2409            depth: fidl::encoding::Depth,
2410        ) -> fidl::Result<()> {
2411            encoder.debug_check_bounds::<EncodingPuppetEncodeRequest>(offset);
2412            // Zero out padding regions. There's no need to apply masks
2413            // because the unmasked parts will be overwritten by fields.
2414            // Write the fields.
2415            self.0.encode(encoder, offset + 0, depth)?;
2416            Ok(())
2417        }
2418    }
2419
2420    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2421        for EncodingPuppetEncodeRequest
2422    {
2423        #[inline(always)]
2424        fn new_empty() -> Self {
2425            Self { record: fidl::new_empty!(Record, D) }
2426        }
2427
2428        #[inline]
2429        unsafe fn decode(
2430            &mut self,
2431            decoder: &mut fidl::encoding::Decoder<'_, D>,
2432            offset: usize,
2433            _depth: fidl::encoding::Depth,
2434        ) -> fidl::Result<()> {
2435            decoder.debug_check_bounds::<Self>(offset);
2436            // Verify that padding bytes are zero.
2437            fidl::decode!(Record, D, &mut self.record, decoder, offset + 0, _depth)?;
2438            Ok(())
2439        }
2440    }
2441
2442    impl fidl::encoding::ResourceTypeMarker for EncodingPuppetEncodeResponse {
2443        type Borrowed<'a> = &'a mut Self;
2444        fn take_or_borrow<'a>(
2445            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2446        ) -> Self::Borrowed<'a> {
2447            value
2448        }
2449    }
2450
2451    unsafe impl fidl::encoding::TypeMarker for EncodingPuppetEncodeResponse {
2452        type Owned = Self;
2453
2454        #[inline(always)]
2455        fn inline_align(_context: fidl::encoding::Context) -> usize {
2456            8
2457        }
2458
2459        #[inline(always)]
2460        fn inline_size(_context: fidl::encoding::Context) -> usize {
2461            16
2462        }
2463    }
2464
2465    unsafe impl
2466        fidl::encoding::Encode<
2467            EncodingPuppetEncodeResponse,
2468            fidl::encoding::DefaultFuchsiaResourceDialect,
2469        > for &mut EncodingPuppetEncodeResponse
2470    {
2471        #[inline]
2472        unsafe fn encode(
2473            self,
2474            encoder: &mut fidl::encoding::Encoder<
2475                '_,
2476                fidl::encoding::DefaultFuchsiaResourceDialect,
2477            >,
2478            offset: usize,
2479            _depth: fidl::encoding::Depth,
2480        ) -> fidl::Result<()> {
2481            encoder.debug_check_bounds::<EncodingPuppetEncodeResponse>(offset);
2482            // Delegate to tuple encoding.
2483            fidl::encoding::Encode::<
2484                EncodingPuppetEncodeResponse,
2485                fidl::encoding::DefaultFuchsiaResourceDialect,
2486            >::encode(
2487                (<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2488                    &mut self.result,
2489                ),),
2490                encoder,
2491                offset,
2492                _depth,
2493            )
2494        }
2495    }
2496    unsafe impl<
2497            T0: fidl::encoding::Encode<
2498                fidl_fuchsia_mem::Buffer,
2499                fidl::encoding::DefaultFuchsiaResourceDialect,
2500            >,
2501        >
2502        fidl::encoding::Encode<
2503            EncodingPuppetEncodeResponse,
2504            fidl::encoding::DefaultFuchsiaResourceDialect,
2505        > for (T0,)
2506    {
2507        #[inline]
2508        unsafe fn encode(
2509            self,
2510            encoder: &mut fidl::encoding::Encoder<
2511                '_,
2512                fidl::encoding::DefaultFuchsiaResourceDialect,
2513            >,
2514            offset: usize,
2515            depth: fidl::encoding::Depth,
2516        ) -> fidl::Result<()> {
2517            encoder.debug_check_bounds::<EncodingPuppetEncodeResponse>(offset);
2518            // Zero out padding regions. There's no need to apply masks
2519            // because the unmasked parts will be overwritten by fields.
2520            // Write the fields.
2521            self.0.encode(encoder, offset + 0, depth)?;
2522            Ok(())
2523        }
2524    }
2525
2526    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2527        for EncodingPuppetEncodeResponse
2528    {
2529        #[inline(always)]
2530        fn new_empty() -> Self {
2531            Self {
2532                result: fidl::new_empty!(
2533                    fidl_fuchsia_mem::Buffer,
2534                    fidl::encoding::DefaultFuchsiaResourceDialect
2535                ),
2536            }
2537        }
2538
2539        #[inline]
2540        unsafe fn decode(
2541            &mut self,
2542            decoder: &mut fidl::encoding::Decoder<
2543                '_,
2544                fidl::encoding::DefaultFuchsiaResourceDialect,
2545            >,
2546            offset: usize,
2547            _depth: fidl::encoding::Depth,
2548        ) -> fidl::Result<()> {
2549            decoder.debug_check_bounds::<Self>(offset);
2550            // Verify that padding bytes are zero.
2551            fidl::decode!(
2552                fidl_fuchsia_mem::Buffer,
2553                fidl::encoding::DefaultFuchsiaResourceDialect,
2554                &mut self.result,
2555                decoder,
2556                offset + 0,
2557                _depth
2558            )?;
2559            Ok(())
2560        }
2561    }
2562
2563    impl fidl::encoding::ResourceTypeMarker for EncodingValidatorValidateRequest {
2564        type Borrowed<'a> = &'a mut Self;
2565        fn take_or_borrow<'a>(
2566            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2567        ) -> Self::Borrowed<'a> {
2568            value
2569        }
2570    }
2571
2572    unsafe impl fidl::encoding::TypeMarker for EncodingValidatorValidateRequest {
2573        type Owned = Self;
2574
2575        #[inline(always)]
2576        fn inline_align(_context: fidl::encoding::Context) -> usize {
2577            4
2578        }
2579
2580        #[inline(always)]
2581        fn inline_size(_context: fidl::encoding::Context) -> usize {
2582            4
2583        }
2584    }
2585
2586    unsafe impl
2587        fidl::encoding::Encode<
2588            EncodingValidatorValidateRequest,
2589            fidl::encoding::DefaultFuchsiaResourceDialect,
2590        > for &mut EncodingValidatorValidateRequest
2591    {
2592        #[inline]
2593        unsafe fn encode(
2594            self,
2595            encoder: &mut fidl::encoding::Encoder<
2596                '_,
2597                fidl::encoding::DefaultFuchsiaResourceDialect,
2598            >,
2599            offset: usize,
2600            _depth: fidl::encoding::Depth,
2601        ) -> fidl::Result<()> {
2602            encoder.debug_check_bounds::<EncodingValidatorValidateRequest>(offset);
2603            // Delegate to tuple encoding.
2604            fidl::encoding::Encode::<
2605                EncodingValidatorValidateRequest,
2606                fidl::encoding::DefaultFuchsiaResourceDialect,
2607            >::encode(
2608                (<fidl::encoding::Endpoint<
2609                    fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
2610                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2611                    &mut self.results
2612                ),),
2613                encoder,
2614                offset,
2615                _depth,
2616            )
2617        }
2618    }
2619    unsafe impl<
2620            T0: fidl::encoding::Encode<
2621                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>>,
2622                fidl::encoding::DefaultFuchsiaResourceDialect,
2623            >,
2624        >
2625        fidl::encoding::Encode<
2626            EncodingValidatorValidateRequest,
2627            fidl::encoding::DefaultFuchsiaResourceDialect,
2628        > for (T0,)
2629    {
2630        #[inline]
2631        unsafe fn encode(
2632            self,
2633            encoder: &mut fidl::encoding::Encoder<
2634                '_,
2635                fidl::encoding::DefaultFuchsiaResourceDialect,
2636            >,
2637            offset: usize,
2638            depth: fidl::encoding::Depth,
2639        ) -> fidl::Result<()> {
2640            encoder.debug_check_bounds::<EncodingValidatorValidateRequest>(offset);
2641            // Zero out padding regions. There's no need to apply masks
2642            // because the unmasked parts will be overwritten by fields.
2643            // Write the fields.
2644            self.0.encode(encoder, offset + 0, depth)?;
2645            Ok(())
2646        }
2647    }
2648
2649    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2650        for EncodingValidatorValidateRequest
2651    {
2652        #[inline(always)]
2653        fn new_empty() -> Self {
2654            Self {
2655                results: fidl::new_empty!(
2656                    fidl::encoding::Endpoint<
2657                        fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
2658                    >,
2659                    fidl::encoding::DefaultFuchsiaResourceDialect
2660                ),
2661            }
2662        }
2663
2664        #[inline]
2665        unsafe fn decode(
2666            &mut self,
2667            decoder: &mut fidl::encoding::Decoder<
2668                '_,
2669                fidl::encoding::DefaultFuchsiaResourceDialect,
2670            >,
2671            offset: usize,
2672            _depth: fidl::encoding::Depth,
2673        ) -> fidl::Result<()> {
2674            decoder.debug_check_bounds::<Self>(offset);
2675            // Verify that padding bytes are zero.
2676            fidl::decode!(
2677                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>>,
2678                fidl::encoding::DefaultFuchsiaResourceDialect,
2679                &mut self.results,
2680                decoder,
2681                offset + 0,
2682                _depth
2683            )?;
2684            Ok(())
2685        }
2686    }
2687
2688    impl fidl::encoding::ValueTypeMarker for LogSinkPuppetEmitLogRequest {
2689        type Borrowed<'a> = &'a Self;
2690        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2691            value
2692        }
2693    }
2694
2695    unsafe impl fidl::encoding::TypeMarker for LogSinkPuppetEmitLogRequest {
2696        type Owned = Self;
2697
2698        #[inline(always)]
2699        fn inline_align(_context: fidl::encoding::Context) -> usize {
2700            8
2701        }
2702
2703        #[inline(always)]
2704        fn inline_size(_context: fidl::encoding::Context) -> usize {
2705            56
2706        }
2707    }
2708
2709    unsafe impl<D: fidl::encoding::ResourceDialect>
2710        fidl::encoding::Encode<LogSinkPuppetEmitLogRequest, D> for &LogSinkPuppetEmitLogRequest
2711    {
2712        #[inline]
2713        unsafe fn encode(
2714            self,
2715            encoder: &mut fidl::encoding::Encoder<'_, D>,
2716            offset: usize,
2717            _depth: fidl::encoding::Depth,
2718        ) -> fidl::Result<()> {
2719            encoder.debug_check_bounds::<LogSinkPuppetEmitLogRequest>(offset);
2720            // Delegate to tuple encoding.
2721            fidl::encoding::Encode::<LogSinkPuppetEmitLogRequest, D>::encode(
2722                (<RecordSpec as fidl::encoding::ValueTypeMarker>::borrow(&self.spec),),
2723                encoder,
2724                offset,
2725                _depth,
2726            )
2727        }
2728    }
2729    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RecordSpec, D>>
2730        fidl::encoding::Encode<LogSinkPuppetEmitLogRequest, D> for (T0,)
2731    {
2732        #[inline]
2733        unsafe fn encode(
2734            self,
2735            encoder: &mut fidl::encoding::Encoder<'_, D>,
2736            offset: usize,
2737            depth: fidl::encoding::Depth,
2738        ) -> fidl::Result<()> {
2739            encoder.debug_check_bounds::<LogSinkPuppetEmitLogRequest>(offset);
2740            // Zero out padding regions. There's no need to apply masks
2741            // because the unmasked parts will be overwritten by fields.
2742            // Write the fields.
2743            self.0.encode(encoder, offset + 0, depth)?;
2744            Ok(())
2745        }
2746    }
2747
2748    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2749        for LogSinkPuppetEmitLogRequest
2750    {
2751        #[inline(always)]
2752        fn new_empty() -> Self {
2753            Self { spec: fidl::new_empty!(RecordSpec, D) }
2754        }
2755
2756        #[inline]
2757        unsafe fn decode(
2758            &mut self,
2759            decoder: &mut fidl::encoding::Decoder<'_, D>,
2760            offset: usize,
2761            _depth: fidl::encoding::Depth,
2762        ) -> fidl::Result<()> {
2763            decoder.debug_check_bounds::<Self>(offset);
2764            // Verify that padding bytes are zero.
2765            fidl::decode!(RecordSpec, D, &mut self.spec, decoder, offset + 0, _depth)?;
2766            Ok(())
2767        }
2768    }
2769
2770    impl fidl::encoding::ValueTypeMarker for LogSinkPuppetGetInfoResponse {
2771        type Borrowed<'a> = &'a Self;
2772        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2773            value
2774        }
2775    }
2776
2777    unsafe impl fidl::encoding::TypeMarker for LogSinkPuppetGetInfoResponse {
2778        type Owned = Self;
2779
2780        #[inline(always)]
2781        fn inline_align(_context: fidl::encoding::Context) -> usize {
2782            8
2783        }
2784
2785        #[inline(always)]
2786        fn inline_size(_context: fidl::encoding::Context) -> usize {
2787            32
2788        }
2789    }
2790
2791    unsafe impl<D: fidl::encoding::ResourceDialect>
2792        fidl::encoding::Encode<LogSinkPuppetGetInfoResponse, D> for &LogSinkPuppetGetInfoResponse
2793    {
2794        #[inline]
2795        unsafe fn encode(
2796            self,
2797            encoder: &mut fidl::encoding::Encoder<'_, D>,
2798            offset: usize,
2799            _depth: fidl::encoding::Depth,
2800        ) -> fidl::Result<()> {
2801            encoder.debug_check_bounds::<LogSinkPuppetGetInfoResponse>(offset);
2802            // Delegate to tuple encoding.
2803            fidl::encoding::Encode::<LogSinkPuppetGetInfoResponse, D>::encode(
2804                (<PuppetInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2805                encoder,
2806                offset,
2807                _depth,
2808            )
2809        }
2810    }
2811    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PuppetInfo, D>>
2812        fidl::encoding::Encode<LogSinkPuppetGetInfoResponse, D> for (T0,)
2813    {
2814        #[inline]
2815        unsafe fn encode(
2816            self,
2817            encoder: &mut fidl::encoding::Encoder<'_, D>,
2818            offset: usize,
2819            depth: fidl::encoding::Depth,
2820        ) -> fidl::Result<()> {
2821            encoder.debug_check_bounds::<LogSinkPuppetGetInfoResponse>(offset);
2822            // Zero out padding regions. There's no need to apply masks
2823            // because the unmasked parts will be overwritten by fields.
2824            // Write the fields.
2825            self.0.encode(encoder, offset + 0, depth)?;
2826            Ok(())
2827        }
2828    }
2829
2830    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2831        for LogSinkPuppetGetInfoResponse
2832    {
2833        #[inline(always)]
2834        fn new_empty() -> Self {
2835            Self { info: fidl::new_empty!(PuppetInfo, D) }
2836        }
2837
2838        #[inline]
2839        unsafe fn decode(
2840            &mut self,
2841            decoder: &mut fidl::encoding::Decoder<'_, D>,
2842            offset: usize,
2843            _depth: fidl::encoding::Depth,
2844        ) -> fidl::Result<()> {
2845            decoder.debug_check_bounds::<Self>(offset);
2846            // Verify that padding bytes are zero.
2847            fidl::decode!(PuppetInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
2848            Ok(())
2849        }
2850    }
2851
2852    impl fidl::encoding::ValueTypeMarker for PuppetInfo {
2853        type Borrowed<'a> = &'a Self;
2854        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2855            value
2856        }
2857    }
2858
2859    unsafe impl fidl::encoding::TypeMarker for PuppetInfo {
2860        type Owned = Self;
2861
2862        #[inline(always)]
2863        fn inline_align(_context: fidl::encoding::Context) -> usize {
2864            8
2865        }
2866
2867        #[inline(always)]
2868        fn inline_size(_context: fidl::encoding::Context) -> usize {
2869            32
2870        }
2871    }
2872
2873    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PuppetInfo, D>
2874        for &PuppetInfo
2875    {
2876        #[inline]
2877        unsafe fn encode(
2878            self,
2879            encoder: &mut fidl::encoding::Encoder<'_, D>,
2880            offset: usize,
2881            _depth: fidl::encoding::Depth,
2882        ) -> fidl::Result<()> {
2883            encoder.debug_check_bounds::<PuppetInfo>(offset);
2884            // Delegate to tuple encoding.
2885            fidl::encoding::Encode::<PuppetInfo, D>::encode(
2886                (
2887                    <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.tag),
2888                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
2889                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
2890                ),
2891                encoder, offset, _depth
2892            )
2893        }
2894    }
2895    unsafe impl<
2896            D: fidl::encoding::ResourceDialect,
2897            T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
2898            T1: fidl::encoding::Encode<u64, D>,
2899            T2: fidl::encoding::Encode<u64, D>,
2900        > fidl::encoding::Encode<PuppetInfo, D> for (T0, T1, T2)
2901    {
2902        #[inline]
2903        unsafe fn encode(
2904            self,
2905            encoder: &mut fidl::encoding::Encoder<'_, D>,
2906            offset: usize,
2907            depth: fidl::encoding::Depth,
2908        ) -> fidl::Result<()> {
2909            encoder.debug_check_bounds::<PuppetInfo>(offset);
2910            // Zero out padding regions. There's no need to apply masks
2911            // because the unmasked parts will be overwritten by fields.
2912            // Write the fields.
2913            self.0.encode(encoder, offset + 0, depth)?;
2914            self.1.encode(encoder, offset + 16, depth)?;
2915            self.2.encode(encoder, offset + 24, depth)?;
2916            Ok(())
2917        }
2918    }
2919
2920    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PuppetInfo {
2921        #[inline(always)]
2922        fn new_empty() -> Self {
2923            Self {
2924                tag: fidl::new_empty!(fidl::encoding::Optional<fidl::encoding::UnboundedString>, D),
2925                pid: fidl::new_empty!(u64, D),
2926                tid: fidl::new_empty!(u64, D),
2927            }
2928        }
2929
2930        #[inline]
2931        unsafe fn decode(
2932            &mut self,
2933            decoder: &mut fidl::encoding::Decoder<'_, D>,
2934            offset: usize,
2935            _depth: fidl::encoding::Depth,
2936        ) -> fidl::Result<()> {
2937            decoder.debug_check_bounds::<Self>(offset);
2938            // Verify that padding bytes are zero.
2939            fidl::decode!(
2940                fidl::encoding::Optional<fidl::encoding::UnboundedString>,
2941                D,
2942                &mut self.tag,
2943                decoder,
2944                offset + 0,
2945                _depth
2946            )?;
2947            fidl::decode!(u64, D, &mut self.pid, decoder, offset + 16, _depth)?;
2948            fidl::decode!(u64, D, &mut self.tid, decoder, offset + 24, _depth)?;
2949            Ok(())
2950        }
2951    }
2952
2953    impl fidl::encoding::ValueTypeMarker for Record {
2954        type Borrowed<'a> = &'a Self;
2955        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2956            value
2957        }
2958    }
2959
2960    unsafe impl fidl::encoding::TypeMarker for Record {
2961        type Owned = Self;
2962
2963        #[inline(always)]
2964        fn inline_align(_context: fidl::encoding::Context) -> usize {
2965            8
2966        }
2967
2968        #[inline(always)]
2969        fn inline_size(_context: fidl::encoding::Context) -> usize {
2970            32
2971        }
2972    }
2973
2974    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Record, D> for &Record {
2975        #[inline]
2976        unsafe fn encode(
2977            self,
2978            encoder: &mut fidl::encoding::Encoder<'_, D>,
2979            offset: usize,
2980            _depth: fidl::encoding::Depth,
2981        ) -> fidl::Result<()> {
2982            encoder.debug_check_bounds::<Record>(offset);
2983            // Delegate to tuple encoding.
2984            fidl::encoding::Encode::<Record, D>::encode(
2985                (
2986                    <fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
2987                    <fidl_fuchsia_diagnostics::Severity as fidl::encoding::ValueTypeMarker>::borrow(&self.severity),
2988                    <fidl::encoding::Vector<Argument, 15> as fidl::encoding::ValueTypeMarker>::borrow(&self.arguments),
2989                ),
2990                encoder, offset, _depth
2991            )
2992        }
2993    }
2994    unsafe impl<
2995            D: fidl::encoding::ResourceDialect,
2996            T0: fidl::encoding::Encode<fidl::BootInstant, D>,
2997            T1: fidl::encoding::Encode<fidl_fuchsia_diagnostics::Severity, D>,
2998            T2: fidl::encoding::Encode<fidl::encoding::Vector<Argument, 15>, D>,
2999        > fidl::encoding::Encode<Record, D> for (T0, T1, T2)
3000    {
3001        #[inline]
3002        unsafe fn encode(
3003            self,
3004            encoder: &mut fidl::encoding::Encoder<'_, D>,
3005            offset: usize,
3006            depth: fidl::encoding::Depth,
3007        ) -> fidl::Result<()> {
3008            encoder.debug_check_bounds::<Record>(offset);
3009            // Zero out padding regions. There's no need to apply masks
3010            // because the unmasked parts will be overwritten by fields.
3011            unsafe {
3012                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3013                (ptr as *mut u64).write_unaligned(0);
3014            }
3015            // Write the fields.
3016            self.0.encode(encoder, offset + 0, depth)?;
3017            self.1.encode(encoder, offset + 8, depth)?;
3018            self.2.encode(encoder, offset + 16, depth)?;
3019            Ok(())
3020        }
3021    }
3022
3023    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Record {
3024        #[inline(always)]
3025        fn new_empty() -> Self {
3026            Self {
3027                timestamp: fidl::new_empty!(fidl::BootInstant, D),
3028                severity: fidl::new_empty!(fidl_fuchsia_diagnostics::Severity, D),
3029                arguments: fidl::new_empty!(fidl::encoding::Vector<Argument, 15>, D),
3030            }
3031        }
3032
3033        #[inline]
3034        unsafe fn decode(
3035            &mut self,
3036            decoder: &mut fidl::encoding::Decoder<'_, D>,
3037            offset: usize,
3038            _depth: fidl::encoding::Depth,
3039        ) -> fidl::Result<()> {
3040            decoder.debug_check_bounds::<Self>(offset);
3041            // Verify that padding bytes are zero.
3042            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3043            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3044            let mask = 0xffffffffffffff00u64;
3045            let maskedval = padval & mask;
3046            if maskedval != 0 {
3047                return Err(fidl::Error::NonZeroPadding {
3048                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3049                });
3050            }
3051            fidl::decode!(fidl::BootInstant, D, &mut self.timestamp, decoder, offset + 0, _depth)?;
3052            fidl::decode!(
3053                fidl_fuchsia_diagnostics::Severity,
3054                D,
3055                &mut self.severity,
3056                decoder,
3057                offset + 8,
3058                _depth
3059            )?;
3060            fidl::decode!(fidl::encoding::Vector<Argument, 15>, D, &mut self.arguments, decoder, offset + 16, _depth)?;
3061            Ok(())
3062        }
3063    }
3064
3065    impl fidl::encoding::ValueTypeMarker for RecordSpec {
3066        type Borrowed<'a> = &'a Self;
3067        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3068            value
3069        }
3070    }
3071
3072    unsafe impl fidl::encoding::TypeMarker for RecordSpec {
3073        type Owned = Self;
3074
3075        #[inline(always)]
3076        fn inline_align(_context: fidl::encoding::Context) -> usize {
3077            8
3078        }
3079
3080        #[inline(always)]
3081        fn inline_size(_context: fidl::encoding::Context) -> usize {
3082            56
3083        }
3084    }
3085
3086    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RecordSpec, D>
3087        for &RecordSpec
3088    {
3089        #[inline]
3090        unsafe fn encode(
3091            self,
3092            encoder: &mut fidl::encoding::Encoder<'_, D>,
3093            offset: usize,
3094            _depth: fidl::encoding::Depth,
3095        ) -> fidl::Result<()> {
3096            encoder.debug_check_bounds::<RecordSpec>(offset);
3097            // Delegate to tuple encoding.
3098            fidl::encoding::Encode::<RecordSpec, D>::encode(
3099                (
3100                    <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
3101                        &self.file,
3102                    ),
3103                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.line),
3104                    <Record as fidl::encoding::ValueTypeMarker>::borrow(&self.record),
3105                ),
3106                encoder,
3107                offset,
3108                _depth,
3109            )
3110        }
3111    }
3112    unsafe impl<
3113            D: fidl::encoding::ResourceDialect,
3114            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
3115            T1: fidl::encoding::Encode<u32, D>,
3116            T2: fidl::encoding::Encode<Record, D>,
3117        > fidl::encoding::Encode<RecordSpec, D> for (T0, T1, T2)
3118    {
3119        #[inline]
3120        unsafe fn encode(
3121            self,
3122            encoder: &mut fidl::encoding::Encoder<'_, D>,
3123            offset: usize,
3124            depth: fidl::encoding::Depth,
3125        ) -> fidl::Result<()> {
3126            encoder.debug_check_bounds::<RecordSpec>(offset);
3127            // Zero out padding regions. There's no need to apply masks
3128            // because the unmasked parts will be overwritten by fields.
3129            unsafe {
3130                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3131                (ptr as *mut u64).write_unaligned(0);
3132            }
3133            // Write the fields.
3134            self.0.encode(encoder, offset + 0, depth)?;
3135            self.1.encode(encoder, offset + 16, depth)?;
3136            self.2.encode(encoder, offset + 24, depth)?;
3137            Ok(())
3138        }
3139    }
3140
3141    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecordSpec {
3142        #[inline(always)]
3143        fn new_empty() -> Self {
3144            Self {
3145                file: fidl::new_empty!(fidl::encoding::BoundedString<256>, D),
3146                line: fidl::new_empty!(u32, D),
3147                record: fidl::new_empty!(Record, D),
3148            }
3149        }
3150
3151        #[inline]
3152        unsafe fn decode(
3153            &mut self,
3154            decoder: &mut fidl::encoding::Decoder<'_, D>,
3155            offset: usize,
3156            _depth: fidl::encoding::Depth,
3157        ) -> fidl::Result<()> {
3158            decoder.debug_check_bounds::<Self>(offset);
3159            // Verify that padding bytes are zero.
3160            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3161            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3162            let mask = 0xffffffff00000000u64;
3163            let maskedval = padval & mask;
3164            if maskedval != 0 {
3165                return Err(fidl::Error::NonZeroPadding {
3166                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3167                });
3168            }
3169            fidl::decode!(
3170                fidl::encoding::BoundedString<256>,
3171                D,
3172                &mut self.file,
3173                decoder,
3174                offset + 0,
3175                _depth
3176            )?;
3177            fidl::decode!(u32, D, &mut self.line, decoder, offset + 16, _depth)?;
3178            fidl::decode!(Record, D, &mut self.record, decoder, offset + 24, _depth)?;
3179            Ok(())
3180        }
3181    }
3182
3183    impl fidl::encoding::ValueTypeMarker for TestFailure {
3184        type Borrowed<'a> = &'a Self;
3185        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3186            value
3187        }
3188    }
3189
3190    unsafe impl fidl::encoding::TypeMarker for TestFailure {
3191        type Owned = Self;
3192
3193        #[inline(always)]
3194        fn inline_align(_context: fidl::encoding::Context) -> usize {
3195            8
3196        }
3197
3198        #[inline(always)]
3199        fn inline_size(_context: fidl::encoding::Context) -> usize {
3200            32
3201        }
3202    }
3203
3204    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TestFailure, D>
3205        for &TestFailure
3206    {
3207        #[inline]
3208        unsafe fn encode(
3209            self,
3210            encoder: &mut fidl::encoding::Encoder<'_, D>,
3211            offset: usize,
3212            _depth: fidl::encoding::Depth,
3213        ) -> fidl::Result<()> {
3214            encoder.debug_check_bounds::<TestFailure>(offset);
3215            // Delegate to tuple encoding.
3216            fidl::encoding::Encode::<TestFailure, D>::encode(
3217                (
3218                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3219                        &self.test_name,
3220                    ),
3221                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3222                        &self.reason,
3223                    ),
3224                ),
3225                encoder,
3226                offset,
3227                _depth,
3228            )
3229        }
3230    }
3231    unsafe impl<
3232            D: fidl::encoding::ResourceDialect,
3233            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3234            T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3235        > fidl::encoding::Encode<TestFailure, D> for (T0, T1)
3236    {
3237        #[inline]
3238        unsafe fn encode(
3239            self,
3240            encoder: &mut fidl::encoding::Encoder<'_, D>,
3241            offset: usize,
3242            depth: fidl::encoding::Depth,
3243        ) -> fidl::Result<()> {
3244            encoder.debug_check_bounds::<TestFailure>(offset);
3245            // Zero out padding regions. There's no need to apply masks
3246            // because the unmasked parts will be overwritten by fields.
3247            // Write the fields.
3248            self.0.encode(encoder, offset + 0, depth)?;
3249            self.1.encode(encoder, offset + 16, depth)?;
3250            Ok(())
3251        }
3252    }
3253
3254    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TestFailure {
3255        #[inline(always)]
3256        fn new_empty() -> Self {
3257            Self {
3258                test_name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3259                reason: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3260            }
3261        }
3262
3263        #[inline]
3264        unsafe fn decode(
3265            &mut self,
3266            decoder: &mut fidl::encoding::Decoder<'_, D>,
3267            offset: usize,
3268            _depth: fidl::encoding::Depth,
3269        ) -> fidl::Result<()> {
3270            decoder.debug_check_bounds::<Self>(offset);
3271            // Verify that padding bytes are zero.
3272            fidl::decode!(
3273                fidl::encoding::UnboundedString,
3274                D,
3275                &mut self.test_name,
3276                decoder,
3277                offset + 0,
3278                _depth
3279            )?;
3280            fidl::decode!(
3281                fidl::encoding::UnboundedString,
3282                D,
3283                &mut self.reason,
3284                decoder,
3285                offset + 16,
3286                _depth
3287            )?;
3288            Ok(())
3289        }
3290    }
3291
3292    impl fidl::encoding::ValueTypeMarker for TestSuccess {
3293        type Borrowed<'a> = &'a Self;
3294        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3295            value
3296        }
3297    }
3298
3299    unsafe impl fidl::encoding::TypeMarker for TestSuccess {
3300        type Owned = Self;
3301
3302        #[inline(always)]
3303        fn inline_align(_context: fidl::encoding::Context) -> usize {
3304            8
3305        }
3306
3307        #[inline(always)]
3308        fn inline_size(_context: fidl::encoding::Context) -> usize {
3309            16
3310        }
3311    }
3312
3313    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TestSuccess, D>
3314        for &TestSuccess
3315    {
3316        #[inline]
3317        unsafe fn encode(
3318            self,
3319            encoder: &mut fidl::encoding::Encoder<'_, D>,
3320            offset: usize,
3321            _depth: fidl::encoding::Depth,
3322        ) -> fidl::Result<()> {
3323            encoder.debug_check_bounds::<TestSuccess>(offset);
3324            // Delegate to tuple encoding.
3325            fidl::encoding::Encode::<TestSuccess, D>::encode(
3326                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3327                    &self.test_name,
3328                ),),
3329                encoder,
3330                offset,
3331                _depth,
3332            )
3333        }
3334    }
3335    unsafe impl<
3336            D: fidl::encoding::ResourceDialect,
3337            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3338        > fidl::encoding::Encode<TestSuccess, D> for (T0,)
3339    {
3340        #[inline]
3341        unsafe fn encode(
3342            self,
3343            encoder: &mut fidl::encoding::Encoder<'_, D>,
3344            offset: usize,
3345            depth: fidl::encoding::Depth,
3346        ) -> fidl::Result<()> {
3347            encoder.debug_check_bounds::<TestSuccess>(offset);
3348            // Zero out padding regions. There's no need to apply masks
3349            // because the unmasked parts will be overwritten by fields.
3350            // Write the fields.
3351            self.0.encode(encoder, offset + 0, depth)?;
3352            Ok(())
3353        }
3354    }
3355
3356    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TestSuccess {
3357        #[inline(always)]
3358        fn new_empty() -> Self {
3359            Self { test_name: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
3360        }
3361
3362        #[inline]
3363        unsafe fn decode(
3364            &mut self,
3365            decoder: &mut fidl::encoding::Decoder<'_, D>,
3366            offset: usize,
3367            _depth: fidl::encoding::Depth,
3368        ) -> fidl::Result<()> {
3369            decoder.debug_check_bounds::<Self>(offset);
3370            // Verify that padding bytes are zero.
3371            fidl::decode!(
3372                fidl::encoding::UnboundedString,
3373                D,
3374                &mut self.test_name,
3375                decoder,
3376                offset + 0,
3377                _depth
3378            )?;
3379            Ok(())
3380        }
3381    }
3382
3383    impl ValidateResultsIteratorGetNextResponse {
3384        #[inline(always)]
3385        fn max_ordinal_present(&self) -> u64 {
3386            if let Some(_) = self.result {
3387                return 1;
3388            }
3389            0
3390        }
3391    }
3392
3393    impl fidl::encoding::ResourceTypeMarker for ValidateResultsIteratorGetNextResponse {
3394        type Borrowed<'a> = &'a mut Self;
3395        fn take_or_borrow<'a>(
3396            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3397        ) -> Self::Borrowed<'a> {
3398            value
3399        }
3400    }
3401
3402    unsafe impl fidl::encoding::TypeMarker for ValidateResultsIteratorGetNextResponse {
3403        type Owned = Self;
3404
3405        #[inline(always)]
3406        fn inline_align(_context: fidl::encoding::Context) -> usize {
3407            8
3408        }
3409
3410        #[inline(always)]
3411        fn inline_size(_context: fidl::encoding::Context) -> usize {
3412            16
3413        }
3414    }
3415
3416    unsafe impl
3417        fidl::encoding::Encode<
3418            ValidateResultsIteratorGetNextResponse,
3419            fidl::encoding::DefaultFuchsiaResourceDialect,
3420        > for &mut ValidateResultsIteratorGetNextResponse
3421    {
3422        unsafe fn encode(
3423            self,
3424            encoder: &mut fidl::encoding::Encoder<
3425                '_,
3426                fidl::encoding::DefaultFuchsiaResourceDialect,
3427            >,
3428            offset: usize,
3429            mut depth: fidl::encoding::Depth,
3430        ) -> fidl::Result<()> {
3431            encoder.debug_check_bounds::<ValidateResultsIteratorGetNextResponse>(offset);
3432            // Vector header
3433            let max_ordinal: u64 = self.max_ordinal_present();
3434            encoder.write_num(max_ordinal, offset);
3435            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3436            // Calling encoder.out_of_line_offset(0) is not allowed.
3437            if max_ordinal == 0 {
3438                return Ok(());
3439            }
3440            depth.increment()?;
3441            let envelope_size = 8;
3442            let bytes_len = max_ordinal as usize * envelope_size;
3443            #[allow(unused_variables)]
3444            let offset = encoder.out_of_line_offset(bytes_len);
3445            let mut _prev_end_offset: usize = 0;
3446            if 1 > max_ordinal {
3447                return Ok(());
3448            }
3449
3450            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3451            // are envelope_size bytes.
3452            let cur_offset: usize = (1 - 1) * envelope_size;
3453
3454            // Zero reserved fields.
3455            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3456
3457            // Safety:
3458            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3459            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3460            //   envelope_size bytes, there is always sufficient room.
3461            fidl::encoding::encode_in_envelope_optional::<
3462                ValidateResult,
3463                fidl::encoding::DefaultFuchsiaResourceDialect,
3464            >(
3465                self.result
3466                    .as_ref()
3467                    .map(<ValidateResult as fidl::encoding::ValueTypeMarker>::borrow),
3468                encoder,
3469                offset + cur_offset,
3470                depth,
3471            )?;
3472
3473            _prev_end_offset = cur_offset + envelope_size;
3474
3475            Ok(())
3476        }
3477    }
3478
3479    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3480        for ValidateResultsIteratorGetNextResponse
3481    {
3482        #[inline(always)]
3483        fn new_empty() -> Self {
3484            Self::default()
3485        }
3486
3487        unsafe fn decode(
3488            &mut self,
3489            decoder: &mut fidl::encoding::Decoder<
3490                '_,
3491                fidl::encoding::DefaultFuchsiaResourceDialect,
3492            >,
3493            offset: usize,
3494            mut depth: fidl::encoding::Depth,
3495        ) -> fidl::Result<()> {
3496            decoder.debug_check_bounds::<Self>(offset);
3497            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3498                None => return Err(fidl::Error::NotNullable),
3499                Some(len) => len,
3500            };
3501            // Calling decoder.out_of_line_offset(0) is not allowed.
3502            if len == 0 {
3503                return Ok(());
3504            };
3505            depth.increment()?;
3506            let envelope_size = 8;
3507            let bytes_len = len * envelope_size;
3508            let offset = decoder.out_of_line_offset(bytes_len)?;
3509            // Decode the envelope for each type.
3510            let mut _next_ordinal_to_read = 0;
3511            let mut next_offset = offset;
3512            let end_offset = offset + bytes_len;
3513            _next_ordinal_to_read += 1;
3514            if next_offset >= end_offset {
3515                return Ok(());
3516            }
3517
3518            // Decode unknown envelopes for gaps in ordinals.
3519            while _next_ordinal_to_read < 1 {
3520                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3521                _next_ordinal_to_read += 1;
3522                next_offset += envelope_size;
3523            }
3524
3525            let next_out_of_line = decoder.next_out_of_line();
3526            let handles_before = decoder.remaining_handles();
3527            if let Some((inlined, num_bytes, num_handles)) =
3528                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3529            {
3530                let member_inline_size =
3531                    <ValidateResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3532                if inlined != (member_inline_size <= 4) {
3533                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3534                }
3535                let inner_offset;
3536                let mut inner_depth = depth.clone();
3537                if inlined {
3538                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3539                    inner_offset = next_offset;
3540                } else {
3541                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3542                    inner_depth.increment()?;
3543                }
3544                let val_ref = self.result.get_or_insert_with(|| {
3545                    fidl::new_empty!(ValidateResult, fidl::encoding::DefaultFuchsiaResourceDialect)
3546                });
3547                fidl::decode!(
3548                    ValidateResult,
3549                    fidl::encoding::DefaultFuchsiaResourceDialect,
3550                    val_ref,
3551                    decoder,
3552                    inner_offset,
3553                    inner_depth
3554                )?;
3555                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3556                {
3557                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3558                }
3559                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3560                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3561                }
3562            }
3563
3564            next_offset += envelope_size;
3565
3566            // Decode the remaining unknown envelopes.
3567            while next_offset < end_offset {
3568                _next_ordinal_to_read += 1;
3569                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3570                next_offset += envelope_size;
3571            }
3572
3573            Ok(())
3574        }
3575    }
3576
3577    impl fidl::encoding::ValueTypeMarker for ValidateResult {
3578        type Borrowed<'a> = &'a Self;
3579        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3580            value
3581        }
3582    }
3583
3584    unsafe impl fidl::encoding::TypeMarker for ValidateResult {
3585        type Owned = Self;
3586
3587        #[inline(always)]
3588        fn inline_align(_context: fidl::encoding::Context) -> usize {
3589            8
3590        }
3591
3592        #[inline(always)]
3593        fn inline_size(_context: fidl::encoding::Context) -> usize {
3594            16
3595        }
3596    }
3597
3598    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ValidateResult, D>
3599        for &ValidateResult
3600    {
3601        #[inline]
3602        unsafe fn encode(
3603            self,
3604            encoder: &mut fidl::encoding::Encoder<'_, D>,
3605            offset: usize,
3606            _depth: fidl::encoding::Depth,
3607        ) -> fidl::Result<()> {
3608            encoder.debug_check_bounds::<ValidateResult>(offset);
3609            encoder.write_num::<u64>(self.ordinal(), offset);
3610            match self {
3611                ValidateResult::Success(ref val) => {
3612                    fidl::encoding::encode_in_envelope::<TestSuccess, D>(
3613                        <TestSuccess as fidl::encoding::ValueTypeMarker>::borrow(val),
3614                        encoder,
3615                        offset + 8,
3616                        _depth,
3617                    )
3618                }
3619                ValidateResult::Failure(ref val) => {
3620                    fidl::encoding::encode_in_envelope::<TestFailure, D>(
3621                        <TestFailure as fidl::encoding::ValueTypeMarker>::borrow(val),
3622                        encoder,
3623                        offset + 8,
3624                        _depth,
3625                    )
3626                }
3627            }
3628        }
3629    }
3630
3631    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ValidateResult {
3632        #[inline(always)]
3633        fn new_empty() -> Self {
3634            Self::Success(fidl::new_empty!(TestSuccess, D))
3635        }
3636
3637        #[inline]
3638        unsafe fn decode(
3639            &mut self,
3640            decoder: &mut fidl::encoding::Decoder<'_, D>,
3641            offset: usize,
3642            mut depth: fidl::encoding::Depth,
3643        ) -> fidl::Result<()> {
3644            decoder.debug_check_bounds::<Self>(offset);
3645            #[allow(unused_variables)]
3646            let next_out_of_line = decoder.next_out_of_line();
3647            let handles_before = decoder.remaining_handles();
3648            let (ordinal, inlined, num_bytes, num_handles) =
3649                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3650
3651            let member_inline_size = match ordinal {
3652                1 => <TestSuccess as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3653                2 => <TestFailure as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3654                _ => return Err(fidl::Error::UnknownUnionTag),
3655            };
3656
3657            if inlined != (member_inline_size <= 4) {
3658                return Err(fidl::Error::InvalidInlineBitInEnvelope);
3659            }
3660            let _inner_offset;
3661            if inlined {
3662                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3663                _inner_offset = offset + 8;
3664            } else {
3665                depth.increment()?;
3666                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3667            }
3668            match ordinal {
3669                1 => {
3670                    #[allow(irrefutable_let_patterns)]
3671                    if let ValidateResult::Success(_) = self {
3672                        // Do nothing, read the value into the object
3673                    } else {
3674                        // Initialize `self` to the right variant
3675                        *self = ValidateResult::Success(fidl::new_empty!(TestSuccess, D));
3676                    }
3677                    #[allow(irrefutable_let_patterns)]
3678                    if let ValidateResult::Success(ref mut val) = self {
3679                        fidl::decode!(TestSuccess, D, val, decoder, _inner_offset, depth)?;
3680                    } else {
3681                        unreachable!()
3682                    }
3683                }
3684                2 => {
3685                    #[allow(irrefutable_let_patterns)]
3686                    if let ValidateResult::Failure(_) = self {
3687                        // Do nothing, read the value into the object
3688                    } else {
3689                        // Initialize `self` to the right variant
3690                        *self = ValidateResult::Failure(fidl::new_empty!(TestFailure, D));
3691                    }
3692                    #[allow(irrefutable_let_patterns)]
3693                    if let ValidateResult::Failure(ref mut val) = self {
3694                        fidl::decode!(TestFailure, D, val, decoder, _inner_offset, depth)?;
3695                    } else {
3696                        unreachable!()
3697                    }
3698                }
3699                ordinal => panic!("unexpected ordinal {:?}", ordinal),
3700            }
3701            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3702                return Err(fidl::Error::InvalidNumBytesInEnvelope);
3703            }
3704            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3705                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3706            }
3707            Ok(())
3708        }
3709    }
3710
3711    impl fidl::encoding::ValueTypeMarker for Value {
3712        type Borrowed<'a> = &'a Self;
3713        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3714            value
3715        }
3716    }
3717
3718    unsafe impl fidl::encoding::TypeMarker for Value {
3719        type Owned = Self;
3720
3721        #[inline(always)]
3722        fn inline_align(_context: fidl::encoding::Context) -> usize {
3723            8
3724        }
3725
3726        #[inline(always)]
3727        fn inline_size(_context: fidl::encoding::Context) -> usize {
3728            16
3729        }
3730    }
3731
3732    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
3733        #[inline]
3734        unsafe fn encode(
3735            self,
3736            encoder: &mut fidl::encoding::Encoder<'_, D>,
3737            offset: usize,
3738            _depth: fidl::encoding::Depth,
3739        ) -> fidl::Result<()> {
3740            encoder.debug_check_bounds::<Value>(offset);
3741            encoder.write_num::<u64>(self.ordinal(), offset);
3742            match self {
3743            Value::SignedInt(ref val) => {
3744                fidl::encoding::encode_in_envelope::<i64, D>(
3745                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
3746                    encoder, offset + 8, _depth
3747                )
3748            }
3749            Value::UnsignedInt(ref val) => {
3750                fidl::encoding::encode_in_envelope::<u64, D>(
3751                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
3752                    encoder, offset + 8, _depth
3753                )
3754            }
3755            Value::Floating(ref val) => {
3756                fidl::encoding::encode_in_envelope::<f64, D>(
3757                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(val),
3758                    encoder, offset + 8, _depth
3759                )
3760            }
3761            Value::Text(ref val) => {
3762                fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<32768>, D>(
3763                    <fidl::encoding::BoundedString<32768> as fidl::encoding::ValueTypeMarker>::borrow(val),
3764                    encoder, offset + 8, _depth
3765                )
3766            }
3767            Value::Boolean(ref val) => {
3768                fidl::encoding::encode_in_envelope::<bool, D>(
3769                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
3770                    encoder, offset + 8, _depth
3771                )
3772            }
3773            Value::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
3774        }
3775        }
3776    }
3777
3778    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
3779        #[inline(always)]
3780        fn new_empty() -> Self {
3781            Self::__SourceBreaking { unknown_ordinal: 0 }
3782        }
3783
3784        #[inline]
3785        unsafe fn decode(
3786            &mut self,
3787            decoder: &mut fidl::encoding::Decoder<'_, D>,
3788            offset: usize,
3789            mut depth: fidl::encoding::Depth,
3790        ) -> fidl::Result<()> {
3791            decoder.debug_check_bounds::<Self>(offset);
3792            #[allow(unused_variables)]
3793            let next_out_of_line = decoder.next_out_of_line();
3794            let handles_before = decoder.remaining_handles();
3795            let (ordinal, inlined, num_bytes, num_handles) =
3796                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3797
3798            let member_inline_size = match ordinal {
3799            1 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3800            2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3801            3 => <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3802            4 => <fidl::encoding::BoundedString<32768> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3803            5 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3804            0 => return Err(fidl::Error::UnknownUnionTag),
3805            _ => num_bytes as usize,
3806        };
3807
3808            if inlined != (member_inline_size <= 4) {
3809                return Err(fidl::Error::InvalidInlineBitInEnvelope);
3810            }
3811            let _inner_offset;
3812            if inlined {
3813                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3814                _inner_offset = offset + 8;
3815            } else {
3816                depth.increment()?;
3817                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3818            }
3819            match ordinal {
3820                1 => {
3821                    #[allow(irrefutable_let_patterns)]
3822                    if let Value::SignedInt(_) = self {
3823                        // Do nothing, read the value into the object
3824                    } else {
3825                        // Initialize `self` to the right variant
3826                        *self = Value::SignedInt(fidl::new_empty!(i64, D));
3827                    }
3828                    #[allow(irrefutable_let_patterns)]
3829                    if let Value::SignedInt(ref mut val) = self {
3830                        fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
3831                    } else {
3832                        unreachable!()
3833                    }
3834                }
3835                2 => {
3836                    #[allow(irrefutable_let_patterns)]
3837                    if let Value::UnsignedInt(_) = self {
3838                        // Do nothing, read the value into the object
3839                    } else {
3840                        // Initialize `self` to the right variant
3841                        *self = Value::UnsignedInt(fidl::new_empty!(u64, D));
3842                    }
3843                    #[allow(irrefutable_let_patterns)]
3844                    if let Value::UnsignedInt(ref mut val) = self {
3845                        fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
3846                    } else {
3847                        unreachable!()
3848                    }
3849                }
3850                3 => {
3851                    #[allow(irrefutable_let_patterns)]
3852                    if let Value::Floating(_) = self {
3853                        // Do nothing, read the value into the object
3854                    } else {
3855                        // Initialize `self` to the right variant
3856                        *self = Value::Floating(fidl::new_empty!(f64, D));
3857                    }
3858                    #[allow(irrefutable_let_patterns)]
3859                    if let Value::Floating(ref mut val) = self {
3860                        fidl::decode!(f64, D, val, decoder, _inner_offset, depth)?;
3861                    } else {
3862                        unreachable!()
3863                    }
3864                }
3865                4 => {
3866                    #[allow(irrefutable_let_patterns)]
3867                    if let Value::Text(_) = self {
3868                        // Do nothing, read the value into the object
3869                    } else {
3870                        // Initialize `self` to the right variant
3871                        *self =
3872                            Value::Text(fidl::new_empty!(fidl::encoding::BoundedString<32768>, D));
3873                    }
3874                    #[allow(irrefutable_let_patterns)]
3875                    if let Value::Text(ref mut val) = self {
3876                        fidl::decode!(
3877                            fidl::encoding::BoundedString<32768>,
3878                            D,
3879                            val,
3880                            decoder,
3881                            _inner_offset,
3882                            depth
3883                        )?;
3884                    } else {
3885                        unreachable!()
3886                    }
3887                }
3888                5 => {
3889                    #[allow(irrefutable_let_patterns)]
3890                    if let Value::Boolean(_) = self {
3891                        // Do nothing, read the value into the object
3892                    } else {
3893                        // Initialize `self` to the right variant
3894                        *self = Value::Boolean(fidl::new_empty!(bool, D));
3895                    }
3896                    #[allow(irrefutable_let_patterns)]
3897                    if let Value::Boolean(ref mut val) = self {
3898                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
3899                    } else {
3900                        unreachable!()
3901                    }
3902                }
3903                #[allow(deprecated)]
3904                ordinal => {
3905                    for _ in 0..num_handles {
3906                        decoder.drop_next_handle()?;
3907                    }
3908                    *self = Value::__SourceBreaking { unknown_ordinal: ordinal };
3909                }
3910            }
3911            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3912                return Err(fidl::Error::InvalidNumBytesInEnvelope);
3913            }
3914            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3915                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3916            }
3917            Ok(())
3918        }
3919    }
3920}