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 _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13pub type AttemptId = String;
14
15#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
17#[repr(u32)]
18pub enum CancelError {
19 NoUpdateInProgress = 1,
21 UpdateCannotBeCanceled = 2,
23 AttemptIdMismatch = 3,
25 CancelLimitExceeded = 4,
27}
28
29impl CancelError {
30 #[inline]
31 pub fn from_primitive(prim: u32) -> Option<Self> {
32 match prim {
33 1 => Some(Self::NoUpdateInProgress),
34 2 => Some(Self::UpdateCannotBeCanceled),
35 3 => Some(Self::AttemptIdMismatch),
36 4 => Some(Self::CancelLimitExceeded),
37 _ => None,
38 }
39 }
40
41 #[inline]
42 pub const fn into_primitive(self) -> u32 {
43 self as u32
44 }
45
46 #[deprecated = "Strict enums should not use `is_unknown`"]
47 #[inline]
48 pub fn is_unknown(&self) -> bool {
49 false
50 }
51}
52
53#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
55#[repr(u32)]
56pub enum FetchFailureReason {
57 Internal = 0,
59 OutOfSpace = 1,
61}
62
63impl FetchFailureReason {
64 #[inline]
65 pub fn from_primitive(prim: u32) -> Option<Self> {
66 match prim {
67 0 => Some(Self::Internal),
68 1 => Some(Self::OutOfSpace),
69 _ => None,
70 }
71 }
72
73 #[inline]
74 pub const fn into_primitive(self) -> u32 {
75 self as u32
76 }
77
78 #[deprecated = "Strict enums should not use `is_unknown`"]
79 #[inline]
80 pub fn is_unknown(&self) -> bool {
81 false
82 }
83}
84
85#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
87#[repr(u32)]
88pub enum Initiator {
89 User = 0,
92 Service = 1,
94}
95
96impl Initiator {
97 #[inline]
98 pub fn from_primitive(prim: u32) -> Option<Self> {
99 match prim {
100 0 => Some(Self::User),
101 1 => Some(Self::Service),
102 _ => None,
103 }
104 }
105
106 #[inline]
107 pub const fn into_primitive(self) -> u32 {
108 self as u32
109 }
110
111 #[deprecated = "Strict enums should not use `is_unknown`"]
112 #[inline]
113 pub fn is_unknown(&self) -> bool {
114 false
115 }
116}
117
118#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
120#[repr(u32)]
121pub enum PrepareFailureReason {
122 Internal = 0,
124 OutOfSpace = 1,
127 UnsupportedDowngrade = 2,
131}
132
133impl PrepareFailureReason {
134 #[inline]
135 pub fn from_primitive(prim: u32) -> Option<Self> {
136 match prim {
137 0 => Some(Self::Internal),
138 1 => Some(Self::OutOfSpace),
139 2 => Some(Self::UnsupportedDowngrade),
140 _ => None,
141 }
142 }
143
144 #[inline]
145 pub const fn into_primitive(self) -> u32 {
146 self as u32
147 }
148
149 #[deprecated = "Strict enums should not use `is_unknown`"]
150 #[inline]
151 pub fn is_unknown(&self) -> bool {
152 false
153 }
154}
155
156#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
158#[repr(u32)]
159pub enum ResumeError {
160 NoUpdateInProgress = 1,
162 AttemptIdMismatch = 2,
164}
165
166impl ResumeError {
167 #[inline]
168 pub fn from_primitive(prim: u32) -> Option<Self> {
169 match prim {
170 1 => Some(Self::NoUpdateInProgress),
171 2 => Some(Self::AttemptIdMismatch),
172 _ => None,
173 }
174 }
175
176 #[inline]
177 pub const fn into_primitive(self) -> u32 {
178 self as u32
179 }
180
181 #[deprecated = "Strict enums should not use `is_unknown`"]
182 #[inline]
183 pub fn is_unknown(&self) -> bool {
184 false
185 }
186}
187
188#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
190#[repr(u32)]
191pub enum StageFailureReason {
192 Internal = 0,
194 OutOfSpace = 1,
196}
197
198impl StageFailureReason {
199 #[inline]
200 pub fn from_primitive(prim: u32) -> Option<Self> {
201 match prim {
202 0 => Some(Self::Internal),
203 1 => Some(Self::OutOfSpace),
204 _ => None,
205 }
206 }
207
208 #[inline]
209 pub const fn into_primitive(self) -> u32 {
210 self as u32
211 }
212
213 #[deprecated = "Strict enums should not use `is_unknown`"]
214 #[inline]
215 pub fn is_unknown(&self) -> bool {
216 false
217 }
218}
219
220#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
222#[repr(u32)]
223pub enum SuspendError {
224 NoUpdateInProgress = 1,
226 SuspendLimitExceeded = 2,
228 AttemptIdMismatch = 3,
230}
231
232impl SuspendError {
233 #[inline]
234 pub fn from_primitive(prim: u32) -> Option<Self> {
235 match prim {
236 1 => Some(Self::NoUpdateInProgress),
237 2 => Some(Self::SuspendLimitExceeded),
238 3 => Some(Self::AttemptIdMismatch),
239 _ => None,
240 }
241 }
242
243 #[inline]
244 pub const fn into_primitive(self) -> u32 {
245 self as u32
246 }
247
248 #[deprecated = "Strict enums should not use `is_unknown`"]
249 #[inline]
250 pub fn is_unknown(&self) -> bool {
251 false
252 }
253}
254
255#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
257#[repr(u32)]
258pub enum UpdateNotStartedReason {
259 AlreadyInProgress = 1,
262}
263
264impl UpdateNotStartedReason {
265 #[inline]
266 pub fn from_primitive(prim: u32) -> Option<Self> {
267 match prim {
268 1 => Some(Self::AlreadyInProgress),
269 _ => None,
270 }
271 }
272
273 #[inline]
274 pub const fn into_primitive(self) -> u32 {
275 self as u32
276 }
277
278 #[deprecated = "Strict enums should not use `is_unknown`"]
279 #[inline]
280 pub fn is_unknown(&self) -> bool {
281 false
282 }
283}
284
285#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
286pub struct InstallerCancelUpdateRequest {
287 pub attempt_id: Option<String>,
288}
289
290impl fidl::Persistable for InstallerCancelUpdateRequest {}
291
292#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
293pub struct InstallerMonitorUpdateRequest {
294 pub attempt_id: Option<String>,
295 pub monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
296}
297
298impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
299 for InstallerMonitorUpdateRequest
300{
301}
302
303#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
304pub struct InstallerMonitorUpdateResponse {
305 pub attached: bool,
306}
307
308impl fidl::Persistable for InstallerMonitorUpdateResponse {}
309
310#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
311pub struct InstallerResumeUpdateRequest {
312 pub attempt_id: Option<String>,
313}
314
315impl fidl::Persistable for InstallerResumeUpdateRequest {}
316
317#[derive(Debug, PartialEq)]
318pub struct InstallerStartUpdateRequest {
319 pub url: fidl_fuchsia_pkg::PackageUrl,
320 pub options: Options,
321 pub monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
322 pub reboot_controller: Option<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
323}
324
325impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
326 for InstallerStartUpdateRequest
327{
328}
329
330#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
331pub struct InstallerSuspendUpdateRequest {
332 pub attempt_id: Option<String>,
333}
334
335impl fidl::Persistable for InstallerSuspendUpdateRequest {}
336
337#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
338pub struct InstallerStartUpdateResponse {
339 pub attempt_id: String,
340}
341
342impl fidl::Persistable for InstallerStartUpdateResponse {}
343
344#[derive(Clone, Debug, PartialEq)]
345pub struct MonitorOnStateRequest {
346 pub state: State,
347}
348
349impl fidl::Persistable for MonitorOnStateRequest {}
350
351#[derive(Clone, Debug, Default, PartialEq)]
353pub struct CanceledData {
354 #[doc(hidden)]
355 pub __source_breaking: fidl::marker::SourceBreaking,
356}
357
358impl fidl::Persistable for CanceledData {}
359
360#[derive(Clone, Debug, Default, PartialEq)]
362pub struct CommitData {
363 pub info: Option<UpdateInfo>,
364 pub progress: Option<InstallationProgress>,
365 #[doc(hidden)]
366 pub __source_breaking: fidl::marker::SourceBreaking,
367}
368
369impl fidl::Persistable for CommitData {}
370
371#[derive(Clone, Debug, Default, PartialEq)]
373pub struct CompleteData {
374 pub info: Option<UpdateInfo>,
375 pub progress: Option<InstallationProgress>,
376 #[doc(hidden)]
377 pub __source_breaking: fidl::marker::SourceBreaking,
378}
379
380impl fidl::Persistable for CompleteData {}
381
382#[derive(Clone, Debug, Default, PartialEq)]
384pub struct DeferRebootData {
385 pub info: Option<UpdateInfo>,
386 pub progress: Option<InstallationProgress>,
387 #[doc(hidden)]
388 pub __source_breaking: fidl::marker::SourceBreaking,
389}
390
391impl fidl::Persistable for DeferRebootData {}
392
393#[derive(Clone, Debug, Default, PartialEq)]
395pub struct FailCommitData {
396 pub info: Option<UpdateInfo>,
397 pub progress: Option<InstallationProgress>,
398 #[doc(hidden)]
399 pub __source_breaking: fidl::marker::SourceBreaking,
400}
401
402impl fidl::Persistable for FailCommitData {}
403
404#[derive(Clone, Debug, Default, PartialEq)]
406pub struct FailFetchData {
407 pub info: Option<UpdateInfo>,
408 pub progress: Option<InstallationProgress>,
409 pub reason: Option<FetchFailureReason>,
410 #[doc(hidden)]
411 pub __source_breaking: fidl::marker::SourceBreaking,
412}
413
414impl fidl::Persistable for FailFetchData {}
415
416#[derive(Clone, Debug, Default, PartialEq)]
418pub struct FailPrepareData {
419 pub reason: Option<PrepareFailureReason>,
420 #[doc(hidden)]
421 pub __source_breaking: fidl::marker::SourceBreaking,
422}
423
424impl fidl::Persistable for FailPrepareData {}
425
426#[derive(Clone, Debug, Default, PartialEq)]
428pub struct FailStageData {
429 pub info: Option<UpdateInfo>,
430 pub progress: Option<InstallationProgress>,
431 pub reason: Option<StageFailureReason>,
432 #[doc(hidden)]
433 pub __source_breaking: fidl::marker::SourceBreaking,
434}
435
436impl fidl::Persistable for FailStageData {}
437
438#[derive(Clone, Debug, Default, PartialEq)]
440pub struct FetchData {
441 pub info: Option<UpdateInfo>,
442 pub progress: Option<InstallationProgress>,
443 #[doc(hidden)]
444 pub __source_breaking: fidl::marker::SourceBreaking,
445}
446
447impl fidl::Persistable for FetchData {}
448
449#[derive(Clone, Debug, Default, PartialEq)]
451pub struct InstallationProgress {
452 pub fraction_completed: Option<f32>,
454 pub bytes_downloaded: Option<u64>,
458 #[doc(hidden)]
459 pub __source_breaking: fidl::marker::SourceBreaking,
460}
461
462impl fidl::Persistable for InstallationProgress {}
463
464#[derive(Clone, Debug, Default, PartialEq)]
466pub struct Options {
467 pub initiator: Option<Initiator>,
469 pub allow_attach_to_existing_attempt: Option<bool>,
476 pub should_write_recovery: Option<bool>,
479 #[doc(hidden)]
480 pub __source_breaking: fidl::marker::SourceBreaking,
481}
482
483impl fidl::Persistable for Options {}
484
485#[derive(Clone, Debug, Default, PartialEq)]
487pub struct PrepareData {
488 #[doc(hidden)]
489 pub __source_breaking: fidl::marker::SourceBreaking,
490}
491
492impl fidl::Persistable for PrepareData {}
493
494#[derive(Clone, Debug, Default, PartialEq)]
496pub struct RebootData {
497 pub info: Option<UpdateInfo>,
498 pub progress: Option<InstallationProgress>,
499 #[doc(hidden)]
500 pub __source_breaking: fidl::marker::SourceBreaking,
501}
502
503impl fidl::Persistable for RebootData {}
504
505#[derive(Clone, Debug, Default, PartialEq)]
507pub struct StageData {
508 pub info: Option<UpdateInfo>,
509 pub progress: Option<InstallationProgress>,
510 #[doc(hidden)]
511 pub __source_breaking: fidl::marker::SourceBreaking,
512}
513
514impl fidl::Persistable for StageData {}
515
516#[derive(Clone, Debug, Default, PartialEq)]
519pub struct UpdateInfo {
520 pub download_size: Option<u64>,
523 #[doc(hidden)]
524 pub __source_breaking: fidl::marker::SourceBreaking,
525}
526
527impl fidl::Persistable for UpdateInfo {}
528
529#[derive(Clone, Debug, Default, PartialEq)]
531pub struct WaitToRebootData {
532 pub info: Option<UpdateInfo>,
533 pub progress: Option<InstallationProgress>,
534 #[doc(hidden)]
535 pub __source_breaking: fidl::marker::SourceBreaking,
536}
537
538impl fidl::Persistable for WaitToRebootData {}
539
540#[derive(Clone, Debug, PartialEq)]
582pub enum State {
583 Prepare(PrepareData),
591 Stage(StageData),
598 Fetch(FetchData),
605 Commit(CommitData),
614 WaitToReboot(WaitToRebootData),
621 Reboot(RebootData),
625 DeferReboot(DeferRebootData),
630 Complete(CompleteData),
634 FailPrepare(FailPrepareData),
638 FailStage(FailStageData),
642 FailFetch(FailFetchData),
646 FailCommit(FailCommitData),
650 Canceled(CanceledData),
654}
655
656impl State {
657 #[inline]
658 pub fn ordinal(&self) -> u64 {
659 match *self {
660 Self::Prepare(_) => 1,
661 Self::Stage(_) => 2,
662 Self::Fetch(_) => 3,
663 Self::Commit(_) => 4,
664 Self::WaitToReboot(_) => 5,
665 Self::Reboot(_) => 6,
666 Self::DeferReboot(_) => 7,
667 Self::Complete(_) => 8,
668 Self::FailPrepare(_) => 9,
669 Self::FailStage(_) => 10,
670 Self::FailFetch(_) => 11,
671 Self::FailCommit(_) => 12,
672 Self::Canceled(_) => 13,
673 }
674 }
675
676 #[deprecated = "Strict unions should not use `is_unknown`"]
677 #[inline]
678 pub fn is_unknown(&self) -> bool {
679 false
680 }
681}
682
683impl fidl::Persistable for State {}
684
685#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
686pub struct InstallerMarker;
687
688impl fidl::endpoints::ProtocolMarker for InstallerMarker {
689 type Proxy = InstallerProxy;
690 type RequestStream = InstallerRequestStream;
691 #[cfg(target_os = "fuchsia")]
692 type SynchronousProxy = InstallerSynchronousProxy;
693
694 const DEBUG_NAME: &'static str = "fuchsia.update.installer.Installer";
695}
696impl fidl::endpoints::DiscoverableProtocolMarker for InstallerMarker {}
697pub type InstallerStartUpdateResult = Result<String, UpdateNotStartedReason>;
698pub type InstallerSuspendUpdateResult = Result<(), SuspendError>;
699pub type InstallerResumeUpdateResult = Result<(), ResumeError>;
700pub type InstallerCancelUpdateResult = Result<(), CancelError>;
701
702pub trait InstallerProxyInterface: Send + Sync {
703 type StartUpdateResponseFut: std::future::Future<Output = Result<InstallerStartUpdateResult, fidl::Error>>
704 + Send;
705 fn r#start_update(
706 &self,
707 url: &fidl_fuchsia_pkg::PackageUrl,
708 options: &Options,
709 monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
710 reboot_controller: Option<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
711 ) -> Self::StartUpdateResponseFut;
712 type MonitorUpdateResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
713 fn r#monitor_update(
714 &self,
715 attempt_id: Option<&str>,
716 monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
717 ) -> Self::MonitorUpdateResponseFut;
718 type SuspendUpdateResponseFut: std::future::Future<Output = Result<InstallerSuspendUpdateResult, fidl::Error>>
719 + Send;
720 fn r#suspend_update(&self, attempt_id: Option<&str>) -> Self::SuspendUpdateResponseFut;
721 type ResumeUpdateResponseFut: std::future::Future<Output = Result<InstallerResumeUpdateResult, fidl::Error>>
722 + Send;
723 fn r#resume_update(&self, attempt_id: Option<&str>) -> Self::ResumeUpdateResponseFut;
724 type CancelUpdateResponseFut: std::future::Future<Output = Result<InstallerCancelUpdateResult, fidl::Error>>
725 + Send;
726 fn r#cancel_update(&self, attempt_id: Option<&str>) -> Self::CancelUpdateResponseFut;
727}
728#[derive(Debug)]
729#[cfg(target_os = "fuchsia")]
730pub struct InstallerSynchronousProxy {
731 client: fidl::client::sync::Client,
732}
733
734#[cfg(target_os = "fuchsia")]
735impl fidl::endpoints::SynchronousProxy for InstallerSynchronousProxy {
736 type Proxy = InstallerProxy;
737 type Protocol = InstallerMarker;
738
739 fn from_channel(inner: fidl::Channel) -> Self {
740 Self::new(inner)
741 }
742
743 fn into_channel(self) -> fidl::Channel {
744 self.client.into_channel()
745 }
746
747 fn as_channel(&self) -> &fidl::Channel {
748 self.client.as_channel()
749 }
750}
751
752#[cfg(target_os = "fuchsia")]
753impl InstallerSynchronousProxy {
754 pub fn new(channel: fidl::Channel) -> Self {
755 let protocol_name = <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
756 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
757 }
758
759 pub fn into_channel(self) -> fidl::Channel {
760 self.client.into_channel()
761 }
762
763 pub fn wait_for_event(
766 &self,
767 deadline: zx::MonotonicInstant,
768 ) -> Result<InstallerEvent, fidl::Error> {
769 InstallerEvent::decode(self.client.wait_for_event(deadline)?)
770 }
771
772 pub fn r#start_update(
792 &self,
793 mut url: &fidl_fuchsia_pkg::PackageUrl,
794 mut options: &Options,
795 mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
796 mut reboot_controller: Option<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
797 ___deadline: zx::MonotonicInstant,
798 ) -> Result<InstallerStartUpdateResult, fidl::Error> {
799 let _response =
800 self.client.send_query::<InstallerStartUpdateRequest, fidl::encoding::ResultType<
801 InstallerStartUpdateResponse,
802 UpdateNotStartedReason,
803 >>(
804 (url, options, monitor, reboot_controller),
805 0x2b1c5ba9167c320b,
806 fidl::encoding::DynamicFlags::empty(),
807 ___deadline,
808 )?;
809 Ok(_response.map(|x| x.attempt_id))
810 }
811
812 pub fn r#monitor_update(
823 &self,
824 mut attempt_id: Option<&str>,
825 mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
826 ___deadline: zx::MonotonicInstant,
827 ) -> Result<bool, fidl::Error> {
828 let _response = self
829 .client
830 .send_query::<InstallerMonitorUpdateRequest, InstallerMonitorUpdateResponse>(
831 (attempt_id, monitor),
832 0x21d54aa1fd825a32,
833 fidl::encoding::DynamicFlags::empty(),
834 ___deadline,
835 )?;
836 Ok(_response.attached)
837 }
838
839 pub fn r#suspend_update(
844 &self,
845 mut attempt_id: Option<&str>,
846 ___deadline: zx::MonotonicInstant,
847 ) -> Result<InstallerSuspendUpdateResult, fidl::Error> {
848 let _response = self.client.send_query::<
849 InstallerSuspendUpdateRequest,
850 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, SuspendError>,
851 >(
852 (attempt_id,),
853 0x788de328461f9950,
854 fidl::encoding::DynamicFlags::empty(),
855 ___deadline,
856 )?;
857 Ok(_response.map(|x| x))
858 }
859
860 pub fn r#resume_update(
865 &self,
866 mut attempt_id: Option<&str>,
867 ___deadline: zx::MonotonicInstant,
868 ) -> Result<InstallerResumeUpdateResult, fidl::Error> {
869 let _response = self.client.send_query::<
870 InstallerResumeUpdateRequest,
871 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ResumeError>,
872 >(
873 (attempt_id,),
874 0x7479e805fec33dd3,
875 fidl::encoding::DynamicFlags::empty(),
876 ___deadline,
877 )?;
878 Ok(_response.map(|x| x))
879 }
880
881 pub fn r#cancel_update(
886 &self,
887 mut attempt_id: Option<&str>,
888 ___deadline: zx::MonotonicInstant,
889 ) -> Result<InstallerCancelUpdateResult, fidl::Error> {
890 let _response = self.client.send_query::<
891 InstallerCancelUpdateRequest,
892 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CancelError>,
893 >(
894 (attempt_id,),
895 0x472dec9160a1d0f,
896 fidl::encoding::DynamicFlags::empty(),
897 ___deadline,
898 )?;
899 Ok(_response.map(|x| x))
900 }
901}
902
903#[derive(Debug, Clone)]
904pub struct InstallerProxy {
905 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
906}
907
908impl fidl::endpoints::Proxy for InstallerProxy {
909 type Protocol = InstallerMarker;
910
911 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
912 Self::new(inner)
913 }
914
915 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
916 self.client.into_channel().map_err(|client| Self { client })
917 }
918
919 fn as_channel(&self) -> &::fidl::AsyncChannel {
920 self.client.as_channel()
921 }
922}
923
924impl InstallerProxy {
925 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
927 let protocol_name = <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
928 Self { client: fidl::client::Client::new(channel, protocol_name) }
929 }
930
931 pub fn take_event_stream(&self) -> InstallerEventStream {
937 InstallerEventStream { event_receiver: self.client.take_event_receiver() }
938 }
939
940 pub fn r#start_update(
960 &self,
961 mut url: &fidl_fuchsia_pkg::PackageUrl,
962 mut options: &Options,
963 mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
964 mut reboot_controller: Option<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
965 ) -> fidl::client::QueryResponseFut<
966 InstallerStartUpdateResult,
967 fidl::encoding::DefaultFuchsiaResourceDialect,
968 > {
969 InstallerProxyInterface::r#start_update(self, url, options, monitor, reboot_controller)
970 }
971
972 pub fn r#monitor_update(
983 &self,
984 mut attempt_id: Option<&str>,
985 mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
986 ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
987 InstallerProxyInterface::r#monitor_update(self, attempt_id, monitor)
988 }
989
990 pub fn r#suspend_update(
995 &self,
996 mut attempt_id: Option<&str>,
997 ) -> fidl::client::QueryResponseFut<
998 InstallerSuspendUpdateResult,
999 fidl::encoding::DefaultFuchsiaResourceDialect,
1000 > {
1001 InstallerProxyInterface::r#suspend_update(self, attempt_id)
1002 }
1003
1004 pub fn r#resume_update(
1009 &self,
1010 mut attempt_id: Option<&str>,
1011 ) -> fidl::client::QueryResponseFut<
1012 InstallerResumeUpdateResult,
1013 fidl::encoding::DefaultFuchsiaResourceDialect,
1014 > {
1015 InstallerProxyInterface::r#resume_update(self, attempt_id)
1016 }
1017
1018 pub fn r#cancel_update(
1023 &self,
1024 mut attempt_id: Option<&str>,
1025 ) -> fidl::client::QueryResponseFut<
1026 InstallerCancelUpdateResult,
1027 fidl::encoding::DefaultFuchsiaResourceDialect,
1028 > {
1029 InstallerProxyInterface::r#cancel_update(self, attempt_id)
1030 }
1031}
1032
1033impl InstallerProxyInterface for InstallerProxy {
1034 type StartUpdateResponseFut = fidl::client::QueryResponseFut<
1035 InstallerStartUpdateResult,
1036 fidl::encoding::DefaultFuchsiaResourceDialect,
1037 >;
1038 fn r#start_update(
1039 &self,
1040 mut url: &fidl_fuchsia_pkg::PackageUrl,
1041 mut options: &Options,
1042 mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
1043 mut reboot_controller: Option<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
1044 ) -> Self::StartUpdateResponseFut {
1045 fn _decode(
1046 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1047 ) -> Result<InstallerStartUpdateResult, fidl::Error> {
1048 let _response = fidl::client::decode_transaction_body::<
1049 fidl::encoding::ResultType<InstallerStartUpdateResponse, UpdateNotStartedReason>,
1050 fidl::encoding::DefaultFuchsiaResourceDialect,
1051 0x2b1c5ba9167c320b,
1052 >(_buf?)?;
1053 Ok(_response.map(|x| x.attempt_id))
1054 }
1055 self.client
1056 .send_query_and_decode::<InstallerStartUpdateRequest, InstallerStartUpdateResult>(
1057 (url, options, monitor, reboot_controller),
1058 0x2b1c5ba9167c320b,
1059 fidl::encoding::DynamicFlags::empty(),
1060 _decode,
1061 )
1062 }
1063
1064 type MonitorUpdateResponseFut =
1065 fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
1066 fn r#monitor_update(
1067 &self,
1068 mut attempt_id: Option<&str>,
1069 mut monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
1070 ) -> Self::MonitorUpdateResponseFut {
1071 fn _decode(
1072 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1073 ) -> Result<bool, fidl::Error> {
1074 let _response = fidl::client::decode_transaction_body::<
1075 InstallerMonitorUpdateResponse,
1076 fidl::encoding::DefaultFuchsiaResourceDialect,
1077 0x21d54aa1fd825a32,
1078 >(_buf?)?;
1079 Ok(_response.attached)
1080 }
1081 self.client.send_query_and_decode::<InstallerMonitorUpdateRequest, bool>(
1082 (attempt_id, monitor),
1083 0x21d54aa1fd825a32,
1084 fidl::encoding::DynamicFlags::empty(),
1085 _decode,
1086 )
1087 }
1088
1089 type SuspendUpdateResponseFut = fidl::client::QueryResponseFut<
1090 InstallerSuspendUpdateResult,
1091 fidl::encoding::DefaultFuchsiaResourceDialect,
1092 >;
1093 fn r#suspend_update(&self, mut attempt_id: Option<&str>) -> Self::SuspendUpdateResponseFut {
1094 fn _decode(
1095 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1096 ) -> Result<InstallerSuspendUpdateResult, fidl::Error> {
1097 let _response = fidl::client::decode_transaction_body::<
1098 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, SuspendError>,
1099 fidl::encoding::DefaultFuchsiaResourceDialect,
1100 0x788de328461f9950,
1101 >(_buf?)?;
1102 Ok(_response.map(|x| x))
1103 }
1104 self.client
1105 .send_query_and_decode::<InstallerSuspendUpdateRequest, InstallerSuspendUpdateResult>(
1106 (attempt_id,),
1107 0x788de328461f9950,
1108 fidl::encoding::DynamicFlags::empty(),
1109 _decode,
1110 )
1111 }
1112
1113 type ResumeUpdateResponseFut = fidl::client::QueryResponseFut<
1114 InstallerResumeUpdateResult,
1115 fidl::encoding::DefaultFuchsiaResourceDialect,
1116 >;
1117 fn r#resume_update(&self, mut attempt_id: Option<&str>) -> Self::ResumeUpdateResponseFut {
1118 fn _decode(
1119 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1120 ) -> Result<InstallerResumeUpdateResult, fidl::Error> {
1121 let _response = fidl::client::decode_transaction_body::<
1122 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ResumeError>,
1123 fidl::encoding::DefaultFuchsiaResourceDialect,
1124 0x7479e805fec33dd3,
1125 >(_buf?)?;
1126 Ok(_response.map(|x| x))
1127 }
1128 self.client
1129 .send_query_and_decode::<InstallerResumeUpdateRequest, InstallerResumeUpdateResult>(
1130 (attempt_id,),
1131 0x7479e805fec33dd3,
1132 fidl::encoding::DynamicFlags::empty(),
1133 _decode,
1134 )
1135 }
1136
1137 type CancelUpdateResponseFut = fidl::client::QueryResponseFut<
1138 InstallerCancelUpdateResult,
1139 fidl::encoding::DefaultFuchsiaResourceDialect,
1140 >;
1141 fn r#cancel_update(&self, mut attempt_id: Option<&str>) -> Self::CancelUpdateResponseFut {
1142 fn _decode(
1143 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1144 ) -> Result<InstallerCancelUpdateResult, fidl::Error> {
1145 let _response = fidl::client::decode_transaction_body::<
1146 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CancelError>,
1147 fidl::encoding::DefaultFuchsiaResourceDialect,
1148 0x472dec9160a1d0f,
1149 >(_buf?)?;
1150 Ok(_response.map(|x| x))
1151 }
1152 self.client
1153 .send_query_and_decode::<InstallerCancelUpdateRequest, InstallerCancelUpdateResult>(
1154 (attempt_id,),
1155 0x472dec9160a1d0f,
1156 fidl::encoding::DynamicFlags::empty(),
1157 _decode,
1158 )
1159 }
1160}
1161
1162pub struct InstallerEventStream {
1163 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1164}
1165
1166impl std::marker::Unpin for InstallerEventStream {}
1167
1168impl futures::stream::FusedStream for InstallerEventStream {
1169 fn is_terminated(&self) -> bool {
1170 self.event_receiver.is_terminated()
1171 }
1172}
1173
1174impl futures::Stream for InstallerEventStream {
1175 type Item = Result<InstallerEvent, fidl::Error>;
1176
1177 fn poll_next(
1178 mut self: std::pin::Pin<&mut Self>,
1179 cx: &mut std::task::Context<'_>,
1180 ) -> std::task::Poll<Option<Self::Item>> {
1181 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1182 &mut self.event_receiver,
1183 cx
1184 )?) {
1185 Some(buf) => std::task::Poll::Ready(Some(InstallerEvent::decode(buf))),
1186 None => std::task::Poll::Ready(None),
1187 }
1188 }
1189}
1190
1191#[derive(Debug)]
1192pub enum InstallerEvent {}
1193
1194impl InstallerEvent {
1195 fn decode(
1197 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1198 ) -> Result<InstallerEvent, fidl::Error> {
1199 let (bytes, _handles) = buf.split_mut();
1200 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1201 debug_assert_eq!(tx_header.tx_id, 0);
1202 match tx_header.ordinal {
1203 _ => Err(fidl::Error::UnknownOrdinal {
1204 ordinal: tx_header.ordinal,
1205 protocol_name: <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1206 }),
1207 }
1208 }
1209}
1210
1211pub struct InstallerRequestStream {
1213 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1214 is_terminated: bool,
1215}
1216
1217impl std::marker::Unpin for InstallerRequestStream {}
1218
1219impl futures::stream::FusedStream for InstallerRequestStream {
1220 fn is_terminated(&self) -> bool {
1221 self.is_terminated
1222 }
1223}
1224
1225impl fidl::endpoints::RequestStream for InstallerRequestStream {
1226 type Protocol = InstallerMarker;
1227 type ControlHandle = InstallerControlHandle;
1228
1229 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1230 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1231 }
1232
1233 fn control_handle(&self) -> Self::ControlHandle {
1234 InstallerControlHandle { inner: self.inner.clone() }
1235 }
1236
1237 fn into_inner(
1238 self,
1239 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1240 {
1241 (self.inner, self.is_terminated)
1242 }
1243
1244 fn from_inner(
1245 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1246 is_terminated: bool,
1247 ) -> Self {
1248 Self { inner, is_terminated }
1249 }
1250}
1251
1252impl futures::Stream for InstallerRequestStream {
1253 type Item = Result<InstallerRequest, fidl::Error>;
1254
1255 fn poll_next(
1256 mut self: std::pin::Pin<&mut Self>,
1257 cx: &mut std::task::Context<'_>,
1258 ) -> std::task::Poll<Option<Self::Item>> {
1259 let this = &mut *self;
1260 if this.inner.check_shutdown(cx) {
1261 this.is_terminated = true;
1262 return std::task::Poll::Ready(None);
1263 }
1264 if this.is_terminated {
1265 panic!("polled InstallerRequestStream after completion");
1266 }
1267 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1268 |bytes, handles| {
1269 match this.inner.channel().read_etc(cx, bytes, handles) {
1270 std::task::Poll::Ready(Ok(())) => {}
1271 std::task::Poll::Pending => return std::task::Poll::Pending,
1272 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1273 this.is_terminated = true;
1274 return std::task::Poll::Ready(None);
1275 }
1276 std::task::Poll::Ready(Err(e)) => {
1277 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1278 e.into(),
1279 ))))
1280 }
1281 }
1282
1283 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1285
1286 std::task::Poll::Ready(Some(match header.ordinal {
1287 0x2b1c5ba9167c320b => {
1288 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1289 let mut req = fidl::new_empty!(
1290 InstallerStartUpdateRequest,
1291 fidl::encoding::DefaultFuchsiaResourceDialect
1292 );
1293 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InstallerStartUpdateRequest>(&header, _body_bytes, handles, &mut req)?;
1294 let control_handle = InstallerControlHandle { inner: this.inner.clone() };
1295 Ok(InstallerRequest::StartUpdate {
1296 url: req.url,
1297 options: req.options,
1298 monitor: req.monitor,
1299 reboot_controller: req.reboot_controller,
1300
1301 responder: InstallerStartUpdateResponder {
1302 control_handle: std::mem::ManuallyDrop::new(control_handle),
1303 tx_id: header.tx_id,
1304 },
1305 })
1306 }
1307 0x21d54aa1fd825a32 => {
1308 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1309 let mut req = fidl::new_empty!(
1310 InstallerMonitorUpdateRequest,
1311 fidl::encoding::DefaultFuchsiaResourceDialect
1312 );
1313 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InstallerMonitorUpdateRequest>(&header, _body_bytes, handles, &mut req)?;
1314 let control_handle = InstallerControlHandle { inner: this.inner.clone() };
1315 Ok(InstallerRequest::MonitorUpdate {
1316 attempt_id: req.attempt_id,
1317 monitor: req.monitor,
1318
1319 responder: InstallerMonitorUpdateResponder {
1320 control_handle: std::mem::ManuallyDrop::new(control_handle),
1321 tx_id: header.tx_id,
1322 },
1323 })
1324 }
1325 0x788de328461f9950 => {
1326 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1327 let mut req = fidl::new_empty!(
1328 InstallerSuspendUpdateRequest,
1329 fidl::encoding::DefaultFuchsiaResourceDialect
1330 );
1331 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InstallerSuspendUpdateRequest>(&header, _body_bytes, handles, &mut req)?;
1332 let control_handle = InstallerControlHandle { inner: this.inner.clone() };
1333 Ok(InstallerRequest::SuspendUpdate {
1334 attempt_id: req.attempt_id,
1335
1336 responder: InstallerSuspendUpdateResponder {
1337 control_handle: std::mem::ManuallyDrop::new(control_handle),
1338 tx_id: header.tx_id,
1339 },
1340 })
1341 }
1342 0x7479e805fec33dd3 => {
1343 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1344 let mut req = fidl::new_empty!(
1345 InstallerResumeUpdateRequest,
1346 fidl::encoding::DefaultFuchsiaResourceDialect
1347 );
1348 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InstallerResumeUpdateRequest>(&header, _body_bytes, handles, &mut req)?;
1349 let control_handle = InstallerControlHandle { inner: this.inner.clone() };
1350 Ok(InstallerRequest::ResumeUpdate {
1351 attempt_id: req.attempt_id,
1352
1353 responder: InstallerResumeUpdateResponder {
1354 control_handle: std::mem::ManuallyDrop::new(control_handle),
1355 tx_id: header.tx_id,
1356 },
1357 })
1358 }
1359 0x472dec9160a1d0f => {
1360 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1361 let mut req = fidl::new_empty!(
1362 InstallerCancelUpdateRequest,
1363 fidl::encoding::DefaultFuchsiaResourceDialect
1364 );
1365 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InstallerCancelUpdateRequest>(&header, _body_bytes, handles, &mut req)?;
1366 let control_handle = InstallerControlHandle { inner: this.inner.clone() };
1367 Ok(InstallerRequest::CancelUpdate {
1368 attempt_id: req.attempt_id,
1369
1370 responder: InstallerCancelUpdateResponder {
1371 control_handle: std::mem::ManuallyDrop::new(control_handle),
1372 tx_id: header.tx_id,
1373 },
1374 })
1375 }
1376 _ => Err(fidl::Error::UnknownOrdinal {
1377 ordinal: header.ordinal,
1378 protocol_name:
1379 <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1380 }),
1381 }))
1382 },
1383 )
1384 }
1385}
1386
1387#[derive(Debug)]
1392pub enum InstallerRequest {
1393 StartUpdate {
1413 url: fidl_fuchsia_pkg::PackageUrl,
1414 options: Options,
1415 monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
1416 reboot_controller: Option<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
1417 responder: InstallerStartUpdateResponder,
1418 },
1419 MonitorUpdate {
1430 attempt_id: Option<String>,
1431 monitor: fidl::endpoints::ClientEnd<MonitorMarker>,
1432 responder: InstallerMonitorUpdateResponder,
1433 },
1434 SuspendUpdate { attempt_id: Option<String>, responder: InstallerSuspendUpdateResponder },
1439 ResumeUpdate { attempt_id: Option<String>, responder: InstallerResumeUpdateResponder },
1444 CancelUpdate { attempt_id: Option<String>, responder: InstallerCancelUpdateResponder },
1449}
1450
1451impl InstallerRequest {
1452 #[allow(irrefutable_let_patterns)]
1453 pub fn into_start_update(
1454 self,
1455 ) -> Option<(
1456 fidl_fuchsia_pkg::PackageUrl,
1457 Options,
1458 fidl::endpoints::ClientEnd<MonitorMarker>,
1459 Option<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
1460 InstallerStartUpdateResponder,
1461 )> {
1462 if let InstallerRequest::StartUpdate {
1463 url,
1464 options,
1465 monitor,
1466 reboot_controller,
1467 responder,
1468 } = self
1469 {
1470 Some((url, options, monitor, reboot_controller, responder))
1471 } else {
1472 None
1473 }
1474 }
1475
1476 #[allow(irrefutable_let_patterns)]
1477 pub fn into_monitor_update(
1478 self,
1479 ) -> Option<(
1480 Option<String>,
1481 fidl::endpoints::ClientEnd<MonitorMarker>,
1482 InstallerMonitorUpdateResponder,
1483 )> {
1484 if let InstallerRequest::MonitorUpdate { attempt_id, monitor, responder } = self {
1485 Some((attempt_id, monitor, responder))
1486 } else {
1487 None
1488 }
1489 }
1490
1491 #[allow(irrefutable_let_patterns)]
1492 pub fn into_suspend_update(self) -> Option<(Option<String>, InstallerSuspendUpdateResponder)> {
1493 if let InstallerRequest::SuspendUpdate { attempt_id, responder } = self {
1494 Some((attempt_id, responder))
1495 } else {
1496 None
1497 }
1498 }
1499
1500 #[allow(irrefutable_let_patterns)]
1501 pub fn into_resume_update(self) -> Option<(Option<String>, InstallerResumeUpdateResponder)> {
1502 if let InstallerRequest::ResumeUpdate { attempt_id, responder } = self {
1503 Some((attempt_id, responder))
1504 } else {
1505 None
1506 }
1507 }
1508
1509 #[allow(irrefutable_let_patterns)]
1510 pub fn into_cancel_update(self) -> Option<(Option<String>, InstallerCancelUpdateResponder)> {
1511 if let InstallerRequest::CancelUpdate { attempt_id, responder } = self {
1512 Some((attempt_id, responder))
1513 } else {
1514 None
1515 }
1516 }
1517
1518 pub fn method_name(&self) -> &'static str {
1520 match *self {
1521 InstallerRequest::StartUpdate { .. } => "start_update",
1522 InstallerRequest::MonitorUpdate { .. } => "monitor_update",
1523 InstallerRequest::SuspendUpdate { .. } => "suspend_update",
1524 InstallerRequest::ResumeUpdate { .. } => "resume_update",
1525 InstallerRequest::CancelUpdate { .. } => "cancel_update",
1526 }
1527 }
1528}
1529
1530#[derive(Debug, Clone)]
1531pub struct InstallerControlHandle {
1532 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1533}
1534
1535impl fidl::endpoints::ControlHandle for InstallerControlHandle {
1536 fn shutdown(&self) {
1537 self.inner.shutdown()
1538 }
1539 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1540 self.inner.shutdown_with_epitaph(status)
1541 }
1542
1543 fn is_closed(&self) -> bool {
1544 self.inner.channel().is_closed()
1545 }
1546 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1547 self.inner.channel().on_closed()
1548 }
1549
1550 #[cfg(target_os = "fuchsia")]
1551 fn signal_peer(
1552 &self,
1553 clear_mask: zx::Signals,
1554 set_mask: zx::Signals,
1555 ) -> Result<(), zx_status::Status> {
1556 use fidl::Peered;
1557 self.inner.channel().signal_peer(clear_mask, set_mask)
1558 }
1559}
1560
1561impl InstallerControlHandle {}
1562
1563#[must_use = "FIDL methods require a response to be sent"]
1564#[derive(Debug)]
1565pub struct InstallerStartUpdateResponder {
1566 control_handle: std::mem::ManuallyDrop<InstallerControlHandle>,
1567 tx_id: u32,
1568}
1569
1570impl std::ops::Drop for InstallerStartUpdateResponder {
1574 fn drop(&mut self) {
1575 self.control_handle.shutdown();
1576 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1578 }
1579}
1580
1581impl fidl::endpoints::Responder for InstallerStartUpdateResponder {
1582 type ControlHandle = InstallerControlHandle;
1583
1584 fn control_handle(&self) -> &InstallerControlHandle {
1585 &self.control_handle
1586 }
1587
1588 fn drop_without_shutdown(mut self) {
1589 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1591 std::mem::forget(self);
1593 }
1594}
1595
1596impl InstallerStartUpdateResponder {
1597 pub fn send(self, mut result: Result<&str, UpdateNotStartedReason>) -> Result<(), fidl::Error> {
1601 let _result = self.send_raw(result);
1602 if _result.is_err() {
1603 self.control_handle.shutdown();
1604 }
1605 self.drop_without_shutdown();
1606 _result
1607 }
1608
1609 pub fn send_no_shutdown_on_err(
1611 self,
1612 mut result: Result<&str, UpdateNotStartedReason>,
1613 ) -> Result<(), fidl::Error> {
1614 let _result = self.send_raw(result);
1615 self.drop_without_shutdown();
1616 _result
1617 }
1618
1619 fn send_raw(
1620 &self,
1621 mut result: Result<&str, UpdateNotStartedReason>,
1622 ) -> Result<(), fidl::Error> {
1623 self.control_handle.inner.send::<fidl::encoding::ResultType<
1624 InstallerStartUpdateResponse,
1625 UpdateNotStartedReason,
1626 >>(
1627 result.map(|attempt_id| (attempt_id,)),
1628 self.tx_id,
1629 0x2b1c5ba9167c320b,
1630 fidl::encoding::DynamicFlags::empty(),
1631 )
1632 }
1633}
1634
1635#[must_use = "FIDL methods require a response to be sent"]
1636#[derive(Debug)]
1637pub struct InstallerMonitorUpdateResponder {
1638 control_handle: std::mem::ManuallyDrop<InstallerControlHandle>,
1639 tx_id: u32,
1640}
1641
1642impl std::ops::Drop for InstallerMonitorUpdateResponder {
1646 fn drop(&mut self) {
1647 self.control_handle.shutdown();
1648 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1650 }
1651}
1652
1653impl fidl::endpoints::Responder for InstallerMonitorUpdateResponder {
1654 type ControlHandle = InstallerControlHandle;
1655
1656 fn control_handle(&self) -> &InstallerControlHandle {
1657 &self.control_handle
1658 }
1659
1660 fn drop_without_shutdown(mut self) {
1661 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1663 std::mem::forget(self);
1665 }
1666}
1667
1668impl InstallerMonitorUpdateResponder {
1669 pub fn send(self, mut attached: bool) -> Result<(), fidl::Error> {
1673 let _result = self.send_raw(attached);
1674 if _result.is_err() {
1675 self.control_handle.shutdown();
1676 }
1677 self.drop_without_shutdown();
1678 _result
1679 }
1680
1681 pub fn send_no_shutdown_on_err(self, mut attached: bool) -> Result<(), fidl::Error> {
1683 let _result = self.send_raw(attached);
1684 self.drop_without_shutdown();
1685 _result
1686 }
1687
1688 fn send_raw(&self, mut attached: bool) -> Result<(), fidl::Error> {
1689 self.control_handle.inner.send::<InstallerMonitorUpdateResponse>(
1690 (attached,),
1691 self.tx_id,
1692 0x21d54aa1fd825a32,
1693 fidl::encoding::DynamicFlags::empty(),
1694 )
1695 }
1696}
1697
1698#[must_use = "FIDL methods require a response to be sent"]
1699#[derive(Debug)]
1700pub struct InstallerSuspendUpdateResponder {
1701 control_handle: std::mem::ManuallyDrop<InstallerControlHandle>,
1702 tx_id: u32,
1703}
1704
1705impl std::ops::Drop for InstallerSuspendUpdateResponder {
1709 fn drop(&mut self) {
1710 self.control_handle.shutdown();
1711 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1713 }
1714}
1715
1716impl fidl::endpoints::Responder for InstallerSuspendUpdateResponder {
1717 type ControlHandle = InstallerControlHandle;
1718
1719 fn control_handle(&self) -> &InstallerControlHandle {
1720 &self.control_handle
1721 }
1722
1723 fn drop_without_shutdown(mut self) {
1724 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1726 std::mem::forget(self);
1728 }
1729}
1730
1731impl InstallerSuspendUpdateResponder {
1732 pub fn send(self, mut result: Result<(), SuspendError>) -> Result<(), fidl::Error> {
1736 let _result = self.send_raw(result);
1737 if _result.is_err() {
1738 self.control_handle.shutdown();
1739 }
1740 self.drop_without_shutdown();
1741 _result
1742 }
1743
1744 pub fn send_no_shutdown_on_err(
1746 self,
1747 mut result: Result<(), SuspendError>,
1748 ) -> Result<(), fidl::Error> {
1749 let _result = self.send_raw(result);
1750 self.drop_without_shutdown();
1751 _result
1752 }
1753
1754 fn send_raw(&self, mut result: Result<(), SuspendError>) -> Result<(), fidl::Error> {
1755 self.control_handle.inner.send::<fidl::encoding::ResultType<
1756 fidl::encoding::EmptyStruct,
1757 SuspendError,
1758 >>(
1759 result,
1760 self.tx_id,
1761 0x788de328461f9950,
1762 fidl::encoding::DynamicFlags::empty(),
1763 )
1764 }
1765}
1766
1767#[must_use = "FIDL methods require a response to be sent"]
1768#[derive(Debug)]
1769pub struct InstallerResumeUpdateResponder {
1770 control_handle: std::mem::ManuallyDrop<InstallerControlHandle>,
1771 tx_id: u32,
1772}
1773
1774impl std::ops::Drop for InstallerResumeUpdateResponder {
1778 fn drop(&mut self) {
1779 self.control_handle.shutdown();
1780 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1782 }
1783}
1784
1785impl fidl::endpoints::Responder for InstallerResumeUpdateResponder {
1786 type ControlHandle = InstallerControlHandle;
1787
1788 fn control_handle(&self) -> &InstallerControlHandle {
1789 &self.control_handle
1790 }
1791
1792 fn drop_without_shutdown(mut self) {
1793 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1795 std::mem::forget(self);
1797 }
1798}
1799
1800impl InstallerResumeUpdateResponder {
1801 pub fn send(self, mut result: Result<(), ResumeError>) -> Result<(), fidl::Error> {
1805 let _result = self.send_raw(result);
1806 if _result.is_err() {
1807 self.control_handle.shutdown();
1808 }
1809 self.drop_without_shutdown();
1810 _result
1811 }
1812
1813 pub fn send_no_shutdown_on_err(
1815 self,
1816 mut result: Result<(), ResumeError>,
1817 ) -> Result<(), fidl::Error> {
1818 let _result = self.send_raw(result);
1819 self.drop_without_shutdown();
1820 _result
1821 }
1822
1823 fn send_raw(&self, mut result: Result<(), ResumeError>) -> Result<(), fidl::Error> {
1824 self.control_handle.inner.send::<fidl::encoding::ResultType<
1825 fidl::encoding::EmptyStruct,
1826 ResumeError,
1827 >>(
1828 result,
1829 self.tx_id,
1830 0x7479e805fec33dd3,
1831 fidl::encoding::DynamicFlags::empty(),
1832 )
1833 }
1834}
1835
1836#[must_use = "FIDL methods require a response to be sent"]
1837#[derive(Debug)]
1838pub struct InstallerCancelUpdateResponder {
1839 control_handle: std::mem::ManuallyDrop<InstallerControlHandle>,
1840 tx_id: u32,
1841}
1842
1843impl std::ops::Drop for InstallerCancelUpdateResponder {
1847 fn drop(&mut self) {
1848 self.control_handle.shutdown();
1849 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1851 }
1852}
1853
1854impl fidl::endpoints::Responder for InstallerCancelUpdateResponder {
1855 type ControlHandle = InstallerControlHandle;
1856
1857 fn control_handle(&self) -> &InstallerControlHandle {
1858 &self.control_handle
1859 }
1860
1861 fn drop_without_shutdown(mut self) {
1862 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1864 std::mem::forget(self);
1866 }
1867}
1868
1869impl InstallerCancelUpdateResponder {
1870 pub fn send(self, mut result: Result<(), CancelError>) -> Result<(), fidl::Error> {
1874 let _result = self.send_raw(result);
1875 if _result.is_err() {
1876 self.control_handle.shutdown();
1877 }
1878 self.drop_without_shutdown();
1879 _result
1880 }
1881
1882 pub fn send_no_shutdown_on_err(
1884 self,
1885 mut result: Result<(), CancelError>,
1886 ) -> Result<(), fidl::Error> {
1887 let _result = self.send_raw(result);
1888 self.drop_without_shutdown();
1889 _result
1890 }
1891
1892 fn send_raw(&self, mut result: Result<(), CancelError>) -> Result<(), fidl::Error> {
1893 self.control_handle.inner.send::<fidl::encoding::ResultType<
1894 fidl::encoding::EmptyStruct,
1895 CancelError,
1896 >>(
1897 result,
1898 self.tx_id,
1899 0x472dec9160a1d0f,
1900 fidl::encoding::DynamicFlags::empty(),
1901 )
1902 }
1903}
1904
1905#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1906pub struct MonitorMarker;
1907
1908impl fidl::endpoints::ProtocolMarker for MonitorMarker {
1909 type Proxy = MonitorProxy;
1910 type RequestStream = MonitorRequestStream;
1911 #[cfg(target_os = "fuchsia")]
1912 type SynchronousProxy = MonitorSynchronousProxy;
1913
1914 const DEBUG_NAME: &'static str = "(anonymous) Monitor";
1915}
1916
1917pub trait MonitorProxyInterface: Send + Sync {
1918 type OnStateResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1919 fn r#on_state(&self, state: &State) -> Self::OnStateResponseFut;
1920}
1921#[derive(Debug)]
1922#[cfg(target_os = "fuchsia")]
1923pub struct MonitorSynchronousProxy {
1924 client: fidl::client::sync::Client,
1925}
1926
1927#[cfg(target_os = "fuchsia")]
1928impl fidl::endpoints::SynchronousProxy for MonitorSynchronousProxy {
1929 type Proxy = MonitorProxy;
1930 type Protocol = MonitorMarker;
1931
1932 fn from_channel(inner: fidl::Channel) -> Self {
1933 Self::new(inner)
1934 }
1935
1936 fn into_channel(self) -> fidl::Channel {
1937 self.client.into_channel()
1938 }
1939
1940 fn as_channel(&self) -> &fidl::Channel {
1941 self.client.as_channel()
1942 }
1943}
1944
1945#[cfg(target_os = "fuchsia")]
1946impl MonitorSynchronousProxy {
1947 pub fn new(channel: fidl::Channel) -> Self {
1948 let protocol_name = <MonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1949 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1950 }
1951
1952 pub fn into_channel(self) -> fidl::Channel {
1953 self.client.into_channel()
1954 }
1955
1956 pub fn wait_for_event(
1959 &self,
1960 deadline: zx::MonotonicInstant,
1961 ) -> Result<MonitorEvent, fidl::Error> {
1962 MonitorEvent::decode(self.client.wait_for_event(deadline)?)
1963 }
1964
1965 pub fn r#on_state(
1986 &self,
1987 mut state: &State,
1988 ___deadline: zx::MonotonicInstant,
1989 ) -> Result<(), fidl::Error> {
1990 let _response =
1991 self.client.send_query::<MonitorOnStateRequest, fidl::encoding::EmptyPayload>(
1992 (state,),
1993 0x574105820d16cf26,
1994 fidl::encoding::DynamicFlags::empty(),
1995 ___deadline,
1996 )?;
1997 Ok(_response)
1998 }
1999}
2000
2001#[derive(Debug, Clone)]
2002pub struct MonitorProxy {
2003 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2004}
2005
2006impl fidl::endpoints::Proxy for MonitorProxy {
2007 type Protocol = MonitorMarker;
2008
2009 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2010 Self::new(inner)
2011 }
2012
2013 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2014 self.client.into_channel().map_err(|client| Self { client })
2015 }
2016
2017 fn as_channel(&self) -> &::fidl::AsyncChannel {
2018 self.client.as_channel()
2019 }
2020}
2021
2022impl MonitorProxy {
2023 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2025 let protocol_name = <MonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2026 Self { client: fidl::client::Client::new(channel, protocol_name) }
2027 }
2028
2029 pub fn take_event_stream(&self) -> MonitorEventStream {
2035 MonitorEventStream { event_receiver: self.client.take_event_receiver() }
2036 }
2037
2038 pub fn r#on_state(
2059 &self,
2060 mut state: &State,
2061 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2062 MonitorProxyInterface::r#on_state(self, state)
2063 }
2064}
2065
2066impl MonitorProxyInterface for MonitorProxy {
2067 type OnStateResponseFut =
2068 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2069 fn r#on_state(&self, mut state: &State) -> Self::OnStateResponseFut {
2070 fn _decode(
2071 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2072 ) -> Result<(), fidl::Error> {
2073 let _response = fidl::client::decode_transaction_body::<
2074 fidl::encoding::EmptyPayload,
2075 fidl::encoding::DefaultFuchsiaResourceDialect,
2076 0x574105820d16cf26,
2077 >(_buf?)?;
2078 Ok(_response)
2079 }
2080 self.client.send_query_and_decode::<MonitorOnStateRequest, ()>(
2081 (state,),
2082 0x574105820d16cf26,
2083 fidl::encoding::DynamicFlags::empty(),
2084 _decode,
2085 )
2086 }
2087}
2088
2089pub struct MonitorEventStream {
2090 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2091}
2092
2093impl std::marker::Unpin for MonitorEventStream {}
2094
2095impl futures::stream::FusedStream for MonitorEventStream {
2096 fn is_terminated(&self) -> bool {
2097 self.event_receiver.is_terminated()
2098 }
2099}
2100
2101impl futures::Stream for MonitorEventStream {
2102 type Item = Result<MonitorEvent, fidl::Error>;
2103
2104 fn poll_next(
2105 mut self: std::pin::Pin<&mut Self>,
2106 cx: &mut std::task::Context<'_>,
2107 ) -> std::task::Poll<Option<Self::Item>> {
2108 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2109 &mut self.event_receiver,
2110 cx
2111 )?) {
2112 Some(buf) => std::task::Poll::Ready(Some(MonitorEvent::decode(buf))),
2113 None => std::task::Poll::Ready(None),
2114 }
2115 }
2116}
2117
2118#[derive(Debug)]
2119pub enum MonitorEvent {}
2120
2121impl MonitorEvent {
2122 fn decode(
2124 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2125 ) -> Result<MonitorEvent, fidl::Error> {
2126 let (bytes, _handles) = buf.split_mut();
2127 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2128 debug_assert_eq!(tx_header.tx_id, 0);
2129 match tx_header.ordinal {
2130 _ => Err(fidl::Error::UnknownOrdinal {
2131 ordinal: tx_header.ordinal,
2132 protocol_name: <MonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2133 }),
2134 }
2135 }
2136}
2137
2138pub struct MonitorRequestStream {
2140 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2141 is_terminated: bool,
2142}
2143
2144impl std::marker::Unpin for MonitorRequestStream {}
2145
2146impl futures::stream::FusedStream for MonitorRequestStream {
2147 fn is_terminated(&self) -> bool {
2148 self.is_terminated
2149 }
2150}
2151
2152impl fidl::endpoints::RequestStream for MonitorRequestStream {
2153 type Protocol = MonitorMarker;
2154 type ControlHandle = MonitorControlHandle;
2155
2156 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2157 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2158 }
2159
2160 fn control_handle(&self) -> Self::ControlHandle {
2161 MonitorControlHandle { inner: self.inner.clone() }
2162 }
2163
2164 fn into_inner(
2165 self,
2166 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2167 {
2168 (self.inner, self.is_terminated)
2169 }
2170
2171 fn from_inner(
2172 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2173 is_terminated: bool,
2174 ) -> Self {
2175 Self { inner, is_terminated }
2176 }
2177}
2178
2179impl futures::Stream for MonitorRequestStream {
2180 type Item = Result<MonitorRequest, fidl::Error>;
2181
2182 fn poll_next(
2183 mut self: std::pin::Pin<&mut Self>,
2184 cx: &mut std::task::Context<'_>,
2185 ) -> std::task::Poll<Option<Self::Item>> {
2186 let this = &mut *self;
2187 if this.inner.check_shutdown(cx) {
2188 this.is_terminated = true;
2189 return std::task::Poll::Ready(None);
2190 }
2191 if this.is_terminated {
2192 panic!("polled MonitorRequestStream after completion");
2193 }
2194 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2195 |bytes, handles| {
2196 match this.inner.channel().read_etc(cx, bytes, handles) {
2197 std::task::Poll::Ready(Ok(())) => {}
2198 std::task::Poll::Pending => return std::task::Poll::Pending,
2199 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2200 this.is_terminated = true;
2201 return std::task::Poll::Ready(None);
2202 }
2203 std::task::Poll::Ready(Err(e)) => {
2204 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2205 e.into(),
2206 ))))
2207 }
2208 }
2209
2210 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2212
2213 std::task::Poll::Ready(Some(match header.ordinal {
2214 0x574105820d16cf26 => {
2215 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2216 let mut req = fidl::new_empty!(
2217 MonitorOnStateRequest,
2218 fidl::encoding::DefaultFuchsiaResourceDialect
2219 );
2220 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MonitorOnStateRequest>(&header, _body_bytes, handles, &mut req)?;
2221 let control_handle = MonitorControlHandle { inner: this.inner.clone() };
2222 Ok(MonitorRequest::OnState {
2223 state: req.state,
2224
2225 responder: MonitorOnStateResponder {
2226 control_handle: std::mem::ManuallyDrop::new(control_handle),
2227 tx_id: header.tx_id,
2228 },
2229 })
2230 }
2231 _ => Err(fidl::Error::UnknownOrdinal {
2232 ordinal: header.ordinal,
2233 protocol_name:
2234 <MonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2235 }),
2236 }))
2237 },
2238 )
2239 }
2240}
2241
2242#[derive(Debug)]
2248pub enum MonitorRequest {
2249 OnState { state: State, responder: MonitorOnStateResponder },
2270}
2271
2272impl MonitorRequest {
2273 #[allow(irrefutable_let_patterns)]
2274 pub fn into_on_state(self) -> Option<(State, MonitorOnStateResponder)> {
2275 if let MonitorRequest::OnState { state, responder } = self {
2276 Some((state, responder))
2277 } else {
2278 None
2279 }
2280 }
2281
2282 pub fn method_name(&self) -> &'static str {
2284 match *self {
2285 MonitorRequest::OnState { .. } => "on_state",
2286 }
2287 }
2288}
2289
2290#[derive(Debug, Clone)]
2291pub struct MonitorControlHandle {
2292 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2293}
2294
2295impl fidl::endpoints::ControlHandle for MonitorControlHandle {
2296 fn shutdown(&self) {
2297 self.inner.shutdown()
2298 }
2299 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2300 self.inner.shutdown_with_epitaph(status)
2301 }
2302
2303 fn is_closed(&self) -> bool {
2304 self.inner.channel().is_closed()
2305 }
2306 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2307 self.inner.channel().on_closed()
2308 }
2309
2310 #[cfg(target_os = "fuchsia")]
2311 fn signal_peer(
2312 &self,
2313 clear_mask: zx::Signals,
2314 set_mask: zx::Signals,
2315 ) -> Result<(), zx_status::Status> {
2316 use fidl::Peered;
2317 self.inner.channel().signal_peer(clear_mask, set_mask)
2318 }
2319}
2320
2321impl MonitorControlHandle {}
2322
2323#[must_use = "FIDL methods require a response to be sent"]
2324#[derive(Debug)]
2325pub struct MonitorOnStateResponder {
2326 control_handle: std::mem::ManuallyDrop<MonitorControlHandle>,
2327 tx_id: u32,
2328}
2329
2330impl std::ops::Drop for MonitorOnStateResponder {
2334 fn drop(&mut self) {
2335 self.control_handle.shutdown();
2336 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2338 }
2339}
2340
2341impl fidl::endpoints::Responder for MonitorOnStateResponder {
2342 type ControlHandle = MonitorControlHandle;
2343
2344 fn control_handle(&self) -> &MonitorControlHandle {
2345 &self.control_handle
2346 }
2347
2348 fn drop_without_shutdown(mut self) {
2349 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2351 std::mem::forget(self);
2353 }
2354}
2355
2356impl MonitorOnStateResponder {
2357 pub fn send(self) -> Result<(), fidl::Error> {
2361 let _result = self.send_raw();
2362 if _result.is_err() {
2363 self.control_handle.shutdown();
2364 }
2365 self.drop_without_shutdown();
2366 _result
2367 }
2368
2369 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2371 let _result = self.send_raw();
2372 self.drop_without_shutdown();
2373 _result
2374 }
2375
2376 fn send_raw(&self) -> Result<(), fidl::Error> {
2377 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2378 (),
2379 self.tx_id,
2380 0x574105820d16cf26,
2381 fidl::encoding::DynamicFlags::empty(),
2382 )
2383 }
2384}
2385
2386#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2387pub struct RebootControllerMarker;
2388
2389impl fidl::endpoints::ProtocolMarker for RebootControllerMarker {
2390 type Proxy = RebootControllerProxy;
2391 type RequestStream = RebootControllerRequestStream;
2392 #[cfg(target_os = "fuchsia")]
2393 type SynchronousProxy = RebootControllerSynchronousProxy;
2394
2395 const DEBUG_NAME: &'static str = "(anonymous) RebootController";
2396}
2397
2398pub trait RebootControllerProxyInterface: Send + Sync {
2399 fn r#unblock(&self) -> Result<(), fidl::Error>;
2400 fn r#detach(&self) -> Result<(), fidl::Error>;
2401}
2402#[derive(Debug)]
2403#[cfg(target_os = "fuchsia")]
2404pub struct RebootControllerSynchronousProxy {
2405 client: fidl::client::sync::Client,
2406}
2407
2408#[cfg(target_os = "fuchsia")]
2409impl fidl::endpoints::SynchronousProxy for RebootControllerSynchronousProxy {
2410 type Proxy = RebootControllerProxy;
2411 type Protocol = RebootControllerMarker;
2412
2413 fn from_channel(inner: fidl::Channel) -> Self {
2414 Self::new(inner)
2415 }
2416
2417 fn into_channel(self) -> fidl::Channel {
2418 self.client.into_channel()
2419 }
2420
2421 fn as_channel(&self) -> &fidl::Channel {
2422 self.client.as_channel()
2423 }
2424}
2425
2426#[cfg(target_os = "fuchsia")]
2427impl RebootControllerSynchronousProxy {
2428 pub fn new(channel: fidl::Channel) -> Self {
2429 let protocol_name = <RebootControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2430 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2431 }
2432
2433 pub fn into_channel(self) -> fidl::Channel {
2434 self.client.into_channel()
2435 }
2436
2437 pub fn wait_for_event(
2440 &self,
2441 deadline: zx::MonotonicInstant,
2442 ) -> Result<RebootControllerEvent, fidl::Error> {
2443 RebootControllerEvent::decode(self.client.wait_for_event(deadline)?)
2444 }
2445
2446 pub fn r#unblock(&self) -> Result<(), fidl::Error> {
2454 self.client.send::<fidl::encoding::EmptyPayload>(
2455 (),
2456 0x5705625395e3d520,
2457 fidl::encoding::DynamicFlags::empty(),
2458 )
2459 }
2460
2461 pub fn r#detach(&self) -> Result<(), fidl::Error> {
2464 self.client.send::<fidl::encoding::EmptyPayload>(
2465 (),
2466 0x1daa560411955f16,
2467 fidl::encoding::DynamicFlags::empty(),
2468 )
2469 }
2470}
2471
2472#[derive(Debug, Clone)]
2473pub struct RebootControllerProxy {
2474 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2475}
2476
2477impl fidl::endpoints::Proxy for RebootControllerProxy {
2478 type Protocol = RebootControllerMarker;
2479
2480 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2481 Self::new(inner)
2482 }
2483
2484 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2485 self.client.into_channel().map_err(|client| Self { client })
2486 }
2487
2488 fn as_channel(&self) -> &::fidl::AsyncChannel {
2489 self.client.as_channel()
2490 }
2491}
2492
2493impl RebootControllerProxy {
2494 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2496 let protocol_name = <RebootControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2497 Self { client: fidl::client::Client::new(channel, protocol_name) }
2498 }
2499
2500 pub fn take_event_stream(&self) -> RebootControllerEventStream {
2506 RebootControllerEventStream { event_receiver: self.client.take_event_receiver() }
2507 }
2508
2509 pub fn r#unblock(&self) -> Result<(), fidl::Error> {
2517 RebootControllerProxyInterface::r#unblock(self)
2518 }
2519
2520 pub fn r#detach(&self) -> Result<(), fidl::Error> {
2523 RebootControllerProxyInterface::r#detach(self)
2524 }
2525}
2526
2527impl RebootControllerProxyInterface for RebootControllerProxy {
2528 fn r#unblock(&self) -> Result<(), fidl::Error> {
2529 self.client.send::<fidl::encoding::EmptyPayload>(
2530 (),
2531 0x5705625395e3d520,
2532 fidl::encoding::DynamicFlags::empty(),
2533 )
2534 }
2535
2536 fn r#detach(&self) -> Result<(), fidl::Error> {
2537 self.client.send::<fidl::encoding::EmptyPayload>(
2538 (),
2539 0x1daa560411955f16,
2540 fidl::encoding::DynamicFlags::empty(),
2541 )
2542 }
2543}
2544
2545pub struct RebootControllerEventStream {
2546 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2547}
2548
2549impl std::marker::Unpin for RebootControllerEventStream {}
2550
2551impl futures::stream::FusedStream for RebootControllerEventStream {
2552 fn is_terminated(&self) -> bool {
2553 self.event_receiver.is_terminated()
2554 }
2555}
2556
2557impl futures::Stream for RebootControllerEventStream {
2558 type Item = Result<RebootControllerEvent, fidl::Error>;
2559
2560 fn poll_next(
2561 mut self: std::pin::Pin<&mut Self>,
2562 cx: &mut std::task::Context<'_>,
2563 ) -> std::task::Poll<Option<Self::Item>> {
2564 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2565 &mut self.event_receiver,
2566 cx
2567 )?) {
2568 Some(buf) => std::task::Poll::Ready(Some(RebootControllerEvent::decode(buf))),
2569 None => std::task::Poll::Ready(None),
2570 }
2571 }
2572}
2573
2574#[derive(Debug)]
2575pub enum RebootControllerEvent {}
2576
2577impl RebootControllerEvent {
2578 fn decode(
2580 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2581 ) -> Result<RebootControllerEvent, fidl::Error> {
2582 let (bytes, _handles) = buf.split_mut();
2583 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2584 debug_assert_eq!(tx_header.tx_id, 0);
2585 match tx_header.ordinal {
2586 _ => Err(fidl::Error::UnknownOrdinal {
2587 ordinal: tx_header.ordinal,
2588 protocol_name:
2589 <RebootControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2590 }),
2591 }
2592 }
2593}
2594
2595pub struct RebootControllerRequestStream {
2597 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2598 is_terminated: bool,
2599}
2600
2601impl std::marker::Unpin for RebootControllerRequestStream {}
2602
2603impl futures::stream::FusedStream for RebootControllerRequestStream {
2604 fn is_terminated(&self) -> bool {
2605 self.is_terminated
2606 }
2607}
2608
2609impl fidl::endpoints::RequestStream for RebootControllerRequestStream {
2610 type Protocol = RebootControllerMarker;
2611 type ControlHandle = RebootControllerControlHandle;
2612
2613 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2614 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2615 }
2616
2617 fn control_handle(&self) -> Self::ControlHandle {
2618 RebootControllerControlHandle { inner: self.inner.clone() }
2619 }
2620
2621 fn into_inner(
2622 self,
2623 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2624 {
2625 (self.inner, self.is_terminated)
2626 }
2627
2628 fn from_inner(
2629 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2630 is_terminated: bool,
2631 ) -> Self {
2632 Self { inner, is_terminated }
2633 }
2634}
2635
2636impl futures::Stream for RebootControllerRequestStream {
2637 type Item = Result<RebootControllerRequest, fidl::Error>;
2638
2639 fn poll_next(
2640 mut self: std::pin::Pin<&mut Self>,
2641 cx: &mut std::task::Context<'_>,
2642 ) -> std::task::Poll<Option<Self::Item>> {
2643 let this = &mut *self;
2644 if this.inner.check_shutdown(cx) {
2645 this.is_terminated = true;
2646 return std::task::Poll::Ready(None);
2647 }
2648 if this.is_terminated {
2649 panic!("polled RebootControllerRequestStream after completion");
2650 }
2651 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2652 |bytes, handles| {
2653 match this.inner.channel().read_etc(cx, bytes, handles) {
2654 std::task::Poll::Ready(Ok(())) => {}
2655 std::task::Poll::Pending => return std::task::Poll::Pending,
2656 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2657 this.is_terminated = true;
2658 return std::task::Poll::Ready(None);
2659 }
2660 std::task::Poll::Ready(Err(e)) => {
2661 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2662 e.into(),
2663 ))))
2664 }
2665 }
2666
2667 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2669
2670 std::task::Poll::Ready(Some(match header.ordinal {
2671 0x5705625395e3d520 => {
2672 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2673 let mut req = fidl::new_empty!(
2674 fidl::encoding::EmptyPayload,
2675 fidl::encoding::DefaultFuchsiaResourceDialect
2676 );
2677 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2678 let control_handle =
2679 RebootControllerControlHandle { inner: this.inner.clone() };
2680 Ok(RebootControllerRequest::Unblock { control_handle })
2681 }
2682 0x1daa560411955f16 => {
2683 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2684 let mut req = fidl::new_empty!(
2685 fidl::encoding::EmptyPayload,
2686 fidl::encoding::DefaultFuchsiaResourceDialect
2687 );
2688 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2689 let control_handle =
2690 RebootControllerControlHandle { inner: this.inner.clone() };
2691 Ok(RebootControllerRequest::Detach { control_handle })
2692 }
2693 _ => Err(fidl::Error::UnknownOrdinal {
2694 ordinal: header.ordinal,
2695 protocol_name:
2696 <RebootControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2697 }),
2698 }))
2699 },
2700 )
2701 }
2702}
2703
2704#[derive(Debug)]
2710pub enum RebootControllerRequest {
2711 Unblock { control_handle: RebootControllerControlHandle },
2719 Detach { control_handle: RebootControllerControlHandle },
2722}
2723
2724impl RebootControllerRequest {
2725 #[allow(irrefutable_let_patterns)]
2726 pub fn into_unblock(self) -> Option<(RebootControllerControlHandle)> {
2727 if let RebootControllerRequest::Unblock { control_handle } = self {
2728 Some((control_handle))
2729 } else {
2730 None
2731 }
2732 }
2733
2734 #[allow(irrefutable_let_patterns)]
2735 pub fn into_detach(self) -> Option<(RebootControllerControlHandle)> {
2736 if let RebootControllerRequest::Detach { control_handle } = self {
2737 Some((control_handle))
2738 } else {
2739 None
2740 }
2741 }
2742
2743 pub fn method_name(&self) -> &'static str {
2745 match *self {
2746 RebootControllerRequest::Unblock { .. } => "unblock",
2747 RebootControllerRequest::Detach { .. } => "detach",
2748 }
2749 }
2750}
2751
2752#[derive(Debug, Clone)]
2753pub struct RebootControllerControlHandle {
2754 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2755}
2756
2757impl fidl::endpoints::ControlHandle for RebootControllerControlHandle {
2758 fn shutdown(&self) {
2759 self.inner.shutdown()
2760 }
2761 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2762 self.inner.shutdown_with_epitaph(status)
2763 }
2764
2765 fn is_closed(&self) -> bool {
2766 self.inner.channel().is_closed()
2767 }
2768 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2769 self.inner.channel().on_closed()
2770 }
2771
2772 #[cfg(target_os = "fuchsia")]
2773 fn signal_peer(
2774 &self,
2775 clear_mask: zx::Signals,
2776 set_mask: zx::Signals,
2777 ) -> Result<(), zx_status::Status> {
2778 use fidl::Peered;
2779 self.inner.channel().signal_peer(clear_mask, set_mask)
2780 }
2781}
2782
2783impl RebootControllerControlHandle {}
2784
2785mod internal {
2786 use super::*;
2787 unsafe impl fidl::encoding::TypeMarker for CancelError {
2788 type Owned = Self;
2789
2790 #[inline(always)]
2791 fn inline_align(_context: fidl::encoding::Context) -> usize {
2792 std::mem::align_of::<u32>()
2793 }
2794
2795 #[inline(always)]
2796 fn inline_size(_context: fidl::encoding::Context) -> usize {
2797 std::mem::size_of::<u32>()
2798 }
2799
2800 #[inline(always)]
2801 fn encode_is_copy() -> bool {
2802 true
2803 }
2804
2805 #[inline(always)]
2806 fn decode_is_copy() -> bool {
2807 false
2808 }
2809 }
2810
2811 impl fidl::encoding::ValueTypeMarker for CancelError {
2812 type Borrowed<'a> = Self;
2813 #[inline(always)]
2814 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2815 *value
2816 }
2817 }
2818
2819 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CancelError {
2820 #[inline]
2821 unsafe fn encode(
2822 self,
2823 encoder: &mut fidl::encoding::Encoder<'_, D>,
2824 offset: usize,
2825 _depth: fidl::encoding::Depth,
2826 ) -> fidl::Result<()> {
2827 encoder.debug_check_bounds::<Self>(offset);
2828 encoder.write_num(self.into_primitive(), offset);
2829 Ok(())
2830 }
2831 }
2832
2833 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CancelError {
2834 #[inline(always)]
2835 fn new_empty() -> Self {
2836 Self::NoUpdateInProgress
2837 }
2838
2839 #[inline]
2840 unsafe fn decode(
2841 &mut self,
2842 decoder: &mut fidl::encoding::Decoder<'_, D>,
2843 offset: usize,
2844 _depth: fidl::encoding::Depth,
2845 ) -> fidl::Result<()> {
2846 decoder.debug_check_bounds::<Self>(offset);
2847 let prim = decoder.read_num::<u32>(offset);
2848
2849 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2850 Ok(())
2851 }
2852 }
2853 unsafe impl fidl::encoding::TypeMarker for FetchFailureReason {
2854 type Owned = Self;
2855
2856 #[inline(always)]
2857 fn inline_align(_context: fidl::encoding::Context) -> usize {
2858 std::mem::align_of::<u32>()
2859 }
2860
2861 #[inline(always)]
2862 fn inline_size(_context: fidl::encoding::Context) -> usize {
2863 std::mem::size_of::<u32>()
2864 }
2865
2866 #[inline(always)]
2867 fn encode_is_copy() -> bool {
2868 true
2869 }
2870
2871 #[inline(always)]
2872 fn decode_is_copy() -> bool {
2873 false
2874 }
2875 }
2876
2877 impl fidl::encoding::ValueTypeMarker for FetchFailureReason {
2878 type Borrowed<'a> = Self;
2879 #[inline(always)]
2880 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2881 *value
2882 }
2883 }
2884
2885 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2886 for FetchFailureReason
2887 {
2888 #[inline]
2889 unsafe fn encode(
2890 self,
2891 encoder: &mut fidl::encoding::Encoder<'_, D>,
2892 offset: usize,
2893 _depth: fidl::encoding::Depth,
2894 ) -> fidl::Result<()> {
2895 encoder.debug_check_bounds::<Self>(offset);
2896 encoder.write_num(self.into_primitive(), offset);
2897 Ok(())
2898 }
2899 }
2900
2901 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FetchFailureReason {
2902 #[inline(always)]
2903 fn new_empty() -> Self {
2904 Self::Internal
2905 }
2906
2907 #[inline]
2908 unsafe fn decode(
2909 &mut self,
2910 decoder: &mut fidl::encoding::Decoder<'_, D>,
2911 offset: usize,
2912 _depth: fidl::encoding::Depth,
2913 ) -> fidl::Result<()> {
2914 decoder.debug_check_bounds::<Self>(offset);
2915 let prim = decoder.read_num::<u32>(offset);
2916
2917 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2918 Ok(())
2919 }
2920 }
2921 unsafe impl fidl::encoding::TypeMarker for Initiator {
2922 type Owned = Self;
2923
2924 #[inline(always)]
2925 fn inline_align(_context: fidl::encoding::Context) -> usize {
2926 std::mem::align_of::<u32>()
2927 }
2928
2929 #[inline(always)]
2930 fn inline_size(_context: fidl::encoding::Context) -> usize {
2931 std::mem::size_of::<u32>()
2932 }
2933
2934 #[inline(always)]
2935 fn encode_is_copy() -> bool {
2936 true
2937 }
2938
2939 #[inline(always)]
2940 fn decode_is_copy() -> bool {
2941 false
2942 }
2943 }
2944
2945 impl fidl::encoding::ValueTypeMarker for Initiator {
2946 type Borrowed<'a> = Self;
2947 #[inline(always)]
2948 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2949 *value
2950 }
2951 }
2952
2953 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Initiator {
2954 #[inline]
2955 unsafe fn encode(
2956 self,
2957 encoder: &mut fidl::encoding::Encoder<'_, D>,
2958 offset: usize,
2959 _depth: fidl::encoding::Depth,
2960 ) -> fidl::Result<()> {
2961 encoder.debug_check_bounds::<Self>(offset);
2962 encoder.write_num(self.into_primitive(), offset);
2963 Ok(())
2964 }
2965 }
2966
2967 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Initiator {
2968 #[inline(always)]
2969 fn new_empty() -> Self {
2970 Self::User
2971 }
2972
2973 #[inline]
2974 unsafe fn decode(
2975 &mut self,
2976 decoder: &mut fidl::encoding::Decoder<'_, D>,
2977 offset: usize,
2978 _depth: fidl::encoding::Depth,
2979 ) -> fidl::Result<()> {
2980 decoder.debug_check_bounds::<Self>(offset);
2981 let prim = decoder.read_num::<u32>(offset);
2982
2983 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2984 Ok(())
2985 }
2986 }
2987 unsafe impl fidl::encoding::TypeMarker for PrepareFailureReason {
2988 type Owned = Self;
2989
2990 #[inline(always)]
2991 fn inline_align(_context: fidl::encoding::Context) -> usize {
2992 std::mem::align_of::<u32>()
2993 }
2994
2995 #[inline(always)]
2996 fn inline_size(_context: fidl::encoding::Context) -> usize {
2997 std::mem::size_of::<u32>()
2998 }
2999
3000 #[inline(always)]
3001 fn encode_is_copy() -> bool {
3002 true
3003 }
3004
3005 #[inline(always)]
3006 fn decode_is_copy() -> bool {
3007 false
3008 }
3009 }
3010
3011 impl fidl::encoding::ValueTypeMarker for PrepareFailureReason {
3012 type Borrowed<'a> = Self;
3013 #[inline(always)]
3014 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3015 *value
3016 }
3017 }
3018
3019 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3020 for PrepareFailureReason
3021 {
3022 #[inline]
3023 unsafe fn encode(
3024 self,
3025 encoder: &mut fidl::encoding::Encoder<'_, D>,
3026 offset: usize,
3027 _depth: fidl::encoding::Depth,
3028 ) -> fidl::Result<()> {
3029 encoder.debug_check_bounds::<Self>(offset);
3030 encoder.write_num(self.into_primitive(), offset);
3031 Ok(())
3032 }
3033 }
3034
3035 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrepareFailureReason {
3036 #[inline(always)]
3037 fn new_empty() -> Self {
3038 Self::Internal
3039 }
3040
3041 #[inline]
3042 unsafe fn decode(
3043 &mut self,
3044 decoder: &mut fidl::encoding::Decoder<'_, D>,
3045 offset: usize,
3046 _depth: fidl::encoding::Depth,
3047 ) -> fidl::Result<()> {
3048 decoder.debug_check_bounds::<Self>(offset);
3049 let prim = decoder.read_num::<u32>(offset);
3050
3051 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3052 Ok(())
3053 }
3054 }
3055 unsafe impl fidl::encoding::TypeMarker for ResumeError {
3056 type Owned = Self;
3057
3058 #[inline(always)]
3059 fn inline_align(_context: fidl::encoding::Context) -> usize {
3060 std::mem::align_of::<u32>()
3061 }
3062
3063 #[inline(always)]
3064 fn inline_size(_context: fidl::encoding::Context) -> usize {
3065 std::mem::size_of::<u32>()
3066 }
3067
3068 #[inline(always)]
3069 fn encode_is_copy() -> bool {
3070 true
3071 }
3072
3073 #[inline(always)]
3074 fn decode_is_copy() -> bool {
3075 false
3076 }
3077 }
3078
3079 impl fidl::encoding::ValueTypeMarker for ResumeError {
3080 type Borrowed<'a> = Self;
3081 #[inline(always)]
3082 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3083 *value
3084 }
3085 }
3086
3087 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ResumeError {
3088 #[inline]
3089 unsafe fn encode(
3090 self,
3091 encoder: &mut fidl::encoding::Encoder<'_, D>,
3092 offset: usize,
3093 _depth: fidl::encoding::Depth,
3094 ) -> fidl::Result<()> {
3095 encoder.debug_check_bounds::<Self>(offset);
3096 encoder.write_num(self.into_primitive(), offset);
3097 Ok(())
3098 }
3099 }
3100
3101 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResumeError {
3102 #[inline(always)]
3103 fn new_empty() -> Self {
3104 Self::NoUpdateInProgress
3105 }
3106
3107 #[inline]
3108 unsafe fn decode(
3109 &mut self,
3110 decoder: &mut fidl::encoding::Decoder<'_, D>,
3111 offset: usize,
3112 _depth: fidl::encoding::Depth,
3113 ) -> fidl::Result<()> {
3114 decoder.debug_check_bounds::<Self>(offset);
3115 let prim = decoder.read_num::<u32>(offset);
3116
3117 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3118 Ok(())
3119 }
3120 }
3121 unsafe impl fidl::encoding::TypeMarker for StageFailureReason {
3122 type Owned = Self;
3123
3124 #[inline(always)]
3125 fn inline_align(_context: fidl::encoding::Context) -> usize {
3126 std::mem::align_of::<u32>()
3127 }
3128
3129 #[inline(always)]
3130 fn inline_size(_context: fidl::encoding::Context) -> usize {
3131 std::mem::size_of::<u32>()
3132 }
3133
3134 #[inline(always)]
3135 fn encode_is_copy() -> bool {
3136 true
3137 }
3138
3139 #[inline(always)]
3140 fn decode_is_copy() -> bool {
3141 false
3142 }
3143 }
3144
3145 impl fidl::encoding::ValueTypeMarker for StageFailureReason {
3146 type Borrowed<'a> = Self;
3147 #[inline(always)]
3148 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3149 *value
3150 }
3151 }
3152
3153 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3154 for StageFailureReason
3155 {
3156 #[inline]
3157 unsafe fn encode(
3158 self,
3159 encoder: &mut fidl::encoding::Encoder<'_, D>,
3160 offset: usize,
3161 _depth: fidl::encoding::Depth,
3162 ) -> fidl::Result<()> {
3163 encoder.debug_check_bounds::<Self>(offset);
3164 encoder.write_num(self.into_primitive(), offset);
3165 Ok(())
3166 }
3167 }
3168
3169 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StageFailureReason {
3170 #[inline(always)]
3171 fn new_empty() -> Self {
3172 Self::Internal
3173 }
3174
3175 #[inline]
3176 unsafe fn decode(
3177 &mut self,
3178 decoder: &mut fidl::encoding::Decoder<'_, D>,
3179 offset: usize,
3180 _depth: fidl::encoding::Depth,
3181 ) -> fidl::Result<()> {
3182 decoder.debug_check_bounds::<Self>(offset);
3183 let prim = decoder.read_num::<u32>(offset);
3184
3185 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3186 Ok(())
3187 }
3188 }
3189 unsafe impl fidl::encoding::TypeMarker for SuspendError {
3190 type Owned = Self;
3191
3192 #[inline(always)]
3193 fn inline_align(_context: fidl::encoding::Context) -> usize {
3194 std::mem::align_of::<u32>()
3195 }
3196
3197 #[inline(always)]
3198 fn inline_size(_context: fidl::encoding::Context) -> usize {
3199 std::mem::size_of::<u32>()
3200 }
3201
3202 #[inline(always)]
3203 fn encode_is_copy() -> bool {
3204 true
3205 }
3206
3207 #[inline(always)]
3208 fn decode_is_copy() -> bool {
3209 false
3210 }
3211 }
3212
3213 impl fidl::encoding::ValueTypeMarker for SuspendError {
3214 type Borrowed<'a> = Self;
3215 #[inline(always)]
3216 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3217 *value
3218 }
3219 }
3220
3221 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SuspendError {
3222 #[inline]
3223 unsafe fn encode(
3224 self,
3225 encoder: &mut fidl::encoding::Encoder<'_, D>,
3226 offset: usize,
3227 _depth: fidl::encoding::Depth,
3228 ) -> fidl::Result<()> {
3229 encoder.debug_check_bounds::<Self>(offset);
3230 encoder.write_num(self.into_primitive(), offset);
3231 Ok(())
3232 }
3233 }
3234
3235 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SuspendError {
3236 #[inline(always)]
3237 fn new_empty() -> Self {
3238 Self::NoUpdateInProgress
3239 }
3240
3241 #[inline]
3242 unsafe fn decode(
3243 &mut self,
3244 decoder: &mut fidl::encoding::Decoder<'_, D>,
3245 offset: usize,
3246 _depth: fidl::encoding::Depth,
3247 ) -> fidl::Result<()> {
3248 decoder.debug_check_bounds::<Self>(offset);
3249 let prim = decoder.read_num::<u32>(offset);
3250
3251 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3252 Ok(())
3253 }
3254 }
3255 unsafe impl fidl::encoding::TypeMarker for UpdateNotStartedReason {
3256 type Owned = Self;
3257
3258 #[inline(always)]
3259 fn inline_align(_context: fidl::encoding::Context) -> usize {
3260 std::mem::align_of::<u32>()
3261 }
3262
3263 #[inline(always)]
3264 fn inline_size(_context: fidl::encoding::Context) -> usize {
3265 std::mem::size_of::<u32>()
3266 }
3267
3268 #[inline(always)]
3269 fn encode_is_copy() -> bool {
3270 true
3271 }
3272
3273 #[inline(always)]
3274 fn decode_is_copy() -> bool {
3275 false
3276 }
3277 }
3278
3279 impl fidl::encoding::ValueTypeMarker for UpdateNotStartedReason {
3280 type Borrowed<'a> = Self;
3281 #[inline(always)]
3282 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3283 *value
3284 }
3285 }
3286
3287 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3288 for UpdateNotStartedReason
3289 {
3290 #[inline]
3291 unsafe fn encode(
3292 self,
3293 encoder: &mut fidl::encoding::Encoder<'_, D>,
3294 offset: usize,
3295 _depth: fidl::encoding::Depth,
3296 ) -> fidl::Result<()> {
3297 encoder.debug_check_bounds::<Self>(offset);
3298 encoder.write_num(self.into_primitive(), offset);
3299 Ok(())
3300 }
3301 }
3302
3303 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3304 for UpdateNotStartedReason
3305 {
3306 #[inline(always)]
3307 fn new_empty() -> Self {
3308 Self::AlreadyInProgress
3309 }
3310
3311 #[inline]
3312 unsafe fn decode(
3313 &mut self,
3314 decoder: &mut fidl::encoding::Decoder<'_, D>,
3315 offset: usize,
3316 _depth: fidl::encoding::Depth,
3317 ) -> fidl::Result<()> {
3318 decoder.debug_check_bounds::<Self>(offset);
3319 let prim = decoder.read_num::<u32>(offset);
3320
3321 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3322 Ok(())
3323 }
3324 }
3325
3326 impl fidl::encoding::ValueTypeMarker for InstallerCancelUpdateRequest {
3327 type Borrowed<'a> = &'a Self;
3328 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3329 value
3330 }
3331 }
3332
3333 unsafe impl fidl::encoding::TypeMarker for InstallerCancelUpdateRequest {
3334 type Owned = Self;
3335
3336 #[inline(always)]
3337 fn inline_align(_context: fidl::encoding::Context) -> usize {
3338 8
3339 }
3340
3341 #[inline(always)]
3342 fn inline_size(_context: fidl::encoding::Context) -> usize {
3343 16
3344 }
3345 }
3346
3347 unsafe impl<D: fidl::encoding::ResourceDialect>
3348 fidl::encoding::Encode<InstallerCancelUpdateRequest, D> for &InstallerCancelUpdateRequest
3349 {
3350 #[inline]
3351 unsafe fn encode(
3352 self,
3353 encoder: &mut fidl::encoding::Encoder<'_, D>,
3354 offset: usize,
3355 _depth: fidl::encoding::Depth,
3356 ) -> fidl::Result<()> {
3357 encoder.debug_check_bounds::<InstallerCancelUpdateRequest>(offset);
3358 fidl::encoding::Encode::<InstallerCancelUpdateRequest, D>::encode(
3360 (
3361 <fidl::encoding::Optional<fidl::encoding::BoundedString<36>> as fidl::encoding::ValueTypeMarker>::borrow(&self.attempt_id),
3362 ),
3363 encoder, offset, _depth
3364 )
3365 }
3366 }
3367 unsafe impl<
3368 D: fidl::encoding::ResourceDialect,
3369 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<36>>, D>,
3370 > fidl::encoding::Encode<InstallerCancelUpdateRequest, D> for (T0,)
3371 {
3372 #[inline]
3373 unsafe fn encode(
3374 self,
3375 encoder: &mut fidl::encoding::Encoder<'_, D>,
3376 offset: usize,
3377 depth: fidl::encoding::Depth,
3378 ) -> fidl::Result<()> {
3379 encoder.debug_check_bounds::<InstallerCancelUpdateRequest>(offset);
3380 self.0.encode(encoder, offset + 0, depth)?;
3384 Ok(())
3385 }
3386 }
3387
3388 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3389 for InstallerCancelUpdateRequest
3390 {
3391 #[inline(always)]
3392 fn new_empty() -> Self {
3393 Self {
3394 attempt_id: fidl::new_empty!(
3395 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
3396 D
3397 ),
3398 }
3399 }
3400
3401 #[inline]
3402 unsafe fn decode(
3403 &mut self,
3404 decoder: &mut fidl::encoding::Decoder<'_, D>,
3405 offset: usize,
3406 _depth: fidl::encoding::Depth,
3407 ) -> fidl::Result<()> {
3408 decoder.debug_check_bounds::<Self>(offset);
3409 fidl::decode!(
3411 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
3412 D,
3413 &mut self.attempt_id,
3414 decoder,
3415 offset + 0,
3416 _depth
3417 )?;
3418 Ok(())
3419 }
3420 }
3421
3422 impl fidl::encoding::ResourceTypeMarker for InstallerMonitorUpdateRequest {
3423 type Borrowed<'a> = &'a mut Self;
3424 fn take_or_borrow<'a>(
3425 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3426 ) -> Self::Borrowed<'a> {
3427 value
3428 }
3429 }
3430
3431 unsafe impl fidl::encoding::TypeMarker for InstallerMonitorUpdateRequest {
3432 type Owned = Self;
3433
3434 #[inline(always)]
3435 fn inline_align(_context: fidl::encoding::Context) -> usize {
3436 8
3437 }
3438
3439 #[inline(always)]
3440 fn inline_size(_context: fidl::encoding::Context) -> usize {
3441 24
3442 }
3443 }
3444
3445 unsafe impl
3446 fidl::encoding::Encode<
3447 InstallerMonitorUpdateRequest,
3448 fidl::encoding::DefaultFuchsiaResourceDialect,
3449 > for &mut InstallerMonitorUpdateRequest
3450 {
3451 #[inline]
3452 unsafe fn encode(
3453 self,
3454 encoder: &mut fidl::encoding::Encoder<
3455 '_,
3456 fidl::encoding::DefaultFuchsiaResourceDialect,
3457 >,
3458 offset: usize,
3459 _depth: fidl::encoding::Depth,
3460 ) -> fidl::Result<()> {
3461 encoder.debug_check_bounds::<InstallerMonitorUpdateRequest>(offset);
3462 fidl::encoding::Encode::<InstallerMonitorUpdateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3464 (
3465 <fidl::encoding::Optional<fidl::encoding::BoundedString<36>> as fidl::encoding::ValueTypeMarker>::borrow(&self.attempt_id),
3466 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.monitor),
3467 ),
3468 encoder, offset, _depth
3469 )
3470 }
3471 }
3472 unsafe impl<
3473 T0: fidl::encoding::Encode<
3474 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
3475 fidl::encoding::DefaultFuchsiaResourceDialect,
3476 >,
3477 T1: fidl::encoding::Encode<
3478 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
3479 fidl::encoding::DefaultFuchsiaResourceDialect,
3480 >,
3481 >
3482 fidl::encoding::Encode<
3483 InstallerMonitorUpdateRequest,
3484 fidl::encoding::DefaultFuchsiaResourceDialect,
3485 > for (T0, T1)
3486 {
3487 #[inline]
3488 unsafe fn encode(
3489 self,
3490 encoder: &mut fidl::encoding::Encoder<
3491 '_,
3492 fidl::encoding::DefaultFuchsiaResourceDialect,
3493 >,
3494 offset: usize,
3495 depth: fidl::encoding::Depth,
3496 ) -> fidl::Result<()> {
3497 encoder.debug_check_bounds::<InstallerMonitorUpdateRequest>(offset);
3498 unsafe {
3501 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3502 (ptr as *mut u64).write_unaligned(0);
3503 }
3504 self.0.encode(encoder, offset + 0, depth)?;
3506 self.1.encode(encoder, offset + 16, depth)?;
3507 Ok(())
3508 }
3509 }
3510
3511 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3512 for InstallerMonitorUpdateRequest
3513 {
3514 #[inline(always)]
3515 fn new_empty() -> Self {
3516 Self {
3517 attempt_id: fidl::new_empty!(
3518 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
3519 fidl::encoding::DefaultFuchsiaResourceDialect
3520 ),
3521 monitor: fidl::new_empty!(
3522 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
3523 fidl::encoding::DefaultFuchsiaResourceDialect
3524 ),
3525 }
3526 }
3527
3528 #[inline]
3529 unsafe fn decode(
3530 &mut self,
3531 decoder: &mut fidl::encoding::Decoder<
3532 '_,
3533 fidl::encoding::DefaultFuchsiaResourceDialect,
3534 >,
3535 offset: usize,
3536 _depth: fidl::encoding::Depth,
3537 ) -> fidl::Result<()> {
3538 decoder.debug_check_bounds::<Self>(offset);
3539 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3541 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3542 let mask = 0xffffffff00000000u64;
3543 let maskedval = padval & mask;
3544 if maskedval != 0 {
3545 return Err(fidl::Error::NonZeroPadding {
3546 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3547 });
3548 }
3549 fidl::decode!(
3550 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
3551 fidl::encoding::DefaultFuchsiaResourceDialect,
3552 &mut self.attempt_id,
3553 decoder,
3554 offset + 0,
3555 _depth
3556 )?;
3557 fidl::decode!(
3558 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
3559 fidl::encoding::DefaultFuchsiaResourceDialect,
3560 &mut self.monitor,
3561 decoder,
3562 offset + 16,
3563 _depth
3564 )?;
3565 Ok(())
3566 }
3567 }
3568
3569 impl fidl::encoding::ValueTypeMarker for InstallerMonitorUpdateResponse {
3570 type Borrowed<'a> = &'a Self;
3571 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3572 value
3573 }
3574 }
3575
3576 unsafe impl fidl::encoding::TypeMarker for InstallerMonitorUpdateResponse {
3577 type Owned = Self;
3578
3579 #[inline(always)]
3580 fn inline_align(_context: fidl::encoding::Context) -> usize {
3581 1
3582 }
3583
3584 #[inline(always)]
3585 fn inline_size(_context: fidl::encoding::Context) -> usize {
3586 1
3587 }
3588 }
3589
3590 unsafe impl<D: fidl::encoding::ResourceDialect>
3591 fidl::encoding::Encode<InstallerMonitorUpdateResponse, D>
3592 for &InstallerMonitorUpdateResponse
3593 {
3594 #[inline]
3595 unsafe fn encode(
3596 self,
3597 encoder: &mut fidl::encoding::Encoder<'_, D>,
3598 offset: usize,
3599 _depth: fidl::encoding::Depth,
3600 ) -> fidl::Result<()> {
3601 encoder.debug_check_bounds::<InstallerMonitorUpdateResponse>(offset);
3602 fidl::encoding::Encode::<InstallerMonitorUpdateResponse, D>::encode(
3604 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.attached),),
3605 encoder,
3606 offset,
3607 _depth,
3608 )
3609 }
3610 }
3611 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3612 fidl::encoding::Encode<InstallerMonitorUpdateResponse, D> for (T0,)
3613 {
3614 #[inline]
3615 unsafe fn encode(
3616 self,
3617 encoder: &mut fidl::encoding::Encoder<'_, D>,
3618 offset: usize,
3619 depth: fidl::encoding::Depth,
3620 ) -> fidl::Result<()> {
3621 encoder.debug_check_bounds::<InstallerMonitorUpdateResponse>(offset);
3622 self.0.encode(encoder, offset + 0, depth)?;
3626 Ok(())
3627 }
3628 }
3629
3630 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3631 for InstallerMonitorUpdateResponse
3632 {
3633 #[inline(always)]
3634 fn new_empty() -> Self {
3635 Self { attached: fidl::new_empty!(bool, D) }
3636 }
3637
3638 #[inline]
3639 unsafe fn decode(
3640 &mut self,
3641 decoder: &mut fidl::encoding::Decoder<'_, D>,
3642 offset: usize,
3643 _depth: fidl::encoding::Depth,
3644 ) -> fidl::Result<()> {
3645 decoder.debug_check_bounds::<Self>(offset);
3646 fidl::decode!(bool, D, &mut self.attached, decoder, offset + 0, _depth)?;
3648 Ok(())
3649 }
3650 }
3651
3652 impl fidl::encoding::ValueTypeMarker for InstallerResumeUpdateRequest {
3653 type Borrowed<'a> = &'a Self;
3654 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3655 value
3656 }
3657 }
3658
3659 unsafe impl fidl::encoding::TypeMarker for InstallerResumeUpdateRequest {
3660 type Owned = Self;
3661
3662 #[inline(always)]
3663 fn inline_align(_context: fidl::encoding::Context) -> usize {
3664 8
3665 }
3666
3667 #[inline(always)]
3668 fn inline_size(_context: fidl::encoding::Context) -> usize {
3669 16
3670 }
3671 }
3672
3673 unsafe impl<D: fidl::encoding::ResourceDialect>
3674 fidl::encoding::Encode<InstallerResumeUpdateRequest, D> for &InstallerResumeUpdateRequest
3675 {
3676 #[inline]
3677 unsafe fn encode(
3678 self,
3679 encoder: &mut fidl::encoding::Encoder<'_, D>,
3680 offset: usize,
3681 _depth: fidl::encoding::Depth,
3682 ) -> fidl::Result<()> {
3683 encoder.debug_check_bounds::<InstallerResumeUpdateRequest>(offset);
3684 fidl::encoding::Encode::<InstallerResumeUpdateRequest, D>::encode(
3686 (
3687 <fidl::encoding::Optional<fidl::encoding::BoundedString<36>> as fidl::encoding::ValueTypeMarker>::borrow(&self.attempt_id),
3688 ),
3689 encoder, offset, _depth
3690 )
3691 }
3692 }
3693 unsafe impl<
3694 D: fidl::encoding::ResourceDialect,
3695 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<36>>, D>,
3696 > fidl::encoding::Encode<InstallerResumeUpdateRequest, D> for (T0,)
3697 {
3698 #[inline]
3699 unsafe fn encode(
3700 self,
3701 encoder: &mut fidl::encoding::Encoder<'_, D>,
3702 offset: usize,
3703 depth: fidl::encoding::Depth,
3704 ) -> fidl::Result<()> {
3705 encoder.debug_check_bounds::<InstallerResumeUpdateRequest>(offset);
3706 self.0.encode(encoder, offset + 0, depth)?;
3710 Ok(())
3711 }
3712 }
3713
3714 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3715 for InstallerResumeUpdateRequest
3716 {
3717 #[inline(always)]
3718 fn new_empty() -> Self {
3719 Self {
3720 attempt_id: fidl::new_empty!(
3721 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
3722 D
3723 ),
3724 }
3725 }
3726
3727 #[inline]
3728 unsafe fn decode(
3729 &mut self,
3730 decoder: &mut fidl::encoding::Decoder<'_, D>,
3731 offset: usize,
3732 _depth: fidl::encoding::Depth,
3733 ) -> fidl::Result<()> {
3734 decoder.debug_check_bounds::<Self>(offset);
3735 fidl::decode!(
3737 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
3738 D,
3739 &mut self.attempt_id,
3740 decoder,
3741 offset + 0,
3742 _depth
3743 )?;
3744 Ok(())
3745 }
3746 }
3747
3748 impl fidl::encoding::ResourceTypeMarker for InstallerStartUpdateRequest {
3749 type Borrowed<'a> = &'a mut Self;
3750 fn take_or_borrow<'a>(
3751 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3752 ) -> Self::Borrowed<'a> {
3753 value
3754 }
3755 }
3756
3757 unsafe impl fidl::encoding::TypeMarker for InstallerStartUpdateRequest {
3758 type Owned = Self;
3759
3760 #[inline(always)]
3761 fn inline_align(_context: fidl::encoding::Context) -> usize {
3762 8
3763 }
3764
3765 #[inline(always)]
3766 fn inline_size(_context: fidl::encoding::Context) -> usize {
3767 40
3768 }
3769 }
3770
3771 unsafe impl
3772 fidl::encoding::Encode<
3773 InstallerStartUpdateRequest,
3774 fidl::encoding::DefaultFuchsiaResourceDialect,
3775 > for &mut InstallerStartUpdateRequest
3776 {
3777 #[inline]
3778 unsafe fn encode(
3779 self,
3780 encoder: &mut fidl::encoding::Encoder<
3781 '_,
3782 fidl::encoding::DefaultFuchsiaResourceDialect,
3783 >,
3784 offset: usize,
3785 _depth: fidl::encoding::Depth,
3786 ) -> fidl::Result<()> {
3787 encoder.debug_check_bounds::<InstallerStartUpdateRequest>(offset);
3788 fidl::encoding::Encode::<InstallerStartUpdateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3790 (
3791 <fidl_fuchsia_pkg::PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
3792 <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
3793 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.monitor),
3794 <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RebootControllerMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.reboot_controller),
3795 ),
3796 encoder, offset, _depth
3797 )
3798 }
3799 }
3800 unsafe impl<
3801 T0: fidl::encoding::Encode<
3802 fidl_fuchsia_pkg::PackageUrl,
3803 fidl::encoding::DefaultFuchsiaResourceDialect,
3804 >,
3805 T1: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
3806 T2: fidl::encoding::Encode<
3807 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
3808 fidl::encoding::DefaultFuchsiaResourceDialect,
3809 >,
3810 T3: fidl::encoding::Encode<
3811 fidl::encoding::Optional<
3812 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
3813 >,
3814 fidl::encoding::DefaultFuchsiaResourceDialect,
3815 >,
3816 >
3817 fidl::encoding::Encode<
3818 InstallerStartUpdateRequest,
3819 fidl::encoding::DefaultFuchsiaResourceDialect,
3820 > for (T0, T1, T2, T3)
3821 {
3822 #[inline]
3823 unsafe fn encode(
3824 self,
3825 encoder: &mut fidl::encoding::Encoder<
3826 '_,
3827 fidl::encoding::DefaultFuchsiaResourceDialect,
3828 >,
3829 offset: usize,
3830 depth: fidl::encoding::Depth,
3831 ) -> fidl::Result<()> {
3832 encoder.debug_check_bounds::<InstallerStartUpdateRequest>(offset);
3833 self.0.encode(encoder, offset + 0, depth)?;
3837 self.1.encode(encoder, offset + 16, depth)?;
3838 self.2.encode(encoder, offset + 32, depth)?;
3839 self.3.encode(encoder, offset + 36, depth)?;
3840 Ok(())
3841 }
3842 }
3843
3844 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3845 for InstallerStartUpdateRequest
3846 {
3847 #[inline(always)]
3848 fn new_empty() -> Self {
3849 Self {
3850 url: fidl::new_empty!(
3851 fidl_fuchsia_pkg::PackageUrl,
3852 fidl::encoding::DefaultFuchsiaResourceDialect
3853 ),
3854 options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
3855 monitor: fidl::new_empty!(
3856 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
3857 fidl::encoding::DefaultFuchsiaResourceDialect
3858 ),
3859 reboot_controller: fidl::new_empty!(
3860 fidl::encoding::Optional<
3861 fidl::encoding::Endpoint<
3862 fidl::endpoints::ServerEnd<RebootControllerMarker>,
3863 >,
3864 >,
3865 fidl::encoding::DefaultFuchsiaResourceDialect
3866 ),
3867 }
3868 }
3869
3870 #[inline]
3871 unsafe fn decode(
3872 &mut self,
3873 decoder: &mut fidl::encoding::Decoder<
3874 '_,
3875 fidl::encoding::DefaultFuchsiaResourceDialect,
3876 >,
3877 offset: usize,
3878 _depth: fidl::encoding::Depth,
3879 ) -> fidl::Result<()> {
3880 decoder.debug_check_bounds::<Self>(offset);
3881 fidl::decode!(
3883 fidl_fuchsia_pkg::PackageUrl,
3884 fidl::encoding::DefaultFuchsiaResourceDialect,
3885 &mut self.url,
3886 decoder,
3887 offset + 0,
3888 _depth
3889 )?;
3890 fidl::decode!(
3891 Options,
3892 fidl::encoding::DefaultFuchsiaResourceDialect,
3893 &mut self.options,
3894 decoder,
3895 offset + 16,
3896 _depth
3897 )?;
3898 fidl::decode!(
3899 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<MonitorMarker>>,
3900 fidl::encoding::DefaultFuchsiaResourceDialect,
3901 &mut self.monitor,
3902 decoder,
3903 offset + 32,
3904 _depth
3905 )?;
3906 fidl::decode!(
3907 fidl::encoding::Optional<
3908 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RebootControllerMarker>>,
3909 >,
3910 fidl::encoding::DefaultFuchsiaResourceDialect,
3911 &mut self.reboot_controller,
3912 decoder,
3913 offset + 36,
3914 _depth
3915 )?;
3916 Ok(())
3917 }
3918 }
3919
3920 impl fidl::encoding::ValueTypeMarker for InstallerSuspendUpdateRequest {
3921 type Borrowed<'a> = &'a Self;
3922 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3923 value
3924 }
3925 }
3926
3927 unsafe impl fidl::encoding::TypeMarker for InstallerSuspendUpdateRequest {
3928 type Owned = Self;
3929
3930 #[inline(always)]
3931 fn inline_align(_context: fidl::encoding::Context) -> usize {
3932 8
3933 }
3934
3935 #[inline(always)]
3936 fn inline_size(_context: fidl::encoding::Context) -> usize {
3937 16
3938 }
3939 }
3940
3941 unsafe impl<D: fidl::encoding::ResourceDialect>
3942 fidl::encoding::Encode<InstallerSuspendUpdateRequest, D>
3943 for &InstallerSuspendUpdateRequest
3944 {
3945 #[inline]
3946 unsafe fn encode(
3947 self,
3948 encoder: &mut fidl::encoding::Encoder<'_, D>,
3949 offset: usize,
3950 _depth: fidl::encoding::Depth,
3951 ) -> fidl::Result<()> {
3952 encoder.debug_check_bounds::<InstallerSuspendUpdateRequest>(offset);
3953 fidl::encoding::Encode::<InstallerSuspendUpdateRequest, D>::encode(
3955 (
3956 <fidl::encoding::Optional<fidl::encoding::BoundedString<36>> as fidl::encoding::ValueTypeMarker>::borrow(&self.attempt_id),
3957 ),
3958 encoder, offset, _depth
3959 )
3960 }
3961 }
3962 unsafe impl<
3963 D: fidl::encoding::ResourceDialect,
3964 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<36>>, D>,
3965 > fidl::encoding::Encode<InstallerSuspendUpdateRequest, D> for (T0,)
3966 {
3967 #[inline]
3968 unsafe fn encode(
3969 self,
3970 encoder: &mut fidl::encoding::Encoder<'_, D>,
3971 offset: usize,
3972 depth: fidl::encoding::Depth,
3973 ) -> fidl::Result<()> {
3974 encoder.debug_check_bounds::<InstallerSuspendUpdateRequest>(offset);
3975 self.0.encode(encoder, offset + 0, depth)?;
3979 Ok(())
3980 }
3981 }
3982
3983 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3984 for InstallerSuspendUpdateRequest
3985 {
3986 #[inline(always)]
3987 fn new_empty() -> Self {
3988 Self {
3989 attempt_id: fidl::new_empty!(
3990 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
3991 D
3992 ),
3993 }
3994 }
3995
3996 #[inline]
3997 unsafe fn decode(
3998 &mut self,
3999 decoder: &mut fidl::encoding::Decoder<'_, D>,
4000 offset: usize,
4001 _depth: fidl::encoding::Depth,
4002 ) -> fidl::Result<()> {
4003 decoder.debug_check_bounds::<Self>(offset);
4004 fidl::decode!(
4006 fidl::encoding::Optional<fidl::encoding::BoundedString<36>>,
4007 D,
4008 &mut self.attempt_id,
4009 decoder,
4010 offset + 0,
4011 _depth
4012 )?;
4013 Ok(())
4014 }
4015 }
4016
4017 impl fidl::encoding::ValueTypeMarker for InstallerStartUpdateResponse {
4018 type Borrowed<'a> = &'a Self;
4019 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4020 value
4021 }
4022 }
4023
4024 unsafe impl fidl::encoding::TypeMarker for InstallerStartUpdateResponse {
4025 type Owned = Self;
4026
4027 #[inline(always)]
4028 fn inline_align(_context: fidl::encoding::Context) -> usize {
4029 8
4030 }
4031
4032 #[inline(always)]
4033 fn inline_size(_context: fidl::encoding::Context) -> usize {
4034 16
4035 }
4036 }
4037
4038 unsafe impl<D: fidl::encoding::ResourceDialect>
4039 fidl::encoding::Encode<InstallerStartUpdateResponse, D> for &InstallerStartUpdateResponse
4040 {
4041 #[inline]
4042 unsafe fn encode(
4043 self,
4044 encoder: &mut fidl::encoding::Encoder<'_, D>,
4045 offset: usize,
4046 _depth: fidl::encoding::Depth,
4047 ) -> fidl::Result<()> {
4048 encoder.debug_check_bounds::<InstallerStartUpdateResponse>(offset);
4049 fidl::encoding::Encode::<InstallerStartUpdateResponse, D>::encode(
4051 (<fidl::encoding::BoundedString<36> as fidl::encoding::ValueTypeMarker>::borrow(
4052 &self.attempt_id,
4053 ),),
4054 encoder,
4055 offset,
4056 _depth,
4057 )
4058 }
4059 }
4060 unsafe impl<
4061 D: fidl::encoding::ResourceDialect,
4062 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<36>, D>,
4063 > fidl::encoding::Encode<InstallerStartUpdateResponse, D> for (T0,)
4064 {
4065 #[inline]
4066 unsafe fn encode(
4067 self,
4068 encoder: &mut fidl::encoding::Encoder<'_, D>,
4069 offset: usize,
4070 depth: fidl::encoding::Depth,
4071 ) -> fidl::Result<()> {
4072 encoder.debug_check_bounds::<InstallerStartUpdateResponse>(offset);
4073 self.0.encode(encoder, offset + 0, depth)?;
4077 Ok(())
4078 }
4079 }
4080
4081 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4082 for InstallerStartUpdateResponse
4083 {
4084 #[inline(always)]
4085 fn new_empty() -> Self {
4086 Self { attempt_id: fidl::new_empty!(fidl::encoding::BoundedString<36>, D) }
4087 }
4088
4089 #[inline]
4090 unsafe fn decode(
4091 &mut self,
4092 decoder: &mut fidl::encoding::Decoder<'_, D>,
4093 offset: usize,
4094 _depth: fidl::encoding::Depth,
4095 ) -> fidl::Result<()> {
4096 decoder.debug_check_bounds::<Self>(offset);
4097 fidl::decode!(
4099 fidl::encoding::BoundedString<36>,
4100 D,
4101 &mut self.attempt_id,
4102 decoder,
4103 offset + 0,
4104 _depth
4105 )?;
4106 Ok(())
4107 }
4108 }
4109
4110 impl fidl::encoding::ValueTypeMarker for MonitorOnStateRequest {
4111 type Borrowed<'a> = &'a Self;
4112 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4113 value
4114 }
4115 }
4116
4117 unsafe impl fidl::encoding::TypeMarker for MonitorOnStateRequest {
4118 type Owned = Self;
4119
4120 #[inline(always)]
4121 fn inline_align(_context: fidl::encoding::Context) -> usize {
4122 8
4123 }
4124
4125 #[inline(always)]
4126 fn inline_size(_context: fidl::encoding::Context) -> usize {
4127 16
4128 }
4129 }
4130
4131 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MonitorOnStateRequest, D>
4132 for &MonitorOnStateRequest
4133 {
4134 #[inline]
4135 unsafe fn encode(
4136 self,
4137 encoder: &mut fidl::encoding::Encoder<'_, D>,
4138 offset: usize,
4139 _depth: fidl::encoding::Depth,
4140 ) -> fidl::Result<()> {
4141 encoder.debug_check_bounds::<MonitorOnStateRequest>(offset);
4142 fidl::encoding::Encode::<MonitorOnStateRequest, D>::encode(
4144 (<State as fidl::encoding::ValueTypeMarker>::borrow(&self.state),),
4145 encoder,
4146 offset,
4147 _depth,
4148 )
4149 }
4150 }
4151 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<State, D>>
4152 fidl::encoding::Encode<MonitorOnStateRequest, D> for (T0,)
4153 {
4154 #[inline]
4155 unsafe fn encode(
4156 self,
4157 encoder: &mut fidl::encoding::Encoder<'_, D>,
4158 offset: usize,
4159 depth: fidl::encoding::Depth,
4160 ) -> fidl::Result<()> {
4161 encoder.debug_check_bounds::<MonitorOnStateRequest>(offset);
4162 self.0.encode(encoder, offset + 0, depth)?;
4166 Ok(())
4167 }
4168 }
4169
4170 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MonitorOnStateRequest {
4171 #[inline(always)]
4172 fn new_empty() -> Self {
4173 Self { state: fidl::new_empty!(State, D) }
4174 }
4175
4176 #[inline]
4177 unsafe fn decode(
4178 &mut self,
4179 decoder: &mut fidl::encoding::Decoder<'_, D>,
4180 offset: usize,
4181 _depth: fidl::encoding::Depth,
4182 ) -> fidl::Result<()> {
4183 decoder.debug_check_bounds::<Self>(offset);
4184 fidl::decode!(State, D, &mut self.state, decoder, offset + 0, _depth)?;
4186 Ok(())
4187 }
4188 }
4189
4190 impl CanceledData {
4191 #[inline(always)]
4192 fn max_ordinal_present(&self) -> u64 {
4193 0
4194 }
4195 }
4196
4197 impl fidl::encoding::ValueTypeMarker for CanceledData {
4198 type Borrowed<'a> = &'a Self;
4199 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4200 value
4201 }
4202 }
4203
4204 unsafe impl fidl::encoding::TypeMarker for CanceledData {
4205 type Owned = Self;
4206
4207 #[inline(always)]
4208 fn inline_align(_context: fidl::encoding::Context) -> usize {
4209 8
4210 }
4211
4212 #[inline(always)]
4213 fn inline_size(_context: fidl::encoding::Context) -> usize {
4214 16
4215 }
4216 }
4217
4218 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CanceledData, D>
4219 for &CanceledData
4220 {
4221 unsafe fn encode(
4222 self,
4223 encoder: &mut fidl::encoding::Encoder<'_, D>,
4224 offset: usize,
4225 mut depth: fidl::encoding::Depth,
4226 ) -> fidl::Result<()> {
4227 encoder.debug_check_bounds::<CanceledData>(offset);
4228 let max_ordinal: u64 = self.max_ordinal_present();
4230 encoder.write_num(max_ordinal, offset);
4231 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4232 if max_ordinal == 0 {
4234 return Ok(());
4235 }
4236 depth.increment()?;
4237 let envelope_size = 8;
4238 let bytes_len = max_ordinal as usize * envelope_size;
4239 #[allow(unused_variables)]
4240 let offset = encoder.out_of_line_offset(bytes_len);
4241 let mut _prev_end_offset: usize = 0;
4242
4243 Ok(())
4244 }
4245 }
4246
4247 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CanceledData {
4248 #[inline(always)]
4249 fn new_empty() -> Self {
4250 Self::default()
4251 }
4252
4253 unsafe fn decode(
4254 &mut self,
4255 decoder: &mut fidl::encoding::Decoder<'_, D>,
4256 offset: usize,
4257 mut depth: fidl::encoding::Depth,
4258 ) -> fidl::Result<()> {
4259 decoder.debug_check_bounds::<Self>(offset);
4260 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4261 None => return Err(fidl::Error::NotNullable),
4262 Some(len) => len,
4263 };
4264 if len == 0 {
4266 return Ok(());
4267 };
4268 depth.increment()?;
4269 let envelope_size = 8;
4270 let bytes_len = len * envelope_size;
4271 let offset = decoder.out_of_line_offset(bytes_len)?;
4272 let mut _next_ordinal_to_read = 0;
4274 let mut next_offset = offset;
4275 let end_offset = offset + bytes_len;
4276
4277 while next_offset < end_offset {
4279 _next_ordinal_to_read += 1;
4280 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4281 next_offset += envelope_size;
4282 }
4283
4284 Ok(())
4285 }
4286 }
4287
4288 impl CommitData {
4289 #[inline(always)]
4290 fn max_ordinal_present(&self) -> u64 {
4291 if let Some(_) = self.progress {
4292 return 2;
4293 }
4294 if let Some(_) = self.info {
4295 return 1;
4296 }
4297 0
4298 }
4299 }
4300
4301 impl fidl::encoding::ValueTypeMarker for CommitData {
4302 type Borrowed<'a> = &'a Self;
4303 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4304 value
4305 }
4306 }
4307
4308 unsafe impl fidl::encoding::TypeMarker for CommitData {
4309 type Owned = Self;
4310
4311 #[inline(always)]
4312 fn inline_align(_context: fidl::encoding::Context) -> usize {
4313 8
4314 }
4315
4316 #[inline(always)]
4317 fn inline_size(_context: fidl::encoding::Context) -> usize {
4318 16
4319 }
4320 }
4321
4322 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CommitData, D>
4323 for &CommitData
4324 {
4325 unsafe fn encode(
4326 self,
4327 encoder: &mut fidl::encoding::Encoder<'_, D>,
4328 offset: usize,
4329 mut depth: fidl::encoding::Depth,
4330 ) -> fidl::Result<()> {
4331 encoder.debug_check_bounds::<CommitData>(offset);
4332 let max_ordinal: u64 = self.max_ordinal_present();
4334 encoder.write_num(max_ordinal, offset);
4335 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4336 if max_ordinal == 0 {
4338 return Ok(());
4339 }
4340 depth.increment()?;
4341 let envelope_size = 8;
4342 let bytes_len = max_ordinal as usize * envelope_size;
4343 #[allow(unused_variables)]
4344 let offset = encoder.out_of_line_offset(bytes_len);
4345 let mut _prev_end_offset: usize = 0;
4346 if 1 > max_ordinal {
4347 return Ok(());
4348 }
4349
4350 let cur_offset: usize = (1 - 1) * envelope_size;
4353
4354 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4356
4357 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
4362 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
4363 encoder,
4364 offset + cur_offset,
4365 depth,
4366 )?;
4367
4368 _prev_end_offset = cur_offset + envelope_size;
4369 if 2 > max_ordinal {
4370 return Ok(());
4371 }
4372
4373 let cur_offset: usize = (2 - 1) * envelope_size;
4376
4377 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4379
4380 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
4385 self.progress
4386 .as_ref()
4387 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
4388 encoder,
4389 offset + cur_offset,
4390 depth,
4391 )?;
4392
4393 _prev_end_offset = cur_offset + envelope_size;
4394
4395 Ok(())
4396 }
4397 }
4398
4399 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CommitData {
4400 #[inline(always)]
4401 fn new_empty() -> Self {
4402 Self::default()
4403 }
4404
4405 unsafe fn decode(
4406 &mut self,
4407 decoder: &mut fidl::encoding::Decoder<'_, D>,
4408 offset: usize,
4409 mut depth: fidl::encoding::Depth,
4410 ) -> fidl::Result<()> {
4411 decoder.debug_check_bounds::<Self>(offset);
4412 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4413 None => return Err(fidl::Error::NotNullable),
4414 Some(len) => len,
4415 };
4416 if len == 0 {
4418 return Ok(());
4419 };
4420 depth.increment()?;
4421 let envelope_size = 8;
4422 let bytes_len = len * envelope_size;
4423 let offset = decoder.out_of_line_offset(bytes_len)?;
4424 let mut _next_ordinal_to_read = 0;
4426 let mut next_offset = offset;
4427 let end_offset = offset + bytes_len;
4428 _next_ordinal_to_read += 1;
4429 if next_offset >= end_offset {
4430 return Ok(());
4431 }
4432
4433 while _next_ordinal_to_read < 1 {
4435 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4436 _next_ordinal_to_read += 1;
4437 next_offset += envelope_size;
4438 }
4439
4440 let next_out_of_line = decoder.next_out_of_line();
4441 let handles_before = decoder.remaining_handles();
4442 if let Some((inlined, num_bytes, num_handles)) =
4443 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4444 {
4445 let member_inline_size =
4446 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4447 if inlined != (member_inline_size <= 4) {
4448 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4449 }
4450 let inner_offset;
4451 let mut inner_depth = depth.clone();
4452 if inlined {
4453 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4454 inner_offset = next_offset;
4455 } else {
4456 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4457 inner_depth.increment()?;
4458 }
4459 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
4460 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
4461 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4462 {
4463 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4464 }
4465 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4466 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4467 }
4468 }
4469
4470 next_offset += envelope_size;
4471 _next_ordinal_to_read += 1;
4472 if next_offset >= end_offset {
4473 return Ok(());
4474 }
4475
4476 while _next_ordinal_to_read < 2 {
4478 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4479 _next_ordinal_to_read += 1;
4480 next_offset += envelope_size;
4481 }
4482
4483 let next_out_of_line = decoder.next_out_of_line();
4484 let handles_before = decoder.remaining_handles();
4485 if let Some((inlined, num_bytes, num_handles)) =
4486 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4487 {
4488 let member_inline_size =
4489 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
4490 decoder.context,
4491 );
4492 if inlined != (member_inline_size <= 4) {
4493 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4494 }
4495 let inner_offset;
4496 let mut inner_depth = depth.clone();
4497 if inlined {
4498 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4499 inner_offset = next_offset;
4500 } else {
4501 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4502 inner_depth.increment()?;
4503 }
4504 let val_ref =
4505 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
4506 fidl::decode!(
4507 InstallationProgress,
4508 D,
4509 val_ref,
4510 decoder,
4511 inner_offset,
4512 inner_depth
4513 )?;
4514 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4515 {
4516 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4517 }
4518 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4519 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4520 }
4521 }
4522
4523 next_offset += envelope_size;
4524
4525 while next_offset < end_offset {
4527 _next_ordinal_to_read += 1;
4528 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4529 next_offset += envelope_size;
4530 }
4531
4532 Ok(())
4533 }
4534 }
4535
4536 impl CompleteData {
4537 #[inline(always)]
4538 fn max_ordinal_present(&self) -> u64 {
4539 if let Some(_) = self.progress {
4540 return 2;
4541 }
4542 if let Some(_) = self.info {
4543 return 1;
4544 }
4545 0
4546 }
4547 }
4548
4549 impl fidl::encoding::ValueTypeMarker for CompleteData {
4550 type Borrowed<'a> = &'a Self;
4551 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4552 value
4553 }
4554 }
4555
4556 unsafe impl fidl::encoding::TypeMarker for CompleteData {
4557 type Owned = Self;
4558
4559 #[inline(always)]
4560 fn inline_align(_context: fidl::encoding::Context) -> usize {
4561 8
4562 }
4563
4564 #[inline(always)]
4565 fn inline_size(_context: fidl::encoding::Context) -> usize {
4566 16
4567 }
4568 }
4569
4570 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompleteData, D>
4571 for &CompleteData
4572 {
4573 unsafe fn encode(
4574 self,
4575 encoder: &mut fidl::encoding::Encoder<'_, D>,
4576 offset: usize,
4577 mut depth: fidl::encoding::Depth,
4578 ) -> fidl::Result<()> {
4579 encoder.debug_check_bounds::<CompleteData>(offset);
4580 let max_ordinal: u64 = self.max_ordinal_present();
4582 encoder.write_num(max_ordinal, offset);
4583 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4584 if max_ordinal == 0 {
4586 return Ok(());
4587 }
4588 depth.increment()?;
4589 let envelope_size = 8;
4590 let bytes_len = max_ordinal as usize * envelope_size;
4591 #[allow(unused_variables)]
4592 let offset = encoder.out_of_line_offset(bytes_len);
4593 let mut _prev_end_offset: usize = 0;
4594 if 1 > max_ordinal {
4595 return Ok(());
4596 }
4597
4598 let cur_offset: usize = (1 - 1) * envelope_size;
4601
4602 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4604
4605 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
4610 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
4611 encoder,
4612 offset + cur_offset,
4613 depth,
4614 )?;
4615
4616 _prev_end_offset = cur_offset + envelope_size;
4617 if 2 > max_ordinal {
4618 return Ok(());
4619 }
4620
4621 let cur_offset: usize = (2 - 1) * envelope_size;
4624
4625 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4627
4628 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
4633 self.progress
4634 .as_ref()
4635 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
4636 encoder,
4637 offset + cur_offset,
4638 depth,
4639 )?;
4640
4641 _prev_end_offset = cur_offset + envelope_size;
4642
4643 Ok(())
4644 }
4645 }
4646
4647 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompleteData {
4648 #[inline(always)]
4649 fn new_empty() -> Self {
4650 Self::default()
4651 }
4652
4653 unsafe fn decode(
4654 &mut self,
4655 decoder: &mut fidl::encoding::Decoder<'_, D>,
4656 offset: usize,
4657 mut depth: fidl::encoding::Depth,
4658 ) -> fidl::Result<()> {
4659 decoder.debug_check_bounds::<Self>(offset);
4660 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4661 None => return Err(fidl::Error::NotNullable),
4662 Some(len) => len,
4663 };
4664 if len == 0 {
4666 return Ok(());
4667 };
4668 depth.increment()?;
4669 let envelope_size = 8;
4670 let bytes_len = len * envelope_size;
4671 let offset = decoder.out_of_line_offset(bytes_len)?;
4672 let mut _next_ordinal_to_read = 0;
4674 let mut next_offset = offset;
4675 let end_offset = offset + bytes_len;
4676 _next_ordinal_to_read += 1;
4677 if next_offset >= end_offset {
4678 return Ok(());
4679 }
4680
4681 while _next_ordinal_to_read < 1 {
4683 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4684 _next_ordinal_to_read += 1;
4685 next_offset += envelope_size;
4686 }
4687
4688 let next_out_of_line = decoder.next_out_of_line();
4689 let handles_before = decoder.remaining_handles();
4690 if let Some((inlined, num_bytes, num_handles)) =
4691 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4692 {
4693 let member_inline_size =
4694 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4695 if inlined != (member_inline_size <= 4) {
4696 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4697 }
4698 let inner_offset;
4699 let mut inner_depth = depth.clone();
4700 if inlined {
4701 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4702 inner_offset = next_offset;
4703 } else {
4704 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4705 inner_depth.increment()?;
4706 }
4707 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
4708 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
4709 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4710 {
4711 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4712 }
4713 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4714 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4715 }
4716 }
4717
4718 next_offset += envelope_size;
4719 _next_ordinal_to_read += 1;
4720 if next_offset >= end_offset {
4721 return Ok(());
4722 }
4723
4724 while _next_ordinal_to_read < 2 {
4726 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4727 _next_ordinal_to_read += 1;
4728 next_offset += envelope_size;
4729 }
4730
4731 let next_out_of_line = decoder.next_out_of_line();
4732 let handles_before = decoder.remaining_handles();
4733 if let Some((inlined, num_bytes, num_handles)) =
4734 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4735 {
4736 let member_inline_size =
4737 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
4738 decoder.context,
4739 );
4740 if inlined != (member_inline_size <= 4) {
4741 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4742 }
4743 let inner_offset;
4744 let mut inner_depth = depth.clone();
4745 if inlined {
4746 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4747 inner_offset = next_offset;
4748 } else {
4749 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4750 inner_depth.increment()?;
4751 }
4752 let val_ref =
4753 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
4754 fidl::decode!(
4755 InstallationProgress,
4756 D,
4757 val_ref,
4758 decoder,
4759 inner_offset,
4760 inner_depth
4761 )?;
4762 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4763 {
4764 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4765 }
4766 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4767 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4768 }
4769 }
4770
4771 next_offset += envelope_size;
4772
4773 while next_offset < end_offset {
4775 _next_ordinal_to_read += 1;
4776 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4777 next_offset += envelope_size;
4778 }
4779
4780 Ok(())
4781 }
4782 }
4783
4784 impl DeferRebootData {
4785 #[inline(always)]
4786 fn max_ordinal_present(&self) -> u64 {
4787 if let Some(_) = self.progress {
4788 return 2;
4789 }
4790 if let Some(_) = self.info {
4791 return 1;
4792 }
4793 0
4794 }
4795 }
4796
4797 impl fidl::encoding::ValueTypeMarker for DeferRebootData {
4798 type Borrowed<'a> = &'a Self;
4799 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4800 value
4801 }
4802 }
4803
4804 unsafe impl fidl::encoding::TypeMarker for DeferRebootData {
4805 type Owned = Self;
4806
4807 #[inline(always)]
4808 fn inline_align(_context: fidl::encoding::Context) -> usize {
4809 8
4810 }
4811
4812 #[inline(always)]
4813 fn inline_size(_context: fidl::encoding::Context) -> usize {
4814 16
4815 }
4816 }
4817
4818 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeferRebootData, D>
4819 for &DeferRebootData
4820 {
4821 unsafe fn encode(
4822 self,
4823 encoder: &mut fidl::encoding::Encoder<'_, D>,
4824 offset: usize,
4825 mut depth: fidl::encoding::Depth,
4826 ) -> fidl::Result<()> {
4827 encoder.debug_check_bounds::<DeferRebootData>(offset);
4828 let max_ordinal: u64 = self.max_ordinal_present();
4830 encoder.write_num(max_ordinal, offset);
4831 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4832 if max_ordinal == 0 {
4834 return Ok(());
4835 }
4836 depth.increment()?;
4837 let envelope_size = 8;
4838 let bytes_len = max_ordinal as usize * envelope_size;
4839 #[allow(unused_variables)]
4840 let offset = encoder.out_of_line_offset(bytes_len);
4841 let mut _prev_end_offset: usize = 0;
4842 if 1 > max_ordinal {
4843 return Ok(());
4844 }
4845
4846 let cur_offset: usize = (1 - 1) * envelope_size;
4849
4850 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4852
4853 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
4858 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
4859 encoder,
4860 offset + cur_offset,
4861 depth,
4862 )?;
4863
4864 _prev_end_offset = cur_offset + envelope_size;
4865 if 2 > max_ordinal {
4866 return Ok(());
4867 }
4868
4869 let cur_offset: usize = (2 - 1) * envelope_size;
4872
4873 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4875
4876 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
4881 self.progress
4882 .as_ref()
4883 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
4884 encoder,
4885 offset + cur_offset,
4886 depth,
4887 )?;
4888
4889 _prev_end_offset = cur_offset + envelope_size;
4890
4891 Ok(())
4892 }
4893 }
4894
4895 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeferRebootData {
4896 #[inline(always)]
4897 fn new_empty() -> Self {
4898 Self::default()
4899 }
4900
4901 unsafe fn decode(
4902 &mut self,
4903 decoder: &mut fidl::encoding::Decoder<'_, D>,
4904 offset: usize,
4905 mut depth: fidl::encoding::Depth,
4906 ) -> fidl::Result<()> {
4907 decoder.debug_check_bounds::<Self>(offset);
4908 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4909 None => return Err(fidl::Error::NotNullable),
4910 Some(len) => len,
4911 };
4912 if len == 0 {
4914 return Ok(());
4915 };
4916 depth.increment()?;
4917 let envelope_size = 8;
4918 let bytes_len = len * envelope_size;
4919 let offset = decoder.out_of_line_offset(bytes_len)?;
4920 let mut _next_ordinal_to_read = 0;
4922 let mut next_offset = offset;
4923 let end_offset = offset + bytes_len;
4924 _next_ordinal_to_read += 1;
4925 if next_offset >= end_offset {
4926 return Ok(());
4927 }
4928
4929 while _next_ordinal_to_read < 1 {
4931 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4932 _next_ordinal_to_read += 1;
4933 next_offset += envelope_size;
4934 }
4935
4936 let next_out_of_line = decoder.next_out_of_line();
4937 let handles_before = decoder.remaining_handles();
4938 if let Some((inlined, num_bytes, num_handles)) =
4939 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4940 {
4941 let member_inline_size =
4942 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4943 if inlined != (member_inline_size <= 4) {
4944 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4945 }
4946 let inner_offset;
4947 let mut inner_depth = depth.clone();
4948 if inlined {
4949 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4950 inner_offset = next_offset;
4951 } else {
4952 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4953 inner_depth.increment()?;
4954 }
4955 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
4956 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
4957 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4958 {
4959 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4960 }
4961 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4962 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4963 }
4964 }
4965
4966 next_offset += envelope_size;
4967 _next_ordinal_to_read += 1;
4968 if next_offset >= end_offset {
4969 return Ok(());
4970 }
4971
4972 while _next_ordinal_to_read < 2 {
4974 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4975 _next_ordinal_to_read += 1;
4976 next_offset += envelope_size;
4977 }
4978
4979 let next_out_of_line = decoder.next_out_of_line();
4980 let handles_before = decoder.remaining_handles();
4981 if let Some((inlined, num_bytes, num_handles)) =
4982 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4983 {
4984 let member_inline_size =
4985 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
4986 decoder.context,
4987 );
4988 if inlined != (member_inline_size <= 4) {
4989 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4990 }
4991 let inner_offset;
4992 let mut inner_depth = depth.clone();
4993 if inlined {
4994 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4995 inner_offset = next_offset;
4996 } else {
4997 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4998 inner_depth.increment()?;
4999 }
5000 let val_ref =
5001 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
5002 fidl::decode!(
5003 InstallationProgress,
5004 D,
5005 val_ref,
5006 decoder,
5007 inner_offset,
5008 inner_depth
5009 )?;
5010 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5011 {
5012 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5013 }
5014 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5015 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5016 }
5017 }
5018
5019 next_offset += envelope_size;
5020
5021 while next_offset < end_offset {
5023 _next_ordinal_to_read += 1;
5024 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5025 next_offset += envelope_size;
5026 }
5027
5028 Ok(())
5029 }
5030 }
5031
5032 impl FailCommitData {
5033 #[inline(always)]
5034 fn max_ordinal_present(&self) -> u64 {
5035 if let Some(_) = self.progress {
5036 return 2;
5037 }
5038 if let Some(_) = self.info {
5039 return 1;
5040 }
5041 0
5042 }
5043 }
5044
5045 impl fidl::encoding::ValueTypeMarker for FailCommitData {
5046 type Borrowed<'a> = &'a Self;
5047 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5048 value
5049 }
5050 }
5051
5052 unsafe impl fidl::encoding::TypeMarker for FailCommitData {
5053 type Owned = Self;
5054
5055 #[inline(always)]
5056 fn inline_align(_context: fidl::encoding::Context) -> usize {
5057 8
5058 }
5059
5060 #[inline(always)]
5061 fn inline_size(_context: fidl::encoding::Context) -> usize {
5062 16
5063 }
5064 }
5065
5066 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FailCommitData, D>
5067 for &FailCommitData
5068 {
5069 unsafe fn encode(
5070 self,
5071 encoder: &mut fidl::encoding::Encoder<'_, D>,
5072 offset: usize,
5073 mut depth: fidl::encoding::Depth,
5074 ) -> fidl::Result<()> {
5075 encoder.debug_check_bounds::<FailCommitData>(offset);
5076 let max_ordinal: u64 = self.max_ordinal_present();
5078 encoder.write_num(max_ordinal, offset);
5079 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5080 if max_ordinal == 0 {
5082 return Ok(());
5083 }
5084 depth.increment()?;
5085 let envelope_size = 8;
5086 let bytes_len = max_ordinal as usize * envelope_size;
5087 #[allow(unused_variables)]
5088 let offset = encoder.out_of_line_offset(bytes_len);
5089 let mut _prev_end_offset: usize = 0;
5090 if 1 > max_ordinal {
5091 return Ok(());
5092 }
5093
5094 let cur_offset: usize = (1 - 1) * envelope_size;
5097
5098 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5100
5101 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
5106 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
5107 encoder,
5108 offset + cur_offset,
5109 depth,
5110 )?;
5111
5112 _prev_end_offset = cur_offset + envelope_size;
5113 if 2 > max_ordinal {
5114 return Ok(());
5115 }
5116
5117 let cur_offset: usize = (2 - 1) * envelope_size;
5120
5121 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5123
5124 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
5129 self.progress
5130 .as_ref()
5131 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
5132 encoder,
5133 offset + cur_offset,
5134 depth,
5135 )?;
5136
5137 _prev_end_offset = cur_offset + envelope_size;
5138
5139 Ok(())
5140 }
5141 }
5142
5143 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FailCommitData {
5144 #[inline(always)]
5145 fn new_empty() -> Self {
5146 Self::default()
5147 }
5148
5149 unsafe fn decode(
5150 &mut self,
5151 decoder: &mut fidl::encoding::Decoder<'_, D>,
5152 offset: usize,
5153 mut depth: fidl::encoding::Depth,
5154 ) -> fidl::Result<()> {
5155 decoder.debug_check_bounds::<Self>(offset);
5156 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5157 None => return Err(fidl::Error::NotNullable),
5158 Some(len) => len,
5159 };
5160 if len == 0 {
5162 return Ok(());
5163 };
5164 depth.increment()?;
5165 let envelope_size = 8;
5166 let bytes_len = len * envelope_size;
5167 let offset = decoder.out_of_line_offset(bytes_len)?;
5168 let mut _next_ordinal_to_read = 0;
5170 let mut next_offset = offset;
5171 let end_offset = offset + bytes_len;
5172 _next_ordinal_to_read += 1;
5173 if next_offset >= end_offset {
5174 return Ok(());
5175 }
5176
5177 while _next_ordinal_to_read < 1 {
5179 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5180 _next_ordinal_to_read += 1;
5181 next_offset += envelope_size;
5182 }
5183
5184 let next_out_of_line = decoder.next_out_of_line();
5185 let handles_before = decoder.remaining_handles();
5186 if let Some((inlined, num_bytes, num_handles)) =
5187 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5188 {
5189 let member_inline_size =
5190 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5191 if inlined != (member_inline_size <= 4) {
5192 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5193 }
5194 let inner_offset;
5195 let mut inner_depth = depth.clone();
5196 if inlined {
5197 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5198 inner_offset = next_offset;
5199 } else {
5200 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5201 inner_depth.increment()?;
5202 }
5203 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
5204 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5205 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5206 {
5207 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5208 }
5209 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5210 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5211 }
5212 }
5213
5214 next_offset += envelope_size;
5215 _next_ordinal_to_read += 1;
5216 if next_offset >= end_offset {
5217 return Ok(());
5218 }
5219
5220 while _next_ordinal_to_read < 2 {
5222 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5223 _next_ordinal_to_read += 1;
5224 next_offset += envelope_size;
5225 }
5226
5227 let next_out_of_line = decoder.next_out_of_line();
5228 let handles_before = decoder.remaining_handles();
5229 if let Some((inlined, num_bytes, num_handles)) =
5230 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5231 {
5232 let member_inline_size =
5233 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
5234 decoder.context,
5235 );
5236 if inlined != (member_inline_size <= 4) {
5237 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5238 }
5239 let inner_offset;
5240 let mut inner_depth = depth.clone();
5241 if inlined {
5242 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5243 inner_offset = next_offset;
5244 } else {
5245 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5246 inner_depth.increment()?;
5247 }
5248 let val_ref =
5249 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
5250 fidl::decode!(
5251 InstallationProgress,
5252 D,
5253 val_ref,
5254 decoder,
5255 inner_offset,
5256 inner_depth
5257 )?;
5258 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5259 {
5260 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5261 }
5262 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5263 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5264 }
5265 }
5266
5267 next_offset += envelope_size;
5268
5269 while next_offset < end_offset {
5271 _next_ordinal_to_read += 1;
5272 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5273 next_offset += envelope_size;
5274 }
5275
5276 Ok(())
5277 }
5278 }
5279
5280 impl FailFetchData {
5281 #[inline(always)]
5282 fn max_ordinal_present(&self) -> u64 {
5283 if let Some(_) = self.reason {
5284 return 3;
5285 }
5286 if let Some(_) = self.progress {
5287 return 2;
5288 }
5289 if let Some(_) = self.info {
5290 return 1;
5291 }
5292 0
5293 }
5294 }
5295
5296 impl fidl::encoding::ValueTypeMarker for FailFetchData {
5297 type Borrowed<'a> = &'a Self;
5298 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5299 value
5300 }
5301 }
5302
5303 unsafe impl fidl::encoding::TypeMarker for FailFetchData {
5304 type Owned = Self;
5305
5306 #[inline(always)]
5307 fn inline_align(_context: fidl::encoding::Context) -> usize {
5308 8
5309 }
5310
5311 #[inline(always)]
5312 fn inline_size(_context: fidl::encoding::Context) -> usize {
5313 16
5314 }
5315 }
5316
5317 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FailFetchData, D>
5318 for &FailFetchData
5319 {
5320 unsafe fn encode(
5321 self,
5322 encoder: &mut fidl::encoding::Encoder<'_, D>,
5323 offset: usize,
5324 mut depth: fidl::encoding::Depth,
5325 ) -> fidl::Result<()> {
5326 encoder.debug_check_bounds::<FailFetchData>(offset);
5327 let max_ordinal: u64 = self.max_ordinal_present();
5329 encoder.write_num(max_ordinal, offset);
5330 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5331 if max_ordinal == 0 {
5333 return Ok(());
5334 }
5335 depth.increment()?;
5336 let envelope_size = 8;
5337 let bytes_len = max_ordinal as usize * envelope_size;
5338 #[allow(unused_variables)]
5339 let offset = encoder.out_of_line_offset(bytes_len);
5340 let mut _prev_end_offset: usize = 0;
5341 if 1 > max_ordinal {
5342 return Ok(());
5343 }
5344
5345 let cur_offset: usize = (1 - 1) * envelope_size;
5348
5349 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5351
5352 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
5357 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
5358 encoder,
5359 offset + cur_offset,
5360 depth,
5361 )?;
5362
5363 _prev_end_offset = cur_offset + envelope_size;
5364 if 2 > max_ordinal {
5365 return Ok(());
5366 }
5367
5368 let cur_offset: usize = (2 - 1) * envelope_size;
5371
5372 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5374
5375 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
5380 self.progress
5381 .as_ref()
5382 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
5383 encoder,
5384 offset + cur_offset,
5385 depth,
5386 )?;
5387
5388 _prev_end_offset = cur_offset + envelope_size;
5389 if 3 > max_ordinal {
5390 return Ok(());
5391 }
5392
5393 let cur_offset: usize = (3 - 1) * envelope_size;
5396
5397 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5399
5400 fidl::encoding::encode_in_envelope_optional::<FetchFailureReason, D>(
5405 self.reason
5406 .as_ref()
5407 .map(<FetchFailureReason as fidl::encoding::ValueTypeMarker>::borrow),
5408 encoder,
5409 offset + cur_offset,
5410 depth,
5411 )?;
5412
5413 _prev_end_offset = cur_offset + envelope_size;
5414
5415 Ok(())
5416 }
5417 }
5418
5419 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FailFetchData {
5420 #[inline(always)]
5421 fn new_empty() -> Self {
5422 Self::default()
5423 }
5424
5425 unsafe fn decode(
5426 &mut self,
5427 decoder: &mut fidl::encoding::Decoder<'_, D>,
5428 offset: usize,
5429 mut depth: fidl::encoding::Depth,
5430 ) -> fidl::Result<()> {
5431 decoder.debug_check_bounds::<Self>(offset);
5432 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5433 None => return Err(fidl::Error::NotNullable),
5434 Some(len) => len,
5435 };
5436 if len == 0 {
5438 return Ok(());
5439 };
5440 depth.increment()?;
5441 let envelope_size = 8;
5442 let bytes_len = len * envelope_size;
5443 let offset = decoder.out_of_line_offset(bytes_len)?;
5444 let mut _next_ordinal_to_read = 0;
5446 let mut next_offset = offset;
5447 let end_offset = offset + bytes_len;
5448 _next_ordinal_to_read += 1;
5449 if next_offset >= end_offset {
5450 return Ok(());
5451 }
5452
5453 while _next_ordinal_to_read < 1 {
5455 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5456 _next_ordinal_to_read += 1;
5457 next_offset += envelope_size;
5458 }
5459
5460 let next_out_of_line = decoder.next_out_of_line();
5461 let handles_before = decoder.remaining_handles();
5462 if let Some((inlined, num_bytes, num_handles)) =
5463 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5464 {
5465 let member_inline_size =
5466 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5467 if inlined != (member_inline_size <= 4) {
5468 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5469 }
5470 let inner_offset;
5471 let mut inner_depth = depth.clone();
5472 if inlined {
5473 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5474 inner_offset = next_offset;
5475 } else {
5476 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5477 inner_depth.increment()?;
5478 }
5479 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
5480 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5481 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5482 {
5483 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5484 }
5485 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5486 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5487 }
5488 }
5489
5490 next_offset += envelope_size;
5491 _next_ordinal_to_read += 1;
5492 if next_offset >= end_offset {
5493 return Ok(());
5494 }
5495
5496 while _next_ordinal_to_read < 2 {
5498 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5499 _next_ordinal_to_read += 1;
5500 next_offset += envelope_size;
5501 }
5502
5503 let next_out_of_line = decoder.next_out_of_line();
5504 let handles_before = decoder.remaining_handles();
5505 if let Some((inlined, num_bytes, num_handles)) =
5506 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5507 {
5508 let member_inline_size =
5509 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
5510 decoder.context,
5511 );
5512 if inlined != (member_inline_size <= 4) {
5513 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5514 }
5515 let inner_offset;
5516 let mut inner_depth = depth.clone();
5517 if inlined {
5518 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5519 inner_offset = next_offset;
5520 } else {
5521 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5522 inner_depth.increment()?;
5523 }
5524 let val_ref =
5525 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
5526 fidl::decode!(
5527 InstallationProgress,
5528 D,
5529 val_ref,
5530 decoder,
5531 inner_offset,
5532 inner_depth
5533 )?;
5534 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5535 {
5536 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5537 }
5538 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5539 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5540 }
5541 }
5542
5543 next_offset += envelope_size;
5544 _next_ordinal_to_read += 1;
5545 if next_offset >= end_offset {
5546 return Ok(());
5547 }
5548
5549 while _next_ordinal_to_read < 3 {
5551 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5552 _next_ordinal_to_read += 1;
5553 next_offset += envelope_size;
5554 }
5555
5556 let next_out_of_line = decoder.next_out_of_line();
5557 let handles_before = decoder.remaining_handles();
5558 if let Some((inlined, num_bytes, num_handles)) =
5559 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5560 {
5561 let member_inline_size =
5562 <FetchFailureReason as fidl::encoding::TypeMarker>::inline_size(
5563 decoder.context,
5564 );
5565 if inlined != (member_inline_size <= 4) {
5566 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5567 }
5568 let inner_offset;
5569 let mut inner_depth = depth.clone();
5570 if inlined {
5571 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5572 inner_offset = next_offset;
5573 } else {
5574 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5575 inner_depth.increment()?;
5576 }
5577 let val_ref =
5578 self.reason.get_or_insert_with(|| fidl::new_empty!(FetchFailureReason, D));
5579 fidl::decode!(FetchFailureReason, D, val_ref, decoder, inner_offset, inner_depth)?;
5580 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5581 {
5582 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5583 }
5584 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5585 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5586 }
5587 }
5588
5589 next_offset += envelope_size;
5590
5591 while next_offset < end_offset {
5593 _next_ordinal_to_read += 1;
5594 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5595 next_offset += envelope_size;
5596 }
5597
5598 Ok(())
5599 }
5600 }
5601
5602 impl FailPrepareData {
5603 #[inline(always)]
5604 fn max_ordinal_present(&self) -> u64 {
5605 if let Some(_) = self.reason {
5606 return 1;
5607 }
5608 0
5609 }
5610 }
5611
5612 impl fidl::encoding::ValueTypeMarker for FailPrepareData {
5613 type Borrowed<'a> = &'a Self;
5614 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5615 value
5616 }
5617 }
5618
5619 unsafe impl fidl::encoding::TypeMarker for FailPrepareData {
5620 type Owned = Self;
5621
5622 #[inline(always)]
5623 fn inline_align(_context: fidl::encoding::Context) -> usize {
5624 8
5625 }
5626
5627 #[inline(always)]
5628 fn inline_size(_context: fidl::encoding::Context) -> usize {
5629 16
5630 }
5631 }
5632
5633 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FailPrepareData, D>
5634 for &FailPrepareData
5635 {
5636 unsafe fn encode(
5637 self,
5638 encoder: &mut fidl::encoding::Encoder<'_, D>,
5639 offset: usize,
5640 mut depth: fidl::encoding::Depth,
5641 ) -> fidl::Result<()> {
5642 encoder.debug_check_bounds::<FailPrepareData>(offset);
5643 let max_ordinal: u64 = self.max_ordinal_present();
5645 encoder.write_num(max_ordinal, offset);
5646 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5647 if max_ordinal == 0 {
5649 return Ok(());
5650 }
5651 depth.increment()?;
5652 let envelope_size = 8;
5653 let bytes_len = max_ordinal as usize * envelope_size;
5654 #[allow(unused_variables)]
5655 let offset = encoder.out_of_line_offset(bytes_len);
5656 let mut _prev_end_offset: usize = 0;
5657 if 1 > max_ordinal {
5658 return Ok(());
5659 }
5660
5661 let cur_offset: usize = (1 - 1) * envelope_size;
5664
5665 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5667
5668 fidl::encoding::encode_in_envelope_optional::<PrepareFailureReason, D>(
5673 self.reason
5674 .as_ref()
5675 .map(<PrepareFailureReason as fidl::encoding::ValueTypeMarker>::borrow),
5676 encoder,
5677 offset + cur_offset,
5678 depth,
5679 )?;
5680
5681 _prev_end_offset = cur_offset + envelope_size;
5682
5683 Ok(())
5684 }
5685 }
5686
5687 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FailPrepareData {
5688 #[inline(always)]
5689 fn new_empty() -> Self {
5690 Self::default()
5691 }
5692
5693 unsafe fn decode(
5694 &mut self,
5695 decoder: &mut fidl::encoding::Decoder<'_, D>,
5696 offset: usize,
5697 mut depth: fidl::encoding::Depth,
5698 ) -> fidl::Result<()> {
5699 decoder.debug_check_bounds::<Self>(offset);
5700 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5701 None => return Err(fidl::Error::NotNullable),
5702 Some(len) => len,
5703 };
5704 if len == 0 {
5706 return Ok(());
5707 };
5708 depth.increment()?;
5709 let envelope_size = 8;
5710 let bytes_len = len * envelope_size;
5711 let offset = decoder.out_of_line_offset(bytes_len)?;
5712 let mut _next_ordinal_to_read = 0;
5714 let mut next_offset = offset;
5715 let end_offset = offset + bytes_len;
5716 _next_ordinal_to_read += 1;
5717 if next_offset >= end_offset {
5718 return Ok(());
5719 }
5720
5721 while _next_ordinal_to_read < 1 {
5723 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5724 _next_ordinal_to_read += 1;
5725 next_offset += envelope_size;
5726 }
5727
5728 let next_out_of_line = decoder.next_out_of_line();
5729 let handles_before = decoder.remaining_handles();
5730 if let Some((inlined, num_bytes, num_handles)) =
5731 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5732 {
5733 let member_inline_size =
5734 <PrepareFailureReason as fidl::encoding::TypeMarker>::inline_size(
5735 decoder.context,
5736 );
5737 if inlined != (member_inline_size <= 4) {
5738 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5739 }
5740 let inner_offset;
5741 let mut inner_depth = depth.clone();
5742 if inlined {
5743 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5744 inner_offset = next_offset;
5745 } else {
5746 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5747 inner_depth.increment()?;
5748 }
5749 let val_ref =
5750 self.reason.get_or_insert_with(|| fidl::new_empty!(PrepareFailureReason, D));
5751 fidl::decode!(
5752 PrepareFailureReason,
5753 D,
5754 val_ref,
5755 decoder,
5756 inner_offset,
5757 inner_depth
5758 )?;
5759 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5760 {
5761 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5762 }
5763 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5764 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5765 }
5766 }
5767
5768 next_offset += envelope_size;
5769
5770 while next_offset < end_offset {
5772 _next_ordinal_to_read += 1;
5773 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5774 next_offset += envelope_size;
5775 }
5776
5777 Ok(())
5778 }
5779 }
5780
5781 impl FailStageData {
5782 #[inline(always)]
5783 fn max_ordinal_present(&self) -> u64 {
5784 if let Some(_) = self.reason {
5785 return 3;
5786 }
5787 if let Some(_) = self.progress {
5788 return 2;
5789 }
5790 if let Some(_) = self.info {
5791 return 1;
5792 }
5793 0
5794 }
5795 }
5796
5797 impl fidl::encoding::ValueTypeMarker for FailStageData {
5798 type Borrowed<'a> = &'a Self;
5799 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5800 value
5801 }
5802 }
5803
5804 unsafe impl fidl::encoding::TypeMarker for FailStageData {
5805 type Owned = Self;
5806
5807 #[inline(always)]
5808 fn inline_align(_context: fidl::encoding::Context) -> usize {
5809 8
5810 }
5811
5812 #[inline(always)]
5813 fn inline_size(_context: fidl::encoding::Context) -> usize {
5814 16
5815 }
5816 }
5817
5818 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FailStageData, D>
5819 for &FailStageData
5820 {
5821 unsafe fn encode(
5822 self,
5823 encoder: &mut fidl::encoding::Encoder<'_, D>,
5824 offset: usize,
5825 mut depth: fidl::encoding::Depth,
5826 ) -> fidl::Result<()> {
5827 encoder.debug_check_bounds::<FailStageData>(offset);
5828 let max_ordinal: u64 = self.max_ordinal_present();
5830 encoder.write_num(max_ordinal, offset);
5831 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5832 if max_ordinal == 0 {
5834 return Ok(());
5835 }
5836 depth.increment()?;
5837 let envelope_size = 8;
5838 let bytes_len = max_ordinal as usize * envelope_size;
5839 #[allow(unused_variables)]
5840 let offset = encoder.out_of_line_offset(bytes_len);
5841 let mut _prev_end_offset: usize = 0;
5842 if 1 > max_ordinal {
5843 return Ok(());
5844 }
5845
5846 let cur_offset: usize = (1 - 1) * envelope_size;
5849
5850 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5852
5853 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
5858 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
5859 encoder,
5860 offset + cur_offset,
5861 depth,
5862 )?;
5863
5864 _prev_end_offset = cur_offset + envelope_size;
5865 if 2 > max_ordinal {
5866 return Ok(());
5867 }
5868
5869 let cur_offset: usize = (2 - 1) * envelope_size;
5872
5873 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5875
5876 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
5881 self.progress
5882 .as_ref()
5883 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
5884 encoder,
5885 offset + cur_offset,
5886 depth,
5887 )?;
5888
5889 _prev_end_offset = cur_offset + envelope_size;
5890 if 3 > max_ordinal {
5891 return Ok(());
5892 }
5893
5894 let cur_offset: usize = (3 - 1) * envelope_size;
5897
5898 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5900
5901 fidl::encoding::encode_in_envelope_optional::<StageFailureReason, D>(
5906 self.reason
5907 .as_ref()
5908 .map(<StageFailureReason as fidl::encoding::ValueTypeMarker>::borrow),
5909 encoder,
5910 offset + cur_offset,
5911 depth,
5912 )?;
5913
5914 _prev_end_offset = cur_offset + envelope_size;
5915
5916 Ok(())
5917 }
5918 }
5919
5920 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FailStageData {
5921 #[inline(always)]
5922 fn new_empty() -> Self {
5923 Self::default()
5924 }
5925
5926 unsafe fn decode(
5927 &mut self,
5928 decoder: &mut fidl::encoding::Decoder<'_, D>,
5929 offset: usize,
5930 mut depth: fidl::encoding::Depth,
5931 ) -> fidl::Result<()> {
5932 decoder.debug_check_bounds::<Self>(offset);
5933 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5934 None => return Err(fidl::Error::NotNullable),
5935 Some(len) => len,
5936 };
5937 if len == 0 {
5939 return Ok(());
5940 };
5941 depth.increment()?;
5942 let envelope_size = 8;
5943 let bytes_len = len * envelope_size;
5944 let offset = decoder.out_of_line_offset(bytes_len)?;
5945 let mut _next_ordinal_to_read = 0;
5947 let mut next_offset = offset;
5948 let end_offset = offset + bytes_len;
5949 _next_ordinal_to_read += 1;
5950 if next_offset >= end_offset {
5951 return Ok(());
5952 }
5953
5954 while _next_ordinal_to_read < 1 {
5956 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5957 _next_ordinal_to_read += 1;
5958 next_offset += envelope_size;
5959 }
5960
5961 let next_out_of_line = decoder.next_out_of_line();
5962 let handles_before = decoder.remaining_handles();
5963 if let Some((inlined, num_bytes, num_handles)) =
5964 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5965 {
5966 let member_inline_size =
5967 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5968 if inlined != (member_inline_size <= 4) {
5969 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5970 }
5971 let inner_offset;
5972 let mut inner_depth = depth.clone();
5973 if inlined {
5974 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5975 inner_offset = next_offset;
5976 } else {
5977 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5978 inner_depth.increment()?;
5979 }
5980 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
5981 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5982 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5983 {
5984 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5985 }
5986 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5987 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5988 }
5989 }
5990
5991 next_offset += envelope_size;
5992 _next_ordinal_to_read += 1;
5993 if next_offset >= end_offset {
5994 return Ok(());
5995 }
5996
5997 while _next_ordinal_to_read < 2 {
5999 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6000 _next_ordinal_to_read += 1;
6001 next_offset += envelope_size;
6002 }
6003
6004 let next_out_of_line = decoder.next_out_of_line();
6005 let handles_before = decoder.remaining_handles();
6006 if let Some((inlined, num_bytes, num_handles)) =
6007 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6008 {
6009 let member_inline_size =
6010 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
6011 decoder.context,
6012 );
6013 if inlined != (member_inline_size <= 4) {
6014 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6015 }
6016 let inner_offset;
6017 let mut inner_depth = depth.clone();
6018 if inlined {
6019 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6020 inner_offset = next_offset;
6021 } else {
6022 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6023 inner_depth.increment()?;
6024 }
6025 let val_ref =
6026 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
6027 fidl::decode!(
6028 InstallationProgress,
6029 D,
6030 val_ref,
6031 decoder,
6032 inner_offset,
6033 inner_depth
6034 )?;
6035 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6036 {
6037 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6038 }
6039 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6040 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6041 }
6042 }
6043
6044 next_offset += envelope_size;
6045 _next_ordinal_to_read += 1;
6046 if next_offset >= end_offset {
6047 return Ok(());
6048 }
6049
6050 while _next_ordinal_to_read < 3 {
6052 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6053 _next_ordinal_to_read += 1;
6054 next_offset += envelope_size;
6055 }
6056
6057 let next_out_of_line = decoder.next_out_of_line();
6058 let handles_before = decoder.remaining_handles();
6059 if let Some((inlined, num_bytes, num_handles)) =
6060 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6061 {
6062 let member_inline_size =
6063 <StageFailureReason as fidl::encoding::TypeMarker>::inline_size(
6064 decoder.context,
6065 );
6066 if inlined != (member_inline_size <= 4) {
6067 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6068 }
6069 let inner_offset;
6070 let mut inner_depth = depth.clone();
6071 if inlined {
6072 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6073 inner_offset = next_offset;
6074 } else {
6075 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6076 inner_depth.increment()?;
6077 }
6078 let val_ref =
6079 self.reason.get_or_insert_with(|| fidl::new_empty!(StageFailureReason, D));
6080 fidl::decode!(StageFailureReason, D, val_ref, decoder, inner_offset, inner_depth)?;
6081 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6082 {
6083 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6084 }
6085 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6086 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6087 }
6088 }
6089
6090 next_offset += envelope_size;
6091
6092 while next_offset < end_offset {
6094 _next_ordinal_to_read += 1;
6095 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6096 next_offset += envelope_size;
6097 }
6098
6099 Ok(())
6100 }
6101 }
6102
6103 impl FetchData {
6104 #[inline(always)]
6105 fn max_ordinal_present(&self) -> u64 {
6106 if let Some(_) = self.progress {
6107 return 2;
6108 }
6109 if let Some(_) = self.info {
6110 return 1;
6111 }
6112 0
6113 }
6114 }
6115
6116 impl fidl::encoding::ValueTypeMarker for FetchData {
6117 type Borrowed<'a> = &'a Self;
6118 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6119 value
6120 }
6121 }
6122
6123 unsafe impl fidl::encoding::TypeMarker for FetchData {
6124 type Owned = Self;
6125
6126 #[inline(always)]
6127 fn inline_align(_context: fidl::encoding::Context) -> usize {
6128 8
6129 }
6130
6131 #[inline(always)]
6132 fn inline_size(_context: fidl::encoding::Context) -> usize {
6133 16
6134 }
6135 }
6136
6137 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FetchData, D>
6138 for &FetchData
6139 {
6140 unsafe fn encode(
6141 self,
6142 encoder: &mut fidl::encoding::Encoder<'_, D>,
6143 offset: usize,
6144 mut depth: fidl::encoding::Depth,
6145 ) -> fidl::Result<()> {
6146 encoder.debug_check_bounds::<FetchData>(offset);
6147 let max_ordinal: u64 = self.max_ordinal_present();
6149 encoder.write_num(max_ordinal, offset);
6150 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6151 if max_ordinal == 0 {
6153 return Ok(());
6154 }
6155 depth.increment()?;
6156 let envelope_size = 8;
6157 let bytes_len = max_ordinal as usize * envelope_size;
6158 #[allow(unused_variables)]
6159 let offset = encoder.out_of_line_offset(bytes_len);
6160 let mut _prev_end_offset: usize = 0;
6161 if 1 > max_ordinal {
6162 return Ok(());
6163 }
6164
6165 let cur_offset: usize = (1 - 1) * envelope_size;
6168
6169 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6171
6172 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
6177 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
6178 encoder,
6179 offset + cur_offset,
6180 depth,
6181 )?;
6182
6183 _prev_end_offset = cur_offset + envelope_size;
6184 if 2 > max_ordinal {
6185 return Ok(());
6186 }
6187
6188 let cur_offset: usize = (2 - 1) * envelope_size;
6191
6192 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6194
6195 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
6200 self.progress
6201 .as_ref()
6202 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
6203 encoder,
6204 offset + cur_offset,
6205 depth,
6206 )?;
6207
6208 _prev_end_offset = cur_offset + envelope_size;
6209
6210 Ok(())
6211 }
6212 }
6213
6214 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FetchData {
6215 #[inline(always)]
6216 fn new_empty() -> Self {
6217 Self::default()
6218 }
6219
6220 unsafe fn decode(
6221 &mut self,
6222 decoder: &mut fidl::encoding::Decoder<'_, D>,
6223 offset: usize,
6224 mut depth: fidl::encoding::Depth,
6225 ) -> fidl::Result<()> {
6226 decoder.debug_check_bounds::<Self>(offset);
6227 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6228 None => return Err(fidl::Error::NotNullable),
6229 Some(len) => len,
6230 };
6231 if len == 0 {
6233 return Ok(());
6234 };
6235 depth.increment()?;
6236 let envelope_size = 8;
6237 let bytes_len = len * envelope_size;
6238 let offset = decoder.out_of_line_offset(bytes_len)?;
6239 let mut _next_ordinal_to_read = 0;
6241 let mut next_offset = offset;
6242 let end_offset = offset + bytes_len;
6243 _next_ordinal_to_read += 1;
6244 if next_offset >= end_offset {
6245 return Ok(());
6246 }
6247
6248 while _next_ordinal_to_read < 1 {
6250 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6251 _next_ordinal_to_read += 1;
6252 next_offset += envelope_size;
6253 }
6254
6255 let next_out_of_line = decoder.next_out_of_line();
6256 let handles_before = decoder.remaining_handles();
6257 if let Some((inlined, num_bytes, num_handles)) =
6258 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6259 {
6260 let member_inline_size =
6261 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6262 if inlined != (member_inline_size <= 4) {
6263 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6264 }
6265 let inner_offset;
6266 let mut inner_depth = depth.clone();
6267 if inlined {
6268 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6269 inner_offset = next_offset;
6270 } else {
6271 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6272 inner_depth.increment()?;
6273 }
6274 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
6275 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
6276 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6277 {
6278 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6279 }
6280 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6281 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6282 }
6283 }
6284
6285 next_offset += envelope_size;
6286 _next_ordinal_to_read += 1;
6287 if next_offset >= end_offset {
6288 return Ok(());
6289 }
6290
6291 while _next_ordinal_to_read < 2 {
6293 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6294 _next_ordinal_to_read += 1;
6295 next_offset += envelope_size;
6296 }
6297
6298 let next_out_of_line = decoder.next_out_of_line();
6299 let handles_before = decoder.remaining_handles();
6300 if let Some((inlined, num_bytes, num_handles)) =
6301 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6302 {
6303 let member_inline_size =
6304 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
6305 decoder.context,
6306 );
6307 if inlined != (member_inline_size <= 4) {
6308 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6309 }
6310 let inner_offset;
6311 let mut inner_depth = depth.clone();
6312 if inlined {
6313 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6314 inner_offset = next_offset;
6315 } else {
6316 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6317 inner_depth.increment()?;
6318 }
6319 let val_ref =
6320 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
6321 fidl::decode!(
6322 InstallationProgress,
6323 D,
6324 val_ref,
6325 decoder,
6326 inner_offset,
6327 inner_depth
6328 )?;
6329 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6330 {
6331 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6332 }
6333 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6334 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6335 }
6336 }
6337
6338 next_offset += envelope_size;
6339
6340 while next_offset < end_offset {
6342 _next_ordinal_to_read += 1;
6343 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6344 next_offset += envelope_size;
6345 }
6346
6347 Ok(())
6348 }
6349 }
6350
6351 impl InstallationProgress {
6352 #[inline(always)]
6353 fn max_ordinal_present(&self) -> u64 {
6354 if let Some(_) = self.bytes_downloaded {
6355 return 2;
6356 }
6357 if let Some(_) = self.fraction_completed {
6358 return 1;
6359 }
6360 0
6361 }
6362 }
6363
6364 impl fidl::encoding::ValueTypeMarker for InstallationProgress {
6365 type Borrowed<'a> = &'a Self;
6366 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6367 value
6368 }
6369 }
6370
6371 unsafe impl fidl::encoding::TypeMarker for InstallationProgress {
6372 type Owned = Self;
6373
6374 #[inline(always)]
6375 fn inline_align(_context: fidl::encoding::Context) -> usize {
6376 8
6377 }
6378
6379 #[inline(always)]
6380 fn inline_size(_context: fidl::encoding::Context) -> usize {
6381 16
6382 }
6383 }
6384
6385 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstallationProgress, D>
6386 for &InstallationProgress
6387 {
6388 unsafe fn encode(
6389 self,
6390 encoder: &mut fidl::encoding::Encoder<'_, D>,
6391 offset: usize,
6392 mut depth: fidl::encoding::Depth,
6393 ) -> fidl::Result<()> {
6394 encoder.debug_check_bounds::<InstallationProgress>(offset);
6395 let max_ordinal: u64 = self.max_ordinal_present();
6397 encoder.write_num(max_ordinal, offset);
6398 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6399 if max_ordinal == 0 {
6401 return Ok(());
6402 }
6403 depth.increment()?;
6404 let envelope_size = 8;
6405 let bytes_len = max_ordinal as usize * envelope_size;
6406 #[allow(unused_variables)]
6407 let offset = encoder.out_of_line_offset(bytes_len);
6408 let mut _prev_end_offset: usize = 0;
6409 if 1 > max_ordinal {
6410 return Ok(());
6411 }
6412
6413 let cur_offset: usize = (1 - 1) * envelope_size;
6416
6417 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6419
6420 fidl::encoding::encode_in_envelope_optional::<f32, D>(
6425 self.fraction_completed
6426 .as_ref()
6427 .map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
6428 encoder,
6429 offset + cur_offset,
6430 depth,
6431 )?;
6432
6433 _prev_end_offset = cur_offset + envelope_size;
6434 if 2 > max_ordinal {
6435 return Ok(());
6436 }
6437
6438 let cur_offset: usize = (2 - 1) * envelope_size;
6441
6442 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6444
6445 fidl::encoding::encode_in_envelope_optional::<u64, D>(
6450 self.bytes_downloaded
6451 .as_ref()
6452 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6453 encoder,
6454 offset + cur_offset,
6455 depth,
6456 )?;
6457
6458 _prev_end_offset = cur_offset + envelope_size;
6459
6460 Ok(())
6461 }
6462 }
6463
6464 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstallationProgress {
6465 #[inline(always)]
6466 fn new_empty() -> Self {
6467 Self::default()
6468 }
6469
6470 unsafe fn decode(
6471 &mut self,
6472 decoder: &mut fidl::encoding::Decoder<'_, D>,
6473 offset: usize,
6474 mut depth: fidl::encoding::Depth,
6475 ) -> fidl::Result<()> {
6476 decoder.debug_check_bounds::<Self>(offset);
6477 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6478 None => return Err(fidl::Error::NotNullable),
6479 Some(len) => len,
6480 };
6481 if len == 0 {
6483 return Ok(());
6484 };
6485 depth.increment()?;
6486 let envelope_size = 8;
6487 let bytes_len = len * envelope_size;
6488 let offset = decoder.out_of_line_offset(bytes_len)?;
6489 let mut _next_ordinal_to_read = 0;
6491 let mut next_offset = offset;
6492 let end_offset = offset + bytes_len;
6493 _next_ordinal_to_read += 1;
6494 if next_offset >= end_offset {
6495 return Ok(());
6496 }
6497
6498 while _next_ordinal_to_read < 1 {
6500 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6501 _next_ordinal_to_read += 1;
6502 next_offset += envelope_size;
6503 }
6504
6505 let next_out_of_line = decoder.next_out_of_line();
6506 let handles_before = decoder.remaining_handles();
6507 if let Some((inlined, num_bytes, num_handles)) =
6508 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6509 {
6510 let member_inline_size =
6511 <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6512 if inlined != (member_inline_size <= 4) {
6513 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6514 }
6515 let inner_offset;
6516 let mut inner_depth = depth.clone();
6517 if inlined {
6518 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6519 inner_offset = next_offset;
6520 } else {
6521 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6522 inner_depth.increment()?;
6523 }
6524 let val_ref =
6525 self.fraction_completed.get_or_insert_with(|| fidl::new_empty!(f32, D));
6526 fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
6527 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6528 {
6529 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6530 }
6531 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6532 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6533 }
6534 }
6535
6536 next_offset += envelope_size;
6537 _next_ordinal_to_read += 1;
6538 if next_offset >= end_offset {
6539 return Ok(());
6540 }
6541
6542 while _next_ordinal_to_read < 2 {
6544 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6545 _next_ordinal_to_read += 1;
6546 next_offset += envelope_size;
6547 }
6548
6549 let next_out_of_line = decoder.next_out_of_line();
6550 let handles_before = decoder.remaining_handles();
6551 if let Some((inlined, num_bytes, num_handles)) =
6552 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6553 {
6554 let member_inline_size =
6555 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6556 if inlined != (member_inline_size <= 4) {
6557 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6558 }
6559 let inner_offset;
6560 let mut inner_depth = depth.clone();
6561 if inlined {
6562 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6563 inner_offset = next_offset;
6564 } else {
6565 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6566 inner_depth.increment()?;
6567 }
6568 let val_ref = self.bytes_downloaded.get_or_insert_with(|| fidl::new_empty!(u64, D));
6569 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6570 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6571 {
6572 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6573 }
6574 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6575 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6576 }
6577 }
6578
6579 next_offset += envelope_size;
6580
6581 while next_offset < end_offset {
6583 _next_ordinal_to_read += 1;
6584 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6585 next_offset += envelope_size;
6586 }
6587
6588 Ok(())
6589 }
6590 }
6591
6592 impl Options {
6593 #[inline(always)]
6594 fn max_ordinal_present(&self) -> u64 {
6595 if let Some(_) = self.should_write_recovery {
6596 return 3;
6597 }
6598 if let Some(_) = self.allow_attach_to_existing_attempt {
6599 return 2;
6600 }
6601 if let Some(_) = self.initiator {
6602 return 1;
6603 }
6604 0
6605 }
6606 }
6607
6608 impl fidl::encoding::ValueTypeMarker for Options {
6609 type Borrowed<'a> = &'a Self;
6610 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6611 value
6612 }
6613 }
6614
6615 unsafe impl fidl::encoding::TypeMarker for Options {
6616 type Owned = Self;
6617
6618 #[inline(always)]
6619 fn inline_align(_context: fidl::encoding::Context) -> usize {
6620 8
6621 }
6622
6623 #[inline(always)]
6624 fn inline_size(_context: fidl::encoding::Context) -> usize {
6625 16
6626 }
6627 }
6628
6629 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Options, D> for &Options {
6630 unsafe fn encode(
6631 self,
6632 encoder: &mut fidl::encoding::Encoder<'_, D>,
6633 offset: usize,
6634 mut depth: fidl::encoding::Depth,
6635 ) -> fidl::Result<()> {
6636 encoder.debug_check_bounds::<Options>(offset);
6637 let max_ordinal: u64 = self.max_ordinal_present();
6639 encoder.write_num(max_ordinal, offset);
6640 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6641 if max_ordinal == 0 {
6643 return Ok(());
6644 }
6645 depth.increment()?;
6646 let envelope_size = 8;
6647 let bytes_len = max_ordinal as usize * envelope_size;
6648 #[allow(unused_variables)]
6649 let offset = encoder.out_of_line_offset(bytes_len);
6650 let mut _prev_end_offset: usize = 0;
6651 if 1 > max_ordinal {
6652 return Ok(());
6653 }
6654
6655 let cur_offset: usize = (1 - 1) * envelope_size;
6658
6659 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6661
6662 fidl::encoding::encode_in_envelope_optional::<Initiator, D>(
6667 self.initiator.as_ref().map(<Initiator as fidl::encoding::ValueTypeMarker>::borrow),
6668 encoder,
6669 offset + cur_offset,
6670 depth,
6671 )?;
6672
6673 _prev_end_offset = cur_offset + envelope_size;
6674 if 2 > max_ordinal {
6675 return Ok(());
6676 }
6677
6678 let cur_offset: usize = (2 - 1) * envelope_size;
6681
6682 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6684
6685 fidl::encoding::encode_in_envelope_optional::<bool, D>(
6690 self.allow_attach_to_existing_attempt
6691 .as_ref()
6692 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6693 encoder,
6694 offset + cur_offset,
6695 depth,
6696 )?;
6697
6698 _prev_end_offset = cur_offset + envelope_size;
6699 if 3 > max_ordinal {
6700 return Ok(());
6701 }
6702
6703 let cur_offset: usize = (3 - 1) * envelope_size;
6706
6707 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6709
6710 fidl::encoding::encode_in_envelope_optional::<bool, D>(
6715 self.should_write_recovery
6716 .as_ref()
6717 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6718 encoder,
6719 offset + cur_offset,
6720 depth,
6721 )?;
6722
6723 _prev_end_offset = cur_offset + envelope_size;
6724
6725 Ok(())
6726 }
6727 }
6728
6729 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Options {
6730 #[inline(always)]
6731 fn new_empty() -> Self {
6732 Self::default()
6733 }
6734
6735 unsafe fn decode(
6736 &mut self,
6737 decoder: &mut fidl::encoding::Decoder<'_, D>,
6738 offset: usize,
6739 mut depth: fidl::encoding::Depth,
6740 ) -> fidl::Result<()> {
6741 decoder.debug_check_bounds::<Self>(offset);
6742 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6743 None => return Err(fidl::Error::NotNullable),
6744 Some(len) => len,
6745 };
6746 if len == 0 {
6748 return Ok(());
6749 };
6750 depth.increment()?;
6751 let envelope_size = 8;
6752 let bytes_len = len * envelope_size;
6753 let offset = decoder.out_of_line_offset(bytes_len)?;
6754 let mut _next_ordinal_to_read = 0;
6756 let mut next_offset = offset;
6757 let end_offset = offset + bytes_len;
6758 _next_ordinal_to_read += 1;
6759 if next_offset >= end_offset {
6760 return Ok(());
6761 }
6762
6763 while _next_ordinal_to_read < 1 {
6765 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6766 _next_ordinal_to_read += 1;
6767 next_offset += envelope_size;
6768 }
6769
6770 let next_out_of_line = decoder.next_out_of_line();
6771 let handles_before = decoder.remaining_handles();
6772 if let Some((inlined, num_bytes, num_handles)) =
6773 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6774 {
6775 let member_inline_size =
6776 <Initiator as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6777 if inlined != (member_inline_size <= 4) {
6778 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6779 }
6780 let inner_offset;
6781 let mut inner_depth = depth.clone();
6782 if inlined {
6783 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6784 inner_offset = next_offset;
6785 } else {
6786 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6787 inner_depth.increment()?;
6788 }
6789 let val_ref = self.initiator.get_or_insert_with(|| fidl::new_empty!(Initiator, D));
6790 fidl::decode!(Initiator, D, val_ref, decoder, inner_offset, inner_depth)?;
6791 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6792 {
6793 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6794 }
6795 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6796 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6797 }
6798 }
6799
6800 next_offset += envelope_size;
6801 _next_ordinal_to_read += 1;
6802 if next_offset >= end_offset {
6803 return Ok(());
6804 }
6805
6806 while _next_ordinal_to_read < 2 {
6808 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6809 _next_ordinal_to_read += 1;
6810 next_offset += envelope_size;
6811 }
6812
6813 let next_out_of_line = decoder.next_out_of_line();
6814 let handles_before = decoder.remaining_handles();
6815 if let Some((inlined, num_bytes, num_handles)) =
6816 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6817 {
6818 let member_inline_size =
6819 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6820 if inlined != (member_inline_size <= 4) {
6821 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6822 }
6823 let inner_offset;
6824 let mut inner_depth = depth.clone();
6825 if inlined {
6826 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6827 inner_offset = next_offset;
6828 } else {
6829 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6830 inner_depth.increment()?;
6831 }
6832 let val_ref = self
6833 .allow_attach_to_existing_attempt
6834 .get_or_insert_with(|| fidl::new_empty!(bool, D));
6835 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6836 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6837 {
6838 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6839 }
6840 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6841 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6842 }
6843 }
6844
6845 next_offset += envelope_size;
6846 _next_ordinal_to_read += 1;
6847 if next_offset >= end_offset {
6848 return Ok(());
6849 }
6850
6851 while _next_ordinal_to_read < 3 {
6853 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6854 _next_ordinal_to_read += 1;
6855 next_offset += envelope_size;
6856 }
6857
6858 let next_out_of_line = decoder.next_out_of_line();
6859 let handles_before = decoder.remaining_handles();
6860 if let Some((inlined, num_bytes, num_handles)) =
6861 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6862 {
6863 let member_inline_size =
6864 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6865 if inlined != (member_inline_size <= 4) {
6866 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6867 }
6868 let inner_offset;
6869 let mut inner_depth = depth.clone();
6870 if inlined {
6871 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6872 inner_offset = next_offset;
6873 } else {
6874 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6875 inner_depth.increment()?;
6876 }
6877 let val_ref =
6878 self.should_write_recovery.get_or_insert_with(|| fidl::new_empty!(bool, D));
6879 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6880 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6881 {
6882 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6883 }
6884 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6885 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6886 }
6887 }
6888
6889 next_offset += envelope_size;
6890
6891 while next_offset < end_offset {
6893 _next_ordinal_to_read += 1;
6894 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6895 next_offset += envelope_size;
6896 }
6897
6898 Ok(())
6899 }
6900 }
6901
6902 impl PrepareData {
6903 #[inline(always)]
6904 fn max_ordinal_present(&self) -> u64 {
6905 0
6906 }
6907 }
6908
6909 impl fidl::encoding::ValueTypeMarker for PrepareData {
6910 type Borrowed<'a> = &'a Self;
6911 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6912 value
6913 }
6914 }
6915
6916 unsafe impl fidl::encoding::TypeMarker for PrepareData {
6917 type Owned = Self;
6918
6919 #[inline(always)]
6920 fn inline_align(_context: fidl::encoding::Context) -> usize {
6921 8
6922 }
6923
6924 #[inline(always)]
6925 fn inline_size(_context: fidl::encoding::Context) -> usize {
6926 16
6927 }
6928 }
6929
6930 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrepareData, D>
6931 for &PrepareData
6932 {
6933 unsafe fn encode(
6934 self,
6935 encoder: &mut fidl::encoding::Encoder<'_, D>,
6936 offset: usize,
6937 mut depth: fidl::encoding::Depth,
6938 ) -> fidl::Result<()> {
6939 encoder.debug_check_bounds::<PrepareData>(offset);
6940 let max_ordinal: u64 = self.max_ordinal_present();
6942 encoder.write_num(max_ordinal, offset);
6943 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6944 if max_ordinal == 0 {
6946 return Ok(());
6947 }
6948 depth.increment()?;
6949 let envelope_size = 8;
6950 let bytes_len = max_ordinal as usize * envelope_size;
6951 #[allow(unused_variables)]
6952 let offset = encoder.out_of_line_offset(bytes_len);
6953 let mut _prev_end_offset: usize = 0;
6954
6955 Ok(())
6956 }
6957 }
6958
6959 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrepareData {
6960 #[inline(always)]
6961 fn new_empty() -> Self {
6962 Self::default()
6963 }
6964
6965 unsafe fn decode(
6966 &mut self,
6967 decoder: &mut fidl::encoding::Decoder<'_, D>,
6968 offset: usize,
6969 mut depth: fidl::encoding::Depth,
6970 ) -> fidl::Result<()> {
6971 decoder.debug_check_bounds::<Self>(offset);
6972 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6973 None => return Err(fidl::Error::NotNullable),
6974 Some(len) => len,
6975 };
6976 if len == 0 {
6978 return Ok(());
6979 };
6980 depth.increment()?;
6981 let envelope_size = 8;
6982 let bytes_len = len * envelope_size;
6983 let offset = decoder.out_of_line_offset(bytes_len)?;
6984 let mut _next_ordinal_to_read = 0;
6986 let mut next_offset = offset;
6987 let end_offset = offset + bytes_len;
6988
6989 while next_offset < end_offset {
6991 _next_ordinal_to_read += 1;
6992 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6993 next_offset += envelope_size;
6994 }
6995
6996 Ok(())
6997 }
6998 }
6999
7000 impl RebootData {
7001 #[inline(always)]
7002 fn max_ordinal_present(&self) -> u64 {
7003 if let Some(_) = self.progress {
7004 return 2;
7005 }
7006 if let Some(_) = self.info {
7007 return 1;
7008 }
7009 0
7010 }
7011 }
7012
7013 impl fidl::encoding::ValueTypeMarker for RebootData {
7014 type Borrowed<'a> = &'a Self;
7015 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7016 value
7017 }
7018 }
7019
7020 unsafe impl fidl::encoding::TypeMarker for RebootData {
7021 type Owned = Self;
7022
7023 #[inline(always)]
7024 fn inline_align(_context: fidl::encoding::Context) -> usize {
7025 8
7026 }
7027
7028 #[inline(always)]
7029 fn inline_size(_context: fidl::encoding::Context) -> usize {
7030 16
7031 }
7032 }
7033
7034 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RebootData, D>
7035 for &RebootData
7036 {
7037 unsafe fn encode(
7038 self,
7039 encoder: &mut fidl::encoding::Encoder<'_, D>,
7040 offset: usize,
7041 mut depth: fidl::encoding::Depth,
7042 ) -> fidl::Result<()> {
7043 encoder.debug_check_bounds::<RebootData>(offset);
7044 let max_ordinal: u64 = self.max_ordinal_present();
7046 encoder.write_num(max_ordinal, offset);
7047 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7048 if max_ordinal == 0 {
7050 return Ok(());
7051 }
7052 depth.increment()?;
7053 let envelope_size = 8;
7054 let bytes_len = max_ordinal as usize * envelope_size;
7055 #[allow(unused_variables)]
7056 let offset = encoder.out_of_line_offset(bytes_len);
7057 let mut _prev_end_offset: usize = 0;
7058 if 1 > max_ordinal {
7059 return Ok(());
7060 }
7061
7062 let cur_offset: usize = (1 - 1) * envelope_size;
7065
7066 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7068
7069 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
7074 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
7075 encoder,
7076 offset + cur_offset,
7077 depth,
7078 )?;
7079
7080 _prev_end_offset = cur_offset + envelope_size;
7081 if 2 > max_ordinal {
7082 return Ok(());
7083 }
7084
7085 let cur_offset: usize = (2 - 1) * envelope_size;
7088
7089 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7091
7092 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
7097 self.progress
7098 .as_ref()
7099 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
7100 encoder,
7101 offset + cur_offset,
7102 depth,
7103 )?;
7104
7105 _prev_end_offset = cur_offset + envelope_size;
7106
7107 Ok(())
7108 }
7109 }
7110
7111 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RebootData {
7112 #[inline(always)]
7113 fn new_empty() -> Self {
7114 Self::default()
7115 }
7116
7117 unsafe fn decode(
7118 &mut self,
7119 decoder: &mut fidl::encoding::Decoder<'_, D>,
7120 offset: usize,
7121 mut depth: fidl::encoding::Depth,
7122 ) -> fidl::Result<()> {
7123 decoder.debug_check_bounds::<Self>(offset);
7124 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7125 None => return Err(fidl::Error::NotNullable),
7126 Some(len) => len,
7127 };
7128 if len == 0 {
7130 return Ok(());
7131 };
7132 depth.increment()?;
7133 let envelope_size = 8;
7134 let bytes_len = len * envelope_size;
7135 let offset = decoder.out_of_line_offset(bytes_len)?;
7136 let mut _next_ordinal_to_read = 0;
7138 let mut next_offset = offset;
7139 let end_offset = offset + bytes_len;
7140 _next_ordinal_to_read += 1;
7141 if next_offset >= end_offset {
7142 return Ok(());
7143 }
7144
7145 while _next_ordinal_to_read < 1 {
7147 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7148 _next_ordinal_to_read += 1;
7149 next_offset += envelope_size;
7150 }
7151
7152 let next_out_of_line = decoder.next_out_of_line();
7153 let handles_before = decoder.remaining_handles();
7154 if let Some((inlined, num_bytes, num_handles)) =
7155 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7156 {
7157 let member_inline_size =
7158 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7159 if inlined != (member_inline_size <= 4) {
7160 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7161 }
7162 let inner_offset;
7163 let mut inner_depth = depth.clone();
7164 if inlined {
7165 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7166 inner_offset = next_offset;
7167 } else {
7168 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7169 inner_depth.increment()?;
7170 }
7171 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
7172 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
7173 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7174 {
7175 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7176 }
7177 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7178 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7179 }
7180 }
7181
7182 next_offset += envelope_size;
7183 _next_ordinal_to_read += 1;
7184 if next_offset >= end_offset {
7185 return Ok(());
7186 }
7187
7188 while _next_ordinal_to_read < 2 {
7190 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7191 _next_ordinal_to_read += 1;
7192 next_offset += envelope_size;
7193 }
7194
7195 let next_out_of_line = decoder.next_out_of_line();
7196 let handles_before = decoder.remaining_handles();
7197 if let Some((inlined, num_bytes, num_handles)) =
7198 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7199 {
7200 let member_inline_size =
7201 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
7202 decoder.context,
7203 );
7204 if inlined != (member_inline_size <= 4) {
7205 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7206 }
7207 let inner_offset;
7208 let mut inner_depth = depth.clone();
7209 if inlined {
7210 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7211 inner_offset = next_offset;
7212 } else {
7213 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7214 inner_depth.increment()?;
7215 }
7216 let val_ref =
7217 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
7218 fidl::decode!(
7219 InstallationProgress,
7220 D,
7221 val_ref,
7222 decoder,
7223 inner_offset,
7224 inner_depth
7225 )?;
7226 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7227 {
7228 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7229 }
7230 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7231 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7232 }
7233 }
7234
7235 next_offset += envelope_size;
7236
7237 while next_offset < end_offset {
7239 _next_ordinal_to_read += 1;
7240 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7241 next_offset += envelope_size;
7242 }
7243
7244 Ok(())
7245 }
7246 }
7247
7248 impl StageData {
7249 #[inline(always)]
7250 fn max_ordinal_present(&self) -> u64 {
7251 if let Some(_) = self.progress {
7252 return 2;
7253 }
7254 if let Some(_) = self.info {
7255 return 1;
7256 }
7257 0
7258 }
7259 }
7260
7261 impl fidl::encoding::ValueTypeMarker for StageData {
7262 type Borrowed<'a> = &'a Self;
7263 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7264 value
7265 }
7266 }
7267
7268 unsafe impl fidl::encoding::TypeMarker for StageData {
7269 type Owned = Self;
7270
7271 #[inline(always)]
7272 fn inline_align(_context: fidl::encoding::Context) -> usize {
7273 8
7274 }
7275
7276 #[inline(always)]
7277 fn inline_size(_context: fidl::encoding::Context) -> usize {
7278 16
7279 }
7280 }
7281
7282 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StageData, D>
7283 for &StageData
7284 {
7285 unsafe fn encode(
7286 self,
7287 encoder: &mut fidl::encoding::Encoder<'_, D>,
7288 offset: usize,
7289 mut depth: fidl::encoding::Depth,
7290 ) -> fidl::Result<()> {
7291 encoder.debug_check_bounds::<StageData>(offset);
7292 let max_ordinal: u64 = self.max_ordinal_present();
7294 encoder.write_num(max_ordinal, offset);
7295 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7296 if max_ordinal == 0 {
7298 return Ok(());
7299 }
7300 depth.increment()?;
7301 let envelope_size = 8;
7302 let bytes_len = max_ordinal as usize * envelope_size;
7303 #[allow(unused_variables)]
7304 let offset = encoder.out_of_line_offset(bytes_len);
7305 let mut _prev_end_offset: usize = 0;
7306 if 1 > max_ordinal {
7307 return Ok(());
7308 }
7309
7310 let cur_offset: usize = (1 - 1) * envelope_size;
7313
7314 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7316
7317 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
7322 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
7323 encoder,
7324 offset + cur_offset,
7325 depth,
7326 )?;
7327
7328 _prev_end_offset = cur_offset + envelope_size;
7329 if 2 > max_ordinal {
7330 return Ok(());
7331 }
7332
7333 let cur_offset: usize = (2 - 1) * envelope_size;
7336
7337 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7339
7340 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
7345 self.progress
7346 .as_ref()
7347 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
7348 encoder,
7349 offset + cur_offset,
7350 depth,
7351 )?;
7352
7353 _prev_end_offset = cur_offset + envelope_size;
7354
7355 Ok(())
7356 }
7357 }
7358
7359 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StageData {
7360 #[inline(always)]
7361 fn new_empty() -> Self {
7362 Self::default()
7363 }
7364
7365 unsafe fn decode(
7366 &mut self,
7367 decoder: &mut fidl::encoding::Decoder<'_, D>,
7368 offset: usize,
7369 mut depth: fidl::encoding::Depth,
7370 ) -> fidl::Result<()> {
7371 decoder.debug_check_bounds::<Self>(offset);
7372 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7373 None => return Err(fidl::Error::NotNullable),
7374 Some(len) => len,
7375 };
7376 if len == 0 {
7378 return Ok(());
7379 };
7380 depth.increment()?;
7381 let envelope_size = 8;
7382 let bytes_len = len * envelope_size;
7383 let offset = decoder.out_of_line_offset(bytes_len)?;
7384 let mut _next_ordinal_to_read = 0;
7386 let mut next_offset = offset;
7387 let end_offset = offset + bytes_len;
7388 _next_ordinal_to_read += 1;
7389 if next_offset >= end_offset {
7390 return Ok(());
7391 }
7392
7393 while _next_ordinal_to_read < 1 {
7395 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7396 _next_ordinal_to_read += 1;
7397 next_offset += envelope_size;
7398 }
7399
7400 let next_out_of_line = decoder.next_out_of_line();
7401 let handles_before = decoder.remaining_handles();
7402 if let Some((inlined, num_bytes, num_handles)) =
7403 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7404 {
7405 let member_inline_size =
7406 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7407 if inlined != (member_inline_size <= 4) {
7408 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7409 }
7410 let inner_offset;
7411 let mut inner_depth = depth.clone();
7412 if inlined {
7413 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7414 inner_offset = next_offset;
7415 } else {
7416 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7417 inner_depth.increment()?;
7418 }
7419 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
7420 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
7421 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7422 {
7423 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7424 }
7425 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7426 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7427 }
7428 }
7429
7430 next_offset += envelope_size;
7431 _next_ordinal_to_read += 1;
7432 if next_offset >= end_offset {
7433 return Ok(());
7434 }
7435
7436 while _next_ordinal_to_read < 2 {
7438 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7439 _next_ordinal_to_read += 1;
7440 next_offset += envelope_size;
7441 }
7442
7443 let next_out_of_line = decoder.next_out_of_line();
7444 let handles_before = decoder.remaining_handles();
7445 if let Some((inlined, num_bytes, num_handles)) =
7446 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7447 {
7448 let member_inline_size =
7449 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
7450 decoder.context,
7451 );
7452 if inlined != (member_inline_size <= 4) {
7453 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7454 }
7455 let inner_offset;
7456 let mut inner_depth = depth.clone();
7457 if inlined {
7458 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7459 inner_offset = next_offset;
7460 } else {
7461 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7462 inner_depth.increment()?;
7463 }
7464 let val_ref =
7465 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
7466 fidl::decode!(
7467 InstallationProgress,
7468 D,
7469 val_ref,
7470 decoder,
7471 inner_offset,
7472 inner_depth
7473 )?;
7474 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7475 {
7476 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7477 }
7478 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7479 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7480 }
7481 }
7482
7483 next_offset += envelope_size;
7484
7485 while next_offset < end_offset {
7487 _next_ordinal_to_read += 1;
7488 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7489 next_offset += envelope_size;
7490 }
7491
7492 Ok(())
7493 }
7494 }
7495
7496 impl UpdateInfo {
7497 #[inline(always)]
7498 fn max_ordinal_present(&self) -> u64 {
7499 if let Some(_) = self.download_size {
7500 return 1;
7501 }
7502 0
7503 }
7504 }
7505
7506 impl fidl::encoding::ValueTypeMarker for UpdateInfo {
7507 type Borrowed<'a> = &'a Self;
7508 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7509 value
7510 }
7511 }
7512
7513 unsafe impl fidl::encoding::TypeMarker for UpdateInfo {
7514 type Owned = Self;
7515
7516 #[inline(always)]
7517 fn inline_align(_context: fidl::encoding::Context) -> usize {
7518 8
7519 }
7520
7521 #[inline(always)]
7522 fn inline_size(_context: fidl::encoding::Context) -> usize {
7523 16
7524 }
7525 }
7526
7527 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UpdateInfo, D>
7528 for &UpdateInfo
7529 {
7530 unsafe fn encode(
7531 self,
7532 encoder: &mut fidl::encoding::Encoder<'_, D>,
7533 offset: usize,
7534 mut depth: fidl::encoding::Depth,
7535 ) -> fidl::Result<()> {
7536 encoder.debug_check_bounds::<UpdateInfo>(offset);
7537 let max_ordinal: u64 = self.max_ordinal_present();
7539 encoder.write_num(max_ordinal, offset);
7540 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7541 if max_ordinal == 0 {
7543 return Ok(());
7544 }
7545 depth.increment()?;
7546 let envelope_size = 8;
7547 let bytes_len = max_ordinal as usize * envelope_size;
7548 #[allow(unused_variables)]
7549 let offset = encoder.out_of_line_offset(bytes_len);
7550 let mut _prev_end_offset: usize = 0;
7551 if 1 > max_ordinal {
7552 return Ok(());
7553 }
7554
7555 let cur_offset: usize = (1 - 1) * envelope_size;
7558
7559 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7561
7562 fidl::encoding::encode_in_envelope_optional::<u64, D>(
7567 self.download_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7568 encoder,
7569 offset + cur_offset,
7570 depth,
7571 )?;
7572
7573 _prev_end_offset = cur_offset + envelope_size;
7574
7575 Ok(())
7576 }
7577 }
7578
7579 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UpdateInfo {
7580 #[inline(always)]
7581 fn new_empty() -> Self {
7582 Self::default()
7583 }
7584
7585 unsafe fn decode(
7586 &mut self,
7587 decoder: &mut fidl::encoding::Decoder<'_, D>,
7588 offset: usize,
7589 mut depth: fidl::encoding::Depth,
7590 ) -> fidl::Result<()> {
7591 decoder.debug_check_bounds::<Self>(offset);
7592 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7593 None => return Err(fidl::Error::NotNullable),
7594 Some(len) => len,
7595 };
7596 if len == 0 {
7598 return Ok(());
7599 };
7600 depth.increment()?;
7601 let envelope_size = 8;
7602 let bytes_len = len * envelope_size;
7603 let offset = decoder.out_of_line_offset(bytes_len)?;
7604 let mut _next_ordinal_to_read = 0;
7606 let mut next_offset = offset;
7607 let end_offset = offset + bytes_len;
7608 _next_ordinal_to_read += 1;
7609 if next_offset >= end_offset {
7610 return Ok(());
7611 }
7612
7613 while _next_ordinal_to_read < 1 {
7615 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7616 _next_ordinal_to_read += 1;
7617 next_offset += envelope_size;
7618 }
7619
7620 let next_out_of_line = decoder.next_out_of_line();
7621 let handles_before = decoder.remaining_handles();
7622 if let Some((inlined, num_bytes, num_handles)) =
7623 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7624 {
7625 let member_inline_size =
7626 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7627 if inlined != (member_inline_size <= 4) {
7628 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7629 }
7630 let inner_offset;
7631 let mut inner_depth = depth.clone();
7632 if inlined {
7633 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7634 inner_offset = next_offset;
7635 } else {
7636 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7637 inner_depth.increment()?;
7638 }
7639 let val_ref = self.download_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
7640 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7641 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7642 {
7643 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7644 }
7645 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7646 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7647 }
7648 }
7649
7650 next_offset += envelope_size;
7651
7652 while next_offset < end_offset {
7654 _next_ordinal_to_read += 1;
7655 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7656 next_offset += envelope_size;
7657 }
7658
7659 Ok(())
7660 }
7661 }
7662
7663 impl WaitToRebootData {
7664 #[inline(always)]
7665 fn max_ordinal_present(&self) -> u64 {
7666 if let Some(_) = self.progress {
7667 return 2;
7668 }
7669 if let Some(_) = self.info {
7670 return 1;
7671 }
7672 0
7673 }
7674 }
7675
7676 impl fidl::encoding::ValueTypeMarker for WaitToRebootData {
7677 type Borrowed<'a> = &'a Self;
7678 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7679 value
7680 }
7681 }
7682
7683 unsafe impl fidl::encoding::TypeMarker for WaitToRebootData {
7684 type Owned = Self;
7685
7686 #[inline(always)]
7687 fn inline_align(_context: fidl::encoding::Context) -> usize {
7688 8
7689 }
7690
7691 #[inline(always)]
7692 fn inline_size(_context: fidl::encoding::Context) -> usize {
7693 16
7694 }
7695 }
7696
7697 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WaitToRebootData, D>
7698 for &WaitToRebootData
7699 {
7700 unsafe fn encode(
7701 self,
7702 encoder: &mut fidl::encoding::Encoder<'_, D>,
7703 offset: usize,
7704 mut depth: fidl::encoding::Depth,
7705 ) -> fidl::Result<()> {
7706 encoder.debug_check_bounds::<WaitToRebootData>(offset);
7707 let max_ordinal: u64 = self.max_ordinal_present();
7709 encoder.write_num(max_ordinal, offset);
7710 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7711 if max_ordinal == 0 {
7713 return Ok(());
7714 }
7715 depth.increment()?;
7716 let envelope_size = 8;
7717 let bytes_len = max_ordinal as usize * envelope_size;
7718 #[allow(unused_variables)]
7719 let offset = encoder.out_of_line_offset(bytes_len);
7720 let mut _prev_end_offset: usize = 0;
7721 if 1 > max_ordinal {
7722 return Ok(());
7723 }
7724
7725 let cur_offset: usize = (1 - 1) * envelope_size;
7728
7729 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7731
7732 fidl::encoding::encode_in_envelope_optional::<UpdateInfo, D>(
7737 self.info.as_ref().map(<UpdateInfo as fidl::encoding::ValueTypeMarker>::borrow),
7738 encoder,
7739 offset + cur_offset,
7740 depth,
7741 )?;
7742
7743 _prev_end_offset = cur_offset + envelope_size;
7744 if 2 > max_ordinal {
7745 return Ok(());
7746 }
7747
7748 let cur_offset: usize = (2 - 1) * envelope_size;
7751
7752 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7754
7755 fidl::encoding::encode_in_envelope_optional::<InstallationProgress, D>(
7760 self.progress
7761 .as_ref()
7762 .map(<InstallationProgress as fidl::encoding::ValueTypeMarker>::borrow),
7763 encoder,
7764 offset + cur_offset,
7765 depth,
7766 )?;
7767
7768 _prev_end_offset = cur_offset + envelope_size;
7769
7770 Ok(())
7771 }
7772 }
7773
7774 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WaitToRebootData {
7775 #[inline(always)]
7776 fn new_empty() -> Self {
7777 Self::default()
7778 }
7779
7780 unsafe fn decode(
7781 &mut self,
7782 decoder: &mut fidl::encoding::Decoder<'_, D>,
7783 offset: usize,
7784 mut depth: fidl::encoding::Depth,
7785 ) -> fidl::Result<()> {
7786 decoder.debug_check_bounds::<Self>(offset);
7787 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7788 None => return Err(fidl::Error::NotNullable),
7789 Some(len) => len,
7790 };
7791 if len == 0 {
7793 return Ok(());
7794 };
7795 depth.increment()?;
7796 let envelope_size = 8;
7797 let bytes_len = len * envelope_size;
7798 let offset = decoder.out_of_line_offset(bytes_len)?;
7799 let mut _next_ordinal_to_read = 0;
7801 let mut next_offset = offset;
7802 let end_offset = offset + bytes_len;
7803 _next_ordinal_to_read += 1;
7804 if next_offset >= end_offset {
7805 return Ok(());
7806 }
7807
7808 while _next_ordinal_to_read < 1 {
7810 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7811 _next_ordinal_to_read += 1;
7812 next_offset += envelope_size;
7813 }
7814
7815 let next_out_of_line = decoder.next_out_of_line();
7816 let handles_before = decoder.remaining_handles();
7817 if let Some((inlined, num_bytes, num_handles)) =
7818 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7819 {
7820 let member_inline_size =
7821 <UpdateInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7822 if inlined != (member_inline_size <= 4) {
7823 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7824 }
7825 let inner_offset;
7826 let mut inner_depth = depth.clone();
7827 if inlined {
7828 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7829 inner_offset = next_offset;
7830 } else {
7831 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7832 inner_depth.increment()?;
7833 }
7834 let val_ref = self.info.get_or_insert_with(|| fidl::new_empty!(UpdateInfo, D));
7835 fidl::decode!(UpdateInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
7836 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7837 {
7838 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7839 }
7840 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7841 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7842 }
7843 }
7844
7845 next_offset += envelope_size;
7846 _next_ordinal_to_read += 1;
7847 if next_offset >= end_offset {
7848 return Ok(());
7849 }
7850
7851 while _next_ordinal_to_read < 2 {
7853 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7854 _next_ordinal_to_read += 1;
7855 next_offset += envelope_size;
7856 }
7857
7858 let next_out_of_line = decoder.next_out_of_line();
7859 let handles_before = decoder.remaining_handles();
7860 if let Some((inlined, num_bytes, num_handles)) =
7861 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7862 {
7863 let member_inline_size =
7864 <InstallationProgress as fidl::encoding::TypeMarker>::inline_size(
7865 decoder.context,
7866 );
7867 if inlined != (member_inline_size <= 4) {
7868 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7869 }
7870 let inner_offset;
7871 let mut inner_depth = depth.clone();
7872 if inlined {
7873 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7874 inner_offset = next_offset;
7875 } else {
7876 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7877 inner_depth.increment()?;
7878 }
7879 let val_ref =
7880 self.progress.get_or_insert_with(|| fidl::new_empty!(InstallationProgress, D));
7881 fidl::decode!(
7882 InstallationProgress,
7883 D,
7884 val_ref,
7885 decoder,
7886 inner_offset,
7887 inner_depth
7888 )?;
7889 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7890 {
7891 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7892 }
7893 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7894 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7895 }
7896 }
7897
7898 next_offset += envelope_size;
7899
7900 while next_offset < end_offset {
7902 _next_ordinal_to_read += 1;
7903 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7904 next_offset += envelope_size;
7905 }
7906
7907 Ok(())
7908 }
7909 }
7910
7911 impl fidl::encoding::ValueTypeMarker for State {
7912 type Borrowed<'a> = &'a Self;
7913 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7914 value
7915 }
7916 }
7917
7918 unsafe impl fidl::encoding::TypeMarker for State {
7919 type Owned = Self;
7920
7921 #[inline(always)]
7922 fn inline_align(_context: fidl::encoding::Context) -> usize {
7923 8
7924 }
7925
7926 #[inline(always)]
7927 fn inline_size(_context: fidl::encoding::Context) -> usize {
7928 16
7929 }
7930 }
7931
7932 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<State, D> for &State {
7933 #[inline]
7934 unsafe fn encode(
7935 self,
7936 encoder: &mut fidl::encoding::Encoder<'_, D>,
7937 offset: usize,
7938 _depth: fidl::encoding::Depth,
7939 ) -> fidl::Result<()> {
7940 encoder.debug_check_bounds::<State>(offset);
7941 encoder.write_num::<u64>(self.ordinal(), offset);
7942 match self {
7943 State::Prepare(ref val) => fidl::encoding::encode_in_envelope::<PrepareData, D>(
7944 <PrepareData as fidl::encoding::ValueTypeMarker>::borrow(val),
7945 encoder,
7946 offset + 8,
7947 _depth,
7948 ),
7949 State::Stage(ref val) => fidl::encoding::encode_in_envelope::<StageData, D>(
7950 <StageData as fidl::encoding::ValueTypeMarker>::borrow(val),
7951 encoder,
7952 offset + 8,
7953 _depth,
7954 ),
7955 State::Fetch(ref val) => fidl::encoding::encode_in_envelope::<FetchData, D>(
7956 <FetchData as fidl::encoding::ValueTypeMarker>::borrow(val),
7957 encoder,
7958 offset + 8,
7959 _depth,
7960 ),
7961 State::Commit(ref val) => fidl::encoding::encode_in_envelope::<CommitData, D>(
7962 <CommitData as fidl::encoding::ValueTypeMarker>::borrow(val),
7963 encoder,
7964 offset + 8,
7965 _depth,
7966 ),
7967 State::WaitToReboot(ref val) => {
7968 fidl::encoding::encode_in_envelope::<WaitToRebootData, D>(
7969 <WaitToRebootData as fidl::encoding::ValueTypeMarker>::borrow(val),
7970 encoder,
7971 offset + 8,
7972 _depth,
7973 )
7974 }
7975 State::Reboot(ref val) => fidl::encoding::encode_in_envelope::<RebootData, D>(
7976 <RebootData as fidl::encoding::ValueTypeMarker>::borrow(val),
7977 encoder,
7978 offset + 8,
7979 _depth,
7980 ),
7981 State::DeferReboot(ref val) => {
7982 fidl::encoding::encode_in_envelope::<DeferRebootData, D>(
7983 <DeferRebootData as fidl::encoding::ValueTypeMarker>::borrow(val),
7984 encoder,
7985 offset + 8,
7986 _depth,
7987 )
7988 }
7989 State::Complete(ref val) => fidl::encoding::encode_in_envelope::<CompleteData, D>(
7990 <CompleteData as fidl::encoding::ValueTypeMarker>::borrow(val),
7991 encoder,
7992 offset + 8,
7993 _depth,
7994 ),
7995 State::FailPrepare(ref val) => {
7996 fidl::encoding::encode_in_envelope::<FailPrepareData, D>(
7997 <FailPrepareData as fidl::encoding::ValueTypeMarker>::borrow(val),
7998 encoder,
7999 offset + 8,
8000 _depth,
8001 )
8002 }
8003 State::FailStage(ref val) => {
8004 fidl::encoding::encode_in_envelope::<FailStageData, D>(
8005 <FailStageData as fidl::encoding::ValueTypeMarker>::borrow(val),
8006 encoder,
8007 offset + 8,
8008 _depth,
8009 )
8010 }
8011 State::FailFetch(ref val) => {
8012 fidl::encoding::encode_in_envelope::<FailFetchData, D>(
8013 <FailFetchData as fidl::encoding::ValueTypeMarker>::borrow(val),
8014 encoder,
8015 offset + 8,
8016 _depth,
8017 )
8018 }
8019 State::FailCommit(ref val) => {
8020 fidl::encoding::encode_in_envelope::<FailCommitData, D>(
8021 <FailCommitData as fidl::encoding::ValueTypeMarker>::borrow(val),
8022 encoder,
8023 offset + 8,
8024 _depth,
8025 )
8026 }
8027 State::Canceled(ref val) => fidl::encoding::encode_in_envelope::<CanceledData, D>(
8028 <CanceledData as fidl::encoding::ValueTypeMarker>::borrow(val),
8029 encoder,
8030 offset + 8,
8031 _depth,
8032 ),
8033 }
8034 }
8035 }
8036
8037 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for State {
8038 #[inline(always)]
8039 fn new_empty() -> Self {
8040 Self::Prepare(fidl::new_empty!(PrepareData, D))
8041 }
8042
8043 #[inline]
8044 unsafe fn decode(
8045 &mut self,
8046 decoder: &mut fidl::encoding::Decoder<'_, D>,
8047 offset: usize,
8048 mut depth: fidl::encoding::Depth,
8049 ) -> fidl::Result<()> {
8050 decoder.debug_check_bounds::<Self>(offset);
8051 #[allow(unused_variables)]
8052 let next_out_of_line = decoder.next_out_of_line();
8053 let handles_before = decoder.remaining_handles();
8054 let (ordinal, inlined, num_bytes, num_handles) =
8055 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8056
8057 let member_inline_size = match ordinal {
8058 1 => <PrepareData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8059 2 => <StageData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8060 3 => <FetchData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8061 4 => <CommitData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8062 5 => <WaitToRebootData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8063 6 => <RebootData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8064 7 => <DeferRebootData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8065 8 => <CompleteData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8066 9 => <FailPrepareData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8067 10 => <FailStageData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8068 11 => <FailFetchData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8069 12 => <FailCommitData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8070 13 => <CanceledData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8071 _ => return Err(fidl::Error::UnknownUnionTag),
8072 };
8073
8074 if inlined != (member_inline_size <= 4) {
8075 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8076 }
8077 let _inner_offset;
8078 if inlined {
8079 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8080 _inner_offset = offset + 8;
8081 } else {
8082 depth.increment()?;
8083 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8084 }
8085 match ordinal {
8086 1 => {
8087 #[allow(irrefutable_let_patterns)]
8088 if let State::Prepare(_) = self {
8089 } else {
8091 *self = State::Prepare(fidl::new_empty!(PrepareData, D));
8093 }
8094 #[allow(irrefutable_let_patterns)]
8095 if let State::Prepare(ref mut val) = self {
8096 fidl::decode!(PrepareData, D, val, decoder, _inner_offset, depth)?;
8097 } else {
8098 unreachable!()
8099 }
8100 }
8101 2 => {
8102 #[allow(irrefutable_let_patterns)]
8103 if let State::Stage(_) = self {
8104 } else {
8106 *self = State::Stage(fidl::new_empty!(StageData, D));
8108 }
8109 #[allow(irrefutable_let_patterns)]
8110 if let State::Stage(ref mut val) = self {
8111 fidl::decode!(StageData, D, val, decoder, _inner_offset, depth)?;
8112 } else {
8113 unreachable!()
8114 }
8115 }
8116 3 => {
8117 #[allow(irrefutable_let_patterns)]
8118 if let State::Fetch(_) = self {
8119 } else {
8121 *self = State::Fetch(fidl::new_empty!(FetchData, D));
8123 }
8124 #[allow(irrefutable_let_patterns)]
8125 if let State::Fetch(ref mut val) = self {
8126 fidl::decode!(FetchData, D, val, decoder, _inner_offset, depth)?;
8127 } else {
8128 unreachable!()
8129 }
8130 }
8131 4 => {
8132 #[allow(irrefutable_let_patterns)]
8133 if let State::Commit(_) = self {
8134 } else {
8136 *self = State::Commit(fidl::new_empty!(CommitData, D));
8138 }
8139 #[allow(irrefutable_let_patterns)]
8140 if let State::Commit(ref mut val) = self {
8141 fidl::decode!(CommitData, D, val, decoder, _inner_offset, depth)?;
8142 } else {
8143 unreachable!()
8144 }
8145 }
8146 5 => {
8147 #[allow(irrefutable_let_patterns)]
8148 if let State::WaitToReboot(_) = self {
8149 } else {
8151 *self = State::WaitToReboot(fidl::new_empty!(WaitToRebootData, D));
8153 }
8154 #[allow(irrefutable_let_patterns)]
8155 if let State::WaitToReboot(ref mut val) = self {
8156 fidl::decode!(WaitToRebootData, D, val, decoder, _inner_offset, depth)?;
8157 } else {
8158 unreachable!()
8159 }
8160 }
8161 6 => {
8162 #[allow(irrefutable_let_patterns)]
8163 if let State::Reboot(_) = self {
8164 } else {
8166 *self = State::Reboot(fidl::new_empty!(RebootData, D));
8168 }
8169 #[allow(irrefutable_let_patterns)]
8170 if let State::Reboot(ref mut val) = self {
8171 fidl::decode!(RebootData, D, val, decoder, _inner_offset, depth)?;
8172 } else {
8173 unreachable!()
8174 }
8175 }
8176 7 => {
8177 #[allow(irrefutable_let_patterns)]
8178 if let State::DeferReboot(_) = self {
8179 } else {
8181 *self = State::DeferReboot(fidl::new_empty!(DeferRebootData, D));
8183 }
8184 #[allow(irrefutable_let_patterns)]
8185 if let State::DeferReboot(ref mut val) = self {
8186 fidl::decode!(DeferRebootData, D, val, decoder, _inner_offset, depth)?;
8187 } else {
8188 unreachable!()
8189 }
8190 }
8191 8 => {
8192 #[allow(irrefutable_let_patterns)]
8193 if let State::Complete(_) = self {
8194 } else {
8196 *self = State::Complete(fidl::new_empty!(CompleteData, D));
8198 }
8199 #[allow(irrefutable_let_patterns)]
8200 if let State::Complete(ref mut val) = self {
8201 fidl::decode!(CompleteData, D, val, decoder, _inner_offset, depth)?;
8202 } else {
8203 unreachable!()
8204 }
8205 }
8206 9 => {
8207 #[allow(irrefutable_let_patterns)]
8208 if let State::FailPrepare(_) = self {
8209 } else {
8211 *self = State::FailPrepare(fidl::new_empty!(FailPrepareData, D));
8213 }
8214 #[allow(irrefutable_let_patterns)]
8215 if let State::FailPrepare(ref mut val) = self {
8216 fidl::decode!(FailPrepareData, D, val, decoder, _inner_offset, depth)?;
8217 } else {
8218 unreachable!()
8219 }
8220 }
8221 10 => {
8222 #[allow(irrefutable_let_patterns)]
8223 if let State::FailStage(_) = self {
8224 } else {
8226 *self = State::FailStage(fidl::new_empty!(FailStageData, D));
8228 }
8229 #[allow(irrefutable_let_patterns)]
8230 if let State::FailStage(ref mut val) = self {
8231 fidl::decode!(FailStageData, D, val, decoder, _inner_offset, depth)?;
8232 } else {
8233 unreachable!()
8234 }
8235 }
8236 11 => {
8237 #[allow(irrefutable_let_patterns)]
8238 if let State::FailFetch(_) = self {
8239 } else {
8241 *self = State::FailFetch(fidl::new_empty!(FailFetchData, D));
8243 }
8244 #[allow(irrefutable_let_patterns)]
8245 if let State::FailFetch(ref mut val) = self {
8246 fidl::decode!(FailFetchData, D, val, decoder, _inner_offset, depth)?;
8247 } else {
8248 unreachable!()
8249 }
8250 }
8251 12 => {
8252 #[allow(irrefutable_let_patterns)]
8253 if let State::FailCommit(_) = self {
8254 } else {
8256 *self = State::FailCommit(fidl::new_empty!(FailCommitData, D));
8258 }
8259 #[allow(irrefutable_let_patterns)]
8260 if let State::FailCommit(ref mut val) = self {
8261 fidl::decode!(FailCommitData, D, val, decoder, _inner_offset, depth)?;
8262 } else {
8263 unreachable!()
8264 }
8265 }
8266 13 => {
8267 #[allow(irrefutable_let_patterns)]
8268 if let State::Canceled(_) = self {
8269 } else {
8271 *self = State::Canceled(fidl::new_empty!(CanceledData, D));
8273 }
8274 #[allow(irrefutable_let_patterns)]
8275 if let State::Canceled(ref mut val) = self {
8276 fidl::decode!(CanceledData, D, val, decoder, _inner_offset, depth)?;
8277 } else {
8278 unreachable!()
8279 }
8280 }
8281 ordinal => panic!("unexpected ordinal {:?}", ordinal),
8282 }
8283 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8284 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8285 }
8286 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8287 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8288 }
8289 Ok(())
8290 }
8291 }
8292}