Skip to main content

fidl_fuchsia_paver/
fidl_fuchsia_paver.rs

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