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