1#![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 _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14#[repr(C)]
15pub struct AdminGetDevicePathRequest {
16 pub fs_id: u64,
17}
18
19impl fidl::Persistable for AdminGetDevicePathRequest {}
20
21#[derive(Debug, PartialEq)]
22pub struct AdminMountRequest {
23 pub device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
24 pub name: String,
25 pub options: MountOptions,
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for AdminMountRequest {}
29
30#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31pub struct AdminStorageHostEnabledResponse {
32 pub enabled: bool,
33}
34
35impl fidl::Persistable for AdminStorageHostEnabledResponse {}
36
37#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
38pub struct AdminUnmountRequest {
39 pub name: String,
40}
41
42impl fidl::Persistable for AdminUnmountRequest {}
43
44#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
45pub struct AdminWipeStorageRequest {
46 pub blobfs_root: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
47 pub blob_creator: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>>,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for AdminWipeStorageRequest {}
51
52#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
53pub struct AdminWriteDataFileRequest {
54 pub filename: String,
55 pub payload: fidl::Vmo,
56}
57
58impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for AdminWriteDataFileRequest {}
59
60#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
61pub struct AdminGetDevicePathResponse {
62 pub path: String,
63}
64
65impl fidl::Persistable for AdminGetDevicePathResponse {}
66
67#[derive(Clone, Debug, PartialEq)]
68pub struct RecoveryInitSystemPartitionTableRequest {
69 pub partitions: Vec<fidl_fuchsia_storage_partitions::PartitionInfo>,
70}
71
72impl fidl::Persistable for RecoveryInitSystemPartitionTableRequest {}
73
74#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
75pub struct StarnixVolumeProviderMountRequest {
76 pub crypt: fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
77 pub exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
78}
79
80impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
81 for StarnixVolumeProviderMountRequest
82{
83}
84
85#[derive(Debug, Default, PartialEq)]
86pub struct MountOptions {
87 pub read_only: Option<bool>,
88 pub collect_metrics: Option<bool>,
90 pub verbose: Option<bool>,
91 pub write_compression_algorithm: Option<String>,
92 #[doc(hidden)]
93 pub __source_breaking: fidl::marker::SourceBreaking,
94}
95
96impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for MountOptions {}
97
98#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
99pub struct AdminMarker;
100
101impl fidl::endpoints::ProtocolMarker for AdminMarker {
102 type Proxy = AdminProxy;
103 type RequestStream = AdminRequestStream;
104 #[cfg(target_os = "fuchsia")]
105 type SynchronousProxy = AdminSynchronousProxy;
106
107 const DEBUG_NAME: &'static str = "fuchsia.fshost.Admin";
108}
109impl fidl::endpoints::DiscoverableProtocolMarker for AdminMarker {}
110pub type AdminMountResult = Result<(), i32>;
111pub type AdminUnmountResult = Result<(), i32>;
112pub type AdminGetDevicePathResult = Result<String, i32>;
113pub type AdminWriteDataFileResult = Result<(), i32>;
114pub type AdminWipeStorageResult = Result<(), i32>;
115pub type AdminShredDataVolumeResult = Result<(), i32>;
116
117pub trait AdminProxyInterface: Send + Sync {
118 type MountResponseFut: std::future::Future<Output = Result<AdminMountResult, fidl::Error>>
119 + Send;
120 fn r#mount(
121 &self,
122 device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
123 name: &str,
124 options: MountOptions,
125 ) -> Self::MountResponseFut;
126 type UnmountResponseFut: std::future::Future<Output = Result<AdminUnmountResult, fidl::Error>>
127 + Send;
128 fn r#unmount(&self, name: &str) -> Self::UnmountResponseFut;
129 type GetDevicePathResponseFut: std::future::Future<Output = Result<AdminGetDevicePathResult, fidl::Error>>
130 + Send;
131 fn r#get_device_path(&self, fs_id: u64) -> Self::GetDevicePathResponseFut;
132 type WriteDataFileResponseFut: std::future::Future<Output = Result<AdminWriteDataFileResult, fidl::Error>>
133 + Send;
134 fn r#write_data_file(
135 &self,
136 filename: &str,
137 payload: fidl::Vmo,
138 ) -> Self::WriteDataFileResponseFut;
139 type WipeStorageResponseFut: std::future::Future<Output = Result<AdminWipeStorageResult, fidl::Error>>
140 + Send;
141 fn r#wipe_storage(
142 &self,
143 blobfs_root: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
144 blob_creator: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>>,
145 ) -> Self::WipeStorageResponseFut;
146 type ShredDataVolumeResponseFut: std::future::Future<Output = Result<AdminShredDataVolumeResult, fidl::Error>>
147 + Send;
148 fn r#shred_data_volume(&self) -> Self::ShredDataVolumeResponseFut;
149 type StorageHostEnabledResponseFut: std::future::Future<Output = Result<bool, fidl::Error>>
150 + Send;
151 fn r#storage_host_enabled(&self) -> Self::StorageHostEnabledResponseFut;
152}
153#[derive(Debug)]
154#[cfg(target_os = "fuchsia")]
155pub struct AdminSynchronousProxy {
156 client: fidl::client::sync::Client,
157}
158
159#[cfg(target_os = "fuchsia")]
160impl fidl::endpoints::SynchronousProxy for AdminSynchronousProxy {
161 type Proxy = AdminProxy;
162 type Protocol = AdminMarker;
163
164 fn from_channel(inner: fidl::Channel) -> Self {
165 Self::new(inner)
166 }
167
168 fn into_channel(self) -> fidl::Channel {
169 self.client.into_channel()
170 }
171
172 fn as_channel(&self) -> &fidl::Channel {
173 self.client.as_channel()
174 }
175}
176
177#[cfg(target_os = "fuchsia")]
178impl AdminSynchronousProxy {
179 pub fn new(channel: fidl::Channel) -> Self {
180 let protocol_name = <AdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
181 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
182 }
183
184 pub fn into_channel(self) -> fidl::Channel {
185 self.client.into_channel()
186 }
187
188 pub fn wait_for_event(
191 &self,
192 deadline: zx::MonotonicInstant,
193 ) -> Result<AdminEvent, fidl::Error> {
194 AdminEvent::decode(self.client.wait_for_event(deadline)?)
195 }
196
197 pub fn r#mount(
201 &self,
202 mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
203 mut name: &str,
204 mut options: MountOptions,
205 ___deadline: zx::MonotonicInstant,
206 ) -> Result<AdminMountResult, fidl::Error> {
207 let _response = self.client.send_query::<
208 AdminMountRequest,
209 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
210 >(
211 (device, name, &mut options,),
212 0x16306ba03192ba46,
213 fidl::encoding::DynamicFlags::empty(),
214 ___deadline,
215 )?;
216 Ok(_response.map(|x| x))
217 }
218
219 pub fn r#unmount(
221 &self,
222 mut name: &str,
223 ___deadline: zx::MonotonicInstant,
224 ) -> Result<AdminUnmountResult, fidl::Error> {
225 let _response = self.client.send_query::<
226 AdminUnmountRequest,
227 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
228 >(
229 (name,),
230 0x18bd0292d4f70424,
231 fidl::encoding::DynamicFlags::empty(),
232 ___deadline,
233 )?;
234 Ok(_response.map(|x| x))
235 }
236
237 pub fn r#get_device_path(
239 &self,
240 mut fs_id: u64,
241 ___deadline: zx::MonotonicInstant,
242 ) -> Result<AdminGetDevicePathResult, fidl::Error> {
243 let _response = self.client.send_query::<
244 AdminGetDevicePathRequest,
245 fidl::encoding::ResultType<AdminGetDevicePathResponse, i32>,
246 >(
247 (fs_id,),
248 0x6540a2949ccc50e7,
249 fidl::encoding::DynamicFlags::empty(),
250 ___deadline,
251 )?;
252 Ok(_response.map(|x| x.path))
253 }
254
255 pub fn r#write_data_file(
261 &self,
262 mut filename: &str,
263 mut payload: fidl::Vmo,
264 ___deadline: zx::MonotonicInstant,
265 ) -> Result<AdminWriteDataFileResult, fidl::Error> {
266 let _response = self.client.send_query::<
267 AdminWriteDataFileRequest,
268 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
269 >(
270 (filename, payload,),
271 0x57d963b6bdc0c50e,
272 fidl::encoding::DynamicFlags::empty(),
273 ___deadline,
274 )?;
275 Ok(_response.map(|x| x))
276 }
277
278 pub fn r#wipe_storage(
298 &self,
299 mut blobfs_root: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
300 mut blob_creator: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>>,
301 ___deadline: zx::MonotonicInstant,
302 ) -> Result<AdminWipeStorageResult, fidl::Error> {
303 let _response = self.client.send_query::<
304 AdminWipeStorageRequest,
305 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
306 >(
307 (blobfs_root, blob_creator,),
308 0x7f135b6aabbc451b,
309 fidl::encoding::DynamicFlags::empty(),
310 ___deadline,
311 )?;
312 Ok(_response.map(|x| x))
313 }
314
315 pub fn r#shred_data_volume(
318 &self,
319 ___deadline: zx::MonotonicInstant,
320 ) -> Result<AdminShredDataVolumeResult, fidl::Error> {
321 let _response = self.client.send_query::<
322 fidl::encoding::EmptyPayload,
323 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
324 >(
325 (),
326 0xb0d6c2e95343a10,
327 fidl::encoding::DynamicFlags::empty(),
328 ___deadline,
329 )?;
330 Ok(_response.map(|x| x))
331 }
332
333 pub fn r#storage_host_enabled(
335 &self,
336 ___deadline: zx::MonotonicInstant,
337 ) -> Result<bool, fidl::Error> {
338 let _response = self
339 .client
340 .send_query::<fidl::encoding::EmptyPayload, AdminStorageHostEnabledResponse>(
341 (),
342 0x5934b6527ec49a35,
343 fidl::encoding::DynamicFlags::empty(),
344 ___deadline,
345 )?;
346 Ok(_response.enabled)
347 }
348}
349
350#[derive(Debug, Clone)]
351pub struct AdminProxy {
352 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
353}
354
355impl fidl::endpoints::Proxy for AdminProxy {
356 type Protocol = AdminMarker;
357
358 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
359 Self::new(inner)
360 }
361
362 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
363 self.client.into_channel().map_err(|client| Self { client })
364 }
365
366 fn as_channel(&self) -> &::fidl::AsyncChannel {
367 self.client.as_channel()
368 }
369}
370
371impl AdminProxy {
372 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
374 let protocol_name = <AdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
375 Self { client: fidl::client::Client::new(channel, protocol_name) }
376 }
377
378 pub fn take_event_stream(&self) -> AdminEventStream {
384 AdminEventStream { event_receiver: self.client.take_event_receiver() }
385 }
386
387 pub fn r#mount(
391 &self,
392 mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
393 mut name: &str,
394 mut options: MountOptions,
395 ) -> fidl::client::QueryResponseFut<
396 AdminMountResult,
397 fidl::encoding::DefaultFuchsiaResourceDialect,
398 > {
399 AdminProxyInterface::r#mount(self, device, name, options)
400 }
401
402 pub fn r#unmount(
404 &self,
405 mut name: &str,
406 ) -> fidl::client::QueryResponseFut<
407 AdminUnmountResult,
408 fidl::encoding::DefaultFuchsiaResourceDialect,
409 > {
410 AdminProxyInterface::r#unmount(self, name)
411 }
412
413 pub fn r#get_device_path(
415 &self,
416 mut fs_id: u64,
417 ) -> fidl::client::QueryResponseFut<
418 AdminGetDevicePathResult,
419 fidl::encoding::DefaultFuchsiaResourceDialect,
420 > {
421 AdminProxyInterface::r#get_device_path(self, fs_id)
422 }
423
424 pub fn r#write_data_file(
430 &self,
431 mut filename: &str,
432 mut payload: fidl::Vmo,
433 ) -> fidl::client::QueryResponseFut<
434 AdminWriteDataFileResult,
435 fidl::encoding::DefaultFuchsiaResourceDialect,
436 > {
437 AdminProxyInterface::r#write_data_file(self, filename, payload)
438 }
439
440 pub fn r#wipe_storage(
460 &self,
461 mut blobfs_root: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
462 mut blob_creator: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>>,
463 ) -> fidl::client::QueryResponseFut<
464 AdminWipeStorageResult,
465 fidl::encoding::DefaultFuchsiaResourceDialect,
466 > {
467 AdminProxyInterface::r#wipe_storage(self, blobfs_root, blob_creator)
468 }
469
470 pub fn r#shred_data_volume(
473 &self,
474 ) -> fidl::client::QueryResponseFut<
475 AdminShredDataVolumeResult,
476 fidl::encoding::DefaultFuchsiaResourceDialect,
477 > {
478 AdminProxyInterface::r#shred_data_volume(self)
479 }
480
481 pub fn r#storage_host_enabled(
483 &self,
484 ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
485 AdminProxyInterface::r#storage_host_enabled(self)
486 }
487}
488
489impl AdminProxyInterface for AdminProxy {
490 type MountResponseFut = fidl::client::QueryResponseFut<
491 AdminMountResult,
492 fidl::encoding::DefaultFuchsiaResourceDialect,
493 >;
494 fn r#mount(
495 &self,
496 mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
497 mut name: &str,
498 mut options: MountOptions,
499 ) -> Self::MountResponseFut {
500 fn _decode(
501 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
502 ) -> Result<AdminMountResult, fidl::Error> {
503 let _response = fidl::client::decode_transaction_body::<
504 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
505 fidl::encoding::DefaultFuchsiaResourceDialect,
506 0x16306ba03192ba46,
507 >(_buf?)?;
508 Ok(_response.map(|x| x))
509 }
510 self.client.send_query_and_decode::<AdminMountRequest, AdminMountResult>(
511 (device, name, &mut options),
512 0x16306ba03192ba46,
513 fidl::encoding::DynamicFlags::empty(),
514 _decode,
515 )
516 }
517
518 type UnmountResponseFut = fidl::client::QueryResponseFut<
519 AdminUnmountResult,
520 fidl::encoding::DefaultFuchsiaResourceDialect,
521 >;
522 fn r#unmount(&self, mut name: &str) -> Self::UnmountResponseFut {
523 fn _decode(
524 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
525 ) -> Result<AdminUnmountResult, fidl::Error> {
526 let _response = fidl::client::decode_transaction_body::<
527 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
528 fidl::encoding::DefaultFuchsiaResourceDialect,
529 0x18bd0292d4f70424,
530 >(_buf?)?;
531 Ok(_response.map(|x| x))
532 }
533 self.client.send_query_and_decode::<AdminUnmountRequest, AdminUnmountResult>(
534 (name,),
535 0x18bd0292d4f70424,
536 fidl::encoding::DynamicFlags::empty(),
537 _decode,
538 )
539 }
540
541 type GetDevicePathResponseFut = fidl::client::QueryResponseFut<
542 AdminGetDevicePathResult,
543 fidl::encoding::DefaultFuchsiaResourceDialect,
544 >;
545 fn r#get_device_path(&self, mut fs_id: u64) -> Self::GetDevicePathResponseFut {
546 fn _decode(
547 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
548 ) -> Result<AdminGetDevicePathResult, fidl::Error> {
549 let _response = fidl::client::decode_transaction_body::<
550 fidl::encoding::ResultType<AdminGetDevicePathResponse, i32>,
551 fidl::encoding::DefaultFuchsiaResourceDialect,
552 0x6540a2949ccc50e7,
553 >(_buf?)?;
554 Ok(_response.map(|x| x.path))
555 }
556 self.client.send_query_and_decode::<AdminGetDevicePathRequest, AdminGetDevicePathResult>(
557 (fs_id,),
558 0x6540a2949ccc50e7,
559 fidl::encoding::DynamicFlags::empty(),
560 _decode,
561 )
562 }
563
564 type WriteDataFileResponseFut = fidl::client::QueryResponseFut<
565 AdminWriteDataFileResult,
566 fidl::encoding::DefaultFuchsiaResourceDialect,
567 >;
568 fn r#write_data_file(
569 &self,
570 mut filename: &str,
571 mut payload: fidl::Vmo,
572 ) -> Self::WriteDataFileResponseFut {
573 fn _decode(
574 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
575 ) -> Result<AdminWriteDataFileResult, fidl::Error> {
576 let _response = fidl::client::decode_transaction_body::<
577 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
578 fidl::encoding::DefaultFuchsiaResourceDialect,
579 0x57d963b6bdc0c50e,
580 >(_buf?)?;
581 Ok(_response.map(|x| x))
582 }
583 self.client.send_query_and_decode::<AdminWriteDataFileRequest, AdminWriteDataFileResult>(
584 (filename, payload),
585 0x57d963b6bdc0c50e,
586 fidl::encoding::DynamicFlags::empty(),
587 _decode,
588 )
589 }
590
591 type WipeStorageResponseFut = fidl::client::QueryResponseFut<
592 AdminWipeStorageResult,
593 fidl::encoding::DefaultFuchsiaResourceDialect,
594 >;
595 fn r#wipe_storage(
596 &self,
597 mut blobfs_root: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
598 mut blob_creator: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>>,
599 ) -> Self::WipeStorageResponseFut {
600 fn _decode(
601 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
602 ) -> Result<AdminWipeStorageResult, fidl::Error> {
603 let _response = fidl::client::decode_transaction_body::<
604 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
605 fidl::encoding::DefaultFuchsiaResourceDialect,
606 0x7f135b6aabbc451b,
607 >(_buf?)?;
608 Ok(_response.map(|x| x))
609 }
610 self.client.send_query_and_decode::<AdminWipeStorageRequest, AdminWipeStorageResult>(
611 (blobfs_root, blob_creator),
612 0x7f135b6aabbc451b,
613 fidl::encoding::DynamicFlags::empty(),
614 _decode,
615 )
616 }
617
618 type ShredDataVolumeResponseFut = fidl::client::QueryResponseFut<
619 AdminShredDataVolumeResult,
620 fidl::encoding::DefaultFuchsiaResourceDialect,
621 >;
622 fn r#shred_data_volume(&self) -> Self::ShredDataVolumeResponseFut {
623 fn _decode(
624 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
625 ) -> Result<AdminShredDataVolumeResult, fidl::Error> {
626 let _response = fidl::client::decode_transaction_body::<
627 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
628 fidl::encoding::DefaultFuchsiaResourceDialect,
629 0xb0d6c2e95343a10,
630 >(_buf?)?;
631 Ok(_response.map(|x| x))
632 }
633 self.client
634 .send_query_and_decode::<fidl::encoding::EmptyPayload, AdminShredDataVolumeResult>(
635 (),
636 0xb0d6c2e95343a10,
637 fidl::encoding::DynamicFlags::empty(),
638 _decode,
639 )
640 }
641
642 type StorageHostEnabledResponseFut =
643 fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
644 fn r#storage_host_enabled(&self) -> Self::StorageHostEnabledResponseFut {
645 fn _decode(
646 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
647 ) -> Result<bool, fidl::Error> {
648 let _response = fidl::client::decode_transaction_body::<
649 AdminStorageHostEnabledResponse,
650 fidl::encoding::DefaultFuchsiaResourceDialect,
651 0x5934b6527ec49a35,
652 >(_buf?)?;
653 Ok(_response.enabled)
654 }
655 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
656 (),
657 0x5934b6527ec49a35,
658 fidl::encoding::DynamicFlags::empty(),
659 _decode,
660 )
661 }
662}
663
664pub struct AdminEventStream {
665 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
666}
667
668impl std::marker::Unpin for AdminEventStream {}
669
670impl futures::stream::FusedStream for AdminEventStream {
671 fn is_terminated(&self) -> bool {
672 self.event_receiver.is_terminated()
673 }
674}
675
676impl futures::Stream for AdminEventStream {
677 type Item = Result<AdminEvent, fidl::Error>;
678
679 fn poll_next(
680 mut self: std::pin::Pin<&mut Self>,
681 cx: &mut std::task::Context<'_>,
682 ) -> std::task::Poll<Option<Self::Item>> {
683 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
684 &mut self.event_receiver,
685 cx
686 )?) {
687 Some(buf) => std::task::Poll::Ready(Some(AdminEvent::decode(buf))),
688 None => std::task::Poll::Ready(None),
689 }
690 }
691}
692
693#[derive(Debug)]
694pub enum AdminEvent {}
695
696impl AdminEvent {
697 fn decode(
699 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
700 ) -> Result<AdminEvent, fidl::Error> {
701 let (bytes, _handles) = buf.split_mut();
702 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
703 debug_assert_eq!(tx_header.tx_id, 0);
704 match tx_header.ordinal {
705 _ => Err(fidl::Error::UnknownOrdinal {
706 ordinal: tx_header.ordinal,
707 protocol_name: <AdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
708 }),
709 }
710 }
711}
712
713pub struct AdminRequestStream {
715 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
716 is_terminated: bool,
717}
718
719impl std::marker::Unpin for AdminRequestStream {}
720
721impl futures::stream::FusedStream for AdminRequestStream {
722 fn is_terminated(&self) -> bool {
723 self.is_terminated
724 }
725}
726
727impl fidl::endpoints::RequestStream for AdminRequestStream {
728 type Protocol = AdminMarker;
729 type ControlHandle = AdminControlHandle;
730
731 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
732 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
733 }
734
735 fn control_handle(&self) -> Self::ControlHandle {
736 AdminControlHandle { inner: self.inner.clone() }
737 }
738
739 fn into_inner(
740 self,
741 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
742 {
743 (self.inner, self.is_terminated)
744 }
745
746 fn from_inner(
747 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
748 is_terminated: bool,
749 ) -> Self {
750 Self { inner, is_terminated }
751 }
752}
753
754impl futures::Stream for AdminRequestStream {
755 type Item = Result<AdminRequest, fidl::Error>;
756
757 fn poll_next(
758 mut self: std::pin::Pin<&mut Self>,
759 cx: &mut std::task::Context<'_>,
760 ) -> std::task::Poll<Option<Self::Item>> {
761 let this = &mut *self;
762 if this.inner.check_shutdown(cx) {
763 this.is_terminated = true;
764 return std::task::Poll::Ready(None);
765 }
766 if this.is_terminated {
767 panic!("polled AdminRequestStream after completion");
768 }
769 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
770 |bytes, handles| {
771 match this.inner.channel().read_etc(cx, bytes, handles) {
772 std::task::Poll::Ready(Ok(())) => {}
773 std::task::Poll::Pending => return std::task::Poll::Pending,
774 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
775 this.is_terminated = true;
776 return std::task::Poll::Ready(None);
777 }
778 std::task::Poll::Ready(Err(e)) => {
779 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
780 e.into(),
781 ))))
782 }
783 }
784
785 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
787
788 std::task::Poll::Ready(Some(match header.ordinal {
789 0x16306ba03192ba46 => {
790 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
791 let mut req = fidl::new_empty!(
792 AdminMountRequest,
793 fidl::encoding::DefaultFuchsiaResourceDialect
794 );
795 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdminMountRequest>(&header, _body_bytes, handles, &mut req)?;
796 let control_handle = AdminControlHandle { inner: this.inner.clone() };
797 Ok(AdminRequest::Mount {
798 device: req.device,
799 name: req.name,
800 options: req.options,
801
802 responder: AdminMountResponder {
803 control_handle: std::mem::ManuallyDrop::new(control_handle),
804 tx_id: header.tx_id,
805 },
806 })
807 }
808 0x18bd0292d4f70424 => {
809 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
810 let mut req = fidl::new_empty!(
811 AdminUnmountRequest,
812 fidl::encoding::DefaultFuchsiaResourceDialect
813 );
814 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdminUnmountRequest>(&header, _body_bytes, handles, &mut req)?;
815 let control_handle = AdminControlHandle { inner: this.inner.clone() };
816 Ok(AdminRequest::Unmount {
817 name: req.name,
818
819 responder: AdminUnmountResponder {
820 control_handle: std::mem::ManuallyDrop::new(control_handle),
821 tx_id: header.tx_id,
822 },
823 })
824 }
825 0x6540a2949ccc50e7 => {
826 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
827 let mut req = fidl::new_empty!(
828 AdminGetDevicePathRequest,
829 fidl::encoding::DefaultFuchsiaResourceDialect
830 );
831 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdminGetDevicePathRequest>(&header, _body_bytes, handles, &mut req)?;
832 let control_handle = AdminControlHandle { inner: this.inner.clone() };
833 Ok(AdminRequest::GetDevicePath {
834 fs_id: req.fs_id,
835
836 responder: AdminGetDevicePathResponder {
837 control_handle: std::mem::ManuallyDrop::new(control_handle),
838 tx_id: header.tx_id,
839 },
840 })
841 }
842 0x57d963b6bdc0c50e => {
843 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
844 let mut req = fidl::new_empty!(
845 AdminWriteDataFileRequest,
846 fidl::encoding::DefaultFuchsiaResourceDialect
847 );
848 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdminWriteDataFileRequest>(&header, _body_bytes, handles, &mut req)?;
849 let control_handle = AdminControlHandle { inner: this.inner.clone() };
850 Ok(AdminRequest::WriteDataFile {
851 filename: req.filename,
852 payload: req.payload,
853
854 responder: AdminWriteDataFileResponder {
855 control_handle: std::mem::ManuallyDrop::new(control_handle),
856 tx_id: header.tx_id,
857 },
858 })
859 }
860 0x7f135b6aabbc451b => {
861 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
862 let mut req = fidl::new_empty!(
863 AdminWipeStorageRequest,
864 fidl::encoding::DefaultFuchsiaResourceDialect
865 );
866 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdminWipeStorageRequest>(&header, _body_bytes, handles, &mut req)?;
867 let control_handle = AdminControlHandle { inner: this.inner.clone() };
868 Ok(AdminRequest::WipeStorage {
869 blobfs_root: req.blobfs_root,
870 blob_creator: req.blob_creator,
871
872 responder: AdminWipeStorageResponder {
873 control_handle: std::mem::ManuallyDrop::new(control_handle),
874 tx_id: header.tx_id,
875 },
876 })
877 }
878 0xb0d6c2e95343a10 => {
879 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
880 let mut req = fidl::new_empty!(
881 fidl::encoding::EmptyPayload,
882 fidl::encoding::DefaultFuchsiaResourceDialect
883 );
884 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
885 let control_handle = AdminControlHandle { inner: this.inner.clone() };
886 Ok(AdminRequest::ShredDataVolume {
887 responder: AdminShredDataVolumeResponder {
888 control_handle: std::mem::ManuallyDrop::new(control_handle),
889 tx_id: header.tx_id,
890 },
891 })
892 }
893 0x5934b6527ec49a35 => {
894 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
895 let mut req = fidl::new_empty!(
896 fidl::encoding::EmptyPayload,
897 fidl::encoding::DefaultFuchsiaResourceDialect
898 );
899 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
900 let control_handle = AdminControlHandle { inner: this.inner.clone() };
901 Ok(AdminRequest::StorageHostEnabled {
902 responder: AdminStorageHostEnabledResponder {
903 control_handle: std::mem::ManuallyDrop::new(control_handle),
904 tx_id: header.tx_id,
905 },
906 })
907 }
908 _ => Err(fidl::Error::UnknownOrdinal {
909 ordinal: header.ordinal,
910 protocol_name: <AdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
911 }),
912 }))
913 },
914 )
915 }
916}
917
918#[derive(Debug)]
920pub enum AdminRequest {
921 Mount {
925 device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
926 name: String,
927 options: MountOptions,
928 responder: AdminMountResponder,
929 },
930 Unmount { name: String, responder: AdminUnmountResponder },
932 GetDevicePath { fs_id: u64, responder: AdminGetDevicePathResponder },
934 WriteDataFile { filename: String, payload: fidl::Vmo, responder: AdminWriteDataFileResponder },
940 WipeStorage {
960 blobfs_root: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
961 blob_creator: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>>,
962 responder: AdminWipeStorageResponder,
963 },
964 ShredDataVolume { responder: AdminShredDataVolumeResponder },
967 StorageHostEnabled { responder: AdminStorageHostEnabledResponder },
969}
970
971impl AdminRequest {
972 #[allow(irrefutable_let_patterns)]
973 pub fn into_mount(
974 self,
975 ) -> Option<(
976 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
977 String,
978 MountOptions,
979 AdminMountResponder,
980 )> {
981 if let AdminRequest::Mount { device, name, options, responder } = self {
982 Some((device, name, options, responder))
983 } else {
984 None
985 }
986 }
987
988 #[allow(irrefutable_let_patterns)]
989 pub fn into_unmount(self) -> Option<(String, AdminUnmountResponder)> {
990 if let AdminRequest::Unmount { name, responder } = self {
991 Some((name, responder))
992 } else {
993 None
994 }
995 }
996
997 #[allow(irrefutable_let_patterns)]
998 pub fn into_get_device_path(self) -> Option<(u64, AdminGetDevicePathResponder)> {
999 if let AdminRequest::GetDevicePath { fs_id, responder } = self {
1000 Some((fs_id, responder))
1001 } else {
1002 None
1003 }
1004 }
1005
1006 #[allow(irrefutable_let_patterns)]
1007 pub fn into_write_data_file(self) -> Option<(String, fidl::Vmo, AdminWriteDataFileResponder)> {
1008 if let AdminRequest::WriteDataFile { filename, payload, responder } = self {
1009 Some((filename, payload, responder))
1010 } else {
1011 None
1012 }
1013 }
1014
1015 #[allow(irrefutable_let_patterns)]
1016 pub fn into_wipe_storage(
1017 self,
1018 ) -> Option<(
1019 Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
1020 Option<fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>>,
1021 AdminWipeStorageResponder,
1022 )> {
1023 if let AdminRequest::WipeStorage { blobfs_root, blob_creator, responder } = self {
1024 Some((blobfs_root, blob_creator, responder))
1025 } else {
1026 None
1027 }
1028 }
1029
1030 #[allow(irrefutable_let_patterns)]
1031 pub fn into_shred_data_volume(self) -> Option<(AdminShredDataVolumeResponder)> {
1032 if let AdminRequest::ShredDataVolume { responder } = self {
1033 Some((responder))
1034 } else {
1035 None
1036 }
1037 }
1038
1039 #[allow(irrefutable_let_patterns)]
1040 pub fn into_storage_host_enabled(self) -> Option<(AdminStorageHostEnabledResponder)> {
1041 if let AdminRequest::StorageHostEnabled { responder } = self {
1042 Some((responder))
1043 } else {
1044 None
1045 }
1046 }
1047
1048 pub fn method_name(&self) -> &'static str {
1050 match *self {
1051 AdminRequest::Mount { .. } => "mount",
1052 AdminRequest::Unmount { .. } => "unmount",
1053 AdminRequest::GetDevicePath { .. } => "get_device_path",
1054 AdminRequest::WriteDataFile { .. } => "write_data_file",
1055 AdminRequest::WipeStorage { .. } => "wipe_storage",
1056 AdminRequest::ShredDataVolume { .. } => "shred_data_volume",
1057 AdminRequest::StorageHostEnabled { .. } => "storage_host_enabled",
1058 }
1059 }
1060}
1061
1062#[derive(Debug, Clone)]
1063pub struct AdminControlHandle {
1064 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1065}
1066
1067impl fidl::endpoints::ControlHandle for AdminControlHandle {
1068 fn shutdown(&self) {
1069 self.inner.shutdown()
1070 }
1071 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1072 self.inner.shutdown_with_epitaph(status)
1073 }
1074
1075 fn is_closed(&self) -> bool {
1076 self.inner.channel().is_closed()
1077 }
1078 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1079 self.inner.channel().on_closed()
1080 }
1081
1082 #[cfg(target_os = "fuchsia")]
1083 fn signal_peer(
1084 &self,
1085 clear_mask: zx::Signals,
1086 set_mask: zx::Signals,
1087 ) -> Result<(), zx_status::Status> {
1088 use fidl::Peered;
1089 self.inner.channel().signal_peer(clear_mask, set_mask)
1090 }
1091}
1092
1093impl AdminControlHandle {}
1094
1095#[must_use = "FIDL methods require a response to be sent"]
1096#[derive(Debug)]
1097pub struct AdminMountResponder {
1098 control_handle: std::mem::ManuallyDrop<AdminControlHandle>,
1099 tx_id: u32,
1100}
1101
1102impl std::ops::Drop for AdminMountResponder {
1106 fn drop(&mut self) {
1107 self.control_handle.shutdown();
1108 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1110 }
1111}
1112
1113impl fidl::endpoints::Responder for AdminMountResponder {
1114 type ControlHandle = AdminControlHandle;
1115
1116 fn control_handle(&self) -> &AdminControlHandle {
1117 &self.control_handle
1118 }
1119
1120 fn drop_without_shutdown(mut self) {
1121 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1123 std::mem::forget(self);
1125 }
1126}
1127
1128impl AdminMountResponder {
1129 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1133 let _result = self.send_raw(result);
1134 if _result.is_err() {
1135 self.control_handle.shutdown();
1136 }
1137 self.drop_without_shutdown();
1138 _result
1139 }
1140
1141 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1143 let _result = self.send_raw(result);
1144 self.drop_without_shutdown();
1145 _result
1146 }
1147
1148 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1149 self.control_handle
1150 .inner
1151 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1152 result,
1153 self.tx_id,
1154 0x16306ba03192ba46,
1155 fidl::encoding::DynamicFlags::empty(),
1156 )
1157 }
1158}
1159
1160#[must_use = "FIDL methods require a response to be sent"]
1161#[derive(Debug)]
1162pub struct AdminUnmountResponder {
1163 control_handle: std::mem::ManuallyDrop<AdminControlHandle>,
1164 tx_id: u32,
1165}
1166
1167impl std::ops::Drop for AdminUnmountResponder {
1171 fn drop(&mut self) {
1172 self.control_handle.shutdown();
1173 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1175 }
1176}
1177
1178impl fidl::endpoints::Responder for AdminUnmountResponder {
1179 type ControlHandle = AdminControlHandle;
1180
1181 fn control_handle(&self) -> &AdminControlHandle {
1182 &self.control_handle
1183 }
1184
1185 fn drop_without_shutdown(mut self) {
1186 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1188 std::mem::forget(self);
1190 }
1191}
1192
1193impl AdminUnmountResponder {
1194 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1198 let _result = self.send_raw(result);
1199 if _result.is_err() {
1200 self.control_handle.shutdown();
1201 }
1202 self.drop_without_shutdown();
1203 _result
1204 }
1205
1206 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1208 let _result = self.send_raw(result);
1209 self.drop_without_shutdown();
1210 _result
1211 }
1212
1213 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1214 self.control_handle
1215 .inner
1216 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1217 result,
1218 self.tx_id,
1219 0x18bd0292d4f70424,
1220 fidl::encoding::DynamicFlags::empty(),
1221 )
1222 }
1223}
1224
1225#[must_use = "FIDL methods require a response to be sent"]
1226#[derive(Debug)]
1227pub struct AdminGetDevicePathResponder {
1228 control_handle: std::mem::ManuallyDrop<AdminControlHandle>,
1229 tx_id: u32,
1230}
1231
1232impl std::ops::Drop for AdminGetDevicePathResponder {
1236 fn drop(&mut self) {
1237 self.control_handle.shutdown();
1238 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1240 }
1241}
1242
1243impl fidl::endpoints::Responder for AdminGetDevicePathResponder {
1244 type ControlHandle = AdminControlHandle;
1245
1246 fn control_handle(&self) -> &AdminControlHandle {
1247 &self.control_handle
1248 }
1249
1250 fn drop_without_shutdown(mut self) {
1251 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1253 std::mem::forget(self);
1255 }
1256}
1257
1258impl AdminGetDevicePathResponder {
1259 pub fn send(self, mut result: Result<&str, i32>) -> Result<(), fidl::Error> {
1263 let _result = self.send_raw(result);
1264 if _result.is_err() {
1265 self.control_handle.shutdown();
1266 }
1267 self.drop_without_shutdown();
1268 _result
1269 }
1270
1271 pub fn send_no_shutdown_on_err(self, mut result: Result<&str, i32>) -> Result<(), fidl::Error> {
1273 let _result = self.send_raw(result);
1274 self.drop_without_shutdown();
1275 _result
1276 }
1277
1278 fn send_raw(&self, mut result: Result<&str, i32>) -> Result<(), fidl::Error> {
1279 self.control_handle
1280 .inner
1281 .send::<fidl::encoding::ResultType<AdminGetDevicePathResponse, i32>>(
1282 result.map(|path| (path,)),
1283 self.tx_id,
1284 0x6540a2949ccc50e7,
1285 fidl::encoding::DynamicFlags::empty(),
1286 )
1287 }
1288}
1289
1290#[must_use = "FIDL methods require a response to be sent"]
1291#[derive(Debug)]
1292pub struct AdminWriteDataFileResponder {
1293 control_handle: std::mem::ManuallyDrop<AdminControlHandle>,
1294 tx_id: u32,
1295}
1296
1297impl std::ops::Drop for AdminWriteDataFileResponder {
1301 fn drop(&mut self) {
1302 self.control_handle.shutdown();
1303 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1305 }
1306}
1307
1308impl fidl::endpoints::Responder for AdminWriteDataFileResponder {
1309 type ControlHandle = AdminControlHandle;
1310
1311 fn control_handle(&self) -> &AdminControlHandle {
1312 &self.control_handle
1313 }
1314
1315 fn drop_without_shutdown(mut self) {
1316 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1318 std::mem::forget(self);
1320 }
1321}
1322
1323impl AdminWriteDataFileResponder {
1324 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1328 let _result = self.send_raw(result);
1329 if _result.is_err() {
1330 self.control_handle.shutdown();
1331 }
1332 self.drop_without_shutdown();
1333 _result
1334 }
1335
1336 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1338 let _result = self.send_raw(result);
1339 self.drop_without_shutdown();
1340 _result
1341 }
1342
1343 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1344 self.control_handle
1345 .inner
1346 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1347 result,
1348 self.tx_id,
1349 0x57d963b6bdc0c50e,
1350 fidl::encoding::DynamicFlags::empty(),
1351 )
1352 }
1353}
1354
1355#[must_use = "FIDL methods require a response to be sent"]
1356#[derive(Debug)]
1357pub struct AdminWipeStorageResponder {
1358 control_handle: std::mem::ManuallyDrop<AdminControlHandle>,
1359 tx_id: u32,
1360}
1361
1362impl std::ops::Drop for AdminWipeStorageResponder {
1366 fn drop(&mut self) {
1367 self.control_handle.shutdown();
1368 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1370 }
1371}
1372
1373impl fidl::endpoints::Responder for AdminWipeStorageResponder {
1374 type ControlHandle = AdminControlHandle;
1375
1376 fn control_handle(&self) -> &AdminControlHandle {
1377 &self.control_handle
1378 }
1379
1380 fn drop_without_shutdown(mut self) {
1381 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1383 std::mem::forget(self);
1385 }
1386}
1387
1388impl AdminWipeStorageResponder {
1389 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1393 let _result = self.send_raw(result);
1394 if _result.is_err() {
1395 self.control_handle.shutdown();
1396 }
1397 self.drop_without_shutdown();
1398 _result
1399 }
1400
1401 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1403 let _result = self.send_raw(result);
1404 self.drop_without_shutdown();
1405 _result
1406 }
1407
1408 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1409 self.control_handle
1410 .inner
1411 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1412 result,
1413 self.tx_id,
1414 0x7f135b6aabbc451b,
1415 fidl::encoding::DynamicFlags::empty(),
1416 )
1417 }
1418}
1419
1420#[must_use = "FIDL methods require a response to be sent"]
1421#[derive(Debug)]
1422pub struct AdminShredDataVolumeResponder {
1423 control_handle: std::mem::ManuallyDrop<AdminControlHandle>,
1424 tx_id: u32,
1425}
1426
1427impl std::ops::Drop for AdminShredDataVolumeResponder {
1431 fn drop(&mut self) {
1432 self.control_handle.shutdown();
1433 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1435 }
1436}
1437
1438impl fidl::endpoints::Responder for AdminShredDataVolumeResponder {
1439 type ControlHandle = AdminControlHandle;
1440
1441 fn control_handle(&self) -> &AdminControlHandle {
1442 &self.control_handle
1443 }
1444
1445 fn drop_without_shutdown(mut self) {
1446 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1448 std::mem::forget(self);
1450 }
1451}
1452
1453impl AdminShredDataVolumeResponder {
1454 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1458 let _result = self.send_raw(result);
1459 if _result.is_err() {
1460 self.control_handle.shutdown();
1461 }
1462 self.drop_without_shutdown();
1463 _result
1464 }
1465
1466 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1468 let _result = self.send_raw(result);
1469 self.drop_without_shutdown();
1470 _result
1471 }
1472
1473 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1474 self.control_handle
1475 .inner
1476 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1477 result,
1478 self.tx_id,
1479 0xb0d6c2e95343a10,
1480 fidl::encoding::DynamicFlags::empty(),
1481 )
1482 }
1483}
1484
1485#[must_use = "FIDL methods require a response to be sent"]
1486#[derive(Debug)]
1487pub struct AdminStorageHostEnabledResponder {
1488 control_handle: std::mem::ManuallyDrop<AdminControlHandle>,
1489 tx_id: u32,
1490}
1491
1492impl std::ops::Drop for AdminStorageHostEnabledResponder {
1496 fn drop(&mut self) {
1497 self.control_handle.shutdown();
1498 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1500 }
1501}
1502
1503impl fidl::endpoints::Responder for AdminStorageHostEnabledResponder {
1504 type ControlHandle = AdminControlHandle;
1505
1506 fn control_handle(&self) -> &AdminControlHandle {
1507 &self.control_handle
1508 }
1509
1510 fn drop_without_shutdown(mut self) {
1511 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1513 std::mem::forget(self);
1515 }
1516}
1517
1518impl AdminStorageHostEnabledResponder {
1519 pub fn send(self, mut enabled: bool) -> Result<(), fidl::Error> {
1523 let _result = self.send_raw(enabled);
1524 if _result.is_err() {
1525 self.control_handle.shutdown();
1526 }
1527 self.drop_without_shutdown();
1528 _result
1529 }
1530
1531 pub fn send_no_shutdown_on_err(self, mut enabled: bool) -> Result<(), fidl::Error> {
1533 let _result = self.send_raw(enabled);
1534 self.drop_without_shutdown();
1535 _result
1536 }
1537
1538 fn send_raw(&self, mut enabled: bool) -> Result<(), fidl::Error> {
1539 self.control_handle.inner.send::<AdminStorageHostEnabledResponse>(
1540 (enabled,),
1541 self.tx_id,
1542 0x5934b6527ec49a35,
1543 fidl::encoding::DynamicFlags::empty(),
1544 )
1545 }
1546}
1547
1548#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1549pub struct RecoveryMarker;
1550
1551impl fidl::endpoints::ProtocolMarker for RecoveryMarker {
1552 type Proxy = RecoveryProxy;
1553 type RequestStream = RecoveryRequestStream;
1554 #[cfg(target_os = "fuchsia")]
1555 type SynchronousProxy = RecoverySynchronousProxy;
1556
1557 const DEBUG_NAME: &'static str = "fuchsia.fshost.Recovery";
1558}
1559impl fidl::endpoints::DiscoverableProtocolMarker for RecoveryMarker {}
1560pub type RecoveryInitSystemPartitionTableResult = Result<(), i32>;
1561
1562pub trait RecoveryProxyInterface: Send + Sync {
1563 type InitSystemPartitionTableResponseFut: std::future::Future<Output = Result<RecoveryInitSystemPartitionTableResult, fidl::Error>>
1564 + Send;
1565 fn r#init_system_partition_table(
1566 &self,
1567 partitions: &[fidl_fuchsia_storage_partitions::PartitionInfo],
1568 ) -> Self::InitSystemPartitionTableResponseFut;
1569}
1570#[derive(Debug)]
1571#[cfg(target_os = "fuchsia")]
1572pub struct RecoverySynchronousProxy {
1573 client: fidl::client::sync::Client,
1574}
1575
1576#[cfg(target_os = "fuchsia")]
1577impl fidl::endpoints::SynchronousProxy for RecoverySynchronousProxy {
1578 type Proxy = RecoveryProxy;
1579 type Protocol = RecoveryMarker;
1580
1581 fn from_channel(inner: fidl::Channel) -> Self {
1582 Self::new(inner)
1583 }
1584
1585 fn into_channel(self) -> fidl::Channel {
1586 self.client.into_channel()
1587 }
1588
1589 fn as_channel(&self) -> &fidl::Channel {
1590 self.client.as_channel()
1591 }
1592}
1593
1594#[cfg(target_os = "fuchsia")]
1595impl RecoverySynchronousProxy {
1596 pub fn new(channel: fidl::Channel) -> Self {
1597 let protocol_name = <RecoveryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1598 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1599 }
1600
1601 pub fn into_channel(self) -> fidl::Channel {
1602 self.client.into_channel()
1603 }
1604
1605 pub fn wait_for_event(
1608 &self,
1609 deadline: zx::MonotonicInstant,
1610 ) -> Result<RecoveryEvent, fidl::Error> {
1611 RecoveryEvent::decode(self.client.wait_for_event(deadline)?)
1612 }
1613
1614 pub fn r#init_system_partition_table(
1616 &self,
1617 mut partitions: &[fidl_fuchsia_storage_partitions::PartitionInfo],
1618 ___deadline: zx::MonotonicInstant,
1619 ) -> Result<RecoveryInitSystemPartitionTableResult, fidl::Error> {
1620 let _response = self.client.send_query::<
1621 RecoveryInitSystemPartitionTableRequest,
1622 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1623 >(
1624 (partitions,),
1625 0x3dcadcbb75e2330b,
1626 fidl::encoding::DynamicFlags::empty(),
1627 ___deadline,
1628 )?;
1629 Ok(_response.map(|x| x))
1630 }
1631}
1632
1633#[derive(Debug, Clone)]
1634pub struct RecoveryProxy {
1635 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1636}
1637
1638impl fidl::endpoints::Proxy for RecoveryProxy {
1639 type Protocol = RecoveryMarker;
1640
1641 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1642 Self::new(inner)
1643 }
1644
1645 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1646 self.client.into_channel().map_err(|client| Self { client })
1647 }
1648
1649 fn as_channel(&self) -> &::fidl::AsyncChannel {
1650 self.client.as_channel()
1651 }
1652}
1653
1654impl RecoveryProxy {
1655 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1657 let protocol_name = <RecoveryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1658 Self { client: fidl::client::Client::new(channel, protocol_name) }
1659 }
1660
1661 pub fn take_event_stream(&self) -> RecoveryEventStream {
1667 RecoveryEventStream { event_receiver: self.client.take_event_receiver() }
1668 }
1669
1670 pub fn r#init_system_partition_table(
1672 &self,
1673 mut partitions: &[fidl_fuchsia_storage_partitions::PartitionInfo],
1674 ) -> fidl::client::QueryResponseFut<
1675 RecoveryInitSystemPartitionTableResult,
1676 fidl::encoding::DefaultFuchsiaResourceDialect,
1677 > {
1678 RecoveryProxyInterface::r#init_system_partition_table(self, partitions)
1679 }
1680}
1681
1682impl RecoveryProxyInterface for RecoveryProxy {
1683 type InitSystemPartitionTableResponseFut = fidl::client::QueryResponseFut<
1684 RecoveryInitSystemPartitionTableResult,
1685 fidl::encoding::DefaultFuchsiaResourceDialect,
1686 >;
1687 fn r#init_system_partition_table(
1688 &self,
1689 mut partitions: &[fidl_fuchsia_storage_partitions::PartitionInfo],
1690 ) -> Self::InitSystemPartitionTableResponseFut {
1691 fn _decode(
1692 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1693 ) -> Result<RecoveryInitSystemPartitionTableResult, fidl::Error> {
1694 let _response = fidl::client::decode_transaction_body::<
1695 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1696 fidl::encoding::DefaultFuchsiaResourceDialect,
1697 0x3dcadcbb75e2330b,
1698 >(_buf?)?;
1699 Ok(_response.map(|x| x))
1700 }
1701 self.client.send_query_and_decode::<
1702 RecoveryInitSystemPartitionTableRequest,
1703 RecoveryInitSystemPartitionTableResult,
1704 >(
1705 (partitions,),
1706 0x3dcadcbb75e2330b,
1707 fidl::encoding::DynamicFlags::empty(),
1708 _decode,
1709 )
1710 }
1711}
1712
1713pub struct RecoveryEventStream {
1714 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1715}
1716
1717impl std::marker::Unpin for RecoveryEventStream {}
1718
1719impl futures::stream::FusedStream for RecoveryEventStream {
1720 fn is_terminated(&self) -> bool {
1721 self.event_receiver.is_terminated()
1722 }
1723}
1724
1725impl futures::Stream for RecoveryEventStream {
1726 type Item = Result<RecoveryEvent, fidl::Error>;
1727
1728 fn poll_next(
1729 mut self: std::pin::Pin<&mut Self>,
1730 cx: &mut std::task::Context<'_>,
1731 ) -> std::task::Poll<Option<Self::Item>> {
1732 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1733 &mut self.event_receiver,
1734 cx
1735 )?) {
1736 Some(buf) => std::task::Poll::Ready(Some(RecoveryEvent::decode(buf))),
1737 None => std::task::Poll::Ready(None),
1738 }
1739 }
1740}
1741
1742#[derive(Debug)]
1743pub enum RecoveryEvent {}
1744
1745impl RecoveryEvent {
1746 fn decode(
1748 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1749 ) -> Result<RecoveryEvent, fidl::Error> {
1750 let (bytes, _handles) = buf.split_mut();
1751 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1752 debug_assert_eq!(tx_header.tx_id, 0);
1753 match tx_header.ordinal {
1754 _ => Err(fidl::Error::UnknownOrdinal {
1755 ordinal: tx_header.ordinal,
1756 protocol_name: <RecoveryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1757 }),
1758 }
1759 }
1760}
1761
1762pub struct RecoveryRequestStream {
1764 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1765 is_terminated: bool,
1766}
1767
1768impl std::marker::Unpin for RecoveryRequestStream {}
1769
1770impl futures::stream::FusedStream for RecoveryRequestStream {
1771 fn is_terminated(&self) -> bool {
1772 self.is_terminated
1773 }
1774}
1775
1776impl fidl::endpoints::RequestStream for RecoveryRequestStream {
1777 type Protocol = RecoveryMarker;
1778 type ControlHandle = RecoveryControlHandle;
1779
1780 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1781 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1782 }
1783
1784 fn control_handle(&self) -> Self::ControlHandle {
1785 RecoveryControlHandle { inner: self.inner.clone() }
1786 }
1787
1788 fn into_inner(
1789 self,
1790 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1791 {
1792 (self.inner, self.is_terminated)
1793 }
1794
1795 fn from_inner(
1796 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1797 is_terminated: bool,
1798 ) -> Self {
1799 Self { inner, is_terminated }
1800 }
1801}
1802
1803impl futures::Stream for RecoveryRequestStream {
1804 type Item = Result<RecoveryRequest, fidl::Error>;
1805
1806 fn poll_next(
1807 mut self: std::pin::Pin<&mut Self>,
1808 cx: &mut std::task::Context<'_>,
1809 ) -> std::task::Poll<Option<Self::Item>> {
1810 let this = &mut *self;
1811 if this.inner.check_shutdown(cx) {
1812 this.is_terminated = true;
1813 return std::task::Poll::Ready(None);
1814 }
1815 if this.is_terminated {
1816 panic!("polled RecoveryRequestStream after completion");
1817 }
1818 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1819 |bytes, handles| {
1820 match this.inner.channel().read_etc(cx, bytes, handles) {
1821 std::task::Poll::Ready(Ok(())) => {}
1822 std::task::Poll::Pending => return std::task::Poll::Pending,
1823 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1824 this.is_terminated = true;
1825 return std::task::Poll::Ready(None);
1826 }
1827 std::task::Poll::Ready(Err(e)) => {
1828 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1829 e.into(),
1830 ))))
1831 }
1832 }
1833
1834 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1836
1837 std::task::Poll::Ready(Some(match header.ordinal {
1838 0x3dcadcbb75e2330b => {
1839 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1840 let mut req = fidl::new_empty!(
1841 RecoveryInitSystemPartitionTableRequest,
1842 fidl::encoding::DefaultFuchsiaResourceDialect
1843 );
1844 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RecoveryInitSystemPartitionTableRequest>(&header, _body_bytes, handles, &mut req)?;
1845 let control_handle = RecoveryControlHandle { inner: this.inner.clone() };
1846 Ok(RecoveryRequest::InitSystemPartitionTable {
1847 partitions: req.partitions,
1848
1849 responder: RecoveryInitSystemPartitionTableResponder {
1850 control_handle: std::mem::ManuallyDrop::new(control_handle),
1851 tx_id: header.tx_id,
1852 },
1853 })
1854 }
1855 _ => Err(fidl::Error::UnknownOrdinal {
1856 ordinal: header.ordinal,
1857 protocol_name:
1858 <RecoveryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1859 }),
1860 }))
1861 },
1862 )
1863 }
1864}
1865
1866#[derive(Debug)]
1869pub enum RecoveryRequest {
1870 InitSystemPartitionTable {
1872 partitions: Vec<fidl_fuchsia_storage_partitions::PartitionInfo>,
1873 responder: RecoveryInitSystemPartitionTableResponder,
1874 },
1875}
1876
1877impl RecoveryRequest {
1878 #[allow(irrefutable_let_patterns)]
1879 pub fn into_init_system_partition_table(
1880 self,
1881 ) -> Option<(
1882 Vec<fidl_fuchsia_storage_partitions::PartitionInfo>,
1883 RecoveryInitSystemPartitionTableResponder,
1884 )> {
1885 if let RecoveryRequest::InitSystemPartitionTable { partitions, responder } = self {
1886 Some((partitions, responder))
1887 } else {
1888 None
1889 }
1890 }
1891
1892 pub fn method_name(&self) -> &'static str {
1894 match *self {
1895 RecoveryRequest::InitSystemPartitionTable { .. } => "init_system_partition_table",
1896 }
1897 }
1898}
1899
1900#[derive(Debug, Clone)]
1901pub struct RecoveryControlHandle {
1902 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1903}
1904
1905impl fidl::endpoints::ControlHandle for RecoveryControlHandle {
1906 fn shutdown(&self) {
1907 self.inner.shutdown()
1908 }
1909 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1910 self.inner.shutdown_with_epitaph(status)
1911 }
1912
1913 fn is_closed(&self) -> bool {
1914 self.inner.channel().is_closed()
1915 }
1916 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1917 self.inner.channel().on_closed()
1918 }
1919
1920 #[cfg(target_os = "fuchsia")]
1921 fn signal_peer(
1922 &self,
1923 clear_mask: zx::Signals,
1924 set_mask: zx::Signals,
1925 ) -> Result<(), zx_status::Status> {
1926 use fidl::Peered;
1927 self.inner.channel().signal_peer(clear_mask, set_mask)
1928 }
1929}
1930
1931impl RecoveryControlHandle {}
1932
1933#[must_use = "FIDL methods require a response to be sent"]
1934#[derive(Debug)]
1935pub struct RecoveryInitSystemPartitionTableResponder {
1936 control_handle: std::mem::ManuallyDrop<RecoveryControlHandle>,
1937 tx_id: u32,
1938}
1939
1940impl std::ops::Drop for RecoveryInitSystemPartitionTableResponder {
1944 fn drop(&mut self) {
1945 self.control_handle.shutdown();
1946 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1948 }
1949}
1950
1951impl fidl::endpoints::Responder for RecoveryInitSystemPartitionTableResponder {
1952 type ControlHandle = RecoveryControlHandle;
1953
1954 fn control_handle(&self) -> &RecoveryControlHandle {
1955 &self.control_handle
1956 }
1957
1958 fn drop_without_shutdown(mut self) {
1959 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1961 std::mem::forget(self);
1963 }
1964}
1965
1966impl RecoveryInitSystemPartitionTableResponder {
1967 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1971 let _result = self.send_raw(result);
1972 if _result.is_err() {
1973 self.control_handle.shutdown();
1974 }
1975 self.drop_without_shutdown();
1976 _result
1977 }
1978
1979 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1981 let _result = self.send_raw(result);
1982 self.drop_without_shutdown();
1983 _result
1984 }
1985
1986 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1987 self.control_handle
1988 .inner
1989 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1990 result,
1991 self.tx_id,
1992 0x3dcadcbb75e2330b,
1993 fidl::encoding::DynamicFlags::empty(),
1994 )
1995 }
1996}
1997
1998#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1999pub struct StarnixVolumeProviderMarker;
2000
2001impl fidl::endpoints::ProtocolMarker for StarnixVolumeProviderMarker {
2002 type Proxy = StarnixVolumeProviderProxy;
2003 type RequestStream = StarnixVolumeProviderRequestStream;
2004 #[cfg(target_os = "fuchsia")]
2005 type SynchronousProxy = StarnixVolumeProviderSynchronousProxy;
2006
2007 const DEBUG_NAME: &'static str = "fuchsia.fshost.StarnixVolumeProvider";
2008}
2009impl fidl::endpoints::DiscoverableProtocolMarker for StarnixVolumeProviderMarker {}
2010pub type StarnixVolumeProviderMountResult = Result<(), i32>;
2011pub type StarnixVolumeProviderUnmountResult = Result<(), i32>;
2012
2013pub trait StarnixVolumeProviderProxyInterface: Send + Sync {
2014 type MountResponseFut: std::future::Future<Output = Result<StarnixVolumeProviderMountResult, fidl::Error>>
2015 + Send;
2016 fn r#mount(
2017 &self,
2018 crypt: fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
2019 exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2020 ) -> Self::MountResponseFut;
2021 type UnmountResponseFut: std::future::Future<Output = Result<StarnixVolumeProviderUnmountResult, fidl::Error>>
2022 + Send;
2023 fn r#unmount(&self) -> Self::UnmountResponseFut;
2024}
2025#[derive(Debug)]
2026#[cfg(target_os = "fuchsia")]
2027pub struct StarnixVolumeProviderSynchronousProxy {
2028 client: fidl::client::sync::Client,
2029}
2030
2031#[cfg(target_os = "fuchsia")]
2032impl fidl::endpoints::SynchronousProxy for StarnixVolumeProviderSynchronousProxy {
2033 type Proxy = StarnixVolumeProviderProxy;
2034 type Protocol = StarnixVolumeProviderMarker;
2035
2036 fn from_channel(inner: fidl::Channel) -> Self {
2037 Self::new(inner)
2038 }
2039
2040 fn into_channel(self) -> fidl::Channel {
2041 self.client.into_channel()
2042 }
2043
2044 fn as_channel(&self) -> &fidl::Channel {
2045 self.client.as_channel()
2046 }
2047}
2048
2049#[cfg(target_os = "fuchsia")]
2050impl StarnixVolumeProviderSynchronousProxy {
2051 pub fn new(channel: fidl::Channel) -> Self {
2052 let protocol_name =
2053 <StarnixVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2054 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2055 }
2056
2057 pub fn into_channel(self) -> fidl::Channel {
2058 self.client.into_channel()
2059 }
2060
2061 pub fn wait_for_event(
2064 &self,
2065 deadline: zx::MonotonicInstant,
2066 ) -> Result<StarnixVolumeProviderEvent, fidl::Error> {
2067 StarnixVolumeProviderEvent::decode(self.client.wait_for_event(deadline)?)
2068 }
2069
2070 pub fn r#mount(
2074 &self,
2075 mut crypt: fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
2076 mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2077 ___deadline: zx::MonotonicInstant,
2078 ) -> Result<StarnixVolumeProviderMountResult, fidl::Error> {
2079 let _response = self.client.send_query::<
2080 StarnixVolumeProviderMountRequest,
2081 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2082 >(
2083 (crypt, exposed_dir,),
2084 0x62ae75763dde5af6,
2085 fidl::encoding::DynamicFlags::empty(),
2086 ___deadline,
2087 )?;
2088 Ok(_response.map(|x| x))
2089 }
2090
2091 pub fn r#unmount(
2093 &self,
2094 ___deadline: zx::MonotonicInstant,
2095 ) -> Result<StarnixVolumeProviderUnmountResult, fidl::Error> {
2096 let _response = self.client.send_query::<
2097 fidl::encoding::EmptyPayload,
2098 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2099 >(
2100 (),
2101 0x5eacc7e034a09a1b,
2102 fidl::encoding::DynamicFlags::empty(),
2103 ___deadline,
2104 )?;
2105 Ok(_response.map(|x| x))
2106 }
2107}
2108
2109#[derive(Debug, Clone)]
2110pub struct StarnixVolumeProviderProxy {
2111 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2112}
2113
2114impl fidl::endpoints::Proxy for StarnixVolumeProviderProxy {
2115 type Protocol = StarnixVolumeProviderMarker;
2116
2117 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2118 Self::new(inner)
2119 }
2120
2121 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2122 self.client.into_channel().map_err(|client| Self { client })
2123 }
2124
2125 fn as_channel(&self) -> &::fidl::AsyncChannel {
2126 self.client.as_channel()
2127 }
2128}
2129
2130impl StarnixVolumeProviderProxy {
2131 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2133 let protocol_name =
2134 <StarnixVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2135 Self { client: fidl::client::Client::new(channel, protocol_name) }
2136 }
2137
2138 pub fn take_event_stream(&self) -> StarnixVolumeProviderEventStream {
2144 StarnixVolumeProviderEventStream { event_receiver: self.client.take_event_receiver() }
2145 }
2146
2147 pub fn r#mount(
2151 &self,
2152 mut crypt: fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
2153 mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2154 ) -> fidl::client::QueryResponseFut<
2155 StarnixVolumeProviderMountResult,
2156 fidl::encoding::DefaultFuchsiaResourceDialect,
2157 > {
2158 StarnixVolumeProviderProxyInterface::r#mount(self, crypt, exposed_dir)
2159 }
2160
2161 pub fn r#unmount(
2163 &self,
2164 ) -> fidl::client::QueryResponseFut<
2165 StarnixVolumeProviderUnmountResult,
2166 fidl::encoding::DefaultFuchsiaResourceDialect,
2167 > {
2168 StarnixVolumeProviderProxyInterface::r#unmount(self)
2169 }
2170}
2171
2172impl StarnixVolumeProviderProxyInterface for StarnixVolumeProviderProxy {
2173 type MountResponseFut = fidl::client::QueryResponseFut<
2174 StarnixVolumeProviderMountResult,
2175 fidl::encoding::DefaultFuchsiaResourceDialect,
2176 >;
2177 fn r#mount(
2178 &self,
2179 mut crypt: fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
2180 mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2181 ) -> Self::MountResponseFut {
2182 fn _decode(
2183 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2184 ) -> Result<StarnixVolumeProviderMountResult, fidl::Error> {
2185 let _response = fidl::client::decode_transaction_body::<
2186 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2187 fidl::encoding::DefaultFuchsiaResourceDialect,
2188 0x62ae75763dde5af6,
2189 >(_buf?)?;
2190 Ok(_response.map(|x| x))
2191 }
2192 self.client.send_query_and_decode::<
2193 StarnixVolumeProviderMountRequest,
2194 StarnixVolumeProviderMountResult,
2195 >(
2196 (crypt, exposed_dir,),
2197 0x62ae75763dde5af6,
2198 fidl::encoding::DynamicFlags::empty(),
2199 _decode,
2200 )
2201 }
2202
2203 type UnmountResponseFut = fidl::client::QueryResponseFut<
2204 StarnixVolumeProviderUnmountResult,
2205 fidl::encoding::DefaultFuchsiaResourceDialect,
2206 >;
2207 fn r#unmount(&self) -> Self::UnmountResponseFut {
2208 fn _decode(
2209 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2210 ) -> Result<StarnixVolumeProviderUnmountResult, fidl::Error> {
2211 let _response = fidl::client::decode_transaction_body::<
2212 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2213 fidl::encoding::DefaultFuchsiaResourceDialect,
2214 0x5eacc7e034a09a1b,
2215 >(_buf?)?;
2216 Ok(_response.map(|x| x))
2217 }
2218 self.client.send_query_and_decode::<
2219 fidl::encoding::EmptyPayload,
2220 StarnixVolumeProviderUnmountResult,
2221 >(
2222 (),
2223 0x5eacc7e034a09a1b,
2224 fidl::encoding::DynamicFlags::empty(),
2225 _decode,
2226 )
2227 }
2228}
2229
2230pub struct StarnixVolumeProviderEventStream {
2231 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2232}
2233
2234impl std::marker::Unpin for StarnixVolumeProviderEventStream {}
2235
2236impl futures::stream::FusedStream for StarnixVolumeProviderEventStream {
2237 fn is_terminated(&self) -> bool {
2238 self.event_receiver.is_terminated()
2239 }
2240}
2241
2242impl futures::Stream for StarnixVolumeProviderEventStream {
2243 type Item = Result<StarnixVolumeProviderEvent, fidl::Error>;
2244
2245 fn poll_next(
2246 mut self: std::pin::Pin<&mut Self>,
2247 cx: &mut std::task::Context<'_>,
2248 ) -> std::task::Poll<Option<Self::Item>> {
2249 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2250 &mut self.event_receiver,
2251 cx
2252 )?) {
2253 Some(buf) => std::task::Poll::Ready(Some(StarnixVolumeProviderEvent::decode(buf))),
2254 None => std::task::Poll::Ready(None),
2255 }
2256 }
2257}
2258
2259#[derive(Debug)]
2260pub enum StarnixVolumeProviderEvent {}
2261
2262impl StarnixVolumeProviderEvent {
2263 fn decode(
2265 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2266 ) -> Result<StarnixVolumeProviderEvent, fidl::Error> {
2267 let (bytes, _handles) = buf.split_mut();
2268 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2269 debug_assert_eq!(tx_header.tx_id, 0);
2270 match tx_header.ordinal {
2271 _ => Err(fidl::Error::UnknownOrdinal {
2272 ordinal: tx_header.ordinal,
2273 protocol_name:
2274 <StarnixVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2275 }),
2276 }
2277 }
2278}
2279
2280pub struct StarnixVolumeProviderRequestStream {
2282 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2283 is_terminated: bool,
2284}
2285
2286impl std::marker::Unpin for StarnixVolumeProviderRequestStream {}
2287
2288impl futures::stream::FusedStream for StarnixVolumeProviderRequestStream {
2289 fn is_terminated(&self) -> bool {
2290 self.is_terminated
2291 }
2292}
2293
2294impl fidl::endpoints::RequestStream for StarnixVolumeProviderRequestStream {
2295 type Protocol = StarnixVolumeProviderMarker;
2296 type ControlHandle = StarnixVolumeProviderControlHandle;
2297
2298 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2299 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2300 }
2301
2302 fn control_handle(&self) -> Self::ControlHandle {
2303 StarnixVolumeProviderControlHandle { inner: self.inner.clone() }
2304 }
2305
2306 fn into_inner(
2307 self,
2308 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2309 {
2310 (self.inner, self.is_terminated)
2311 }
2312
2313 fn from_inner(
2314 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2315 is_terminated: bool,
2316 ) -> Self {
2317 Self { inner, is_terminated }
2318 }
2319}
2320
2321impl futures::Stream for StarnixVolumeProviderRequestStream {
2322 type Item = Result<StarnixVolumeProviderRequest, fidl::Error>;
2323
2324 fn poll_next(
2325 mut self: std::pin::Pin<&mut Self>,
2326 cx: &mut std::task::Context<'_>,
2327 ) -> std::task::Poll<Option<Self::Item>> {
2328 let this = &mut *self;
2329 if this.inner.check_shutdown(cx) {
2330 this.is_terminated = true;
2331 return std::task::Poll::Ready(None);
2332 }
2333 if this.is_terminated {
2334 panic!("polled StarnixVolumeProviderRequestStream after completion");
2335 }
2336 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2337 |bytes, handles| {
2338 match this.inner.channel().read_etc(cx, bytes, handles) {
2339 std::task::Poll::Ready(Ok(())) => {}
2340 std::task::Poll::Pending => return std::task::Poll::Pending,
2341 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2342 this.is_terminated = true;
2343 return std::task::Poll::Ready(None);
2344 }
2345 std::task::Poll::Ready(Err(e)) => {
2346 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2347 e.into(),
2348 ))))
2349 }
2350 }
2351
2352 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2354
2355 std::task::Poll::Ready(Some(match header.ordinal {
2356 0x62ae75763dde5af6 => {
2357 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2358 let mut req = fidl::new_empty!(StarnixVolumeProviderMountRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2359 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StarnixVolumeProviderMountRequest>(&header, _body_bytes, handles, &mut req)?;
2360 let control_handle = StarnixVolumeProviderControlHandle {
2361 inner: this.inner.clone(),
2362 };
2363 Ok(StarnixVolumeProviderRequest::Mount {crypt: req.crypt,
2364exposed_dir: req.exposed_dir,
2365
2366 responder: StarnixVolumeProviderMountResponder {
2367 control_handle: std::mem::ManuallyDrop::new(control_handle),
2368 tx_id: header.tx_id,
2369 },
2370 })
2371 }
2372 0x5eacc7e034a09a1b => {
2373 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2374 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2375 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2376 let control_handle = StarnixVolumeProviderControlHandle {
2377 inner: this.inner.clone(),
2378 };
2379 Ok(StarnixVolumeProviderRequest::Unmount {
2380 responder: StarnixVolumeProviderUnmountResponder {
2381 control_handle: std::mem::ManuallyDrop::new(control_handle),
2382 tx_id: header.tx_id,
2383 },
2384 })
2385 }
2386 _ => Err(fidl::Error::UnknownOrdinal {
2387 ordinal: header.ordinal,
2388 protocol_name: <StarnixVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2389 }),
2390 }))
2391 },
2392 )
2393 }
2394}
2395
2396#[derive(Debug)]
2398pub enum StarnixVolumeProviderRequest {
2399 Mount {
2403 crypt: fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
2404 exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2405 responder: StarnixVolumeProviderMountResponder,
2406 },
2407 Unmount { responder: StarnixVolumeProviderUnmountResponder },
2409}
2410
2411impl StarnixVolumeProviderRequest {
2412 #[allow(irrefutable_let_patterns)]
2413 pub fn into_mount(
2414 self,
2415 ) -> Option<(
2416 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
2417 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2418 StarnixVolumeProviderMountResponder,
2419 )> {
2420 if let StarnixVolumeProviderRequest::Mount { crypt, exposed_dir, responder } = self {
2421 Some((crypt, exposed_dir, responder))
2422 } else {
2423 None
2424 }
2425 }
2426
2427 #[allow(irrefutable_let_patterns)]
2428 pub fn into_unmount(self) -> Option<(StarnixVolumeProviderUnmountResponder)> {
2429 if let StarnixVolumeProviderRequest::Unmount { responder } = self {
2430 Some((responder))
2431 } else {
2432 None
2433 }
2434 }
2435
2436 pub fn method_name(&self) -> &'static str {
2438 match *self {
2439 StarnixVolumeProviderRequest::Mount { .. } => "mount",
2440 StarnixVolumeProviderRequest::Unmount { .. } => "unmount",
2441 }
2442 }
2443}
2444
2445#[derive(Debug, Clone)]
2446pub struct StarnixVolumeProviderControlHandle {
2447 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2448}
2449
2450impl fidl::endpoints::ControlHandle for StarnixVolumeProviderControlHandle {
2451 fn shutdown(&self) {
2452 self.inner.shutdown()
2453 }
2454 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2455 self.inner.shutdown_with_epitaph(status)
2456 }
2457
2458 fn is_closed(&self) -> bool {
2459 self.inner.channel().is_closed()
2460 }
2461 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2462 self.inner.channel().on_closed()
2463 }
2464
2465 #[cfg(target_os = "fuchsia")]
2466 fn signal_peer(
2467 &self,
2468 clear_mask: zx::Signals,
2469 set_mask: zx::Signals,
2470 ) -> Result<(), zx_status::Status> {
2471 use fidl::Peered;
2472 self.inner.channel().signal_peer(clear_mask, set_mask)
2473 }
2474}
2475
2476impl StarnixVolumeProviderControlHandle {}
2477
2478#[must_use = "FIDL methods require a response to be sent"]
2479#[derive(Debug)]
2480pub struct StarnixVolumeProviderMountResponder {
2481 control_handle: std::mem::ManuallyDrop<StarnixVolumeProviderControlHandle>,
2482 tx_id: u32,
2483}
2484
2485impl std::ops::Drop for StarnixVolumeProviderMountResponder {
2489 fn drop(&mut self) {
2490 self.control_handle.shutdown();
2491 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2493 }
2494}
2495
2496impl fidl::endpoints::Responder for StarnixVolumeProviderMountResponder {
2497 type ControlHandle = StarnixVolumeProviderControlHandle;
2498
2499 fn control_handle(&self) -> &StarnixVolumeProviderControlHandle {
2500 &self.control_handle
2501 }
2502
2503 fn drop_without_shutdown(mut self) {
2504 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2506 std::mem::forget(self);
2508 }
2509}
2510
2511impl StarnixVolumeProviderMountResponder {
2512 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2516 let _result = self.send_raw(result);
2517 if _result.is_err() {
2518 self.control_handle.shutdown();
2519 }
2520 self.drop_without_shutdown();
2521 _result
2522 }
2523
2524 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2526 let _result = self.send_raw(result);
2527 self.drop_without_shutdown();
2528 _result
2529 }
2530
2531 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2532 self.control_handle
2533 .inner
2534 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2535 result,
2536 self.tx_id,
2537 0x62ae75763dde5af6,
2538 fidl::encoding::DynamicFlags::empty(),
2539 )
2540 }
2541}
2542
2543#[must_use = "FIDL methods require a response to be sent"]
2544#[derive(Debug)]
2545pub struct StarnixVolumeProviderUnmountResponder {
2546 control_handle: std::mem::ManuallyDrop<StarnixVolumeProviderControlHandle>,
2547 tx_id: u32,
2548}
2549
2550impl std::ops::Drop for StarnixVolumeProviderUnmountResponder {
2554 fn drop(&mut self) {
2555 self.control_handle.shutdown();
2556 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2558 }
2559}
2560
2561impl fidl::endpoints::Responder for StarnixVolumeProviderUnmountResponder {
2562 type ControlHandle = StarnixVolumeProviderControlHandle;
2563
2564 fn control_handle(&self) -> &StarnixVolumeProviderControlHandle {
2565 &self.control_handle
2566 }
2567
2568 fn drop_without_shutdown(mut self) {
2569 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2571 std::mem::forget(self);
2573 }
2574}
2575
2576impl StarnixVolumeProviderUnmountResponder {
2577 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2581 let _result = self.send_raw(result);
2582 if _result.is_err() {
2583 self.control_handle.shutdown();
2584 }
2585 self.drop_without_shutdown();
2586 _result
2587 }
2588
2589 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2591 let _result = self.send_raw(result);
2592 self.drop_without_shutdown();
2593 _result
2594 }
2595
2596 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2597 self.control_handle
2598 .inner
2599 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2600 result,
2601 self.tx_id,
2602 0x5eacc7e034a09a1b,
2603 fidl::encoding::DynamicFlags::empty(),
2604 )
2605 }
2606}
2607
2608mod internal {
2609 use super::*;
2610
2611 impl fidl::encoding::ValueTypeMarker for AdminGetDevicePathRequest {
2612 type Borrowed<'a> = &'a Self;
2613 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2614 value
2615 }
2616 }
2617
2618 unsafe impl fidl::encoding::TypeMarker for AdminGetDevicePathRequest {
2619 type Owned = Self;
2620
2621 #[inline(always)]
2622 fn inline_align(_context: fidl::encoding::Context) -> usize {
2623 8
2624 }
2625
2626 #[inline(always)]
2627 fn inline_size(_context: fidl::encoding::Context) -> usize {
2628 8
2629 }
2630 #[inline(always)]
2631 fn encode_is_copy() -> bool {
2632 true
2633 }
2634
2635 #[inline(always)]
2636 fn decode_is_copy() -> bool {
2637 true
2638 }
2639 }
2640
2641 unsafe impl<D: fidl::encoding::ResourceDialect>
2642 fidl::encoding::Encode<AdminGetDevicePathRequest, D> for &AdminGetDevicePathRequest
2643 {
2644 #[inline]
2645 unsafe fn encode(
2646 self,
2647 encoder: &mut fidl::encoding::Encoder<'_, D>,
2648 offset: usize,
2649 _depth: fidl::encoding::Depth,
2650 ) -> fidl::Result<()> {
2651 encoder.debug_check_bounds::<AdminGetDevicePathRequest>(offset);
2652 unsafe {
2653 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2655 (buf_ptr as *mut AdminGetDevicePathRequest)
2656 .write_unaligned((self as *const AdminGetDevicePathRequest).read());
2657 }
2660 Ok(())
2661 }
2662 }
2663 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2664 fidl::encoding::Encode<AdminGetDevicePathRequest, D> for (T0,)
2665 {
2666 #[inline]
2667 unsafe fn encode(
2668 self,
2669 encoder: &mut fidl::encoding::Encoder<'_, D>,
2670 offset: usize,
2671 depth: fidl::encoding::Depth,
2672 ) -> fidl::Result<()> {
2673 encoder.debug_check_bounds::<AdminGetDevicePathRequest>(offset);
2674 self.0.encode(encoder, offset + 0, depth)?;
2678 Ok(())
2679 }
2680 }
2681
2682 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2683 for AdminGetDevicePathRequest
2684 {
2685 #[inline(always)]
2686 fn new_empty() -> Self {
2687 Self { fs_id: fidl::new_empty!(u64, D) }
2688 }
2689
2690 #[inline]
2691 unsafe fn decode(
2692 &mut self,
2693 decoder: &mut fidl::encoding::Decoder<'_, D>,
2694 offset: usize,
2695 _depth: fidl::encoding::Depth,
2696 ) -> fidl::Result<()> {
2697 decoder.debug_check_bounds::<Self>(offset);
2698 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2699 unsafe {
2702 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2703 }
2704 Ok(())
2705 }
2706 }
2707
2708 impl fidl::encoding::ResourceTypeMarker for AdminMountRequest {
2709 type Borrowed<'a> = &'a mut Self;
2710 fn take_or_borrow<'a>(
2711 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2712 ) -> Self::Borrowed<'a> {
2713 value
2714 }
2715 }
2716
2717 unsafe impl fidl::encoding::TypeMarker for AdminMountRequest {
2718 type Owned = Self;
2719
2720 #[inline(always)]
2721 fn inline_align(_context: fidl::encoding::Context) -> usize {
2722 8
2723 }
2724
2725 #[inline(always)]
2726 fn inline_size(_context: fidl::encoding::Context) -> usize {
2727 40
2728 }
2729 }
2730
2731 unsafe impl
2732 fidl::encoding::Encode<AdminMountRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2733 for &mut AdminMountRequest
2734 {
2735 #[inline]
2736 unsafe fn encode(
2737 self,
2738 encoder: &mut fidl::encoding::Encoder<
2739 '_,
2740 fidl::encoding::DefaultFuchsiaResourceDialect,
2741 >,
2742 offset: usize,
2743 _depth: fidl::encoding::Depth,
2744 ) -> fidl::Result<()> {
2745 encoder.debug_check_bounds::<AdminMountRequest>(offset);
2746 fidl::encoding::Encode::<AdminMountRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2748 (
2749 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.device),
2750 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
2751 <MountOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
2752 ),
2753 encoder, offset, _depth
2754 )
2755 }
2756 }
2757 unsafe impl<
2758 T0: fidl::encoding::Encode<
2759 fidl::encoding::Endpoint<
2760 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
2761 >,
2762 fidl::encoding::DefaultFuchsiaResourceDialect,
2763 >,
2764 T1: fidl::encoding::Encode<
2765 fidl::encoding::BoundedString<255>,
2766 fidl::encoding::DefaultFuchsiaResourceDialect,
2767 >,
2768 T2: fidl::encoding::Encode<MountOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
2769 >
2770 fidl::encoding::Encode<AdminMountRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
2771 for (T0, T1, T2)
2772 {
2773 #[inline]
2774 unsafe fn encode(
2775 self,
2776 encoder: &mut fidl::encoding::Encoder<
2777 '_,
2778 fidl::encoding::DefaultFuchsiaResourceDialect,
2779 >,
2780 offset: usize,
2781 depth: fidl::encoding::Depth,
2782 ) -> fidl::Result<()> {
2783 encoder.debug_check_bounds::<AdminMountRequest>(offset);
2784 unsafe {
2787 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2788 (ptr as *mut u64).write_unaligned(0);
2789 }
2790 self.0.encode(encoder, offset + 0, depth)?;
2792 self.1.encode(encoder, offset + 8, depth)?;
2793 self.2.encode(encoder, offset + 24, depth)?;
2794 Ok(())
2795 }
2796 }
2797
2798 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2799 for AdminMountRequest
2800 {
2801 #[inline(always)]
2802 fn new_empty() -> Self {
2803 Self {
2804 device: fidl::new_empty!(
2805 fidl::encoding::Endpoint<
2806 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
2807 >,
2808 fidl::encoding::DefaultFuchsiaResourceDialect
2809 ),
2810 name: fidl::new_empty!(
2811 fidl::encoding::BoundedString<255>,
2812 fidl::encoding::DefaultFuchsiaResourceDialect
2813 ),
2814 options: fidl::new_empty!(
2815 MountOptions,
2816 fidl::encoding::DefaultFuchsiaResourceDialect
2817 ),
2818 }
2819 }
2820
2821 #[inline]
2822 unsafe fn decode(
2823 &mut self,
2824 decoder: &mut fidl::encoding::Decoder<
2825 '_,
2826 fidl::encoding::DefaultFuchsiaResourceDialect,
2827 >,
2828 offset: usize,
2829 _depth: fidl::encoding::Depth,
2830 ) -> fidl::Result<()> {
2831 decoder.debug_check_bounds::<Self>(offset);
2832 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2834 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2835 let mask = 0xffffffff00000000u64;
2836 let maskedval = padval & mask;
2837 if maskedval != 0 {
2838 return Err(fidl::Error::NonZeroPadding {
2839 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2840 });
2841 }
2842 fidl::decode!(
2843 fidl::encoding::Endpoint<
2844 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
2845 >,
2846 fidl::encoding::DefaultFuchsiaResourceDialect,
2847 &mut self.device,
2848 decoder,
2849 offset + 0,
2850 _depth
2851 )?;
2852 fidl::decode!(
2853 fidl::encoding::BoundedString<255>,
2854 fidl::encoding::DefaultFuchsiaResourceDialect,
2855 &mut self.name,
2856 decoder,
2857 offset + 8,
2858 _depth
2859 )?;
2860 fidl::decode!(
2861 MountOptions,
2862 fidl::encoding::DefaultFuchsiaResourceDialect,
2863 &mut self.options,
2864 decoder,
2865 offset + 24,
2866 _depth
2867 )?;
2868 Ok(())
2869 }
2870 }
2871
2872 impl fidl::encoding::ValueTypeMarker for AdminStorageHostEnabledResponse {
2873 type Borrowed<'a> = &'a Self;
2874 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2875 value
2876 }
2877 }
2878
2879 unsafe impl fidl::encoding::TypeMarker for AdminStorageHostEnabledResponse {
2880 type Owned = Self;
2881
2882 #[inline(always)]
2883 fn inline_align(_context: fidl::encoding::Context) -> usize {
2884 1
2885 }
2886
2887 #[inline(always)]
2888 fn inline_size(_context: fidl::encoding::Context) -> usize {
2889 1
2890 }
2891 }
2892
2893 unsafe impl<D: fidl::encoding::ResourceDialect>
2894 fidl::encoding::Encode<AdminStorageHostEnabledResponse, D>
2895 for &AdminStorageHostEnabledResponse
2896 {
2897 #[inline]
2898 unsafe fn encode(
2899 self,
2900 encoder: &mut fidl::encoding::Encoder<'_, D>,
2901 offset: usize,
2902 _depth: fidl::encoding::Depth,
2903 ) -> fidl::Result<()> {
2904 encoder.debug_check_bounds::<AdminStorageHostEnabledResponse>(offset);
2905 fidl::encoding::Encode::<AdminStorageHostEnabledResponse, D>::encode(
2907 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
2908 encoder,
2909 offset,
2910 _depth,
2911 )
2912 }
2913 }
2914 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2915 fidl::encoding::Encode<AdminStorageHostEnabledResponse, D> for (T0,)
2916 {
2917 #[inline]
2918 unsafe fn encode(
2919 self,
2920 encoder: &mut fidl::encoding::Encoder<'_, D>,
2921 offset: usize,
2922 depth: fidl::encoding::Depth,
2923 ) -> fidl::Result<()> {
2924 encoder.debug_check_bounds::<AdminStorageHostEnabledResponse>(offset);
2925 self.0.encode(encoder, offset + 0, depth)?;
2929 Ok(())
2930 }
2931 }
2932
2933 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2934 for AdminStorageHostEnabledResponse
2935 {
2936 #[inline(always)]
2937 fn new_empty() -> Self {
2938 Self { enabled: fidl::new_empty!(bool, D) }
2939 }
2940
2941 #[inline]
2942 unsafe fn decode(
2943 &mut self,
2944 decoder: &mut fidl::encoding::Decoder<'_, D>,
2945 offset: usize,
2946 _depth: fidl::encoding::Depth,
2947 ) -> fidl::Result<()> {
2948 decoder.debug_check_bounds::<Self>(offset);
2949 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
2951 Ok(())
2952 }
2953 }
2954
2955 impl fidl::encoding::ValueTypeMarker for AdminUnmountRequest {
2956 type Borrowed<'a> = &'a Self;
2957 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2958 value
2959 }
2960 }
2961
2962 unsafe impl fidl::encoding::TypeMarker for AdminUnmountRequest {
2963 type Owned = Self;
2964
2965 #[inline(always)]
2966 fn inline_align(_context: fidl::encoding::Context) -> usize {
2967 8
2968 }
2969
2970 #[inline(always)]
2971 fn inline_size(_context: fidl::encoding::Context) -> usize {
2972 16
2973 }
2974 }
2975
2976 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AdminUnmountRequest, D>
2977 for &AdminUnmountRequest
2978 {
2979 #[inline]
2980 unsafe fn encode(
2981 self,
2982 encoder: &mut fidl::encoding::Encoder<'_, D>,
2983 offset: usize,
2984 _depth: fidl::encoding::Depth,
2985 ) -> fidl::Result<()> {
2986 encoder.debug_check_bounds::<AdminUnmountRequest>(offset);
2987 fidl::encoding::Encode::<AdminUnmountRequest, D>::encode(
2989 (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
2990 &self.name,
2991 ),),
2992 encoder,
2993 offset,
2994 _depth,
2995 )
2996 }
2997 }
2998 unsafe impl<
2999 D: fidl::encoding::ResourceDialect,
3000 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
3001 > fidl::encoding::Encode<AdminUnmountRequest, D> for (T0,)
3002 {
3003 #[inline]
3004 unsafe fn encode(
3005 self,
3006 encoder: &mut fidl::encoding::Encoder<'_, D>,
3007 offset: usize,
3008 depth: fidl::encoding::Depth,
3009 ) -> fidl::Result<()> {
3010 encoder.debug_check_bounds::<AdminUnmountRequest>(offset);
3011 self.0.encode(encoder, offset + 0, depth)?;
3015 Ok(())
3016 }
3017 }
3018
3019 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdminUnmountRequest {
3020 #[inline(always)]
3021 fn new_empty() -> Self {
3022 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
3023 }
3024
3025 #[inline]
3026 unsafe fn decode(
3027 &mut self,
3028 decoder: &mut fidl::encoding::Decoder<'_, D>,
3029 offset: usize,
3030 _depth: fidl::encoding::Depth,
3031 ) -> fidl::Result<()> {
3032 decoder.debug_check_bounds::<Self>(offset);
3033 fidl::decode!(
3035 fidl::encoding::BoundedString<255>,
3036 D,
3037 &mut self.name,
3038 decoder,
3039 offset + 0,
3040 _depth
3041 )?;
3042 Ok(())
3043 }
3044 }
3045
3046 impl fidl::encoding::ResourceTypeMarker for AdminWipeStorageRequest {
3047 type Borrowed<'a> = &'a mut Self;
3048 fn take_or_borrow<'a>(
3049 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3050 ) -> Self::Borrowed<'a> {
3051 value
3052 }
3053 }
3054
3055 unsafe impl fidl::encoding::TypeMarker for AdminWipeStorageRequest {
3056 type Owned = Self;
3057
3058 #[inline(always)]
3059 fn inline_align(_context: fidl::encoding::Context) -> usize {
3060 4
3061 }
3062
3063 #[inline(always)]
3064 fn inline_size(_context: fidl::encoding::Context) -> usize {
3065 8
3066 }
3067 }
3068
3069 unsafe impl
3070 fidl::encoding::Encode<
3071 AdminWipeStorageRequest,
3072 fidl::encoding::DefaultFuchsiaResourceDialect,
3073 > for &mut AdminWipeStorageRequest
3074 {
3075 #[inline]
3076 unsafe fn encode(
3077 self,
3078 encoder: &mut fidl::encoding::Encoder<
3079 '_,
3080 fidl::encoding::DefaultFuchsiaResourceDialect,
3081 >,
3082 offset: usize,
3083 _depth: fidl::encoding::Depth,
3084 ) -> fidl::Result<()> {
3085 encoder.debug_check_bounds::<AdminWipeStorageRequest>(offset);
3086 fidl::encoding::Encode::<
3088 AdminWipeStorageRequest,
3089 fidl::encoding::DefaultFuchsiaResourceDialect,
3090 >::encode(
3091 (
3092 <fidl::encoding::Optional<
3093 fidl::encoding::Endpoint<
3094 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3095 >,
3096 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3097 &mut self.blobfs_root
3098 ),
3099 <fidl::encoding::Optional<
3100 fidl::encoding::Endpoint<
3101 fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>,
3102 >,
3103 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3104 &mut self.blob_creator,
3105 ),
3106 ),
3107 encoder,
3108 offset,
3109 _depth,
3110 )
3111 }
3112 }
3113 unsafe impl<
3114 T0: fidl::encoding::Encode<
3115 fidl::encoding::Optional<
3116 fidl::encoding::Endpoint<
3117 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3118 >,
3119 >,
3120 fidl::encoding::DefaultFuchsiaResourceDialect,
3121 >,
3122 T1: fidl::encoding::Encode<
3123 fidl::encoding::Optional<
3124 fidl::encoding::Endpoint<
3125 fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>,
3126 >,
3127 >,
3128 fidl::encoding::DefaultFuchsiaResourceDialect,
3129 >,
3130 >
3131 fidl::encoding::Encode<
3132 AdminWipeStorageRequest,
3133 fidl::encoding::DefaultFuchsiaResourceDialect,
3134 > for (T0, T1)
3135 {
3136 #[inline]
3137 unsafe fn encode(
3138 self,
3139 encoder: &mut fidl::encoding::Encoder<
3140 '_,
3141 fidl::encoding::DefaultFuchsiaResourceDialect,
3142 >,
3143 offset: usize,
3144 depth: fidl::encoding::Depth,
3145 ) -> fidl::Result<()> {
3146 encoder.debug_check_bounds::<AdminWipeStorageRequest>(offset);
3147 self.0.encode(encoder, offset + 0, depth)?;
3151 self.1.encode(encoder, offset + 4, depth)?;
3152 Ok(())
3153 }
3154 }
3155
3156 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3157 for AdminWipeStorageRequest
3158 {
3159 #[inline(always)]
3160 fn new_empty() -> Self {
3161 Self {
3162 blobfs_root: fidl::new_empty!(
3163 fidl::encoding::Optional<
3164 fidl::encoding::Endpoint<
3165 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3166 >,
3167 >,
3168 fidl::encoding::DefaultFuchsiaResourceDialect
3169 ),
3170 blob_creator: fidl::new_empty!(
3171 fidl::encoding::Optional<
3172 fidl::encoding::Endpoint<
3173 fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>,
3174 >,
3175 >,
3176 fidl::encoding::DefaultFuchsiaResourceDialect
3177 ),
3178 }
3179 }
3180
3181 #[inline]
3182 unsafe fn decode(
3183 &mut self,
3184 decoder: &mut fidl::encoding::Decoder<
3185 '_,
3186 fidl::encoding::DefaultFuchsiaResourceDialect,
3187 >,
3188 offset: usize,
3189 _depth: fidl::encoding::Depth,
3190 ) -> fidl::Result<()> {
3191 decoder.debug_check_bounds::<Self>(offset);
3192 fidl::decode!(
3194 fidl::encoding::Optional<
3195 fidl::encoding::Endpoint<
3196 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3197 >,
3198 >,
3199 fidl::encoding::DefaultFuchsiaResourceDialect,
3200 &mut self.blobfs_root,
3201 decoder,
3202 offset + 0,
3203 _depth
3204 )?;
3205 fidl::decode!(
3206 fidl::encoding::Optional<
3207 fidl::encoding::Endpoint<
3208 fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::BlobCreatorMarker>,
3209 >,
3210 >,
3211 fidl::encoding::DefaultFuchsiaResourceDialect,
3212 &mut self.blob_creator,
3213 decoder,
3214 offset + 4,
3215 _depth
3216 )?;
3217 Ok(())
3218 }
3219 }
3220
3221 impl fidl::encoding::ResourceTypeMarker for AdminWriteDataFileRequest {
3222 type Borrowed<'a> = &'a mut Self;
3223 fn take_or_borrow<'a>(
3224 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3225 ) -> Self::Borrowed<'a> {
3226 value
3227 }
3228 }
3229
3230 unsafe impl fidl::encoding::TypeMarker for AdminWriteDataFileRequest {
3231 type Owned = Self;
3232
3233 #[inline(always)]
3234 fn inline_align(_context: fidl::encoding::Context) -> usize {
3235 8
3236 }
3237
3238 #[inline(always)]
3239 fn inline_size(_context: fidl::encoding::Context) -> usize {
3240 24
3241 }
3242 }
3243
3244 unsafe impl
3245 fidl::encoding::Encode<
3246 AdminWriteDataFileRequest,
3247 fidl::encoding::DefaultFuchsiaResourceDialect,
3248 > for &mut AdminWriteDataFileRequest
3249 {
3250 #[inline]
3251 unsafe fn encode(
3252 self,
3253 encoder: &mut fidl::encoding::Encoder<
3254 '_,
3255 fidl::encoding::DefaultFuchsiaResourceDialect,
3256 >,
3257 offset: usize,
3258 _depth: fidl::encoding::Depth,
3259 ) -> fidl::Result<()> {
3260 encoder.debug_check_bounds::<AdminWriteDataFileRequest>(offset);
3261 fidl::encoding::Encode::<AdminWriteDataFileRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3263 (
3264 <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.filename),
3265 <fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.payload),
3266 ),
3267 encoder, offset, _depth
3268 )
3269 }
3270 }
3271 unsafe impl<
3272 T0: fidl::encoding::Encode<
3273 fidl::encoding::BoundedString<4095>,
3274 fidl::encoding::DefaultFuchsiaResourceDialect,
3275 >,
3276 T1: fidl::encoding::Encode<
3277 fidl::encoding::HandleType<
3278 fidl::Vmo,
3279 { fidl::ObjectType::VMO.into_raw() },
3280 2147483648,
3281 >,
3282 fidl::encoding::DefaultFuchsiaResourceDialect,
3283 >,
3284 >
3285 fidl::encoding::Encode<
3286 AdminWriteDataFileRequest,
3287 fidl::encoding::DefaultFuchsiaResourceDialect,
3288 > for (T0, T1)
3289 {
3290 #[inline]
3291 unsafe fn encode(
3292 self,
3293 encoder: &mut fidl::encoding::Encoder<
3294 '_,
3295 fidl::encoding::DefaultFuchsiaResourceDialect,
3296 >,
3297 offset: usize,
3298 depth: fidl::encoding::Depth,
3299 ) -> fidl::Result<()> {
3300 encoder.debug_check_bounds::<AdminWriteDataFileRequest>(offset);
3301 unsafe {
3304 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3305 (ptr as *mut u64).write_unaligned(0);
3306 }
3307 self.0.encode(encoder, offset + 0, depth)?;
3309 self.1.encode(encoder, offset + 16, depth)?;
3310 Ok(())
3311 }
3312 }
3313
3314 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3315 for AdminWriteDataFileRequest
3316 {
3317 #[inline(always)]
3318 fn new_empty() -> Self {
3319 Self {
3320 filename: fidl::new_empty!(
3321 fidl::encoding::BoundedString<4095>,
3322 fidl::encoding::DefaultFuchsiaResourceDialect
3323 ),
3324 payload: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3325 }
3326 }
3327
3328 #[inline]
3329 unsafe fn decode(
3330 &mut self,
3331 decoder: &mut fidl::encoding::Decoder<
3332 '_,
3333 fidl::encoding::DefaultFuchsiaResourceDialect,
3334 >,
3335 offset: usize,
3336 _depth: fidl::encoding::Depth,
3337 ) -> fidl::Result<()> {
3338 decoder.debug_check_bounds::<Self>(offset);
3339 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3341 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3342 let mask = 0xffffffff00000000u64;
3343 let maskedval = padval & mask;
3344 if maskedval != 0 {
3345 return Err(fidl::Error::NonZeroPadding {
3346 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3347 });
3348 }
3349 fidl::decode!(
3350 fidl::encoding::BoundedString<4095>,
3351 fidl::encoding::DefaultFuchsiaResourceDialect,
3352 &mut self.filename,
3353 decoder,
3354 offset + 0,
3355 _depth
3356 )?;
3357 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.payload, decoder, offset + 16, _depth)?;
3358 Ok(())
3359 }
3360 }
3361
3362 impl fidl::encoding::ValueTypeMarker for AdminGetDevicePathResponse {
3363 type Borrowed<'a> = &'a Self;
3364 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3365 value
3366 }
3367 }
3368
3369 unsafe impl fidl::encoding::TypeMarker for AdminGetDevicePathResponse {
3370 type Owned = Self;
3371
3372 #[inline(always)]
3373 fn inline_align(_context: fidl::encoding::Context) -> usize {
3374 8
3375 }
3376
3377 #[inline(always)]
3378 fn inline_size(_context: fidl::encoding::Context) -> usize {
3379 16
3380 }
3381 }
3382
3383 unsafe impl<D: fidl::encoding::ResourceDialect>
3384 fidl::encoding::Encode<AdminGetDevicePathResponse, D> for &AdminGetDevicePathResponse
3385 {
3386 #[inline]
3387 unsafe fn encode(
3388 self,
3389 encoder: &mut fidl::encoding::Encoder<'_, D>,
3390 offset: usize,
3391 _depth: fidl::encoding::Depth,
3392 ) -> fidl::Result<()> {
3393 encoder.debug_check_bounds::<AdminGetDevicePathResponse>(offset);
3394 fidl::encoding::Encode::<AdminGetDevicePathResponse, D>::encode(
3396 (<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(
3397 &self.path,
3398 ),),
3399 encoder,
3400 offset,
3401 _depth,
3402 )
3403 }
3404 }
3405 unsafe impl<
3406 D: fidl::encoding::ResourceDialect,
3407 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4095>, D>,
3408 > fidl::encoding::Encode<AdminGetDevicePathResponse, D> for (T0,)
3409 {
3410 #[inline]
3411 unsafe fn encode(
3412 self,
3413 encoder: &mut fidl::encoding::Encoder<'_, D>,
3414 offset: usize,
3415 depth: fidl::encoding::Depth,
3416 ) -> fidl::Result<()> {
3417 encoder.debug_check_bounds::<AdminGetDevicePathResponse>(offset);
3418 self.0.encode(encoder, offset + 0, depth)?;
3422 Ok(())
3423 }
3424 }
3425
3426 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3427 for AdminGetDevicePathResponse
3428 {
3429 #[inline(always)]
3430 fn new_empty() -> Self {
3431 Self { path: fidl::new_empty!(fidl::encoding::BoundedString<4095>, D) }
3432 }
3433
3434 #[inline]
3435 unsafe fn decode(
3436 &mut self,
3437 decoder: &mut fidl::encoding::Decoder<'_, D>,
3438 offset: usize,
3439 _depth: fidl::encoding::Depth,
3440 ) -> fidl::Result<()> {
3441 decoder.debug_check_bounds::<Self>(offset);
3442 fidl::decode!(
3444 fidl::encoding::BoundedString<4095>,
3445 D,
3446 &mut self.path,
3447 decoder,
3448 offset + 0,
3449 _depth
3450 )?;
3451 Ok(())
3452 }
3453 }
3454
3455 impl fidl::encoding::ValueTypeMarker for RecoveryInitSystemPartitionTableRequest {
3456 type Borrowed<'a> = &'a Self;
3457 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3458 value
3459 }
3460 }
3461
3462 unsafe impl fidl::encoding::TypeMarker for RecoveryInitSystemPartitionTableRequest {
3463 type Owned = Self;
3464
3465 #[inline(always)]
3466 fn inline_align(_context: fidl::encoding::Context) -> usize {
3467 8
3468 }
3469
3470 #[inline(always)]
3471 fn inline_size(_context: fidl::encoding::Context) -> usize {
3472 16
3473 }
3474 }
3475
3476 unsafe impl<D: fidl::encoding::ResourceDialect>
3477 fidl::encoding::Encode<RecoveryInitSystemPartitionTableRequest, D>
3478 for &RecoveryInitSystemPartitionTableRequest
3479 {
3480 #[inline]
3481 unsafe fn encode(
3482 self,
3483 encoder: &mut fidl::encoding::Encoder<'_, D>,
3484 offset: usize,
3485 _depth: fidl::encoding::Depth,
3486 ) -> fidl::Result<()> {
3487 encoder.debug_check_bounds::<RecoveryInitSystemPartitionTableRequest>(offset);
3488 fidl::encoding::Encode::<RecoveryInitSystemPartitionTableRequest, D>::encode(
3490 (
3491 <fidl::encoding::Vector<fidl_fuchsia_storage_partitions::PartitionInfo, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.partitions),
3492 ),
3493 encoder, offset, _depth
3494 )
3495 }
3496 }
3497 unsafe impl<
3498 D: fidl::encoding::ResourceDialect,
3499 T0: fidl::encoding::Encode<
3500 fidl::encoding::Vector<fidl_fuchsia_storage_partitions::PartitionInfo, 128>,
3501 D,
3502 >,
3503 > fidl::encoding::Encode<RecoveryInitSystemPartitionTableRequest, D> for (T0,)
3504 {
3505 #[inline]
3506 unsafe fn encode(
3507 self,
3508 encoder: &mut fidl::encoding::Encoder<'_, D>,
3509 offset: usize,
3510 depth: fidl::encoding::Depth,
3511 ) -> fidl::Result<()> {
3512 encoder.debug_check_bounds::<RecoveryInitSystemPartitionTableRequest>(offset);
3513 self.0.encode(encoder, offset + 0, depth)?;
3517 Ok(())
3518 }
3519 }
3520
3521 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3522 for RecoveryInitSystemPartitionTableRequest
3523 {
3524 #[inline(always)]
3525 fn new_empty() -> Self {
3526 Self {
3527 partitions: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_storage_partitions::PartitionInfo, 128>, D),
3528 }
3529 }
3530
3531 #[inline]
3532 unsafe fn decode(
3533 &mut self,
3534 decoder: &mut fidl::encoding::Decoder<'_, D>,
3535 offset: usize,
3536 _depth: fidl::encoding::Depth,
3537 ) -> fidl::Result<()> {
3538 decoder.debug_check_bounds::<Self>(offset);
3539 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_storage_partitions::PartitionInfo, 128>, D, &mut self.partitions, decoder, offset + 0, _depth)?;
3541 Ok(())
3542 }
3543 }
3544
3545 impl fidl::encoding::ResourceTypeMarker for StarnixVolumeProviderMountRequest {
3546 type Borrowed<'a> = &'a mut Self;
3547 fn take_or_borrow<'a>(
3548 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3549 ) -> Self::Borrowed<'a> {
3550 value
3551 }
3552 }
3553
3554 unsafe impl fidl::encoding::TypeMarker for StarnixVolumeProviderMountRequest {
3555 type Owned = Self;
3556
3557 #[inline(always)]
3558 fn inline_align(_context: fidl::encoding::Context) -> usize {
3559 4
3560 }
3561
3562 #[inline(always)]
3563 fn inline_size(_context: fidl::encoding::Context) -> usize {
3564 8
3565 }
3566 }
3567
3568 unsafe impl
3569 fidl::encoding::Encode<
3570 StarnixVolumeProviderMountRequest,
3571 fidl::encoding::DefaultFuchsiaResourceDialect,
3572 > for &mut StarnixVolumeProviderMountRequest
3573 {
3574 #[inline]
3575 unsafe fn encode(
3576 self,
3577 encoder: &mut fidl::encoding::Encoder<
3578 '_,
3579 fidl::encoding::DefaultFuchsiaResourceDialect,
3580 >,
3581 offset: usize,
3582 _depth: fidl::encoding::Depth,
3583 ) -> fidl::Result<()> {
3584 encoder.debug_check_bounds::<StarnixVolumeProviderMountRequest>(offset);
3585 fidl::encoding::Encode::<
3587 StarnixVolumeProviderMountRequest,
3588 fidl::encoding::DefaultFuchsiaResourceDialect,
3589 >::encode(
3590 (
3591 <fidl::encoding::Endpoint<
3592 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
3593 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3594 &mut self.crypt
3595 ),
3596 <fidl::encoding::Endpoint<
3597 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3598 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3599 &mut self.exposed_dir
3600 ),
3601 ),
3602 encoder,
3603 offset,
3604 _depth,
3605 )
3606 }
3607 }
3608 unsafe impl<
3609 T0: fidl::encoding::Encode<
3610 fidl::encoding::Endpoint<
3611 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
3612 >,
3613 fidl::encoding::DefaultFuchsiaResourceDialect,
3614 >,
3615 T1: fidl::encoding::Encode<
3616 fidl::encoding::Endpoint<
3617 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3618 >,
3619 fidl::encoding::DefaultFuchsiaResourceDialect,
3620 >,
3621 >
3622 fidl::encoding::Encode<
3623 StarnixVolumeProviderMountRequest,
3624 fidl::encoding::DefaultFuchsiaResourceDialect,
3625 > for (T0, T1)
3626 {
3627 #[inline]
3628 unsafe fn encode(
3629 self,
3630 encoder: &mut fidl::encoding::Encoder<
3631 '_,
3632 fidl::encoding::DefaultFuchsiaResourceDialect,
3633 >,
3634 offset: usize,
3635 depth: fidl::encoding::Depth,
3636 ) -> fidl::Result<()> {
3637 encoder.debug_check_bounds::<StarnixVolumeProviderMountRequest>(offset);
3638 self.0.encode(encoder, offset + 0, depth)?;
3642 self.1.encode(encoder, offset + 4, depth)?;
3643 Ok(())
3644 }
3645 }
3646
3647 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3648 for StarnixVolumeProviderMountRequest
3649 {
3650 #[inline(always)]
3651 fn new_empty() -> Self {
3652 Self {
3653 crypt: fidl::new_empty!(
3654 fidl::encoding::Endpoint<
3655 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
3656 >,
3657 fidl::encoding::DefaultFuchsiaResourceDialect
3658 ),
3659 exposed_dir: fidl::new_empty!(
3660 fidl::encoding::Endpoint<
3661 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3662 >,
3663 fidl::encoding::DefaultFuchsiaResourceDialect
3664 ),
3665 }
3666 }
3667
3668 #[inline]
3669 unsafe fn decode(
3670 &mut self,
3671 decoder: &mut fidl::encoding::Decoder<
3672 '_,
3673 fidl::encoding::DefaultFuchsiaResourceDialect,
3674 >,
3675 offset: usize,
3676 _depth: fidl::encoding::Depth,
3677 ) -> fidl::Result<()> {
3678 decoder.debug_check_bounds::<Self>(offset);
3679 fidl::decode!(
3681 fidl::encoding::Endpoint<
3682 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
3683 >,
3684 fidl::encoding::DefaultFuchsiaResourceDialect,
3685 &mut self.crypt,
3686 decoder,
3687 offset + 0,
3688 _depth
3689 )?;
3690 fidl::decode!(
3691 fidl::encoding::Endpoint<
3692 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3693 >,
3694 fidl::encoding::DefaultFuchsiaResourceDialect,
3695 &mut self.exposed_dir,
3696 decoder,
3697 offset + 4,
3698 _depth
3699 )?;
3700 Ok(())
3701 }
3702 }
3703
3704 impl MountOptions {
3705 #[inline(always)]
3706 fn max_ordinal_present(&self) -> u64 {
3707 if let Some(_) = self.write_compression_algorithm {
3708 return 4;
3709 }
3710 if let Some(_) = self.verbose {
3711 return 3;
3712 }
3713 if let Some(_) = self.collect_metrics {
3714 return 2;
3715 }
3716 if let Some(_) = self.read_only {
3717 return 1;
3718 }
3719 0
3720 }
3721 }
3722
3723 impl fidl::encoding::ResourceTypeMarker for MountOptions {
3724 type Borrowed<'a> = &'a mut Self;
3725 fn take_or_borrow<'a>(
3726 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3727 ) -> Self::Borrowed<'a> {
3728 value
3729 }
3730 }
3731
3732 unsafe impl fidl::encoding::TypeMarker for MountOptions {
3733 type Owned = Self;
3734
3735 #[inline(always)]
3736 fn inline_align(_context: fidl::encoding::Context) -> usize {
3737 8
3738 }
3739
3740 #[inline(always)]
3741 fn inline_size(_context: fidl::encoding::Context) -> usize {
3742 16
3743 }
3744 }
3745
3746 unsafe impl fidl::encoding::Encode<MountOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
3747 for &mut MountOptions
3748 {
3749 unsafe fn encode(
3750 self,
3751 encoder: &mut fidl::encoding::Encoder<
3752 '_,
3753 fidl::encoding::DefaultFuchsiaResourceDialect,
3754 >,
3755 offset: usize,
3756 mut depth: fidl::encoding::Depth,
3757 ) -> fidl::Result<()> {
3758 encoder.debug_check_bounds::<MountOptions>(offset);
3759 let max_ordinal: u64 = self.max_ordinal_present();
3761 encoder.write_num(max_ordinal, offset);
3762 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3763 if max_ordinal == 0 {
3765 return Ok(());
3766 }
3767 depth.increment()?;
3768 let envelope_size = 8;
3769 let bytes_len = max_ordinal as usize * envelope_size;
3770 #[allow(unused_variables)]
3771 let offset = encoder.out_of_line_offset(bytes_len);
3772 let mut _prev_end_offset: usize = 0;
3773 if 1 > max_ordinal {
3774 return Ok(());
3775 }
3776
3777 let cur_offset: usize = (1 - 1) * envelope_size;
3780
3781 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3783
3784 fidl::encoding::encode_in_envelope_optional::<
3789 bool,
3790 fidl::encoding::DefaultFuchsiaResourceDialect,
3791 >(
3792 self.read_only.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3793 encoder,
3794 offset + cur_offset,
3795 depth,
3796 )?;
3797
3798 _prev_end_offset = cur_offset + envelope_size;
3799 if 2 > max_ordinal {
3800 return Ok(());
3801 }
3802
3803 let cur_offset: usize = (2 - 1) * envelope_size;
3806
3807 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3809
3810 fidl::encoding::encode_in_envelope_optional::<
3815 bool,
3816 fidl::encoding::DefaultFuchsiaResourceDialect,
3817 >(
3818 self.collect_metrics
3819 .as_ref()
3820 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3821 encoder,
3822 offset + cur_offset,
3823 depth,
3824 )?;
3825
3826 _prev_end_offset = cur_offset + envelope_size;
3827 if 3 > max_ordinal {
3828 return Ok(());
3829 }
3830
3831 let cur_offset: usize = (3 - 1) * envelope_size;
3834
3835 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3837
3838 fidl::encoding::encode_in_envelope_optional::<
3843 bool,
3844 fidl::encoding::DefaultFuchsiaResourceDialect,
3845 >(
3846 self.verbose.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3847 encoder,
3848 offset + cur_offset,
3849 depth,
3850 )?;
3851
3852 _prev_end_offset = cur_offset + envelope_size;
3853 if 4 > max_ordinal {
3854 return Ok(());
3855 }
3856
3857 let cur_offset: usize = (4 - 1) * envelope_size;
3860
3861 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3863
3864 fidl::encoding::encode_in_envelope_optional::<
3869 fidl::encoding::BoundedString<32>,
3870 fidl::encoding::DefaultFuchsiaResourceDialect,
3871 >(
3872 self.write_compression_algorithm.as_ref().map(
3873 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
3874 ),
3875 encoder,
3876 offset + cur_offset,
3877 depth,
3878 )?;
3879
3880 _prev_end_offset = cur_offset + envelope_size;
3881
3882 Ok(())
3883 }
3884 }
3885
3886 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for MountOptions {
3887 #[inline(always)]
3888 fn new_empty() -> Self {
3889 Self::default()
3890 }
3891
3892 unsafe fn decode(
3893 &mut self,
3894 decoder: &mut fidl::encoding::Decoder<
3895 '_,
3896 fidl::encoding::DefaultFuchsiaResourceDialect,
3897 >,
3898 offset: usize,
3899 mut depth: fidl::encoding::Depth,
3900 ) -> fidl::Result<()> {
3901 decoder.debug_check_bounds::<Self>(offset);
3902 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3903 None => return Err(fidl::Error::NotNullable),
3904 Some(len) => len,
3905 };
3906 if len == 0 {
3908 return Ok(());
3909 };
3910 depth.increment()?;
3911 let envelope_size = 8;
3912 let bytes_len = len * envelope_size;
3913 let offset = decoder.out_of_line_offset(bytes_len)?;
3914 let mut _next_ordinal_to_read = 0;
3916 let mut next_offset = offset;
3917 let end_offset = offset + bytes_len;
3918 _next_ordinal_to_read += 1;
3919 if next_offset >= end_offset {
3920 return Ok(());
3921 }
3922
3923 while _next_ordinal_to_read < 1 {
3925 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3926 _next_ordinal_to_read += 1;
3927 next_offset += envelope_size;
3928 }
3929
3930 let next_out_of_line = decoder.next_out_of_line();
3931 let handles_before = decoder.remaining_handles();
3932 if let Some((inlined, num_bytes, num_handles)) =
3933 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3934 {
3935 let member_inline_size =
3936 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3937 if inlined != (member_inline_size <= 4) {
3938 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3939 }
3940 let inner_offset;
3941 let mut inner_depth = depth.clone();
3942 if inlined {
3943 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3944 inner_offset = next_offset;
3945 } else {
3946 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3947 inner_depth.increment()?;
3948 }
3949 let val_ref = self.read_only.get_or_insert_with(|| {
3950 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
3951 });
3952 fidl::decode!(
3953 bool,
3954 fidl::encoding::DefaultFuchsiaResourceDialect,
3955 val_ref,
3956 decoder,
3957 inner_offset,
3958 inner_depth
3959 )?;
3960 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3961 {
3962 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3963 }
3964 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3965 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3966 }
3967 }
3968
3969 next_offset += envelope_size;
3970 _next_ordinal_to_read += 1;
3971 if next_offset >= end_offset {
3972 return Ok(());
3973 }
3974
3975 while _next_ordinal_to_read < 2 {
3977 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3978 _next_ordinal_to_read += 1;
3979 next_offset += envelope_size;
3980 }
3981
3982 let next_out_of_line = decoder.next_out_of_line();
3983 let handles_before = decoder.remaining_handles();
3984 if let Some((inlined, num_bytes, num_handles)) =
3985 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3986 {
3987 let member_inline_size =
3988 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3989 if inlined != (member_inline_size <= 4) {
3990 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3991 }
3992 let inner_offset;
3993 let mut inner_depth = depth.clone();
3994 if inlined {
3995 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3996 inner_offset = next_offset;
3997 } else {
3998 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3999 inner_depth.increment()?;
4000 }
4001 let val_ref = self.collect_metrics.get_or_insert_with(|| {
4002 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
4003 });
4004 fidl::decode!(
4005 bool,
4006 fidl::encoding::DefaultFuchsiaResourceDialect,
4007 val_ref,
4008 decoder,
4009 inner_offset,
4010 inner_depth
4011 )?;
4012 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4013 {
4014 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4015 }
4016 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4017 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4018 }
4019 }
4020
4021 next_offset += envelope_size;
4022 _next_ordinal_to_read += 1;
4023 if next_offset >= end_offset {
4024 return Ok(());
4025 }
4026
4027 while _next_ordinal_to_read < 3 {
4029 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4030 _next_ordinal_to_read += 1;
4031 next_offset += envelope_size;
4032 }
4033
4034 let next_out_of_line = decoder.next_out_of_line();
4035 let handles_before = decoder.remaining_handles();
4036 if let Some((inlined, num_bytes, num_handles)) =
4037 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4038 {
4039 let member_inline_size =
4040 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4041 if inlined != (member_inline_size <= 4) {
4042 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4043 }
4044 let inner_offset;
4045 let mut inner_depth = depth.clone();
4046 if inlined {
4047 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4048 inner_offset = next_offset;
4049 } else {
4050 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4051 inner_depth.increment()?;
4052 }
4053 let val_ref = self.verbose.get_or_insert_with(|| {
4054 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
4055 });
4056 fidl::decode!(
4057 bool,
4058 fidl::encoding::DefaultFuchsiaResourceDialect,
4059 val_ref,
4060 decoder,
4061 inner_offset,
4062 inner_depth
4063 )?;
4064 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4065 {
4066 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4067 }
4068 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4069 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4070 }
4071 }
4072
4073 next_offset += envelope_size;
4074 _next_ordinal_to_read += 1;
4075 if next_offset >= end_offset {
4076 return Ok(());
4077 }
4078
4079 while _next_ordinal_to_read < 4 {
4081 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4082 _next_ordinal_to_read += 1;
4083 next_offset += envelope_size;
4084 }
4085
4086 let next_out_of_line = decoder.next_out_of_line();
4087 let handles_before = decoder.remaining_handles();
4088 if let Some((inlined, num_bytes, num_handles)) =
4089 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4090 {
4091 let member_inline_size =
4092 <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
4093 decoder.context,
4094 );
4095 if inlined != (member_inline_size <= 4) {
4096 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4097 }
4098 let inner_offset;
4099 let mut inner_depth = depth.clone();
4100 if inlined {
4101 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4102 inner_offset = next_offset;
4103 } else {
4104 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4105 inner_depth.increment()?;
4106 }
4107 let val_ref = self.write_compression_algorithm.get_or_insert_with(|| {
4108 fidl::new_empty!(
4109 fidl::encoding::BoundedString<32>,
4110 fidl::encoding::DefaultFuchsiaResourceDialect
4111 )
4112 });
4113 fidl::decode!(
4114 fidl::encoding::BoundedString<32>,
4115 fidl::encoding::DefaultFuchsiaResourceDialect,
4116 val_ref,
4117 decoder,
4118 inner_offset,
4119 inner_depth
4120 )?;
4121 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4122 {
4123 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4124 }
4125 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4126 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4127 }
4128 }
4129
4130 next_offset += envelope_size;
4131
4132 while next_offset < end_offset {
4134 _next_ordinal_to_read += 1;
4135 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4136 next_offset += envelope_size;
4137 }
4138
4139 Ok(())
4140 }
4141 }
4142}