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