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