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_hardware_block_volume_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct VolumeMarker;
16
17impl fidl::endpoints::ProtocolMarker for VolumeMarker {
18 type Proxy = VolumeProxy;
19 type RequestStream = VolumeRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = VolumeSynchronousProxy;
22
23 const DEBUG_NAME: &'static str = "fuchsia.hardware.block.volume.Volume";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for VolumeMarker {}
26
27pub trait VolumeProxyInterface: Send + Sync {
28 type GetInfoResponseFut: std::future::Future<
29 Output = Result<fidl_fuchsia_hardware_block::BlockGetInfoResult, fidl::Error>,
30 > + Send;
31 fn r#get_info(&self) -> Self::GetInfoResponseFut;
32 type GetStatsResponseFut: std::future::Future<
33 Output = Result<fidl_fuchsia_hardware_block::BlockGetStatsResult, fidl::Error>,
34 > + Send;
35 fn r#get_stats(&self, clear: bool) -> Self::GetStatsResponseFut;
36 fn r#open_session(
37 &self,
38 session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
39 ) -> Result<(), fidl::Error>;
40 fn r#open_session_with_offset_map(
41 &self,
42 session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
43 offset_map: Option<
44 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::OffsetMapMarker>,
45 >,
46 initial_mappings: Option<&[fidl_fuchsia_hardware_block::BlockOffsetMapping]>,
47 ) -> Result<(), fidl::Error>;
48 type GetTypeGuidResponseFut: std::future::Future<
49 Output = Result<
50 (i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
51 fidl::Error,
52 >,
53 > + Send;
54 fn r#get_type_guid(&self) -> Self::GetTypeGuidResponseFut;
55 type GetInstanceGuidResponseFut: std::future::Future<
56 Output = Result<
57 (i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
58 fidl::Error,
59 >,
60 > + Send;
61 fn r#get_instance_guid(&self) -> Self::GetInstanceGuidResponseFut;
62 type GetNameResponseFut: std::future::Future<Output = Result<(i32, Option<String>), fidl::Error>>
63 + Send;
64 fn r#get_name(&self) -> Self::GetNameResponseFut;
65 type GetMetadataResponseFut: std::future::Future<
66 Output = Result<
67 fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult,
68 fidl::Error,
69 >,
70 > + Send;
71 fn r#get_metadata(&self) -> Self::GetMetadataResponseFut;
72 type QuerySlicesResponseFut: std::future::Future<Output = Result<(i32, [VsliceRange; 16], u64), fidl::Error>>
73 + Send;
74 fn r#query_slices(&self, start_slices: &[u64]) -> Self::QuerySlicesResponseFut;
75 type GetVolumeInfoResponseFut: std::future::Future<
76 Output = Result<
77 (i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
78 fidl::Error,
79 >,
80 > + Send;
81 fn r#get_volume_info(&self) -> Self::GetVolumeInfoResponseFut;
82 type ExtendResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
83 fn r#extend(&self, start_slice: u64, slice_count: u64) -> Self::ExtendResponseFut;
84 type ShrinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
85 fn r#shrink(&self, start_slice: u64, slice_count: u64) -> Self::ShrinkResponseFut;
86 type DestroyResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
87 fn r#destroy(&self) -> Self::DestroyResponseFut;
88}
89#[derive(Debug)]
90#[cfg(target_os = "fuchsia")]
91pub struct VolumeSynchronousProxy {
92 client: fidl::client::sync::Client,
93}
94
95#[cfg(target_os = "fuchsia")]
96impl fidl::endpoints::SynchronousProxy for VolumeSynchronousProxy {
97 type Proxy = VolumeProxy;
98 type Protocol = VolumeMarker;
99
100 fn from_channel(inner: fidl::Channel) -> Self {
101 Self::new(inner)
102 }
103
104 fn into_channel(self) -> fidl::Channel {
105 self.client.into_channel()
106 }
107
108 fn as_channel(&self) -> &fidl::Channel {
109 self.client.as_channel()
110 }
111}
112
113#[cfg(target_os = "fuchsia")]
114impl VolumeSynchronousProxy {
115 pub fn new(channel: fidl::Channel) -> Self {
116 let protocol_name = <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
117 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
118 }
119
120 pub fn into_channel(self) -> fidl::Channel {
121 self.client.into_channel()
122 }
123
124 pub fn wait_for_event(
127 &self,
128 deadline: zx::MonotonicInstant,
129 ) -> Result<VolumeEvent, fidl::Error> {
130 VolumeEvent::decode(self.client.wait_for_event(deadline)?)
131 }
132
133 pub fn r#get_info(
135 &self,
136 ___deadline: zx::MonotonicInstant,
137 ) -> Result<fidl_fuchsia_hardware_block::BlockGetInfoResult, fidl::Error> {
138 let _response =
139 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
140 fidl_fuchsia_hardware_block::BlockGetInfoResponse,
141 i32,
142 >>(
143 (),
144 0x79df1a5cdb6cc6a3,
145 fidl::encoding::DynamicFlags::empty(),
146 ___deadline,
147 )?;
148 Ok(_response.map(|x| x.info))
149 }
150
151 pub fn r#get_stats(
153 &self,
154 mut clear: bool,
155 ___deadline: zx::MonotonicInstant,
156 ) -> Result<fidl_fuchsia_hardware_block::BlockGetStatsResult, fidl::Error> {
157 let _response = self.client.send_query::<
158 fidl_fuchsia_hardware_block::BlockGetStatsRequest,
159 fidl::encoding::ResultType<fidl_fuchsia_hardware_block::BlockGetStatsResponse, i32>,
160 >(
161 (clear,),
162 0x53d9542a778385ae,
163 fidl::encoding::DynamicFlags::empty(),
164 ___deadline,
165 )?;
166 Ok(_response.map(|x| x.stats))
167 }
168
169 pub fn r#open_session(
171 &self,
172 mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
173 ) -> Result<(), fidl::Error> {
174 self.client.send::<fidl_fuchsia_hardware_block::BlockOpenSessionRequest>(
175 (session,),
176 0x7241c68d17614a31,
177 fidl::encoding::DynamicFlags::empty(),
178 )
179 }
180
181 pub fn r#open_session_with_offset_map(
201 &self,
202 mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
203 mut offset_map: Option<
204 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::OffsetMapMarker>,
205 >,
206 mut initial_mappings: Option<&[fidl_fuchsia_hardware_block::BlockOffsetMapping]>,
207 ) -> Result<(), fidl::Error> {
208 self.client.send::<fidl_fuchsia_hardware_block::BlockOpenSessionWithOffsetMapRequest>(
209 (session, offset_map, initial_mappings),
210 0x7a8d3ba3d8bfa10f,
211 fidl::encoding::DynamicFlags::empty(),
212 )
213 }
214
215 pub fn r#get_type_guid(
218 &self,
219 ___deadline: zx::MonotonicInstant,
220 ) -> Result<(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>), fidl::Error> {
221 let _response = self.client.send_query::<
222 fidl::encoding::EmptyPayload,
223 fidl_fuchsia_hardware_block_partition::PartitionGetTypeGuidResponse,
224 >(
225 (),
226 0x111843d737a9b847,
227 fidl::encoding::DynamicFlags::empty(),
228 ___deadline,
229 )?;
230 Ok((_response.status, _response.guid))
231 }
232
233 pub fn r#get_instance_guid(
236 &self,
237 ___deadline: zx::MonotonicInstant,
238 ) -> Result<(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>), fidl::Error> {
239 let _response = self.client.send_query::<
240 fidl::encoding::EmptyPayload,
241 fidl_fuchsia_hardware_block_partition::PartitionGetInstanceGuidResponse,
242 >(
243 (),
244 0x14a5a573b275d435,
245 fidl::encoding::DynamicFlags::empty(),
246 ___deadline,
247 )?;
248 Ok((_response.status, _response.guid))
249 }
250
251 pub fn r#get_name(
254 &self,
255 ___deadline: zx::MonotonicInstant,
256 ) -> Result<(i32, Option<String>), fidl::Error> {
257 let _response = self.client.send_query::<
258 fidl::encoding::EmptyPayload,
259 fidl_fuchsia_hardware_block_partition::PartitionGetNameResponse,
260 >(
261 (),
262 0x7e3c6f0b0937fc02,
263 fidl::encoding::DynamicFlags::empty(),
264 ___deadline,
265 )?;
266 Ok((_response.status, _response.name))
267 }
268
269 pub fn r#get_metadata(
273 &self,
274 ___deadline: zx::MonotonicInstant,
275 ) -> Result<fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult, fidl::Error>
276 {
277 let _response = self
278 .client
279 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
280 fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
281 i32,
282 >>(
283 (), 0x42d1464c96c3f3ff, fidl::encoding::DynamicFlags::empty(), ___deadline
284 )?;
285 Ok(_response.map(|x| x))
286 }
287
288 pub fn r#query_slices(
291 &self,
292 mut start_slices: &[u64],
293 ___deadline: zx::MonotonicInstant,
294 ) -> Result<(i32, [VsliceRange; 16], u64), fidl::Error> {
295 let _response =
296 self.client.send_query::<VolumeQuerySlicesRequest, VolumeQuerySlicesResponse>(
297 (start_slices,),
298 0x589a96828a3e2aa1,
299 fidl::encoding::DynamicFlags::empty(),
300 ___deadline,
301 )?;
302 Ok((_response.status, _response.response, _response.response_count))
303 }
304
305 pub fn r#get_volume_info(
307 &self,
308 ___deadline: zx::MonotonicInstant,
309 ) -> Result<(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>), fidl::Error> {
310 let _response =
311 self.client.send_query::<fidl::encoding::EmptyPayload, VolumeGetVolumeInfoResponse>(
312 (),
313 0x60417b6cf9e34c80,
314 fidl::encoding::DynamicFlags::empty(),
315 ___deadline,
316 )?;
317 Ok((_response.status, _response.manager, _response.volume))
318 }
319
320 pub fn r#extend(
326 &self,
327 mut start_slice: u64,
328 mut slice_count: u64,
329 ___deadline: zx::MonotonicInstant,
330 ) -> Result<i32, fidl::Error> {
331 let _response = self.client.send_query::<VolumeExtendRequest, VolumeExtendResponse>(
332 (start_slice, slice_count),
333 0xdddf872f5039d37,
334 fidl::encoding::DynamicFlags::empty(),
335 ___deadline,
336 )?;
337 Ok(_response.status)
338 }
339
340 pub fn r#shrink(
343 &self,
344 mut start_slice: u64,
345 mut slice_count: u64,
346 ___deadline: zx::MonotonicInstant,
347 ) -> Result<i32, fidl::Error> {
348 let _response = self.client.send_query::<VolumeShrinkRequest, VolumeShrinkResponse>(
349 (start_slice, slice_count),
350 0x27ab5ed4f6fdcd29,
351 fidl::encoding::DynamicFlags::empty(),
352 ___deadline,
353 )?;
354 Ok(_response.status)
355 }
356
357 pub fn r#destroy(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
360 let _response =
361 self.client.send_query::<fidl::encoding::EmptyPayload, VolumeDestroyResponse>(
362 (),
363 0x732bf4bea39b5e87,
364 fidl::encoding::DynamicFlags::empty(),
365 ___deadline,
366 )?;
367 Ok(_response.status)
368 }
369}
370
371#[cfg(target_os = "fuchsia")]
372impl From<VolumeSynchronousProxy> for zx::Handle {
373 fn from(value: VolumeSynchronousProxy) -> Self {
374 value.into_channel().into()
375 }
376}
377
378#[cfg(target_os = "fuchsia")]
379impl From<fidl::Channel> for VolumeSynchronousProxy {
380 fn from(value: fidl::Channel) -> Self {
381 Self::new(value)
382 }
383}
384
385#[derive(Debug, Clone)]
386pub struct VolumeProxy {
387 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
388}
389
390impl fidl::endpoints::Proxy for VolumeProxy {
391 type Protocol = VolumeMarker;
392
393 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
394 Self::new(inner)
395 }
396
397 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
398 self.client.into_channel().map_err(|client| Self { client })
399 }
400
401 fn as_channel(&self) -> &::fidl::AsyncChannel {
402 self.client.as_channel()
403 }
404}
405
406impl VolumeProxy {
407 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
409 let protocol_name = <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
410 Self { client: fidl::client::Client::new(channel, protocol_name) }
411 }
412
413 pub fn take_event_stream(&self) -> VolumeEventStream {
419 VolumeEventStream { event_receiver: self.client.take_event_receiver() }
420 }
421
422 pub fn r#get_info(
424 &self,
425 ) -> fidl::client::QueryResponseFut<
426 fidl_fuchsia_hardware_block::BlockGetInfoResult,
427 fidl::encoding::DefaultFuchsiaResourceDialect,
428 > {
429 VolumeProxyInterface::r#get_info(self)
430 }
431
432 pub fn r#get_stats(
434 &self,
435 mut clear: bool,
436 ) -> fidl::client::QueryResponseFut<
437 fidl_fuchsia_hardware_block::BlockGetStatsResult,
438 fidl::encoding::DefaultFuchsiaResourceDialect,
439 > {
440 VolumeProxyInterface::r#get_stats(self, clear)
441 }
442
443 pub fn r#open_session(
445 &self,
446 mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
447 ) -> Result<(), fidl::Error> {
448 VolumeProxyInterface::r#open_session(self, session)
449 }
450
451 pub fn r#open_session_with_offset_map(
471 &self,
472 mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
473 mut offset_map: Option<
474 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::OffsetMapMarker>,
475 >,
476 mut initial_mappings: Option<&[fidl_fuchsia_hardware_block::BlockOffsetMapping]>,
477 ) -> Result<(), fidl::Error> {
478 VolumeProxyInterface::r#open_session_with_offset_map(
479 self,
480 session,
481 offset_map,
482 initial_mappings,
483 )
484 }
485
486 pub fn r#get_type_guid(
489 &self,
490 ) -> fidl::client::QueryResponseFut<
491 (i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
492 fidl::encoding::DefaultFuchsiaResourceDialect,
493 > {
494 VolumeProxyInterface::r#get_type_guid(self)
495 }
496
497 pub fn r#get_instance_guid(
500 &self,
501 ) -> fidl::client::QueryResponseFut<
502 (i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
503 fidl::encoding::DefaultFuchsiaResourceDialect,
504 > {
505 VolumeProxyInterface::r#get_instance_guid(self)
506 }
507
508 pub fn r#get_name(
511 &self,
512 ) -> fidl::client::QueryResponseFut<
513 (i32, Option<String>),
514 fidl::encoding::DefaultFuchsiaResourceDialect,
515 > {
516 VolumeProxyInterface::r#get_name(self)
517 }
518
519 pub fn r#get_metadata(
523 &self,
524 ) -> fidl::client::QueryResponseFut<
525 fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult,
526 fidl::encoding::DefaultFuchsiaResourceDialect,
527 > {
528 VolumeProxyInterface::r#get_metadata(self)
529 }
530
531 pub fn r#query_slices(
534 &self,
535 mut start_slices: &[u64],
536 ) -> fidl::client::QueryResponseFut<
537 (i32, [VsliceRange; 16], u64),
538 fidl::encoding::DefaultFuchsiaResourceDialect,
539 > {
540 VolumeProxyInterface::r#query_slices(self, start_slices)
541 }
542
543 pub fn r#get_volume_info(
545 &self,
546 ) -> fidl::client::QueryResponseFut<
547 (i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
548 fidl::encoding::DefaultFuchsiaResourceDialect,
549 > {
550 VolumeProxyInterface::r#get_volume_info(self)
551 }
552
553 pub fn r#extend(
559 &self,
560 mut start_slice: u64,
561 mut slice_count: u64,
562 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
563 VolumeProxyInterface::r#extend(self, start_slice, slice_count)
564 }
565
566 pub fn r#shrink(
569 &self,
570 mut start_slice: u64,
571 mut slice_count: u64,
572 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
573 VolumeProxyInterface::r#shrink(self, start_slice, slice_count)
574 }
575
576 pub fn r#destroy(
579 &self,
580 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
581 VolumeProxyInterface::r#destroy(self)
582 }
583}
584
585impl VolumeProxyInterface for VolumeProxy {
586 type GetInfoResponseFut = fidl::client::QueryResponseFut<
587 fidl_fuchsia_hardware_block::BlockGetInfoResult,
588 fidl::encoding::DefaultFuchsiaResourceDialect,
589 >;
590 fn r#get_info(&self) -> Self::GetInfoResponseFut {
591 fn _decode(
592 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
593 ) -> Result<fidl_fuchsia_hardware_block::BlockGetInfoResult, fidl::Error> {
594 let _response = fidl::client::decode_transaction_body::<
595 fidl::encoding::ResultType<fidl_fuchsia_hardware_block::BlockGetInfoResponse, i32>,
596 fidl::encoding::DefaultFuchsiaResourceDialect,
597 0x79df1a5cdb6cc6a3,
598 >(_buf?)?;
599 Ok(_response.map(|x| x.info))
600 }
601 self.client.send_query_and_decode::<
602 fidl::encoding::EmptyPayload,
603 fidl_fuchsia_hardware_block::BlockGetInfoResult,
604 >(
605 (),
606 0x79df1a5cdb6cc6a3,
607 fidl::encoding::DynamicFlags::empty(),
608 _decode,
609 )
610 }
611
612 type GetStatsResponseFut = fidl::client::QueryResponseFut<
613 fidl_fuchsia_hardware_block::BlockGetStatsResult,
614 fidl::encoding::DefaultFuchsiaResourceDialect,
615 >;
616 fn r#get_stats(&self, mut clear: bool) -> Self::GetStatsResponseFut {
617 fn _decode(
618 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
619 ) -> Result<fidl_fuchsia_hardware_block::BlockGetStatsResult, fidl::Error> {
620 let _response = fidl::client::decode_transaction_body::<
621 fidl::encoding::ResultType<fidl_fuchsia_hardware_block::BlockGetStatsResponse, i32>,
622 fidl::encoding::DefaultFuchsiaResourceDialect,
623 0x53d9542a778385ae,
624 >(_buf?)?;
625 Ok(_response.map(|x| x.stats))
626 }
627 self.client.send_query_and_decode::<
628 fidl_fuchsia_hardware_block::BlockGetStatsRequest,
629 fidl_fuchsia_hardware_block::BlockGetStatsResult,
630 >(
631 (clear,),
632 0x53d9542a778385ae,
633 fidl::encoding::DynamicFlags::empty(),
634 _decode,
635 )
636 }
637
638 fn r#open_session(
639 &self,
640 mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
641 ) -> Result<(), fidl::Error> {
642 self.client.send::<fidl_fuchsia_hardware_block::BlockOpenSessionRequest>(
643 (session,),
644 0x7241c68d17614a31,
645 fidl::encoding::DynamicFlags::empty(),
646 )
647 }
648
649 fn r#open_session_with_offset_map(
650 &self,
651 mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
652 mut offset_map: Option<
653 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::OffsetMapMarker>,
654 >,
655 mut initial_mappings: Option<&[fidl_fuchsia_hardware_block::BlockOffsetMapping]>,
656 ) -> Result<(), fidl::Error> {
657 self.client.send::<fidl_fuchsia_hardware_block::BlockOpenSessionWithOffsetMapRequest>(
658 (session, offset_map, initial_mappings),
659 0x7a8d3ba3d8bfa10f,
660 fidl::encoding::DynamicFlags::empty(),
661 )
662 }
663
664 type GetTypeGuidResponseFut = fidl::client::QueryResponseFut<
665 (i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
666 fidl::encoding::DefaultFuchsiaResourceDialect,
667 >;
668 fn r#get_type_guid(&self) -> Self::GetTypeGuidResponseFut {
669 fn _decode(
670 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
671 ) -> Result<(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>), fidl::Error>
672 {
673 let _response = fidl::client::decode_transaction_body::<
674 fidl_fuchsia_hardware_block_partition::PartitionGetTypeGuidResponse,
675 fidl::encoding::DefaultFuchsiaResourceDialect,
676 0x111843d737a9b847,
677 >(_buf?)?;
678 Ok((_response.status, _response.guid))
679 }
680 self.client.send_query_and_decode::<
681 fidl::encoding::EmptyPayload,
682 (i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
683 >(
684 (),
685 0x111843d737a9b847,
686 fidl::encoding::DynamicFlags::empty(),
687 _decode,
688 )
689 }
690
691 type GetInstanceGuidResponseFut = fidl::client::QueryResponseFut<
692 (i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
693 fidl::encoding::DefaultFuchsiaResourceDialect,
694 >;
695 fn r#get_instance_guid(&self) -> Self::GetInstanceGuidResponseFut {
696 fn _decode(
697 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
698 ) -> Result<(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>), fidl::Error>
699 {
700 let _response = fidl::client::decode_transaction_body::<
701 fidl_fuchsia_hardware_block_partition::PartitionGetInstanceGuidResponse,
702 fidl::encoding::DefaultFuchsiaResourceDialect,
703 0x14a5a573b275d435,
704 >(_buf?)?;
705 Ok((_response.status, _response.guid))
706 }
707 self.client.send_query_and_decode::<
708 fidl::encoding::EmptyPayload,
709 (i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
710 >(
711 (),
712 0x14a5a573b275d435,
713 fidl::encoding::DynamicFlags::empty(),
714 _decode,
715 )
716 }
717
718 type GetNameResponseFut = fidl::client::QueryResponseFut<
719 (i32, Option<String>),
720 fidl::encoding::DefaultFuchsiaResourceDialect,
721 >;
722 fn r#get_name(&self) -> Self::GetNameResponseFut {
723 fn _decode(
724 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
725 ) -> Result<(i32, Option<String>), fidl::Error> {
726 let _response = fidl::client::decode_transaction_body::<
727 fidl_fuchsia_hardware_block_partition::PartitionGetNameResponse,
728 fidl::encoding::DefaultFuchsiaResourceDialect,
729 0x7e3c6f0b0937fc02,
730 >(_buf?)?;
731 Ok((_response.status, _response.name))
732 }
733 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<String>)>(
734 (),
735 0x7e3c6f0b0937fc02,
736 fidl::encoding::DynamicFlags::empty(),
737 _decode,
738 )
739 }
740
741 type GetMetadataResponseFut = fidl::client::QueryResponseFut<
742 fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult,
743 fidl::encoding::DefaultFuchsiaResourceDialect,
744 >;
745 fn r#get_metadata(&self) -> Self::GetMetadataResponseFut {
746 fn _decode(
747 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
748 ) -> Result<fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult, fidl::Error>
749 {
750 let _response = fidl::client::decode_transaction_body::<
751 fidl::encoding::ResultType<
752 fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
753 i32,
754 >,
755 fidl::encoding::DefaultFuchsiaResourceDialect,
756 0x42d1464c96c3f3ff,
757 >(_buf?)?;
758 Ok(_response.map(|x| x))
759 }
760 self.client.send_query_and_decode::<
761 fidl::encoding::EmptyPayload,
762 fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult,
763 >(
764 (),
765 0x42d1464c96c3f3ff,
766 fidl::encoding::DynamicFlags::empty(),
767 _decode,
768 )
769 }
770
771 type QuerySlicesResponseFut = fidl::client::QueryResponseFut<
772 (i32, [VsliceRange; 16], u64),
773 fidl::encoding::DefaultFuchsiaResourceDialect,
774 >;
775 fn r#query_slices(&self, mut start_slices: &[u64]) -> Self::QuerySlicesResponseFut {
776 fn _decode(
777 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
778 ) -> Result<(i32, [VsliceRange; 16], u64), fidl::Error> {
779 let _response = fidl::client::decode_transaction_body::<
780 VolumeQuerySlicesResponse,
781 fidl::encoding::DefaultFuchsiaResourceDialect,
782 0x589a96828a3e2aa1,
783 >(_buf?)?;
784 Ok((_response.status, _response.response, _response.response_count))
785 }
786 self.client
787 .send_query_and_decode::<VolumeQuerySlicesRequest, (i32, [VsliceRange; 16], u64)>(
788 (start_slices,),
789 0x589a96828a3e2aa1,
790 fidl::encoding::DynamicFlags::empty(),
791 _decode,
792 )
793 }
794
795 type GetVolumeInfoResponseFut = fidl::client::QueryResponseFut<
796 (i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
797 fidl::encoding::DefaultFuchsiaResourceDialect,
798 >;
799 fn r#get_volume_info(&self) -> Self::GetVolumeInfoResponseFut {
800 fn _decode(
801 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
802 ) -> Result<(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>), fidl::Error>
803 {
804 let _response = fidl::client::decode_transaction_body::<
805 VolumeGetVolumeInfoResponse,
806 fidl::encoding::DefaultFuchsiaResourceDialect,
807 0x60417b6cf9e34c80,
808 >(_buf?)?;
809 Ok((_response.status, _response.manager, _response.volume))
810 }
811 self.client.send_query_and_decode::<
812 fidl::encoding::EmptyPayload,
813 (i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
814 >(
815 (),
816 0x60417b6cf9e34c80,
817 fidl::encoding::DynamicFlags::empty(),
818 _decode,
819 )
820 }
821
822 type ExtendResponseFut =
823 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
824 fn r#extend(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ExtendResponseFut {
825 fn _decode(
826 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
827 ) -> Result<i32, fidl::Error> {
828 let _response = fidl::client::decode_transaction_body::<
829 VolumeExtendResponse,
830 fidl::encoding::DefaultFuchsiaResourceDialect,
831 0xdddf872f5039d37,
832 >(_buf?)?;
833 Ok(_response.status)
834 }
835 self.client.send_query_and_decode::<VolumeExtendRequest, i32>(
836 (start_slice, slice_count),
837 0xdddf872f5039d37,
838 fidl::encoding::DynamicFlags::empty(),
839 _decode,
840 )
841 }
842
843 type ShrinkResponseFut =
844 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
845 fn r#shrink(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ShrinkResponseFut {
846 fn _decode(
847 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
848 ) -> Result<i32, fidl::Error> {
849 let _response = fidl::client::decode_transaction_body::<
850 VolumeShrinkResponse,
851 fidl::encoding::DefaultFuchsiaResourceDialect,
852 0x27ab5ed4f6fdcd29,
853 >(_buf?)?;
854 Ok(_response.status)
855 }
856 self.client.send_query_and_decode::<VolumeShrinkRequest, i32>(
857 (start_slice, slice_count),
858 0x27ab5ed4f6fdcd29,
859 fidl::encoding::DynamicFlags::empty(),
860 _decode,
861 )
862 }
863
864 type DestroyResponseFut =
865 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
866 fn r#destroy(&self) -> Self::DestroyResponseFut {
867 fn _decode(
868 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
869 ) -> Result<i32, fidl::Error> {
870 let _response = fidl::client::decode_transaction_body::<
871 VolumeDestroyResponse,
872 fidl::encoding::DefaultFuchsiaResourceDialect,
873 0x732bf4bea39b5e87,
874 >(_buf?)?;
875 Ok(_response.status)
876 }
877 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
878 (),
879 0x732bf4bea39b5e87,
880 fidl::encoding::DynamicFlags::empty(),
881 _decode,
882 )
883 }
884}
885
886pub struct VolumeEventStream {
887 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
888}
889
890impl std::marker::Unpin for VolumeEventStream {}
891
892impl futures::stream::FusedStream for VolumeEventStream {
893 fn is_terminated(&self) -> bool {
894 self.event_receiver.is_terminated()
895 }
896}
897
898impl futures::Stream for VolumeEventStream {
899 type Item = Result<VolumeEvent, fidl::Error>;
900
901 fn poll_next(
902 mut self: std::pin::Pin<&mut Self>,
903 cx: &mut std::task::Context<'_>,
904 ) -> std::task::Poll<Option<Self::Item>> {
905 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
906 &mut self.event_receiver,
907 cx
908 )?) {
909 Some(buf) => std::task::Poll::Ready(Some(VolumeEvent::decode(buf))),
910 None => std::task::Poll::Ready(None),
911 }
912 }
913}
914
915#[derive(Debug)]
916pub enum VolumeEvent {}
917
918impl VolumeEvent {
919 fn decode(
921 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
922 ) -> Result<VolumeEvent, fidl::Error> {
923 let (bytes, _handles) = buf.split_mut();
924 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
925 debug_assert_eq!(tx_header.tx_id, 0);
926 match tx_header.ordinal {
927 _ => Err(fidl::Error::UnknownOrdinal {
928 ordinal: tx_header.ordinal,
929 protocol_name: <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
930 }),
931 }
932 }
933}
934
935pub struct VolumeRequestStream {
937 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
938 is_terminated: bool,
939}
940
941impl std::marker::Unpin for VolumeRequestStream {}
942
943impl futures::stream::FusedStream for VolumeRequestStream {
944 fn is_terminated(&self) -> bool {
945 self.is_terminated
946 }
947}
948
949impl fidl::endpoints::RequestStream for VolumeRequestStream {
950 type Protocol = VolumeMarker;
951 type ControlHandle = VolumeControlHandle;
952
953 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
954 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
955 }
956
957 fn control_handle(&self) -> Self::ControlHandle {
958 VolumeControlHandle { inner: self.inner.clone() }
959 }
960
961 fn into_inner(
962 self,
963 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
964 {
965 (self.inner, self.is_terminated)
966 }
967
968 fn from_inner(
969 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
970 is_terminated: bool,
971 ) -> Self {
972 Self { inner, is_terminated }
973 }
974}
975
976impl futures::Stream for VolumeRequestStream {
977 type Item = Result<VolumeRequest, fidl::Error>;
978
979 fn poll_next(
980 mut self: std::pin::Pin<&mut Self>,
981 cx: &mut std::task::Context<'_>,
982 ) -> std::task::Poll<Option<Self::Item>> {
983 let this = &mut *self;
984 if this.inner.check_shutdown(cx) {
985 this.is_terminated = true;
986 return std::task::Poll::Ready(None);
987 }
988 if this.is_terminated {
989 panic!("polled VolumeRequestStream after completion");
990 }
991 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
992 |bytes, handles| {
993 match this.inner.channel().read_etc(cx, bytes, handles) {
994 std::task::Poll::Ready(Ok(())) => {}
995 std::task::Poll::Pending => return std::task::Poll::Pending,
996 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
997 this.is_terminated = true;
998 return std::task::Poll::Ready(None);
999 }
1000 std::task::Poll::Ready(Err(e)) => {
1001 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1002 e.into(),
1003 ))))
1004 }
1005 }
1006
1007 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1009
1010 std::task::Poll::Ready(Some(match header.ordinal {
1011 0x79df1a5cdb6cc6a3 => {
1012 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1013 let mut req = fidl::new_empty!(
1014 fidl::encoding::EmptyPayload,
1015 fidl::encoding::DefaultFuchsiaResourceDialect
1016 );
1017 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1018 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1019 Ok(VolumeRequest::GetInfo {
1020 responder: VolumeGetInfoResponder {
1021 control_handle: std::mem::ManuallyDrop::new(control_handle),
1022 tx_id: header.tx_id,
1023 },
1024 })
1025 }
1026 0x53d9542a778385ae => {
1027 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1028 let mut req = fidl::new_empty!(
1029 fidl_fuchsia_hardware_block::BlockGetStatsRequest,
1030 fidl::encoding::DefaultFuchsiaResourceDialect
1031 );
1032 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_block::BlockGetStatsRequest>(&header, _body_bytes, handles, &mut req)?;
1033 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1034 Ok(VolumeRequest::GetStats {
1035 clear: req.clear,
1036
1037 responder: VolumeGetStatsResponder {
1038 control_handle: std::mem::ManuallyDrop::new(control_handle),
1039 tx_id: header.tx_id,
1040 },
1041 })
1042 }
1043 0x7241c68d17614a31 => {
1044 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1045 let mut req = fidl::new_empty!(
1046 fidl_fuchsia_hardware_block::BlockOpenSessionRequest,
1047 fidl::encoding::DefaultFuchsiaResourceDialect
1048 );
1049 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_block::BlockOpenSessionRequest>(&header, _body_bytes, handles, &mut req)?;
1050 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1051 Ok(VolumeRequest::OpenSession { session: req.session, control_handle })
1052 }
1053 0x7a8d3ba3d8bfa10f => {
1054 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1055 let mut req = fidl::new_empty!(
1056 fidl_fuchsia_hardware_block::BlockOpenSessionWithOffsetMapRequest,
1057 fidl::encoding::DefaultFuchsiaResourceDialect
1058 );
1059 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_block::BlockOpenSessionWithOffsetMapRequest>(&header, _body_bytes, handles, &mut req)?;
1060 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1061 Ok(VolumeRequest::OpenSessionWithOffsetMap {
1062 session: req.session,
1063 offset_map: req.offset_map,
1064 initial_mappings: req.initial_mappings,
1065
1066 control_handle,
1067 })
1068 }
1069 0x111843d737a9b847 => {
1070 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1071 let mut req = fidl::new_empty!(
1072 fidl::encoding::EmptyPayload,
1073 fidl::encoding::DefaultFuchsiaResourceDialect
1074 );
1075 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1076 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1077 Ok(VolumeRequest::GetTypeGuid {
1078 responder: VolumeGetTypeGuidResponder {
1079 control_handle: std::mem::ManuallyDrop::new(control_handle),
1080 tx_id: header.tx_id,
1081 },
1082 })
1083 }
1084 0x14a5a573b275d435 => {
1085 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1086 let mut req = fidl::new_empty!(
1087 fidl::encoding::EmptyPayload,
1088 fidl::encoding::DefaultFuchsiaResourceDialect
1089 );
1090 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1091 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1092 Ok(VolumeRequest::GetInstanceGuid {
1093 responder: VolumeGetInstanceGuidResponder {
1094 control_handle: std::mem::ManuallyDrop::new(control_handle),
1095 tx_id: header.tx_id,
1096 },
1097 })
1098 }
1099 0x7e3c6f0b0937fc02 => {
1100 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1101 let mut req = fidl::new_empty!(
1102 fidl::encoding::EmptyPayload,
1103 fidl::encoding::DefaultFuchsiaResourceDialect
1104 );
1105 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1106 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1107 Ok(VolumeRequest::GetName {
1108 responder: VolumeGetNameResponder {
1109 control_handle: std::mem::ManuallyDrop::new(control_handle),
1110 tx_id: header.tx_id,
1111 },
1112 })
1113 }
1114 0x42d1464c96c3f3ff => {
1115 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1116 let mut req = fidl::new_empty!(
1117 fidl::encoding::EmptyPayload,
1118 fidl::encoding::DefaultFuchsiaResourceDialect
1119 );
1120 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1121 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1122 Ok(VolumeRequest::GetMetadata {
1123 responder: VolumeGetMetadataResponder {
1124 control_handle: std::mem::ManuallyDrop::new(control_handle),
1125 tx_id: header.tx_id,
1126 },
1127 })
1128 }
1129 0x589a96828a3e2aa1 => {
1130 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1131 let mut req = fidl::new_empty!(
1132 VolumeQuerySlicesRequest,
1133 fidl::encoding::DefaultFuchsiaResourceDialect
1134 );
1135 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeQuerySlicesRequest>(&header, _body_bytes, handles, &mut req)?;
1136 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1137 Ok(VolumeRequest::QuerySlices {
1138 start_slices: req.start_slices,
1139
1140 responder: VolumeQuerySlicesResponder {
1141 control_handle: std::mem::ManuallyDrop::new(control_handle),
1142 tx_id: header.tx_id,
1143 },
1144 })
1145 }
1146 0x60417b6cf9e34c80 => {
1147 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1148 let mut req = fidl::new_empty!(
1149 fidl::encoding::EmptyPayload,
1150 fidl::encoding::DefaultFuchsiaResourceDialect
1151 );
1152 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1153 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1154 Ok(VolumeRequest::GetVolumeInfo {
1155 responder: VolumeGetVolumeInfoResponder {
1156 control_handle: std::mem::ManuallyDrop::new(control_handle),
1157 tx_id: header.tx_id,
1158 },
1159 })
1160 }
1161 0xdddf872f5039d37 => {
1162 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1163 let mut req = fidl::new_empty!(
1164 VolumeExtendRequest,
1165 fidl::encoding::DefaultFuchsiaResourceDialect
1166 );
1167 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeExtendRequest>(&header, _body_bytes, handles, &mut req)?;
1168 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1169 Ok(VolumeRequest::Extend {
1170 start_slice: req.start_slice,
1171 slice_count: req.slice_count,
1172
1173 responder: VolumeExtendResponder {
1174 control_handle: std::mem::ManuallyDrop::new(control_handle),
1175 tx_id: header.tx_id,
1176 },
1177 })
1178 }
1179 0x27ab5ed4f6fdcd29 => {
1180 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1181 let mut req = fidl::new_empty!(
1182 VolumeShrinkRequest,
1183 fidl::encoding::DefaultFuchsiaResourceDialect
1184 );
1185 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeShrinkRequest>(&header, _body_bytes, handles, &mut req)?;
1186 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1187 Ok(VolumeRequest::Shrink {
1188 start_slice: req.start_slice,
1189 slice_count: req.slice_count,
1190
1191 responder: VolumeShrinkResponder {
1192 control_handle: std::mem::ManuallyDrop::new(control_handle),
1193 tx_id: header.tx_id,
1194 },
1195 })
1196 }
1197 0x732bf4bea39b5e87 => {
1198 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1199 let mut req = fidl::new_empty!(
1200 fidl::encoding::EmptyPayload,
1201 fidl::encoding::DefaultFuchsiaResourceDialect
1202 );
1203 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1204 let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1205 Ok(VolumeRequest::Destroy {
1206 responder: VolumeDestroyResponder {
1207 control_handle: std::mem::ManuallyDrop::new(control_handle),
1208 tx_id: header.tx_id,
1209 },
1210 })
1211 }
1212 _ => Err(fidl::Error::UnknownOrdinal {
1213 ordinal: header.ordinal,
1214 protocol_name:
1215 <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1216 }),
1217 }))
1218 },
1219 )
1220 }
1221}
1222
1223#[derive(Debug)]
1225pub enum VolumeRequest {
1226 GetInfo { responder: VolumeGetInfoResponder },
1228 GetStats { clear: bool, responder: VolumeGetStatsResponder },
1230 OpenSession {
1232 session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
1233 control_handle: VolumeControlHandle,
1234 },
1235 OpenSessionWithOffsetMap {
1255 session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
1256 offset_map:
1257 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::OffsetMapMarker>>,
1258 initial_mappings: Option<Vec<fidl_fuchsia_hardware_block::BlockOffsetMapping>>,
1259 control_handle: VolumeControlHandle,
1260 },
1261 GetTypeGuid { responder: VolumeGetTypeGuidResponder },
1264 GetInstanceGuid { responder: VolumeGetInstanceGuidResponder },
1267 GetName { responder: VolumeGetNameResponder },
1270 GetMetadata { responder: VolumeGetMetadataResponder },
1274 QuerySlices { start_slices: Vec<u64>, responder: VolumeQuerySlicesResponder },
1277 GetVolumeInfo { responder: VolumeGetVolumeInfoResponder },
1279 Extend { start_slice: u64, slice_count: u64, responder: VolumeExtendResponder },
1285 Shrink { start_slice: u64, slice_count: u64, responder: VolumeShrinkResponder },
1288 Destroy { responder: VolumeDestroyResponder },
1291}
1292
1293impl VolumeRequest {
1294 #[allow(irrefutable_let_patterns)]
1295 pub fn into_get_info(self) -> Option<(VolumeGetInfoResponder)> {
1296 if let VolumeRequest::GetInfo { responder } = self {
1297 Some((responder))
1298 } else {
1299 None
1300 }
1301 }
1302
1303 #[allow(irrefutable_let_patterns)]
1304 pub fn into_get_stats(self) -> Option<(bool, VolumeGetStatsResponder)> {
1305 if let VolumeRequest::GetStats { clear, responder } = self {
1306 Some((clear, responder))
1307 } else {
1308 None
1309 }
1310 }
1311
1312 #[allow(irrefutable_let_patterns)]
1313 pub fn into_open_session(
1314 self,
1315 ) -> Option<(
1316 fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
1317 VolumeControlHandle,
1318 )> {
1319 if let VolumeRequest::OpenSession { session, control_handle } = self {
1320 Some((session, control_handle))
1321 } else {
1322 None
1323 }
1324 }
1325
1326 #[allow(irrefutable_let_patterns)]
1327 pub fn into_open_session_with_offset_map(
1328 self,
1329 ) -> Option<(
1330 fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
1331 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::OffsetMapMarker>>,
1332 Option<Vec<fidl_fuchsia_hardware_block::BlockOffsetMapping>>,
1333 VolumeControlHandle,
1334 )> {
1335 if let VolumeRequest::OpenSessionWithOffsetMap {
1336 session,
1337 offset_map,
1338 initial_mappings,
1339 control_handle,
1340 } = self
1341 {
1342 Some((session, offset_map, initial_mappings, control_handle))
1343 } else {
1344 None
1345 }
1346 }
1347
1348 #[allow(irrefutable_let_patterns)]
1349 pub fn into_get_type_guid(self) -> Option<(VolumeGetTypeGuidResponder)> {
1350 if let VolumeRequest::GetTypeGuid { responder } = self {
1351 Some((responder))
1352 } else {
1353 None
1354 }
1355 }
1356
1357 #[allow(irrefutable_let_patterns)]
1358 pub fn into_get_instance_guid(self) -> Option<(VolumeGetInstanceGuidResponder)> {
1359 if let VolumeRequest::GetInstanceGuid { responder } = self {
1360 Some((responder))
1361 } else {
1362 None
1363 }
1364 }
1365
1366 #[allow(irrefutable_let_patterns)]
1367 pub fn into_get_name(self) -> Option<(VolumeGetNameResponder)> {
1368 if let VolumeRequest::GetName { responder } = self {
1369 Some((responder))
1370 } else {
1371 None
1372 }
1373 }
1374
1375 #[allow(irrefutable_let_patterns)]
1376 pub fn into_get_metadata(self) -> Option<(VolumeGetMetadataResponder)> {
1377 if let VolumeRequest::GetMetadata { responder } = self {
1378 Some((responder))
1379 } else {
1380 None
1381 }
1382 }
1383
1384 #[allow(irrefutable_let_patterns)]
1385 pub fn into_query_slices(self) -> Option<(Vec<u64>, VolumeQuerySlicesResponder)> {
1386 if let VolumeRequest::QuerySlices { start_slices, responder } = self {
1387 Some((start_slices, responder))
1388 } else {
1389 None
1390 }
1391 }
1392
1393 #[allow(irrefutable_let_patterns)]
1394 pub fn into_get_volume_info(self) -> Option<(VolumeGetVolumeInfoResponder)> {
1395 if let VolumeRequest::GetVolumeInfo { responder } = self {
1396 Some((responder))
1397 } else {
1398 None
1399 }
1400 }
1401
1402 #[allow(irrefutable_let_patterns)]
1403 pub fn into_extend(self) -> Option<(u64, u64, VolumeExtendResponder)> {
1404 if let VolumeRequest::Extend { start_slice, slice_count, responder } = self {
1405 Some((start_slice, slice_count, responder))
1406 } else {
1407 None
1408 }
1409 }
1410
1411 #[allow(irrefutable_let_patterns)]
1412 pub fn into_shrink(self) -> Option<(u64, u64, VolumeShrinkResponder)> {
1413 if let VolumeRequest::Shrink { start_slice, slice_count, responder } = self {
1414 Some((start_slice, slice_count, responder))
1415 } else {
1416 None
1417 }
1418 }
1419
1420 #[allow(irrefutable_let_patterns)]
1421 pub fn into_destroy(self) -> Option<(VolumeDestroyResponder)> {
1422 if let VolumeRequest::Destroy { responder } = self {
1423 Some((responder))
1424 } else {
1425 None
1426 }
1427 }
1428
1429 pub fn method_name(&self) -> &'static str {
1431 match *self {
1432 VolumeRequest::GetInfo { .. } => "get_info",
1433 VolumeRequest::GetStats { .. } => "get_stats",
1434 VolumeRequest::OpenSession { .. } => "open_session",
1435 VolumeRequest::OpenSessionWithOffsetMap { .. } => "open_session_with_offset_map",
1436 VolumeRequest::GetTypeGuid { .. } => "get_type_guid",
1437 VolumeRequest::GetInstanceGuid { .. } => "get_instance_guid",
1438 VolumeRequest::GetName { .. } => "get_name",
1439 VolumeRequest::GetMetadata { .. } => "get_metadata",
1440 VolumeRequest::QuerySlices { .. } => "query_slices",
1441 VolumeRequest::GetVolumeInfo { .. } => "get_volume_info",
1442 VolumeRequest::Extend { .. } => "extend",
1443 VolumeRequest::Shrink { .. } => "shrink",
1444 VolumeRequest::Destroy { .. } => "destroy",
1445 }
1446 }
1447}
1448
1449#[derive(Debug, Clone)]
1450pub struct VolumeControlHandle {
1451 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1452}
1453
1454impl fidl::endpoints::ControlHandle for VolumeControlHandle {
1455 fn shutdown(&self) {
1456 self.inner.shutdown()
1457 }
1458 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1459 self.inner.shutdown_with_epitaph(status)
1460 }
1461
1462 fn is_closed(&self) -> bool {
1463 self.inner.channel().is_closed()
1464 }
1465 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1466 self.inner.channel().on_closed()
1467 }
1468
1469 #[cfg(target_os = "fuchsia")]
1470 fn signal_peer(
1471 &self,
1472 clear_mask: zx::Signals,
1473 set_mask: zx::Signals,
1474 ) -> Result<(), zx_status::Status> {
1475 use fidl::Peered;
1476 self.inner.channel().signal_peer(clear_mask, set_mask)
1477 }
1478}
1479
1480impl VolumeControlHandle {}
1481
1482#[must_use = "FIDL methods require a response to be sent"]
1483#[derive(Debug)]
1484pub struct VolumeGetInfoResponder {
1485 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1486 tx_id: u32,
1487}
1488
1489impl std::ops::Drop for VolumeGetInfoResponder {
1493 fn drop(&mut self) {
1494 self.control_handle.shutdown();
1495 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1497 }
1498}
1499
1500impl fidl::endpoints::Responder for VolumeGetInfoResponder {
1501 type ControlHandle = VolumeControlHandle;
1502
1503 fn control_handle(&self) -> &VolumeControlHandle {
1504 &self.control_handle
1505 }
1506
1507 fn drop_without_shutdown(mut self) {
1508 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1510 std::mem::forget(self);
1512 }
1513}
1514
1515impl VolumeGetInfoResponder {
1516 pub fn send(
1520 self,
1521 mut result: Result<&fidl_fuchsia_hardware_block::BlockInfo, i32>,
1522 ) -> Result<(), fidl::Error> {
1523 let _result = self.send_raw(result);
1524 if _result.is_err() {
1525 self.control_handle.shutdown();
1526 }
1527 self.drop_without_shutdown();
1528 _result
1529 }
1530
1531 pub fn send_no_shutdown_on_err(
1533 self,
1534 mut result: Result<&fidl_fuchsia_hardware_block::BlockInfo, i32>,
1535 ) -> Result<(), fidl::Error> {
1536 let _result = self.send_raw(result);
1537 self.drop_without_shutdown();
1538 _result
1539 }
1540
1541 fn send_raw(
1542 &self,
1543 mut result: Result<&fidl_fuchsia_hardware_block::BlockInfo, i32>,
1544 ) -> Result<(), fidl::Error> {
1545 self.control_handle.inner.send::<fidl::encoding::ResultType<
1546 fidl_fuchsia_hardware_block::BlockGetInfoResponse,
1547 i32,
1548 >>(
1549 result.map(|info| (info,)),
1550 self.tx_id,
1551 0x79df1a5cdb6cc6a3,
1552 fidl::encoding::DynamicFlags::empty(),
1553 )
1554 }
1555}
1556
1557#[must_use = "FIDL methods require a response to be sent"]
1558#[derive(Debug)]
1559pub struct VolumeGetStatsResponder {
1560 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1561 tx_id: u32,
1562}
1563
1564impl std::ops::Drop for VolumeGetStatsResponder {
1568 fn drop(&mut self) {
1569 self.control_handle.shutdown();
1570 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1572 }
1573}
1574
1575impl fidl::endpoints::Responder for VolumeGetStatsResponder {
1576 type ControlHandle = VolumeControlHandle;
1577
1578 fn control_handle(&self) -> &VolumeControlHandle {
1579 &self.control_handle
1580 }
1581
1582 fn drop_without_shutdown(mut self) {
1583 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1585 std::mem::forget(self);
1587 }
1588}
1589
1590impl VolumeGetStatsResponder {
1591 pub fn send(
1595 self,
1596 mut result: Result<&fidl_fuchsia_hardware_block::BlockStats, i32>,
1597 ) -> Result<(), fidl::Error> {
1598 let _result = self.send_raw(result);
1599 if _result.is_err() {
1600 self.control_handle.shutdown();
1601 }
1602 self.drop_without_shutdown();
1603 _result
1604 }
1605
1606 pub fn send_no_shutdown_on_err(
1608 self,
1609 mut result: Result<&fidl_fuchsia_hardware_block::BlockStats, i32>,
1610 ) -> Result<(), fidl::Error> {
1611 let _result = self.send_raw(result);
1612 self.drop_without_shutdown();
1613 _result
1614 }
1615
1616 fn send_raw(
1617 &self,
1618 mut result: Result<&fidl_fuchsia_hardware_block::BlockStats, i32>,
1619 ) -> Result<(), fidl::Error> {
1620 self.control_handle.inner.send::<fidl::encoding::ResultType<
1621 fidl_fuchsia_hardware_block::BlockGetStatsResponse,
1622 i32,
1623 >>(
1624 result.map(|stats| (stats,)),
1625 self.tx_id,
1626 0x53d9542a778385ae,
1627 fidl::encoding::DynamicFlags::empty(),
1628 )
1629 }
1630}
1631
1632#[must_use = "FIDL methods require a response to be sent"]
1633#[derive(Debug)]
1634pub struct VolumeGetTypeGuidResponder {
1635 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1636 tx_id: u32,
1637}
1638
1639impl std::ops::Drop for VolumeGetTypeGuidResponder {
1643 fn drop(&mut self) {
1644 self.control_handle.shutdown();
1645 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1647 }
1648}
1649
1650impl fidl::endpoints::Responder for VolumeGetTypeGuidResponder {
1651 type ControlHandle = VolumeControlHandle;
1652
1653 fn control_handle(&self) -> &VolumeControlHandle {
1654 &self.control_handle
1655 }
1656
1657 fn drop_without_shutdown(mut self) {
1658 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1660 std::mem::forget(self);
1662 }
1663}
1664
1665impl VolumeGetTypeGuidResponder {
1666 pub fn send(
1670 self,
1671 mut status: i32,
1672 mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
1673 ) -> Result<(), fidl::Error> {
1674 let _result = self.send_raw(status, guid);
1675 if _result.is_err() {
1676 self.control_handle.shutdown();
1677 }
1678 self.drop_without_shutdown();
1679 _result
1680 }
1681
1682 pub fn send_no_shutdown_on_err(
1684 self,
1685 mut status: i32,
1686 mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
1687 ) -> Result<(), fidl::Error> {
1688 let _result = self.send_raw(status, guid);
1689 self.drop_without_shutdown();
1690 _result
1691 }
1692
1693 fn send_raw(
1694 &self,
1695 mut status: i32,
1696 mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
1697 ) -> Result<(), fidl::Error> {
1698 self.control_handle
1699 .inner
1700 .send::<fidl_fuchsia_hardware_block_partition::PartitionGetTypeGuidResponse>(
1701 (status, guid),
1702 self.tx_id,
1703 0x111843d737a9b847,
1704 fidl::encoding::DynamicFlags::empty(),
1705 )
1706 }
1707}
1708
1709#[must_use = "FIDL methods require a response to be sent"]
1710#[derive(Debug)]
1711pub struct VolumeGetInstanceGuidResponder {
1712 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1713 tx_id: u32,
1714}
1715
1716impl std::ops::Drop for VolumeGetInstanceGuidResponder {
1720 fn drop(&mut self) {
1721 self.control_handle.shutdown();
1722 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1724 }
1725}
1726
1727impl fidl::endpoints::Responder for VolumeGetInstanceGuidResponder {
1728 type ControlHandle = VolumeControlHandle;
1729
1730 fn control_handle(&self) -> &VolumeControlHandle {
1731 &self.control_handle
1732 }
1733
1734 fn drop_without_shutdown(mut self) {
1735 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1737 std::mem::forget(self);
1739 }
1740}
1741
1742impl VolumeGetInstanceGuidResponder {
1743 pub fn send(
1747 self,
1748 mut status: i32,
1749 mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
1750 ) -> Result<(), fidl::Error> {
1751 let _result = self.send_raw(status, guid);
1752 if _result.is_err() {
1753 self.control_handle.shutdown();
1754 }
1755 self.drop_without_shutdown();
1756 _result
1757 }
1758
1759 pub fn send_no_shutdown_on_err(
1761 self,
1762 mut status: i32,
1763 mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
1764 ) -> Result<(), fidl::Error> {
1765 let _result = self.send_raw(status, guid);
1766 self.drop_without_shutdown();
1767 _result
1768 }
1769
1770 fn send_raw(
1771 &self,
1772 mut status: i32,
1773 mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
1774 ) -> Result<(), fidl::Error> {
1775 self.control_handle
1776 .inner
1777 .send::<fidl_fuchsia_hardware_block_partition::PartitionGetInstanceGuidResponse>(
1778 (status, guid),
1779 self.tx_id,
1780 0x14a5a573b275d435,
1781 fidl::encoding::DynamicFlags::empty(),
1782 )
1783 }
1784}
1785
1786#[must_use = "FIDL methods require a response to be sent"]
1787#[derive(Debug)]
1788pub struct VolumeGetNameResponder {
1789 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1790 tx_id: u32,
1791}
1792
1793impl std::ops::Drop for VolumeGetNameResponder {
1797 fn drop(&mut self) {
1798 self.control_handle.shutdown();
1799 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1801 }
1802}
1803
1804impl fidl::endpoints::Responder for VolumeGetNameResponder {
1805 type ControlHandle = VolumeControlHandle;
1806
1807 fn control_handle(&self) -> &VolumeControlHandle {
1808 &self.control_handle
1809 }
1810
1811 fn drop_without_shutdown(mut self) {
1812 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1814 std::mem::forget(self);
1816 }
1817}
1818
1819impl VolumeGetNameResponder {
1820 pub fn send(self, mut status: i32, mut name: Option<&str>) -> Result<(), fidl::Error> {
1824 let _result = self.send_raw(status, name);
1825 if _result.is_err() {
1826 self.control_handle.shutdown();
1827 }
1828 self.drop_without_shutdown();
1829 _result
1830 }
1831
1832 pub fn send_no_shutdown_on_err(
1834 self,
1835 mut status: i32,
1836 mut name: Option<&str>,
1837 ) -> Result<(), fidl::Error> {
1838 let _result = self.send_raw(status, name);
1839 self.drop_without_shutdown();
1840 _result
1841 }
1842
1843 fn send_raw(&self, mut status: i32, mut name: Option<&str>) -> Result<(), fidl::Error> {
1844 self.control_handle
1845 .inner
1846 .send::<fidl_fuchsia_hardware_block_partition::PartitionGetNameResponse>(
1847 (status, name),
1848 self.tx_id,
1849 0x7e3c6f0b0937fc02,
1850 fidl::encoding::DynamicFlags::empty(),
1851 )
1852 }
1853}
1854
1855#[must_use = "FIDL methods require a response to be sent"]
1856#[derive(Debug)]
1857pub struct VolumeGetMetadataResponder {
1858 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1859 tx_id: u32,
1860}
1861
1862impl std::ops::Drop for VolumeGetMetadataResponder {
1866 fn drop(&mut self) {
1867 self.control_handle.shutdown();
1868 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1870 }
1871}
1872
1873impl fidl::endpoints::Responder for VolumeGetMetadataResponder {
1874 type ControlHandle = VolumeControlHandle;
1875
1876 fn control_handle(&self) -> &VolumeControlHandle {
1877 &self.control_handle
1878 }
1879
1880 fn drop_without_shutdown(mut self) {
1881 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1883 std::mem::forget(self);
1885 }
1886}
1887
1888impl VolumeGetMetadataResponder {
1889 pub fn send(
1893 self,
1894 mut result: Result<
1895 &fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
1896 i32,
1897 >,
1898 ) -> Result<(), fidl::Error> {
1899 let _result = self.send_raw(result);
1900 if _result.is_err() {
1901 self.control_handle.shutdown();
1902 }
1903 self.drop_without_shutdown();
1904 _result
1905 }
1906
1907 pub fn send_no_shutdown_on_err(
1909 self,
1910 mut result: Result<
1911 &fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
1912 i32,
1913 >,
1914 ) -> Result<(), fidl::Error> {
1915 let _result = self.send_raw(result);
1916 self.drop_without_shutdown();
1917 _result
1918 }
1919
1920 fn send_raw(
1921 &self,
1922 mut result: Result<
1923 &fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
1924 i32,
1925 >,
1926 ) -> Result<(), fidl::Error> {
1927 self.control_handle.inner.send::<fidl::encoding::ResultType<
1928 fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
1929 i32,
1930 >>(
1931 result,
1932 self.tx_id,
1933 0x42d1464c96c3f3ff,
1934 fidl::encoding::DynamicFlags::empty(),
1935 )
1936 }
1937}
1938
1939#[must_use = "FIDL methods require a response to be sent"]
1940#[derive(Debug)]
1941pub struct VolumeQuerySlicesResponder {
1942 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1943 tx_id: u32,
1944}
1945
1946impl std::ops::Drop for VolumeQuerySlicesResponder {
1950 fn drop(&mut self) {
1951 self.control_handle.shutdown();
1952 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1954 }
1955}
1956
1957impl fidl::endpoints::Responder for VolumeQuerySlicesResponder {
1958 type ControlHandle = VolumeControlHandle;
1959
1960 fn control_handle(&self) -> &VolumeControlHandle {
1961 &self.control_handle
1962 }
1963
1964 fn drop_without_shutdown(mut self) {
1965 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1967 std::mem::forget(self);
1969 }
1970}
1971
1972impl VolumeQuerySlicesResponder {
1973 pub fn send(
1977 self,
1978 mut status: i32,
1979 mut response: &[VsliceRange; 16],
1980 mut response_count: u64,
1981 ) -> Result<(), fidl::Error> {
1982 let _result = self.send_raw(status, response, response_count);
1983 if _result.is_err() {
1984 self.control_handle.shutdown();
1985 }
1986 self.drop_without_shutdown();
1987 _result
1988 }
1989
1990 pub fn send_no_shutdown_on_err(
1992 self,
1993 mut status: i32,
1994 mut response: &[VsliceRange; 16],
1995 mut response_count: u64,
1996 ) -> Result<(), fidl::Error> {
1997 let _result = self.send_raw(status, response, response_count);
1998 self.drop_without_shutdown();
1999 _result
2000 }
2001
2002 fn send_raw(
2003 &self,
2004 mut status: i32,
2005 mut response: &[VsliceRange; 16],
2006 mut response_count: u64,
2007 ) -> Result<(), fidl::Error> {
2008 self.control_handle.inner.send::<VolumeQuerySlicesResponse>(
2009 (status, response, response_count),
2010 self.tx_id,
2011 0x589a96828a3e2aa1,
2012 fidl::encoding::DynamicFlags::empty(),
2013 )
2014 }
2015}
2016
2017#[must_use = "FIDL methods require a response to be sent"]
2018#[derive(Debug)]
2019pub struct VolumeGetVolumeInfoResponder {
2020 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
2021 tx_id: u32,
2022}
2023
2024impl std::ops::Drop for VolumeGetVolumeInfoResponder {
2028 fn drop(&mut self) {
2029 self.control_handle.shutdown();
2030 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2032 }
2033}
2034
2035impl fidl::endpoints::Responder for VolumeGetVolumeInfoResponder {
2036 type ControlHandle = VolumeControlHandle;
2037
2038 fn control_handle(&self) -> &VolumeControlHandle {
2039 &self.control_handle
2040 }
2041
2042 fn drop_without_shutdown(mut self) {
2043 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2045 std::mem::forget(self);
2047 }
2048}
2049
2050impl VolumeGetVolumeInfoResponder {
2051 pub fn send(
2055 self,
2056 mut status: i32,
2057 mut manager: Option<&VolumeManagerInfo>,
2058 mut volume: Option<&VolumeInfo>,
2059 ) -> Result<(), fidl::Error> {
2060 let _result = self.send_raw(status, manager, volume);
2061 if _result.is_err() {
2062 self.control_handle.shutdown();
2063 }
2064 self.drop_without_shutdown();
2065 _result
2066 }
2067
2068 pub fn send_no_shutdown_on_err(
2070 self,
2071 mut status: i32,
2072 mut manager: Option<&VolumeManagerInfo>,
2073 mut volume: Option<&VolumeInfo>,
2074 ) -> Result<(), fidl::Error> {
2075 let _result = self.send_raw(status, manager, volume);
2076 self.drop_without_shutdown();
2077 _result
2078 }
2079
2080 fn send_raw(
2081 &self,
2082 mut status: i32,
2083 mut manager: Option<&VolumeManagerInfo>,
2084 mut volume: Option<&VolumeInfo>,
2085 ) -> Result<(), fidl::Error> {
2086 self.control_handle.inner.send::<VolumeGetVolumeInfoResponse>(
2087 (status, manager, volume),
2088 self.tx_id,
2089 0x60417b6cf9e34c80,
2090 fidl::encoding::DynamicFlags::empty(),
2091 )
2092 }
2093}
2094
2095#[must_use = "FIDL methods require a response to be sent"]
2096#[derive(Debug)]
2097pub struct VolumeExtendResponder {
2098 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
2099 tx_id: u32,
2100}
2101
2102impl std::ops::Drop for VolumeExtendResponder {
2106 fn drop(&mut self) {
2107 self.control_handle.shutdown();
2108 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2110 }
2111}
2112
2113impl fidl::endpoints::Responder for VolumeExtendResponder {
2114 type ControlHandle = VolumeControlHandle;
2115
2116 fn control_handle(&self) -> &VolumeControlHandle {
2117 &self.control_handle
2118 }
2119
2120 fn drop_without_shutdown(mut self) {
2121 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2123 std::mem::forget(self);
2125 }
2126}
2127
2128impl VolumeExtendResponder {
2129 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2133 let _result = self.send_raw(status);
2134 if _result.is_err() {
2135 self.control_handle.shutdown();
2136 }
2137 self.drop_without_shutdown();
2138 _result
2139 }
2140
2141 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2143 let _result = self.send_raw(status);
2144 self.drop_without_shutdown();
2145 _result
2146 }
2147
2148 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2149 self.control_handle.inner.send::<VolumeExtendResponse>(
2150 (status,),
2151 self.tx_id,
2152 0xdddf872f5039d37,
2153 fidl::encoding::DynamicFlags::empty(),
2154 )
2155 }
2156}
2157
2158#[must_use = "FIDL methods require a response to be sent"]
2159#[derive(Debug)]
2160pub struct VolumeShrinkResponder {
2161 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
2162 tx_id: u32,
2163}
2164
2165impl std::ops::Drop for VolumeShrinkResponder {
2169 fn drop(&mut self) {
2170 self.control_handle.shutdown();
2171 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2173 }
2174}
2175
2176impl fidl::endpoints::Responder for VolumeShrinkResponder {
2177 type ControlHandle = VolumeControlHandle;
2178
2179 fn control_handle(&self) -> &VolumeControlHandle {
2180 &self.control_handle
2181 }
2182
2183 fn drop_without_shutdown(mut self) {
2184 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2186 std::mem::forget(self);
2188 }
2189}
2190
2191impl VolumeShrinkResponder {
2192 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2196 let _result = self.send_raw(status);
2197 if _result.is_err() {
2198 self.control_handle.shutdown();
2199 }
2200 self.drop_without_shutdown();
2201 _result
2202 }
2203
2204 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2206 let _result = self.send_raw(status);
2207 self.drop_without_shutdown();
2208 _result
2209 }
2210
2211 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2212 self.control_handle.inner.send::<VolumeShrinkResponse>(
2213 (status,),
2214 self.tx_id,
2215 0x27ab5ed4f6fdcd29,
2216 fidl::encoding::DynamicFlags::empty(),
2217 )
2218 }
2219}
2220
2221#[must_use = "FIDL methods require a response to be sent"]
2222#[derive(Debug)]
2223pub struct VolumeDestroyResponder {
2224 control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
2225 tx_id: u32,
2226}
2227
2228impl std::ops::Drop for VolumeDestroyResponder {
2232 fn drop(&mut self) {
2233 self.control_handle.shutdown();
2234 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2236 }
2237}
2238
2239impl fidl::endpoints::Responder for VolumeDestroyResponder {
2240 type ControlHandle = VolumeControlHandle;
2241
2242 fn control_handle(&self) -> &VolumeControlHandle {
2243 &self.control_handle
2244 }
2245
2246 fn drop_without_shutdown(mut self) {
2247 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2249 std::mem::forget(self);
2251 }
2252}
2253
2254impl VolumeDestroyResponder {
2255 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2259 let _result = self.send_raw(status);
2260 if _result.is_err() {
2261 self.control_handle.shutdown();
2262 }
2263 self.drop_without_shutdown();
2264 _result
2265 }
2266
2267 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2269 let _result = self.send_raw(status);
2270 self.drop_without_shutdown();
2271 _result
2272 }
2273
2274 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2275 self.control_handle.inner.send::<VolumeDestroyResponse>(
2276 (status,),
2277 self.tx_id,
2278 0x732bf4bea39b5e87,
2279 fidl::encoding::DynamicFlags::empty(),
2280 )
2281 }
2282}
2283
2284#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2285pub struct VolumeManagerMarker;
2286
2287impl fidl::endpoints::ProtocolMarker for VolumeManagerMarker {
2288 type Proxy = VolumeManagerProxy;
2289 type RequestStream = VolumeManagerRequestStream;
2290 #[cfg(target_os = "fuchsia")]
2291 type SynchronousProxy = VolumeManagerSynchronousProxy;
2292
2293 const DEBUG_NAME: &'static str = "(anonymous) VolumeManager";
2294}
2295pub type VolumeManagerSetPartitionNameResult = Result<(), i32>;
2296
2297pub trait VolumeManagerProxyInterface: Send + Sync {
2298 type AllocatePartitionResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
2299 fn r#allocate_partition(
2300 &self,
2301 slice_count: u64,
2302 type_: &fidl_fuchsia_hardware_block_partition::Guid,
2303 instance: &fidl_fuchsia_hardware_block_partition::Guid,
2304 name: &str,
2305 flags: u32,
2306 ) -> Self::AllocatePartitionResponseFut;
2307 type GetInfoResponseFut: std::future::Future<Output = Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error>>
2308 + Send;
2309 fn r#get_info(&self) -> Self::GetInfoResponseFut;
2310 type ActivateResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
2311 fn r#activate(
2312 &self,
2313 old_guid: &fidl_fuchsia_hardware_block_partition::Guid,
2314 new_guid: &fidl_fuchsia_hardware_block_partition::Guid,
2315 ) -> Self::ActivateResponseFut;
2316 type GetPartitionLimitResponseFut: std::future::Future<Output = Result<(i32, u64), fidl::Error>>
2317 + Send;
2318 fn r#get_partition_limit(
2319 &self,
2320 guid: &fidl_fuchsia_hardware_block_partition::Guid,
2321 ) -> Self::GetPartitionLimitResponseFut;
2322 type SetPartitionLimitResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
2323 fn r#set_partition_limit(
2324 &self,
2325 guid: &fidl_fuchsia_hardware_block_partition::Guid,
2326 slice_count: u64,
2327 ) -> Self::SetPartitionLimitResponseFut;
2328 type SetPartitionNameResponseFut: std::future::Future<Output = Result<VolumeManagerSetPartitionNameResult, fidl::Error>>
2329 + Send;
2330 fn r#set_partition_name(
2331 &self,
2332 guid: &fidl_fuchsia_hardware_block_partition::Guid,
2333 name: &str,
2334 ) -> Self::SetPartitionNameResponseFut;
2335}
2336#[derive(Debug)]
2337#[cfg(target_os = "fuchsia")]
2338pub struct VolumeManagerSynchronousProxy {
2339 client: fidl::client::sync::Client,
2340}
2341
2342#[cfg(target_os = "fuchsia")]
2343impl fidl::endpoints::SynchronousProxy for VolumeManagerSynchronousProxy {
2344 type Proxy = VolumeManagerProxy;
2345 type Protocol = VolumeManagerMarker;
2346
2347 fn from_channel(inner: fidl::Channel) -> Self {
2348 Self::new(inner)
2349 }
2350
2351 fn into_channel(self) -> fidl::Channel {
2352 self.client.into_channel()
2353 }
2354
2355 fn as_channel(&self) -> &fidl::Channel {
2356 self.client.as_channel()
2357 }
2358}
2359
2360#[cfg(target_os = "fuchsia")]
2361impl VolumeManagerSynchronousProxy {
2362 pub fn new(channel: fidl::Channel) -> Self {
2363 let protocol_name = <VolumeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2364 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2365 }
2366
2367 pub fn into_channel(self) -> fidl::Channel {
2368 self.client.into_channel()
2369 }
2370
2371 pub fn wait_for_event(
2374 &self,
2375 deadline: zx::MonotonicInstant,
2376 ) -> Result<VolumeManagerEvent, fidl::Error> {
2377 VolumeManagerEvent::decode(self.client.wait_for_event(deadline)?)
2378 }
2379
2380 pub fn r#allocate_partition(
2387 &self,
2388 mut slice_count: u64,
2389 mut type_: &fidl_fuchsia_hardware_block_partition::Guid,
2390 mut instance: &fidl_fuchsia_hardware_block_partition::Guid,
2391 mut name: &str,
2392 mut flags: u32,
2393 ___deadline: zx::MonotonicInstant,
2394 ) -> Result<i32, fidl::Error> {
2395 let _response = self.client.send_query::<
2396 VolumeManagerAllocatePartitionRequest,
2397 VolumeManagerAllocatePartitionResponse,
2398 >(
2399 (slice_count, type_, instance, name, flags,),
2400 0x4e79f24ed059e394,
2401 fidl::encoding::DynamicFlags::empty(),
2402 ___deadline,
2403 )?;
2404 Ok(_response.status)
2405 }
2406
2407 pub fn r#get_info(
2415 &self,
2416 ___deadline: zx::MonotonicInstant,
2417 ) -> Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error> {
2418 let _response =
2419 self.client.send_query::<fidl::encoding::EmptyPayload, VolumeManagerGetInfoResponse>(
2420 (),
2421 0x735b3548582b2c9,
2422 fidl::encoding::DynamicFlags::empty(),
2423 ___deadline,
2424 )?;
2425 Ok((_response.status, _response.info))
2426 }
2427
2428 pub fn r#activate(
2444 &self,
2445 mut old_guid: &fidl_fuchsia_hardware_block_partition::Guid,
2446 mut new_guid: &fidl_fuchsia_hardware_block_partition::Guid,
2447 ___deadline: zx::MonotonicInstant,
2448 ) -> Result<i32, fidl::Error> {
2449 let _response =
2450 self.client.send_query::<VolumeManagerActivateRequest, VolumeManagerActivateResponse>(
2451 (old_guid, new_guid),
2452 0xc8cef57012874d0,
2453 fidl::encoding::DynamicFlags::empty(),
2454 ___deadline,
2455 )?;
2456 Ok(_response.status)
2457 }
2458
2459 pub fn r#get_partition_limit(
2469 &self,
2470 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2471 ___deadline: zx::MonotonicInstant,
2472 ) -> Result<(i32, u64), fidl::Error> {
2473 let _response = self.client.send_query::<
2474 VolumeManagerGetPartitionLimitRequest,
2475 VolumeManagerGetPartitionLimitResponse,
2476 >(
2477 (guid,),
2478 0x6e32f6df9fa2a919,
2479 fidl::encoding::DynamicFlags::empty(),
2480 ___deadline,
2481 )?;
2482 Ok((_response.status, _response.slice_count))
2483 }
2484
2485 pub fn r#set_partition_limit(
2497 &self,
2498 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2499 mut slice_count: u64,
2500 ___deadline: zx::MonotonicInstant,
2501 ) -> Result<i32, fidl::Error> {
2502 let _response = self.client.send_query::<
2503 VolumeManagerSetPartitionLimitRequest,
2504 VolumeManagerSetPartitionLimitResponse,
2505 >(
2506 (guid, slice_count,),
2507 0x2e09076ef266fa35,
2508 fidl::encoding::DynamicFlags::empty(),
2509 ___deadline,
2510 )?;
2511 Ok(_response.status)
2512 }
2513
2514 pub fn r#set_partition_name(
2518 &self,
2519 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2520 mut name: &str,
2521 ___deadline: zx::MonotonicInstant,
2522 ) -> Result<VolumeManagerSetPartitionNameResult, fidl::Error> {
2523 let _response = self.client.send_query::<
2524 VolumeManagerSetPartitionNameRequest,
2525 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2526 >(
2527 (guid, name,),
2528 0x4539a9b95cba0397,
2529 fidl::encoding::DynamicFlags::empty(),
2530 ___deadline,
2531 )?;
2532 Ok(_response.map(|x| x))
2533 }
2534}
2535
2536#[cfg(target_os = "fuchsia")]
2537impl From<VolumeManagerSynchronousProxy> for zx::Handle {
2538 fn from(value: VolumeManagerSynchronousProxy) -> Self {
2539 value.into_channel().into()
2540 }
2541}
2542
2543#[cfg(target_os = "fuchsia")]
2544impl From<fidl::Channel> for VolumeManagerSynchronousProxy {
2545 fn from(value: fidl::Channel) -> Self {
2546 Self::new(value)
2547 }
2548}
2549
2550#[derive(Debug, Clone)]
2551pub struct VolumeManagerProxy {
2552 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2553}
2554
2555impl fidl::endpoints::Proxy for VolumeManagerProxy {
2556 type Protocol = VolumeManagerMarker;
2557
2558 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2559 Self::new(inner)
2560 }
2561
2562 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2563 self.client.into_channel().map_err(|client| Self { client })
2564 }
2565
2566 fn as_channel(&self) -> &::fidl::AsyncChannel {
2567 self.client.as_channel()
2568 }
2569}
2570
2571impl VolumeManagerProxy {
2572 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2574 let protocol_name = <VolumeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2575 Self { client: fidl::client::Client::new(channel, protocol_name) }
2576 }
2577
2578 pub fn take_event_stream(&self) -> VolumeManagerEventStream {
2584 VolumeManagerEventStream { event_receiver: self.client.take_event_receiver() }
2585 }
2586
2587 pub fn r#allocate_partition(
2594 &self,
2595 mut slice_count: u64,
2596 mut type_: &fidl_fuchsia_hardware_block_partition::Guid,
2597 mut instance: &fidl_fuchsia_hardware_block_partition::Guid,
2598 mut name: &str,
2599 mut flags: u32,
2600 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2601 VolumeManagerProxyInterface::r#allocate_partition(
2602 self,
2603 slice_count,
2604 type_,
2605 instance,
2606 name,
2607 flags,
2608 )
2609 }
2610
2611 pub fn r#get_info(
2619 &self,
2620 ) -> fidl::client::QueryResponseFut<
2621 (i32, Option<Box<VolumeManagerInfo>>),
2622 fidl::encoding::DefaultFuchsiaResourceDialect,
2623 > {
2624 VolumeManagerProxyInterface::r#get_info(self)
2625 }
2626
2627 pub fn r#activate(
2643 &self,
2644 mut old_guid: &fidl_fuchsia_hardware_block_partition::Guid,
2645 mut new_guid: &fidl_fuchsia_hardware_block_partition::Guid,
2646 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2647 VolumeManagerProxyInterface::r#activate(self, old_guid, new_guid)
2648 }
2649
2650 pub fn r#get_partition_limit(
2660 &self,
2661 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2662 ) -> fidl::client::QueryResponseFut<(i32, u64), fidl::encoding::DefaultFuchsiaResourceDialect>
2663 {
2664 VolumeManagerProxyInterface::r#get_partition_limit(self, guid)
2665 }
2666
2667 pub fn r#set_partition_limit(
2679 &self,
2680 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2681 mut slice_count: u64,
2682 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2683 VolumeManagerProxyInterface::r#set_partition_limit(self, guid, slice_count)
2684 }
2685
2686 pub fn r#set_partition_name(
2690 &self,
2691 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2692 mut name: &str,
2693 ) -> fidl::client::QueryResponseFut<
2694 VolumeManagerSetPartitionNameResult,
2695 fidl::encoding::DefaultFuchsiaResourceDialect,
2696 > {
2697 VolumeManagerProxyInterface::r#set_partition_name(self, guid, name)
2698 }
2699}
2700
2701impl VolumeManagerProxyInterface for VolumeManagerProxy {
2702 type AllocatePartitionResponseFut =
2703 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2704 fn r#allocate_partition(
2705 &self,
2706 mut slice_count: u64,
2707 mut type_: &fidl_fuchsia_hardware_block_partition::Guid,
2708 mut instance: &fidl_fuchsia_hardware_block_partition::Guid,
2709 mut name: &str,
2710 mut flags: u32,
2711 ) -> Self::AllocatePartitionResponseFut {
2712 fn _decode(
2713 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2714 ) -> Result<i32, fidl::Error> {
2715 let _response = fidl::client::decode_transaction_body::<
2716 VolumeManagerAllocatePartitionResponse,
2717 fidl::encoding::DefaultFuchsiaResourceDialect,
2718 0x4e79f24ed059e394,
2719 >(_buf?)?;
2720 Ok(_response.status)
2721 }
2722 self.client.send_query_and_decode::<VolumeManagerAllocatePartitionRequest, i32>(
2723 (slice_count, type_, instance, name, flags),
2724 0x4e79f24ed059e394,
2725 fidl::encoding::DynamicFlags::empty(),
2726 _decode,
2727 )
2728 }
2729
2730 type GetInfoResponseFut = fidl::client::QueryResponseFut<
2731 (i32, Option<Box<VolumeManagerInfo>>),
2732 fidl::encoding::DefaultFuchsiaResourceDialect,
2733 >;
2734 fn r#get_info(&self) -> Self::GetInfoResponseFut {
2735 fn _decode(
2736 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2737 ) -> Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error> {
2738 let _response = fidl::client::decode_transaction_body::<
2739 VolumeManagerGetInfoResponse,
2740 fidl::encoding::DefaultFuchsiaResourceDialect,
2741 0x735b3548582b2c9,
2742 >(_buf?)?;
2743 Ok((_response.status, _response.info))
2744 }
2745 self.client.send_query_and_decode::<
2746 fidl::encoding::EmptyPayload,
2747 (i32, Option<Box<VolumeManagerInfo>>),
2748 >(
2749 (),
2750 0x735b3548582b2c9,
2751 fidl::encoding::DynamicFlags::empty(),
2752 _decode,
2753 )
2754 }
2755
2756 type ActivateResponseFut =
2757 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2758 fn r#activate(
2759 &self,
2760 mut old_guid: &fidl_fuchsia_hardware_block_partition::Guid,
2761 mut new_guid: &fidl_fuchsia_hardware_block_partition::Guid,
2762 ) -> Self::ActivateResponseFut {
2763 fn _decode(
2764 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2765 ) -> Result<i32, fidl::Error> {
2766 let _response = fidl::client::decode_transaction_body::<
2767 VolumeManagerActivateResponse,
2768 fidl::encoding::DefaultFuchsiaResourceDialect,
2769 0xc8cef57012874d0,
2770 >(_buf?)?;
2771 Ok(_response.status)
2772 }
2773 self.client.send_query_and_decode::<VolumeManagerActivateRequest, i32>(
2774 (old_guid, new_guid),
2775 0xc8cef57012874d0,
2776 fidl::encoding::DynamicFlags::empty(),
2777 _decode,
2778 )
2779 }
2780
2781 type GetPartitionLimitResponseFut =
2782 fidl::client::QueryResponseFut<(i32, u64), fidl::encoding::DefaultFuchsiaResourceDialect>;
2783 fn r#get_partition_limit(
2784 &self,
2785 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2786 ) -> Self::GetPartitionLimitResponseFut {
2787 fn _decode(
2788 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2789 ) -> Result<(i32, u64), fidl::Error> {
2790 let _response = fidl::client::decode_transaction_body::<
2791 VolumeManagerGetPartitionLimitResponse,
2792 fidl::encoding::DefaultFuchsiaResourceDialect,
2793 0x6e32f6df9fa2a919,
2794 >(_buf?)?;
2795 Ok((_response.status, _response.slice_count))
2796 }
2797 self.client.send_query_and_decode::<VolumeManagerGetPartitionLimitRequest, (i32, u64)>(
2798 (guid,),
2799 0x6e32f6df9fa2a919,
2800 fidl::encoding::DynamicFlags::empty(),
2801 _decode,
2802 )
2803 }
2804
2805 type SetPartitionLimitResponseFut =
2806 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
2807 fn r#set_partition_limit(
2808 &self,
2809 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2810 mut slice_count: u64,
2811 ) -> Self::SetPartitionLimitResponseFut {
2812 fn _decode(
2813 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2814 ) -> Result<i32, fidl::Error> {
2815 let _response = fidl::client::decode_transaction_body::<
2816 VolumeManagerSetPartitionLimitResponse,
2817 fidl::encoding::DefaultFuchsiaResourceDialect,
2818 0x2e09076ef266fa35,
2819 >(_buf?)?;
2820 Ok(_response.status)
2821 }
2822 self.client.send_query_and_decode::<VolumeManagerSetPartitionLimitRequest, i32>(
2823 (guid, slice_count),
2824 0x2e09076ef266fa35,
2825 fidl::encoding::DynamicFlags::empty(),
2826 _decode,
2827 )
2828 }
2829
2830 type SetPartitionNameResponseFut = fidl::client::QueryResponseFut<
2831 VolumeManagerSetPartitionNameResult,
2832 fidl::encoding::DefaultFuchsiaResourceDialect,
2833 >;
2834 fn r#set_partition_name(
2835 &self,
2836 mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
2837 mut name: &str,
2838 ) -> Self::SetPartitionNameResponseFut {
2839 fn _decode(
2840 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2841 ) -> Result<VolumeManagerSetPartitionNameResult, fidl::Error> {
2842 let _response = fidl::client::decode_transaction_body::<
2843 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2844 fidl::encoding::DefaultFuchsiaResourceDialect,
2845 0x4539a9b95cba0397,
2846 >(_buf?)?;
2847 Ok(_response.map(|x| x))
2848 }
2849 self.client.send_query_and_decode::<
2850 VolumeManagerSetPartitionNameRequest,
2851 VolumeManagerSetPartitionNameResult,
2852 >(
2853 (guid, name,),
2854 0x4539a9b95cba0397,
2855 fidl::encoding::DynamicFlags::empty(),
2856 _decode,
2857 )
2858 }
2859}
2860
2861pub struct VolumeManagerEventStream {
2862 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2863}
2864
2865impl std::marker::Unpin for VolumeManagerEventStream {}
2866
2867impl futures::stream::FusedStream for VolumeManagerEventStream {
2868 fn is_terminated(&self) -> bool {
2869 self.event_receiver.is_terminated()
2870 }
2871}
2872
2873impl futures::Stream for VolumeManagerEventStream {
2874 type Item = Result<VolumeManagerEvent, fidl::Error>;
2875
2876 fn poll_next(
2877 mut self: std::pin::Pin<&mut Self>,
2878 cx: &mut std::task::Context<'_>,
2879 ) -> std::task::Poll<Option<Self::Item>> {
2880 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2881 &mut self.event_receiver,
2882 cx
2883 )?) {
2884 Some(buf) => std::task::Poll::Ready(Some(VolumeManagerEvent::decode(buf))),
2885 None => std::task::Poll::Ready(None),
2886 }
2887 }
2888}
2889
2890#[derive(Debug)]
2891pub enum VolumeManagerEvent {}
2892
2893impl VolumeManagerEvent {
2894 fn decode(
2896 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2897 ) -> Result<VolumeManagerEvent, fidl::Error> {
2898 let (bytes, _handles) = buf.split_mut();
2899 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2900 debug_assert_eq!(tx_header.tx_id, 0);
2901 match tx_header.ordinal {
2902 _ => Err(fidl::Error::UnknownOrdinal {
2903 ordinal: tx_header.ordinal,
2904 protocol_name: <VolumeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2905 }),
2906 }
2907 }
2908}
2909
2910pub struct VolumeManagerRequestStream {
2912 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2913 is_terminated: bool,
2914}
2915
2916impl std::marker::Unpin for VolumeManagerRequestStream {}
2917
2918impl futures::stream::FusedStream for VolumeManagerRequestStream {
2919 fn is_terminated(&self) -> bool {
2920 self.is_terminated
2921 }
2922}
2923
2924impl fidl::endpoints::RequestStream for VolumeManagerRequestStream {
2925 type Protocol = VolumeManagerMarker;
2926 type ControlHandle = VolumeManagerControlHandle;
2927
2928 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2929 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2930 }
2931
2932 fn control_handle(&self) -> Self::ControlHandle {
2933 VolumeManagerControlHandle { inner: self.inner.clone() }
2934 }
2935
2936 fn into_inner(
2937 self,
2938 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2939 {
2940 (self.inner, self.is_terminated)
2941 }
2942
2943 fn from_inner(
2944 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2945 is_terminated: bool,
2946 ) -> Self {
2947 Self { inner, is_terminated }
2948 }
2949}
2950
2951impl futures::Stream for VolumeManagerRequestStream {
2952 type Item = Result<VolumeManagerRequest, fidl::Error>;
2953
2954 fn poll_next(
2955 mut self: std::pin::Pin<&mut Self>,
2956 cx: &mut std::task::Context<'_>,
2957 ) -> std::task::Poll<Option<Self::Item>> {
2958 let this = &mut *self;
2959 if this.inner.check_shutdown(cx) {
2960 this.is_terminated = true;
2961 return std::task::Poll::Ready(None);
2962 }
2963 if this.is_terminated {
2964 panic!("polled VolumeManagerRequestStream after completion");
2965 }
2966 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2967 |bytes, handles| {
2968 match this.inner.channel().read_etc(cx, bytes, handles) {
2969 std::task::Poll::Ready(Ok(())) => {}
2970 std::task::Poll::Pending => return std::task::Poll::Pending,
2971 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2972 this.is_terminated = true;
2973 return std::task::Poll::Ready(None);
2974 }
2975 std::task::Poll::Ready(Err(e)) => {
2976 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2977 e.into(),
2978 ))))
2979 }
2980 }
2981
2982 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2984
2985 std::task::Poll::Ready(Some(match header.ordinal {
2986 0x4e79f24ed059e394 => {
2987 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2988 let mut req = fidl::new_empty!(
2989 VolumeManagerAllocatePartitionRequest,
2990 fidl::encoding::DefaultFuchsiaResourceDialect
2991 );
2992 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerAllocatePartitionRequest>(&header, _body_bytes, handles, &mut req)?;
2993 let control_handle =
2994 VolumeManagerControlHandle { inner: this.inner.clone() };
2995 Ok(VolumeManagerRequest::AllocatePartition {
2996 slice_count: req.slice_count,
2997 type_: req.type_,
2998 instance: req.instance,
2999 name: req.name,
3000 flags: req.flags,
3001
3002 responder: VolumeManagerAllocatePartitionResponder {
3003 control_handle: std::mem::ManuallyDrop::new(control_handle),
3004 tx_id: header.tx_id,
3005 },
3006 })
3007 }
3008 0x735b3548582b2c9 => {
3009 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3010 let mut req = fidl::new_empty!(
3011 fidl::encoding::EmptyPayload,
3012 fidl::encoding::DefaultFuchsiaResourceDialect
3013 );
3014 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3015 let control_handle =
3016 VolumeManagerControlHandle { inner: this.inner.clone() };
3017 Ok(VolumeManagerRequest::GetInfo {
3018 responder: VolumeManagerGetInfoResponder {
3019 control_handle: std::mem::ManuallyDrop::new(control_handle),
3020 tx_id: header.tx_id,
3021 },
3022 })
3023 }
3024 0xc8cef57012874d0 => {
3025 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3026 let mut req = fidl::new_empty!(
3027 VolumeManagerActivateRequest,
3028 fidl::encoding::DefaultFuchsiaResourceDialect
3029 );
3030 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerActivateRequest>(&header, _body_bytes, handles, &mut req)?;
3031 let control_handle =
3032 VolumeManagerControlHandle { inner: this.inner.clone() };
3033 Ok(VolumeManagerRequest::Activate {
3034 old_guid: req.old_guid,
3035 new_guid: req.new_guid,
3036
3037 responder: VolumeManagerActivateResponder {
3038 control_handle: std::mem::ManuallyDrop::new(control_handle),
3039 tx_id: header.tx_id,
3040 },
3041 })
3042 }
3043 0x6e32f6df9fa2a919 => {
3044 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3045 let mut req = fidl::new_empty!(
3046 VolumeManagerGetPartitionLimitRequest,
3047 fidl::encoding::DefaultFuchsiaResourceDialect
3048 );
3049 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerGetPartitionLimitRequest>(&header, _body_bytes, handles, &mut req)?;
3050 let control_handle =
3051 VolumeManagerControlHandle { inner: this.inner.clone() };
3052 Ok(VolumeManagerRequest::GetPartitionLimit {
3053 guid: req.guid,
3054
3055 responder: VolumeManagerGetPartitionLimitResponder {
3056 control_handle: std::mem::ManuallyDrop::new(control_handle),
3057 tx_id: header.tx_id,
3058 },
3059 })
3060 }
3061 0x2e09076ef266fa35 => {
3062 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3063 let mut req = fidl::new_empty!(
3064 VolumeManagerSetPartitionLimitRequest,
3065 fidl::encoding::DefaultFuchsiaResourceDialect
3066 );
3067 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerSetPartitionLimitRequest>(&header, _body_bytes, handles, &mut req)?;
3068 let control_handle =
3069 VolumeManagerControlHandle { inner: this.inner.clone() };
3070 Ok(VolumeManagerRequest::SetPartitionLimit {
3071 guid: req.guid,
3072 slice_count: req.slice_count,
3073
3074 responder: VolumeManagerSetPartitionLimitResponder {
3075 control_handle: std::mem::ManuallyDrop::new(control_handle),
3076 tx_id: header.tx_id,
3077 },
3078 })
3079 }
3080 0x4539a9b95cba0397 => {
3081 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3082 let mut req = fidl::new_empty!(
3083 VolumeManagerSetPartitionNameRequest,
3084 fidl::encoding::DefaultFuchsiaResourceDialect
3085 );
3086 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerSetPartitionNameRequest>(&header, _body_bytes, handles, &mut req)?;
3087 let control_handle =
3088 VolumeManagerControlHandle { inner: this.inner.clone() };
3089 Ok(VolumeManagerRequest::SetPartitionName {
3090 guid: req.guid,
3091 name: req.name,
3092
3093 responder: VolumeManagerSetPartitionNameResponder {
3094 control_handle: std::mem::ManuallyDrop::new(control_handle),
3095 tx_id: header.tx_id,
3096 },
3097 })
3098 }
3099 _ => Err(fidl::Error::UnknownOrdinal {
3100 ordinal: header.ordinal,
3101 protocol_name:
3102 <VolumeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3103 }),
3104 }))
3105 },
3106 )
3107 }
3108}
3109
3110#[derive(Debug)]
3112pub enum VolumeManagerRequest {
3113 AllocatePartition {
3120 slice_count: u64,
3121 type_: fidl_fuchsia_hardware_block_partition::Guid,
3122 instance: fidl_fuchsia_hardware_block_partition::Guid,
3123 name: String,
3124 flags: u32,
3125 responder: VolumeManagerAllocatePartitionResponder,
3126 },
3127 GetInfo { responder: VolumeManagerGetInfoResponder },
3135 Activate {
3151 old_guid: fidl_fuchsia_hardware_block_partition::Guid,
3152 new_guid: fidl_fuchsia_hardware_block_partition::Guid,
3153 responder: VolumeManagerActivateResponder,
3154 },
3155 GetPartitionLimit {
3165 guid: fidl_fuchsia_hardware_block_partition::Guid,
3166 responder: VolumeManagerGetPartitionLimitResponder,
3167 },
3168 SetPartitionLimit {
3180 guid: fidl_fuchsia_hardware_block_partition::Guid,
3181 slice_count: u64,
3182 responder: VolumeManagerSetPartitionLimitResponder,
3183 },
3184 SetPartitionName {
3188 guid: fidl_fuchsia_hardware_block_partition::Guid,
3189 name: String,
3190 responder: VolumeManagerSetPartitionNameResponder,
3191 },
3192}
3193
3194impl VolumeManagerRequest {
3195 #[allow(irrefutable_let_patterns)]
3196 pub fn into_allocate_partition(
3197 self,
3198 ) -> Option<(
3199 u64,
3200 fidl_fuchsia_hardware_block_partition::Guid,
3201 fidl_fuchsia_hardware_block_partition::Guid,
3202 String,
3203 u32,
3204 VolumeManagerAllocatePartitionResponder,
3205 )> {
3206 if let VolumeManagerRequest::AllocatePartition {
3207 slice_count,
3208 type_,
3209 instance,
3210 name,
3211 flags,
3212 responder,
3213 } = self
3214 {
3215 Some((slice_count, type_, instance, name, flags, responder))
3216 } else {
3217 None
3218 }
3219 }
3220
3221 #[allow(irrefutable_let_patterns)]
3222 pub fn into_get_info(self) -> Option<(VolumeManagerGetInfoResponder)> {
3223 if let VolumeManagerRequest::GetInfo { responder } = self {
3224 Some((responder))
3225 } else {
3226 None
3227 }
3228 }
3229
3230 #[allow(irrefutable_let_patterns)]
3231 pub fn into_activate(
3232 self,
3233 ) -> Option<(
3234 fidl_fuchsia_hardware_block_partition::Guid,
3235 fidl_fuchsia_hardware_block_partition::Guid,
3236 VolumeManagerActivateResponder,
3237 )> {
3238 if let VolumeManagerRequest::Activate { old_guid, new_guid, responder } = self {
3239 Some((old_guid, new_guid, responder))
3240 } else {
3241 None
3242 }
3243 }
3244
3245 #[allow(irrefutable_let_patterns)]
3246 pub fn into_get_partition_limit(
3247 self,
3248 ) -> Option<(
3249 fidl_fuchsia_hardware_block_partition::Guid,
3250 VolumeManagerGetPartitionLimitResponder,
3251 )> {
3252 if let VolumeManagerRequest::GetPartitionLimit { guid, responder } = self {
3253 Some((guid, responder))
3254 } else {
3255 None
3256 }
3257 }
3258
3259 #[allow(irrefutable_let_patterns)]
3260 pub fn into_set_partition_limit(
3261 self,
3262 ) -> Option<(
3263 fidl_fuchsia_hardware_block_partition::Guid,
3264 u64,
3265 VolumeManagerSetPartitionLimitResponder,
3266 )> {
3267 if let VolumeManagerRequest::SetPartitionLimit { guid, slice_count, responder } = self {
3268 Some((guid, slice_count, responder))
3269 } else {
3270 None
3271 }
3272 }
3273
3274 #[allow(irrefutable_let_patterns)]
3275 pub fn into_set_partition_name(
3276 self,
3277 ) -> Option<(
3278 fidl_fuchsia_hardware_block_partition::Guid,
3279 String,
3280 VolumeManagerSetPartitionNameResponder,
3281 )> {
3282 if let VolumeManagerRequest::SetPartitionName { guid, name, responder } = self {
3283 Some((guid, name, responder))
3284 } else {
3285 None
3286 }
3287 }
3288
3289 pub fn method_name(&self) -> &'static str {
3291 match *self {
3292 VolumeManagerRequest::AllocatePartition { .. } => "allocate_partition",
3293 VolumeManagerRequest::GetInfo { .. } => "get_info",
3294 VolumeManagerRequest::Activate { .. } => "activate",
3295 VolumeManagerRequest::GetPartitionLimit { .. } => "get_partition_limit",
3296 VolumeManagerRequest::SetPartitionLimit { .. } => "set_partition_limit",
3297 VolumeManagerRequest::SetPartitionName { .. } => "set_partition_name",
3298 }
3299 }
3300}
3301
3302#[derive(Debug, Clone)]
3303pub struct VolumeManagerControlHandle {
3304 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3305}
3306
3307impl fidl::endpoints::ControlHandle for VolumeManagerControlHandle {
3308 fn shutdown(&self) {
3309 self.inner.shutdown()
3310 }
3311 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3312 self.inner.shutdown_with_epitaph(status)
3313 }
3314
3315 fn is_closed(&self) -> bool {
3316 self.inner.channel().is_closed()
3317 }
3318 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3319 self.inner.channel().on_closed()
3320 }
3321
3322 #[cfg(target_os = "fuchsia")]
3323 fn signal_peer(
3324 &self,
3325 clear_mask: zx::Signals,
3326 set_mask: zx::Signals,
3327 ) -> Result<(), zx_status::Status> {
3328 use fidl::Peered;
3329 self.inner.channel().signal_peer(clear_mask, set_mask)
3330 }
3331}
3332
3333impl VolumeManagerControlHandle {}
3334
3335#[must_use = "FIDL methods require a response to be sent"]
3336#[derive(Debug)]
3337pub struct VolumeManagerAllocatePartitionResponder {
3338 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3339 tx_id: u32,
3340}
3341
3342impl std::ops::Drop for VolumeManagerAllocatePartitionResponder {
3346 fn drop(&mut self) {
3347 self.control_handle.shutdown();
3348 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3350 }
3351}
3352
3353impl fidl::endpoints::Responder for VolumeManagerAllocatePartitionResponder {
3354 type ControlHandle = VolumeManagerControlHandle;
3355
3356 fn control_handle(&self) -> &VolumeManagerControlHandle {
3357 &self.control_handle
3358 }
3359
3360 fn drop_without_shutdown(mut self) {
3361 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3363 std::mem::forget(self);
3365 }
3366}
3367
3368impl VolumeManagerAllocatePartitionResponder {
3369 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3373 let _result = self.send_raw(status);
3374 if _result.is_err() {
3375 self.control_handle.shutdown();
3376 }
3377 self.drop_without_shutdown();
3378 _result
3379 }
3380
3381 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3383 let _result = self.send_raw(status);
3384 self.drop_without_shutdown();
3385 _result
3386 }
3387
3388 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3389 self.control_handle.inner.send::<VolumeManagerAllocatePartitionResponse>(
3390 (status,),
3391 self.tx_id,
3392 0x4e79f24ed059e394,
3393 fidl::encoding::DynamicFlags::empty(),
3394 )
3395 }
3396}
3397
3398#[must_use = "FIDL methods require a response to be sent"]
3399#[derive(Debug)]
3400pub struct VolumeManagerGetInfoResponder {
3401 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3402 tx_id: u32,
3403}
3404
3405impl std::ops::Drop for VolumeManagerGetInfoResponder {
3409 fn drop(&mut self) {
3410 self.control_handle.shutdown();
3411 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3413 }
3414}
3415
3416impl fidl::endpoints::Responder for VolumeManagerGetInfoResponder {
3417 type ControlHandle = VolumeManagerControlHandle;
3418
3419 fn control_handle(&self) -> &VolumeManagerControlHandle {
3420 &self.control_handle
3421 }
3422
3423 fn drop_without_shutdown(mut self) {
3424 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3426 std::mem::forget(self);
3428 }
3429}
3430
3431impl VolumeManagerGetInfoResponder {
3432 pub fn send(
3436 self,
3437 mut status: i32,
3438 mut info: Option<&VolumeManagerInfo>,
3439 ) -> Result<(), fidl::Error> {
3440 let _result = self.send_raw(status, info);
3441 if _result.is_err() {
3442 self.control_handle.shutdown();
3443 }
3444 self.drop_without_shutdown();
3445 _result
3446 }
3447
3448 pub fn send_no_shutdown_on_err(
3450 self,
3451 mut status: i32,
3452 mut info: Option<&VolumeManagerInfo>,
3453 ) -> Result<(), fidl::Error> {
3454 let _result = self.send_raw(status, info);
3455 self.drop_without_shutdown();
3456 _result
3457 }
3458
3459 fn send_raw(
3460 &self,
3461 mut status: i32,
3462 mut info: Option<&VolumeManagerInfo>,
3463 ) -> Result<(), fidl::Error> {
3464 self.control_handle.inner.send::<VolumeManagerGetInfoResponse>(
3465 (status, info),
3466 self.tx_id,
3467 0x735b3548582b2c9,
3468 fidl::encoding::DynamicFlags::empty(),
3469 )
3470 }
3471}
3472
3473#[must_use = "FIDL methods require a response to be sent"]
3474#[derive(Debug)]
3475pub struct VolumeManagerActivateResponder {
3476 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3477 tx_id: u32,
3478}
3479
3480impl std::ops::Drop for VolumeManagerActivateResponder {
3484 fn drop(&mut self) {
3485 self.control_handle.shutdown();
3486 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3488 }
3489}
3490
3491impl fidl::endpoints::Responder for VolumeManagerActivateResponder {
3492 type ControlHandle = VolumeManagerControlHandle;
3493
3494 fn control_handle(&self) -> &VolumeManagerControlHandle {
3495 &self.control_handle
3496 }
3497
3498 fn drop_without_shutdown(mut self) {
3499 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3501 std::mem::forget(self);
3503 }
3504}
3505
3506impl VolumeManagerActivateResponder {
3507 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3511 let _result = self.send_raw(status);
3512 if _result.is_err() {
3513 self.control_handle.shutdown();
3514 }
3515 self.drop_without_shutdown();
3516 _result
3517 }
3518
3519 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3521 let _result = self.send_raw(status);
3522 self.drop_without_shutdown();
3523 _result
3524 }
3525
3526 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3527 self.control_handle.inner.send::<VolumeManagerActivateResponse>(
3528 (status,),
3529 self.tx_id,
3530 0xc8cef57012874d0,
3531 fidl::encoding::DynamicFlags::empty(),
3532 )
3533 }
3534}
3535
3536#[must_use = "FIDL methods require a response to be sent"]
3537#[derive(Debug)]
3538pub struct VolumeManagerGetPartitionLimitResponder {
3539 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3540 tx_id: u32,
3541}
3542
3543impl std::ops::Drop for VolumeManagerGetPartitionLimitResponder {
3547 fn drop(&mut self) {
3548 self.control_handle.shutdown();
3549 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3551 }
3552}
3553
3554impl fidl::endpoints::Responder for VolumeManagerGetPartitionLimitResponder {
3555 type ControlHandle = VolumeManagerControlHandle;
3556
3557 fn control_handle(&self) -> &VolumeManagerControlHandle {
3558 &self.control_handle
3559 }
3560
3561 fn drop_without_shutdown(mut self) {
3562 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3564 std::mem::forget(self);
3566 }
3567}
3568
3569impl VolumeManagerGetPartitionLimitResponder {
3570 pub fn send(self, mut status: i32, mut slice_count: u64) -> Result<(), fidl::Error> {
3574 let _result = self.send_raw(status, slice_count);
3575 if _result.is_err() {
3576 self.control_handle.shutdown();
3577 }
3578 self.drop_without_shutdown();
3579 _result
3580 }
3581
3582 pub fn send_no_shutdown_on_err(
3584 self,
3585 mut status: i32,
3586 mut slice_count: u64,
3587 ) -> Result<(), fidl::Error> {
3588 let _result = self.send_raw(status, slice_count);
3589 self.drop_without_shutdown();
3590 _result
3591 }
3592
3593 fn send_raw(&self, mut status: i32, mut slice_count: u64) -> Result<(), fidl::Error> {
3594 self.control_handle.inner.send::<VolumeManagerGetPartitionLimitResponse>(
3595 (status, slice_count),
3596 self.tx_id,
3597 0x6e32f6df9fa2a919,
3598 fidl::encoding::DynamicFlags::empty(),
3599 )
3600 }
3601}
3602
3603#[must_use = "FIDL methods require a response to be sent"]
3604#[derive(Debug)]
3605pub struct VolumeManagerSetPartitionLimitResponder {
3606 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3607 tx_id: u32,
3608}
3609
3610impl std::ops::Drop for VolumeManagerSetPartitionLimitResponder {
3614 fn drop(&mut self) {
3615 self.control_handle.shutdown();
3616 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3618 }
3619}
3620
3621impl fidl::endpoints::Responder for VolumeManagerSetPartitionLimitResponder {
3622 type ControlHandle = VolumeManagerControlHandle;
3623
3624 fn control_handle(&self) -> &VolumeManagerControlHandle {
3625 &self.control_handle
3626 }
3627
3628 fn drop_without_shutdown(mut self) {
3629 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3631 std::mem::forget(self);
3633 }
3634}
3635
3636impl VolumeManagerSetPartitionLimitResponder {
3637 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3641 let _result = self.send_raw(status);
3642 if _result.is_err() {
3643 self.control_handle.shutdown();
3644 }
3645 self.drop_without_shutdown();
3646 _result
3647 }
3648
3649 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3651 let _result = self.send_raw(status);
3652 self.drop_without_shutdown();
3653 _result
3654 }
3655
3656 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3657 self.control_handle.inner.send::<VolumeManagerSetPartitionLimitResponse>(
3658 (status,),
3659 self.tx_id,
3660 0x2e09076ef266fa35,
3661 fidl::encoding::DynamicFlags::empty(),
3662 )
3663 }
3664}
3665
3666#[must_use = "FIDL methods require a response to be sent"]
3667#[derive(Debug)]
3668pub struct VolumeManagerSetPartitionNameResponder {
3669 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3670 tx_id: u32,
3671}
3672
3673impl std::ops::Drop for VolumeManagerSetPartitionNameResponder {
3677 fn drop(&mut self) {
3678 self.control_handle.shutdown();
3679 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3681 }
3682}
3683
3684impl fidl::endpoints::Responder for VolumeManagerSetPartitionNameResponder {
3685 type ControlHandle = VolumeManagerControlHandle;
3686
3687 fn control_handle(&self) -> &VolumeManagerControlHandle {
3688 &self.control_handle
3689 }
3690
3691 fn drop_without_shutdown(mut self) {
3692 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3694 std::mem::forget(self);
3696 }
3697}
3698
3699impl VolumeManagerSetPartitionNameResponder {
3700 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3704 let _result = self.send_raw(result);
3705 if _result.is_err() {
3706 self.control_handle.shutdown();
3707 }
3708 self.drop_without_shutdown();
3709 _result
3710 }
3711
3712 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3714 let _result = self.send_raw(result);
3715 self.drop_without_shutdown();
3716 _result
3717 }
3718
3719 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3720 self.control_handle
3721 .inner
3722 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3723 result,
3724 self.tx_id,
3725 0x4539a9b95cba0397,
3726 fidl::encoding::DynamicFlags::empty(),
3727 )
3728 }
3729}
3730
3731#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3732pub struct ServiceMarker;
3733
3734#[cfg(target_os = "fuchsia")]
3735impl fidl::endpoints::ServiceMarker for ServiceMarker {
3736 type Proxy = ServiceProxy;
3737 type Request = ServiceRequest;
3738 const SERVICE_NAME: &'static str = "fuchsia.hardware.block.volume.Service";
3739}
3740
3741#[cfg(target_os = "fuchsia")]
3744pub enum ServiceRequest {
3745 Volume(VolumeRequestStream),
3746}
3747
3748#[cfg(target_os = "fuchsia")]
3749impl fidl::endpoints::ServiceRequest for ServiceRequest {
3750 type Service = ServiceMarker;
3751
3752 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
3753 match name {
3754 "volume" => Self::Volume(
3755 <VolumeRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
3756 ),
3757 _ => panic!("no such member protocol name for service Service"),
3758 }
3759 }
3760
3761 fn member_names() -> &'static [&'static str] {
3762 &["volume"]
3763 }
3764}
3765#[cfg(target_os = "fuchsia")]
3766pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
3767
3768#[cfg(target_os = "fuchsia")]
3769impl fidl::endpoints::ServiceProxy for ServiceProxy {
3770 type Service = ServiceMarker;
3771
3772 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
3773 Self(opener)
3774 }
3775}
3776
3777#[cfg(target_os = "fuchsia")]
3778impl ServiceProxy {
3779 pub fn connect_to_volume(&self) -> Result<VolumeProxy, fidl::Error> {
3780 let (proxy, server_end) = fidl::endpoints::create_proxy::<VolumeMarker>();
3781 self.connect_channel_to_volume(server_end)?;
3782 Ok(proxy)
3783 }
3784
3785 pub fn connect_to_volume_sync(&self) -> Result<VolumeSynchronousProxy, fidl::Error> {
3788 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<VolumeMarker>();
3789 self.connect_channel_to_volume(server_end)?;
3790 Ok(proxy)
3791 }
3792
3793 pub fn connect_channel_to_volume(
3796 &self,
3797 server_end: fidl::endpoints::ServerEnd<VolumeMarker>,
3798 ) -> Result<(), fidl::Error> {
3799 self.0.open_member("volume", server_end.into_channel())
3800 }
3801
3802 pub fn instance_name(&self) -> &str {
3803 self.0.instance_name()
3804 }
3805}
3806
3807mod internal {
3808 use super::*;
3809}