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