1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_system_state_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct SystemStateTransitionGetMexecZbisResponse {
16 pub kernel_zbi: fidl::Vmo,
17 pub data_zbi: fidl::Vmo,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for SystemStateTransitionGetMexecZbisResponse
22{
23}
24
25#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
26pub struct SystemStateTransitionMarker;
27
28impl fidl::endpoints::ProtocolMarker for SystemStateTransitionMarker {
29 type Proxy = SystemStateTransitionProxy;
30 type RequestStream = SystemStateTransitionRequestStream;
31 #[cfg(target_os = "fuchsia")]
32 type SynchronousProxy = SystemStateTransitionSynchronousProxy;
33
34 const DEBUG_NAME: &'static str = "fuchsia.system.state.SystemStateTransition";
35}
36impl fidl::endpoints::DiscoverableProtocolMarker for SystemStateTransitionMarker {}
37pub type SystemStateTransitionGetMexecZbisResult = Result<(fidl::Vmo, fidl::Vmo), i32>;
38
39pub trait SystemStateTransitionProxyInterface: Send + Sync {
40 type GetTerminationSystemStateResponseFut: std::future::Future<Output = Result<SystemPowerState, fidl::Error>>
41 + Send;
42 fn r#get_termination_system_state(&self) -> Self::GetTerminationSystemStateResponseFut;
43 type GetMexecZbisResponseFut: std::future::Future<Output = Result<SystemStateTransitionGetMexecZbisResult, fidl::Error>>
44 + Send;
45 fn r#get_mexec_zbis(&self) -> Self::GetMexecZbisResponseFut;
46}
47#[derive(Debug)]
48#[cfg(target_os = "fuchsia")]
49pub struct SystemStateTransitionSynchronousProxy {
50 client: fidl::client::sync::Client,
51}
52
53#[cfg(target_os = "fuchsia")]
54impl fidl::endpoints::SynchronousProxy for SystemStateTransitionSynchronousProxy {
55 type Proxy = SystemStateTransitionProxy;
56 type Protocol = SystemStateTransitionMarker;
57
58 fn from_channel(inner: fidl::Channel) -> Self {
59 Self::new(inner)
60 }
61
62 fn into_channel(self) -> fidl::Channel {
63 self.client.into_channel()
64 }
65
66 fn as_channel(&self) -> &fidl::Channel {
67 self.client.as_channel()
68 }
69}
70
71#[cfg(target_os = "fuchsia")]
72impl SystemStateTransitionSynchronousProxy {
73 pub fn new(channel: fidl::Channel) -> Self {
74 let protocol_name =
75 <SystemStateTransitionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
76 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
77 }
78
79 pub fn into_channel(self) -> fidl::Channel {
80 self.client.into_channel()
81 }
82
83 pub fn wait_for_event(
86 &self,
87 deadline: zx::MonotonicInstant,
88 ) -> Result<SystemStateTransitionEvent, fidl::Error> {
89 SystemStateTransitionEvent::decode(self.client.wait_for_event(deadline)?)
90 }
91
92 pub fn r#get_termination_system_state(
94 &self,
95 ___deadline: zx::MonotonicInstant,
96 ) -> Result<SystemPowerState, fidl::Error> {
97 let _response = self.client.send_query::<
98 fidl::encoding::EmptyPayload,
99 SystemStateTransitionGetTerminationSystemStateResponse,
100 >(
101 (),
102 0x7570e8c601c5e27e,
103 fidl::encoding::DynamicFlags::empty(),
104 ___deadline,
105 )?;
106 Ok(_response.state)
107 }
108
109 pub fn r#get_mexec_zbis(
123 &self,
124 ___deadline: zx::MonotonicInstant,
125 ) -> Result<SystemStateTransitionGetMexecZbisResult, fidl::Error> {
126 let _response =
127 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
128 SystemStateTransitionGetMexecZbisResponse,
129 i32,
130 >>(
131 (),
132 0x4d5efe452f310fef,
133 fidl::encoding::DynamicFlags::empty(),
134 ___deadline,
135 )?;
136 Ok(_response.map(|x| (x.kernel_zbi, x.data_zbi)))
137 }
138}
139
140#[cfg(target_os = "fuchsia")]
141impl From<SystemStateTransitionSynchronousProxy> for zx::Handle {
142 fn from(value: SystemStateTransitionSynchronousProxy) -> Self {
143 value.into_channel().into()
144 }
145}
146
147#[cfg(target_os = "fuchsia")]
148impl From<fidl::Channel> for SystemStateTransitionSynchronousProxy {
149 fn from(value: fidl::Channel) -> Self {
150 Self::new(value)
151 }
152}
153
154#[derive(Debug, Clone)]
155pub struct SystemStateTransitionProxy {
156 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
157}
158
159impl fidl::endpoints::Proxy for SystemStateTransitionProxy {
160 type Protocol = SystemStateTransitionMarker;
161
162 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
163 Self::new(inner)
164 }
165
166 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
167 self.client.into_channel().map_err(|client| Self { client })
168 }
169
170 fn as_channel(&self) -> &::fidl::AsyncChannel {
171 self.client.as_channel()
172 }
173}
174
175impl SystemStateTransitionProxy {
176 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
178 let protocol_name =
179 <SystemStateTransitionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
180 Self { client: fidl::client::Client::new(channel, protocol_name) }
181 }
182
183 pub fn take_event_stream(&self) -> SystemStateTransitionEventStream {
189 SystemStateTransitionEventStream { event_receiver: self.client.take_event_receiver() }
190 }
191
192 pub fn r#get_termination_system_state(
194 &self,
195 ) -> fidl::client::QueryResponseFut<
196 SystemPowerState,
197 fidl::encoding::DefaultFuchsiaResourceDialect,
198 > {
199 SystemStateTransitionProxyInterface::r#get_termination_system_state(self)
200 }
201
202 pub fn r#get_mexec_zbis(
216 &self,
217 ) -> fidl::client::QueryResponseFut<
218 SystemStateTransitionGetMexecZbisResult,
219 fidl::encoding::DefaultFuchsiaResourceDialect,
220 > {
221 SystemStateTransitionProxyInterface::r#get_mexec_zbis(self)
222 }
223}
224
225impl SystemStateTransitionProxyInterface for SystemStateTransitionProxy {
226 type GetTerminationSystemStateResponseFut = fidl::client::QueryResponseFut<
227 SystemPowerState,
228 fidl::encoding::DefaultFuchsiaResourceDialect,
229 >;
230 fn r#get_termination_system_state(&self) -> Self::GetTerminationSystemStateResponseFut {
231 fn _decode(
232 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
233 ) -> Result<SystemPowerState, fidl::Error> {
234 let _response = fidl::client::decode_transaction_body::<
235 SystemStateTransitionGetTerminationSystemStateResponse,
236 fidl::encoding::DefaultFuchsiaResourceDialect,
237 0x7570e8c601c5e27e,
238 >(_buf?)?;
239 Ok(_response.state)
240 }
241 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SystemPowerState>(
242 (),
243 0x7570e8c601c5e27e,
244 fidl::encoding::DynamicFlags::empty(),
245 _decode,
246 )
247 }
248
249 type GetMexecZbisResponseFut = fidl::client::QueryResponseFut<
250 SystemStateTransitionGetMexecZbisResult,
251 fidl::encoding::DefaultFuchsiaResourceDialect,
252 >;
253 fn r#get_mexec_zbis(&self) -> Self::GetMexecZbisResponseFut {
254 fn _decode(
255 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
256 ) -> Result<SystemStateTransitionGetMexecZbisResult, fidl::Error> {
257 let _response = fidl::client::decode_transaction_body::<
258 fidl::encoding::ResultType<SystemStateTransitionGetMexecZbisResponse, i32>,
259 fidl::encoding::DefaultFuchsiaResourceDialect,
260 0x4d5efe452f310fef,
261 >(_buf?)?;
262 Ok(_response.map(|x| (x.kernel_zbi, x.data_zbi)))
263 }
264 self.client.send_query_and_decode::<
265 fidl::encoding::EmptyPayload,
266 SystemStateTransitionGetMexecZbisResult,
267 >(
268 (),
269 0x4d5efe452f310fef,
270 fidl::encoding::DynamicFlags::empty(),
271 _decode,
272 )
273 }
274}
275
276pub struct SystemStateTransitionEventStream {
277 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
278}
279
280impl std::marker::Unpin for SystemStateTransitionEventStream {}
281
282impl futures::stream::FusedStream for SystemStateTransitionEventStream {
283 fn is_terminated(&self) -> bool {
284 self.event_receiver.is_terminated()
285 }
286}
287
288impl futures::Stream for SystemStateTransitionEventStream {
289 type Item = Result<SystemStateTransitionEvent, fidl::Error>;
290
291 fn poll_next(
292 mut self: std::pin::Pin<&mut Self>,
293 cx: &mut std::task::Context<'_>,
294 ) -> std::task::Poll<Option<Self::Item>> {
295 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
296 &mut self.event_receiver,
297 cx
298 )?) {
299 Some(buf) => std::task::Poll::Ready(Some(SystemStateTransitionEvent::decode(buf))),
300 None => std::task::Poll::Ready(None),
301 }
302 }
303}
304
305#[derive(Debug)]
306pub enum SystemStateTransitionEvent {}
307
308impl SystemStateTransitionEvent {
309 fn decode(
311 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
312 ) -> Result<SystemStateTransitionEvent, fidl::Error> {
313 let (bytes, _handles) = buf.split_mut();
314 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
315 debug_assert_eq!(tx_header.tx_id, 0);
316 match tx_header.ordinal {
317 _ => Err(fidl::Error::UnknownOrdinal {
318 ordinal: tx_header.ordinal,
319 protocol_name:
320 <SystemStateTransitionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
321 }),
322 }
323 }
324}
325
326pub struct SystemStateTransitionRequestStream {
328 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
329 is_terminated: bool,
330}
331
332impl std::marker::Unpin for SystemStateTransitionRequestStream {}
333
334impl futures::stream::FusedStream for SystemStateTransitionRequestStream {
335 fn is_terminated(&self) -> bool {
336 self.is_terminated
337 }
338}
339
340impl fidl::endpoints::RequestStream for SystemStateTransitionRequestStream {
341 type Protocol = SystemStateTransitionMarker;
342 type ControlHandle = SystemStateTransitionControlHandle;
343
344 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
345 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
346 }
347
348 fn control_handle(&self) -> Self::ControlHandle {
349 SystemStateTransitionControlHandle { inner: self.inner.clone() }
350 }
351
352 fn into_inner(
353 self,
354 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
355 {
356 (self.inner, self.is_terminated)
357 }
358
359 fn from_inner(
360 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
361 is_terminated: bool,
362 ) -> Self {
363 Self { inner, is_terminated }
364 }
365}
366
367impl futures::Stream for SystemStateTransitionRequestStream {
368 type Item = Result<SystemStateTransitionRequest, fidl::Error>;
369
370 fn poll_next(
371 mut self: std::pin::Pin<&mut Self>,
372 cx: &mut std::task::Context<'_>,
373 ) -> std::task::Poll<Option<Self::Item>> {
374 let this = &mut *self;
375 if this.inner.check_shutdown(cx) {
376 this.is_terminated = true;
377 return std::task::Poll::Ready(None);
378 }
379 if this.is_terminated {
380 panic!("polled SystemStateTransitionRequestStream after completion");
381 }
382 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
383 |bytes, handles| {
384 match this.inner.channel().read_etc(cx, bytes, handles) {
385 std::task::Poll::Ready(Ok(())) => {}
386 std::task::Poll::Pending => return std::task::Poll::Pending,
387 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
388 this.is_terminated = true;
389 return std::task::Poll::Ready(None);
390 }
391 std::task::Poll::Ready(Err(e)) => {
392 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
393 e.into(),
394 ))))
395 }
396 }
397
398 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
400
401 std::task::Poll::Ready(Some(match header.ordinal {
402 0x7570e8c601c5e27e => {
403 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
404 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
405 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
406 let control_handle = SystemStateTransitionControlHandle {
407 inner: this.inner.clone(),
408 };
409 Ok(SystemStateTransitionRequest::GetTerminationSystemState {
410 responder: SystemStateTransitionGetTerminationSystemStateResponder {
411 control_handle: std::mem::ManuallyDrop::new(control_handle),
412 tx_id: header.tx_id,
413 },
414 })
415 }
416 0x4d5efe452f310fef => {
417 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
418 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
419 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
420 let control_handle = SystemStateTransitionControlHandle {
421 inner: this.inner.clone(),
422 };
423 Ok(SystemStateTransitionRequest::GetMexecZbis {
424 responder: SystemStateTransitionGetMexecZbisResponder {
425 control_handle: std::mem::ManuallyDrop::new(control_handle),
426 tx_id: header.tx_id,
427 },
428 })
429 }
430 _ => Err(fidl::Error::UnknownOrdinal {
431 ordinal: header.ordinal,
432 protocol_name: <SystemStateTransitionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
433 }),
434 }))
435 },
436 )
437 }
438}
439
440#[derive(Debug)]
442pub enum SystemStateTransitionRequest {
443 GetTerminationSystemState { responder: SystemStateTransitionGetTerminationSystemStateResponder },
445 GetMexecZbis { responder: SystemStateTransitionGetMexecZbisResponder },
459}
460
461impl SystemStateTransitionRequest {
462 #[allow(irrefutable_let_patterns)]
463 pub fn into_get_termination_system_state(
464 self,
465 ) -> Option<(SystemStateTransitionGetTerminationSystemStateResponder)> {
466 if let SystemStateTransitionRequest::GetTerminationSystemState { responder } = self {
467 Some((responder))
468 } else {
469 None
470 }
471 }
472
473 #[allow(irrefutable_let_patterns)]
474 pub fn into_get_mexec_zbis(self) -> Option<(SystemStateTransitionGetMexecZbisResponder)> {
475 if let SystemStateTransitionRequest::GetMexecZbis { responder } = self {
476 Some((responder))
477 } else {
478 None
479 }
480 }
481
482 pub fn method_name(&self) -> &'static str {
484 match *self {
485 SystemStateTransitionRequest::GetTerminationSystemState { .. } => {
486 "get_termination_system_state"
487 }
488 SystemStateTransitionRequest::GetMexecZbis { .. } => "get_mexec_zbis",
489 }
490 }
491}
492
493#[derive(Debug, Clone)]
494pub struct SystemStateTransitionControlHandle {
495 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
496}
497
498impl fidl::endpoints::ControlHandle for SystemStateTransitionControlHandle {
499 fn shutdown(&self) {
500 self.inner.shutdown()
501 }
502 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
503 self.inner.shutdown_with_epitaph(status)
504 }
505
506 fn is_closed(&self) -> bool {
507 self.inner.channel().is_closed()
508 }
509 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
510 self.inner.channel().on_closed()
511 }
512
513 #[cfg(target_os = "fuchsia")]
514 fn signal_peer(
515 &self,
516 clear_mask: zx::Signals,
517 set_mask: zx::Signals,
518 ) -> Result<(), zx_status::Status> {
519 use fidl::Peered;
520 self.inner.channel().signal_peer(clear_mask, set_mask)
521 }
522}
523
524impl SystemStateTransitionControlHandle {}
525
526#[must_use = "FIDL methods require a response to be sent"]
527#[derive(Debug)]
528pub struct SystemStateTransitionGetTerminationSystemStateResponder {
529 control_handle: std::mem::ManuallyDrop<SystemStateTransitionControlHandle>,
530 tx_id: u32,
531}
532
533impl std::ops::Drop for SystemStateTransitionGetTerminationSystemStateResponder {
537 fn drop(&mut self) {
538 self.control_handle.shutdown();
539 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
541 }
542}
543
544impl fidl::endpoints::Responder for SystemStateTransitionGetTerminationSystemStateResponder {
545 type ControlHandle = SystemStateTransitionControlHandle;
546
547 fn control_handle(&self) -> &SystemStateTransitionControlHandle {
548 &self.control_handle
549 }
550
551 fn drop_without_shutdown(mut self) {
552 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
554 std::mem::forget(self);
556 }
557}
558
559impl SystemStateTransitionGetTerminationSystemStateResponder {
560 pub fn send(self, mut state: SystemPowerState) -> Result<(), fidl::Error> {
564 let _result = self.send_raw(state);
565 if _result.is_err() {
566 self.control_handle.shutdown();
567 }
568 self.drop_without_shutdown();
569 _result
570 }
571
572 pub fn send_no_shutdown_on_err(self, mut state: SystemPowerState) -> Result<(), fidl::Error> {
574 let _result = self.send_raw(state);
575 self.drop_without_shutdown();
576 _result
577 }
578
579 fn send_raw(&self, mut state: SystemPowerState) -> Result<(), fidl::Error> {
580 self.control_handle.inner.send::<SystemStateTransitionGetTerminationSystemStateResponse>(
581 (state,),
582 self.tx_id,
583 0x7570e8c601c5e27e,
584 fidl::encoding::DynamicFlags::empty(),
585 )
586 }
587}
588
589#[must_use = "FIDL methods require a response to be sent"]
590#[derive(Debug)]
591pub struct SystemStateTransitionGetMexecZbisResponder {
592 control_handle: std::mem::ManuallyDrop<SystemStateTransitionControlHandle>,
593 tx_id: u32,
594}
595
596impl std::ops::Drop for SystemStateTransitionGetMexecZbisResponder {
600 fn drop(&mut self) {
601 self.control_handle.shutdown();
602 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
604 }
605}
606
607impl fidl::endpoints::Responder for SystemStateTransitionGetMexecZbisResponder {
608 type ControlHandle = SystemStateTransitionControlHandle;
609
610 fn control_handle(&self) -> &SystemStateTransitionControlHandle {
611 &self.control_handle
612 }
613
614 fn drop_without_shutdown(mut self) {
615 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
617 std::mem::forget(self);
619 }
620}
621
622impl SystemStateTransitionGetMexecZbisResponder {
623 pub fn send(self, mut result: Result<(fidl::Vmo, fidl::Vmo), i32>) -> Result<(), fidl::Error> {
627 let _result = self.send_raw(result);
628 if _result.is_err() {
629 self.control_handle.shutdown();
630 }
631 self.drop_without_shutdown();
632 _result
633 }
634
635 pub fn send_no_shutdown_on_err(
637 self,
638 mut result: Result<(fidl::Vmo, fidl::Vmo), i32>,
639 ) -> Result<(), fidl::Error> {
640 let _result = self.send_raw(result);
641 self.drop_without_shutdown();
642 _result
643 }
644
645 fn send_raw(&self, mut result: Result<(fidl::Vmo, fidl::Vmo), i32>) -> Result<(), fidl::Error> {
646 self.control_handle.inner.send::<fidl::encoding::ResultType<
647 SystemStateTransitionGetMexecZbisResponse,
648 i32,
649 >>(
650 result,
651 self.tx_id,
652 0x4d5efe452f310fef,
653 fidl::encoding::DynamicFlags::empty(),
654 )
655 }
656}
657
658mod internal {
659 use super::*;
660
661 impl fidl::encoding::ResourceTypeMarker for SystemStateTransitionGetMexecZbisResponse {
662 type Borrowed<'a> = &'a mut Self;
663 fn take_or_borrow<'a>(
664 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
665 ) -> Self::Borrowed<'a> {
666 value
667 }
668 }
669
670 unsafe impl fidl::encoding::TypeMarker for SystemStateTransitionGetMexecZbisResponse {
671 type Owned = Self;
672
673 #[inline(always)]
674 fn inline_align(_context: fidl::encoding::Context) -> usize {
675 4
676 }
677
678 #[inline(always)]
679 fn inline_size(_context: fidl::encoding::Context) -> usize {
680 8
681 }
682 }
683
684 unsafe impl
685 fidl::encoding::Encode<
686 SystemStateTransitionGetMexecZbisResponse,
687 fidl::encoding::DefaultFuchsiaResourceDialect,
688 > for &mut SystemStateTransitionGetMexecZbisResponse
689 {
690 #[inline]
691 unsafe fn encode(
692 self,
693 encoder: &mut fidl::encoding::Encoder<
694 '_,
695 fidl::encoding::DefaultFuchsiaResourceDialect,
696 >,
697 offset: usize,
698 _depth: fidl::encoding::Depth,
699 ) -> fidl::Result<()> {
700 encoder.debug_check_bounds::<SystemStateTransitionGetMexecZbisResponse>(offset);
701 fidl::encoding::Encode::<
703 SystemStateTransitionGetMexecZbisResponse,
704 fidl::encoding::DefaultFuchsiaResourceDialect,
705 >::encode(
706 (
707 <fidl::encoding::HandleType<
708 fidl::Vmo,
709 { fidl::ObjectType::VMO.into_raw() },
710 2147483648,
711 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
712 &mut self.kernel_zbi
713 ),
714 <fidl::encoding::HandleType<
715 fidl::Vmo,
716 { fidl::ObjectType::VMO.into_raw() },
717 2147483648,
718 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
719 &mut self.data_zbi
720 ),
721 ),
722 encoder,
723 offset,
724 _depth,
725 )
726 }
727 }
728 unsafe impl<
729 T0: fidl::encoding::Encode<
730 fidl::encoding::HandleType<
731 fidl::Vmo,
732 { fidl::ObjectType::VMO.into_raw() },
733 2147483648,
734 >,
735 fidl::encoding::DefaultFuchsiaResourceDialect,
736 >,
737 T1: fidl::encoding::Encode<
738 fidl::encoding::HandleType<
739 fidl::Vmo,
740 { fidl::ObjectType::VMO.into_raw() },
741 2147483648,
742 >,
743 fidl::encoding::DefaultFuchsiaResourceDialect,
744 >,
745 >
746 fidl::encoding::Encode<
747 SystemStateTransitionGetMexecZbisResponse,
748 fidl::encoding::DefaultFuchsiaResourceDialect,
749 > for (T0, T1)
750 {
751 #[inline]
752 unsafe fn encode(
753 self,
754 encoder: &mut fidl::encoding::Encoder<
755 '_,
756 fidl::encoding::DefaultFuchsiaResourceDialect,
757 >,
758 offset: usize,
759 depth: fidl::encoding::Depth,
760 ) -> fidl::Result<()> {
761 encoder.debug_check_bounds::<SystemStateTransitionGetMexecZbisResponse>(offset);
762 self.0.encode(encoder, offset + 0, depth)?;
766 self.1.encode(encoder, offset + 4, depth)?;
767 Ok(())
768 }
769 }
770
771 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
772 for SystemStateTransitionGetMexecZbisResponse
773 {
774 #[inline(always)]
775 fn new_empty() -> Self {
776 Self {
777 kernel_zbi: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
778 data_zbi: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
779 }
780 }
781
782 #[inline]
783 unsafe fn decode(
784 &mut self,
785 decoder: &mut fidl::encoding::Decoder<
786 '_,
787 fidl::encoding::DefaultFuchsiaResourceDialect,
788 >,
789 offset: usize,
790 _depth: fidl::encoding::Depth,
791 ) -> fidl::Result<()> {
792 decoder.debug_check_bounds::<Self>(offset);
793 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.kernel_zbi, decoder, offset + 0, _depth)?;
795 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_zbi, decoder, offset + 4, _depth)?;
796 Ok(())
797 }
798 }
799}