fidl_fuchsia_sysinfo/
fidl_fuchsia_sysinfo.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
13pub const BOARD_NAME_LEN: u8 = 32;
14
15pub const BOOTLOADER_VENDOR_LEN: u8 = 32;
16
17pub const SERIAL_NUMBER_LEN: u8 = 32;
18
19#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
20pub enum InterruptControllerType {
21    Unknown,
22    Apic,
23    GicV2,
24    GicV3,
25    Plic,
26    #[doc(hidden)]
27    __SourceBreaking {
28        unknown_ordinal: u32,
29    },
30}
31
32/// Pattern that matches an unknown `InterruptControllerType` member.
33#[macro_export]
34macro_rules! InterruptControllerTypeUnknown {
35    () => {
36        _
37    };
38}
39
40impl InterruptControllerType {
41    #[inline]
42    pub fn from_primitive(prim: u32) -> Option<Self> {
43        match prim {
44            0 => Some(Self::Unknown),
45            1 => Some(Self::Apic),
46            2 => Some(Self::GicV2),
47            3 => Some(Self::GicV3),
48            4 => Some(Self::Plic),
49            _ => None,
50        }
51    }
52
53    #[inline]
54    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
55        match prim {
56            0 => Self::Unknown,
57            1 => Self::Apic,
58            2 => Self::GicV2,
59            3 => Self::GicV3,
60            4 => Self::Plic,
61            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
62        }
63    }
64
65    #[inline]
66    pub fn unknown() -> Self {
67        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
68    }
69
70    #[inline]
71    pub const fn into_primitive(self) -> u32 {
72        match self {
73            Self::Unknown => 0,
74            Self::Apic => 1,
75            Self::GicV2 => 2,
76            Self::GicV3 => 3,
77            Self::Plic => 4,
78            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
79        }
80    }
81
82    #[inline]
83    pub fn is_unknown(&self) -> bool {
84        match self {
85            Self::__SourceBreaking { unknown_ordinal: _ } => true,
86            _ => false,
87        }
88    }
89}
90
91#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
92pub struct InterruptControllerInfo {
93    pub type_: InterruptControllerType,
94}
95
96impl fidl::Persistable for InterruptControllerInfo {}
97
98#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
99pub struct SysInfoGetBoardNameResponse {
100    pub status: i32,
101    pub name: Option<String>,
102}
103
104impl fidl::Persistable for SysInfoGetBoardNameResponse {}
105
106#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
107#[repr(C)]
108pub struct SysInfoGetBoardRevisionResponse {
109    pub status: i32,
110    pub revision: u32,
111}
112
113impl fidl::Persistable for SysInfoGetBoardRevisionResponse {}
114
115#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
116pub struct SysInfoGetBootloaderVendorResponse {
117    pub status: i32,
118    pub vendor: Option<String>,
119}
120
121impl fidl::Persistable for SysInfoGetBootloaderVendorResponse {}
122
123#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
124pub struct SysInfoGetInterruptControllerInfoResponse {
125    pub status: i32,
126    pub info: Option<Box<InterruptControllerInfo>>,
127}
128
129impl fidl::Persistable for SysInfoGetInterruptControllerInfoResponse {}
130
131#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
132pub struct SysInfoGetSerialNumberResponse {
133    pub serial: String,
134}
135
136impl fidl::Persistable for SysInfoGetSerialNumberResponse {}
137
138#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
139pub struct SysInfoMarker;
140
141impl fidl::endpoints::ProtocolMarker for SysInfoMarker {
142    type Proxy = SysInfoProxy;
143    type RequestStream = SysInfoRequestStream;
144    #[cfg(target_os = "fuchsia")]
145    type SynchronousProxy = SysInfoSynchronousProxy;
146
147    const DEBUG_NAME: &'static str = "fuchsia.sysinfo.SysInfo";
148}
149impl fidl::endpoints::DiscoverableProtocolMarker for SysInfoMarker {}
150pub type SysInfoGetSerialNumberResult = Result<String, i32>;
151
152pub trait SysInfoProxyInterface: Send + Sync {
153    type GetBoardNameResponseFut: std::future::Future<Output = Result<(i32, Option<String>), fidl::Error>>
154        + Send;
155    fn r#get_board_name(&self) -> Self::GetBoardNameResponseFut;
156    type GetBoardRevisionResponseFut: std::future::Future<Output = Result<(i32, u32), fidl::Error>>
157        + Send;
158    fn r#get_board_revision(&self) -> Self::GetBoardRevisionResponseFut;
159    type GetBootloaderVendorResponseFut: std::future::Future<Output = Result<(i32, Option<String>), fidl::Error>>
160        + Send;
161    fn r#get_bootloader_vendor(&self) -> Self::GetBootloaderVendorResponseFut;
162    type GetInterruptControllerInfoResponseFut: std::future::Future<
163            Output = Result<(i32, Option<Box<InterruptControllerInfo>>), fidl::Error>,
164        > + Send;
165    fn r#get_interrupt_controller_info(&self) -> Self::GetInterruptControllerInfoResponseFut;
166    type GetSerialNumberResponseFut: std::future::Future<Output = Result<SysInfoGetSerialNumberResult, fidl::Error>>
167        + Send;
168    fn r#get_serial_number(&self) -> Self::GetSerialNumberResponseFut;
169}
170#[derive(Debug)]
171#[cfg(target_os = "fuchsia")]
172pub struct SysInfoSynchronousProxy {
173    client: fidl::client::sync::Client,
174}
175
176#[cfg(target_os = "fuchsia")]
177impl fidl::endpoints::SynchronousProxy for SysInfoSynchronousProxy {
178    type Proxy = SysInfoProxy;
179    type Protocol = SysInfoMarker;
180
181    fn from_channel(inner: fidl::Channel) -> Self {
182        Self::new(inner)
183    }
184
185    fn into_channel(self) -> fidl::Channel {
186        self.client.into_channel()
187    }
188
189    fn as_channel(&self) -> &fidl::Channel {
190        self.client.as_channel()
191    }
192}
193
194#[cfg(target_os = "fuchsia")]
195impl SysInfoSynchronousProxy {
196    pub fn new(channel: fidl::Channel) -> Self {
197        let protocol_name = <SysInfoMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
198        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
199    }
200
201    pub fn into_channel(self) -> fidl::Channel {
202        self.client.into_channel()
203    }
204
205    /// Waits until an event arrives and returns it. It is safe for other
206    /// threads to make concurrent requests while waiting for an event.
207    pub fn wait_for_event(
208        &self,
209        deadline: zx::MonotonicInstant,
210    ) -> Result<SysInfoEvent, fidl::Error> {
211        SysInfoEvent::decode(self.client.wait_for_event(deadline)?)
212    }
213
214    /// Return the board name for the platform we are running on.
215    pub fn r#get_board_name(
216        &self,
217        ___deadline: zx::MonotonicInstant,
218    ) -> Result<(i32, Option<String>), fidl::Error> {
219        let _response =
220            self.client.send_query::<fidl::encoding::EmptyPayload, SysInfoGetBoardNameResponse>(
221                (),
222                0x6d29d1a6edf9a614,
223                fidl::encoding::DynamicFlags::empty(),
224                ___deadline,
225            )?;
226        Ok((_response.status, _response.name))
227    }
228
229    /// Return the board revision for the board we are running on.
230    pub fn r#get_board_revision(
231        &self,
232        ___deadline: zx::MonotonicInstant,
233    ) -> Result<(i32, u32), fidl::Error> {
234        let _response = self
235            .client
236            .send_query::<fidl::encoding::EmptyPayload, SysInfoGetBoardRevisionResponse>(
237                (),
238                0x3dd050d99012e9cc,
239                fidl::encoding::DynamicFlags::empty(),
240                ___deadline,
241            )?;
242        Ok((_response.status, _response.revision))
243    }
244
245    /// Return the bootloader vendor for the platform we are running on.
246    pub fn r#get_bootloader_vendor(
247        &self,
248        ___deadline: zx::MonotonicInstant,
249    ) -> Result<(i32, Option<String>), fidl::Error> {
250        let _response = self
251            .client
252            .send_query::<fidl::encoding::EmptyPayload, SysInfoGetBootloaderVendorResponse>(
253                (),
254                0x2511f1c2f9ae2017,
255                fidl::encoding::DynamicFlags::empty(),
256                ___deadline,
257            )?;
258        Ok((_response.status, _response.vendor))
259    }
260
261    /// Return interrupt controller information.
262    pub fn r#get_interrupt_controller_info(
263        &self,
264        ___deadline: zx::MonotonicInstant,
265    ) -> Result<(i32, Option<Box<InterruptControllerInfo>>), fidl::Error> {
266        let _response = self
267            .client
268            .send_query::<fidl::encoding::EmptyPayload, SysInfoGetInterruptControllerInfoResponse>(
269                (),
270                0x31a438b28dca119c,
271                fidl::encoding::DynamicFlags::empty(),
272                ___deadline,
273            )?;
274        Ok((_response.status, _response.info))
275    }
276
277    pub fn r#get_serial_number(
278        &self,
279        ___deadline: zx::MonotonicInstant,
280    ) -> Result<SysInfoGetSerialNumberResult, fidl::Error> {
281        let _response = self.client.send_query::<
282            fidl::encoding::EmptyPayload,
283            fidl::encoding::ResultType<SysInfoGetSerialNumberResponse, i32>,
284        >(
285            (),
286            0x3b6920410a59f01f,
287            fidl::encoding::DynamicFlags::empty(),
288            ___deadline,
289        )?;
290        Ok(_response.map(|x| x.serial))
291    }
292}
293
294#[derive(Debug, Clone)]
295pub struct SysInfoProxy {
296    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
297}
298
299impl fidl::endpoints::Proxy for SysInfoProxy {
300    type Protocol = SysInfoMarker;
301
302    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
303        Self::new(inner)
304    }
305
306    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
307        self.client.into_channel().map_err(|client| Self { client })
308    }
309
310    fn as_channel(&self) -> &::fidl::AsyncChannel {
311        self.client.as_channel()
312    }
313}
314
315impl SysInfoProxy {
316    /// Create a new Proxy for fuchsia.sysinfo/SysInfo.
317    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
318        let protocol_name = <SysInfoMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
319        Self { client: fidl::client::Client::new(channel, protocol_name) }
320    }
321
322    /// Get a Stream of events from the remote end of the protocol.
323    ///
324    /// # Panics
325    ///
326    /// Panics if the event stream was already taken.
327    pub fn take_event_stream(&self) -> SysInfoEventStream {
328        SysInfoEventStream { event_receiver: self.client.take_event_receiver() }
329    }
330
331    /// Return the board name for the platform we are running on.
332    pub fn r#get_board_name(
333        &self,
334    ) -> fidl::client::QueryResponseFut<
335        (i32, Option<String>),
336        fidl::encoding::DefaultFuchsiaResourceDialect,
337    > {
338        SysInfoProxyInterface::r#get_board_name(self)
339    }
340
341    /// Return the board revision for the board we are running on.
342    pub fn r#get_board_revision(
343        &self,
344    ) -> fidl::client::QueryResponseFut<(i32, u32), fidl::encoding::DefaultFuchsiaResourceDialect>
345    {
346        SysInfoProxyInterface::r#get_board_revision(self)
347    }
348
349    /// Return the bootloader vendor for the platform we are running on.
350    pub fn r#get_bootloader_vendor(
351        &self,
352    ) -> fidl::client::QueryResponseFut<
353        (i32, Option<String>),
354        fidl::encoding::DefaultFuchsiaResourceDialect,
355    > {
356        SysInfoProxyInterface::r#get_bootloader_vendor(self)
357    }
358
359    /// Return interrupt controller information.
360    pub fn r#get_interrupt_controller_info(
361        &self,
362    ) -> fidl::client::QueryResponseFut<
363        (i32, Option<Box<InterruptControllerInfo>>),
364        fidl::encoding::DefaultFuchsiaResourceDialect,
365    > {
366        SysInfoProxyInterface::r#get_interrupt_controller_info(self)
367    }
368
369    pub fn r#get_serial_number(
370        &self,
371    ) -> fidl::client::QueryResponseFut<
372        SysInfoGetSerialNumberResult,
373        fidl::encoding::DefaultFuchsiaResourceDialect,
374    > {
375        SysInfoProxyInterface::r#get_serial_number(self)
376    }
377}
378
379impl SysInfoProxyInterface for SysInfoProxy {
380    type GetBoardNameResponseFut = fidl::client::QueryResponseFut<
381        (i32, Option<String>),
382        fidl::encoding::DefaultFuchsiaResourceDialect,
383    >;
384    fn r#get_board_name(&self) -> Self::GetBoardNameResponseFut {
385        fn _decode(
386            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
387        ) -> Result<(i32, Option<String>), fidl::Error> {
388            let _response = fidl::client::decode_transaction_body::<
389                SysInfoGetBoardNameResponse,
390                fidl::encoding::DefaultFuchsiaResourceDialect,
391                0x6d29d1a6edf9a614,
392            >(_buf?)?;
393            Ok((_response.status, _response.name))
394        }
395        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<String>)>(
396            (),
397            0x6d29d1a6edf9a614,
398            fidl::encoding::DynamicFlags::empty(),
399            _decode,
400        )
401    }
402
403    type GetBoardRevisionResponseFut =
404        fidl::client::QueryResponseFut<(i32, u32), fidl::encoding::DefaultFuchsiaResourceDialect>;
405    fn r#get_board_revision(&self) -> Self::GetBoardRevisionResponseFut {
406        fn _decode(
407            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
408        ) -> Result<(i32, u32), fidl::Error> {
409            let _response = fidl::client::decode_transaction_body::<
410                SysInfoGetBoardRevisionResponse,
411                fidl::encoding::DefaultFuchsiaResourceDialect,
412                0x3dd050d99012e9cc,
413            >(_buf?)?;
414            Ok((_response.status, _response.revision))
415        }
416        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, u32)>(
417            (),
418            0x3dd050d99012e9cc,
419            fidl::encoding::DynamicFlags::empty(),
420            _decode,
421        )
422    }
423
424    type GetBootloaderVendorResponseFut = fidl::client::QueryResponseFut<
425        (i32, Option<String>),
426        fidl::encoding::DefaultFuchsiaResourceDialect,
427    >;
428    fn r#get_bootloader_vendor(&self) -> Self::GetBootloaderVendorResponseFut {
429        fn _decode(
430            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
431        ) -> Result<(i32, Option<String>), fidl::Error> {
432            let _response = fidl::client::decode_transaction_body::<
433                SysInfoGetBootloaderVendorResponse,
434                fidl::encoding::DefaultFuchsiaResourceDialect,
435                0x2511f1c2f9ae2017,
436            >(_buf?)?;
437            Ok((_response.status, _response.vendor))
438        }
439        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<String>)>(
440            (),
441            0x2511f1c2f9ae2017,
442            fidl::encoding::DynamicFlags::empty(),
443            _decode,
444        )
445    }
446
447    type GetInterruptControllerInfoResponseFut = fidl::client::QueryResponseFut<
448        (i32, Option<Box<InterruptControllerInfo>>),
449        fidl::encoding::DefaultFuchsiaResourceDialect,
450    >;
451    fn r#get_interrupt_controller_info(&self) -> Self::GetInterruptControllerInfoResponseFut {
452        fn _decode(
453            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
454        ) -> Result<(i32, Option<Box<InterruptControllerInfo>>), fidl::Error> {
455            let _response = fidl::client::decode_transaction_body::<
456                SysInfoGetInterruptControllerInfoResponse,
457                fidl::encoding::DefaultFuchsiaResourceDialect,
458                0x31a438b28dca119c,
459            >(_buf?)?;
460            Ok((_response.status, _response.info))
461        }
462        self.client.send_query_and_decode::<
463            fidl::encoding::EmptyPayload,
464            (i32, Option<Box<InterruptControllerInfo>>),
465        >(
466            (),
467            0x31a438b28dca119c,
468            fidl::encoding::DynamicFlags::empty(),
469            _decode,
470        )
471    }
472
473    type GetSerialNumberResponseFut = fidl::client::QueryResponseFut<
474        SysInfoGetSerialNumberResult,
475        fidl::encoding::DefaultFuchsiaResourceDialect,
476    >;
477    fn r#get_serial_number(&self) -> Self::GetSerialNumberResponseFut {
478        fn _decode(
479            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
480        ) -> Result<SysInfoGetSerialNumberResult, fidl::Error> {
481            let _response = fidl::client::decode_transaction_body::<
482                fidl::encoding::ResultType<SysInfoGetSerialNumberResponse, i32>,
483                fidl::encoding::DefaultFuchsiaResourceDialect,
484                0x3b6920410a59f01f,
485            >(_buf?)?;
486            Ok(_response.map(|x| x.serial))
487        }
488        self.client
489            .send_query_and_decode::<fidl::encoding::EmptyPayload, SysInfoGetSerialNumberResult>(
490                (),
491                0x3b6920410a59f01f,
492                fidl::encoding::DynamicFlags::empty(),
493                _decode,
494            )
495    }
496}
497
498pub struct SysInfoEventStream {
499    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
500}
501
502impl std::marker::Unpin for SysInfoEventStream {}
503
504impl futures::stream::FusedStream for SysInfoEventStream {
505    fn is_terminated(&self) -> bool {
506        self.event_receiver.is_terminated()
507    }
508}
509
510impl futures::Stream for SysInfoEventStream {
511    type Item = Result<SysInfoEvent, 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        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
518            &mut self.event_receiver,
519            cx
520        )?) {
521            Some(buf) => std::task::Poll::Ready(Some(SysInfoEvent::decode(buf))),
522            None => std::task::Poll::Ready(None),
523        }
524    }
525}
526
527#[derive(Debug)]
528pub enum SysInfoEvent {}
529
530impl SysInfoEvent {
531    /// Decodes a message buffer as a [`SysInfoEvent`].
532    fn decode(
533        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
534    ) -> Result<SysInfoEvent, fidl::Error> {
535        let (bytes, _handles) = buf.split_mut();
536        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
537        debug_assert_eq!(tx_header.tx_id, 0);
538        match tx_header.ordinal {
539            _ => Err(fidl::Error::UnknownOrdinal {
540                ordinal: tx_header.ordinal,
541                protocol_name: <SysInfoMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
542            }),
543        }
544    }
545}
546
547/// A Stream of incoming requests for fuchsia.sysinfo/SysInfo.
548pub struct SysInfoRequestStream {
549    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
550    is_terminated: bool,
551}
552
553impl std::marker::Unpin for SysInfoRequestStream {}
554
555impl futures::stream::FusedStream for SysInfoRequestStream {
556    fn is_terminated(&self) -> bool {
557        self.is_terminated
558    }
559}
560
561impl fidl::endpoints::RequestStream for SysInfoRequestStream {
562    type Protocol = SysInfoMarker;
563    type ControlHandle = SysInfoControlHandle;
564
565    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
566        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
567    }
568
569    fn control_handle(&self) -> Self::ControlHandle {
570        SysInfoControlHandle { inner: self.inner.clone() }
571    }
572
573    fn into_inner(
574        self,
575    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
576    {
577        (self.inner, self.is_terminated)
578    }
579
580    fn from_inner(
581        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
582        is_terminated: bool,
583    ) -> Self {
584        Self { inner, is_terminated }
585    }
586}
587
588impl futures::Stream for SysInfoRequestStream {
589    type Item = Result<SysInfoRequest, fidl::Error>;
590
591    fn poll_next(
592        mut self: std::pin::Pin<&mut Self>,
593        cx: &mut std::task::Context<'_>,
594    ) -> std::task::Poll<Option<Self::Item>> {
595        let this = &mut *self;
596        if this.inner.check_shutdown(cx) {
597            this.is_terminated = true;
598            return std::task::Poll::Ready(None);
599        }
600        if this.is_terminated {
601            panic!("polled SysInfoRequestStream after completion");
602        }
603        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
604            |bytes, handles| {
605                match this.inner.channel().read_etc(cx, bytes, handles) {
606                    std::task::Poll::Ready(Ok(())) => {}
607                    std::task::Poll::Pending => return std::task::Poll::Pending,
608                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
609                        this.is_terminated = true;
610                        return std::task::Poll::Ready(None);
611                    }
612                    std::task::Poll::Ready(Err(e)) => {
613                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
614                            e.into(),
615                        ))))
616                    }
617                }
618
619                // A message has been received from the channel
620                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
621
622                std::task::Poll::Ready(Some(match header.ordinal {
623                    0x6d29d1a6edf9a614 => {
624                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
625                        let mut req = fidl::new_empty!(
626                            fidl::encoding::EmptyPayload,
627                            fidl::encoding::DefaultFuchsiaResourceDialect
628                        );
629                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
630                        let control_handle = SysInfoControlHandle { inner: this.inner.clone() };
631                        Ok(SysInfoRequest::GetBoardName {
632                            responder: SysInfoGetBoardNameResponder {
633                                control_handle: std::mem::ManuallyDrop::new(control_handle),
634                                tx_id: header.tx_id,
635                            },
636                        })
637                    }
638                    0x3dd050d99012e9cc => {
639                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
640                        let mut req = fidl::new_empty!(
641                            fidl::encoding::EmptyPayload,
642                            fidl::encoding::DefaultFuchsiaResourceDialect
643                        );
644                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
645                        let control_handle = SysInfoControlHandle { inner: this.inner.clone() };
646                        Ok(SysInfoRequest::GetBoardRevision {
647                            responder: SysInfoGetBoardRevisionResponder {
648                                control_handle: std::mem::ManuallyDrop::new(control_handle),
649                                tx_id: header.tx_id,
650                            },
651                        })
652                    }
653                    0x2511f1c2f9ae2017 => {
654                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
655                        let mut req = fidl::new_empty!(
656                            fidl::encoding::EmptyPayload,
657                            fidl::encoding::DefaultFuchsiaResourceDialect
658                        );
659                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
660                        let control_handle = SysInfoControlHandle { inner: this.inner.clone() };
661                        Ok(SysInfoRequest::GetBootloaderVendor {
662                            responder: SysInfoGetBootloaderVendorResponder {
663                                control_handle: std::mem::ManuallyDrop::new(control_handle),
664                                tx_id: header.tx_id,
665                            },
666                        })
667                    }
668                    0x31a438b28dca119c => {
669                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
670                        let mut req = fidl::new_empty!(
671                            fidl::encoding::EmptyPayload,
672                            fidl::encoding::DefaultFuchsiaResourceDialect
673                        );
674                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
675                        let control_handle = SysInfoControlHandle { inner: this.inner.clone() };
676                        Ok(SysInfoRequest::GetInterruptControllerInfo {
677                            responder: SysInfoGetInterruptControllerInfoResponder {
678                                control_handle: std::mem::ManuallyDrop::new(control_handle),
679                                tx_id: header.tx_id,
680                            },
681                        })
682                    }
683                    0x3b6920410a59f01f => {
684                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
685                        let mut req = fidl::new_empty!(
686                            fidl::encoding::EmptyPayload,
687                            fidl::encoding::DefaultFuchsiaResourceDialect
688                        );
689                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
690                        let control_handle = SysInfoControlHandle { inner: this.inner.clone() };
691                        Ok(SysInfoRequest::GetSerialNumber {
692                            responder: SysInfoGetSerialNumberResponder {
693                                control_handle: std::mem::ManuallyDrop::new(control_handle),
694                                tx_id: header.tx_id,
695                            },
696                        })
697                    }
698                    _ => Err(fidl::Error::UnknownOrdinal {
699                        ordinal: header.ordinal,
700                        protocol_name:
701                            <SysInfoMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
702                    }),
703                }))
704            },
705        )
706    }
707}
708
709#[derive(Debug)]
710pub enum SysInfoRequest {
711    /// Return the board name for the platform we are running on.
712    GetBoardName {
713        responder: SysInfoGetBoardNameResponder,
714    },
715    /// Return the board revision for the board we are running on.
716    GetBoardRevision {
717        responder: SysInfoGetBoardRevisionResponder,
718    },
719    /// Return the bootloader vendor for the platform we are running on.
720    GetBootloaderVendor {
721        responder: SysInfoGetBootloaderVendorResponder,
722    },
723    /// Return interrupt controller information.
724    GetInterruptControllerInfo {
725        responder: SysInfoGetInterruptControllerInfoResponder,
726    },
727    GetSerialNumber {
728        responder: SysInfoGetSerialNumberResponder,
729    },
730}
731
732impl SysInfoRequest {
733    #[allow(irrefutable_let_patterns)]
734    pub fn into_get_board_name(self) -> Option<(SysInfoGetBoardNameResponder)> {
735        if let SysInfoRequest::GetBoardName { responder } = self {
736            Some((responder))
737        } else {
738            None
739        }
740    }
741
742    #[allow(irrefutable_let_patterns)]
743    pub fn into_get_board_revision(self) -> Option<(SysInfoGetBoardRevisionResponder)> {
744        if let SysInfoRequest::GetBoardRevision { responder } = self {
745            Some((responder))
746        } else {
747            None
748        }
749    }
750
751    #[allow(irrefutable_let_patterns)]
752    pub fn into_get_bootloader_vendor(self) -> Option<(SysInfoGetBootloaderVendorResponder)> {
753        if let SysInfoRequest::GetBootloaderVendor { responder } = self {
754            Some((responder))
755        } else {
756            None
757        }
758    }
759
760    #[allow(irrefutable_let_patterns)]
761    pub fn into_get_interrupt_controller_info(
762        self,
763    ) -> Option<(SysInfoGetInterruptControllerInfoResponder)> {
764        if let SysInfoRequest::GetInterruptControllerInfo { responder } = self {
765            Some((responder))
766        } else {
767            None
768        }
769    }
770
771    #[allow(irrefutable_let_patterns)]
772    pub fn into_get_serial_number(self) -> Option<(SysInfoGetSerialNumberResponder)> {
773        if let SysInfoRequest::GetSerialNumber { responder } = self {
774            Some((responder))
775        } else {
776            None
777        }
778    }
779
780    /// Name of the method defined in FIDL
781    pub fn method_name(&self) -> &'static str {
782        match *self {
783            SysInfoRequest::GetBoardName { .. } => "get_board_name",
784            SysInfoRequest::GetBoardRevision { .. } => "get_board_revision",
785            SysInfoRequest::GetBootloaderVendor { .. } => "get_bootloader_vendor",
786            SysInfoRequest::GetInterruptControllerInfo { .. } => "get_interrupt_controller_info",
787            SysInfoRequest::GetSerialNumber { .. } => "get_serial_number",
788        }
789    }
790}
791
792#[derive(Debug, Clone)]
793pub struct SysInfoControlHandle {
794    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
795}
796
797impl fidl::endpoints::ControlHandle for SysInfoControlHandle {
798    fn shutdown(&self) {
799        self.inner.shutdown()
800    }
801    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
802        self.inner.shutdown_with_epitaph(status)
803    }
804
805    fn is_closed(&self) -> bool {
806        self.inner.channel().is_closed()
807    }
808    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
809        self.inner.channel().on_closed()
810    }
811
812    #[cfg(target_os = "fuchsia")]
813    fn signal_peer(
814        &self,
815        clear_mask: zx::Signals,
816        set_mask: zx::Signals,
817    ) -> Result<(), zx_status::Status> {
818        use fidl::Peered;
819        self.inner.channel().signal_peer(clear_mask, set_mask)
820    }
821}
822
823impl SysInfoControlHandle {}
824
825#[must_use = "FIDL methods require a response to be sent"]
826#[derive(Debug)]
827pub struct SysInfoGetBoardNameResponder {
828    control_handle: std::mem::ManuallyDrop<SysInfoControlHandle>,
829    tx_id: u32,
830}
831
832/// Set the the channel to be shutdown (see [`SysInfoControlHandle::shutdown`])
833/// if the responder is dropped without sending a response, so that the client
834/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
835impl std::ops::Drop for SysInfoGetBoardNameResponder {
836    fn drop(&mut self) {
837        self.control_handle.shutdown();
838        // Safety: drops once, never accessed again
839        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
840    }
841}
842
843impl fidl::endpoints::Responder for SysInfoGetBoardNameResponder {
844    type ControlHandle = SysInfoControlHandle;
845
846    fn control_handle(&self) -> &SysInfoControlHandle {
847        &self.control_handle
848    }
849
850    fn drop_without_shutdown(mut self) {
851        // Safety: drops once, never accessed again due to mem::forget
852        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
853        // Prevent Drop from running (which would shut down the channel)
854        std::mem::forget(self);
855    }
856}
857
858impl SysInfoGetBoardNameResponder {
859    /// Sends a response to the FIDL transaction.
860    ///
861    /// Sets the channel to shutdown if an error occurs.
862    pub fn send(self, mut status: i32, mut name: Option<&str>) -> Result<(), fidl::Error> {
863        let _result = self.send_raw(status, name);
864        if _result.is_err() {
865            self.control_handle.shutdown();
866        }
867        self.drop_without_shutdown();
868        _result
869    }
870
871    /// Similar to "send" but does not shutdown the channel if an error occurs.
872    pub fn send_no_shutdown_on_err(
873        self,
874        mut status: i32,
875        mut name: Option<&str>,
876    ) -> Result<(), fidl::Error> {
877        let _result = self.send_raw(status, name);
878        self.drop_without_shutdown();
879        _result
880    }
881
882    fn send_raw(&self, mut status: i32, mut name: Option<&str>) -> Result<(), fidl::Error> {
883        self.control_handle.inner.send::<SysInfoGetBoardNameResponse>(
884            (status, name),
885            self.tx_id,
886            0x6d29d1a6edf9a614,
887            fidl::encoding::DynamicFlags::empty(),
888        )
889    }
890}
891
892#[must_use = "FIDL methods require a response to be sent"]
893#[derive(Debug)]
894pub struct SysInfoGetBoardRevisionResponder {
895    control_handle: std::mem::ManuallyDrop<SysInfoControlHandle>,
896    tx_id: u32,
897}
898
899/// Set the the channel to be shutdown (see [`SysInfoControlHandle::shutdown`])
900/// if the responder is dropped without sending a response, so that the client
901/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
902impl std::ops::Drop for SysInfoGetBoardRevisionResponder {
903    fn drop(&mut self) {
904        self.control_handle.shutdown();
905        // Safety: drops once, never accessed again
906        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
907    }
908}
909
910impl fidl::endpoints::Responder for SysInfoGetBoardRevisionResponder {
911    type ControlHandle = SysInfoControlHandle;
912
913    fn control_handle(&self) -> &SysInfoControlHandle {
914        &self.control_handle
915    }
916
917    fn drop_without_shutdown(mut self) {
918        // Safety: drops once, never accessed again due to mem::forget
919        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
920        // Prevent Drop from running (which would shut down the channel)
921        std::mem::forget(self);
922    }
923}
924
925impl SysInfoGetBoardRevisionResponder {
926    /// Sends a response to the FIDL transaction.
927    ///
928    /// Sets the channel to shutdown if an error occurs.
929    pub fn send(self, mut status: i32, mut revision: u32) -> Result<(), fidl::Error> {
930        let _result = self.send_raw(status, revision);
931        if _result.is_err() {
932            self.control_handle.shutdown();
933        }
934        self.drop_without_shutdown();
935        _result
936    }
937
938    /// Similar to "send" but does not shutdown the channel if an error occurs.
939    pub fn send_no_shutdown_on_err(
940        self,
941        mut status: i32,
942        mut revision: u32,
943    ) -> Result<(), fidl::Error> {
944        let _result = self.send_raw(status, revision);
945        self.drop_without_shutdown();
946        _result
947    }
948
949    fn send_raw(&self, mut status: i32, mut revision: u32) -> Result<(), fidl::Error> {
950        self.control_handle.inner.send::<SysInfoGetBoardRevisionResponse>(
951            (status, revision),
952            self.tx_id,
953            0x3dd050d99012e9cc,
954            fidl::encoding::DynamicFlags::empty(),
955        )
956    }
957}
958
959#[must_use = "FIDL methods require a response to be sent"]
960#[derive(Debug)]
961pub struct SysInfoGetBootloaderVendorResponder {
962    control_handle: std::mem::ManuallyDrop<SysInfoControlHandle>,
963    tx_id: u32,
964}
965
966/// Set the the channel to be shutdown (see [`SysInfoControlHandle::shutdown`])
967/// if the responder is dropped without sending a response, so that the client
968/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
969impl std::ops::Drop for SysInfoGetBootloaderVendorResponder {
970    fn drop(&mut self) {
971        self.control_handle.shutdown();
972        // Safety: drops once, never accessed again
973        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
974    }
975}
976
977impl fidl::endpoints::Responder for SysInfoGetBootloaderVendorResponder {
978    type ControlHandle = SysInfoControlHandle;
979
980    fn control_handle(&self) -> &SysInfoControlHandle {
981        &self.control_handle
982    }
983
984    fn drop_without_shutdown(mut self) {
985        // Safety: drops once, never accessed again due to mem::forget
986        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
987        // Prevent Drop from running (which would shut down the channel)
988        std::mem::forget(self);
989    }
990}
991
992impl SysInfoGetBootloaderVendorResponder {
993    /// Sends a response to the FIDL transaction.
994    ///
995    /// Sets the channel to shutdown if an error occurs.
996    pub fn send(self, mut status: i32, mut vendor: Option<&str>) -> Result<(), fidl::Error> {
997        let _result = self.send_raw(status, vendor);
998        if _result.is_err() {
999            self.control_handle.shutdown();
1000        }
1001        self.drop_without_shutdown();
1002        _result
1003    }
1004
1005    /// Similar to "send" but does not shutdown the channel if an error occurs.
1006    pub fn send_no_shutdown_on_err(
1007        self,
1008        mut status: i32,
1009        mut vendor: Option<&str>,
1010    ) -> Result<(), fidl::Error> {
1011        let _result = self.send_raw(status, vendor);
1012        self.drop_without_shutdown();
1013        _result
1014    }
1015
1016    fn send_raw(&self, mut status: i32, mut vendor: Option<&str>) -> Result<(), fidl::Error> {
1017        self.control_handle.inner.send::<SysInfoGetBootloaderVendorResponse>(
1018            (status, vendor),
1019            self.tx_id,
1020            0x2511f1c2f9ae2017,
1021            fidl::encoding::DynamicFlags::empty(),
1022        )
1023    }
1024}
1025
1026#[must_use = "FIDL methods require a response to be sent"]
1027#[derive(Debug)]
1028pub struct SysInfoGetInterruptControllerInfoResponder {
1029    control_handle: std::mem::ManuallyDrop<SysInfoControlHandle>,
1030    tx_id: u32,
1031}
1032
1033/// Set the the channel to be shutdown (see [`SysInfoControlHandle::shutdown`])
1034/// if the responder is dropped without sending a response, so that the client
1035/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1036impl std::ops::Drop for SysInfoGetInterruptControllerInfoResponder {
1037    fn drop(&mut self) {
1038        self.control_handle.shutdown();
1039        // Safety: drops once, never accessed again
1040        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1041    }
1042}
1043
1044impl fidl::endpoints::Responder for SysInfoGetInterruptControllerInfoResponder {
1045    type ControlHandle = SysInfoControlHandle;
1046
1047    fn control_handle(&self) -> &SysInfoControlHandle {
1048        &self.control_handle
1049    }
1050
1051    fn drop_without_shutdown(mut self) {
1052        // Safety: drops once, never accessed again due to mem::forget
1053        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1054        // Prevent Drop from running (which would shut down the channel)
1055        std::mem::forget(self);
1056    }
1057}
1058
1059impl SysInfoGetInterruptControllerInfoResponder {
1060    /// Sends a response to the FIDL transaction.
1061    ///
1062    /// Sets the channel to shutdown if an error occurs.
1063    pub fn send(
1064        self,
1065        mut status: i32,
1066        mut info: Option<&InterruptControllerInfo>,
1067    ) -> Result<(), fidl::Error> {
1068        let _result = self.send_raw(status, info);
1069        if _result.is_err() {
1070            self.control_handle.shutdown();
1071        }
1072        self.drop_without_shutdown();
1073        _result
1074    }
1075
1076    /// Similar to "send" but does not shutdown the channel if an error occurs.
1077    pub fn send_no_shutdown_on_err(
1078        self,
1079        mut status: i32,
1080        mut info: Option<&InterruptControllerInfo>,
1081    ) -> Result<(), fidl::Error> {
1082        let _result = self.send_raw(status, info);
1083        self.drop_without_shutdown();
1084        _result
1085    }
1086
1087    fn send_raw(
1088        &self,
1089        mut status: i32,
1090        mut info: Option<&InterruptControllerInfo>,
1091    ) -> Result<(), fidl::Error> {
1092        self.control_handle.inner.send::<SysInfoGetInterruptControllerInfoResponse>(
1093            (status, info),
1094            self.tx_id,
1095            0x31a438b28dca119c,
1096            fidl::encoding::DynamicFlags::empty(),
1097        )
1098    }
1099}
1100
1101#[must_use = "FIDL methods require a response to be sent"]
1102#[derive(Debug)]
1103pub struct SysInfoGetSerialNumberResponder {
1104    control_handle: std::mem::ManuallyDrop<SysInfoControlHandle>,
1105    tx_id: u32,
1106}
1107
1108/// Set the the channel to be shutdown (see [`SysInfoControlHandle::shutdown`])
1109/// if the responder is dropped without sending a response, so that the client
1110/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1111impl std::ops::Drop for SysInfoGetSerialNumberResponder {
1112    fn drop(&mut self) {
1113        self.control_handle.shutdown();
1114        // Safety: drops once, never accessed again
1115        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1116    }
1117}
1118
1119impl fidl::endpoints::Responder for SysInfoGetSerialNumberResponder {
1120    type ControlHandle = SysInfoControlHandle;
1121
1122    fn control_handle(&self) -> &SysInfoControlHandle {
1123        &self.control_handle
1124    }
1125
1126    fn drop_without_shutdown(mut self) {
1127        // Safety: drops once, never accessed again due to mem::forget
1128        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1129        // Prevent Drop from running (which would shut down the channel)
1130        std::mem::forget(self);
1131    }
1132}
1133
1134impl SysInfoGetSerialNumberResponder {
1135    /// Sends a response to the FIDL transaction.
1136    ///
1137    /// Sets the channel to shutdown if an error occurs.
1138    pub fn send(self, mut result: Result<&str, i32>) -> Result<(), fidl::Error> {
1139        let _result = self.send_raw(result);
1140        if _result.is_err() {
1141            self.control_handle.shutdown();
1142        }
1143        self.drop_without_shutdown();
1144        _result
1145    }
1146
1147    /// Similar to "send" but does not shutdown the channel if an error occurs.
1148    pub fn send_no_shutdown_on_err(self, mut result: Result<&str, i32>) -> Result<(), fidl::Error> {
1149        let _result = self.send_raw(result);
1150        self.drop_without_shutdown();
1151        _result
1152    }
1153
1154    fn send_raw(&self, mut result: Result<&str, i32>) -> Result<(), fidl::Error> {
1155        self.control_handle
1156            .inner
1157            .send::<fidl::encoding::ResultType<SysInfoGetSerialNumberResponse, i32>>(
1158                result.map(|serial| (serial,)),
1159                self.tx_id,
1160                0x3b6920410a59f01f,
1161                fidl::encoding::DynamicFlags::empty(),
1162            )
1163    }
1164}
1165
1166#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1167pub struct ServiceMarker;
1168
1169#[cfg(target_os = "fuchsia")]
1170impl fidl::endpoints::ServiceMarker for ServiceMarker {
1171    type Proxy = ServiceProxy;
1172    type Request = ServiceRequest;
1173    const SERVICE_NAME: &'static str = "fuchsia.sysinfo.Service";
1174}
1175
1176/// A request for one of the member protocols of Service.
1177///
1178#[cfg(target_os = "fuchsia")]
1179pub enum ServiceRequest {
1180    Device(SysInfoRequestStream),
1181}
1182
1183#[cfg(target_os = "fuchsia")]
1184impl fidl::endpoints::ServiceRequest for ServiceRequest {
1185    type Service = ServiceMarker;
1186
1187    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
1188        match name {
1189            "device" => Self::Device(
1190                <SysInfoRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
1191            ),
1192            _ => panic!("no such member protocol name for service Service"),
1193        }
1194    }
1195
1196    fn member_names() -> &'static [&'static str] {
1197        &["device"]
1198    }
1199}
1200#[cfg(target_os = "fuchsia")]
1201pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
1202
1203#[cfg(target_os = "fuchsia")]
1204impl fidl::endpoints::ServiceProxy for ServiceProxy {
1205    type Service = ServiceMarker;
1206
1207    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
1208        Self(opener)
1209    }
1210}
1211
1212#[cfg(target_os = "fuchsia")]
1213impl ServiceProxy {
1214    pub fn connect_to_device(&self) -> Result<SysInfoProxy, fidl::Error> {
1215        let (proxy, server_end) = fidl::endpoints::create_proxy::<SysInfoMarker>();
1216        self.connect_channel_to_device(server_end)?;
1217        Ok(proxy)
1218    }
1219
1220    /// Like `connect_to_device`, but returns a sync proxy.
1221    /// See [`Self::connect_to_device`] for more details.
1222    pub fn connect_to_device_sync(&self) -> Result<SysInfoSynchronousProxy, fidl::Error> {
1223        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<SysInfoMarker>();
1224        self.connect_channel_to_device(server_end)?;
1225        Ok(proxy)
1226    }
1227
1228    /// Like `connect_to_device`, but accepts a server end.
1229    /// See [`Self::connect_to_device`] for more details.
1230    pub fn connect_channel_to_device(
1231        &self,
1232        server_end: fidl::endpoints::ServerEnd<SysInfoMarker>,
1233    ) -> Result<(), fidl::Error> {
1234        self.0.open_member("device", server_end.into_channel())
1235    }
1236
1237    pub fn instance_name(&self) -> &str {
1238        self.0.instance_name()
1239    }
1240}
1241
1242mod internal {
1243    use super::*;
1244    unsafe impl fidl::encoding::TypeMarker for InterruptControllerType {
1245        type Owned = Self;
1246
1247        #[inline(always)]
1248        fn inline_align(_context: fidl::encoding::Context) -> usize {
1249            std::mem::align_of::<u32>()
1250        }
1251
1252        #[inline(always)]
1253        fn inline_size(_context: fidl::encoding::Context) -> usize {
1254            std::mem::size_of::<u32>()
1255        }
1256
1257        #[inline(always)]
1258        fn encode_is_copy() -> bool {
1259            false
1260        }
1261
1262        #[inline(always)]
1263        fn decode_is_copy() -> bool {
1264            false
1265        }
1266    }
1267
1268    impl fidl::encoding::ValueTypeMarker for InterruptControllerType {
1269        type Borrowed<'a> = Self;
1270        #[inline(always)]
1271        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1272            *value
1273        }
1274    }
1275
1276    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1277        for InterruptControllerType
1278    {
1279        #[inline]
1280        unsafe fn encode(
1281            self,
1282            encoder: &mut fidl::encoding::Encoder<'_, D>,
1283            offset: usize,
1284            _depth: fidl::encoding::Depth,
1285        ) -> fidl::Result<()> {
1286            encoder.debug_check_bounds::<Self>(offset);
1287            encoder.write_num(self.into_primitive(), offset);
1288            Ok(())
1289        }
1290    }
1291
1292    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1293        for InterruptControllerType
1294    {
1295        #[inline(always)]
1296        fn new_empty() -> Self {
1297            Self::unknown()
1298        }
1299
1300        #[inline]
1301        unsafe fn decode(
1302            &mut self,
1303            decoder: &mut fidl::encoding::Decoder<'_, D>,
1304            offset: usize,
1305            _depth: fidl::encoding::Depth,
1306        ) -> fidl::Result<()> {
1307            decoder.debug_check_bounds::<Self>(offset);
1308            let prim = decoder.read_num::<u32>(offset);
1309
1310            *self = Self::from_primitive_allow_unknown(prim);
1311            Ok(())
1312        }
1313    }
1314
1315    impl fidl::encoding::ValueTypeMarker for InterruptControllerInfo {
1316        type Borrowed<'a> = &'a Self;
1317        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1318            value
1319        }
1320    }
1321
1322    unsafe impl fidl::encoding::TypeMarker for InterruptControllerInfo {
1323        type Owned = Self;
1324
1325        #[inline(always)]
1326        fn inline_align(_context: fidl::encoding::Context) -> usize {
1327            4
1328        }
1329
1330        #[inline(always)]
1331        fn inline_size(_context: fidl::encoding::Context) -> usize {
1332            4
1333        }
1334    }
1335
1336    unsafe impl<D: fidl::encoding::ResourceDialect>
1337        fidl::encoding::Encode<InterruptControllerInfo, D> for &InterruptControllerInfo
1338    {
1339        #[inline]
1340        unsafe fn encode(
1341            self,
1342            encoder: &mut fidl::encoding::Encoder<'_, D>,
1343            offset: usize,
1344            _depth: fidl::encoding::Depth,
1345        ) -> fidl::Result<()> {
1346            encoder.debug_check_bounds::<InterruptControllerInfo>(offset);
1347            // Delegate to tuple encoding.
1348            fidl::encoding::Encode::<InterruptControllerInfo, D>::encode(
1349                (<InterruptControllerType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),),
1350                encoder,
1351                offset,
1352                _depth,
1353            )
1354        }
1355    }
1356    unsafe impl<
1357            D: fidl::encoding::ResourceDialect,
1358            T0: fidl::encoding::Encode<InterruptControllerType, D>,
1359        > fidl::encoding::Encode<InterruptControllerInfo, D> for (T0,)
1360    {
1361        #[inline]
1362        unsafe fn encode(
1363            self,
1364            encoder: &mut fidl::encoding::Encoder<'_, D>,
1365            offset: usize,
1366            depth: fidl::encoding::Depth,
1367        ) -> fidl::Result<()> {
1368            encoder.debug_check_bounds::<InterruptControllerInfo>(offset);
1369            // Zero out padding regions. There's no need to apply masks
1370            // because the unmasked parts will be overwritten by fields.
1371            // Write the fields.
1372            self.0.encode(encoder, offset + 0, depth)?;
1373            Ok(())
1374        }
1375    }
1376
1377    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1378        for InterruptControllerInfo
1379    {
1380        #[inline(always)]
1381        fn new_empty() -> Self {
1382            Self { type_: fidl::new_empty!(InterruptControllerType, D) }
1383        }
1384
1385        #[inline]
1386        unsafe fn decode(
1387            &mut self,
1388            decoder: &mut fidl::encoding::Decoder<'_, D>,
1389            offset: usize,
1390            _depth: fidl::encoding::Depth,
1391        ) -> fidl::Result<()> {
1392            decoder.debug_check_bounds::<Self>(offset);
1393            // Verify that padding bytes are zero.
1394            fidl::decode!(
1395                InterruptControllerType,
1396                D,
1397                &mut self.type_,
1398                decoder,
1399                offset + 0,
1400                _depth
1401            )?;
1402            Ok(())
1403        }
1404    }
1405
1406    impl fidl::encoding::ValueTypeMarker for SysInfoGetBoardNameResponse {
1407        type Borrowed<'a> = &'a Self;
1408        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1409            value
1410        }
1411    }
1412
1413    unsafe impl fidl::encoding::TypeMarker for SysInfoGetBoardNameResponse {
1414        type Owned = Self;
1415
1416        #[inline(always)]
1417        fn inline_align(_context: fidl::encoding::Context) -> usize {
1418            8
1419        }
1420
1421        #[inline(always)]
1422        fn inline_size(_context: fidl::encoding::Context) -> usize {
1423            24
1424        }
1425    }
1426
1427    unsafe impl<D: fidl::encoding::ResourceDialect>
1428        fidl::encoding::Encode<SysInfoGetBoardNameResponse, D> for &SysInfoGetBoardNameResponse
1429    {
1430        #[inline]
1431        unsafe fn encode(
1432            self,
1433            encoder: &mut fidl::encoding::Encoder<'_, D>,
1434            offset: usize,
1435            _depth: fidl::encoding::Depth,
1436        ) -> fidl::Result<()> {
1437            encoder.debug_check_bounds::<SysInfoGetBoardNameResponse>(offset);
1438            // Delegate to tuple encoding.
1439            fidl::encoding::Encode::<SysInfoGetBoardNameResponse, D>::encode(
1440                (
1441                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1442                    <fidl::encoding::Optional<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
1443                ),
1444                encoder, offset, _depth
1445            )
1446        }
1447    }
1448    unsafe impl<
1449            D: fidl::encoding::ResourceDialect,
1450            T0: fidl::encoding::Encode<i32, D>,
1451            T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<32>>, D>,
1452        > fidl::encoding::Encode<SysInfoGetBoardNameResponse, D> for (T0, T1)
1453    {
1454        #[inline]
1455        unsafe fn encode(
1456            self,
1457            encoder: &mut fidl::encoding::Encoder<'_, D>,
1458            offset: usize,
1459            depth: fidl::encoding::Depth,
1460        ) -> fidl::Result<()> {
1461            encoder.debug_check_bounds::<SysInfoGetBoardNameResponse>(offset);
1462            // Zero out padding regions. There's no need to apply masks
1463            // because the unmasked parts will be overwritten by fields.
1464            unsafe {
1465                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1466                (ptr as *mut u64).write_unaligned(0);
1467            }
1468            // Write the fields.
1469            self.0.encode(encoder, offset + 0, depth)?;
1470            self.1.encode(encoder, offset + 8, depth)?;
1471            Ok(())
1472        }
1473    }
1474
1475    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1476        for SysInfoGetBoardNameResponse
1477    {
1478        #[inline(always)]
1479        fn new_empty() -> Self {
1480            Self {
1481                status: fidl::new_empty!(i32, D),
1482                name: fidl::new_empty!(
1483                    fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
1484                    D
1485                ),
1486            }
1487        }
1488
1489        #[inline]
1490        unsafe fn decode(
1491            &mut self,
1492            decoder: &mut fidl::encoding::Decoder<'_, D>,
1493            offset: usize,
1494            _depth: fidl::encoding::Depth,
1495        ) -> fidl::Result<()> {
1496            decoder.debug_check_bounds::<Self>(offset);
1497            // Verify that padding bytes are zero.
1498            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1499            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1500            let mask = 0xffffffff00000000u64;
1501            let maskedval = padval & mask;
1502            if maskedval != 0 {
1503                return Err(fidl::Error::NonZeroPadding {
1504                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1505                });
1506            }
1507            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1508            fidl::decode!(
1509                fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
1510                D,
1511                &mut self.name,
1512                decoder,
1513                offset + 8,
1514                _depth
1515            )?;
1516            Ok(())
1517        }
1518    }
1519
1520    impl fidl::encoding::ValueTypeMarker for SysInfoGetBoardRevisionResponse {
1521        type Borrowed<'a> = &'a Self;
1522        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1523            value
1524        }
1525    }
1526
1527    unsafe impl fidl::encoding::TypeMarker for SysInfoGetBoardRevisionResponse {
1528        type Owned = Self;
1529
1530        #[inline(always)]
1531        fn inline_align(_context: fidl::encoding::Context) -> usize {
1532            4
1533        }
1534
1535        #[inline(always)]
1536        fn inline_size(_context: fidl::encoding::Context) -> usize {
1537            8
1538        }
1539        #[inline(always)]
1540        fn encode_is_copy() -> bool {
1541            true
1542        }
1543
1544        #[inline(always)]
1545        fn decode_is_copy() -> bool {
1546            true
1547        }
1548    }
1549
1550    unsafe impl<D: fidl::encoding::ResourceDialect>
1551        fidl::encoding::Encode<SysInfoGetBoardRevisionResponse, D>
1552        for &SysInfoGetBoardRevisionResponse
1553    {
1554        #[inline]
1555        unsafe fn encode(
1556            self,
1557            encoder: &mut fidl::encoding::Encoder<'_, D>,
1558            offset: usize,
1559            _depth: fidl::encoding::Depth,
1560        ) -> fidl::Result<()> {
1561            encoder.debug_check_bounds::<SysInfoGetBoardRevisionResponse>(offset);
1562            unsafe {
1563                // Copy the object into the buffer.
1564                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1565                (buf_ptr as *mut SysInfoGetBoardRevisionResponse)
1566                    .write_unaligned((self as *const SysInfoGetBoardRevisionResponse).read());
1567                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1568                // done second because the memcpy will write garbage to these bytes.
1569            }
1570            Ok(())
1571        }
1572    }
1573    unsafe impl<
1574            D: fidl::encoding::ResourceDialect,
1575            T0: fidl::encoding::Encode<i32, D>,
1576            T1: fidl::encoding::Encode<u32, D>,
1577        > fidl::encoding::Encode<SysInfoGetBoardRevisionResponse, D> for (T0, T1)
1578    {
1579        #[inline]
1580        unsafe fn encode(
1581            self,
1582            encoder: &mut fidl::encoding::Encoder<'_, D>,
1583            offset: usize,
1584            depth: fidl::encoding::Depth,
1585        ) -> fidl::Result<()> {
1586            encoder.debug_check_bounds::<SysInfoGetBoardRevisionResponse>(offset);
1587            // Zero out padding regions. There's no need to apply masks
1588            // because the unmasked parts will be overwritten by fields.
1589            // Write the fields.
1590            self.0.encode(encoder, offset + 0, depth)?;
1591            self.1.encode(encoder, offset + 4, depth)?;
1592            Ok(())
1593        }
1594    }
1595
1596    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1597        for SysInfoGetBoardRevisionResponse
1598    {
1599        #[inline(always)]
1600        fn new_empty() -> Self {
1601            Self { status: fidl::new_empty!(i32, D), revision: fidl::new_empty!(u32, D) }
1602        }
1603
1604        #[inline]
1605        unsafe fn decode(
1606            &mut self,
1607            decoder: &mut fidl::encoding::Decoder<'_, D>,
1608            offset: usize,
1609            _depth: fidl::encoding::Depth,
1610        ) -> fidl::Result<()> {
1611            decoder.debug_check_bounds::<Self>(offset);
1612            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1613            // Verify that padding bytes are zero.
1614            // Copy from the buffer into the object.
1615            unsafe {
1616                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1617            }
1618            Ok(())
1619        }
1620    }
1621
1622    impl fidl::encoding::ValueTypeMarker for SysInfoGetBootloaderVendorResponse {
1623        type Borrowed<'a> = &'a Self;
1624        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1625            value
1626        }
1627    }
1628
1629    unsafe impl fidl::encoding::TypeMarker for SysInfoGetBootloaderVendorResponse {
1630        type Owned = Self;
1631
1632        #[inline(always)]
1633        fn inline_align(_context: fidl::encoding::Context) -> usize {
1634            8
1635        }
1636
1637        #[inline(always)]
1638        fn inline_size(_context: fidl::encoding::Context) -> usize {
1639            24
1640        }
1641    }
1642
1643    unsafe impl<D: fidl::encoding::ResourceDialect>
1644        fidl::encoding::Encode<SysInfoGetBootloaderVendorResponse, D>
1645        for &SysInfoGetBootloaderVendorResponse
1646    {
1647        #[inline]
1648        unsafe fn encode(
1649            self,
1650            encoder: &mut fidl::encoding::Encoder<'_, D>,
1651            offset: usize,
1652            _depth: fidl::encoding::Depth,
1653        ) -> fidl::Result<()> {
1654            encoder.debug_check_bounds::<SysInfoGetBootloaderVendorResponse>(offset);
1655            // Delegate to tuple encoding.
1656            fidl::encoding::Encode::<SysInfoGetBootloaderVendorResponse, D>::encode(
1657                (
1658                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1659                    <fidl::encoding::Optional<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.vendor),
1660                ),
1661                encoder, offset, _depth
1662            )
1663        }
1664    }
1665    unsafe impl<
1666            D: fidl::encoding::ResourceDialect,
1667            T0: fidl::encoding::Encode<i32, D>,
1668            T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<32>>, D>,
1669        > fidl::encoding::Encode<SysInfoGetBootloaderVendorResponse, D> for (T0, T1)
1670    {
1671        #[inline]
1672        unsafe fn encode(
1673            self,
1674            encoder: &mut fidl::encoding::Encoder<'_, D>,
1675            offset: usize,
1676            depth: fidl::encoding::Depth,
1677        ) -> fidl::Result<()> {
1678            encoder.debug_check_bounds::<SysInfoGetBootloaderVendorResponse>(offset);
1679            // Zero out padding regions. There's no need to apply masks
1680            // because the unmasked parts will be overwritten by fields.
1681            unsafe {
1682                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1683                (ptr as *mut u64).write_unaligned(0);
1684            }
1685            // Write the fields.
1686            self.0.encode(encoder, offset + 0, depth)?;
1687            self.1.encode(encoder, offset + 8, depth)?;
1688            Ok(())
1689        }
1690    }
1691
1692    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1693        for SysInfoGetBootloaderVendorResponse
1694    {
1695        #[inline(always)]
1696        fn new_empty() -> Self {
1697            Self {
1698                status: fidl::new_empty!(i32, D),
1699                vendor: fidl::new_empty!(
1700                    fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
1701                    D
1702                ),
1703            }
1704        }
1705
1706        #[inline]
1707        unsafe fn decode(
1708            &mut self,
1709            decoder: &mut fidl::encoding::Decoder<'_, D>,
1710            offset: usize,
1711            _depth: fidl::encoding::Depth,
1712        ) -> fidl::Result<()> {
1713            decoder.debug_check_bounds::<Self>(offset);
1714            // Verify that padding bytes are zero.
1715            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1716            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1717            let mask = 0xffffffff00000000u64;
1718            let maskedval = padval & mask;
1719            if maskedval != 0 {
1720                return Err(fidl::Error::NonZeroPadding {
1721                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1722                });
1723            }
1724            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1725            fidl::decode!(
1726                fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
1727                D,
1728                &mut self.vendor,
1729                decoder,
1730                offset + 8,
1731                _depth
1732            )?;
1733            Ok(())
1734        }
1735    }
1736
1737    impl fidl::encoding::ValueTypeMarker for SysInfoGetInterruptControllerInfoResponse {
1738        type Borrowed<'a> = &'a Self;
1739        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1740            value
1741        }
1742    }
1743
1744    unsafe impl fidl::encoding::TypeMarker for SysInfoGetInterruptControllerInfoResponse {
1745        type Owned = Self;
1746
1747        #[inline(always)]
1748        fn inline_align(_context: fidl::encoding::Context) -> usize {
1749            8
1750        }
1751
1752        #[inline(always)]
1753        fn inline_size(_context: fidl::encoding::Context) -> usize {
1754            16
1755        }
1756    }
1757
1758    unsafe impl<D: fidl::encoding::ResourceDialect>
1759        fidl::encoding::Encode<SysInfoGetInterruptControllerInfoResponse, D>
1760        for &SysInfoGetInterruptControllerInfoResponse
1761    {
1762        #[inline]
1763        unsafe fn encode(
1764            self,
1765            encoder: &mut fidl::encoding::Encoder<'_, D>,
1766            offset: usize,
1767            _depth: fidl::encoding::Depth,
1768        ) -> fidl::Result<()> {
1769            encoder.debug_check_bounds::<SysInfoGetInterruptControllerInfoResponse>(offset);
1770            // Delegate to tuple encoding.
1771            fidl::encoding::Encode::<SysInfoGetInterruptControllerInfoResponse, D>::encode(
1772                (
1773                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1774                    <fidl::encoding::Boxed<InterruptControllerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1775                ),
1776                encoder, offset, _depth
1777            )
1778        }
1779    }
1780    unsafe impl<
1781            D: fidl::encoding::ResourceDialect,
1782            T0: fidl::encoding::Encode<i32, D>,
1783            T1: fidl::encoding::Encode<fidl::encoding::Boxed<InterruptControllerInfo>, D>,
1784        > fidl::encoding::Encode<SysInfoGetInterruptControllerInfoResponse, D> for (T0, T1)
1785    {
1786        #[inline]
1787        unsafe fn encode(
1788            self,
1789            encoder: &mut fidl::encoding::Encoder<'_, D>,
1790            offset: usize,
1791            depth: fidl::encoding::Depth,
1792        ) -> fidl::Result<()> {
1793            encoder.debug_check_bounds::<SysInfoGetInterruptControllerInfoResponse>(offset);
1794            // Zero out padding regions. There's no need to apply masks
1795            // because the unmasked parts will be overwritten by fields.
1796            unsafe {
1797                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1798                (ptr as *mut u64).write_unaligned(0);
1799            }
1800            // Write the fields.
1801            self.0.encode(encoder, offset + 0, depth)?;
1802            self.1.encode(encoder, offset + 8, depth)?;
1803            Ok(())
1804        }
1805    }
1806
1807    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1808        for SysInfoGetInterruptControllerInfoResponse
1809    {
1810        #[inline(always)]
1811        fn new_empty() -> Self {
1812            Self {
1813                status: fidl::new_empty!(i32, D),
1814                info: fidl::new_empty!(fidl::encoding::Boxed<InterruptControllerInfo>, D),
1815            }
1816        }
1817
1818        #[inline]
1819        unsafe fn decode(
1820            &mut self,
1821            decoder: &mut fidl::encoding::Decoder<'_, D>,
1822            offset: usize,
1823            _depth: fidl::encoding::Depth,
1824        ) -> fidl::Result<()> {
1825            decoder.debug_check_bounds::<Self>(offset);
1826            // Verify that padding bytes are zero.
1827            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1828            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1829            let mask = 0xffffffff00000000u64;
1830            let maskedval = padval & mask;
1831            if maskedval != 0 {
1832                return Err(fidl::Error::NonZeroPadding {
1833                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1834                });
1835            }
1836            fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1837            fidl::decode!(
1838                fidl::encoding::Boxed<InterruptControllerInfo>,
1839                D,
1840                &mut self.info,
1841                decoder,
1842                offset + 8,
1843                _depth
1844            )?;
1845            Ok(())
1846        }
1847    }
1848
1849    impl fidl::encoding::ValueTypeMarker for SysInfoGetSerialNumberResponse {
1850        type Borrowed<'a> = &'a Self;
1851        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1852            value
1853        }
1854    }
1855
1856    unsafe impl fidl::encoding::TypeMarker for SysInfoGetSerialNumberResponse {
1857        type Owned = Self;
1858
1859        #[inline(always)]
1860        fn inline_align(_context: fidl::encoding::Context) -> usize {
1861            8
1862        }
1863
1864        #[inline(always)]
1865        fn inline_size(_context: fidl::encoding::Context) -> usize {
1866            16
1867        }
1868    }
1869
1870    unsafe impl<D: fidl::encoding::ResourceDialect>
1871        fidl::encoding::Encode<SysInfoGetSerialNumberResponse, D>
1872        for &SysInfoGetSerialNumberResponse
1873    {
1874        #[inline]
1875        unsafe fn encode(
1876            self,
1877            encoder: &mut fidl::encoding::Encoder<'_, D>,
1878            offset: usize,
1879            _depth: fidl::encoding::Depth,
1880        ) -> fidl::Result<()> {
1881            encoder.debug_check_bounds::<SysInfoGetSerialNumberResponse>(offset);
1882            // Delegate to tuple encoding.
1883            fidl::encoding::Encode::<SysInfoGetSerialNumberResponse, D>::encode(
1884                (<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
1885                    &self.serial,
1886                ),),
1887                encoder,
1888                offset,
1889                _depth,
1890            )
1891        }
1892    }
1893    unsafe impl<
1894            D: fidl::encoding::ResourceDialect,
1895            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
1896        > fidl::encoding::Encode<SysInfoGetSerialNumberResponse, D> for (T0,)
1897    {
1898        #[inline]
1899        unsafe fn encode(
1900            self,
1901            encoder: &mut fidl::encoding::Encoder<'_, D>,
1902            offset: usize,
1903            depth: fidl::encoding::Depth,
1904        ) -> fidl::Result<()> {
1905            encoder.debug_check_bounds::<SysInfoGetSerialNumberResponse>(offset);
1906            // Zero out padding regions. There's no need to apply masks
1907            // because the unmasked parts will be overwritten by fields.
1908            // Write the fields.
1909            self.0.encode(encoder, offset + 0, depth)?;
1910            Ok(())
1911        }
1912    }
1913
1914    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1915        for SysInfoGetSerialNumberResponse
1916    {
1917        #[inline(always)]
1918        fn new_empty() -> Self {
1919            Self { serial: fidl::new_empty!(fidl::encoding::BoundedString<32>, D) }
1920        }
1921
1922        #[inline]
1923        unsafe fn decode(
1924            &mut self,
1925            decoder: &mut fidl::encoding::Decoder<'_, D>,
1926            offset: usize,
1927            _depth: fidl::encoding::Depth,
1928        ) -> fidl::Result<()> {
1929            decoder.debug_check_bounds::<Self>(offset);
1930            // Verify that padding bytes are zero.
1931            fidl::decode!(
1932                fidl::encoding::BoundedString<32>,
1933                D,
1934                &mut self.serial,
1935                decoder,
1936                offset + 0,
1937                _depth
1938            )?;
1939            Ok(())
1940        }
1941    }
1942}