Skip to main content

fidl_fuchsia_paver/
fidl_fuchsia_paver.rs

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