1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fdomain_client::fidl::{ControlHandle as _, FDomainFlexibleIntoResult as _, Responder as _};
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9pub use fidl_fuchsia_storage_block_common::*;
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14pub struct BlockOpenSessionRequest {
15 pub session: fdomain_client::fidl::ServerEnd<SessionMarker>,
16}
17
18impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for BlockOpenSessionRequest {}
19
20#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
21pub struct BlockOpenSessionWithOptionsRequest {
22 pub session: fdomain_client::fidl::ServerEnd<SessionMarker>,
23 pub mappings: Vec<BlockOffsetMapping>,
24}
25
26impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
27 for BlockOpenSessionWithOptionsRequest
28{
29}
30
31#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
32pub struct SessionAttachVmoRequest {
33 pub vmo: fdomain_client::Vmo,
34}
35
36impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for SessionAttachVmoRequest {}
37
38#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39pub struct SessionGetFifoResponse {
40 pub fifo: fdomain_client::Fifo,
41}
42
43impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for SessionGetFifoResponse {}
44
45#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
46pub struct BlockMarker;
47
48impl fdomain_client::fidl::ProtocolMarker for BlockMarker {
49 type Proxy = BlockProxy;
50 type RequestStream = BlockRequestStream;
51
52 const DEBUG_NAME: &'static str = "fuchsia.storage.block.Block";
53}
54impl fdomain_client::fidl::DiscoverableProtocolMarker for BlockMarker {}
55pub type BlockGetInfoResult = Result<BlockInfo, i32>;
56pub type BlockGetMetadataResult = Result<PartitionInfo, i32>;
57
58pub trait BlockProxyInterface: Send + Sync {
59 type GetInfoResponseFut: std::future::Future<Output = Result<BlockGetInfoResult, fidl::Error>>
60 + Send;
61 fn r#get_info(&self) -> Self::GetInfoResponseFut;
62 fn r#open_session(
63 &self,
64 session: fdomain_client::fidl::ServerEnd<SessionMarker>,
65 ) -> Result<(), fidl::Error>;
66 fn r#open_session_with_options(
67 &self,
68 session: fdomain_client::fidl::ServerEnd<SessionMarker>,
69 mappings: &[BlockOffsetMapping],
70 ) -> Result<(), fidl::Error>;
71 type GetTypeGuidResponseFut: std::future::Future<Output = Result<(i32, Option<Box<Guid>>), fidl::Error>>
72 + Send;
73 fn r#get_type_guid(&self) -> Self::GetTypeGuidResponseFut;
74 type GetInstanceGuidResponseFut: std::future::Future<Output = Result<(i32, Option<Box<Guid>>), fidl::Error>>
75 + Send;
76 fn r#get_instance_guid(&self) -> Self::GetInstanceGuidResponseFut;
77 type GetNameResponseFut: std::future::Future<Output = Result<(i32, Option<String>), fidl::Error>>
78 + Send;
79 fn r#get_name(&self) -> Self::GetNameResponseFut;
80 type GetMetadataResponseFut: std::future::Future<Output = Result<BlockGetMetadataResult, fidl::Error>>
81 + Send;
82 fn r#get_metadata(&self) -> Self::GetMetadataResponseFut;
83 type QuerySlicesResponseFut: std::future::Future<Output = Result<(i32, [VsliceRange; 16], u64), fidl::Error>>
84 + Send;
85 fn r#query_slices(&self, start_slices: &[u64]) -> Self::QuerySlicesResponseFut;
86 type GetVolumeInfoResponseFut: std::future::Future<
87 Output = Result<
88 (i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
89 fidl::Error,
90 >,
91 > + Send;
92 fn r#get_volume_info(&self) -> Self::GetVolumeInfoResponseFut;
93 type ExtendResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
94 fn r#extend(&self, start_slice: u64, slice_count: u64) -> Self::ExtendResponseFut;
95 type ShrinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
96 fn r#shrink(&self, start_slice: u64, slice_count: u64) -> Self::ShrinkResponseFut;
97 type DestroyResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
98 fn r#destroy(&self) -> Self::DestroyResponseFut;
99}
100
101#[derive(Debug, Clone)]
102pub struct BlockProxy {
103 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
104}
105
106impl fdomain_client::fidl::Proxy for BlockProxy {
107 type Protocol = BlockMarker;
108
109 fn from_channel(inner: fdomain_client::Channel) -> Self {
110 Self::new(inner)
111 }
112
113 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
114 self.client.into_channel().map_err(|client| Self { client })
115 }
116
117 fn as_channel(&self) -> &fdomain_client::Channel {
118 self.client.as_channel()
119 }
120}
121
122impl BlockProxy {
123 pub fn new(channel: fdomain_client::Channel) -> Self {
125 let protocol_name = <BlockMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
126 Self { client: fidl::client::Client::new(channel, protocol_name) }
127 }
128
129 pub fn take_event_stream(&self) -> BlockEventStream {
135 BlockEventStream { event_receiver: self.client.take_event_receiver() }
136 }
137
138 pub fn r#get_info(
140 &self,
141 ) -> fidl::client::QueryResponseFut<
142 BlockGetInfoResult,
143 fdomain_client::fidl::FDomainResourceDialect,
144 > {
145 BlockProxyInterface::r#get_info(self)
146 }
147
148 pub fn r#open_session(
150 &self,
151 mut session: fdomain_client::fidl::ServerEnd<SessionMarker>,
152 ) -> Result<(), fidl::Error> {
153 BlockProxyInterface::r#open_session(self, session)
154 }
155
156 pub fn r#open_session_with_options(
177 &self,
178 mut session: fdomain_client::fidl::ServerEnd<SessionMarker>,
179 mut mappings: &[BlockOffsetMapping],
180 ) -> Result<(), fidl::Error> {
181 BlockProxyInterface::r#open_session_with_options(self, session, mappings)
182 }
183
184 pub fn r#get_type_guid(
187 &self,
188 ) -> fidl::client::QueryResponseFut<
189 (i32, Option<Box<Guid>>),
190 fdomain_client::fidl::FDomainResourceDialect,
191 > {
192 BlockProxyInterface::r#get_type_guid(self)
193 }
194
195 pub fn r#get_instance_guid(
198 &self,
199 ) -> fidl::client::QueryResponseFut<
200 (i32, Option<Box<Guid>>),
201 fdomain_client::fidl::FDomainResourceDialect,
202 > {
203 BlockProxyInterface::r#get_instance_guid(self)
204 }
205
206 pub fn r#get_name(
209 &self,
210 ) -> fidl::client::QueryResponseFut<
211 (i32, Option<String>),
212 fdomain_client::fidl::FDomainResourceDialect,
213 > {
214 BlockProxyInterface::r#get_name(self)
215 }
216
217 pub fn r#get_metadata(
221 &self,
222 ) -> fidl::client::QueryResponseFut<
223 BlockGetMetadataResult,
224 fdomain_client::fidl::FDomainResourceDialect,
225 > {
226 BlockProxyInterface::r#get_metadata(self)
227 }
228
229 pub fn r#query_slices(
234 &self,
235 mut start_slices: &[u64],
236 ) -> fidl::client::QueryResponseFut<
237 (i32, [VsliceRange; 16], u64),
238 fdomain_client::fidl::FDomainResourceDialect,
239 > {
240 BlockProxyInterface::r#query_slices(self, start_slices)
241 }
242
243 pub fn r#get_volume_info(
247 &self,
248 ) -> fidl::client::QueryResponseFut<
249 (i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
250 fdomain_client::fidl::FDomainResourceDialect,
251 > {
252 BlockProxyInterface::r#get_volume_info(self)
253 }
254
255 pub fn r#extend(
263 &self,
264 mut start_slice: u64,
265 mut slice_count: u64,
266 ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
267 BlockProxyInterface::r#extend(self, start_slice, slice_count)
268 }
269
270 pub fn r#shrink(
275 &self,
276 mut start_slice: u64,
277 mut slice_count: u64,
278 ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
279 BlockProxyInterface::r#shrink(self, start_slice, slice_count)
280 }
281
282 pub fn r#destroy(
287 &self,
288 ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
289 BlockProxyInterface::r#destroy(self)
290 }
291}
292
293impl BlockProxyInterface for BlockProxy {
294 type GetInfoResponseFut = fidl::client::QueryResponseFut<
295 BlockGetInfoResult,
296 fdomain_client::fidl::FDomainResourceDialect,
297 >;
298 fn r#get_info(&self) -> Self::GetInfoResponseFut {
299 fn _decode(
300 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
301 ) -> Result<BlockGetInfoResult, fidl::Error> {
302 let _response = fidl::client::decode_transaction_body::<
303 fidl::encoding::ResultType<BlockGetInfoResponse, i32>,
304 fdomain_client::fidl::FDomainResourceDialect,
305 0x58777a4a31cc9a47,
306 >(_buf?)?;
307 Ok(_response.map(|x| x.info))
308 }
309 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, BlockGetInfoResult>(
310 (),
311 0x58777a4a31cc9a47,
312 fidl::encoding::DynamicFlags::empty(),
313 _decode,
314 )
315 }
316
317 fn r#open_session(
318 &self,
319 mut session: fdomain_client::fidl::ServerEnd<SessionMarker>,
320 ) -> Result<(), fidl::Error> {
321 self.client.send::<BlockOpenSessionRequest>(
322 (session,),
323 0x2ca32f8c64f1d6c8,
324 fidl::encoding::DynamicFlags::empty(),
325 )
326 }
327
328 fn r#open_session_with_options(
329 &self,
330 mut session: fdomain_client::fidl::ServerEnd<SessionMarker>,
331 mut mappings: &[BlockOffsetMapping],
332 ) -> Result<(), fidl::Error> {
333 self.client.send::<BlockOpenSessionWithOptionsRequest>(
334 (session, mappings),
335 0x1974e5f7b9de6f0c,
336 fidl::encoding::DynamicFlags::empty(),
337 )
338 }
339
340 type GetTypeGuidResponseFut = fidl::client::QueryResponseFut<
341 (i32, Option<Box<Guid>>),
342 fdomain_client::fidl::FDomainResourceDialect,
343 >;
344 fn r#get_type_guid(&self) -> Self::GetTypeGuidResponseFut {
345 fn _decode(
346 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
347 ) -> Result<(i32, Option<Box<Guid>>), fidl::Error> {
348 let _response = fidl::client::decode_transaction_body::<
349 BlockGetTypeGuidResponse,
350 fdomain_client::fidl::FDomainResourceDialect,
351 0xefe4e41dafce4cc,
352 >(_buf?)?;
353 Ok((_response.status, _response.guid))
354 }
355 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<Box<Guid>>)>(
356 (),
357 0xefe4e41dafce4cc,
358 fidl::encoding::DynamicFlags::empty(),
359 _decode,
360 )
361 }
362
363 type GetInstanceGuidResponseFut = fidl::client::QueryResponseFut<
364 (i32, Option<Box<Guid>>),
365 fdomain_client::fidl::FDomainResourceDialect,
366 >;
367 fn r#get_instance_guid(&self) -> Self::GetInstanceGuidResponseFut {
368 fn _decode(
369 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
370 ) -> Result<(i32, Option<Box<Guid>>), fidl::Error> {
371 let _response = fidl::client::decode_transaction_body::<
372 BlockGetInstanceGuidResponse,
373 fdomain_client::fidl::FDomainResourceDialect,
374 0x2e85011aabeb87fb,
375 >(_buf?)?;
376 Ok((_response.status, _response.guid))
377 }
378 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<Box<Guid>>)>(
379 (),
380 0x2e85011aabeb87fb,
381 fidl::encoding::DynamicFlags::empty(),
382 _decode,
383 )
384 }
385
386 type GetNameResponseFut = fidl::client::QueryResponseFut<
387 (i32, Option<String>),
388 fdomain_client::fidl::FDomainResourceDialect,
389 >;
390 fn r#get_name(&self) -> Self::GetNameResponseFut {
391 fn _decode(
392 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
393 ) -> Result<(i32, Option<String>), fidl::Error> {
394 let _response = fidl::client::decode_transaction_body::<
395 BlockGetNameResponse,
396 fdomain_client::fidl::FDomainResourceDialect,
397 0x630be18badedbb05,
398 >(_buf?)?;
399 Ok((_response.status, _response.name))
400 }
401 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<String>)>(
402 (),
403 0x630be18badedbb05,
404 fidl::encoding::DynamicFlags::empty(),
405 _decode,
406 )
407 }
408
409 type GetMetadataResponseFut = fidl::client::QueryResponseFut<
410 BlockGetMetadataResult,
411 fdomain_client::fidl::FDomainResourceDialect,
412 >;
413 fn r#get_metadata(&self) -> Self::GetMetadataResponseFut {
414 fn _decode(
415 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
416 ) -> Result<BlockGetMetadataResult, fidl::Error> {
417 let _response = fidl::client::decode_transaction_body::<
418 fidl::encoding::ResultType<PartitionInfo, i32>,
419 fdomain_client::fidl::FDomainResourceDialect,
420 0x2c76b02ef9382533,
421 >(_buf?)?;
422 Ok(_response.map(|x| x))
423 }
424 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, BlockGetMetadataResult>(
425 (),
426 0x2c76b02ef9382533,
427 fidl::encoding::DynamicFlags::empty(),
428 _decode,
429 )
430 }
431
432 type QuerySlicesResponseFut = fidl::client::QueryResponseFut<
433 (i32, [VsliceRange; 16], u64),
434 fdomain_client::fidl::FDomainResourceDialect,
435 >;
436 fn r#query_slices(&self, mut start_slices: &[u64]) -> Self::QuerySlicesResponseFut {
437 fn _decode(
438 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
439 ) -> Result<(i32, [VsliceRange; 16], u64), fidl::Error> {
440 let _response = fidl::client::decode_transaction_body::<
441 BlockQuerySlicesResponse,
442 fdomain_client::fidl::FDomainResourceDialect,
443 0x289240ac4fbaa190,
444 >(_buf?)?;
445 Ok((_response.status, _response.response, _response.response_count))
446 }
447 self.client.send_query_and_decode::<BlockQuerySlicesRequest, (i32, [VsliceRange; 16], u64)>(
448 (start_slices,),
449 0x289240ac4fbaa190,
450 fidl::encoding::DynamicFlags::empty(),
451 _decode,
452 )
453 }
454
455 type GetVolumeInfoResponseFut = fidl::client::QueryResponseFut<
456 (i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
457 fdomain_client::fidl::FDomainResourceDialect,
458 >;
459 fn r#get_volume_info(&self) -> Self::GetVolumeInfoResponseFut {
460 fn _decode(
461 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
462 ) -> Result<(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>), fidl::Error>
463 {
464 let _response = fidl::client::decode_transaction_body::<
465 BlockGetVolumeInfoResponse,
466 fdomain_client::fidl::FDomainResourceDialect,
467 0x3a7dc69ea5d788d4,
468 >(_buf?)?;
469 Ok((_response.status, _response.manager, _response.volume))
470 }
471 self.client.send_query_and_decode::<
472 fidl::encoding::EmptyPayload,
473 (i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
474 >(
475 (),
476 0x3a7dc69ea5d788d4,
477 fidl::encoding::DynamicFlags::empty(),
478 _decode,
479 )
480 }
481
482 type ExtendResponseFut =
483 fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
484 fn r#extend(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ExtendResponseFut {
485 fn _decode(
486 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
487 ) -> Result<i32, fidl::Error> {
488 let _response = fidl::client::decode_transaction_body::<
489 BlockExtendResponse,
490 fdomain_client::fidl::FDomainResourceDialect,
491 0x273fb2980ff24157,
492 >(_buf?)?;
493 Ok(_response.status)
494 }
495 self.client.send_query_and_decode::<BlockExtendRequest, i32>(
496 (start_slice, slice_count),
497 0x273fb2980ff24157,
498 fidl::encoding::DynamicFlags::empty(),
499 _decode,
500 )
501 }
502
503 type ShrinkResponseFut =
504 fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
505 fn r#shrink(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ShrinkResponseFut {
506 fn _decode(
507 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
508 ) -> Result<i32, fidl::Error> {
509 let _response = fidl::client::decode_transaction_body::<
510 BlockShrinkResponse,
511 fdomain_client::fidl::FDomainResourceDialect,
512 0x73da6de865600a8b,
513 >(_buf?)?;
514 Ok(_response.status)
515 }
516 self.client.send_query_and_decode::<BlockShrinkRequest, i32>(
517 (start_slice, slice_count),
518 0x73da6de865600a8b,
519 fidl::encoding::DynamicFlags::empty(),
520 _decode,
521 )
522 }
523
524 type DestroyResponseFut =
525 fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
526 fn r#destroy(&self) -> Self::DestroyResponseFut {
527 fn _decode(
528 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
529 ) -> Result<i32, fidl::Error> {
530 let _response = fidl::client::decode_transaction_body::<
531 BlockDestroyResponse,
532 fdomain_client::fidl::FDomainResourceDialect,
533 0x5866ba764e05a68e,
534 >(_buf?)?;
535 Ok(_response.status)
536 }
537 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
538 (),
539 0x5866ba764e05a68e,
540 fidl::encoding::DynamicFlags::empty(),
541 _decode,
542 )
543 }
544}
545
546pub struct BlockEventStream {
547 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
548}
549
550impl std::marker::Unpin for BlockEventStream {}
551
552impl futures::stream::FusedStream for BlockEventStream {
553 fn is_terminated(&self) -> bool {
554 self.event_receiver.is_terminated()
555 }
556}
557
558impl futures::Stream for BlockEventStream {
559 type Item = Result<BlockEvent, fidl::Error>;
560
561 fn poll_next(
562 mut self: std::pin::Pin<&mut Self>,
563 cx: &mut std::task::Context<'_>,
564 ) -> std::task::Poll<Option<Self::Item>> {
565 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
566 &mut self.event_receiver,
567 cx
568 )?) {
569 Some(buf) => std::task::Poll::Ready(Some(BlockEvent::decode(buf))),
570 None => std::task::Poll::Ready(None),
571 }
572 }
573}
574
575#[derive(Debug)]
576pub enum BlockEvent {}
577
578impl BlockEvent {
579 fn decode(
581 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
582 ) -> Result<BlockEvent, fidl::Error> {
583 let (bytes, _handles) = buf.split_mut();
584 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
585 debug_assert_eq!(tx_header.tx_id, 0);
586 match tx_header.ordinal {
587 _ => Err(fidl::Error::UnknownOrdinal {
588 ordinal: tx_header.ordinal,
589 protocol_name: <BlockMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
590 }),
591 }
592 }
593}
594
595pub struct BlockRequestStream {
597 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
598 is_terminated: bool,
599}
600
601impl std::marker::Unpin for BlockRequestStream {}
602
603impl futures::stream::FusedStream for BlockRequestStream {
604 fn is_terminated(&self) -> bool {
605 self.is_terminated
606 }
607}
608
609impl fdomain_client::fidl::RequestStream for BlockRequestStream {
610 type Protocol = BlockMarker;
611 type ControlHandle = BlockControlHandle;
612
613 fn from_channel(channel: fdomain_client::Channel) -> Self {
614 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
615 }
616
617 fn control_handle(&self) -> Self::ControlHandle {
618 BlockControlHandle { inner: self.inner.clone() }
619 }
620
621 fn into_inner(
622 self,
623 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
624 {
625 (self.inner, self.is_terminated)
626 }
627
628 fn from_inner(
629 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
630 is_terminated: bool,
631 ) -> Self {
632 Self { inner, is_terminated }
633 }
634}
635
636impl futures::Stream for BlockRequestStream {
637 type Item = Result<BlockRequest, fidl::Error>;
638
639 fn poll_next(
640 mut self: std::pin::Pin<&mut Self>,
641 cx: &mut std::task::Context<'_>,
642 ) -> std::task::Poll<Option<Self::Item>> {
643 let this = &mut *self;
644 if this.inner.check_shutdown(cx) {
645 this.is_terminated = true;
646 return std::task::Poll::Ready(None);
647 }
648 if this.is_terminated {
649 panic!("polled BlockRequestStream after completion");
650 }
651 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
652 |bytes, handles| {
653 match this.inner.channel().read_etc(cx, bytes, handles) {
654 std::task::Poll::Ready(Ok(())) => {}
655 std::task::Poll::Pending => return std::task::Poll::Pending,
656 std::task::Poll::Ready(Err(None)) => {
657 this.is_terminated = true;
658 return std::task::Poll::Ready(None);
659 }
660 std::task::Poll::Ready(Err(Some(e))) => {
661 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
662 e.into(),
663 ))));
664 }
665 }
666
667 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
669
670 std::task::Poll::Ready(Some(match header.ordinal {
671 0x58777a4a31cc9a47 => {
672 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
673 let mut req = fidl::new_empty!(
674 fidl::encoding::EmptyPayload,
675 fdomain_client::fidl::FDomainResourceDialect
676 );
677 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
678 let control_handle = BlockControlHandle { inner: this.inner.clone() };
679 Ok(BlockRequest::GetInfo {
680 responder: BlockGetInfoResponder {
681 control_handle: std::mem::ManuallyDrop::new(control_handle),
682 tx_id: header.tx_id,
683 },
684 })
685 }
686 0x2ca32f8c64f1d6c8 => {
687 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
688 let mut req = fidl::new_empty!(
689 BlockOpenSessionRequest,
690 fdomain_client::fidl::FDomainResourceDialect
691 );
692 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<BlockOpenSessionRequest>(&header, _body_bytes, handles, &mut req)?;
693 let control_handle = BlockControlHandle { inner: this.inner.clone() };
694 Ok(BlockRequest::OpenSession { session: req.session, control_handle })
695 }
696 0x1974e5f7b9de6f0c => {
697 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
698 let mut req = fidl::new_empty!(
699 BlockOpenSessionWithOptionsRequest,
700 fdomain_client::fidl::FDomainResourceDialect
701 );
702 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<BlockOpenSessionWithOptionsRequest>(&header, _body_bytes, handles, &mut req)?;
703 let control_handle = BlockControlHandle { inner: this.inner.clone() };
704 Ok(BlockRequest::OpenSessionWithOptions {
705 session: req.session,
706 mappings: req.mappings,
707
708 control_handle,
709 })
710 }
711 0xefe4e41dafce4cc => {
712 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
713 let mut req = fidl::new_empty!(
714 fidl::encoding::EmptyPayload,
715 fdomain_client::fidl::FDomainResourceDialect
716 );
717 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
718 let control_handle = BlockControlHandle { inner: this.inner.clone() };
719 Ok(BlockRequest::GetTypeGuid {
720 responder: BlockGetTypeGuidResponder {
721 control_handle: std::mem::ManuallyDrop::new(control_handle),
722 tx_id: header.tx_id,
723 },
724 })
725 }
726 0x2e85011aabeb87fb => {
727 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
728 let mut req = fidl::new_empty!(
729 fidl::encoding::EmptyPayload,
730 fdomain_client::fidl::FDomainResourceDialect
731 );
732 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
733 let control_handle = BlockControlHandle { inner: this.inner.clone() };
734 Ok(BlockRequest::GetInstanceGuid {
735 responder: BlockGetInstanceGuidResponder {
736 control_handle: std::mem::ManuallyDrop::new(control_handle),
737 tx_id: header.tx_id,
738 },
739 })
740 }
741 0x630be18badedbb05 => {
742 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
743 let mut req = fidl::new_empty!(
744 fidl::encoding::EmptyPayload,
745 fdomain_client::fidl::FDomainResourceDialect
746 );
747 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
748 let control_handle = BlockControlHandle { inner: this.inner.clone() };
749 Ok(BlockRequest::GetName {
750 responder: BlockGetNameResponder {
751 control_handle: std::mem::ManuallyDrop::new(control_handle),
752 tx_id: header.tx_id,
753 },
754 })
755 }
756 0x2c76b02ef9382533 => {
757 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
758 let mut req = fidl::new_empty!(
759 fidl::encoding::EmptyPayload,
760 fdomain_client::fidl::FDomainResourceDialect
761 );
762 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
763 let control_handle = BlockControlHandle { inner: this.inner.clone() };
764 Ok(BlockRequest::GetMetadata {
765 responder: BlockGetMetadataResponder {
766 control_handle: std::mem::ManuallyDrop::new(control_handle),
767 tx_id: header.tx_id,
768 },
769 })
770 }
771 0x289240ac4fbaa190 => {
772 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
773 let mut req = fidl::new_empty!(
774 BlockQuerySlicesRequest,
775 fdomain_client::fidl::FDomainResourceDialect
776 );
777 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<BlockQuerySlicesRequest>(&header, _body_bytes, handles, &mut req)?;
778 let control_handle = BlockControlHandle { inner: this.inner.clone() };
779 Ok(BlockRequest::QuerySlices {
780 start_slices: req.start_slices,
781
782 responder: BlockQuerySlicesResponder {
783 control_handle: std::mem::ManuallyDrop::new(control_handle),
784 tx_id: header.tx_id,
785 },
786 })
787 }
788 0x3a7dc69ea5d788d4 => {
789 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
790 let mut req = fidl::new_empty!(
791 fidl::encoding::EmptyPayload,
792 fdomain_client::fidl::FDomainResourceDialect
793 );
794 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
795 let control_handle = BlockControlHandle { inner: this.inner.clone() };
796 Ok(BlockRequest::GetVolumeInfo {
797 responder: BlockGetVolumeInfoResponder {
798 control_handle: std::mem::ManuallyDrop::new(control_handle),
799 tx_id: header.tx_id,
800 },
801 })
802 }
803 0x273fb2980ff24157 => {
804 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
805 let mut req = fidl::new_empty!(
806 BlockExtendRequest,
807 fdomain_client::fidl::FDomainResourceDialect
808 );
809 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<BlockExtendRequest>(&header, _body_bytes, handles, &mut req)?;
810 let control_handle = BlockControlHandle { inner: this.inner.clone() };
811 Ok(BlockRequest::Extend {
812 start_slice: req.start_slice,
813 slice_count: req.slice_count,
814
815 responder: BlockExtendResponder {
816 control_handle: std::mem::ManuallyDrop::new(control_handle),
817 tx_id: header.tx_id,
818 },
819 })
820 }
821 0x73da6de865600a8b => {
822 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
823 let mut req = fidl::new_empty!(
824 BlockShrinkRequest,
825 fdomain_client::fidl::FDomainResourceDialect
826 );
827 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<BlockShrinkRequest>(&header, _body_bytes, handles, &mut req)?;
828 let control_handle = BlockControlHandle { inner: this.inner.clone() };
829 Ok(BlockRequest::Shrink {
830 start_slice: req.start_slice,
831 slice_count: req.slice_count,
832
833 responder: BlockShrinkResponder {
834 control_handle: std::mem::ManuallyDrop::new(control_handle),
835 tx_id: header.tx_id,
836 },
837 })
838 }
839 0x5866ba764e05a68e => {
840 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
841 let mut req = fidl::new_empty!(
842 fidl::encoding::EmptyPayload,
843 fdomain_client::fidl::FDomainResourceDialect
844 );
845 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
846 let control_handle = BlockControlHandle { inner: this.inner.clone() };
847 Ok(BlockRequest::Destroy {
848 responder: BlockDestroyResponder {
849 control_handle: std::mem::ManuallyDrop::new(control_handle),
850 tx_id: header.tx_id,
851 },
852 })
853 }
854 _ => Err(fidl::Error::UnknownOrdinal {
855 ordinal: header.ordinal,
856 protocol_name:
857 <BlockMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
858 }),
859 }))
860 },
861 )
862 }
863}
864
865#[derive(Debug)]
868pub enum BlockRequest {
869 GetInfo { responder: BlockGetInfoResponder },
871 OpenSession {
873 session: fdomain_client::fidl::ServerEnd<SessionMarker>,
874 control_handle: BlockControlHandle,
875 },
876 OpenSessionWithOptions {
897 session: fdomain_client::fidl::ServerEnd<SessionMarker>,
898 mappings: Vec<BlockOffsetMapping>,
899 control_handle: BlockControlHandle,
900 },
901 GetTypeGuid { responder: BlockGetTypeGuidResponder },
904 GetInstanceGuid { responder: BlockGetInstanceGuidResponder },
907 GetName { responder: BlockGetNameResponder },
910 GetMetadata { responder: BlockGetMetadataResponder },
914 QuerySlices { start_slices: Vec<u64>, responder: BlockQuerySlicesResponder },
919 GetVolumeInfo { responder: BlockGetVolumeInfoResponder },
923 Extend { start_slice: u64, slice_count: u64, responder: BlockExtendResponder },
931 Shrink { start_slice: u64, slice_count: u64, responder: BlockShrinkResponder },
936 Destroy { responder: BlockDestroyResponder },
941}
942
943impl BlockRequest {
944 #[allow(irrefutable_let_patterns)]
945 pub fn into_get_info(self) -> Option<(BlockGetInfoResponder)> {
946 if let BlockRequest::GetInfo { responder } = self { Some((responder)) } else { None }
947 }
948
949 #[allow(irrefutable_let_patterns)]
950 pub fn into_open_session(
951 self,
952 ) -> Option<(fdomain_client::fidl::ServerEnd<SessionMarker>, BlockControlHandle)> {
953 if let BlockRequest::OpenSession { session, control_handle } = self {
954 Some((session, control_handle))
955 } else {
956 None
957 }
958 }
959
960 #[allow(irrefutable_let_patterns)]
961 pub fn into_open_session_with_options(
962 self,
963 ) -> Option<(
964 fdomain_client::fidl::ServerEnd<SessionMarker>,
965 Vec<BlockOffsetMapping>,
966 BlockControlHandle,
967 )> {
968 if let BlockRequest::OpenSessionWithOptions { session, mappings, control_handle } = self {
969 Some((session, mappings, control_handle))
970 } else {
971 None
972 }
973 }
974
975 #[allow(irrefutable_let_patterns)]
976 pub fn into_get_type_guid(self) -> Option<(BlockGetTypeGuidResponder)> {
977 if let BlockRequest::GetTypeGuid { responder } = self { Some((responder)) } else { None }
978 }
979
980 #[allow(irrefutable_let_patterns)]
981 pub fn into_get_instance_guid(self) -> Option<(BlockGetInstanceGuidResponder)> {
982 if let BlockRequest::GetInstanceGuid { responder } = self {
983 Some((responder))
984 } else {
985 None
986 }
987 }
988
989 #[allow(irrefutable_let_patterns)]
990 pub fn into_get_name(self) -> Option<(BlockGetNameResponder)> {
991 if let BlockRequest::GetName { responder } = self { Some((responder)) } else { None }
992 }
993
994 #[allow(irrefutable_let_patterns)]
995 pub fn into_get_metadata(self) -> Option<(BlockGetMetadataResponder)> {
996 if let BlockRequest::GetMetadata { responder } = self { Some((responder)) } else { None }
997 }
998
999 #[allow(irrefutable_let_patterns)]
1000 pub fn into_query_slices(self) -> Option<(Vec<u64>, BlockQuerySlicesResponder)> {
1001 if let BlockRequest::QuerySlices { start_slices, responder } = self {
1002 Some((start_slices, responder))
1003 } else {
1004 None
1005 }
1006 }
1007
1008 #[allow(irrefutable_let_patterns)]
1009 pub fn into_get_volume_info(self) -> Option<(BlockGetVolumeInfoResponder)> {
1010 if let BlockRequest::GetVolumeInfo { responder } = self { Some((responder)) } else { None }
1011 }
1012
1013 #[allow(irrefutable_let_patterns)]
1014 pub fn into_extend(self) -> Option<(u64, u64, BlockExtendResponder)> {
1015 if let BlockRequest::Extend { start_slice, slice_count, responder } = self {
1016 Some((start_slice, slice_count, responder))
1017 } else {
1018 None
1019 }
1020 }
1021
1022 #[allow(irrefutable_let_patterns)]
1023 pub fn into_shrink(self) -> Option<(u64, u64, BlockShrinkResponder)> {
1024 if let BlockRequest::Shrink { start_slice, slice_count, responder } = self {
1025 Some((start_slice, slice_count, responder))
1026 } else {
1027 None
1028 }
1029 }
1030
1031 #[allow(irrefutable_let_patterns)]
1032 pub fn into_destroy(self) -> Option<(BlockDestroyResponder)> {
1033 if let BlockRequest::Destroy { responder } = self { Some((responder)) } else { None }
1034 }
1035
1036 pub fn method_name(&self) -> &'static str {
1038 match *self {
1039 BlockRequest::GetInfo { .. } => "get_info",
1040 BlockRequest::OpenSession { .. } => "open_session",
1041 BlockRequest::OpenSessionWithOptions { .. } => "open_session_with_options",
1042 BlockRequest::GetTypeGuid { .. } => "get_type_guid",
1043 BlockRequest::GetInstanceGuid { .. } => "get_instance_guid",
1044 BlockRequest::GetName { .. } => "get_name",
1045 BlockRequest::GetMetadata { .. } => "get_metadata",
1046 BlockRequest::QuerySlices { .. } => "query_slices",
1047 BlockRequest::GetVolumeInfo { .. } => "get_volume_info",
1048 BlockRequest::Extend { .. } => "extend",
1049 BlockRequest::Shrink { .. } => "shrink",
1050 BlockRequest::Destroy { .. } => "destroy",
1051 }
1052 }
1053}
1054
1055#[derive(Debug, Clone)]
1056pub struct BlockControlHandle {
1057 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1058}
1059
1060impl BlockControlHandle {
1061 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1062 self.inner.shutdown_with_epitaph(status.into())
1063 }
1064}
1065
1066impl fdomain_client::fidl::ControlHandle for BlockControlHandle {
1067 fn shutdown(&self) {
1068 self.inner.shutdown()
1069 }
1070
1071 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1072 self.inner.shutdown_with_epitaph(status)
1073 }
1074
1075 fn is_closed(&self) -> bool {
1076 self.inner.channel().is_closed()
1077 }
1078 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1079 self.inner.channel().on_closed()
1080 }
1081}
1082
1083impl BlockControlHandle {}
1084
1085#[must_use = "FIDL methods require a response to be sent"]
1086#[derive(Debug)]
1087pub struct BlockGetInfoResponder {
1088 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1089 tx_id: u32,
1090}
1091
1092impl std::ops::Drop for BlockGetInfoResponder {
1096 fn drop(&mut self) {
1097 self.control_handle.shutdown();
1098 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1100 }
1101}
1102
1103impl fdomain_client::fidl::Responder for BlockGetInfoResponder {
1104 type ControlHandle = BlockControlHandle;
1105
1106 fn control_handle(&self) -> &BlockControlHandle {
1107 &self.control_handle
1108 }
1109
1110 fn drop_without_shutdown(mut self) {
1111 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1113 std::mem::forget(self);
1115 }
1116}
1117
1118impl BlockGetInfoResponder {
1119 pub fn send(self, mut result: Result<&BlockInfo, i32>) -> Result<(), fidl::Error> {
1123 let _result = self.send_raw(result);
1124 if _result.is_err() {
1125 self.control_handle.shutdown();
1126 }
1127 self.drop_without_shutdown();
1128 _result
1129 }
1130
1131 pub fn send_no_shutdown_on_err(
1133 self,
1134 mut result: Result<&BlockInfo, i32>,
1135 ) -> Result<(), fidl::Error> {
1136 let _result = self.send_raw(result);
1137 self.drop_without_shutdown();
1138 _result
1139 }
1140
1141 fn send_raw(&self, mut result: Result<&BlockInfo, i32>) -> Result<(), fidl::Error> {
1142 self.control_handle.inner.send::<fidl::encoding::ResultType<BlockGetInfoResponse, i32>>(
1143 result.map(|info| (info,)),
1144 self.tx_id,
1145 0x58777a4a31cc9a47,
1146 fidl::encoding::DynamicFlags::empty(),
1147 )
1148 }
1149}
1150
1151#[must_use = "FIDL methods require a response to be sent"]
1152#[derive(Debug)]
1153pub struct BlockGetTypeGuidResponder {
1154 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1155 tx_id: u32,
1156}
1157
1158impl std::ops::Drop for BlockGetTypeGuidResponder {
1162 fn drop(&mut self) {
1163 self.control_handle.shutdown();
1164 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1166 }
1167}
1168
1169impl fdomain_client::fidl::Responder for BlockGetTypeGuidResponder {
1170 type ControlHandle = BlockControlHandle;
1171
1172 fn control_handle(&self) -> &BlockControlHandle {
1173 &self.control_handle
1174 }
1175
1176 fn drop_without_shutdown(mut self) {
1177 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1179 std::mem::forget(self);
1181 }
1182}
1183
1184impl BlockGetTypeGuidResponder {
1185 pub fn send(self, mut status: i32, mut guid: Option<&Guid>) -> Result<(), fidl::Error> {
1189 let _result = self.send_raw(status, guid);
1190 if _result.is_err() {
1191 self.control_handle.shutdown();
1192 }
1193 self.drop_without_shutdown();
1194 _result
1195 }
1196
1197 pub fn send_no_shutdown_on_err(
1199 self,
1200 mut status: i32,
1201 mut guid: Option<&Guid>,
1202 ) -> Result<(), fidl::Error> {
1203 let _result = self.send_raw(status, guid);
1204 self.drop_without_shutdown();
1205 _result
1206 }
1207
1208 fn send_raw(&self, mut status: i32, mut guid: Option<&Guid>) -> Result<(), fidl::Error> {
1209 self.control_handle.inner.send::<BlockGetTypeGuidResponse>(
1210 (status, guid),
1211 self.tx_id,
1212 0xefe4e41dafce4cc,
1213 fidl::encoding::DynamicFlags::empty(),
1214 )
1215 }
1216}
1217
1218#[must_use = "FIDL methods require a response to be sent"]
1219#[derive(Debug)]
1220pub struct BlockGetInstanceGuidResponder {
1221 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1222 tx_id: u32,
1223}
1224
1225impl std::ops::Drop for BlockGetInstanceGuidResponder {
1229 fn drop(&mut self) {
1230 self.control_handle.shutdown();
1231 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1233 }
1234}
1235
1236impl fdomain_client::fidl::Responder for BlockGetInstanceGuidResponder {
1237 type ControlHandle = BlockControlHandle;
1238
1239 fn control_handle(&self) -> &BlockControlHandle {
1240 &self.control_handle
1241 }
1242
1243 fn drop_without_shutdown(mut self) {
1244 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1246 std::mem::forget(self);
1248 }
1249}
1250
1251impl BlockGetInstanceGuidResponder {
1252 pub fn send(self, mut status: i32, mut guid: Option<&Guid>) -> Result<(), fidl::Error> {
1256 let _result = self.send_raw(status, guid);
1257 if _result.is_err() {
1258 self.control_handle.shutdown();
1259 }
1260 self.drop_without_shutdown();
1261 _result
1262 }
1263
1264 pub fn send_no_shutdown_on_err(
1266 self,
1267 mut status: i32,
1268 mut guid: Option<&Guid>,
1269 ) -> Result<(), fidl::Error> {
1270 let _result = self.send_raw(status, guid);
1271 self.drop_without_shutdown();
1272 _result
1273 }
1274
1275 fn send_raw(&self, mut status: i32, mut guid: Option<&Guid>) -> Result<(), fidl::Error> {
1276 self.control_handle.inner.send::<BlockGetInstanceGuidResponse>(
1277 (status, guid),
1278 self.tx_id,
1279 0x2e85011aabeb87fb,
1280 fidl::encoding::DynamicFlags::empty(),
1281 )
1282 }
1283}
1284
1285#[must_use = "FIDL methods require a response to be sent"]
1286#[derive(Debug)]
1287pub struct BlockGetNameResponder {
1288 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1289 tx_id: u32,
1290}
1291
1292impl std::ops::Drop for BlockGetNameResponder {
1296 fn drop(&mut self) {
1297 self.control_handle.shutdown();
1298 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1300 }
1301}
1302
1303impl fdomain_client::fidl::Responder for BlockGetNameResponder {
1304 type ControlHandle = BlockControlHandle;
1305
1306 fn control_handle(&self) -> &BlockControlHandle {
1307 &self.control_handle
1308 }
1309
1310 fn drop_without_shutdown(mut self) {
1311 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1313 std::mem::forget(self);
1315 }
1316}
1317
1318impl BlockGetNameResponder {
1319 pub fn send(self, mut status: i32, mut name: Option<&str>) -> Result<(), fidl::Error> {
1323 let _result = self.send_raw(status, name);
1324 if _result.is_err() {
1325 self.control_handle.shutdown();
1326 }
1327 self.drop_without_shutdown();
1328 _result
1329 }
1330
1331 pub fn send_no_shutdown_on_err(
1333 self,
1334 mut status: i32,
1335 mut name: Option<&str>,
1336 ) -> Result<(), fidl::Error> {
1337 let _result = self.send_raw(status, name);
1338 self.drop_without_shutdown();
1339 _result
1340 }
1341
1342 fn send_raw(&self, mut status: i32, mut name: Option<&str>) -> Result<(), fidl::Error> {
1343 self.control_handle.inner.send::<BlockGetNameResponse>(
1344 (status, name),
1345 self.tx_id,
1346 0x630be18badedbb05,
1347 fidl::encoding::DynamicFlags::empty(),
1348 )
1349 }
1350}
1351
1352#[must_use = "FIDL methods require a response to be sent"]
1353#[derive(Debug)]
1354pub struct BlockGetMetadataResponder {
1355 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1356 tx_id: u32,
1357}
1358
1359impl std::ops::Drop for BlockGetMetadataResponder {
1363 fn drop(&mut self) {
1364 self.control_handle.shutdown();
1365 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1367 }
1368}
1369
1370impl fdomain_client::fidl::Responder for BlockGetMetadataResponder {
1371 type ControlHandle = BlockControlHandle;
1372
1373 fn control_handle(&self) -> &BlockControlHandle {
1374 &self.control_handle
1375 }
1376
1377 fn drop_without_shutdown(mut self) {
1378 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1380 std::mem::forget(self);
1382 }
1383}
1384
1385impl BlockGetMetadataResponder {
1386 pub fn send(self, mut result: Result<&PartitionInfo, i32>) -> Result<(), fidl::Error> {
1390 let _result = self.send_raw(result);
1391 if _result.is_err() {
1392 self.control_handle.shutdown();
1393 }
1394 self.drop_without_shutdown();
1395 _result
1396 }
1397
1398 pub fn send_no_shutdown_on_err(
1400 self,
1401 mut result: Result<&PartitionInfo, i32>,
1402 ) -> Result<(), fidl::Error> {
1403 let _result = self.send_raw(result);
1404 self.drop_without_shutdown();
1405 _result
1406 }
1407
1408 fn send_raw(&self, mut result: Result<&PartitionInfo, i32>) -> Result<(), fidl::Error> {
1409 self.control_handle.inner.send::<fidl::encoding::ResultType<PartitionInfo, i32>>(
1410 result,
1411 self.tx_id,
1412 0x2c76b02ef9382533,
1413 fidl::encoding::DynamicFlags::empty(),
1414 )
1415 }
1416}
1417
1418#[must_use = "FIDL methods require a response to be sent"]
1419#[derive(Debug)]
1420pub struct BlockQuerySlicesResponder {
1421 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1422 tx_id: u32,
1423}
1424
1425impl std::ops::Drop for BlockQuerySlicesResponder {
1429 fn drop(&mut self) {
1430 self.control_handle.shutdown();
1431 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1433 }
1434}
1435
1436impl fdomain_client::fidl::Responder for BlockQuerySlicesResponder {
1437 type ControlHandle = BlockControlHandle;
1438
1439 fn control_handle(&self) -> &BlockControlHandle {
1440 &self.control_handle
1441 }
1442
1443 fn drop_without_shutdown(mut self) {
1444 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1446 std::mem::forget(self);
1448 }
1449}
1450
1451impl BlockQuerySlicesResponder {
1452 pub fn send(
1456 self,
1457 mut status: i32,
1458 mut response: &[VsliceRange; 16],
1459 mut response_count: u64,
1460 ) -> Result<(), fidl::Error> {
1461 let _result = self.send_raw(status, response, response_count);
1462 if _result.is_err() {
1463 self.control_handle.shutdown();
1464 }
1465 self.drop_without_shutdown();
1466 _result
1467 }
1468
1469 pub fn send_no_shutdown_on_err(
1471 self,
1472 mut status: i32,
1473 mut response: &[VsliceRange; 16],
1474 mut response_count: u64,
1475 ) -> Result<(), fidl::Error> {
1476 let _result = self.send_raw(status, response, response_count);
1477 self.drop_without_shutdown();
1478 _result
1479 }
1480
1481 fn send_raw(
1482 &self,
1483 mut status: i32,
1484 mut response: &[VsliceRange; 16],
1485 mut response_count: u64,
1486 ) -> Result<(), fidl::Error> {
1487 self.control_handle.inner.send::<BlockQuerySlicesResponse>(
1488 (status, response, response_count),
1489 self.tx_id,
1490 0x289240ac4fbaa190,
1491 fidl::encoding::DynamicFlags::empty(),
1492 )
1493 }
1494}
1495
1496#[must_use = "FIDL methods require a response to be sent"]
1497#[derive(Debug)]
1498pub struct BlockGetVolumeInfoResponder {
1499 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1500 tx_id: u32,
1501}
1502
1503impl std::ops::Drop for BlockGetVolumeInfoResponder {
1507 fn drop(&mut self) {
1508 self.control_handle.shutdown();
1509 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1511 }
1512}
1513
1514impl fdomain_client::fidl::Responder for BlockGetVolumeInfoResponder {
1515 type ControlHandle = BlockControlHandle;
1516
1517 fn control_handle(&self) -> &BlockControlHandle {
1518 &self.control_handle
1519 }
1520
1521 fn drop_without_shutdown(mut self) {
1522 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1524 std::mem::forget(self);
1526 }
1527}
1528
1529impl BlockGetVolumeInfoResponder {
1530 pub fn send(
1534 self,
1535 mut status: i32,
1536 mut manager: Option<&VolumeManagerInfo>,
1537 mut volume: Option<&VolumeInfo>,
1538 ) -> Result<(), fidl::Error> {
1539 let _result = self.send_raw(status, manager, volume);
1540 if _result.is_err() {
1541 self.control_handle.shutdown();
1542 }
1543 self.drop_without_shutdown();
1544 _result
1545 }
1546
1547 pub fn send_no_shutdown_on_err(
1549 self,
1550 mut status: i32,
1551 mut manager: Option<&VolumeManagerInfo>,
1552 mut volume: Option<&VolumeInfo>,
1553 ) -> Result<(), fidl::Error> {
1554 let _result = self.send_raw(status, manager, volume);
1555 self.drop_without_shutdown();
1556 _result
1557 }
1558
1559 fn send_raw(
1560 &self,
1561 mut status: i32,
1562 mut manager: Option<&VolumeManagerInfo>,
1563 mut volume: Option<&VolumeInfo>,
1564 ) -> Result<(), fidl::Error> {
1565 self.control_handle.inner.send::<BlockGetVolumeInfoResponse>(
1566 (status, manager, volume),
1567 self.tx_id,
1568 0x3a7dc69ea5d788d4,
1569 fidl::encoding::DynamicFlags::empty(),
1570 )
1571 }
1572}
1573
1574#[must_use = "FIDL methods require a response to be sent"]
1575#[derive(Debug)]
1576pub struct BlockExtendResponder {
1577 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1578 tx_id: u32,
1579}
1580
1581impl std::ops::Drop for BlockExtendResponder {
1585 fn drop(&mut self) {
1586 self.control_handle.shutdown();
1587 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1589 }
1590}
1591
1592impl fdomain_client::fidl::Responder for BlockExtendResponder {
1593 type ControlHandle = BlockControlHandle;
1594
1595 fn control_handle(&self) -> &BlockControlHandle {
1596 &self.control_handle
1597 }
1598
1599 fn drop_without_shutdown(mut self) {
1600 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1602 std::mem::forget(self);
1604 }
1605}
1606
1607impl BlockExtendResponder {
1608 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
1612 let _result = self.send_raw(status);
1613 if _result.is_err() {
1614 self.control_handle.shutdown();
1615 }
1616 self.drop_without_shutdown();
1617 _result
1618 }
1619
1620 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
1622 let _result = self.send_raw(status);
1623 self.drop_without_shutdown();
1624 _result
1625 }
1626
1627 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
1628 self.control_handle.inner.send::<BlockExtendResponse>(
1629 (status,),
1630 self.tx_id,
1631 0x273fb2980ff24157,
1632 fidl::encoding::DynamicFlags::empty(),
1633 )
1634 }
1635}
1636
1637#[must_use = "FIDL methods require a response to be sent"]
1638#[derive(Debug)]
1639pub struct BlockShrinkResponder {
1640 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1641 tx_id: u32,
1642}
1643
1644impl std::ops::Drop for BlockShrinkResponder {
1648 fn drop(&mut self) {
1649 self.control_handle.shutdown();
1650 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1652 }
1653}
1654
1655impl fdomain_client::fidl::Responder for BlockShrinkResponder {
1656 type ControlHandle = BlockControlHandle;
1657
1658 fn control_handle(&self) -> &BlockControlHandle {
1659 &self.control_handle
1660 }
1661
1662 fn drop_without_shutdown(mut self) {
1663 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1665 std::mem::forget(self);
1667 }
1668}
1669
1670impl BlockShrinkResponder {
1671 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
1675 let _result = self.send_raw(status);
1676 if _result.is_err() {
1677 self.control_handle.shutdown();
1678 }
1679 self.drop_without_shutdown();
1680 _result
1681 }
1682
1683 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
1685 let _result = self.send_raw(status);
1686 self.drop_without_shutdown();
1687 _result
1688 }
1689
1690 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
1691 self.control_handle.inner.send::<BlockShrinkResponse>(
1692 (status,),
1693 self.tx_id,
1694 0x73da6de865600a8b,
1695 fidl::encoding::DynamicFlags::empty(),
1696 )
1697 }
1698}
1699
1700#[must_use = "FIDL methods require a response to be sent"]
1701#[derive(Debug)]
1702pub struct BlockDestroyResponder {
1703 control_handle: std::mem::ManuallyDrop<BlockControlHandle>,
1704 tx_id: u32,
1705}
1706
1707impl std::ops::Drop for BlockDestroyResponder {
1711 fn drop(&mut self) {
1712 self.control_handle.shutdown();
1713 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1715 }
1716}
1717
1718impl fdomain_client::fidl::Responder for BlockDestroyResponder {
1719 type ControlHandle = BlockControlHandle;
1720
1721 fn control_handle(&self) -> &BlockControlHandle {
1722 &self.control_handle
1723 }
1724
1725 fn drop_without_shutdown(mut self) {
1726 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1728 std::mem::forget(self);
1730 }
1731}
1732
1733impl BlockDestroyResponder {
1734 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
1738 let _result = self.send_raw(status);
1739 if _result.is_err() {
1740 self.control_handle.shutdown();
1741 }
1742 self.drop_without_shutdown();
1743 _result
1744 }
1745
1746 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
1748 let _result = self.send_raw(status);
1749 self.drop_without_shutdown();
1750 _result
1751 }
1752
1753 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
1754 self.control_handle.inner.send::<BlockDestroyResponse>(
1755 (status,),
1756 self.tx_id,
1757 0x5866ba764e05a68e,
1758 fidl::encoding::DynamicFlags::empty(),
1759 )
1760 }
1761}
1762
1763#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1764pub struct SessionMarker;
1765
1766impl fdomain_client::fidl::ProtocolMarker for SessionMarker {
1767 type Proxy = SessionProxy;
1768 type RequestStream = SessionRequestStream;
1769
1770 const DEBUG_NAME: &'static str = "(anonymous) Session";
1771}
1772pub type SessionGetFifoResult = Result<fdomain_client::Fifo, i32>;
1773pub type SessionAttachVmoResult = Result<VmoId, i32>;
1774
1775pub trait SessionProxyInterface: Send + Sync {
1776 type CloseResponseFut: std::future::Future<
1777 Output = Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
1778 > + Send;
1779 fn r#close(&self) -> Self::CloseResponseFut;
1780 type GetFifoResponseFut: std::future::Future<Output = Result<SessionGetFifoResult, fidl::Error>>
1781 + Send;
1782 fn r#get_fifo(&self) -> Self::GetFifoResponseFut;
1783 type AttachVmoResponseFut: std::future::Future<Output = Result<SessionAttachVmoResult, fidl::Error>>
1784 + Send;
1785 fn r#attach_vmo(&self, vmo: fdomain_client::Vmo) -> Self::AttachVmoResponseFut;
1786}
1787
1788#[derive(Debug, Clone)]
1789pub struct SessionProxy {
1790 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1791}
1792
1793impl fdomain_client::fidl::Proxy for SessionProxy {
1794 type Protocol = SessionMarker;
1795
1796 fn from_channel(inner: fdomain_client::Channel) -> Self {
1797 Self::new(inner)
1798 }
1799
1800 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1801 self.client.into_channel().map_err(|client| Self { client })
1802 }
1803
1804 fn as_channel(&self) -> &fdomain_client::Channel {
1805 self.client.as_channel()
1806 }
1807}
1808
1809impl SessionProxy {
1810 pub fn new(channel: fdomain_client::Channel) -> Self {
1812 let protocol_name = <SessionMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1813 Self { client: fidl::client::Client::new(channel, protocol_name) }
1814 }
1815
1816 pub fn take_event_stream(&self) -> SessionEventStream {
1822 SessionEventStream { event_receiver: self.client.take_event_receiver() }
1823 }
1824
1825 pub fn r#close(
1836 &self,
1837 ) -> fidl::client::QueryResponseFut<
1838 fdomain_fuchsia_unknown::CloseableCloseResult,
1839 fdomain_client::fidl::FDomainResourceDialect,
1840 > {
1841 SessionProxyInterface::r#close(self)
1842 }
1843
1844 pub fn r#get_fifo(
1846 &self,
1847 ) -> fidl::client::QueryResponseFut<
1848 SessionGetFifoResult,
1849 fdomain_client::fidl::FDomainResourceDialect,
1850 > {
1851 SessionProxyInterface::r#get_fifo(self)
1852 }
1853
1854 pub fn r#attach_vmo(
1859 &self,
1860 mut vmo: fdomain_client::Vmo,
1861 ) -> fidl::client::QueryResponseFut<
1862 SessionAttachVmoResult,
1863 fdomain_client::fidl::FDomainResourceDialect,
1864 > {
1865 SessionProxyInterface::r#attach_vmo(self, vmo)
1866 }
1867}
1868
1869impl SessionProxyInterface for SessionProxy {
1870 type CloseResponseFut = fidl::client::QueryResponseFut<
1871 fdomain_fuchsia_unknown::CloseableCloseResult,
1872 fdomain_client::fidl::FDomainResourceDialect,
1873 >;
1874 fn r#close(&self) -> Self::CloseResponseFut {
1875 fn _decode(
1876 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1877 ) -> Result<fdomain_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
1878 let _response = fidl::client::decode_transaction_body::<
1879 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1880 fdomain_client::fidl::FDomainResourceDialect,
1881 0x5ac5d459ad7f657e,
1882 >(_buf?)?;
1883 Ok(_response.map(|x| x))
1884 }
1885 self.client.send_query_and_decode::<
1886 fidl::encoding::EmptyPayload,
1887 fdomain_fuchsia_unknown::CloseableCloseResult,
1888 >(
1889 (),
1890 0x5ac5d459ad7f657e,
1891 fidl::encoding::DynamicFlags::empty(),
1892 _decode,
1893 )
1894 }
1895
1896 type GetFifoResponseFut = fidl::client::QueryResponseFut<
1897 SessionGetFifoResult,
1898 fdomain_client::fidl::FDomainResourceDialect,
1899 >;
1900 fn r#get_fifo(&self) -> Self::GetFifoResponseFut {
1901 fn _decode(
1902 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1903 ) -> Result<SessionGetFifoResult, fidl::Error> {
1904 let _response = fidl::client::decode_transaction_body::<
1905 fidl::encoding::ResultType<SessionGetFifoResponse, i32>,
1906 fdomain_client::fidl::FDomainResourceDialect,
1907 0x7a6c7610912aaa98,
1908 >(_buf?)?;
1909 Ok(_response.map(|x| x.fifo))
1910 }
1911 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SessionGetFifoResult>(
1912 (),
1913 0x7a6c7610912aaa98,
1914 fidl::encoding::DynamicFlags::empty(),
1915 _decode,
1916 )
1917 }
1918
1919 type AttachVmoResponseFut = fidl::client::QueryResponseFut<
1920 SessionAttachVmoResult,
1921 fdomain_client::fidl::FDomainResourceDialect,
1922 >;
1923 fn r#attach_vmo(&self, mut vmo: fdomain_client::Vmo) -> Self::AttachVmoResponseFut {
1924 fn _decode(
1925 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1926 ) -> Result<SessionAttachVmoResult, fidl::Error> {
1927 let _response = fidl::client::decode_transaction_body::<
1928 fidl::encoding::ResultType<SessionAttachVmoResponse, i32>,
1929 fdomain_client::fidl::FDomainResourceDialect,
1930 0x677a0f6fd1a370b2,
1931 >(_buf?)?;
1932 Ok(_response.map(|x| x.vmoid))
1933 }
1934 self.client.send_query_and_decode::<SessionAttachVmoRequest, SessionAttachVmoResult>(
1935 (vmo,),
1936 0x677a0f6fd1a370b2,
1937 fidl::encoding::DynamicFlags::empty(),
1938 _decode,
1939 )
1940 }
1941}
1942
1943pub struct SessionEventStream {
1944 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1945}
1946
1947impl std::marker::Unpin for SessionEventStream {}
1948
1949impl futures::stream::FusedStream for SessionEventStream {
1950 fn is_terminated(&self) -> bool {
1951 self.event_receiver.is_terminated()
1952 }
1953}
1954
1955impl futures::Stream for SessionEventStream {
1956 type Item = Result<SessionEvent, fidl::Error>;
1957
1958 fn poll_next(
1959 mut self: std::pin::Pin<&mut Self>,
1960 cx: &mut std::task::Context<'_>,
1961 ) -> std::task::Poll<Option<Self::Item>> {
1962 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1963 &mut self.event_receiver,
1964 cx
1965 )?) {
1966 Some(buf) => std::task::Poll::Ready(Some(SessionEvent::decode(buf))),
1967 None => std::task::Poll::Ready(None),
1968 }
1969 }
1970}
1971
1972#[derive(Debug)]
1973pub enum SessionEvent {}
1974
1975impl SessionEvent {
1976 fn decode(
1978 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1979 ) -> Result<SessionEvent, fidl::Error> {
1980 let (bytes, _handles) = buf.split_mut();
1981 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1982 debug_assert_eq!(tx_header.tx_id, 0);
1983 match tx_header.ordinal {
1984 _ => Err(fidl::Error::UnknownOrdinal {
1985 ordinal: tx_header.ordinal,
1986 protocol_name: <SessionMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1987 }),
1988 }
1989 }
1990}
1991
1992pub struct SessionRequestStream {
1994 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1995 is_terminated: bool,
1996}
1997
1998impl std::marker::Unpin for SessionRequestStream {}
1999
2000impl futures::stream::FusedStream for SessionRequestStream {
2001 fn is_terminated(&self) -> bool {
2002 self.is_terminated
2003 }
2004}
2005
2006impl fdomain_client::fidl::RequestStream for SessionRequestStream {
2007 type Protocol = SessionMarker;
2008 type ControlHandle = SessionControlHandle;
2009
2010 fn from_channel(channel: fdomain_client::Channel) -> Self {
2011 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2012 }
2013
2014 fn control_handle(&self) -> Self::ControlHandle {
2015 SessionControlHandle { inner: self.inner.clone() }
2016 }
2017
2018 fn into_inner(
2019 self,
2020 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2021 {
2022 (self.inner, self.is_terminated)
2023 }
2024
2025 fn from_inner(
2026 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2027 is_terminated: bool,
2028 ) -> Self {
2029 Self { inner, is_terminated }
2030 }
2031}
2032
2033impl futures::Stream for SessionRequestStream {
2034 type Item = Result<SessionRequest, fidl::Error>;
2035
2036 fn poll_next(
2037 mut self: std::pin::Pin<&mut Self>,
2038 cx: &mut std::task::Context<'_>,
2039 ) -> std::task::Poll<Option<Self::Item>> {
2040 let this = &mut *self;
2041 if this.inner.check_shutdown(cx) {
2042 this.is_terminated = true;
2043 return std::task::Poll::Ready(None);
2044 }
2045 if this.is_terminated {
2046 panic!("polled SessionRequestStream after completion");
2047 }
2048 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2049 |bytes, handles| {
2050 match this.inner.channel().read_etc(cx, bytes, handles) {
2051 std::task::Poll::Ready(Ok(())) => {}
2052 std::task::Poll::Pending => return std::task::Poll::Pending,
2053 std::task::Poll::Ready(Err(None)) => {
2054 this.is_terminated = true;
2055 return std::task::Poll::Ready(None);
2056 }
2057 std::task::Poll::Ready(Err(Some(e))) => {
2058 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2059 e.into(),
2060 ))));
2061 }
2062 }
2063
2064 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2066
2067 std::task::Poll::Ready(Some(match header.ordinal {
2068 0x5ac5d459ad7f657e => {
2069 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2070 let mut req = fidl::new_empty!(
2071 fidl::encoding::EmptyPayload,
2072 fdomain_client::fidl::FDomainResourceDialect
2073 );
2074 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2075 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2076 Ok(SessionRequest::Close {
2077 responder: SessionCloseResponder {
2078 control_handle: std::mem::ManuallyDrop::new(control_handle),
2079 tx_id: header.tx_id,
2080 },
2081 })
2082 }
2083 0x7a6c7610912aaa98 => {
2084 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2085 let mut req = fidl::new_empty!(
2086 fidl::encoding::EmptyPayload,
2087 fdomain_client::fidl::FDomainResourceDialect
2088 );
2089 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2090 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2091 Ok(SessionRequest::GetFifo {
2092 responder: SessionGetFifoResponder {
2093 control_handle: std::mem::ManuallyDrop::new(control_handle),
2094 tx_id: header.tx_id,
2095 },
2096 })
2097 }
2098 0x677a0f6fd1a370b2 => {
2099 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2100 let mut req = fidl::new_empty!(
2101 SessionAttachVmoRequest,
2102 fdomain_client::fidl::FDomainResourceDialect
2103 );
2104 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<SessionAttachVmoRequest>(&header, _body_bytes, handles, &mut req)?;
2105 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2106 Ok(SessionRequest::AttachVmo {
2107 vmo: req.vmo,
2108
2109 responder: SessionAttachVmoResponder {
2110 control_handle: std::mem::ManuallyDrop::new(control_handle),
2111 tx_id: header.tx_id,
2112 },
2113 })
2114 }
2115 _ => Err(fidl::Error::UnknownOrdinal {
2116 ordinal: header.ordinal,
2117 protocol_name:
2118 <SessionMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2119 }),
2120 }))
2121 },
2122 )
2123 }
2124}
2125
2126#[derive(Debug)]
2136pub enum SessionRequest {
2137 Close { responder: SessionCloseResponder },
2148 GetFifo { responder: SessionGetFifoResponder },
2150 AttachVmo { vmo: fdomain_client::Vmo, responder: SessionAttachVmoResponder },
2155}
2156
2157impl SessionRequest {
2158 #[allow(irrefutable_let_patterns)]
2159 pub fn into_close(self) -> Option<(SessionCloseResponder)> {
2160 if let SessionRequest::Close { responder } = self { Some((responder)) } else { None }
2161 }
2162
2163 #[allow(irrefutable_let_patterns)]
2164 pub fn into_get_fifo(self) -> Option<(SessionGetFifoResponder)> {
2165 if let SessionRequest::GetFifo { responder } = self { Some((responder)) } else { None }
2166 }
2167
2168 #[allow(irrefutable_let_patterns)]
2169 pub fn into_attach_vmo(self) -> Option<(fdomain_client::Vmo, SessionAttachVmoResponder)> {
2170 if let SessionRequest::AttachVmo { vmo, responder } = self {
2171 Some((vmo, responder))
2172 } else {
2173 None
2174 }
2175 }
2176
2177 pub fn method_name(&self) -> &'static str {
2179 match *self {
2180 SessionRequest::Close { .. } => "close",
2181 SessionRequest::GetFifo { .. } => "get_fifo",
2182 SessionRequest::AttachVmo { .. } => "attach_vmo",
2183 }
2184 }
2185}
2186
2187#[derive(Debug, Clone)]
2188pub struct SessionControlHandle {
2189 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2190}
2191
2192impl SessionControlHandle {
2193 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2194 self.inner.shutdown_with_epitaph(status.into())
2195 }
2196}
2197
2198impl fdomain_client::fidl::ControlHandle for SessionControlHandle {
2199 fn shutdown(&self) {
2200 self.inner.shutdown()
2201 }
2202
2203 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2204 self.inner.shutdown_with_epitaph(status)
2205 }
2206
2207 fn is_closed(&self) -> bool {
2208 self.inner.channel().is_closed()
2209 }
2210 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2211 self.inner.channel().on_closed()
2212 }
2213}
2214
2215impl SessionControlHandle {}
2216
2217#[must_use = "FIDL methods require a response to be sent"]
2218#[derive(Debug)]
2219pub struct SessionCloseResponder {
2220 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
2221 tx_id: u32,
2222}
2223
2224impl std::ops::Drop for SessionCloseResponder {
2228 fn drop(&mut self) {
2229 self.control_handle.shutdown();
2230 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2232 }
2233}
2234
2235impl fdomain_client::fidl::Responder for SessionCloseResponder {
2236 type ControlHandle = SessionControlHandle;
2237
2238 fn control_handle(&self) -> &SessionControlHandle {
2239 &self.control_handle
2240 }
2241
2242 fn drop_without_shutdown(mut self) {
2243 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2245 std::mem::forget(self);
2247 }
2248}
2249
2250impl SessionCloseResponder {
2251 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2255 let _result = self.send_raw(result);
2256 if _result.is_err() {
2257 self.control_handle.shutdown();
2258 }
2259 self.drop_without_shutdown();
2260 _result
2261 }
2262
2263 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2265 let _result = self.send_raw(result);
2266 self.drop_without_shutdown();
2267 _result
2268 }
2269
2270 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2271 self.control_handle
2272 .inner
2273 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2274 result,
2275 self.tx_id,
2276 0x5ac5d459ad7f657e,
2277 fidl::encoding::DynamicFlags::empty(),
2278 )
2279 }
2280}
2281
2282#[must_use = "FIDL methods require a response to be sent"]
2283#[derive(Debug)]
2284pub struct SessionGetFifoResponder {
2285 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
2286 tx_id: u32,
2287}
2288
2289impl std::ops::Drop for SessionGetFifoResponder {
2293 fn drop(&mut self) {
2294 self.control_handle.shutdown();
2295 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2297 }
2298}
2299
2300impl fdomain_client::fidl::Responder for SessionGetFifoResponder {
2301 type ControlHandle = SessionControlHandle;
2302
2303 fn control_handle(&self) -> &SessionControlHandle {
2304 &self.control_handle
2305 }
2306
2307 fn drop_without_shutdown(mut self) {
2308 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2310 std::mem::forget(self);
2312 }
2313}
2314
2315impl SessionGetFifoResponder {
2316 pub fn send(self, mut result: Result<fdomain_client::Fifo, i32>) -> Result<(), fidl::Error> {
2320 let _result = self.send_raw(result);
2321 if _result.is_err() {
2322 self.control_handle.shutdown();
2323 }
2324 self.drop_without_shutdown();
2325 _result
2326 }
2327
2328 pub fn send_no_shutdown_on_err(
2330 self,
2331 mut result: Result<fdomain_client::Fifo, i32>,
2332 ) -> Result<(), fidl::Error> {
2333 let _result = self.send_raw(result);
2334 self.drop_without_shutdown();
2335 _result
2336 }
2337
2338 fn send_raw(&self, mut result: Result<fdomain_client::Fifo, i32>) -> Result<(), fidl::Error> {
2339 self.control_handle.inner.send::<fidl::encoding::ResultType<SessionGetFifoResponse, i32>>(
2340 result.map(|fifo| (fifo,)),
2341 self.tx_id,
2342 0x7a6c7610912aaa98,
2343 fidl::encoding::DynamicFlags::empty(),
2344 )
2345 }
2346}
2347
2348#[must_use = "FIDL methods require a response to be sent"]
2349#[derive(Debug)]
2350pub struct SessionAttachVmoResponder {
2351 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
2352 tx_id: u32,
2353}
2354
2355impl std::ops::Drop for SessionAttachVmoResponder {
2359 fn drop(&mut self) {
2360 self.control_handle.shutdown();
2361 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2363 }
2364}
2365
2366impl fdomain_client::fidl::Responder for SessionAttachVmoResponder {
2367 type ControlHandle = SessionControlHandle;
2368
2369 fn control_handle(&self) -> &SessionControlHandle {
2370 &self.control_handle
2371 }
2372
2373 fn drop_without_shutdown(mut self) {
2374 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2376 std::mem::forget(self);
2378 }
2379}
2380
2381impl SessionAttachVmoResponder {
2382 pub fn send(self, mut result: Result<&VmoId, i32>) -> Result<(), fidl::Error> {
2386 let _result = self.send_raw(result);
2387 if _result.is_err() {
2388 self.control_handle.shutdown();
2389 }
2390 self.drop_without_shutdown();
2391 _result
2392 }
2393
2394 pub fn send_no_shutdown_on_err(
2396 self,
2397 mut result: Result<&VmoId, i32>,
2398 ) -> Result<(), fidl::Error> {
2399 let _result = self.send_raw(result);
2400 self.drop_without_shutdown();
2401 _result
2402 }
2403
2404 fn send_raw(&self, mut result: Result<&VmoId, i32>) -> Result<(), fidl::Error> {
2405 self.control_handle.inner.send::<fidl::encoding::ResultType<SessionAttachVmoResponse, i32>>(
2406 result.map(|vmoid| (vmoid,)),
2407 self.tx_id,
2408 0x677a0f6fd1a370b2,
2409 fidl::encoding::DynamicFlags::empty(),
2410 )
2411 }
2412}
2413
2414#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2415pub struct VolumeManagerMarker;
2416
2417impl fdomain_client::fidl::ProtocolMarker for VolumeManagerMarker {
2418 type Proxy = VolumeManagerProxy;
2419 type RequestStream = VolumeManagerRequestStream;
2420
2421 const DEBUG_NAME: &'static str = "(anonymous) VolumeManager";
2422}
2423pub type VolumeManagerSetPartitionNameResult = Result<(), i32>;
2424
2425pub trait VolumeManagerProxyInterface: Send + Sync {
2426 type AllocatePartitionResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
2427 fn r#allocate_partition(
2428 &self,
2429 slice_count: u64,
2430 type_: &Guid,
2431 instance: &Guid,
2432 name: &str,
2433 flags: u32,
2434 ) -> Self::AllocatePartitionResponseFut;
2435 type GetInfoResponseFut: std::future::Future<Output = Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error>>
2436 + Send;
2437 fn r#get_info(&self) -> Self::GetInfoResponseFut;
2438 type ActivateResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
2439 fn r#activate(&self, old_guid: &Guid, new_guid: &Guid) -> Self::ActivateResponseFut;
2440 type GetPartitionLimitResponseFut: std::future::Future<Output = Result<(i32, u64), fidl::Error>>
2441 + Send;
2442 fn r#get_partition_limit(&self, guid: &Guid) -> Self::GetPartitionLimitResponseFut;
2443 type SetPartitionLimitResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
2444 fn r#set_partition_limit(
2445 &self,
2446 guid: &Guid,
2447 slice_count: u64,
2448 ) -> Self::SetPartitionLimitResponseFut;
2449 type SetPartitionNameResponseFut: std::future::Future<Output = Result<VolumeManagerSetPartitionNameResult, fidl::Error>>
2450 + Send;
2451 fn r#set_partition_name(&self, guid: &Guid, name: &str) -> Self::SetPartitionNameResponseFut;
2452}
2453
2454#[derive(Debug, Clone)]
2455pub struct VolumeManagerProxy {
2456 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
2457}
2458
2459impl fdomain_client::fidl::Proxy for VolumeManagerProxy {
2460 type Protocol = VolumeManagerMarker;
2461
2462 fn from_channel(inner: fdomain_client::Channel) -> Self {
2463 Self::new(inner)
2464 }
2465
2466 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
2467 self.client.into_channel().map_err(|client| Self { client })
2468 }
2469
2470 fn as_channel(&self) -> &fdomain_client::Channel {
2471 self.client.as_channel()
2472 }
2473}
2474
2475impl VolumeManagerProxy {
2476 pub fn new(channel: fdomain_client::Channel) -> Self {
2478 let protocol_name =
2479 <VolumeManagerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2480 Self { client: fidl::client::Client::new(channel, protocol_name) }
2481 }
2482
2483 pub fn take_event_stream(&self) -> VolumeManagerEventStream {
2489 VolumeManagerEventStream { event_receiver: self.client.take_event_receiver() }
2490 }
2491
2492 pub fn r#allocate_partition(
2499 &self,
2500 mut slice_count: u64,
2501 mut type_: &Guid,
2502 mut instance: &Guid,
2503 mut name: &str,
2504 mut flags: u32,
2505 ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
2506 VolumeManagerProxyInterface::r#allocate_partition(
2507 self,
2508 slice_count,
2509 type_,
2510 instance,
2511 name,
2512 flags,
2513 )
2514 }
2515
2516 pub fn r#get_info(
2524 &self,
2525 ) -> fidl::client::QueryResponseFut<
2526 (i32, Option<Box<VolumeManagerInfo>>),
2527 fdomain_client::fidl::FDomainResourceDialect,
2528 > {
2529 VolumeManagerProxyInterface::r#get_info(self)
2530 }
2531
2532 pub fn r#activate(
2548 &self,
2549 mut old_guid: &Guid,
2550 mut new_guid: &Guid,
2551 ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
2552 VolumeManagerProxyInterface::r#activate(self, old_guid, new_guid)
2553 }
2554
2555 pub fn r#get_partition_limit(
2565 &self,
2566 mut guid: &Guid,
2567 ) -> fidl::client::QueryResponseFut<(i32, u64), fdomain_client::fidl::FDomainResourceDialect>
2568 {
2569 VolumeManagerProxyInterface::r#get_partition_limit(self, guid)
2570 }
2571
2572 pub fn r#set_partition_limit(
2584 &self,
2585 mut guid: &Guid,
2586 mut slice_count: u64,
2587 ) -> fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect> {
2588 VolumeManagerProxyInterface::r#set_partition_limit(self, guid, slice_count)
2589 }
2590
2591 pub fn r#set_partition_name(
2595 &self,
2596 mut guid: &Guid,
2597 mut name: &str,
2598 ) -> fidl::client::QueryResponseFut<
2599 VolumeManagerSetPartitionNameResult,
2600 fdomain_client::fidl::FDomainResourceDialect,
2601 > {
2602 VolumeManagerProxyInterface::r#set_partition_name(self, guid, name)
2603 }
2604}
2605
2606impl VolumeManagerProxyInterface for VolumeManagerProxy {
2607 type AllocatePartitionResponseFut =
2608 fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2609 fn r#allocate_partition(
2610 &self,
2611 mut slice_count: u64,
2612 mut type_: &Guid,
2613 mut instance: &Guid,
2614 mut name: &str,
2615 mut flags: u32,
2616 ) -> Self::AllocatePartitionResponseFut {
2617 fn _decode(
2618 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2619 ) -> Result<i32, fidl::Error> {
2620 let _response = fidl::client::decode_transaction_body::<
2621 VolumeManagerAllocatePartitionResponse,
2622 fdomain_client::fidl::FDomainResourceDialect,
2623 0x5db528bfc287b696,
2624 >(_buf?)?;
2625 Ok(_response.status)
2626 }
2627 self.client.send_query_and_decode::<VolumeManagerAllocatePartitionRequest, i32>(
2628 (slice_count, type_, instance, name, flags),
2629 0x5db528bfc287b696,
2630 fidl::encoding::DynamicFlags::empty(),
2631 _decode,
2632 )
2633 }
2634
2635 type GetInfoResponseFut = fidl::client::QueryResponseFut<
2636 (i32, Option<Box<VolumeManagerInfo>>),
2637 fdomain_client::fidl::FDomainResourceDialect,
2638 >;
2639 fn r#get_info(&self) -> Self::GetInfoResponseFut {
2640 fn _decode(
2641 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2642 ) -> Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error> {
2643 let _response = fidl::client::decode_transaction_body::<
2644 VolumeManagerGetInfoResponse,
2645 fdomain_client::fidl::FDomainResourceDialect,
2646 0x2611214dcca5b064,
2647 >(_buf?)?;
2648 Ok((_response.status, _response.info))
2649 }
2650 self.client.send_query_and_decode::<
2651 fidl::encoding::EmptyPayload,
2652 (i32, Option<Box<VolumeManagerInfo>>),
2653 >(
2654 (),
2655 0x2611214dcca5b064,
2656 fidl::encoding::DynamicFlags::empty(),
2657 _decode,
2658 )
2659 }
2660
2661 type ActivateResponseFut =
2662 fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2663 fn r#activate(&self, mut old_guid: &Guid, mut new_guid: &Guid) -> Self::ActivateResponseFut {
2664 fn _decode(
2665 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2666 ) -> Result<i32, fidl::Error> {
2667 let _response = fidl::client::decode_transaction_body::<
2668 VolumeManagerActivateResponse,
2669 fdomain_client::fidl::FDomainResourceDialect,
2670 0x182238d40c275be,
2671 >(_buf?)?;
2672 Ok(_response.status)
2673 }
2674 self.client.send_query_and_decode::<VolumeManagerActivateRequest, i32>(
2675 (old_guid, new_guid),
2676 0x182238d40c275be,
2677 fidl::encoding::DynamicFlags::empty(),
2678 _decode,
2679 )
2680 }
2681
2682 type GetPartitionLimitResponseFut =
2683 fidl::client::QueryResponseFut<(i32, u64), fdomain_client::fidl::FDomainResourceDialect>;
2684 fn r#get_partition_limit(&self, mut guid: &Guid) -> Self::GetPartitionLimitResponseFut {
2685 fn _decode(
2686 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2687 ) -> Result<(i32, u64), fidl::Error> {
2688 let _response = fidl::client::decode_transaction_body::<
2689 VolumeManagerGetPartitionLimitResponse,
2690 fdomain_client::fidl::FDomainResourceDialect,
2691 0x5bc9d21ea8bd52db,
2692 >(_buf?)?;
2693 Ok((_response.status, _response.slice_count))
2694 }
2695 self.client.send_query_and_decode::<VolumeManagerGetPartitionLimitRequest, (i32, u64)>(
2696 (guid,),
2697 0x5bc9d21ea8bd52db,
2698 fidl::encoding::DynamicFlags::empty(),
2699 _decode,
2700 )
2701 }
2702
2703 type SetPartitionLimitResponseFut =
2704 fidl::client::QueryResponseFut<i32, fdomain_client::fidl::FDomainResourceDialect>;
2705 fn r#set_partition_limit(
2706 &self,
2707 mut guid: &Guid,
2708 mut slice_count: u64,
2709 ) -> Self::SetPartitionLimitResponseFut {
2710 fn _decode(
2711 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2712 ) -> Result<i32, fidl::Error> {
2713 let _response = fidl::client::decode_transaction_body::<
2714 VolumeManagerSetPartitionLimitResponse,
2715 fdomain_client::fidl::FDomainResourceDialect,
2716 0x3a4903076534c093,
2717 >(_buf?)?;
2718 Ok(_response.status)
2719 }
2720 self.client.send_query_and_decode::<VolumeManagerSetPartitionLimitRequest, i32>(
2721 (guid, slice_count),
2722 0x3a4903076534c093,
2723 fidl::encoding::DynamicFlags::empty(),
2724 _decode,
2725 )
2726 }
2727
2728 type SetPartitionNameResponseFut = fidl::client::QueryResponseFut<
2729 VolumeManagerSetPartitionNameResult,
2730 fdomain_client::fidl::FDomainResourceDialect,
2731 >;
2732 fn r#set_partition_name(
2733 &self,
2734 mut guid: &Guid,
2735 mut name: &str,
2736 ) -> Self::SetPartitionNameResponseFut {
2737 fn _decode(
2738 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2739 ) -> Result<VolumeManagerSetPartitionNameResult, fidl::Error> {
2740 let _response = fidl::client::decode_transaction_body::<
2741 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2742 fdomain_client::fidl::FDomainResourceDialect,
2743 0x26afb07b9d70ff1a,
2744 >(_buf?)?;
2745 Ok(_response.map(|x| x))
2746 }
2747 self.client.send_query_and_decode::<
2748 VolumeManagerSetPartitionNameRequest,
2749 VolumeManagerSetPartitionNameResult,
2750 >(
2751 (guid, name,),
2752 0x26afb07b9d70ff1a,
2753 fidl::encoding::DynamicFlags::empty(),
2754 _decode,
2755 )
2756 }
2757}
2758
2759pub struct VolumeManagerEventStream {
2760 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2761}
2762
2763impl std::marker::Unpin for VolumeManagerEventStream {}
2764
2765impl futures::stream::FusedStream for VolumeManagerEventStream {
2766 fn is_terminated(&self) -> bool {
2767 self.event_receiver.is_terminated()
2768 }
2769}
2770
2771impl futures::Stream for VolumeManagerEventStream {
2772 type Item = Result<VolumeManagerEvent, fidl::Error>;
2773
2774 fn poll_next(
2775 mut self: std::pin::Pin<&mut Self>,
2776 cx: &mut std::task::Context<'_>,
2777 ) -> std::task::Poll<Option<Self::Item>> {
2778 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2779 &mut self.event_receiver,
2780 cx
2781 )?) {
2782 Some(buf) => std::task::Poll::Ready(Some(VolumeManagerEvent::decode(buf))),
2783 None => std::task::Poll::Ready(None),
2784 }
2785 }
2786}
2787
2788#[derive(Debug)]
2789pub enum VolumeManagerEvent {}
2790
2791impl VolumeManagerEvent {
2792 fn decode(
2794 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2795 ) -> Result<VolumeManagerEvent, fidl::Error> {
2796 let (bytes, _handles) = buf.split_mut();
2797 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2798 debug_assert_eq!(tx_header.tx_id, 0);
2799 match tx_header.ordinal {
2800 _ => Err(fidl::Error::UnknownOrdinal {
2801 ordinal: tx_header.ordinal,
2802 protocol_name:
2803 <VolumeManagerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2804 }),
2805 }
2806 }
2807}
2808
2809pub struct VolumeManagerRequestStream {
2811 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2812 is_terminated: bool,
2813}
2814
2815impl std::marker::Unpin for VolumeManagerRequestStream {}
2816
2817impl futures::stream::FusedStream for VolumeManagerRequestStream {
2818 fn is_terminated(&self) -> bool {
2819 self.is_terminated
2820 }
2821}
2822
2823impl fdomain_client::fidl::RequestStream for VolumeManagerRequestStream {
2824 type Protocol = VolumeManagerMarker;
2825 type ControlHandle = VolumeManagerControlHandle;
2826
2827 fn from_channel(channel: fdomain_client::Channel) -> Self {
2828 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2829 }
2830
2831 fn control_handle(&self) -> Self::ControlHandle {
2832 VolumeManagerControlHandle { inner: self.inner.clone() }
2833 }
2834
2835 fn into_inner(
2836 self,
2837 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2838 {
2839 (self.inner, self.is_terminated)
2840 }
2841
2842 fn from_inner(
2843 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2844 is_terminated: bool,
2845 ) -> Self {
2846 Self { inner, is_terminated }
2847 }
2848}
2849
2850impl futures::Stream for VolumeManagerRequestStream {
2851 type Item = Result<VolumeManagerRequest, fidl::Error>;
2852
2853 fn poll_next(
2854 mut self: std::pin::Pin<&mut Self>,
2855 cx: &mut std::task::Context<'_>,
2856 ) -> std::task::Poll<Option<Self::Item>> {
2857 let this = &mut *self;
2858 if this.inner.check_shutdown(cx) {
2859 this.is_terminated = true;
2860 return std::task::Poll::Ready(None);
2861 }
2862 if this.is_terminated {
2863 panic!("polled VolumeManagerRequestStream after completion");
2864 }
2865 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2866 |bytes, handles| {
2867 match this.inner.channel().read_etc(cx, bytes, handles) {
2868 std::task::Poll::Ready(Ok(())) => {}
2869 std::task::Poll::Pending => return std::task::Poll::Pending,
2870 std::task::Poll::Ready(Err(None)) => {
2871 this.is_terminated = true;
2872 return std::task::Poll::Ready(None);
2873 }
2874 std::task::Poll::Ready(Err(Some(e))) => {
2875 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2876 e.into(),
2877 ))));
2878 }
2879 }
2880
2881 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2883
2884 std::task::Poll::Ready(Some(match header.ordinal {
2885 0x5db528bfc287b696 => {
2886 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2887 let mut req = fidl::new_empty!(VolumeManagerAllocatePartitionRequest, fdomain_client::fidl::FDomainResourceDialect);
2888 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<VolumeManagerAllocatePartitionRequest>(&header, _body_bytes, handles, &mut req)?;
2889 let control_handle = VolumeManagerControlHandle {
2890 inner: this.inner.clone(),
2891 };
2892 Ok(VolumeManagerRequest::AllocatePartition {slice_count: req.slice_count,
2893type_: req.type_,
2894instance: req.instance,
2895name: req.name,
2896flags: req.flags,
2897
2898 responder: VolumeManagerAllocatePartitionResponder {
2899 control_handle: std::mem::ManuallyDrop::new(control_handle),
2900 tx_id: header.tx_id,
2901 },
2902 })
2903 }
2904 0x2611214dcca5b064 => {
2905 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2906 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
2907 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2908 let control_handle = VolumeManagerControlHandle {
2909 inner: this.inner.clone(),
2910 };
2911 Ok(VolumeManagerRequest::GetInfo {
2912 responder: VolumeManagerGetInfoResponder {
2913 control_handle: std::mem::ManuallyDrop::new(control_handle),
2914 tx_id: header.tx_id,
2915 },
2916 })
2917 }
2918 0x182238d40c275be => {
2919 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2920 let mut req = fidl::new_empty!(VolumeManagerActivateRequest, fdomain_client::fidl::FDomainResourceDialect);
2921 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<VolumeManagerActivateRequest>(&header, _body_bytes, handles, &mut req)?;
2922 let control_handle = VolumeManagerControlHandle {
2923 inner: this.inner.clone(),
2924 };
2925 Ok(VolumeManagerRequest::Activate {old_guid: req.old_guid,
2926new_guid: req.new_guid,
2927
2928 responder: VolumeManagerActivateResponder {
2929 control_handle: std::mem::ManuallyDrop::new(control_handle),
2930 tx_id: header.tx_id,
2931 },
2932 })
2933 }
2934 0x5bc9d21ea8bd52db => {
2935 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2936 let mut req = fidl::new_empty!(VolumeManagerGetPartitionLimitRequest, fdomain_client::fidl::FDomainResourceDialect);
2937 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<VolumeManagerGetPartitionLimitRequest>(&header, _body_bytes, handles, &mut req)?;
2938 let control_handle = VolumeManagerControlHandle {
2939 inner: this.inner.clone(),
2940 };
2941 Ok(VolumeManagerRequest::GetPartitionLimit {guid: req.guid,
2942
2943 responder: VolumeManagerGetPartitionLimitResponder {
2944 control_handle: std::mem::ManuallyDrop::new(control_handle),
2945 tx_id: header.tx_id,
2946 },
2947 })
2948 }
2949 0x3a4903076534c093 => {
2950 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2951 let mut req = fidl::new_empty!(VolumeManagerSetPartitionLimitRequest, fdomain_client::fidl::FDomainResourceDialect);
2952 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<VolumeManagerSetPartitionLimitRequest>(&header, _body_bytes, handles, &mut req)?;
2953 let control_handle = VolumeManagerControlHandle {
2954 inner: this.inner.clone(),
2955 };
2956 Ok(VolumeManagerRequest::SetPartitionLimit {guid: req.guid,
2957slice_count: req.slice_count,
2958
2959 responder: VolumeManagerSetPartitionLimitResponder {
2960 control_handle: std::mem::ManuallyDrop::new(control_handle),
2961 tx_id: header.tx_id,
2962 },
2963 })
2964 }
2965 0x26afb07b9d70ff1a => {
2966 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2967 let mut req = fidl::new_empty!(VolumeManagerSetPartitionNameRequest, fdomain_client::fidl::FDomainResourceDialect);
2968 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<VolumeManagerSetPartitionNameRequest>(&header, _body_bytes, handles, &mut req)?;
2969 let control_handle = VolumeManagerControlHandle {
2970 inner: this.inner.clone(),
2971 };
2972 Ok(VolumeManagerRequest::SetPartitionName {guid: req.guid,
2973name: req.name,
2974
2975 responder: VolumeManagerSetPartitionNameResponder {
2976 control_handle: std::mem::ManuallyDrop::new(control_handle),
2977 tx_id: header.tx_id,
2978 },
2979 })
2980 }
2981 _ => Err(fidl::Error::UnknownOrdinal {
2982 ordinal: header.ordinal,
2983 protocol_name: <VolumeManagerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2984 }),
2985 }))
2986 },
2987 )
2988 }
2989}
2990
2991#[derive(Debug)]
2993pub enum VolumeManagerRequest {
2994 AllocatePartition {
3001 slice_count: u64,
3002 type_: Guid,
3003 instance: Guid,
3004 name: String,
3005 flags: u32,
3006 responder: VolumeManagerAllocatePartitionResponder,
3007 },
3008 GetInfo { responder: VolumeManagerGetInfoResponder },
3016 Activate { old_guid: Guid, new_guid: Guid, responder: VolumeManagerActivateResponder },
3032 GetPartitionLimit { guid: Guid, responder: VolumeManagerGetPartitionLimitResponder },
3042 SetPartitionLimit {
3054 guid: Guid,
3055 slice_count: u64,
3056 responder: VolumeManagerSetPartitionLimitResponder,
3057 },
3058 SetPartitionName { guid: Guid, name: String, responder: VolumeManagerSetPartitionNameResponder },
3062}
3063
3064impl VolumeManagerRequest {
3065 #[allow(irrefutable_let_patterns)]
3066 pub fn into_allocate_partition(
3067 self,
3068 ) -> Option<(u64, Guid, Guid, String, u32, VolumeManagerAllocatePartitionResponder)> {
3069 if let VolumeManagerRequest::AllocatePartition {
3070 slice_count,
3071 type_,
3072 instance,
3073 name,
3074 flags,
3075 responder,
3076 } = self
3077 {
3078 Some((slice_count, type_, instance, name, flags, responder))
3079 } else {
3080 None
3081 }
3082 }
3083
3084 #[allow(irrefutable_let_patterns)]
3085 pub fn into_get_info(self) -> Option<(VolumeManagerGetInfoResponder)> {
3086 if let VolumeManagerRequest::GetInfo { responder } = self {
3087 Some((responder))
3088 } else {
3089 None
3090 }
3091 }
3092
3093 #[allow(irrefutable_let_patterns)]
3094 pub fn into_activate(self) -> Option<(Guid, Guid, VolumeManagerActivateResponder)> {
3095 if let VolumeManagerRequest::Activate { old_guid, new_guid, responder } = self {
3096 Some((old_guid, new_guid, responder))
3097 } else {
3098 None
3099 }
3100 }
3101
3102 #[allow(irrefutable_let_patterns)]
3103 pub fn into_get_partition_limit(
3104 self,
3105 ) -> Option<(Guid, VolumeManagerGetPartitionLimitResponder)> {
3106 if let VolumeManagerRequest::GetPartitionLimit { guid, responder } = self {
3107 Some((guid, responder))
3108 } else {
3109 None
3110 }
3111 }
3112
3113 #[allow(irrefutable_let_patterns)]
3114 pub fn into_set_partition_limit(
3115 self,
3116 ) -> Option<(Guid, u64, VolumeManagerSetPartitionLimitResponder)> {
3117 if let VolumeManagerRequest::SetPartitionLimit { guid, slice_count, responder } = self {
3118 Some((guid, slice_count, responder))
3119 } else {
3120 None
3121 }
3122 }
3123
3124 #[allow(irrefutable_let_patterns)]
3125 pub fn into_set_partition_name(
3126 self,
3127 ) -> Option<(Guid, String, VolumeManagerSetPartitionNameResponder)> {
3128 if let VolumeManagerRequest::SetPartitionName { guid, name, responder } = self {
3129 Some((guid, name, responder))
3130 } else {
3131 None
3132 }
3133 }
3134
3135 pub fn method_name(&self) -> &'static str {
3137 match *self {
3138 VolumeManagerRequest::AllocatePartition { .. } => "allocate_partition",
3139 VolumeManagerRequest::GetInfo { .. } => "get_info",
3140 VolumeManagerRequest::Activate { .. } => "activate",
3141 VolumeManagerRequest::GetPartitionLimit { .. } => "get_partition_limit",
3142 VolumeManagerRequest::SetPartitionLimit { .. } => "set_partition_limit",
3143 VolumeManagerRequest::SetPartitionName { .. } => "set_partition_name",
3144 }
3145 }
3146}
3147
3148#[derive(Debug, Clone)]
3149pub struct VolumeManagerControlHandle {
3150 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3151}
3152
3153impl VolumeManagerControlHandle {
3154 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3155 self.inner.shutdown_with_epitaph(status.into())
3156 }
3157}
3158
3159impl fdomain_client::fidl::ControlHandle for VolumeManagerControlHandle {
3160 fn shutdown(&self) {
3161 self.inner.shutdown()
3162 }
3163
3164 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3165 self.inner.shutdown_with_epitaph(status)
3166 }
3167
3168 fn is_closed(&self) -> bool {
3169 self.inner.channel().is_closed()
3170 }
3171 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3172 self.inner.channel().on_closed()
3173 }
3174}
3175
3176impl VolumeManagerControlHandle {}
3177
3178#[must_use = "FIDL methods require a response to be sent"]
3179#[derive(Debug)]
3180pub struct VolumeManagerAllocatePartitionResponder {
3181 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3182 tx_id: u32,
3183}
3184
3185impl std::ops::Drop for VolumeManagerAllocatePartitionResponder {
3189 fn drop(&mut self) {
3190 self.control_handle.shutdown();
3191 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3193 }
3194}
3195
3196impl fdomain_client::fidl::Responder for VolumeManagerAllocatePartitionResponder {
3197 type ControlHandle = VolumeManagerControlHandle;
3198
3199 fn control_handle(&self) -> &VolumeManagerControlHandle {
3200 &self.control_handle
3201 }
3202
3203 fn drop_without_shutdown(mut self) {
3204 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3206 std::mem::forget(self);
3208 }
3209}
3210
3211impl VolumeManagerAllocatePartitionResponder {
3212 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3216 let _result = self.send_raw(status);
3217 if _result.is_err() {
3218 self.control_handle.shutdown();
3219 }
3220 self.drop_without_shutdown();
3221 _result
3222 }
3223
3224 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3226 let _result = self.send_raw(status);
3227 self.drop_without_shutdown();
3228 _result
3229 }
3230
3231 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3232 self.control_handle.inner.send::<VolumeManagerAllocatePartitionResponse>(
3233 (status,),
3234 self.tx_id,
3235 0x5db528bfc287b696,
3236 fidl::encoding::DynamicFlags::empty(),
3237 )
3238 }
3239}
3240
3241#[must_use = "FIDL methods require a response to be sent"]
3242#[derive(Debug)]
3243pub struct VolumeManagerGetInfoResponder {
3244 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3245 tx_id: u32,
3246}
3247
3248impl std::ops::Drop for VolumeManagerGetInfoResponder {
3252 fn drop(&mut self) {
3253 self.control_handle.shutdown();
3254 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3256 }
3257}
3258
3259impl fdomain_client::fidl::Responder for VolumeManagerGetInfoResponder {
3260 type ControlHandle = VolumeManagerControlHandle;
3261
3262 fn control_handle(&self) -> &VolumeManagerControlHandle {
3263 &self.control_handle
3264 }
3265
3266 fn drop_without_shutdown(mut self) {
3267 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3269 std::mem::forget(self);
3271 }
3272}
3273
3274impl VolumeManagerGetInfoResponder {
3275 pub fn send(
3279 self,
3280 mut status: i32,
3281 mut info: Option<&VolumeManagerInfo>,
3282 ) -> Result<(), fidl::Error> {
3283 let _result = self.send_raw(status, info);
3284 if _result.is_err() {
3285 self.control_handle.shutdown();
3286 }
3287 self.drop_without_shutdown();
3288 _result
3289 }
3290
3291 pub fn send_no_shutdown_on_err(
3293 self,
3294 mut status: i32,
3295 mut info: Option<&VolumeManagerInfo>,
3296 ) -> Result<(), fidl::Error> {
3297 let _result = self.send_raw(status, info);
3298 self.drop_without_shutdown();
3299 _result
3300 }
3301
3302 fn send_raw(
3303 &self,
3304 mut status: i32,
3305 mut info: Option<&VolumeManagerInfo>,
3306 ) -> Result<(), fidl::Error> {
3307 self.control_handle.inner.send::<VolumeManagerGetInfoResponse>(
3308 (status, info),
3309 self.tx_id,
3310 0x2611214dcca5b064,
3311 fidl::encoding::DynamicFlags::empty(),
3312 )
3313 }
3314}
3315
3316#[must_use = "FIDL methods require a response to be sent"]
3317#[derive(Debug)]
3318pub struct VolumeManagerActivateResponder {
3319 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3320 tx_id: u32,
3321}
3322
3323impl std::ops::Drop for VolumeManagerActivateResponder {
3327 fn drop(&mut self) {
3328 self.control_handle.shutdown();
3329 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3331 }
3332}
3333
3334impl fdomain_client::fidl::Responder for VolumeManagerActivateResponder {
3335 type ControlHandle = VolumeManagerControlHandle;
3336
3337 fn control_handle(&self) -> &VolumeManagerControlHandle {
3338 &self.control_handle
3339 }
3340
3341 fn drop_without_shutdown(mut self) {
3342 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3344 std::mem::forget(self);
3346 }
3347}
3348
3349impl VolumeManagerActivateResponder {
3350 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3354 let _result = self.send_raw(status);
3355 if _result.is_err() {
3356 self.control_handle.shutdown();
3357 }
3358 self.drop_without_shutdown();
3359 _result
3360 }
3361
3362 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3364 let _result = self.send_raw(status);
3365 self.drop_without_shutdown();
3366 _result
3367 }
3368
3369 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3370 self.control_handle.inner.send::<VolumeManagerActivateResponse>(
3371 (status,),
3372 self.tx_id,
3373 0x182238d40c275be,
3374 fidl::encoding::DynamicFlags::empty(),
3375 )
3376 }
3377}
3378
3379#[must_use = "FIDL methods require a response to be sent"]
3380#[derive(Debug)]
3381pub struct VolumeManagerGetPartitionLimitResponder {
3382 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3383 tx_id: u32,
3384}
3385
3386impl std::ops::Drop for VolumeManagerGetPartitionLimitResponder {
3390 fn drop(&mut self) {
3391 self.control_handle.shutdown();
3392 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3394 }
3395}
3396
3397impl fdomain_client::fidl::Responder for VolumeManagerGetPartitionLimitResponder {
3398 type ControlHandle = VolumeManagerControlHandle;
3399
3400 fn control_handle(&self) -> &VolumeManagerControlHandle {
3401 &self.control_handle
3402 }
3403
3404 fn drop_without_shutdown(mut self) {
3405 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3407 std::mem::forget(self);
3409 }
3410}
3411
3412impl VolumeManagerGetPartitionLimitResponder {
3413 pub fn send(self, mut status: i32, mut slice_count: u64) -> Result<(), fidl::Error> {
3417 let _result = self.send_raw(status, slice_count);
3418 if _result.is_err() {
3419 self.control_handle.shutdown();
3420 }
3421 self.drop_without_shutdown();
3422 _result
3423 }
3424
3425 pub fn send_no_shutdown_on_err(
3427 self,
3428 mut status: i32,
3429 mut slice_count: u64,
3430 ) -> Result<(), fidl::Error> {
3431 let _result = self.send_raw(status, slice_count);
3432 self.drop_without_shutdown();
3433 _result
3434 }
3435
3436 fn send_raw(&self, mut status: i32, mut slice_count: u64) -> Result<(), fidl::Error> {
3437 self.control_handle.inner.send::<VolumeManagerGetPartitionLimitResponse>(
3438 (status, slice_count),
3439 self.tx_id,
3440 0x5bc9d21ea8bd52db,
3441 fidl::encoding::DynamicFlags::empty(),
3442 )
3443 }
3444}
3445
3446#[must_use = "FIDL methods require a response to be sent"]
3447#[derive(Debug)]
3448pub struct VolumeManagerSetPartitionLimitResponder {
3449 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3450 tx_id: u32,
3451}
3452
3453impl std::ops::Drop for VolumeManagerSetPartitionLimitResponder {
3457 fn drop(&mut self) {
3458 self.control_handle.shutdown();
3459 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3461 }
3462}
3463
3464impl fdomain_client::fidl::Responder for VolumeManagerSetPartitionLimitResponder {
3465 type ControlHandle = VolumeManagerControlHandle;
3466
3467 fn control_handle(&self) -> &VolumeManagerControlHandle {
3468 &self.control_handle
3469 }
3470
3471 fn drop_without_shutdown(mut self) {
3472 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3474 std::mem::forget(self);
3476 }
3477}
3478
3479impl VolumeManagerSetPartitionLimitResponder {
3480 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3484 let _result = self.send_raw(status);
3485 if _result.is_err() {
3486 self.control_handle.shutdown();
3487 }
3488 self.drop_without_shutdown();
3489 _result
3490 }
3491
3492 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3494 let _result = self.send_raw(status);
3495 self.drop_without_shutdown();
3496 _result
3497 }
3498
3499 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3500 self.control_handle.inner.send::<VolumeManagerSetPartitionLimitResponse>(
3501 (status,),
3502 self.tx_id,
3503 0x3a4903076534c093,
3504 fidl::encoding::DynamicFlags::empty(),
3505 )
3506 }
3507}
3508
3509#[must_use = "FIDL methods require a response to be sent"]
3510#[derive(Debug)]
3511pub struct VolumeManagerSetPartitionNameResponder {
3512 control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
3513 tx_id: u32,
3514}
3515
3516impl std::ops::Drop for VolumeManagerSetPartitionNameResponder {
3520 fn drop(&mut self) {
3521 self.control_handle.shutdown();
3522 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3524 }
3525}
3526
3527impl fdomain_client::fidl::Responder for VolumeManagerSetPartitionNameResponder {
3528 type ControlHandle = VolumeManagerControlHandle;
3529
3530 fn control_handle(&self) -> &VolumeManagerControlHandle {
3531 &self.control_handle
3532 }
3533
3534 fn drop_without_shutdown(mut self) {
3535 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3537 std::mem::forget(self);
3539 }
3540}
3541
3542impl VolumeManagerSetPartitionNameResponder {
3543 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3547 let _result = self.send_raw(result);
3548 if _result.is_err() {
3549 self.control_handle.shutdown();
3550 }
3551 self.drop_without_shutdown();
3552 _result
3553 }
3554
3555 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3557 let _result = self.send_raw(result);
3558 self.drop_without_shutdown();
3559 _result
3560 }
3561
3562 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3563 self.control_handle
3564 .inner
3565 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3566 result,
3567 self.tx_id,
3568 0x26afb07b9d70ff1a,
3569 fidl::encoding::DynamicFlags::empty(),
3570 )
3571 }
3572}
3573
3574mod internal {
3575 use super::*;
3576
3577 impl fidl::encoding::ResourceTypeMarker for BlockOpenSessionRequest {
3578 type Borrowed<'a> = &'a mut Self;
3579 fn take_or_borrow<'a>(
3580 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3581 ) -> Self::Borrowed<'a> {
3582 value
3583 }
3584 }
3585
3586 unsafe impl fidl::encoding::TypeMarker for BlockOpenSessionRequest {
3587 type Owned = Self;
3588
3589 #[inline(always)]
3590 fn inline_align(_context: fidl::encoding::Context) -> usize {
3591 4
3592 }
3593
3594 #[inline(always)]
3595 fn inline_size(_context: fidl::encoding::Context) -> usize {
3596 4
3597 }
3598 }
3599
3600 unsafe impl
3601 fidl::encoding::Encode<
3602 BlockOpenSessionRequest,
3603 fdomain_client::fidl::FDomainResourceDialect,
3604 > for &mut BlockOpenSessionRequest
3605 {
3606 #[inline]
3607 unsafe fn encode(
3608 self,
3609 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3610 offset: usize,
3611 _depth: fidl::encoding::Depth,
3612 ) -> fidl::Result<()> {
3613 encoder.debug_check_bounds::<BlockOpenSessionRequest>(offset);
3614 fidl::encoding::Encode::<BlockOpenSessionRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
3616 (
3617 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
3618 ),
3619 encoder, offset, _depth
3620 )
3621 }
3622 }
3623 unsafe impl<
3624 T0: fidl::encoding::Encode<
3625 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SessionMarker>>,
3626 fdomain_client::fidl::FDomainResourceDialect,
3627 >,
3628 >
3629 fidl::encoding::Encode<
3630 BlockOpenSessionRequest,
3631 fdomain_client::fidl::FDomainResourceDialect,
3632 > for (T0,)
3633 {
3634 #[inline]
3635 unsafe fn encode(
3636 self,
3637 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3638 offset: usize,
3639 depth: fidl::encoding::Depth,
3640 ) -> fidl::Result<()> {
3641 encoder.debug_check_bounds::<BlockOpenSessionRequest>(offset);
3642 self.0.encode(encoder, offset + 0, depth)?;
3646 Ok(())
3647 }
3648 }
3649
3650 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
3651 for BlockOpenSessionRequest
3652 {
3653 #[inline(always)]
3654 fn new_empty() -> Self {
3655 Self {
3656 session: fidl::new_empty!(
3657 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SessionMarker>>,
3658 fdomain_client::fidl::FDomainResourceDialect
3659 ),
3660 }
3661 }
3662
3663 #[inline]
3664 unsafe fn decode(
3665 &mut self,
3666 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3667 offset: usize,
3668 _depth: fidl::encoding::Depth,
3669 ) -> fidl::Result<()> {
3670 decoder.debug_check_bounds::<Self>(offset);
3671 fidl::decode!(
3673 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SessionMarker>>,
3674 fdomain_client::fidl::FDomainResourceDialect,
3675 &mut self.session,
3676 decoder,
3677 offset + 0,
3678 _depth
3679 )?;
3680 Ok(())
3681 }
3682 }
3683
3684 impl fidl::encoding::ResourceTypeMarker for BlockOpenSessionWithOptionsRequest {
3685 type Borrowed<'a> = &'a mut Self;
3686 fn take_or_borrow<'a>(
3687 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3688 ) -> Self::Borrowed<'a> {
3689 value
3690 }
3691 }
3692
3693 unsafe impl fidl::encoding::TypeMarker for BlockOpenSessionWithOptionsRequest {
3694 type Owned = Self;
3695
3696 #[inline(always)]
3697 fn inline_align(_context: fidl::encoding::Context) -> usize {
3698 8
3699 }
3700
3701 #[inline(always)]
3702 fn inline_size(_context: fidl::encoding::Context) -> usize {
3703 24
3704 }
3705 }
3706
3707 unsafe impl
3708 fidl::encoding::Encode<
3709 BlockOpenSessionWithOptionsRequest,
3710 fdomain_client::fidl::FDomainResourceDialect,
3711 > for &mut BlockOpenSessionWithOptionsRequest
3712 {
3713 #[inline]
3714 unsafe fn encode(
3715 self,
3716 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3717 offset: usize,
3718 _depth: fidl::encoding::Depth,
3719 ) -> fidl::Result<()> {
3720 encoder.debug_check_bounds::<BlockOpenSessionWithOptionsRequest>(offset);
3721 fidl::encoding::Encode::<BlockOpenSessionWithOptionsRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
3723 (
3724 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
3725 <fidl::encoding::Vector<BlockOffsetMapping, 4> as fidl::encoding::ValueTypeMarker>::borrow(&self.mappings),
3726 ),
3727 encoder, offset, _depth
3728 )
3729 }
3730 }
3731 unsafe impl<
3732 T0: fidl::encoding::Encode<
3733 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SessionMarker>>,
3734 fdomain_client::fidl::FDomainResourceDialect,
3735 >,
3736 T1: fidl::encoding::Encode<
3737 fidl::encoding::Vector<BlockOffsetMapping, 4>,
3738 fdomain_client::fidl::FDomainResourceDialect,
3739 >,
3740 >
3741 fidl::encoding::Encode<
3742 BlockOpenSessionWithOptionsRequest,
3743 fdomain_client::fidl::FDomainResourceDialect,
3744 > for (T0, T1)
3745 {
3746 #[inline]
3747 unsafe fn encode(
3748 self,
3749 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3750 offset: usize,
3751 depth: fidl::encoding::Depth,
3752 ) -> fidl::Result<()> {
3753 encoder.debug_check_bounds::<BlockOpenSessionWithOptionsRequest>(offset);
3754 unsafe {
3757 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3758 (ptr as *mut u64).write_unaligned(0);
3759 }
3760 self.0.encode(encoder, offset + 0, depth)?;
3762 self.1.encode(encoder, offset + 8, depth)?;
3763 Ok(())
3764 }
3765 }
3766
3767 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
3768 for BlockOpenSessionWithOptionsRequest
3769 {
3770 #[inline(always)]
3771 fn new_empty() -> Self {
3772 Self {
3773 session: fidl::new_empty!(
3774 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SessionMarker>>,
3775 fdomain_client::fidl::FDomainResourceDialect
3776 ),
3777 mappings: fidl::new_empty!(fidl::encoding::Vector<BlockOffsetMapping, 4>, fdomain_client::fidl::FDomainResourceDialect),
3778 }
3779 }
3780
3781 #[inline]
3782 unsafe fn decode(
3783 &mut self,
3784 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3785 offset: usize,
3786 _depth: fidl::encoding::Depth,
3787 ) -> fidl::Result<()> {
3788 decoder.debug_check_bounds::<Self>(offset);
3789 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3791 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3792 let mask = 0xffffffff00000000u64;
3793 let maskedval = padval & mask;
3794 if maskedval != 0 {
3795 return Err(fidl::Error::NonZeroPadding {
3796 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3797 });
3798 }
3799 fidl::decode!(
3800 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<SessionMarker>>,
3801 fdomain_client::fidl::FDomainResourceDialect,
3802 &mut self.session,
3803 decoder,
3804 offset + 0,
3805 _depth
3806 )?;
3807 fidl::decode!(fidl::encoding::Vector<BlockOffsetMapping, 4>, fdomain_client::fidl::FDomainResourceDialect, &mut self.mappings, decoder, offset + 8, _depth)?;
3808 Ok(())
3809 }
3810 }
3811
3812 impl fidl::encoding::ResourceTypeMarker for SessionAttachVmoRequest {
3813 type Borrowed<'a> = &'a mut Self;
3814 fn take_or_borrow<'a>(
3815 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3816 ) -> Self::Borrowed<'a> {
3817 value
3818 }
3819 }
3820
3821 unsafe impl fidl::encoding::TypeMarker for SessionAttachVmoRequest {
3822 type Owned = Self;
3823
3824 #[inline(always)]
3825 fn inline_align(_context: fidl::encoding::Context) -> usize {
3826 4
3827 }
3828
3829 #[inline(always)]
3830 fn inline_size(_context: fidl::encoding::Context) -> usize {
3831 4
3832 }
3833 }
3834
3835 unsafe impl
3836 fidl::encoding::Encode<
3837 SessionAttachVmoRequest,
3838 fdomain_client::fidl::FDomainResourceDialect,
3839 > for &mut SessionAttachVmoRequest
3840 {
3841 #[inline]
3842 unsafe fn encode(
3843 self,
3844 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3845 offset: usize,
3846 _depth: fidl::encoding::Depth,
3847 ) -> fidl::Result<()> {
3848 encoder.debug_check_bounds::<SessionAttachVmoRequest>(offset);
3849 fidl::encoding::Encode::<
3851 SessionAttachVmoRequest,
3852 fdomain_client::fidl::FDomainResourceDialect,
3853 >::encode(
3854 (<fidl::encoding::HandleType<
3855 fdomain_client::Vmo,
3856 { fidl::ObjectType::VMO.into_raw() },
3857 2147483648,
3858 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3859 &mut self.vmo
3860 ),),
3861 encoder,
3862 offset,
3863 _depth,
3864 )
3865 }
3866 }
3867 unsafe impl<
3868 T0: fidl::encoding::Encode<
3869 fidl::encoding::HandleType<
3870 fdomain_client::Vmo,
3871 { fidl::ObjectType::VMO.into_raw() },
3872 2147483648,
3873 >,
3874 fdomain_client::fidl::FDomainResourceDialect,
3875 >,
3876 >
3877 fidl::encoding::Encode<
3878 SessionAttachVmoRequest,
3879 fdomain_client::fidl::FDomainResourceDialect,
3880 > for (T0,)
3881 {
3882 #[inline]
3883 unsafe fn encode(
3884 self,
3885 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3886 offset: usize,
3887 depth: fidl::encoding::Depth,
3888 ) -> fidl::Result<()> {
3889 encoder.debug_check_bounds::<SessionAttachVmoRequest>(offset);
3890 self.0.encode(encoder, offset + 0, depth)?;
3894 Ok(())
3895 }
3896 }
3897
3898 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
3899 for SessionAttachVmoRequest
3900 {
3901 #[inline(always)]
3902 fn new_empty() -> Self {
3903 Self {
3904 vmo: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
3905 }
3906 }
3907
3908 #[inline]
3909 unsafe fn decode(
3910 &mut self,
3911 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3912 offset: usize,
3913 _depth: fidl::encoding::Depth,
3914 ) -> fidl::Result<()> {
3915 decoder.debug_check_bounds::<Self>(offset);
3916 fidl::decode!(fidl::encoding::HandleType<fdomain_client::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
3918 Ok(())
3919 }
3920 }
3921
3922 impl fidl::encoding::ResourceTypeMarker for SessionGetFifoResponse {
3923 type Borrowed<'a> = &'a mut Self;
3924 fn take_or_borrow<'a>(
3925 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3926 ) -> Self::Borrowed<'a> {
3927 value
3928 }
3929 }
3930
3931 unsafe impl fidl::encoding::TypeMarker for SessionGetFifoResponse {
3932 type Owned = Self;
3933
3934 #[inline(always)]
3935 fn inline_align(_context: fidl::encoding::Context) -> usize {
3936 4
3937 }
3938
3939 #[inline(always)]
3940 fn inline_size(_context: fidl::encoding::Context) -> usize {
3941 4
3942 }
3943 }
3944
3945 unsafe impl
3946 fidl::encoding::Encode<SessionGetFifoResponse, fdomain_client::fidl::FDomainResourceDialect>
3947 for &mut SessionGetFifoResponse
3948 {
3949 #[inline]
3950 unsafe fn encode(
3951 self,
3952 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3953 offset: usize,
3954 _depth: fidl::encoding::Depth,
3955 ) -> fidl::Result<()> {
3956 encoder.debug_check_bounds::<SessionGetFifoResponse>(offset);
3957 fidl::encoding::Encode::<
3959 SessionGetFifoResponse,
3960 fdomain_client::fidl::FDomainResourceDialect,
3961 >::encode(
3962 (<fidl::encoding::HandleType<
3963 fdomain_client::Fifo,
3964 { fidl::ObjectType::FIFO.into_raw() },
3965 2147483648,
3966 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3967 &mut self.fifo
3968 ),),
3969 encoder,
3970 offset,
3971 _depth,
3972 )
3973 }
3974 }
3975 unsafe impl<
3976 T0: fidl::encoding::Encode<
3977 fidl::encoding::HandleType<
3978 fdomain_client::Fifo,
3979 { fidl::ObjectType::FIFO.into_raw() },
3980 2147483648,
3981 >,
3982 fdomain_client::fidl::FDomainResourceDialect,
3983 >,
3984 >
3985 fidl::encoding::Encode<SessionGetFifoResponse, fdomain_client::fidl::FDomainResourceDialect>
3986 for (T0,)
3987 {
3988 #[inline]
3989 unsafe fn encode(
3990 self,
3991 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3992 offset: usize,
3993 depth: fidl::encoding::Depth,
3994 ) -> fidl::Result<()> {
3995 encoder.debug_check_bounds::<SessionGetFifoResponse>(offset);
3996 self.0.encode(encoder, offset + 0, depth)?;
4000 Ok(())
4001 }
4002 }
4003
4004 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
4005 for SessionGetFifoResponse
4006 {
4007 #[inline(always)]
4008 fn new_empty() -> Self {
4009 Self {
4010 fifo: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Fifo, { fidl::ObjectType::FIFO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
4011 }
4012 }
4013
4014 #[inline]
4015 unsafe fn decode(
4016 &mut self,
4017 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
4018 offset: usize,
4019 _depth: fidl::encoding::Depth,
4020 ) -> fidl::Result<()> {
4021 decoder.debug_check_bounds::<Self>(offset);
4022 fidl::decode!(fidl::encoding::HandleType<fdomain_client::Fifo, { fidl::ObjectType::FIFO.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.fifo, decoder, offset + 0, _depth)?;
4024 Ok(())
4025 }
4026 }
4027}