1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_virtualization_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16pub struct BlockSpec {
17 pub id: String,
19 pub mode: BlockMode,
21 pub format: BlockFormat,
23}
24
25impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlockSpec {}
26
27#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28pub struct GuestGetBalloonControllerRequest {
29 pub controller: fidl::endpoints::ServerEnd<BalloonControllerMarker>,
30}
31
32impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
33 for GuestGetBalloonControllerRequest
34{
35}
36
37#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
38pub struct GuestGetHostVsockEndpointRequest {
39 pub endpoint: fidl::endpoints::ServerEnd<HostVsockEndpointMarker>,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for GuestGetHostVsockEndpointRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct GuestGetMemControllerRequest {
49 pub controller: fidl::endpoints::ServerEnd<MemControllerMarker>,
50}
51
52impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
53 for GuestGetMemControllerRequest
54{
55}
56
57#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
58pub struct GuestGetSerialResponse {
59 pub socket: fidl::Socket,
60}
61
62impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GuestGetSerialResponse {}
63
64#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
65pub struct GuestLifecycleBindRequest {
66 pub guest: fidl::endpoints::ServerEnd<GuestMarker>,
67}
68
69impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GuestLifecycleBindRequest {}
70
71#[derive(Debug, PartialEq)]
72pub struct GuestLifecycleCreateRequest {
73 pub guest_config: GuestConfig,
74}
75
76impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
77 for GuestLifecycleCreateRequest
78{
79}
80
81#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
82pub struct GuestManagerConnectRequest {
83 pub controller: fidl::endpoints::ServerEnd<GuestMarker>,
84}
85
86impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
87 for GuestManagerConnectRequest
88{
89}
90
91#[derive(Debug, PartialEq)]
92pub struct GuestManagerGetInfoResponse {
93 pub guest_info: GuestInfo,
94}
95
96impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
97 for GuestManagerGetInfoResponse
98{
99}
100
101#[derive(Debug, PartialEq)]
102pub struct GuestManagerLaunchRequest {
103 pub guest_config: GuestConfig,
104 pub controller: fidl::endpoints::ServerEnd<GuestMarker>,
105}
106
107impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GuestManagerLaunchRequest {}
108
109#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
110pub struct GuestGetConsoleResponse {
111 pub socket: fidl::Socket,
112}
113
114impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GuestGetConsoleResponse {}
115
116#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
117pub struct HostVsockAcceptorAcceptResponse {
118 pub socket: fidl::Socket,
119}
120
121impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
122 for HostVsockAcceptorAcceptResponse
123{
124}
125
126#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127pub struct HostVsockEndpointConnectResponse {
128 pub socket: fidl::Socket,
129}
130
131impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
132 for HostVsockEndpointConnectResponse
133{
134}
135
136#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137pub struct Listener {
138 pub port: u32,
139 pub acceptor: fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>,
140}
141
142impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Listener {}
143
144#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146pub struct WaylandDevice {
147 pub memory: u64,
152 pub server: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_wayland::Server_Marker>>,
154}
155
156impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WaylandDevice {}
157
158#[derive(Debug, Default, PartialEq)]
161pub struct GuestConfig {
162 pub kernel_type: Option<KernelType>,
164 pub kernel: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
166 pub ramdisk: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
169 pub dtb_overlay: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
172 pub cmdline: Option<String>,
174 pub cmdline_add: Option<Vec<String>>,
176 pub cpus: Option<u8>,
178 pub guest_memory: Option<u64>,
181 pub block_devices: Option<Vec<BlockSpec>>,
184 pub net_devices: Option<Vec<NetSpec>>,
186 pub wayland_device: Option<WaylandDevice>,
188 pub magma_device: Option<MagmaDevice>,
190 pub default_net: Option<bool>,
192 pub virtio_balloon: Option<bool>,
194 pub virtio_console: Option<bool>,
196 pub virtio_gpu: Option<bool>,
198 pub virtio_rng: Option<bool>,
200 pub virtio_vsock: Option<bool>,
202 pub virtio_sound: Option<bool>,
204 pub virtio_sound_input: Option<bool>,
206 pub vsock_listeners: Option<Vec<Listener>>,
212 pub virtio_mem: Option<bool>,
214 pub virtio_mem_block_size: Option<u64>,
219 pub virtio_mem_region_size: Option<u64>,
221 pub virtio_mem_region_alignment: Option<u64>,
223 #[doc(hidden)]
224 pub __source_breaking: fidl::marker::SourceBreaking,
225}
226
227impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GuestConfig {}
228
229#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
230pub enum BlockFormat {
231 File(fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>),
233 Qcow(fidl::Channel),
235 Block(fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>),
237}
238
239impl BlockFormat {
240 #[inline]
241 pub fn ordinal(&self) -> u64 {
242 match *self {
243 Self::File(_) => 1,
244 Self::Qcow(_) => 2,
245 Self::Block(_) => 3,
246 }
247 }
248
249 #[deprecated = "Strict unions should not use `is_unknown`"]
250 #[inline]
251 pub fn is_unknown(&self) -> bool {
252 false
253 }
254}
255
256impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlockFormat {}
257
258#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
259pub struct BalloonControllerMarker;
260
261impl fidl::endpoints::ProtocolMarker for BalloonControllerMarker {
262 type Proxy = BalloonControllerProxy;
263 type RequestStream = BalloonControllerRequestStream;
264 #[cfg(target_os = "fuchsia")]
265 type SynchronousProxy = BalloonControllerSynchronousProxy;
266
267 const DEBUG_NAME: &'static str = "fuchsia.virtualization.BalloonController";
268}
269impl fidl::endpoints::DiscoverableProtocolMarker for BalloonControllerMarker {}
270
271pub trait BalloonControllerProxyInterface: Send + Sync {
272 type GetBalloonSizeResponseFut: std::future::Future<Output = Result<(u32, u32), fidl::Error>>
273 + Send;
274 fn r#get_balloon_size(&self) -> Self::GetBalloonSizeResponseFut;
275 fn r#request_num_pages(&self, requested_num_pages: u32) -> Result<(), fidl::Error>;
276 type GetMemStatsResponseFut: std::future::Future<Output = Result<(i32, Option<Vec<MemStat>>), fidl::Error>>
277 + Send;
278 fn r#get_mem_stats(&self) -> Self::GetMemStatsResponseFut;
279}
280#[derive(Debug)]
281#[cfg(target_os = "fuchsia")]
282pub struct BalloonControllerSynchronousProxy {
283 client: fidl::client::sync::Client,
284}
285
286#[cfg(target_os = "fuchsia")]
287impl fidl::endpoints::SynchronousProxy for BalloonControllerSynchronousProxy {
288 type Proxy = BalloonControllerProxy;
289 type Protocol = BalloonControllerMarker;
290
291 fn from_channel(inner: fidl::Channel) -> Self {
292 Self::new(inner)
293 }
294
295 fn into_channel(self) -> fidl::Channel {
296 self.client.into_channel()
297 }
298
299 fn as_channel(&self) -> &fidl::Channel {
300 self.client.as_channel()
301 }
302}
303
304#[cfg(target_os = "fuchsia")]
305impl BalloonControllerSynchronousProxy {
306 pub fn new(channel: fidl::Channel) -> Self {
307 let protocol_name =
308 <BalloonControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
309 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
310 }
311
312 pub fn into_channel(self) -> fidl::Channel {
313 self.client.into_channel()
314 }
315
316 pub fn wait_for_event(
319 &self,
320 deadline: zx::MonotonicInstant,
321 ) -> Result<BalloonControllerEvent, fidl::Error> {
322 BalloonControllerEvent::decode(self.client.wait_for_event(deadline)?)
323 }
324
325 pub fn r#get_balloon_size(
333 &self,
334 ___deadline: zx::MonotonicInstant,
335 ) -> Result<(u32, u32), fidl::Error> {
336 let _response = self
337 .client
338 .send_query::<fidl::encoding::EmptyPayload, BalloonControllerGetBalloonSizeResponse>(
339 (),
340 0x2bb2ebaa6ff64d0b,
341 fidl::encoding::DynamicFlags::empty(),
342 ___deadline,
343 )?;
344 Ok((_response.current_num_pages, _response.requested_num_pages))
345 }
346
347 pub fn r#request_num_pages(&self, mut requested_num_pages: u32) -> Result<(), fidl::Error> {
354 self.client.send::<BalloonControllerRequestNumPagesRequest>(
355 (requested_num_pages,),
356 0x55c444d65e1df1e8,
357 fidl::encoding::DynamicFlags::empty(),
358 )
359 }
360
361 pub fn r#get_mem_stats(
363 &self,
364 ___deadline: zx::MonotonicInstant,
365 ) -> Result<(i32, Option<Vec<MemStat>>), fidl::Error> {
366 let _response = self
367 .client
368 .send_query::<fidl::encoding::EmptyPayload, BalloonControllerGetMemStatsResponse>(
369 (),
370 0x676199795cc01142,
371 fidl::encoding::DynamicFlags::empty(),
372 ___deadline,
373 )?;
374 Ok((_response.status, _response.mem_stats))
375 }
376}
377
378#[cfg(target_os = "fuchsia")]
379impl From<BalloonControllerSynchronousProxy> for zx::Handle {
380 fn from(value: BalloonControllerSynchronousProxy) -> Self {
381 value.into_channel().into()
382 }
383}
384
385#[cfg(target_os = "fuchsia")]
386impl From<fidl::Channel> for BalloonControllerSynchronousProxy {
387 fn from(value: fidl::Channel) -> Self {
388 Self::new(value)
389 }
390}
391
392#[derive(Debug, Clone)]
393pub struct BalloonControllerProxy {
394 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
395}
396
397impl fidl::endpoints::Proxy for BalloonControllerProxy {
398 type Protocol = BalloonControllerMarker;
399
400 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
401 Self::new(inner)
402 }
403
404 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
405 self.client.into_channel().map_err(|client| Self { client })
406 }
407
408 fn as_channel(&self) -> &::fidl::AsyncChannel {
409 self.client.as_channel()
410 }
411}
412
413impl BalloonControllerProxy {
414 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
416 let protocol_name =
417 <BalloonControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
418 Self { client: fidl::client::Client::new(channel, protocol_name) }
419 }
420
421 pub fn take_event_stream(&self) -> BalloonControllerEventStream {
427 BalloonControllerEventStream { event_receiver: self.client.take_event_receiver() }
428 }
429
430 pub fn r#get_balloon_size(
438 &self,
439 ) -> fidl::client::QueryResponseFut<(u32, u32), fidl::encoding::DefaultFuchsiaResourceDialect>
440 {
441 BalloonControllerProxyInterface::r#get_balloon_size(self)
442 }
443
444 pub fn r#request_num_pages(&self, mut requested_num_pages: u32) -> Result<(), fidl::Error> {
451 BalloonControllerProxyInterface::r#request_num_pages(self, requested_num_pages)
452 }
453
454 pub fn r#get_mem_stats(
456 &self,
457 ) -> fidl::client::QueryResponseFut<
458 (i32, Option<Vec<MemStat>>),
459 fidl::encoding::DefaultFuchsiaResourceDialect,
460 > {
461 BalloonControllerProxyInterface::r#get_mem_stats(self)
462 }
463}
464
465impl BalloonControllerProxyInterface for BalloonControllerProxy {
466 type GetBalloonSizeResponseFut =
467 fidl::client::QueryResponseFut<(u32, u32), fidl::encoding::DefaultFuchsiaResourceDialect>;
468 fn r#get_balloon_size(&self) -> Self::GetBalloonSizeResponseFut {
469 fn _decode(
470 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
471 ) -> Result<(u32, u32), fidl::Error> {
472 let _response = fidl::client::decode_transaction_body::<
473 BalloonControllerGetBalloonSizeResponse,
474 fidl::encoding::DefaultFuchsiaResourceDialect,
475 0x2bb2ebaa6ff64d0b,
476 >(_buf?)?;
477 Ok((_response.current_num_pages, _response.requested_num_pages))
478 }
479 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (u32, u32)>(
480 (),
481 0x2bb2ebaa6ff64d0b,
482 fidl::encoding::DynamicFlags::empty(),
483 _decode,
484 )
485 }
486
487 fn r#request_num_pages(&self, mut requested_num_pages: u32) -> Result<(), fidl::Error> {
488 self.client.send::<BalloonControllerRequestNumPagesRequest>(
489 (requested_num_pages,),
490 0x55c444d65e1df1e8,
491 fidl::encoding::DynamicFlags::empty(),
492 )
493 }
494
495 type GetMemStatsResponseFut = fidl::client::QueryResponseFut<
496 (i32, Option<Vec<MemStat>>),
497 fidl::encoding::DefaultFuchsiaResourceDialect,
498 >;
499 fn r#get_mem_stats(&self) -> Self::GetMemStatsResponseFut {
500 fn _decode(
501 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
502 ) -> Result<(i32, Option<Vec<MemStat>>), fidl::Error> {
503 let _response = fidl::client::decode_transaction_body::<
504 BalloonControllerGetMemStatsResponse,
505 fidl::encoding::DefaultFuchsiaResourceDialect,
506 0x676199795cc01142,
507 >(_buf?)?;
508 Ok((_response.status, _response.mem_stats))
509 }
510 self.client
511 .send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<Vec<MemStat>>)>(
512 (),
513 0x676199795cc01142,
514 fidl::encoding::DynamicFlags::empty(),
515 _decode,
516 )
517 }
518}
519
520pub struct BalloonControllerEventStream {
521 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
522}
523
524impl std::marker::Unpin for BalloonControllerEventStream {}
525
526impl futures::stream::FusedStream for BalloonControllerEventStream {
527 fn is_terminated(&self) -> bool {
528 self.event_receiver.is_terminated()
529 }
530}
531
532impl futures::Stream for BalloonControllerEventStream {
533 type Item = Result<BalloonControllerEvent, fidl::Error>;
534
535 fn poll_next(
536 mut self: std::pin::Pin<&mut Self>,
537 cx: &mut std::task::Context<'_>,
538 ) -> std::task::Poll<Option<Self::Item>> {
539 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
540 &mut self.event_receiver,
541 cx
542 )?) {
543 Some(buf) => std::task::Poll::Ready(Some(BalloonControllerEvent::decode(buf))),
544 None => std::task::Poll::Ready(None),
545 }
546 }
547}
548
549#[derive(Debug)]
550pub enum BalloonControllerEvent {}
551
552impl BalloonControllerEvent {
553 fn decode(
555 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
556 ) -> Result<BalloonControllerEvent, fidl::Error> {
557 let (bytes, _handles) = buf.split_mut();
558 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
559 debug_assert_eq!(tx_header.tx_id, 0);
560 match tx_header.ordinal {
561 _ => Err(fidl::Error::UnknownOrdinal {
562 ordinal: tx_header.ordinal,
563 protocol_name:
564 <BalloonControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
565 }),
566 }
567 }
568}
569
570pub struct BalloonControllerRequestStream {
572 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
573 is_terminated: bool,
574}
575
576impl std::marker::Unpin for BalloonControllerRequestStream {}
577
578impl futures::stream::FusedStream for BalloonControllerRequestStream {
579 fn is_terminated(&self) -> bool {
580 self.is_terminated
581 }
582}
583
584impl fidl::endpoints::RequestStream for BalloonControllerRequestStream {
585 type Protocol = BalloonControllerMarker;
586 type ControlHandle = BalloonControllerControlHandle;
587
588 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
589 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
590 }
591
592 fn control_handle(&self) -> Self::ControlHandle {
593 BalloonControllerControlHandle { inner: self.inner.clone() }
594 }
595
596 fn into_inner(
597 self,
598 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
599 {
600 (self.inner, self.is_terminated)
601 }
602
603 fn from_inner(
604 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
605 is_terminated: bool,
606 ) -> Self {
607 Self { inner, is_terminated }
608 }
609}
610
611impl futures::Stream for BalloonControllerRequestStream {
612 type Item = Result<BalloonControllerRequest, fidl::Error>;
613
614 fn poll_next(
615 mut self: std::pin::Pin<&mut Self>,
616 cx: &mut std::task::Context<'_>,
617 ) -> std::task::Poll<Option<Self::Item>> {
618 let this = &mut *self;
619 if this.inner.check_shutdown(cx) {
620 this.is_terminated = true;
621 return std::task::Poll::Ready(None);
622 }
623 if this.is_terminated {
624 panic!("polled BalloonControllerRequestStream after completion");
625 }
626 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
627 |bytes, handles| {
628 match this.inner.channel().read_etc(cx, bytes, handles) {
629 std::task::Poll::Ready(Ok(())) => {}
630 std::task::Poll::Pending => return std::task::Poll::Pending,
631 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
632 this.is_terminated = true;
633 return std::task::Poll::Ready(None);
634 }
635 std::task::Poll::Ready(Err(e)) => {
636 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
637 e.into(),
638 ))))
639 }
640 }
641
642 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
644
645 std::task::Poll::Ready(Some(match header.ordinal {
646 0x2bb2ebaa6ff64d0b => {
647 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
648 let mut req = fidl::new_empty!(
649 fidl::encoding::EmptyPayload,
650 fidl::encoding::DefaultFuchsiaResourceDialect
651 );
652 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
653 let control_handle =
654 BalloonControllerControlHandle { inner: this.inner.clone() };
655 Ok(BalloonControllerRequest::GetBalloonSize {
656 responder: BalloonControllerGetBalloonSizeResponder {
657 control_handle: std::mem::ManuallyDrop::new(control_handle),
658 tx_id: header.tx_id,
659 },
660 })
661 }
662 0x55c444d65e1df1e8 => {
663 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
664 let mut req = fidl::new_empty!(
665 BalloonControllerRequestNumPagesRequest,
666 fidl::encoding::DefaultFuchsiaResourceDialect
667 );
668 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BalloonControllerRequestNumPagesRequest>(&header, _body_bytes, handles, &mut req)?;
669 let control_handle =
670 BalloonControllerControlHandle { inner: this.inner.clone() };
671 Ok(BalloonControllerRequest::RequestNumPages {
672 requested_num_pages: req.requested_num_pages,
673
674 control_handle,
675 })
676 }
677 0x676199795cc01142 => {
678 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
679 let mut req = fidl::new_empty!(
680 fidl::encoding::EmptyPayload,
681 fidl::encoding::DefaultFuchsiaResourceDialect
682 );
683 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
684 let control_handle =
685 BalloonControllerControlHandle { inner: this.inner.clone() };
686 Ok(BalloonControllerRequest::GetMemStats {
687 responder: BalloonControllerGetMemStatsResponder {
688 control_handle: std::mem::ManuallyDrop::new(control_handle),
689 tx_id: header.tx_id,
690 },
691 })
692 }
693 _ => Err(fidl::Error::UnknownOrdinal {
694 ordinal: header.ordinal,
695 protocol_name:
696 <BalloonControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
697 }),
698 }))
699 },
700 )
701 }
702}
703
704#[derive(Debug)]
706pub enum BalloonControllerRequest {
707 GetBalloonSize { responder: BalloonControllerGetBalloonSizeResponder },
715 RequestNumPages { requested_num_pages: u32, control_handle: BalloonControllerControlHandle },
722 GetMemStats { responder: BalloonControllerGetMemStatsResponder },
724}
725
726impl BalloonControllerRequest {
727 #[allow(irrefutable_let_patterns)]
728 pub fn into_get_balloon_size(self) -> Option<(BalloonControllerGetBalloonSizeResponder)> {
729 if let BalloonControllerRequest::GetBalloonSize { responder } = self {
730 Some((responder))
731 } else {
732 None
733 }
734 }
735
736 #[allow(irrefutable_let_patterns)]
737 pub fn into_request_num_pages(self) -> Option<(u32, BalloonControllerControlHandle)> {
738 if let BalloonControllerRequest::RequestNumPages { requested_num_pages, control_handle } =
739 self
740 {
741 Some((requested_num_pages, control_handle))
742 } else {
743 None
744 }
745 }
746
747 #[allow(irrefutable_let_patterns)]
748 pub fn into_get_mem_stats(self) -> Option<(BalloonControllerGetMemStatsResponder)> {
749 if let BalloonControllerRequest::GetMemStats { responder } = self {
750 Some((responder))
751 } else {
752 None
753 }
754 }
755
756 pub fn method_name(&self) -> &'static str {
758 match *self {
759 BalloonControllerRequest::GetBalloonSize { .. } => "get_balloon_size",
760 BalloonControllerRequest::RequestNumPages { .. } => "request_num_pages",
761 BalloonControllerRequest::GetMemStats { .. } => "get_mem_stats",
762 }
763 }
764}
765
766#[derive(Debug, Clone)]
767pub struct BalloonControllerControlHandle {
768 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
769}
770
771impl fidl::endpoints::ControlHandle for BalloonControllerControlHandle {
772 fn shutdown(&self) {
773 self.inner.shutdown()
774 }
775 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
776 self.inner.shutdown_with_epitaph(status)
777 }
778
779 fn is_closed(&self) -> bool {
780 self.inner.channel().is_closed()
781 }
782 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
783 self.inner.channel().on_closed()
784 }
785
786 #[cfg(target_os = "fuchsia")]
787 fn signal_peer(
788 &self,
789 clear_mask: zx::Signals,
790 set_mask: zx::Signals,
791 ) -> Result<(), zx_status::Status> {
792 use fidl::Peered;
793 self.inner.channel().signal_peer(clear_mask, set_mask)
794 }
795}
796
797impl BalloonControllerControlHandle {}
798
799#[must_use = "FIDL methods require a response to be sent"]
800#[derive(Debug)]
801pub struct BalloonControllerGetBalloonSizeResponder {
802 control_handle: std::mem::ManuallyDrop<BalloonControllerControlHandle>,
803 tx_id: u32,
804}
805
806impl std::ops::Drop for BalloonControllerGetBalloonSizeResponder {
810 fn drop(&mut self) {
811 self.control_handle.shutdown();
812 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
814 }
815}
816
817impl fidl::endpoints::Responder for BalloonControllerGetBalloonSizeResponder {
818 type ControlHandle = BalloonControllerControlHandle;
819
820 fn control_handle(&self) -> &BalloonControllerControlHandle {
821 &self.control_handle
822 }
823
824 fn drop_without_shutdown(mut self) {
825 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
827 std::mem::forget(self);
829 }
830}
831
832impl BalloonControllerGetBalloonSizeResponder {
833 pub fn send(
837 self,
838 mut current_num_pages: u32,
839 mut requested_num_pages: u32,
840 ) -> Result<(), fidl::Error> {
841 let _result = self.send_raw(current_num_pages, requested_num_pages);
842 if _result.is_err() {
843 self.control_handle.shutdown();
844 }
845 self.drop_without_shutdown();
846 _result
847 }
848
849 pub fn send_no_shutdown_on_err(
851 self,
852 mut current_num_pages: u32,
853 mut requested_num_pages: u32,
854 ) -> Result<(), fidl::Error> {
855 let _result = self.send_raw(current_num_pages, requested_num_pages);
856 self.drop_without_shutdown();
857 _result
858 }
859
860 fn send_raw(
861 &self,
862 mut current_num_pages: u32,
863 mut requested_num_pages: u32,
864 ) -> Result<(), fidl::Error> {
865 self.control_handle.inner.send::<BalloonControllerGetBalloonSizeResponse>(
866 (current_num_pages, requested_num_pages),
867 self.tx_id,
868 0x2bb2ebaa6ff64d0b,
869 fidl::encoding::DynamicFlags::empty(),
870 )
871 }
872}
873
874#[must_use = "FIDL methods require a response to be sent"]
875#[derive(Debug)]
876pub struct BalloonControllerGetMemStatsResponder {
877 control_handle: std::mem::ManuallyDrop<BalloonControllerControlHandle>,
878 tx_id: u32,
879}
880
881impl std::ops::Drop for BalloonControllerGetMemStatsResponder {
885 fn drop(&mut self) {
886 self.control_handle.shutdown();
887 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
889 }
890}
891
892impl fidl::endpoints::Responder for BalloonControllerGetMemStatsResponder {
893 type ControlHandle = BalloonControllerControlHandle;
894
895 fn control_handle(&self) -> &BalloonControllerControlHandle {
896 &self.control_handle
897 }
898
899 fn drop_without_shutdown(mut self) {
900 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
902 std::mem::forget(self);
904 }
905}
906
907impl BalloonControllerGetMemStatsResponder {
908 pub fn send(
912 self,
913 mut status: i32,
914 mut mem_stats: Option<&[MemStat]>,
915 ) -> Result<(), fidl::Error> {
916 let _result = self.send_raw(status, mem_stats);
917 if _result.is_err() {
918 self.control_handle.shutdown();
919 }
920 self.drop_without_shutdown();
921 _result
922 }
923
924 pub fn send_no_shutdown_on_err(
926 self,
927 mut status: i32,
928 mut mem_stats: Option<&[MemStat]>,
929 ) -> Result<(), fidl::Error> {
930 let _result = self.send_raw(status, mem_stats);
931 self.drop_without_shutdown();
932 _result
933 }
934
935 fn send_raw(
936 &self,
937 mut status: i32,
938 mut mem_stats: Option<&[MemStat]>,
939 ) -> Result<(), fidl::Error> {
940 self.control_handle.inner.send::<BalloonControllerGetMemStatsResponse>(
941 (status, mem_stats),
942 self.tx_id,
943 0x676199795cc01142,
944 fidl::encoding::DynamicFlags::empty(),
945 )
946 }
947}
948
949#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
950pub struct DebianGuestManagerMarker;
951
952impl fidl::endpoints::ProtocolMarker for DebianGuestManagerMarker {
953 type Proxy = DebianGuestManagerProxy;
954 type RequestStream = DebianGuestManagerRequestStream;
955 #[cfg(target_os = "fuchsia")]
956 type SynchronousProxy = DebianGuestManagerSynchronousProxy;
957
958 const DEBUG_NAME: &'static str = "fuchsia.virtualization.DebianGuestManager";
959}
960impl fidl::endpoints::DiscoverableProtocolMarker for DebianGuestManagerMarker {}
961
962pub trait DebianGuestManagerProxyInterface: Send + Sync {
963 type LaunchResponseFut: std::future::Future<Output = Result<GuestManagerLaunchResult, fidl::Error>>
964 + Send;
965 fn r#launch(
966 &self,
967 guest_config: GuestConfig,
968 controller: fidl::endpoints::ServerEnd<GuestMarker>,
969 ) -> Self::LaunchResponseFut;
970 type ForceShutdownResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
971 fn r#force_shutdown(&self) -> Self::ForceShutdownResponseFut;
972 type ConnectResponseFut: std::future::Future<Output = Result<GuestManagerConnectResult, fidl::Error>>
973 + Send;
974 fn r#connect(
975 &self,
976 controller: fidl::endpoints::ServerEnd<GuestMarker>,
977 ) -> Self::ConnectResponseFut;
978 type GetInfoResponseFut: std::future::Future<Output = Result<GuestInfo, fidl::Error>> + Send;
979 fn r#get_info(&self) -> Self::GetInfoResponseFut;
980}
981#[derive(Debug)]
982#[cfg(target_os = "fuchsia")]
983pub struct DebianGuestManagerSynchronousProxy {
984 client: fidl::client::sync::Client,
985}
986
987#[cfg(target_os = "fuchsia")]
988impl fidl::endpoints::SynchronousProxy for DebianGuestManagerSynchronousProxy {
989 type Proxy = DebianGuestManagerProxy;
990 type Protocol = DebianGuestManagerMarker;
991
992 fn from_channel(inner: fidl::Channel) -> Self {
993 Self::new(inner)
994 }
995
996 fn into_channel(self) -> fidl::Channel {
997 self.client.into_channel()
998 }
999
1000 fn as_channel(&self) -> &fidl::Channel {
1001 self.client.as_channel()
1002 }
1003}
1004
1005#[cfg(target_os = "fuchsia")]
1006impl DebianGuestManagerSynchronousProxy {
1007 pub fn new(channel: fidl::Channel) -> Self {
1008 let protocol_name =
1009 <DebianGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1010 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1011 }
1012
1013 pub fn into_channel(self) -> fidl::Channel {
1014 self.client.into_channel()
1015 }
1016
1017 pub fn wait_for_event(
1020 &self,
1021 deadline: zx::MonotonicInstant,
1022 ) -> Result<DebianGuestManagerEvent, fidl::Error> {
1023 DebianGuestManagerEvent::decode(self.client.wait_for_event(deadline)?)
1024 }
1025
1026 pub fn r#launch(
1035 &self,
1036 mut guest_config: GuestConfig,
1037 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
1038 ___deadline: zx::MonotonicInstant,
1039 ) -> Result<GuestManagerLaunchResult, fidl::Error> {
1040 let _response =
1041 self.client.send_query::<GuestManagerLaunchRequest, fidl::encoding::ResultType<
1042 fidl::encoding::EmptyStruct,
1043 GuestManagerError,
1044 >>(
1045 (&mut guest_config, controller),
1046 0x394a2e29f750323e,
1047 fidl::encoding::DynamicFlags::empty(),
1048 ___deadline,
1049 )?;
1050 Ok(_response.map(|x| x))
1051 }
1052
1053 pub fn r#force_shutdown(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
1056 let _response =
1057 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
1058 (),
1059 0x3ad9a012982f872d,
1060 fidl::encoding::DynamicFlags::empty(),
1061 ___deadline,
1062 )?;
1063 Ok(_response)
1064 }
1065
1066 pub fn r#connect(
1072 &self,
1073 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
1074 ___deadline: zx::MonotonicInstant,
1075 ) -> Result<GuestManagerConnectResult, fidl::Error> {
1076 let _response =
1077 self.client.send_query::<GuestManagerConnectRequest, fidl::encoding::ResultType<
1078 fidl::encoding::EmptyStruct,
1079 GuestManagerError,
1080 >>(
1081 (controller,),
1082 0x4e489076e3bb15b4,
1083 fidl::encoding::DynamicFlags::empty(),
1084 ___deadline,
1085 )?;
1086 Ok(_response.map(|x| x))
1087 }
1088
1089 pub fn r#get_info(&self, ___deadline: zx::MonotonicInstant) -> Result<GuestInfo, fidl::Error> {
1091 let _response =
1092 self.client.send_query::<fidl::encoding::EmptyPayload, GuestManagerGetInfoResponse>(
1093 (),
1094 0x76892614aea695dc,
1095 fidl::encoding::DynamicFlags::empty(),
1096 ___deadline,
1097 )?;
1098 Ok(_response.guest_info)
1099 }
1100}
1101
1102#[cfg(target_os = "fuchsia")]
1103impl From<DebianGuestManagerSynchronousProxy> for zx::Handle {
1104 fn from(value: DebianGuestManagerSynchronousProxy) -> Self {
1105 value.into_channel().into()
1106 }
1107}
1108
1109#[cfg(target_os = "fuchsia")]
1110impl From<fidl::Channel> for DebianGuestManagerSynchronousProxy {
1111 fn from(value: fidl::Channel) -> Self {
1112 Self::new(value)
1113 }
1114}
1115
1116#[derive(Debug, Clone)]
1117pub struct DebianGuestManagerProxy {
1118 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1119}
1120
1121impl fidl::endpoints::Proxy for DebianGuestManagerProxy {
1122 type Protocol = DebianGuestManagerMarker;
1123
1124 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1125 Self::new(inner)
1126 }
1127
1128 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1129 self.client.into_channel().map_err(|client| Self { client })
1130 }
1131
1132 fn as_channel(&self) -> &::fidl::AsyncChannel {
1133 self.client.as_channel()
1134 }
1135}
1136
1137impl DebianGuestManagerProxy {
1138 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1140 let protocol_name =
1141 <DebianGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1142 Self { client: fidl::client::Client::new(channel, protocol_name) }
1143 }
1144
1145 pub fn take_event_stream(&self) -> DebianGuestManagerEventStream {
1151 DebianGuestManagerEventStream { event_receiver: self.client.take_event_receiver() }
1152 }
1153
1154 pub fn r#launch(
1163 &self,
1164 mut guest_config: GuestConfig,
1165 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
1166 ) -> fidl::client::QueryResponseFut<
1167 GuestManagerLaunchResult,
1168 fidl::encoding::DefaultFuchsiaResourceDialect,
1169 > {
1170 DebianGuestManagerProxyInterface::r#launch(self, guest_config, controller)
1171 }
1172
1173 pub fn r#force_shutdown(
1176 &self,
1177 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1178 DebianGuestManagerProxyInterface::r#force_shutdown(self)
1179 }
1180
1181 pub fn r#connect(
1187 &self,
1188 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
1189 ) -> fidl::client::QueryResponseFut<
1190 GuestManagerConnectResult,
1191 fidl::encoding::DefaultFuchsiaResourceDialect,
1192 > {
1193 DebianGuestManagerProxyInterface::r#connect(self, controller)
1194 }
1195
1196 pub fn r#get_info(
1198 &self,
1199 ) -> fidl::client::QueryResponseFut<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
1200 {
1201 DebianGuestManagerProxyInterface::r#get_info(self)
1202 }
1203}
1204
1205impl DebianGuestManagerProxyInterface for DebianGuestManagerProxy {
1206 type LaunchResponseFut = fidl::client::QueryResponseFut<
1207 GuestManagerLaunchResult,
1208 fidl::encoding::DefaultFuchsiaResourceDialect,
1209 >;
1210 fn r#launch(
1211 &self,
1212 mut guest_config: GuestConfig,
1213 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
1214 ) -> Self::LaunchResponseFut {
1215 fn _decode(
1216 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1217 ) -> Result<GuestManagerLaunchResult, fidl::Error> {
1218 let _response = fidl::client::decode_transaction_body::<
1219 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestManagerError>,
1220 fidl::encoding::DefaultFuchsiaResourceDialect,
1221 0x394a2e29f750323e,
1222 >(_buf?)?;
1223 Ok(_response.map(|x| x))
1224 }
1225 self.client.send_query_and_decode::<GuestManagerLaunchRequest, GuestManagerLaunchResult>(
1226 (&mut guest_config, controller),
1227 0x394a2e29f750323e,
1228 fidl::encoding::DynamicFlags::empty(),
1229 _decode,
1230 )
1231 }
1232
1233 type ForceShutdownResponseFut =
1234 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1235 fn r#force_shutdown(&self) -> Self::ForceShutdownResponseFut {
1236 fn _decode(
1237 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1238 ) -> Result<(), fidl::Error> {
1239 let _response = fidl::client::decode_transaction_body::<
1240 fidl::encoding::EmptyPayload,
1241 fidl::encoding::DefaultFuchsiaResourceDialect,
1242 0x3ad9a012982f872d,
1243 >(_buf?)?;
1244 Ok(_response)
1245 }
1246 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1247 (),
1248 0x3ad9a012982f872d,
1249 fidl::encoding::DynamicFlags::empty(),
1250 _decode,
1251 )
1252 }
1253
1254 type ConnectResponseFut = fidl::client::QueryResponseFut<
1255 GuestManagerConnectResult,
1256 fidl::encoding::DefaultFuchsiaResourceDialect,
1257 >;
1258 fn r#connect(
1259 &self,
1260 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
1261 ) -> Self::ConnectResponseFut {
1262 fn _decode(
1263 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1264 ) -> Result<GuestManagerConnectResult, fidl::Error> {
1265 let _response = fidl::client::decode_transaction_body::<
1266 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestManagerError>,
1267 fidl::encoding::DefaultFuchsiaResourceDialect,
1268 0x4e489076e3bb15b4,
1269 >(_buf?)?;
1270 Ok(_response.map(|x| x))
1271 }
1272 self.client.send_query_and_decode::<GuestManagerConnectRequest, GuestManagerConnectResult>(
1273 (controller,),
1274 0x4e489076e3bb15b4,
1275 fidl::encoding::DynamicFlags::empty(),
1276 _decode,
1277 )
1278 }
1279
1280 type GetInfoResponseFut =
1281 fidl::client::QueryResponseFut<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
1282 fn r#get_info(&self) -> Self::GetInfoResponseFut {
1283 fn _decode(
1284 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1285 ) -> Result<GuestInfo, fidl::Error> {
1286 let _response = fidl::client::decode_transaction_body::<
1287 GuestManagerGetInfoResponse,
1288 fidl::encoding::DefaultFuchsiaResourceDialect,
1289 0x76892614aea695dc,
1290 >(_buf?)?;
1291 Ok(_response.guest_info)
1292 }
1293 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GuestInfo>(
1294 (),
1295 0x76892614aea695dc,
1296 fidl::encoding::DynamicFlags::empty(),
1297 _decode,
1298 )
1299 }
1300}
1301
1302pub struct DebianGuestManagerEventStream {
1303 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1304}
1305
1306impl std::marker::Unpin for DebianGuestManagerEventStream {}
1307
1308impl futures::stream::FusedStream for DebianGuestManagerEventStream {
1309 fn is_terminated(&self) -> bool {
1310 self.event_receiver.is_terminated()
1311 }
1312}
1313
1314impl futures::Stream for DebianGuestManagerEventStream {
1315 type Item = Result<DebianGuestManagerEvent, fidl::Error>;
1316
1317 fn poll_next(
1318 mut self: std::pin::Pin<&mut Self>,
1319 cx: &mut std::task::Context<'_>,
1320 ) -> std::task::Poll<Option<Self::Item>> {
1321 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1322 &mut self.event_receiver,
1323 cx
1324 )?) {
1325 Some(buf) => std::task::Poll::Ready(Some(DebianGuestManagerEvent::decode(buf))),
1326 None => std::task::Poll::Ready(None),
1327 }
1328 }
1329}
1330
1331#[derive(Debug)]
1332pub enum DebianGuestManagerEvent {}
1333
1334impl DebianGuestManagerEvent {
1335 fn decode(
1337 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1338 ) -> Result<DebianGuestManagerEvent, fidl::Error> {
1339 let (bytes, _handles) = buf.split_mut();
1340 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1341 debug_assert_eq!(tx_header.tx_id, 0);
1342 match tx_header.ordinal {
1343 _ => Err(fidl::Error::UnknownOrdinal {
1344 ordinal: tx_header.ordinal,
1345 protocol_name:
1346 <DebianGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1347 }),
1348 }
1349 }
1350}
1351
1352pub struct DebianGuestManagerRequestStream {
1354 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1355 is_terminated: bool,
1356}
1357
1358impl std::marker::Unpin for DebianGuestManagerRequestStream {}
1359
1360impl futures::stream::FusedStream for DebianGuestManagerRequestStream {
1361 fn is_terminated(&self) -> bool {
1362 self.is_terminated
1363 }
1364}
1365
1366impl fidl::endpoints::RequestStream for DebianGuestManagerRequestStream {
1367 type Protocol = DebianGuestManagerMarker;
1368 type ControlHandle = DebianGuestManagerControlHandle;
1369
1370 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1371 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1372 }
1373
1374 fn control_handle(&self) -> Self::ControlHandle {
1375 DebianGuestManagerControlHandle { inner: self.inner.clone() }
1376 }
1377
1378 fn into_inner(
1379 self,
1380 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1381 {
1382 (self.inner, self.is_terminated)
1383 }
1384
1385 fn from_inner(
1386 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1387 is_terminated: bool,
1388 ) -> Self {
1389 Self { inner, is_terminated }
1390 }
1391}
1392
1393impl futures::Stream for DebianGuestManagerRequestStream {
1394 type Item = Result<DebianGuestManagerRequest, fidl::Error>;
1395
1396 fn poll_next(
1397 mut self: std::pin::Pin<&mut Self>,
1398 cx: &mut std::task::Context<'_>,
1399 ) -> std::task::Poll<Option<Self::Item>> {
1400 let this = &mut *self;
1401 if this.inner.check_shutdown(cx) {
1402 this.is_terminated = true;
1403 return std::task::Poll::Ready(None);
1404 }
1405 if this.is_terminated {
1406 panic!("polled DebianGuestManagerRequestStream after completion");
1407 }
1408 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1409 |bytes, handles| {
1410 match this.inner.channel().read_etc(cx, bytes, handles) {
1411 std::task::Poll::Ready(Ok(())) => {}
1412 std::task::Poll::Pending => return std::task::Poll::Pending,
1413 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1414 this.is_terminated = true;
1415 return std::task::Poll::Ready(None);
1416 }
1417 std::task::Poll::Ready(Err(e)) => {
1418 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1419 e.into(),
1420 ))))
1421 }
1422 }
1423
1424 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1426
1427 std::task::Poll::Ready(Some(match header.ordinal {
1428 0x394a2e29f750323e => {
1429 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1430 let mut req = fidl::new_empty!(GuestManagerLaunchRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1431 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestManagerLaunchRequest>(&header, _body_bytes, handles, &mut req)?;
1432 let control_handle = DebianGuestManagerControlHandle {
1433 inner: this.inner.clone(),
1434 };
1435 Ok(DebianGuestManagerRequest::Launch {guest_config: req.guest_config,
1436controller: req.controller,
1437
1438 responder: DebianGuestManagerLaunchResponder {
1439 control_handle: std::mem::ManuallyDrop::new(control_handle),
1440 tx_id: header.tx_id,
1441 },
1442 })
1443 }
1444 0x3ad9a012982f872d => {
1445 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1446 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1447 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1448 let control_handle = DebianGuestManagerControlHandle {
1449 inner: this.inner.clone(),
1450 };
1451 Ok(DebianGuestManagerRequest::ForceShutdown {
1452 responder: DebianGuestManagerForceShutdownResponder {
1453 control_handle: std::mem::ManuallyDrop::new(control_handle),
1454 tx_id: header.tx_id,
1455 },
1456 })
1457 }
1458 0x4e489076e3bb15b4 => {
1459 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1460 let mut req = fidl::new_empty!(GuestManagerConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1461 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestManagerConnectRequest>(&header, _body_bytes, handles, &mut req)?;
1462 let control_handle = DebianGuestManagerControlHandle {
1463 inner: this.inner.clone(),
1464 };
1465 Ok(DebianGuestManagerRequest::Connect {controller: req.controller,
1466
1467 responder: DebianGuestManagerConnectResponder {
1468 control_handle: std::mem::ManuallyDrop::new(control_handle),
1469 tx_id: header.tx_id,
1470 },
1471 })
1472 }
1473 0x76892614aea695dc => {
1474 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1475 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1476 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1477 let control_handle = DebianGuestManagerControlHandle {
1478 inner: this.inner.clone(),
1479 };
1480 Ok(DebianGuestManagerRequest::GetInfo {
1481 responder: DebianGuestManagerGetInfoResponder {
1482 control_handle: std::mem::ManuallyDrop::new(control_handle),
1483 tx_id: header.tx_id,
1484 },
1485 })
1486 }
1487 _ => Err(fidl::Error::UnknownOrdinal {
1488 ordinal: header.ordinal,
1489 protocol_name: <DebianGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1490 }),
1491 }))
1492 },
1493 )
1494 }
1495}
1496
1497#[derive(Debug)]
1498pub enum DebianGuestManagerRequest {
1499 Launch {
1508 guest_config: GuestConfig,
1509 controller: fidl::endpoints::ServerEnd<GuestMarker>,
1510 responder: DebianGuestManagerLaunchResponder,
1511 },
1512 ForceShutdown { responder: DebianGuestManagerForceShutdownResponder },
1515 Connect {
1521 controller: fidl::endpoints::ServerEnd<GuestMarker>,
1522 responder: DebianGuestManagerConnectResponder,
1523 },
1524 GetInfo { responder: DebianGuestManagerGetInfoResponder },
1526}
1527
1528impl DebianGuestManagerRequest {
1529 #[allow(irrefutable_let_patterns)]
1530 pub fn into_launch(
1531 self,
1532 ) -> Option<(
1533 GuestConfig,
1534 fidl::endpoints::ServerEnd<GuestMarker>,
1535 DebianGuestManagerLaunchResponder,
1536 )> {
1537 if let DebianGuestManagerRequest::Launch { guest_config, controller, responder } = self {
1538 Some((guest_config, controller, responder))
1539 } else {
1540 None
1541 }
1542 }
1543
1544 #[allow(irrefutable_let_patterns)]
1545 pub fn into_force_shutdown(self) -> Option<(DebianGuestManagerForceShutdownResponder)> {
1546 if let DebianGuestManagerRequest::ForceShutdown { responder } = self {
1547 Some((responder))
1548 } else {
1549 None
1550 }
1551 }
1552
1553 #[allow(irrefutable_let_patterns)]
1554 pub fn into_connect(
1555 self,
1556 ) -> Option<(fidl::endpoints::ServerEnd<GuestMarker>, DebianGuestManagerConnectResponder)> {
1557 if let DebianGuestManagerRequest::Connect { controller, responder } = self {
1558 Some((controller, responder))
1559 } else {
1560 None
1561 }
1562 }
1563
1564 #[allow(irrefutable_let_patterns)]
1565 pub fn into_get_info(self) -> Option<(DebianGuestManagerGetInfoResponder)> {
1566 if let DebianGuestManagerRequest::GetInfo { responder } = self {
1567 Some((responder))
1568 } else {
1569 None
1570 }
1571 }
1572
1573 pub fn method_name(&self) -> &'static str {
1575 match *self {
1576 DebianGuestManagerRequest::Launch { .. } => "launch",
1577 DebianGuestManagerRequest::ForceShutdown { .. } => "force_shutdown",
1578 DebianGuestManagerRequest::Connect { .. } => "connect",
1579 DebianGuestManagerRequest::GetInfo { .. } => "get_info",
1580 }
1581 }
1582}
1583
1584#[derive(Debug, Clone)]
1585pub struct DebianGuestManagerControlHandle {
1586 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1587}
1588
1589impl fidl::endpoints::ControlHandle for DebianGuestManagerControlHandle {
1590 fn shutdown(&self) {
1591 self.inner.shutdown()
1592 }
1593 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1594 self.inner.shutdown_with_epitaph(status)
1595 }
1596
1597 fn is_closed(&self) -> bool {
1598 self.inner.channel().is_closed()
1599 }
1600 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1601 self.inner.channel().on_closed()
1602 }
1603
1604 #[cfg(target_os = "fuchsia")]
1605 fn signal_peer(
1606 &self,
1607 clear_mask: zx::Signals,
1608 set_mask: zx::Signals,
1609 ) -> Result<(), zx_status::Status> {
1610 use fidl::Peered;
1611 self.inner.channel().signal_peer(clear_mask, set_mask)
1612 }
1613}
1614
1615impl DebianGuestManagerControlHandle {}
1616
1617#[must_use = "FIDL methods require a response to be sent"]
1618#[derive(Debug)]
1619pub struct DebianGuestManagerLaunchResponder {
1620 control_handle: std::mem::ManuallyDrop<DebianGuestManagerControlHandle>,
1621 tx_id: u32,
1622}
1623
1624impl std::ops::Drop for DebianGuestManagerLaunchResponder {
1628 fn drop(&mut self) {
1629 self.control_handle.shutdown();
1630 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1632 }
1633}
1634
1635impl fidl::endpoints::Responder for DebianGuestManagerLaunchResponder {
1636 type ControlHandle = DebianGuestManagerControlHandle;
1637
1638 fn control_handle(&self) -> &DebianGuestManagerControlHandle {
1639 &self.control_handle
1640 }
1641
1642 fn drop_without_shutdown(mut self) {
1643 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1645 std::mem::forget(self);
1647 }
1648}
1649
1650impl DebianGuestManagerLaunchResponder {
1651 pub fn send(self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
1655 let _result = self.send_raw(result);
1656 if _result.is_err() {
1657 self.control_handle.shutdown();
1658 }
1659 self.drop_without_shutdown();
1660 _result
1661 }
1662
1663 pub fn send_no_shutdown_on_err(
1665 self,
1666 mut result: Result<(), GuestManagerError>,
1667 ) -> Result<(), fidl::Error> {
1668 let _result = self.send_raw(result);
1669 self.drop_without_shutdown();
1670 _result
1671 }
1672
1673 fn send_raw(&self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
1674 self.control_handle.inner.send::<fidl::encoding::ResultType<
1675 fidl::encoding::EmptyStruct,
1676 GuestManagerError,
1677 >>(
1678 result,
1679 self.tx_id,
1680 0x394a2e29f750323e,
1681 fidl::encoding::DynamicFlags::empty(),
1682 )
1683 }
1684}
1685
1686#[must_use = "FIDL methods require a response to be sent"]
1687#[derive(Debug)]
1688pub struct DebianGuestManagerForceShutdownResponder {
1689 control_handle: std::mem::ManuallyDrop<DebianGuestManagerControlHandle>,
1690 tx_id: u32,
1691}
1692
1693impl std::ops::Drop for DebianGuestManagerForceShutdownResponder {
1697 fn drop(&mut self) {
1698 self.control_handle.shutdown();
1699 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1701 }
1702}
1703
1704impl fidl::endpoints::Responder for DebianGuestManagerForceShutdownResponder {
1705 type ControlHandle = DebianGuestManagerControlHandle;
1706
1707 fn control_handle(&self) -> &DebianGuestManagerControlHandle {
1708 &self.control_handle
1709 }
1710
1711 fn drop_without_shutdown(mut self) {
1712 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1714 std::mem::forget(self);
1716 }
1717}
1718
1719impl DebianGuestManagerForceShutdownResponder {
1720 pub fn send(self) -> Result<(), fidl::Error> {
1724 let _result = self.send_raw();
1725 if _result.is_err() {
1726 self.control_handle.shutdown();
1727 }
1728 self.drop_without_shutdown();
1729 _result
1730 }
1731
1732 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1734 let _result = self.send_raw();
1735 self.drop_without_shutdown();
1736 _result
1737 }
1738
1739 fn send_raw(&self) -> Result<(), fidl::Error> {
1740 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1741 (),
1742 self.tx_id,
1743 0x3ad9a012982f872d,
1744 fidl::encoding::DynamicFlags::empty(),
1745 )
1746 }
1747}
1748
1749#[must_use = "FIDL methods require a response to be sent"]
1750#[derive(Debug)]
1751pub struct DebianGuestManagerConnectResponder {
1752 control_handle: std::mem::ManuallyDrop<DebianGuestManagerControlHandle>,
1753 tx_id: u32,
1754}
1755
1756impl std::ops::Drop for DebianGuestManagerConnectResponder {
1760 fn drop(&mut self) {
1761 self.control_handle.shutdown();
1762 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1764 }
1765}
1766
1767impl fidl::endpoints::Responder for DebianGuestManagerConnectResponder {
1768 type ControlHandle = DebianGuestManagerControlHandle;
1769
1770 fn control_handle(&self) -> &DebianGuestManagerControlHandle {
1771 &self.control_handle
1772 }
1773
1774 fn drop_without_shutdown(mut self) {
1775 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1777 std::mem::forget(self);
1779 }
1780}
1781
1782impl DebianGuestManagerConnectResponder {
1783 pub fn send(self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
1787 let _result = self.send_raw(result);
1788 if _result.is_err() {
1789 self.control_handle.shutdown();
1790 }
1791 self.drop_without_shutdown();
1792 _result
1793 }
1794
1795 pub fn send_no_shutdown_on_err(
1797 self,
1798 mut result: Result<(), GuestManagerError>,
1799 ) -> Result<(), fidl::Error> {
1800 let _result = self.send_raw(result);
1801 self.drop_without_shutdown();
1802 _result
1803 }
1804
1805 fn send_raw(&self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
1806 self.control_handle.inner.send::<fidl::encoding::ResultType<
1807 fidl::encoding::EmptyStruct,
1808 GuestManagerError,
1809 >>(
1810 result,
1811 self.tx_id,
1812 0x4e489076e3bb15b4,
1813 fidl::encoding::DynamicFlags::empty(),
1814 )
1815 }
1816}
1817
1818#[must_use = "FIDL methods require a response to be sent"]
1819#[derive(Debug)]
1820pub struct DebianGuestManagerGetInfoResponder {
1821 control_handle: std::mem::ManuallyDrop<DebianGuestManagerControlHandle>,
1822 tx_id: u32,
1823}
1824
1825impl std::ops::Drop for DebianGuestManagerGetInfoResponder {
1829 fn drop(&mut self) {
1830 self.control_handle.shutdown();
1831 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1833 }
1834}
1835
1836impl fidl::endpoints::Responder for DebianGuestManagerGetInfoResponder {
1837 type ControlHandle = DebianGuestManagerControlHandle;
1838
1839 fn control_handle(&self) -> &DebianGuestManagerControlHandle {
1840 &self.control_handle
1841 }
1842
1843 fn drop_without_shutdown(mut self) {
1844 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1846 std::mem::forget(self);
1848 }
1849}
1850
1851impl DebianGuestManagerGetInfoResponder {
1852 pub fn send(self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
1856 let _result = self.send_raw(guest_info);
1857 if _result.is_err() {
1858 self.control_handle.shutdown();
1859 }
1860 self.drop_without_shutdown();
1861 _result
1862 }
1863
1864 pub fn send_no_shutdown_on_err(self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
1866 let _result = self.send_raw(guest_info);
1867 self.drop_without_shutdown();
1868 _result
1869 }
1870
1871 fn send_raw(&self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
1872 self.control_handle.inner.send::<GuestManagerGetInfoResponse>(
1873 (guest_info,),
1874 self.tx_id,
1875 0x76892614aea695dc,
1876 fidl::encoding::DynamicFlags::empty(),
1877 )
1878 }
1879}
1880
1881#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1882pub struct GuestMarker;
1883
1884impl fidl::endpoints::ProtocolMarker for GuestMarker {
1885 type Proxy = GuestProxy;
1886 type RequestStream = GuestRequestStream;
1887 #[cfg(target_os = "fuchsia")]
1888 type SynchronousProxy = GuestSynchronousProxy;
1889
1890 const DEBUG_NAME: &'static str = "fuchsia.virtualization.Guest";
1891}
1892impl fidl::endpoints::DiscoverableProtocolMarker for GuestMarker {}
1893pub type GuestGetConsoleResult = Result<fidl::Socket, GuestError>;
1894pub type GuestGetHostVsockEndpointResult = Result<(), GuestError>;
1895pub type GuestGetBalloonControllerResult = Result<(), GuestError>;
1896pub type GuestGetMemControllerResult = Result<(), GuestError>;
1897
1898pub trait GuestProxyInterface: Send + Sync {
1899 type GetConsoleResponseFut: std::future::Future<Output = Result<GuestGetConsoleResult, fidl::Error>>
1900 + Send;
1901 fn r#get_console(&self) -> Self::GetConsoleResponseFut;
1902 type GetSerialResponseFut: std::future::Future<Output = Result<fidl::Socket, fidl::Error>>
1903 + Send;
1904 fn r#get_serial(&self) -> Self::GetSerialResponseFut;
1905 type GetHostVsockEndpointResponseFut: std::future::Future<Output = Result<GuestGetHostVsockEndpointResult, fidl::Error>>
1906 + Send;
1907 fn r#get_host_vsock_endpoint(
1908 &self,
1909 endpoint: fidl::endpoints::ServerEnd<HostVsockEndpointMarker>,
1910 ) -> Self::GetHostVsockEndpointResponseFut;
1911 type GetBalloonControllerResponseFut: std::future::Future<Output = Result<GuestGetBalloonControllerResult, fidl::Error>>
1912 + Send;
1913 fn r#get_balloon_controller(
1914 &self,
1915 controller: fidl::endpoints::ServerEnd<BalloonControllerMarker>,
1916 ) -> Self::GetBalloonControllerResponseFut;
1917 type GetMemControllerResponseFut: std::future::Future<Output = Result<GuestGetMemControllerResult, fidl::Error>>
1918 + Send;
1919 fn r#get_mem_controller(
1920 &self,
1921 controller: fidl::endpoints::ServerEnd<MemControllerMarker>,
1922 ) -> Self::GetMemControllerResponseFut;
1923}
1924#[derive(Debug)]
1925#[cfg(target_os = "fuchsia")]
1926pub struct GuestSynchronousProxy {
1927 client: fidl::client::sync::Client,
1928}
1929
1930#[cfg(target_os = "fuchsia")]
1931impl fidl::endpoints::SynchronousProxy for GuestSynchronousProxy {
1932 type Proxy = GuestProxy;
1933 type Protocol = GuestMarker;
1934
1935 fn from_channel(inner: fidl::Channel) -> Self {
1936 Self::new(inner)
1937 }
1938
1939 fn into_channel(self) -> fidl::Channel {
1940 self.client.into_channel()
1941 }
1942
1943 fn as_channel(&self) -> &fidl::Channel {
1944 self.client.as_channel()
1945 }
1946}
1947
1948#[cfg(target_os = "fuchsia")]
1949impl GuestSynchronousProxy {
1950 pub fn new(channel: fidl::Channel) -> Self {
1951 let protocol_name = <GuestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1952 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1953 }
1954
1955 pub fn into_channel(self) -> fidl::Channel {
1956 self.client.into_channel()
1957 }
1958
1959 pub fn wait_for_event(
1962 &self,
1963 deadline: zx::MonotonicInstant,
1964 ) -> Result<GuestEvent, fidl::Error> {
1965 GuestEvent::decode(self.client.wait_for_event(deadline)?)
1966 }
1967
1968 pub fn r#get_console(
1976 &self,
1977 ___deadline: zx::MonotonicInstant,
1978 ) -> Result<GuestGetConsoleResult, fidl::Error> {
1979 let _response = self.client.send_query::<
1980 fidl::encoding::EmptyPayload,
1981 fidl::encoding::ResultType<GuestGetConsoleResponse, GuestError>,
1982 >(
1983 (),
1984 0x48cbcecb7793806e,
1985 fidl::encoding::DynamicFlags::empty(),
1986 ___deadline,
1987 )?;
1988 Ok(_response.map(|x| x.socket))
1989 }
1990
1991 pub fn r#get_serial(
1997 &self,
1998 ___deadline: zx::MonotonicInstant,
1999 ) -> Result<fidl::Socket, fidl::Error> {
2000 let _response =
2001 self.client.send_query::<fidl::encoding::EmptyPayload, GuestGetSerialResponse>(
2002 (),
2003 0xcdd541a160d7044,
2004 fidl::encoding::DynamicFlags::empty(),
2005 ___deadline,
2006 )?;
2007 Ok(_response.socket)
2008 }
2009
2010 pub fn r#get_host_vsock_endpoint(
2019 &self,
2020 mut endpoint: fidl::endpoints::ServerEnd<HostVsockEndpointMarker>,
2021 ___deadline: zx::MonotonicInstant,
2022 ) -> Result<GuestGetHostVsockEndpointResult, fidl::Error> {
2023 let _response = self.client.send_query::<
2024 GuestGetHostVsockEndpointRequest,
2025 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
2026 >(
2027 (endpoint,),
2028 0x766e96aeb9c28ed1,
2029 fidl::encoding::DynamicFlags::empty(),
2030 ___deadline,
2031 )?;
2032 Ok(_response.map(|x| x))
2033 }
2034
2035 pub fn r#get_balloon_controller(
2039 &self,
2040 mut controller: fidl::endpoints::ServerEnd<BalloonControllerMarker>,
2041 ___deadline: zx::MonotonicInstant,
2042 ) -> Result<GuestGetBalloonControllerResult, fidl::Error> {
2043 let _response = self.client.send_query::<
2044 GuestGetBalloonControllerRequest,
2045 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
2046 >(
2047 (controller,),
2048 0x7b210bff219ac84e,
2049 fidl::encoding::DynamicFlags::empty(),
2050 ___deadline,
2051 )?;
2052 Ok(_response.map(|x| x))
2053 }
2054
2055 pub fn r#get_mem_controller(
2059 &self,
2060 mut controller: fidl::endpoints::ServerEnd<MemControllerMarker>,
2061 ___deadline: zx::MonotonicInstant,
2062 ) -> Result<GuestGetMemControllerResult, fidl::Error> {
2063 let _response = self.client.send_query::<
2064 GuestGetMemControllerRequest,
2065 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
2066 >(
2067 (controller,),
2068 0x170b19f4b867a01c,
2069 fidl::encoding::DynamicFlags::empty(),
2070 ___deadline,
2071 )?;
2072 Ok(_response.map(|x| x))
2073 }
2074}
2075
2076#[cfg(target_os = "fuchsia")]
2077impl From<GuestSynchronousProxy> for zx::Handle {
2078 fn from(value: GuestSynchronousProxy) -> Self {
2079 value.into_channel().into()
2080 }
2081}
2082
2083#[cfg(target_os = "fuchsia")]
2084impl From<fidl::Channel> for GuestSynchronousProxy {
2085 fn from(value: fidl::Channel) -> Self {
2086 Self::new(value)
2087 }
2088}
2089
2090#[derive(Debug, Clone)]
2091pub struct GuestProxy {
2092 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2093}
2094
2095impl fidl::endpoints::Proxy for GuestProxy {
2096 type Protocol = GuestMarker;
2097
2098 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2099 Self::new(inner)
2100 }
2101
2102 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2103 self.client.into_channel().map_err(|client| Self { client })
2104 }
2105
2106 fn as_channel(&self) -> &::fidl::AsyncChannel {
2107 self.client.as_channel()
2108 }
2109}
2110
2111impl GuestProxy {
2112 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2114 let protocol_name = <GuestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2115 Self { client: fidl::client::Client::new(channel, protocol_name) }
2116 }
2117
2118 pub fn take_event_stream(&self) -> GuestEventStream {
2124 GuestEventStream { event_receiver: self.client.take_event_receiver() }
2125 }
2126
2127 pub fn r#get_console(
2135 &self,
2136 ) -> fidl::client::QueryResponseFut<
2137 GuestGetConsoleResult,
2138 fidl::encoding::DefaultFuchsiaResourceDialect,
2139 > {
2140 GuestProxyInterface::r#get_console(self)
2141 }
2142
2143 pub fn r#get_serial(
2149 &self,
2150 ) -> fidl::client::QueryResponseFut<fidl::Socket, fidl::encoding::DefaultFuchsiaResourceDialect>
2151 {
2152 GuestProxyInterface::r#get_serial(self)
2153 }
2154
2155 pub fn r#get_host_vsock_endpoint(
2164 &self,
2165 mut endpoint: fidl::endpoints::ServerEnd<HostVsockEndpointMarker>,
2166 ) -> fidl::client::QueryResponseFut<
2167 GuestGetHostVsockEndpointResult,
2168 fidl::encoding::DefaultFuchsiaResourceDialect,
2169 > {
2170 GuestProxyInterface::r#get_host_vsock_endpoint(self, endpoint)
2171 }
2172
2173 pub fn r#get_balloon_controller(
2177 &self,
2178 mut controller: fidl::endpoints::ServerEnd<BalloonControllerMarker>,
2179 ) -> fidl::client::QueryResponseFut<
2180 GuestGetBalloonControllerResult,
2181 fidl::encoding::DefaultFuchsiaResourceDialect,
2182 > {
2183 GuestProxyInterface::r#get_balloon_controller(self, controller)
2184 }
2185
2186 pub fn r#get_mem_controller(
2190 &self,
2191 mut controller: fidl::endpoints::ServerEnd<MemControllerMarker>,
2192 ) -> fidl::client::QueryResponseFut<
2193 GuestGetMemControllerResult,
2194 fidl::encoding::DefaultFuchsiaResourceDialect,
2195 > {
2196 GuestProxyInterface::r#get_mem_controller(self, controller)
2197 }
2198}
2199
2200impl GuestProxyInterface for GuestProxy {
2201 type GetConsoleResponseFut = fidl::client::QueryResponseFut<
2202 GuestGetConsoleResult,
2203 fidl::encoding::DefaultFuchsiaResourceDialect,
2204 >;
2205 fn r#get_console(&self) -> Self::GetConsoleResponseFut {
2206 fn _decode(
2207 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2208 ) -> Result<GuestGetConsoleResult, fidl::Error> {
2209 let _response = fidl::client::decode_transaction_body::<
2210 fidl::encoding::ResultType<GuestGetConsoleResponse, GuestError>,
2211 fidl::encoding::DefaultFuchsiaResourceDialect,
2212 0x48cbcecb7793806e,
2213 >(_buf?)?;
2214 Ok(_response.map(|x| x.socket))
2215 }
2216 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GuestGetConsoleResult>(
2217 (),
2218 0x48cbcecb7793806e,
2219 fidl::encoding::DynamicFlags::empty(),
2220 _decode,
2221 )
2222 }
2223
2224 type GetSerialResponseFut =
2225 fidl::client::QueryResponseFut<fidl::Socket, fidl::encoding::DefaultFuchsiaResourceDialect>;
2226 fn r#get_serial(&self) -> Self::GetSerialResponseFut {
2227 fn _decode(
2228 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2229 ) -> Result<fidl::Socket, fidl::Error> {
2230 let _response = fidl::client::decode_transaction_body::<
2231 GuestGetSerialResponse,
2232 fidl::encoding::DefaultFuchsiaResourceDialect,
2233 0xcdd541a160d7044,
2234 >(_buf?)?;
2235 Ok(_response.socket)
2236 }
2237 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Socket>(
2238 (),
2239 0xcdd541a160d7044,
2240 fidl::encoding::DynamicFlags::empty(),
2241 _decode,
2242 )
2243 }
2244
2245 type GetHostVsockEndpointResponseFut = fidl::client::QueryResponseFut<
2246 GuestGetHostVsockEndpointResult,
2247 fidl::encoding::DefaultFuchsiaResourceDialect,
2248 >;
2249 fn r#get_host_vsock_endpoint(
2250 &self,
2251 mut endpoint: fidl::endpoints::ServerEnd<HostVsockEndpointMarker>,
2252 ) -> Self::GetHostVsockEndpointResponseFut {
2253 fn _decode(
2254 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2255 ) -> Result<GuestGetHostVsockEndpointResult, fidl::Error> {
2256 let _response = fidl::client::decode_transaction_body::<
2257 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
2258 fidl::encoding::DefaultFuchsiaResourceDialect,
2259 0x766e96aeb9c28ed1,
2260 >(_buf?)?;
2261 Ok(_response.map(|x| x))
2262 }
2263 self.client.send_query_and_decode::<
2264 GuestGetHostVsockEndpointRequest,
2265 GuestGetHostVsockEndpointResult,
2266 >(
2267 (endpoint,),
2268 0x766e96aeb9c28ed1,
2269 fidl::encoding::DynamicFlags::empty(),
2270 _decode,
2271 )
2272 }
2273
2274 type GetBalloonControllerResponseFut = fidl::client::QueryResponseFut<
2275 GuestGetBalloonControllerResult,
2276 fidl::encoding::DefaultFuchsiaResourceDialect,
2277 >;
2278 fn r#get_balloon_controller(
2279 &self,
2280 mut controller: fidl::endpoints::ServerEnd<BalloonControllerMarker>,
2281 ) -> Self::GetBalloonControllerResponseFut {
2282 fn _decode(
2283 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2284 ) -> Result<GuestGetBalloonControllerResult, fidl::Error> {
2285 let _response = fidl::client::decode_transaction_body::<
2286 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
2287 fidl::encoding::DefaultFuchsiaResourceDialect,
2288 0x7b210bff219ac84e,
2289 >(_buf?)?;
2290 Ok(_response.map(|x| x))
2291 }
2292 self.client.send_query_and_decode::<
2293 GuestGetBalloonControllerRequest,
2294 GuestGetBalloonControllerResult,
2295 >(
2296 (controller,),
2297 0x7b210bff219ac84e,
2298 fidl::encoding::DynamicFlags::empty(),
2299 _decode,
2300 )
2301 }
2302
2303 type GetMemControllerResponseFut = fidl::client::QueryResponseFut<
2304 GuestGetMemControllerResult,
2305 fidl::encoding::DefaultFuchsiaResourceDialect,
2306 >;
2307 fn r#get_mem_controller(
2308 &self,
2309 mut controller: fidl::endpoints::ServerEnd<MemControllerMarker>,
2310 ) -> Self::GetMemControllerResponseFut {
2311 fn _decode(
2312 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2313 ) -> Result<GuestGetMemControllerResult, fidl::Error> {
2314 let _response = fidl::client::decode_transaction_body::<
2315 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
2316 fidl::encoding::DefaultFuchsiaResourceDialect,
2317 0x170b19f4b867a01c,
2318 >(_buf?)?;
2319 Ok(_response.map(|x| x))
2320 }
2321 self.client
2322 .send_query_and_decode::<GuestGetMemControllerRequest, GuestGetMemControllerResult>(
2323 (controller,),
2324 0x170b19f4b867a01c,
2325 fidl::encoding::DynamicFlags::empty(),
2326 _decode,
2327 )
2328 }
2329}
2330
2331pub struct GuestEventStream {
2332 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2333}
2334
2335impl std::marker::Unpin for GuestEventStream {}
2336
2337impl futures::stream::FusedStream for GuestEventStream {
2338 fn is_terminated(&self) -> bool {
2339 self.event_receiver.is_terminated()
2340 }
2341}
2342
2343impl futures::Stream for GuestEventStream {
2344 type Item = Result<GuestEvent, fidl::Error>;
2345
2346 fn poll_next(
2347 mut self: std::pin::Pin<&mut Self>,
2348 cx: &mut std::task::Context<'_>,
2349 ) -> std::task::Poll<Option<Self::Item>> {
2350 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2351 &mut self.event_receiver,
2352 cx
2353 )?) {
2354 Some(buf) => std::task::Poll::Ready(Some(GuestEvent::decode(buf))),
2355 None => std::task::Poll::Ready(None),
2356 }
2357 }
2358}
2359
2360#[derive(Debug)]
2361pub enum GuestEvent {}
2362
2363impl GuestEvent {
2364 fn decode(
2366 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2367 ) -> Result<GuestEvent, fidl::Error> {
2368 let (bytes, _handles) = buf.split_mut();
2369 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2370 debug_assert_eq!(tx_header.tx_id, 0);
2371 match tx_header.ordinal {
2372 _ => Err(fidl::Error::UnknownOrdinal {
2373 ordinal: tx_header.ordinal,
2374 protocol_name: <GuestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2375 }),
2376 }
2377 }
2378}
2379
2380pub struct GuestRequestStream {
2382 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2383 is_terminated: bool,
2384}
2385
2386impl std::marker::Unpin for GuestRequestStream {}
2387
2388impl futures::stream::FusedStream for GuestRequestStream {
2389 fn is_terminated(&self) -> bool {
2390 self.is_terminated
2391 }
2392}
2393
2394impl fidl::endpoints::RequestStream for GuestRequestStream {
2395 type Protocol = GuestMarker;
2396 type ControlHandle = GuestControlHandle;
2397
2398 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2399 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2400 }
2401
2402 fn control_handle(&self) -> Self::ControlHandle {
2403 GuestControlHandle { inner: self.inner.clone() }
2404 }
2405
2406 fn into_inner(
2407 self,
2408 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2409 {
2410 (self.inner, self.is_terminated)
2411 }
2412
2413 fn from_inner(
2414 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2415 is_terminated: bool,
2416 ) -> Self {
2417 Self { inner, is_terminated }
2418 }
2419}
2420
2421impl futures::Stream for GuestRequestStream {
2422 type Item = Result<GuestRequest, fidl::Error>;
2423
2424 fn poll_next(
2425 mut self: std::pin::Pin<&mut Self>,
2426 cx: &mut std::task::Context<'_>,
2427 ) -> std::task::Poll<Option<Self::Item>> {
2428 let this = &mut *self;
2429 if this.inner.check_shutdown(cx) {
2430 this.is_terminated = true;
2431 return std::task::Poll::Ready(None);
2432 }
2433 if this.is_terminated {
2434 panic!("polled GuestRequestStream after completion");
2435 }
2436 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2437 |bytes, handles| {
2438 match this.inner.channel().read_etc(cx, bytes, handles) {
2439 std::task::Poll::Ready(Ok(())) => {}
2440 std::task::Poll::Pending => return std::task::Poll::Pending,
2441 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2442 this.is_terminated = true;
2443 return std::task::Poll::Ready(None);
2444 }
2445 std::task::Poll::Ready(Err(e)) => {
2446 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2447 e.into(),
2448 ))))
2449 }
2450 }
2451
2452 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2454
2455 std::task::Poll::Ready(Some(match header.ordinal {
2456 0x48cbcecb7793806e => {
2457 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2458 let mut req = fidl::new_empty!(
2459 fidl::encoding::EmptyPayload,
2460 fidl::encoding::DefaultFuchsiaResourceDialect
2461 );
2462 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2463 let control_handle = GuestControlHandle { inner: this.inner.clone() };
2464 Ok(GuestRequest::GetConsole {
2465 responder: GuestGetConsoleResponder {
2466 control_handle: std::mem::ManuallyDrop::new(control_handle),
2467 tx_id: header.tx_id,
2468 },
2469 })
2470 }
2471 0xcdd541a160d7044 => {
2472 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2473 let mut req = fidl::new_empty!(
2474 fidl::encoding::EmptyPayload,
2475 fidl::encoding::DefaultFuchsiaResourceDialect
2476 );
2477 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2478 let control_handle = GuestControlHandle { inner: this.inner.clone() };
2479 Ok(GuestRequest::GetSerial {
2480 responder: GuestGetSerialResponder {
2481 control_handle: std::mem::ManuallyDrop::new(control_handle),
2482 tx_id: header.tx_id,
2483 },
2484 })
2485 }
2486 0x766e96aeb9c28ed1 => {
2487 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2488 let mut req = fidl::new_empty!(
2489 GuestGetHostVsockEndpointRequest,
2490 fidl::encoding::DefaultFuchsiaResourceDialect
2491 );
2492 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestGetHostVsockEndpointRequest>(&header, _body_bytes, handles, &mut req)?;
2493 let control_handle = GuestControlHandle { inner: this.inner.clone() };
2494 Ok(GuestRequest::GetHostVsockEndpoint {
2495 endpoint: req.endpoint,
2496
2497 responder: GuestGetHostVsockEndpointResponder {
2498 control_handle: std::mem::ManuallyDrop::new(control_handle),
2499 tx_id: header.tx_id,
2500 },
2501 })
2502 }
2503 0x7b210bff219ac84e => {
2504 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2505 let mut req = fidl::new_empty!(
2506 GuestGetBalloonControllerRequest,
2507 fidl::encoding::DefaultFuchsiaResourceDialect
2508 );
2509 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestGetBalloonControllerRequest>(&header, _body_bytes, handles, &mut req)?;
2510 let control_handle = GuestControlHandle { inner: this.inner.clone() };
2511 Ok(GuestRequest::GetBalloonController {
2512 controller: req.controller,
2513
2514 responder: GuestGetBalloonControllerResponder {
2515 control_handle: std::mem::ManuallyDrop::new(control_handle),
2516 tx_id: header.tx_id,
2517 },
2518 })
2519 }
2520 0x170b19f4b867a01c => {
2521 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2522 let mut req = fidl::new_empty!(
2523 GuestGetMemControllerRequest,
2524 fidl::encoding::DefaultFuchsiaResourceDialect
2525 );
2526 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestGetMemControllerRequest>(&header, _body_bytes, handles, &mut req)?;
2527 let control_handle = GuestControlHandle { inner: this.inner.clone() };
2528 Ok(GuestRequest::GetMemController {
2529 controller: req.controller,
2530
2531 responder: GuestGetMemControllerResponder {
2532 control_handle: std::mem::ManuallyDrop::new(control_handle),
2533 tx_id: header.tx_id,
2534 },
2535 })
2536 }
2537 _ => Err(fidl::Error::UnknownOrdinal {
2538 ordinal: header.ordinal,
2539 protocol_name: <GuestMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2540 }),
2541 }))
2542 },
2543 )
2544 }
2545}
2546
2547#[derive(Debug)]
2551pub enum GuestRequest {
2552 GetConsole { responder: GuestGetConsoleResponder },
2560 GetSerial { responder: GuestGetSerialResponder },
2566 GetHostVsockEndpoint {
2575 endpoint: fidl::endpoints::ServerEnd<HostVsockEndpointMarker>,
2576 responder: GuestGetHostVsockEndpointResponder,
2577 },
2578 GetBalloonController {
2582 controller: fidl::endpoints::ServerEnd<BalloonControllerMarker>,
2583 responder: GuestGetBalloonControllerResponder,
2584 },
2585 GetMemController {
2589 controller: fidl::endpoints::ServerEnd<MemControllerMarker>,
2590 responder: GuestGetMemControllerResponder,
2591 },
2592}
2593
2594impl GuestRequest {
2595 #[allow(irrefutable_let_patterns)]
2596 pub fn into_get_console(self) -> Option<(GuestGetConsoleResponder)> {
2597 if let GuestRequest::GetConsole { responder } = self {
2598 Some((responder))
2599 } else {
2600 None
2601 }
2602 }
2603
2604 #[allow(irrefutable_let_patterns)]
2605 pub fn into_get_serial(self) -> Option<(GuestGetSerialResponder)> {
2606 if let GuestRequest::GetSerial { responder } = self {
2607 Some((responder))
2608 } else {
2609 None
2610 }
2611 }
2612
2613 #[allow(irrefutable_let_patterns)]
2614 pub fn into_get_host_vsock_endpoint(
2615 self,
2616 ) -> Option<(
2617 fidl::endpoints::ServerEnd<HostVsockEndpointMarker>,
2618 GuestGetHostVsockEndpointResponder,
2619 )> {
2620 if let GuestRequest::GetHostVsockEndpoint { endpoint, responder } = self {
2621 Some((endpoint, responder))
2622 } else {
2623 None
2624 }
2625 }
2626
2627 #[allow(irrefutable_let_patterns)]
2628 pub fn into_get_balloon_controller(
2629 self,
2630 ) -> Option<(
2631 fidl::endpoints::ServerEnd<BalloonControllerMarker>,
2632 GuestGetBalloonControllerResponder,
2633 )> {
2634 if let GuestRequest::GetBalloonController { controller, responder } = self {
2635 Some((controller, responder))
2636 } else {
2637 None
2638 }
2639 }
2640
2641 #[allow(irrefutable_let_patterns)]
2642 pub fn into_get_mem_controller(
2643 self,
2644 ) -> Option<(fidl::endpoints::ServerEnd<MemControllerMarker>, GuestGetMemControllerResponder)>
2645 {
2646 if let GuestRequest::GetMemController { controller, responder } = self {
2647 Some((controller, responder))
2648 } else {
2649 None
2650 }
2651 }
2652
2653 pub fn method_name(&self) -> &'static str {
2655 match *self {
2656 GuestRequest::GetConsole { .. } => "get_console",
2657 GuestRequest::GetSerial { .. } => "get_serial",
2658 GuestRequest::GetHostVsockEndpoint { .. } => "get_host_vsock_endpoint",
2659 GuestRequest::GetBalloonController { .. } => "get_balloon_controller",
2660 GuestRequest::GetMemController { .. } => "get_mem_controller",
2661 }
2662 }
2663}
2664
2665#[derive(Debug, Clone)]
2666pub struct GuestControlHandle {
2667 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2668}
2669
2670impl fidl::endpoints::ControlHandle for GuestControlHandle {
2671 fn shutdown(&self) {
2672 self.inner.shutdown()
2673 }
2674 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2675 self.inner.shutdown_with_epitaph(status)
2676 }
2677
2678 fn is_closed(&self) -> bool {
2679 self.inner.channel().is_closed()
2680 }
2681 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2682 self.inner.channel().on_closed()
2683 }
2684
2685 #[cfg(target_os = "fuchsia")]
2686 fn signal_peer(
2687 &self,
2688 clear_mask: zx::Signals,
2689 set_mask: zx::Signals,
2690 ) -> Result<(), zx_status::Status> {
2691 use fidl::Peered;
2692 self.inner.channel().signal_peer(clear_mask, set_mask)
2693 }
2694}
2695
2696impl GuestControlHandle {}
2697
2698#[must_use = "FIDL methods require a response to be sent"]
2699#[derive(Debug)]
2700pub struct GuestGetConsoleResponder {
2701 control_handle: std::mem::ManuallyDrop<GuestControlHandle>,
2702 tx_id: u32,
2703}
2704
2705impl std::ops::Drop for GuestGetConsoleResponder {
2709 fn drop(&mut self) {
2710 self.control_handle.shutdown();
2711 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2713 }
2714}
2715
2716impl fidl::endpoints::Responder for GuestGetConsoleResponder {
2717 type ControlHandle = GuestControlHandle;
2718
2719 fn control_handle(&self) -> &GuestControlHandle {
2720 &self.control_handle
2721 }
2722
2723 fn drop_without_shutdown(mut self) {
2724 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2726 std::mem::forget(self);
2728 }
2729}
2730
2731impl GuestGetConsoleResponder {
2732 pub fn send(self, mut result: Result<fidl::Socket, GuestError>) -> Result<(), fidl::Error> {
2736 let _result = self.send_raw(result);
2737 if _result.is_err() {
2738 self.control_handle.shutdown();
2739 }
2740 self.drop_without_shutdown();
2741 _result
2742 }
2743
2744 pub fn send_no_shutdown_on_err(
2746 self,
2747 mut result: Result<fidl::Socket, GuestError>,
2748 ) -> Result<(), fidl::Error> {
2749 let _result = self.send_raw(result);
2750 self.drop_without_shutdown();
2751 _result
2752 }
2753
2754 fn send_raw(&self, mut result: Result<fidl::Socket, GuestError>) -> Result<(), fidl::Error> {
2755 self.control_handle
2756 .inner
2757 .send::<fidl::encoding::ResultType<GuestGetConsoleResponse, GuestError>>(
2758 result.map(|socket| (socket,)),
2759 self.tx_id,
2760 0x48cbcecb7793806e,
2761 fidl::encoding::DynamicFlags::empty(),
2762 )
2763 }
2764}
2765
2766#[must_use = "FIDL methods require a response to be sent"]
2767#[derive(Debug)]
2768pub struct GuestGetSerialResponder {
2769 control_handle: std::mem::ManuallyDrop<GuestControlHandle>,
2770 tx_id: u32,
2771}
2772
2773impl std::ops::Drop for GuestGetSerialResponder {
2777 fn drop(&mut self) {
2778 self.control_handle.shutdown();
2779 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2781 }
2782}
2783
2784impl fidl::endpoints::Responder for GuestGetSerialResponder {
2785 type ControlHandle = GuestControlHandle;
2786
2787 fn control_handle(&self) -> &GuestControlHandle {
2788 &self.control_handle
2789 }
2790
2791 fn drop_without_shutdown(mut self) {
2792 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2794 std::mem::forget(self);
2796 }
2797}
2798
2799impl GuestGetSerialResponder {
2800 pub fn send(self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
2804 let _result = self.send_raw(socket);
2805 if _result.is_err() {
2806 self.control_handle.shutdown();
2807 }
2808 self.drop_without_shutdown();
2809 _result
2810 }
2811
2812 pub fn send_no_shutdown_on_err(self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
2814 let _result = self.send_raw(socket);
2815 self.drop_without_shutdown();
2816 _result
2817 }
2818
2819 fn send_raw(&self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
2820 self.control_handle.inner.send::<GuestGetSerialResponse>(
2821 (socket,),
2822 self.tx_id,
2823 0xcdd541a160d7044,
2824 fidl::encoding::DynamicFlags::empty(),
2825 )
2826 }
2827}
2828
2829#[must_use = "FIDL methods require a response to be sent"]
2830#[derive(Debug)]
2831pub struct GuestGetHostVsockEndpointResponder {
2832 control_handle: std::mem::ManuallyDrop<GuestControlHandle>,
2833 tx_id: u32,
2834}
2835
2836impl std::ops::Drop for GuestGetHostVsockEndpointResponder {
2840 fn drop(&mut self) {
2841 self.control_handle.shutdown();
2842 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2844 }
2845}
2846
2847impl fidl::endpoints::Responder for GuestGetHostVsockEndpointResponder {
2848 type ControlHandle = GuestControlHandle;
2849
2850 fn control_handle(&self) -> &GuestControlHandle {
2851 &self.control_handle
2852 }
2853
2854 fn drop_without_shutdown(mut self) {
2855 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2857 std::mem::forget(self);
2859 }
2860}
2861
2862impl GuestGetHostVsockEndpointResponder {
2863 pub fn send(self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
2867 let _result = self.send_raw(result);
2868 if _result.is_err() {
2869 self.control_handle.shutdown();
2870 }
2871 self.drop_without_shutdown();
2872 _result
2873 }
2874
2875 pub fn send_no_shutdown_on_err(
2877 self,
2878 mut result: Result<(), GuestError>,
2879 ) -> Result<(), fidl::Error> {
2880 let _result = self.send_raw(result);
2881 self.drop_without_shutdown();
2882 _result
2883 }
2884
2885 fn send_raw(&self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
2886 self.control_handle
2887 .inner
2888 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>>(
2889 result,
2890 self.tx_id,
2891 0x766e96aeb9c28ed1,
2892 fidl::encoding::DynamicFlags::empty(),
2893 )
2894 }
2895}
2896
2897#[must_use = "FIDL methods require a response to be sent"]
2898#[derive(Debug)]
2899pub struct GuestGetBalloonControllerResponder {
2900 control_handle: std::mem::ManuallyDrop<GuestControlHandle>,
2901 tx_id: u32,
2902}
2903
2904impl std::ops::Drop for GuestGetBalloonControllerResponder {
2908 fn drop(&mut self) {
2909 self.control_handle.shutdown();
2910 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2912 }
2913}
2914
2915impl fidl::endpoints::Responder for GuestGetBalloonControllerResponder {
2916 type ControlHandle = GuestControlHandle;
2917
2918 fn control_handle(&self) -> &GuestControlHandle {
2919 &self.control_handle
2920 }
2921
2922 fn drop_without_shutdown(mut self) {
2923 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2925 std::mem::forget(self);
2927 }
2928}
2929
2930impl GuestGetBalloonControllerResponder {
2931 pub fn send(self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
2935 let _result = self.send_raw(result);
2936 if _result.is_err() {
2937 self.control_handle.shutdown();
2938 }
2939 self.drop_without_shutdown();
2940 _result
2941 }
2942
2943 pub fn send_no_shutdown_on_err(
2945 self,
2946 mut result: Result<(), GuestError>,
2947 ) -> Result<(), fidl::Error> {
2948 let _result = self.send_raw(result);
2949 self.drop_without_shutdown();
2950 _result
2951 }
2952
2953 fn send_raw(&self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
2954 self.control_handle
2955 .inner
2956 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>>(
2957 result,
2958 self.tx_id,
2959 0x7b210bff219ac84e,
2960 fidl::encoding::DynamicFlags::empty(),
2961 )
2962 }
2963}
2964
2965#[must_use = "FIDL methods require a response to be sent"]
2966#[derive(Debug)]
2967pub struct GuestGetMemControllerResponder {
2968 control_handle: std::mem::ManuallyDrop<GuestControlHandle>,
2969 tx_id: u32,
2970}
2971
2972impl std::ops::Drop for GuestGetMemControllerResponder {
2976 fn drop(&mut self) {
2977 self.control_handle.shutdown();
2978 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2980 }
2981}
2982
2983impl fidl::endpoints::Responder for GuestGetMemControllerResponder {
2984 type ControlHandle = GuestControlHandle;
2985
2986 fn control_handle(&self) -> &GuestControlHandle {
2987 &self.control_handle
2988 }
2989
2990 fn drop_without_shutdown(mut self) {
2991 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2993 std::mem::forget(self);
2995 }
2996}
2997
2998impl GuestGetMemControllerResponder {
2999 pub fn send(self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
3003 let _result = self.send_raw(result);
3004 if _result.is_err() {
3005 self.control_handle.shutdown();
3006 }
3007 self.drop_without_shutdown();
3008 _result
3009 }
3010
3011 pub fn send_no_shutdown_on_err(
3013 self,
3014 mut result: Result<(), GuestError>,
3015 ) -> Result<(), fidl::Error> {
3016 let _result = self.send_raw(result);
3017 self.drop_without_shutdown();
3018 _result
3019 }
3020
3021 fn send_raw(&self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
3022 self.control_handle
3023 .inner
3024 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>>(
3025 result,
3026 self.tx_id,
3027 0x170b19f4b867a01c,
3028 fidl::encoding::DynamicFlags::empty(),
3029 )
3030 }
3031}
3032
3033#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3034pub struct GuestLifecycleMarker;
3035
3036impl fidl::endpoints::ProtocolMarker for GuestLifecycleMarker {
3037 type Proxy = GuestLifecycleProxy;
3038 type RequestStream = GuestLifecycleRequestStream;
3039 #[cfg(target_os = "fuchsia")]
3040 type SynchronousProxy = GuestLifecycleSynchronousProxy;
3041
3042 const DEBUG_NAME: &'static str = "fuchsia.virtualization.GuestLifecycle";
3043}
3044impl fidl::endpoints::DiscoverableProtocolMarker for GuestLifecycleMarker {}
3045pub type GuestLifecycleCreateResult = Result<(), GuestError>;
3046pub type GuestLifecycleRunResult = Result<(), GuestError>;
3047
3048pub trait GuestLifecycleProxyInterface: Send + Sync {
3049 type CreateResponseFut: std::future::Future<Output = Result<GuestLifecycleCreateResult, fidl::Error>>
3050 + Send;
3051 fn r#create(&self, guest_config: GuestConfig) -> Self::CreateResponseFut;
3052 fn r#bind(&self, guest: fidl::endpoints::ServerEnd<GuestMarker>) -> Result<(), fidl::Error>;
3053 type RunResponseFut: std::future::Future<Output = Result<GuestLifecycleRunResult, fidl::Error>>
3054 + Send;
3055 fn r#run(&self) -> Self::RunResponseFut;
3056 type StopResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3057 fn r#stop(&self) -> Self::StopResponseFut;
3058}
3059#[derive(Debug)]
3060#[cfg(target_os = "fuchsia")]
3061pub struct GuestLifecycleSynchronousProxy {
3062 client: fidl::client::sync::Client,
3063}
3064
3065#[cfg(target_os = "fuchsia")]
3066impl fidl::endpoints::SynchronousProxy for GuestLifecycleSynchronousProxy {
3067 type Proxy = GuestLifecycleProxy;
3068 type Protocol = GuestLifecycleMarker;
3069
3070 fn from_channel(inner: fidl::Channel) -> Self {
3071 Self::new(inner)
3072 }
3073
3074 fn into_channel(self) -> fidl::Channel {
3075 self.client.into_channel()
3076 }
3077
3078 fn as_channel(&self) -> &fidl::Channel {
3079 self.client.as_channel()
3080 }
3081}
3082
3083#[cfg(target_os = "fuchsia")]
3084impl GuestLifecycleSynchronousProxy {
3085 pub fn new(channel: fidl::Channel) -> Self {
3086 let protocol_name = <GuestLifecycleMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3087 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3088 }
3089
3090 pub fn into_channel(self) -> fidl::Channel {
3091 self.client.into_channel()
3092 }
3093
3094 pub fn wait_for_event(
3097 &self,
3098 deadline: zx::MonotonicInstant,
3099 ) -> Result<GuestLifecycleEvent, fidl::Error> {
3100 GuestLifecycleEvent::decode(self.client.wait_for_event(deadline)?)
3101 }
3102
3103 pub fn r#create(
3112 &self,
3113 mut guest_config: GuestConfig,
3114 ___deadline: zx::MonotonicInstant,
3115 ) -> Result<GuestLifecycleCreateResult, fidl::Error> {
3116 let _response = self.client.send_query::<
3117 GuestLifecycleCreateRequest,
3118 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
3119 >(
3120 (&mut guest_config,),
3121 0x152719eed416ed41,
3122 fidl::encoding::DynamicFlags::empty(),
3123 ___deadline,
3124 )?;
3125 Ok(_response.map(|x| x))
3126 }
3127
3128 pub fn r#bind(
3133 &self,
3134 mut guest: fidl::endpoints::ServerEnd<GuestMarker>,
3135 ) -> Result<(), fidl::Error> {
3136 self.client.send::<GuestLifecycleBindRequest>(
3137 (guest,),
3138 0x57dd3e245f9598ed,
3139 fidl::encoding::DynamicFlags::empty(),
3140 )
3141 }
3142
3143 pub fn r#run(
3153 &self,
3154 ___deadline: zx::MonotonicInstant,
3155 ) -> Result<GuestLifecycleRunResult, fidl::Error> {
3156 let _response = self.client.send_query::<
3157 fidl::encoding::EmptyPayload,
3158 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
3159 >(
3160 (),
3161 0x2907fef2ac775657,
3162 fidl::encoding::DynamicFlags::empty(),
3163 ___deadline,
3164 )?;
3165 Ok(_response.map(|x| x))
3166 }
3167
3168 pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
3171 let _response =
3172 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
3173 (),
3174 0x27eef9c535ac8eb4,
3175 fidl::encoding::DynamicFlags::empty(),
3176 ___deadline,
3177 )?;
3178 Ok(_response)
3179 }
3180}
3181
3182#[cfg(target_os = "fuchsia")]
3183impl From<GuestLifecycleSynchronousProxy> for zx::Handle {
3184 fn from(value: GuestLifecycleSynchronousProxy) -> Self {
3185 value.into_channel().into()
3186 }
3187}
3188
3189#[cfg(target_os = "fuchsia")]
3190impl From<fidl::Channel> for GuestLifecycleSynchronousProxy {
3191 fn from(value: fidl::Channel) -> Self {
3192 Self::new(value)
3193 }
3194}
3195
3196#[derive(Debug, Clone)]
3197pub struct GuestLifecycleProxy {
3198 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3199}
3200
3201impl fidl::endpoints::Proxy for GuestLifecycleProxy {
3202 type Protocol = GuestLifecycleMarker;
3203
3204 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3205 Self::new(inner)
3206 }
3207
3208 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3209 self.client.into_channel().map_err(|client| Self { client })
3210 }
3211
3212 fn as_channel(&self) -> &::fidl::AsyncChannel {
3213 self.client.as_channel()
3214 }
3215}
3216
3217impl GuestLifecycleProxy {
3218 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3220 let protocol_name = <GuestLifecycleMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3221 Self { client: fidl::client::Client::new(channel, protocol_name) }
3222 }
3223
3224 pub fn take_event_stream(&self) -> GuestLifecycleEventStream {
3230 GuestLifecycleEventStream { event_receiver: self.client.take_event_receiver() }
3231 }
3232
3233 pub fn r#create(
3242 &self,
3243 mut guest_config: GuestConfig,
3244 ) -> fidl::client::QueryResponseFut<
3245 GuestLifecycleCreateResult,
3246 fidl::encoding::DefaultFuchsiaResourceDialect,
3247 > {
3248 GuestLifecycleProxyInterface::r#create(self, guest_config)
3249 }
3250
3251 pub fn r#bind(
3256 &self,
3257 mut guest: fidl::endpoints::ServerEnd<GuestMarker>,
3258 ) -> Result<(), fidl::Error> {
3259 GuestLifecycleProxyInterface::r#bind(self, guest)
3260 }
3261
3262 pub fn r#run(
3272 &self,
3273 ) -> fidl::client::QueryResponseFut<
3274 GuestLifecycleRunResult,
3275 fidl::encoding::DefaultFuchsiaResourceDialect,
3276 > {
3277 GuestLifecycleProxyInterface::r#run(self)
3278 }
3279
3280 pub fn r#stop(
3283 &self,
3284 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
3285 GuestLifecycleProxyInterface::r#stop(self)
3286 }
3287}
3288
3289impl GuestLifecycleProxyInterface for GuestLifecycleProxy {
3290 type CreateResponseFut = fidl::client::QueryResponseFut<
3291 GuestLifecycleCreateResult,
3292 fidl::encoding::DefaultFuchsiaResourceDialect,
3293 >;
3294 fn r#create(&self, mut guest_config: GuestConfig) -> Self::CreateResponseFut {
3295 fn _decode(
3296 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3297 ) -> Result<GuestLifecycleCreateResult, fidl::Error> {
3298 let _response = fidl::client::decode_transaction_body::<
3299 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
3300 fidl::encoding::DefaultFuchsiaResourceDialect,
3301 0x152719eed416ed41,
3302 >(_buf?)?;
3303 Ok(_response.map(|x| x))
3304 }
3305 self.client
3306 .send_query_and_decode::<GuestLifecycleCreateRequest, GuestLifecycleCreateResult>(
3307 (&mut guest_config,),
3308 0x152719eed416ed41,
3309 fidl::encoding::DynamicFlags::empty(),
3310 _decode,
3311 )
3312 }
3313
3314 fn r#bind(
3315 &self,
3316 mut guest: fidl::endpoints::ServerEnd<GuestMarker>,
3317 ) -> Result<(), fidl::Error> {
3318 self.client.send::<GuestLifecycleBindRequest>(
3319 (guest,),
3320 0x57dd3e245f9598ed,
3321 fidl::encoding::DynamicFlags::empty(),
3322 )
3323 }
3324
3325 type RunResponseFut = fidl::client::QueryResponseFut<
3326 GuestLifecycleRunResult,
3327 fidl::encoding::DefaultFuchsiaResourceDialect,
3328 >;
3329 fn r#run(&self) -> Self::RunResponseFut {
3330 fn _decode(
3331 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3332 ) -> Result<GuestLifecycleRunResult, fidl::Error> {
3333 let _response = fidl::client::decode_transaction_body::<
3334 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>,
3335 fidl::encoding::DefaultFuchsiaResourceDialect,
3336 0x2907fef2ac775657,
3337 >(_buf?)?;
3338 Ok(_response.map(|x| x))
3339 }
3340 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GuestLifecycleRunResult>(
3341 (),
3342 0x2907fef2ac775657,
3343 fidl::encoding::DynamicFlags::empty(),
3344 _decode,
3345 )
3346 }
3347
3348 type StopResponseFut =
3349 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
3350 fn r#stop(&self) -> Self::StopResponseFut {
3351 fn _decode(
3352 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3353 ) -> Result<(), fidl::Error> {
3354 let _response = fidl::client::decode_transaction_body::<
3355 fidl::encoding::EmptyPayload,
3356 fidl::encoding::DefaultFuchsiaResourceDialect,
3357 0x27eef9c535ac8eb4,
3358 >(_buf?)?;
3359 Ok(_response)
3360 }
3361 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
3362 (),
3363 0x27eef9c535ac8eb4,
3364 fidl::encoding::DynamicFlags::empty(),
3365 _decode,
3366 )
3367 }
3368}
3369
3370pub struct GuestLifecycleEventStream {
3371 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3372}
3373
3374impl std::marker::Unpin for GuestLifecycleEventStream {}
3375
3376impl futures::stream::FusedStream for GuestLifecycleEventStream {
3377 fn is_terminated(&self) -> bool {
3378 self.event_receiver.is_terminated()
3379 }
3380}
3381
3382impl futures::Stream for GuestLifecycleEventStream {
3383 type Item = Result<GuestLifecycleEvent, fidl::Error>;
3384
3385 fn poll_next(
3386 mut self: std::pin::Pin<&mut Self>,
3387 cx: &mut std::task::Context<'_>,
3388 ) -> std::task::Poll<Option<Self::Item>> {
3389 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3390 &mut self.event_receiver,
3391 cx
3392 )?) {
3393 Some(buf) => std::task::Poll::Ready(Some(GuestLifecycleEvent::decode(buf))),
3394 None => std::task::Poll::Ready(None),
3395 }
3396 }
3397}
3398
3399#[derive(Debug)]
3400pub enum GuestLifecycleEvent {}
3401
3402impl GuestLifecycleEvent {
3403 fn decode(
3405 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3406 ) -> Result<GuestLifecycleEvent, fidl::Error> {
3407 let (bytes, _handles) = buf.split_mut();
3408 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3409 debug_assert_eq!(tx_header.tx_id, 0);
3410 match tx_header.ordinal {
3411 _ => Err(fidl::Error::UnknownOrdinal {
3412 ordinal: tx_header.ordinal,
3413 protocol_name:
3414 <GuestLifecycleMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3415 }),
3416 }
3417 }
3418}
3419
3420pub struct GuestLifecycleRequestStream {
3422 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3423 is_terminated: bool,
3424}
3425
3426impl std::marker::Unpin for GuestLifecycleRequestStream {}
3427
3428impl futures::stream::FusedStream for GuestLifecycleRequestStream {
3429 fn is_terminated(&self) -> bool {
3430 self.is_terminated
3431 }
3432}
3433
3434impl fidl::endpoints::RequestStream for GuestLifecycleRequestStream {
3435 type Protocol = GuestLifecycleMarker;
3436 type ControlHandle = GuestLifecycleControlHandle;
3437
3438 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3439 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3440 }
3441
3442 fn control_handle(&self) -> Self::ControlHandle {
3443 GuestLifecycleControlHandle { inner: self.inner.clone() }
3444 }
3445
3446 fn into_inner(
3447 self,
3448 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3449 {
3450 (self.inner, self.is_terminated)
3451 }
3452
3453 fn from_inner(
3454 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3455 is_terminated: bool,
3456 ) -> Self {
3457 Self { inner, is_terminated }
3458 }
3459}
3460
3461impl futures::Stream for GuestLifecycleRequestStream {
3462 type Item = Result<GuestLifecycleRequest, fidl::Error>;
3463
3464 fn poll_next(
3465 mut self: std::pin::Pin<&mut Self>,
3466 cx: &mut std::task::Context<'_>,
3467 ) -> std::task::Poll<Option<Self::Item>> {
3468 let this = &mut *self;
3469 if this.inner.check_shutdown(cx) {
3470 this.is_terminated = true;
3471 return std::task::Poll::Ready(None);
3472 }
3473 if this.is_terminated {
3474 panic!("polled GuestLifecycleRequestStream after completion");
3475 }
3476 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3477 |bytes, handles| {
3478 match this.inner.channel().read_etc(cx, bytes, handles) {
3479 std::task::Poll::Ready(Ok(())) => {}
3480 std::task::Poll::Pending => return std::task::Poll::Pending,
3481 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3482 this.is_terminated = true;
3483 return std::task::Poll::Ready(None);
3484 }
3485 std::task::Poll::Ready(Err(e)) => {
3486 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3487 e.into(),
3488 ))))
3489 }
3490 }
3491
3492 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3494
3495 std::task::Poll::Ready(Some(match header.ordinal {
3496 0x152719eed416ed41 => {
3497 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3498 let mut req = fidl::new_empty!(
3499 GuestLifecycleCreateRequest,
3500 fidl::encoding::DefaultFuchsiaResourceDialect
3501 );
3502 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestLifecycleCreateRequest>(&header, _body_bytes, handles, &mut req)?;
3503 let control_handle =
3504 GuestLifecycleControlHandle { inner: this.inner.clone() };
3505 Ok(GuestLifecycleRequest::Create {
3506 guest_config: req.guest_config,
3507
3508 responder: GuestLifecycleCreateResponder {
3509 control_handle: std::mem::ManuallyDrop::new(control_handle),
3510 tx_id: header.tx_id,
3511 },
3512 })
3513 }
3514 0x57dd3e245f9598ed => {
3515 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3516 let mut req = fidl::new_empty!(
3517 GuestLifecycleBindRequest,
3518 fidl::encoding::DefaultFuchsiaResourceDialect
3519 );
3520 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestLifecycleBindRequest>(&header, _body_bytes, handles, &mut req)?;
3521 let control_handle =
3522 GuestLifecycleControlHandle { inner: this.inner.clone() };
3523 Ok(GuestLifecycleRequest::Bind { guest: req.guest, control_handle })
3524 }
3525 0x2907fef2ac775657 => {
3526 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3527 let mut req = fidl::new_empty!(
3528 fidl::encoding::EmptyPayload,
3529 fidl::encoding::DefaultFuchsiaResourceDialect
3530 );
3531 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3532 let control_handle =
3533 GuestLifecycleControlHandle { inner: this.inner.clone() };
3534 Ok(GuestLifecycleRequest::Run {
3535 responder: GuestLifecycleRunResponder {
3536 control_handle: std::mem::ManuallyDrop::new(control_handle),
3537 tx_id: header.tx_id,
3538 },
3539 })
3540 }
3541 0x27eef9c535ac8eb4 => {
3542 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3543 let mut req = fidl::new_empty!(
3544 fidl::encoding::EmptyPayload,
3545 fidl::encoding::DefaultFuchsiaResourceDialect
3546 );
3547 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3548 let control_handle =
3549 GuestLifecycleControlHandle { inner: this.inner.clone() };
3550 Ok(GuestLifecycleRequest::Stop {
3551 responder: GuestLifecycleStopResponder {
3552 control_handle: std::mem::ManuallyDrop::new(control_handle),
3553 tx_id: header.tx_id,
3554 },
3555 })
3556 }
3557 _ => Err(fidl::Error::UnknownOrdinal {
3558 ordinal: header.ordinal,
3559 protocol_name:
3560 <GuestLifecycleMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3561 }),
3562 }))
3563 },
3564 )
3565 }
3566}
3567
3568#[derive(Debug)]
3570pub enum GuestLifecycleRequest {
3571 Create { guest_config: GuestConfig, responder: GuestLifecycleCreateResponder },
3580 Bind {
3585 guest: fidl::endpoints::ServerEnd<GuestMarker>,
3586 control_handle: GuestLifecycleControlHandle,
3587 },
3588 Run { responder: GuestLifecycleRunResponder },
3598 Stop { responder: GuestLifecycleStopResponder },
3601}
3602
3603impl GuestLifecycleRequest {
3604 #[allow(irrefutable_let_patterns)]
3605 pub fn into_create(self) -> Option<(GuestConfig, GuestLifecycleCreateResponder)> {
3606 if let GuestLifecycleRequest::Create { guest_config, responder } = self {
3607 Some((guest_config, responder))
3608 } else {
3609 None
3610 }
3611 }
3612
3613 #[allow(irrefutable_let_patterns)]
3614 pub fn into_bind(
3615 self,
3616 ) -> Option<(fidl::endpoints::ServerEnd<GuestMarker>, GuestLifecycleControlHandle)> {
3617 if let GuestLifecycleRequest::Bind { guest, control_handle } = self {
3618 Some((guest, control_handle))
3619 } else {
3620 None
3621 }
3622 }
3623
3624 #[allow(irrefutable_let_patterns)]
3625 pub fn into_run(self) -> Option<(GuestLifecycleRunResponder)> {
3626 if let GuestLifecycleRequest::Run { responder } = self {
3627 Some((responder))
3628 } else {
3629 None
3630 }
3631 }
3632
3633 #[allow(irrefutable_let_patterns)]
3634 pub fn into_stop(self) -> Option<(GuestLifecycleStopResponder)> {
3635 if let GuestLifecycleRequest::Stop { responder } = self {
3636 Some((responder))
3637 } else {
3638 None
3639 }
3640 }
3641
3642 pub fn method_name(&self) -> &'static str {
3644 match *self {
3645 GuestLifecycleRequest::Create { .. } => "create",
3646 GuestLifecycleRequest::Bind { .. } => "bind",
3647 GuestLifecycleRequest::Run { .. } => "run",
3648 GuestLifecycleRequest::Stop { .. } => "stop",
3649 }
3650 }
3651}
3652
3653#[derive(Debug, Clone)]
3654pub struct GuestLifecycleControlHandle {
3655 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3656}
3657
3658impl fidl::endpoints::ControlHandle for GuestLifecycleControlHandle {
3659 fn shutdown(&self) {
3660 self.inner.shutdown()
3661 }
3662 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3663 self.inner.shutdown_with_epitaph(status)
3664 }
3665
3666 fn is_closed(&self) -> bool {
3667 self.inner.channel().is_closed()
3668 }
3669 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3670 self.inner.channel().on_closed()
3671 }
3672
3673 #[cfg(target_os = "fuchsia")]
3674 fn signal_peer(
3675 &self,
3676 clear_mask: zx::Signals,
3677 set_mask: zx::Signals,
3678 ) -> Result<(), zx_status::Status> {
3679 use fidl::Peered;
3680 self.inner.channel().signal_peer(clear_mask, set_mask)
3681 }
3682}
3683
3684impl GuestLifecycleControlHandle {}
3685
3686#[must_use = "FIDL methods require a response to be sent"]
3687#[derive(Debug)]
3688pub struct GuestLifecycleCreateResponder {
3689 control_handle: std::mem::ManuallyDrop<GuestLifecycleControlHandle>,
3690 tx_id: u32,
3691}
3692
3693impl std::ops::Drop for GuestLifecycleCreateResponder {
3697 fn drop(&mut self) {
3698 self.control_handle.shutdown();
3699 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3701 }
3702}
3703
3704impl fidl::endpoints::Responder for GuestLifecycleCreateResponder {
3705 type ControlHandle = GuestLifecycleControlHandle;
3706
3707 fn control_handle(&self) -> &GuestLifecycleControlHandle {
3708 &self.control_handle
3709 }
3710
3711 fn drop_without_shutdown(mut self) {
3712 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3714 std::mem::forget(self);
3716 }
3717}
3718
3719impl GuestLifecycleCreateResponder {
3720 pub fn send(self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
3724 let _result = self.send_raw(result);
3725 if _result.is_err() {
3726 self.control_handle.shutdown();
3727 }
3728 self.drop_without_shutdown();
3729 _result
3730 }
3731
3732 pub fn send_no_shutdown_on_err(
3734 self,
3735 mut result: Result<(), GuestError>,
3736 ) -> Result<(), fidl::Error> {
3737 let _result = self.send_raw(result);
3738 self.drop_without_shutdown();
3739 _result
3740 }
3741
3742 fn send_raw(&self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
3743 self.control_handle
3744 .inner
3745 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>>(
3746 result,
3747 self.tx_id,
3748 0x152719eed416ed41,
3749 fidl::encoding::DynamicFlags::empty(),
3750 )
3751 }
3752}
3753
3754#[must_use = "FIDL methods require a response to be sent"]
3755#[derive(Debug)]
3756pub struct GuestLifecycleRunResponder {
3757 control_handle: std::mem::ManuallyDrop<GuestLifecycleControlHandle>,
3758 tx_id: u32,
3759}
3760
3761impl std::ops::Drop for GuestLifecycleRunResponder {
3765 fn drop(&mut self) {
3766 self.control_handle.shutdown();
3767 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3769 }
3770}
3771
3772impl fidl::endpoints::Responder for GuestLifecycleRunResponder {
3773 type ControlHandle = GuestLifecycleControlHandle;
3774
3775 fn control_handle(&self) -> &GuestLifecycleControlHandle {
3776 &self.control_handle
3777 }
3778
3779 fn drop_without_shutdown(mut self) {
3780 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3782 std::mem::forget(self);
3784 }
3785}
3786
3787impl GuestLifecycleRunResponder {
3788 pub fn send(self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
3792 let _result = self.send_raw(result);
3793 if _result.is_err() {
3794 self.control_handle.shutdown();
3795 }
3796 self.drop_without_shutdown();
3797 _result
3798 }
3799
3800 pub fn send_no_shutdown_on_err(
3802 self,
3803 mut result: Result<(), GuestError>,
3804 ) -> Result<(), fidl::Error> {
3805 let _result = self.send_raw(result);
3806 self.drop_without_shutdown();
3807 _result
3808 }
3809
3810 fn send_raw(&self, mut result: Result<(), GuestError>) -> Result<(), fidl::Error> {
3811 self.control_handle
3812 .inner
3813 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestError>>(
3814 result,
3815 self.tx_id,
3816 0x2907fef2ac775657,
3817 fidl::encoding::DynamicFlags::empty(),
3818 )
3819 }
3820}
3821
3822#[must_use = "FIDL methods require a response to be sent"]
3823#[derive(Debug)]
3824pub struct GuestLifecycleStopResponder {
3825 control_handle: std::mem::ManuallyDrop<GuestLifecycleControlHandle>,
3826 tx_id: u32,
3827}
3828
3829impl std::ops::Drop for GuestLifecycleStopResponder {
3833 fn drop(&mut self) {
3834 self.control_handle.shutdown();
3835 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3837 }
3838}
3839
3840impl fidl::endpoints::Responder for GuestLifecycleStopResponder {
3841 type ControlHandle = GuestLifecycleControlHandle;
3842
3843 fn control_handle(&self) -> &GuestLifecycleControlHandle {
3844 &self.control_handle
3845 }
3846
3847 fn drop_without_shutdown(mut self) {
3848 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3850 std::mem::forget(self);
3852 }
3853}
3854
3855impl GuestLifecycleStopResponder {
3856 pub fn send(self) -> Result<(), fidl::Error> {
3860 let _result = self.send_raw();
3861 if _result.is_err() {
3862 self.control_handle.shutdown();
3863 }
3864 self.drop_without_shutdown();
3865 _result
3866 }
3867
3868 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3870 let _result = self.send_raw();
3871 self.drop_without_shutdown();
3872 _result
3873 }
3874
3875 fn send_raw(&self) -> Result<(), fidl::Error> {
3876 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3877 (),
3878 self.tx_id,
3879 0x27eef9c535ac8eb4,
3880 fidl::encoding::DynamicFlags::empty(),
3881 )
3882 }
3883}
3884
3885#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3886pub struct GuestManagerMarker;
3887
3888impl fidl::endpoints::ProtocolMarker for GuestManagerMarker {
3889 type Proxy = GuestManagerProxy;
3890 type RequestStream = GuestManagerRequestStream;
3891 #[cfg(target_os = "fuchsia")]
3892 type SynchronousProxy = GuestManagerSynchronousProxy;
3893
3894 const DEBUG_NAME: &'static str = "fuchsia.virtualization.GuestManager";
3895}
3896impl fidl::endpoints::DiscoverableProtocolMarker for GuestManagerMarker {}
3897pub type GuestManagerLaunchResult = Result<(), GuestManagerError>;
3898pub type GuestManagerConnectResult = Result<(), GuestManagerError>;
3899
3900pub trait GuestManagerProxyInterface: Send + Sync {
3901 type LaunchResponseFut: std::future::Future<Output = Result<GuestManagerLaunchResult, fidl::Error>>
3902 + Send;
3903 fn r#launch(
3904 &self,
3905 guest_config: GuestConfig,
3906 controller: fidl::endpoints::ServerEnd<GuestMarker>,
3907 ) -> Self::LaunchResponseFut;
3908 type ForceShutdownResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3909 fn r#force_shutdown(&self) -> Self::ForceShutdownResponseFut;
3910 type ConnectResponseFut: std::future::Future<Output = Result<GuestManagerConnectResult, fidl::Error>>
3911 + Send;
3912 fn r#connect(
3913 &self,
3914 controller: fidl::endpoints::ServerEnd<GuestMarker>,
3915 ) -> Self::ConnectResponseFut;
3916 type GetInfoResponseFut: std::future::Future<Output = Result<GuestInfo, fidl::Error>> + Send;
3917 fn r#get_info(&self) -> Self::GetInfoResponseFut;
3918}
3919#[derive(Debug)]
3920#[cfg(target_os = "fuchsia")]
3921pub struct GuestManagerSynchronousProxy {
3922 client: fidl::client::sync::Client,
3923}
3924
3925#[cfg(target_os = "fuchsia")]
3926impl fidl::endpoints::SynchronousProxy for GuestManagerSynchronousProxy {
3927 type Proxy = GuestManagerProxy;
3928 type Protocol = GuestManagerMarker;
3929
3930 fn from_channel(inner: fidl::Channel) -> Self {
3931 Self::new(inner)
3932 }
3933
3934 fn into_channel(self) -> fidl::Channel {
3935 self.client.into_channel()
3936 }
3937
3938 fn as_channel(&self) -> &fidl::Channel {
3939 self.client.as_channel()
3940 }
3941}
3942
3943#[cfg(target_os = "fuchsia")]
3944impl GuestManagerSynchronousProxy {
3945 pub fn new(channel: fidl::Channel) -> Self {
3946 let protocol_name = <GuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3947 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3948 }
3949
3950 pub fn into_channel(self) -> fidl::Channel {
3951 self.client.into_channel()
3952 }
3953
3954 pub fn wait_for_event(
3957 &self,
3958 deadline: zx::MonotonicInstant,
3959 ) -> Result<GuestManagerEvent, fidl::Error> {
3960 GuestManagerEvent::decode(self.client.wait_for_event(deadline)?)
3961 }
3962
3963 pub fn r#launch(
3972 &self,
3973 mut guest_config: GuestConfig,
3974 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
3975 ___deadline: zx::MonotonicInstant,
3976 ) -> Result<GuestManagerLaunchResult, fidl::Error> {
3977 let _response =
3978 self.client.send_query::<GuestManagerLaunchRequest, fidl::encoding::ResultType<
3979 fidl::encoding::EmptyStruct,
3980 GuestManagerError,
3981 >>(
3982 (&mut guest_config, controller),
3983 0x394a2e29f750323e,
3984 fidl::encoding::DynamicFlags::empty(),
3985 ___deadline,
3986 )?;
3987 Ok(_response.map(|x| x))
3988 }
3989
3990 pub fn r#force_shutdown(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
3993 let _response =
3994 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
3995 (),
3996 0x3ad9a012982f872d,
3997 fidl::encoding::DynamicFlags::empty(),
3998 ___deadline,
3999 )?;
4000 Ok(_response)
4001 }
4002
4003 pub fn r#connect(
4009 &self,
4010 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
4011 ___deadline: zx::MonotonicInstant,
4012 ) -> Result<GuestManagerConnectResult, fidl::Error> {
4013 let _response =
4014 self.client.send_query::<GuestManagerConnectRequest, fidl::encoding::ResultType<
4015 fidl::encoding::EmptyStruct,
4016 GuestManagerError,
4017 >>(
4018 (controller,),
4019 0x4e489076e3bb15b4,
4020 fidl::encoding::DynamicFlags::empty(),
4021 ___deadline,
4022 )?;
4023 Ok(_response.map(|x| x))
4024 }
4025
4026 pub fn r#get_info(&self, ___deadline: zx::MonotonicInstant) -> Result<GuestInfo, fidl::Error> {
4028 let _response =
4029 self.client.send_query::<fidl::encoding::EmptyPayload, GuestManagerGetInfoResponse>(
4030 (),
4031 0x76892614aea695dc,
4032 fidl::encoding::DynamicFlags::empty(),
4033 ___deadline,
4034 )?;
4035 Ok(_response.guest_info)
4036 }
4037}
4038
4039#[cfg(target_os = "fuchsia")]
4040impl From<GuestManagerSynchronousProxy> for zx::Handle {
4041 fn from(value: GuestManagerSynchronousProxy) -> Self {
4042 value.into_channel().into()
4043 }
4044}
4045
4046#[cfg(target_os = "fuchsia")]
4047impl From<fidl::Channel> for GuestManagerSynchronousProxy {
4048 fn from(value: fidl::Channel) -> Self {
4049 Self::new(value)
4050 }
4051}
4052
4053#[derive(Debug, Clone)]
4054pub struct GuestManagerProxy {
4055 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4056}
4057
4058impl fidl::endpoints::Proxy for GuestManagerProxy {
4059 type Protocol = GuestManagerMarker;
4060
4061 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4062 Self::new(inner)
4063 }
4064
4065 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4066 self.client.into_channel().map_err(|client| Self { client })
4067 }
4068
4069 fn as_channel(&self) -> &::fidl::AsyncChannel {
4070 self.client.as_channel()
4071 }
4072}
4073
4074impl GuestManagerProxy {
4075 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4077 let protocol_name = <GuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4078 Self { client: fidl::client::Client::new(channel, protocol_name) }
4079 }
4080
4081 pub fn take_event_stream(&self) -> GuestManagerEventStream {
4087 GuestManagerEventStream { event_receiver: self.client.take_event_receiver() }
4088 }
4089
4090 pub fn r#launch(
4099 &self,
4100 mut guest_config: GuestConfig,
4101 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
4102 ) -> fidl::client::QueryResponseFut<
4103 GuestManagerLaunchResult,
4104 fidl::encoding::DefaultFuchsiaResourceDialect,
4105 > {
4106 GuestManagerProxyInterface::r#launch(self, guest_config, controller)
4107 }
4108
4109 pub fn r#force_shutdown(
4112 &self,
4113 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4114 GuestManagerProxyInterface::r#force_shutdown(self)
4115 }
4116
4117 pub fn r#connect(
4123 &self,
4124 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
4125 ) -> fidl::client::QueryResponseFut<
4126 GuestManagerConnectResult,
4127 fidl::encoding::DefaultFuchsiaResourceDialect,
4128 > {
4129 GuestManagerProxyInterface::r#connect(self, controller)
4130 }
4131
4132 pub fn r#get_info(
4134 &self,
4135 ) -> fidl::client::QueryResponseFut<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
4136 {
4137 GuestManagerProxyInterface::r#get_info(self)
4138 }
4139}
4140
4141impl GuestManagerProxyInterface for GuestManagerProxy {
4142 type LaunchResponseFut = fidl::client::QueryResponseFut<
4143 GuestManagerLaunchResult,
4144 fidl::encoding::DefaultFuchsiaResourceDialect,
4145 >;
4146 fn r#launch(
4147 &self,
4148 mut guest_config: GuestConfig,
4149 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
4150 ) -> Self::LaunchResponseFut {
4151 fn _decode(
4152 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4153 ) -> Result<GuestManagerLaunchResult, fidl::Error> {
4154 let _response = fidl::client::decode_transaction_body::<
4155 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestManagerError>,
4156 fidl::encoding::DefaultFuchsiaResourceDialect,
4157 0x394a2e29f750323e,
4158 >(_buf?)?;
4159 Ok(_response.map(|x| x))
4160 }
4161 self.client.send_query_and_decode::<GuestManagerLaunchRequest, GuestManagerLaunchResult>(
4162 (&mut guest_config, controller),
4163 0x394a2e29f750323e,
4164 fidl::encoding::DynamicFlags::empty(),
4165 _decode,
4166 )
4167 }
4168
4169 type ForceShutdownResponseFut =
4170 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4171 fn r#force_shutdown(&self) -> Self::ForceShutdownResponseFut {
4172 fn _decode(
4173 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4174 ) -> Result<(), fidl::Error> {
4175 let _response = fidl::client::decode_transaction_body::<
4176 fidl::encoding::EmptyPayload,
4177 fidl::encoding::DefaultFuchsiaResourceDialect,
4178 0x3ad9a012982f872d,
4179 >(_buf?)?;
4180 Ok(_response)
4181 }
4182 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
4183 (),
4184 0x3ad9a012982f872d,
4185 fidl::encoding::DynamicFlags::empty(),
4186 _decode,
4187 )
4188 }
4189
4190 type ConnectResponseFut = fidl::client::QueryResponseFut<
4191 GuestManagerConnectResult,
4192 fidl::encoding::DefaultFuchsiaResourceDialect,
4193 >;
4194 fn r#connect(
4195 &self,
4196 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
4197 ) -> Self::ConnectResponseFut {
4198 fn _decode(
4199 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4200 ) -> Result<GuestManagerConnectResult, fidl::Error> {
4201 let _response = fidl::client::decode_transaction_body::<
4202 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestManagerError>,
4203 fidl::encoding::DefaultFuchsiaResourceDialect,
4204 0x4e489076e3bb15b4,
4205 >(_buf?)?;
4206 Ok(_response.map(|x| x))
4207 }
4208 self.client.send_query_and_decode::<GuestManagerConnectRequest, GuestManagerConnectResult>(
4209 (controller,),
4210 0x4e489076e3bb15b4,
4211 fidl::encoding::DynamicFlags::empty(),
4212 _decode,
4213 )
4214 }
4215
4216 type GetInfoResponseFut =
4217 fidl::client::QueryResponseFut<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
4218 fn r#get_info(&self) -> Self::GetInfoResponseFut {
4219 fn _decode(
4220 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4221 ) -> Result<GuestInfo, fidl::Error> {
4222 let _response = fidl::client::decode_transaction_body::<
4223 GuestManagerGetInfoResponse,
4224 fidl::encoding::DefaultFuchsiaResourceDialect,
4225 0x76892614aea695dc,
4226 >(_buf?)?;
4227 Ok(_response.guest_info)
4228 }
4229 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GuestInfo>(
4230 (),
4231 0x76892614aea695dc,
4232 fidl::encoding::DynamicFlags::empty(),
4233 _decode,
4234 )
4235 }
4236}
4237
4238pub struct GuestManagerEventStream {
4239 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4240}
4241
4242impl std::marker::Unpin for GuestManagerEventStream {}
4243
4244impl futures::stream::FusedStream for GuestManagerEventStream {
4245 fn is_terminated(&self) -> bool {
4246 self.event_receiver.is_terminated()
4247 }
4248}
4249
4250impl futures::Stream for GuestManagerEventStream {
4251 type Item = Result<GuestManagerEvent, fidl::Error>;
4252
4253 fn poll_next(
4254 mut self: std::pin::Pin<&mut Self>,
4255 cx: &mut std::task::Context<'_>,
4256 ) -> std::task::Poll<Option<Self::Item>> {
4257 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4258 &mut self.event_receiver,
4259 cx
4260 )?) {
4261 Some(buf) => std::task::Poll::Ready(Some(GuestManagerEvent::decode(buf))),
4262 None => std::task::Poll::Ready(None),
4263 }
4264 }
4265}
4266
4267#[derive(Debug)]
4268pub enum GuestManagerEvent {}
4269
4270impl GuestManagerEvent {
4271 fn decode(
4273 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4274 ) -> Result<GuestManagerEvent, fidl::Error> {
4275 let (bytes, _handles) = buf.split_mut();
4276 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4277 debug_assert_eq!(tx_header.tx_id, 0);
4278 match tx_header.ordinal {
4279 _ => Err(fidl::Error::UnknownOrdinal {
4280 ordinal: tx_header.ordinal,
4281 protocol_name: <GuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4282 }),
4283 }
4284 }
4285}
4286
4287pub struct GuestManagerRequestStream {
4289 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4290 is_terminated: bool,
4291}
4292
4293impl std::marker::Unpin for GuestManagerRequestStream {}
4294
4295impl futures::stream::FusedStream for GuestManagerRequestStream {
4296 fn is_terminated(&self) -> bool {
4297 self.is_terminated
4298 }
4299}
4300
4301impl fidl::endpoints::RequestStream for GuestManagerRequestStream {
4302 type Protocol = GuestManagerMarker;
4303 type ControlHandle = GuestManagerControlHandle;
4304
4305 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4306 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4307 }
4308
4309 fn control_handle(&self) -> Self::ControlHandle {
4310 GuestManagerControlHandle { inner: self.inner.clone() }
4311 }
4312
4313 fn into_inner(
4314 self,
4315 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4316 {
4317 (self.inner, self.is_terminated)
4318 }
4319
4320 fn from_inner(
4321 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4322 is_terminated: bool,
4323 ) -> Self {
4324 Self { inner, is_terminated }
4325 }
4326}
4327
4328impl futures::Stream for GuestManagerRequestStream {
4329 type Item = Result<GuestManagerRequest, fidl::Error>;
4330
4331 fn poll_next(
4332 mut self: std::pin::Pin<&mut Self>,
4333 cx: &mut std::task::Context<'_>,
4334 ) -> std::task::Poll<Option<Self::Item>> {
4335 let this = &mut *self;
4336 if this.inner.check_shutdown(cx) {
4337 this.is_terminated = true;
4338 return std::task::Poll::Ready(None);
4339 }
4340 if this.is_terminated {
4341 panic!("polled GuestManagerRequestStream after completion");
4342 }
4343 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4344 |bytes, handles| {
4345 match this.inner.channel().read_etc(cx, bytes, handles) {
4346 std::task::Poll::Ready(Ok(())) => {}
4347 std::task::Poll::Pending => return std::task::Poll::Pending,
4348 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4349 this.is_terminated = true;
4350 return std::task::Poll::Ready(None);
4351 }
4352 std::task::Poll::Ready(Err(e)) => {
4353 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4354 e.into(),
4355 ))))
4356 }
4357 }
4358
4359 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4361
4362 std::task::Poll::Ready(Some(match header.ordinal {
4363 0x394a2e29f750323e => {
4364 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4365 let mut req = fidl::new_empty!(
4366 GuestManagerLaunchRequest,
4367 fidl::encoding::DefaultFuchsiaResourceDialect
4368 );
4369 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestManagerLaunchRequest>(&header, _body_bytes, handles, &mut req)?;
4370 let control_handle =
4371 GuestManagerControlHandle { inner: this.inner.clone() };
4372 Ok(GuestManagerRequest::Launch {
4373 guest_config: req.guest_config,
4374 controller: req.controller,
4375
4376 responder: GuestManagerLaunchResponder {
4377 control_handle: std::mem::ManuallyDrop::new(control_handle),
4378 tx_id: header.tx_id,
4379 },
4380 })
4381 }
4382 0x3ad9a012982f872d => {
4383 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4384 let mut req = fidl::new_empty!(
4385 fidl::encoding::EmptyPayload,
4386 fidl::encoding::DefaultFuchsiaResourceDialect
4387 );
4388 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4389 let control_handle =
4390 GuestManagerControlHandle { inner: this.inner.clone() };
4391 Ok(GuestManagerRequest::ForceShutdown {
4392 responder: GuestManagerForceShutdownResponder {
4393 control_handle: std::mem::ManuallyDrop::new(control_handle),
4394 tx_id: header.tx_id,
4395 },
4396 })
4397 }
4398 0x4e489076e3bb15b4 => {
4399 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4400 let mut req = fidl::new_empty!(
4401 GuestManagerConnectRequest,
4402 fidl::encoding::DefaultFuchsiaResourceDialect
4403 );
4404 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestManagerConnectRequest>(&header, _body_bytes, handles, &mut req)?;
4405 let control_handle =
4406 GuestManagerControlHandle { inner: this.inner.clone() };
4407 Ok(GuestManagerRequest::Connect {
4408 controller: req.controller,
4409
4410 responder: GuestManagerConnectResponder {
4411 control_handle: std::mem::ManuallyDrop::new(control_handle),
4412 tx_id: header.tx_id,
4413 },
4414 })
4415 }
4416 0x76892614aea695dc => {
4417 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4418 let mut req = fidl::new_empty!(
4419 fidl::encoding::EmptyPayload,
4420 fidl::encoding::DefaultFuchsiaResourceDialect
4421 );
4422 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4423 let control_handle =
4424 GuestManagerControlHandle { inner: this.inner.clone() };
4425 Ok(GuestManagerRequest::GetInfo {
4426 responder: GuestManagerGetInfoResponder {
4427 control_handle: std::mem::ManuallyDrop::new(control_handle),
4428 tx_id: header.tx_id,
4429 },
4430 })
4431 }
4432 _ => Err(fidl::Error::UnknownOrdinal {
4433 ordinal: header.ordinal,
4434 protocol_name:
4435 <GuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4436 }),
4437 }))
4438 },
4439 )
4440 }
4441}
4442
4443#[derive(Debug)]
4444pub enum GuestManagerRequest {
4445 Launch {
4454 guest_config: GuestConfig,
4455 controller: fidl::endpoints::ServerEnd<GuestMarker>,
4456 responder: GuestManagerLaunchResponder,
4457 },
4458 ForceShutdown { responder: GuestManagerForceShutdownResponder },
4461 Connect {
4467 controller: fidl::endpoints::ServerEnd<GuestMarker>,
4468 responder: GuestManagerConnectResponder,
4469 },
4470 GetInfo { responder: GuestManagerGetInfoResponder },
4472}
4473
4474impl GuestManagerRequest {
4475 #[allow(irrefutable_let_patterns)]
4476 pub fn into_launch(
4477 self,
4478 ) -> Option<(GuestConfig, fidl::endpoints::ServerEnd<GuestMarker>, GuestManagerLaunchResponder)>
4479 {
4480 if let GuestManagerRequest::Launch { guest_config, controller, responder } = self {
4481 Some((guest_config, controller, responder))
4482 } else {
4483 None
4484 }
4485 }
4486
4487 #[allow(irrefutable_let_patterns)]
4488 pub fn into_force_shutdown(self) -> Option<(GuestManagerForceShutdownResponder)> {
4489 if let GuestManagerRequest::ForceShutdown { responder } = self {
4490 Some((responder))
4491 } else {
4492 None
4493 }
4494 }
4495
4496 #[allow(irrefutable_let_patterns)]
4497 pub fn into_connect(
4498 self,
4499 ) -> Option<(fidl::endpoints::ServerEnd<GuestMarker>, GuestManagerConnectResponder)> {
4500 if let GuestManagerRequest::Connect { controller, responder } = self {
4501 Some((controller, responder))
4502 } else {
4503 None
4504 }
4505 }
4506
4507 #[allow(irrefutable_let_patterns)]
4508 pub fn into_get_info(self) -> Option<(GuestManagerGetInfoResponder)> {
4509 if let GuestManagerRequest::GetInfo { responder } = self {
4510 Some((responder))
4511 } else {
4512 None
4513 }
4514 }
4515
4516 pub fn method_name(&self) -> &'static str {
4518 match *self {
4519 GuestManagerRequest::Launch { .. } => "launch",
4520 GuestManagerRequest::ForceShutdown { .. } => "force_shutdown",
4521 GuestManagerRequest::Connect { .. } => "connect",
4522 GuestManagerRequest::GetInfo { .. } => "get_info",
4523 }
4524 }
4525}
4526
4527#[derive(Debug, Clone)]
4528pub struct GuestManagerControlHandle {
4529 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4530}
4531
4532impl fidl::endpoints::ControlHandle for GuestManagerControlHandle {
4533 fn shutdown(&self) {
4534 self.inner.shutdown()
4535 }
4536 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4537 self.inner.shutdown_with_epitaph(status)
4538 }
4539
4540 fn is_closed(&self) -> bool {
4541 self.inner.channel().is_closed()
4542 }
4543 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4544 self.inner.channel().on_closed()
4545 }
4546
4547 #[cfg(target_os = "fuchsia")]
4548 fn signal_peer(
4549 &self,
4550 clear_mask: zx::Signals,
4551 set_mask: zx::Signals,
4552 ) -> Result<(), zx_status::Status> {
4553 use fidl::Peered;
4554 self.inner.channel().signal_peer(clear_mask, set_mask)
4555 }
4556}
4557
4558impl GuestManagerControlHandle {}
4559
4560#[must_use = "FIDL methods require a response to be sent"]
4561#[derive(Debug)]
4562pub struct GuestManagerLaunchResponder {
4563 control_handle: std::mem::ManuallyDrop<GuestManagerControlHandle>,
4564 tx_id: u32,
4565}
4566
4567impl std::ops::Drop for GuestManagerLaunchResponder {
4571 fn drop(&mut self) {
4572 self.control_handle.shutdown();
4573 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4575 }
4576}
4577
4578impl fidl::endpoints::Responder for GuestManagerLaunchResponder {
4579 type ControlHandle = GuestManagerControlHandle;
4580
4581 fn control_handle(&self) -> &GuestManagerControlHandle {
4582 &self.control_handle
4583 }
4584
4585 fn drop_without_shutdown(mut self) {
4586 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4588 std::mem::forget(self);
4590 }
4591}
4592
4593impl GuestManagerLaunchResponder {
4594 pub fn send(self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
4598 let _result = self.send_raw(result);
4599 if _result.is_err() {
4600 self.control_handle.shutdown();
4601 }
4602 self.drop_without_shutdown();
4603 _result
4604 }
4605
4606 pub fn send_no_shutdown_on_err(
4608 self,
4609 mut result: Result<(), GuestManagerError>,
4610 ) -> Result<(), fidl::Error> {
4611 let _result = self.send_raw(result);
4612 self.drop_without_shutdown();
4613 _result
4614 }
4615
4616 fn send_raw(&self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
4617 self.control_handle.inner.send::<fidl::encoding::ResultType<
4618 fidl::encoding::EmptyStruct,
4619 GuestManagerError,
4620 >>(
4621 result,
4622 self.tx_id,
4623 0x394a2e29f750323e,
4624 fidl::encoding::DynamicFlags::empty(),
4625 )
4626 }
4627}
4628
4629#[must_use = "FIDL methods require a response to be sent"]
4630#[derive(Debug)]
4631pub struct GuestManagerForceShutdownResponder {
4632 control_handle: std::mem::ManuallyDrop<GuestManagerControlHandle>,
4633 tx_id: u32,
4634}
4635
4636impl std::ops::Drop for GuestManagerForceShutdownResponder {
4640 fn drop(&mut self) {
4641 self.control_handle.shutdown();
4642 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4644 }
4645}
4646
4647impl fidl::endpoints::Responder for GuestManagerForceShutdownResponder {
4648 type ControlHandle = GuestManagerControlHandle;
4649
4650 fn control_handle(&self) -> &GuestManagerControlHandle {
4651 &self.control_handle
4652 }
4653
4654 fn drop_without_shutdown(mut self) {
4655 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4657 std::mem::forget(self);
4659 }
4660}
4661
4662impl GuestManagerForceShutdownResponder {
4663 pub fn send(self) -> Result<(), fidl::Error> {
4667 let _result = self.send_raw();
4668 if _result.is_err() {
4669 self.control_handle.shutdown();
4670 }
4671 self.drop_without_shutdown();
4672 _result
4673 }
4674
4675 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
4677 let _result = self.send_raw();
4678 self.drop_without_shutdown();
4679 _result
4680 }
4681
4682 fn send_raw(&self) -> Result<(), fidl::Error> {
4683 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
4684 (),
4685 self.tx_id,
4686 0x3ad9a012982f872d,
4687 fidl::encoding::DynamicFlags::empty(),
4688 )
4689 }
4690}
4691
4692#[must_use = "FIDL methods require a response to be sent"]
4693#[derive(Debug)]
4694pub struct GuestManagerConnectResponder {
4695 control_handle: std::mem::ManuallyDrop<GuestManagerControlHandle>,
4696 tx_id: u32,
4697}
4698
4699impl std::ops::Drop for GuestManagerConnectResponder {
4703 fn drop(&mut self) {
4704 self.control_handle.shutdown();
4705 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4707 }
4708}
4709
4710impl fidl::endpoints::Responder for GuestManagerConnectResponder {
4711 type ControlHandle = GuestManagerControlHandle;
4712
4713 fn control_handle(&self) -> &GuestManagerControlHandle {
4714 &self.control_handle
4715 }
4716
4717 fn drop_without_shutdown(mut self) {
4718 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4720 std::mem::forget(self);
4722 }
4723}
4724
4725impl GuestManagerConnectResponder {
4726 pub fn send(self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
4730 let _result = self.send_raw(result);
4731 if _result.is_err() {
4732 self.control_handle.shutdown();
4733 }
4734 self.drop_without_shutdown();
4735 _result
4736 }
4737
4738 pub fn send_no_shutdown_on_err(
4740 self,
4741 mut result: Result<(), GuestManagerError>,
4742 ) -> Result<(), fidl::Error> {
4743 let _result = self.send_raw(result);
4744 self.drop_without_shutdown();
4745 _result
4746 }
4747
4748 fn send_raw(&self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
4749 self.control_handle.inner.send::<fidl::encoding::ResultType<
4750 fidl::encoding::EmptyStruct,
4751 GuestManagerError,
4752 >>(
4753 result,
4754 self.tx_id,
4755 0x4e489076e3bb15b4,
4756 fidl::encoding::DynamicFlags::empty(),
4757 )
4758 }
4759}
4760
4761#[must_use = "FIDL methods require a response to be sent"]
4762#[derive(Debug)]
4763pub struct GuestManagerGetInfoResponder {
4764 control_handle: std::mem::ManuallyDrop<GuestManagerControlHandle>,
4765 tx_id: u32,
4766}
4767
4768impl std::ops::Drop for GuestManagerGetInfoResponder {
4772 fn drop(&mut self) {
4773 self.control_handle.shutdown();
4774 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4776 }
4777}
4778
4779impl fidl::endpoints::Responder for GuestManagerGetInfoResponder {
4780 type ControlHandle = GuestManagerControlHandle;
4781
4782 fn control_handle(&self) -> &GuestManagerControlHandle {
4783 &self.control_handle
4784 }
4785
4786 fn drop_without_shutdown(mut self) {
4787 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4789 std::mem::forget(self);
4791 }
4792}
4793
4794impl GuestManagerGetInfoResponder {
4795 pub fn send(self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
4799 let _result = self.send_raw(guest_info);
4800 if _result.is_err() {
4801 self.control_handle.shutdown();
4802 }
4803 self.drop_without_shutdown();
4804 _result
4805 }
4806
4807 pub fn send_no_shutdown_on_err(self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
4809 let _result = self.send_raw(guest_info);
4810 self.drop_without_shutdown();
4811 _result
4812 }
4813
4814 fn send_raw(&self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
4815 self.control_handle.inner.send::<GuestManagerGetInfoResponse>(
4816 (guest_info,),
4817 self.tx_id,
4818 0x76892614aea695dc,
4819 fidl::encoding::DynamicFlags::empty(),
4820 )
4821 }
4822}
4823
4824#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4825pub struct HostVsockAcceptorMarker;
4826
4827impl fidl::endpoints::ProtocolMarker for HostVsockAcceptorMarker {
4828 type Proxy = HostVsockAcceptorProxy;
4829 type RequestStream = HostVsockAcceptorRequestStream;
4830 #[cfg(target_os = "fuchsia")]
4831 type SynchronousProxy = HostVsockAcceptorSynchronousProxy;
4832
4833 const DEBUG_NAME: &'static str = "(anonymous) HostVsockAcceptor";
4834}
4835pub type HostVsockAcceptorAcceptResult = Result<fidl::Socket, i32>;
4836
4837pub trait HostVsockAcceptorProxyInterface: Send + Sync {
4838 type AcceptResponseFut: std::future::Future<Output = Result<HostVsockAcceptorAcceptResult, fidl::Error>>
4839 + Send;
4840 fn r#accept(&self, src_cid: u32, src_port: u32, port: u32) -> Self::AcceptResponseFut;
4841}
4842#[derive(Debug)]
4843#[cfg(target_os = "fuchsia")]
4844pub struct HostVsockAcceptorSynchronousProxy {
4845 client: fidl::client::sync::Client,
4846}
4847
4848#[cfg(target_os = "fuchsia")]
4849impl fidl::endpoints::SynchronousProxy for HostVsockAcceptorSynchronousProxy {
4850 type Proxy = HostVsockAcceptorProxy;
4851 type Protocol = HostVsockAcceptorMarker;
4852
4853 fn from_channel(inner: fidl::Channel) -> Self {
4854 Self::new(inner)
4855 }
4856
4857 fn into_channel(self) -> fidl::Channel {
4858 self.client.into_channel()
4859 }
4860
4861 fn as_channel(&self) -> &fidl::Channel {
4862 self.client.as_channel()
4863 }
4864}
4865
4866#[cfg(target_os = "fuchsia")]
4867impl HostVsockAcceptorSynchronousProxy {
4868 pub fn new(channel: fidl::Channel) -> Self {
4869 let protocol_name =
4870 <HostVsockAcceptorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4871 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4872 }
4873
4874 pub fn into_channel(self) -> fidl::Channel {
4875 self.client.into_channel()
4876 }
4877
4878 pub fn wait_for_event(
4881 &self,
4882 deadline: zx::MonotonicInstant,
4883 ) -> Result<HostVsockAcceptorEvent, fidl::Error> {
4884 HostVsockAcceptorEvent::decode(self.client.wait_for_event(deadline)?)
4885 }
4886
4887 pub fn r#accept(
4888 &self,
4889 mut src_cid: u32,
4890 mut src_port: u32,
4891 mut port: u32,
4892 ___deadline: zx::MonotonicInstant,
4893 ) -> Result<HostVsockAcceptorAcceptResult, fidl::Error> {
4894 let _response = self.client.send_query::<
4895 HostVsockAcceptorAcceptRequest,
4896 fidl::encoding::ResultType<HostVsockAcceptorAcceptResponse, i32>,
4897 >(
4898 (src_cid, src_port, port,),
4899 0x6996ed935beaa2d7,
4900 fidl::encoding::DynamicFlags::empty(),
4901 ___deadline,
4902 )?;
4903 Ok(_response.map(|x| x.socket))
4904 }
4905}
4906
4907#[cfg(target_os = "fuchsia")]
4908impl From<HostVsockAcceptorSynchronousProxy> for zx::Handle {
4909 fn from(value: HostVsockAcceptorSynchronousProxy) -> Self {
4910 value.into_channel().into()
4911 }
4912}
4913
4914#[cfg(target_os = "fuchsia")]
4915impl From<fidl::Channel> for HostVsockAcceptorSynchronousProxy {
4916 fn from(value: fidl::Channel) -> Self {
4917 Self::new(value)
4918 }
4919}
4920
4921#[derive(Debug, Clone)]
4922pub struct HostVsockAcceptorProxy {
4923 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4924}
4925
4926impl fidl::endpoints::Proxy for HostVsockAcceptorProxy {
4927 type Protocol = HostVsockAcceptorMarker;
4928
4929 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4930 Self::new(inner)
4931 }
4932
4933 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4934 self.client.into_channel().map_err(|client| Self { client })
4935 }
4936
4937 fn as_channel(&self) -> &::fidl::AsyncChannel {
4938 self.client.as_channel()
4939 }
4940}
4941
4942impl HostVsockAcceptorProxy {
4943 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4945 let protocol_name =
4946 <HostVsockAcceptorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4947 Self { client: fidl::client::Client::new(channel, protocol_name) }
4948 }
4949
4950 pub fn take_event_stream(&self) -> HostVsockAcceptorEventStream {
4956 HostVsockAcceptorEventStream { event_receiver: self.client.take_event_receiver() }
4957 }
4958
4959 pub fn r#accept(
4960 &self,
4961 mut src_cid: u32,
4962 mut src_port: u32,
4963 mut port: u32,
4964 ) -> fidl::client::QueryResponseFut<
4965 HostVsockAcceptorAcceptResult,
4966 fidl::encoding::DefaultFuchsiaResourceDialect,
4967 > {
4968 HostVsockAcceptorProxyInterface::r#accept(self, src_cid, src_port, port)
4969 }
4970}
4971
4972impl HostVsockAcceptorProxyInterface for HostVsockAcceptorProxy {
4973 type AcceptResponseFut = fidl::client::QueryResponseFut<
4974 HostVsockAcceptorAcceptResult,
4975 fidl::encoding::DefaultFuchsiaResourceDialect,
4976 >;
4977 fn r#accept(
4978 &self,
4979 mut src_cid: u32,
4980 mut src_port: u32,
4981 mut port: u32,
4982 ) -> Self::AcceptResponseFut {
4983 fn _decode(
4984 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4985 ) -> Result<HostVsockAcceptorAcceptResult, fidl::Error> {
4986 let _response = fidl::client::decode_transaction_body::<
4987 fidl::encoding::ResultType<HostVsockAcceptorAcceptResponse, i32>,
4988 fidl::encoding::DefaultFuchsiaResourceDialect,
4989 0x6996ed935beaa2d7,
4990 >(_buf?)?;
4991 Ok(_response.map(|x| x.socket))
4992 }
4993 self.client
4994 .send_query_and_decode::<HostVsockAcceptorAcceptRequest, HostVsockAcceptorAcceptResult>(
4995 (src_cid, src_port, port),
4996 0x6996ed935beaa2d7,
4997 fidl::encoding::DynamicFlags::empty(),
4998 _decode,
4999 )
5000 }
5001}
5002
5003pub struct HostVsockAcceptorEventStream {
5004 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5005}
5006
5007impl std::marker::Unpin for HostVsockAcceptorEventStream {}
5008
5009impl futures::stream::FusedStream for HostVsockAcceptorEventStream {
5010 fn is_terminated(&self) -> bool {
5011 self.event_receiver.is_terminated()
5012 }
5013}
5014
5015impl futures::Stream for HostVsockAcceptorEventStream {
5016 type Item = Result<HostVsockAcceptorEvent, fidl::Error>;
5017
5018 fn poll_next(
5019 mut self: std::pin::Pin<&mut Self>,
5020 cx: &mut std::task::Context<'_>,
5021 ) -> std::task::Poll<Option<Self::Item>> {
5022 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5023 &mut self.event_receiver,
5024 cx
5025 )?) {
5026 Some(buf) => std::task::Poll::Ready(Some(HostVsockAcceptorEvent::decode(buf))),
5027 None => std::task::Poll::Ready(None),
5028 }
5029 }
5030}
5031
5032#[derive(Debug)]
5033pub enum HostVsockAcceptorEvent {}
5034
5035impl HostVsockAcceptorEvent {
5036 fn decode(
5038 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5039 ) -> Result<HostVsockAcceptorEvent, fidl::Error> {
5040 let (bytes, _handles) = buf.split_mut();
5041 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5042 debug_assert_eq!(tx_header.tx_id, 0);
5043 match tx_header.ordinal {
5044 _ => Err(fidl::Error::UnknownOrdinal {
5045 ordinal: tx_header.ordinal,
5046 protocol_name:
5047 <HostVsockAcceptorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5048 }),
5049 }
5050 }
5051}
5052
5053pub struct HostVsockAcceptorRequestStream {
5055 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5056 is_terminated: bool,
5057}
5058
5059impl std::marker::Unpin for HostVsockAcceptorRequestStream {}
5060
5061impl futures::stream::FusedStream for HostVsockAcceptorRequestStream {
5062 fn is_terminated(&self) -> bool {
5063 self.is_terminated
5064 }
5065}
5066
5067impl fidl::endpoints::RequestStream for HostVsockAcceptorRequestStream {
5068 type Protocol = HostVsockAcceptorMarker;
5069 type ControlHandle = HostVsockAcceptorControlHandle;
5070
5071 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5072 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5073 }
5074
5075 fn control_handle(&self) -> Self::ControlHandle {
5076 HostVsockAcceptorControlHandle { inner: self.inner.clone() }
5077 }
5078
5079 fn into_inner(
5080 self,
5081 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5082 {
5083 (self.inner, self.is_terminated)
5084 }
5085
5086 fn from_inner(
5087 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5088 is_terminated: bool,
5089 ) -> Self {
5090 Self { inner, is_terminated }
5091 }
5092}
5093
5094impl futures::Stream for HostVsockAcceptorRequestStream {
5095 type Item = Result<HostVsockAcceptorRequest, fidl::Error>;
5096
5097 fn poll_next(
5098 mut self: std::pin::Pin<&mut Self>,
5099 cx: &mut std::task::Context<'_>,
5100 ) -> std::task::Poll<Option<Self::Item>> {
5101 let this = &mut *self;
5102 if this.inner.check_shutdown(cx) {
5103 this.is_terminated = true;
5104 return std::task::Poll::Ready(None);
5105 }
5106 if this.is_terminated {
5107 panic!("polled HostVsockAcceptorRequestStream after completion");
5108 }
5109 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5110 |bytes, handles| {
5111 match this.inner.channel().read_etc(cx, bytes, handles) {
5112 std::task::Poll::Ready(Ok(())) => {}
5113 std::task::Poll::Pending => return std::task::Poll::Pending,
5114 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5115 this.is_terminated = true;
5116 return std::task::Poll::Ready(None);
5117 }
5118 std::task::Poll::Ready(Err(e)) => {
5119 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5120 e.into(),
5121 ))))
5122 }
5123 }
5124
5125 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5127
5128 std::task::Poll::Ready(Some(match header.ordinal {
5129 0x6996ed935beaa2d7 => {
5130 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5131 let mut req = fidl::new_empty!(
5132 HostVsockAcceptorAcceptRequest,
5133 fidl::encoding::DefaultFuchsiaResourceDialect
5134 );
5135 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<HostVsockAcceptorAcceptRequest>(&header, _body_bytes, handles, &mut req)?;
5136 let control_handle =
5137 HostVsockAcceptorControlHandle { inner: this.inner.clone() };
5138 Ok(HostVsockAcceptorRequest::Accept {
5139 src_cid: req.src_cid,
5140 src_port: req.src_port,
5141 port: req.port,
5142
5143 responder: HostVsockAcceptorAcceptResponder {
5144 control_handle: std::mem::ManuallyDrop::new(control_handle),
5145 tx_id: header.tx_id,
5146 },
5147 })
5148 }
5149 _ => Err(fidl::Error::UnknownOrdinal {
5150 ordinal: header.ordinal,
5151 protocol_name:
5152 <HostVsockAcceptorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5153 }),
5154 }))
5155 },
5156 )
5157 }
5158}
5159
5160#[derive(Debug)]
5164pub enum HostVsockAcceptorRequest {
5165 Accept { src_cid: u32, src_port: u32, port: u32, responder: HostVsockAcceptorAcceptResponder },
5166}
5167
5168impl HostVsockAcceptorRequest {
5169 #[allow(irrefutable_let_patterns)]
5170 pub fn into_accept(self) -> Option<(u32, u32, u32, HostVsockAcceptorAcceptResponder)> {
5171 if let HostVsockAcceptorRequest::Accept { src_cid, src_port, port, responder } = self {
5172 Some((src_cid, src_port, port, responder))
5173 } else {
5174 None
5175 }
5176 }
5177
5178 pub fn method_name(&self) -> &'static str {
5180 match *self {
5181 HostVsockAcceptorRequest::Accept { .. } => "accept",
5182 }
5183 }
5184}
5185
5186#[derive(Debug, Clone)]
5187pub struct HostVsockAcceptorControlHandle {
5188 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5189}
5190
5191impl fidl::endpoints::ControlHandle for HostVsockAcceptorControlHandle {
5192 fn shutdown(&self) {
5193 self.inner.shutdown()
5194 }
5195 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5196 self.inner.shutdown_with_epitaph(status)
5197 }
5198
5199 fn is_closed(&self) -> bool {
5200 self.inner.channel().is_closed()
5201 }
5202 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5203 self.inner.channel().on_closed()
5204 }
5205
5206 #[cfg(target_os = "fuchsia")]
5207 fn signal_peer(
5208 &self,
5209 clear_mask: zx::Signals,
5210 set_mask: zx::Signals,
5211 ) -> Result<(), zx_status::Status> {
5212 use fidl::Peered;
5213 self.inner.channel().signal_peer(clear_mask, set_mask)
5214 }
5215}
5216
5217impl HostVsockAcceptorControlHandle {}
5218
5219#[must_use = "FIDL methods require a response to be sent"]
5220#[derive(Debug)]
5221pub struct HostVsockAcceptorAcceptResponder {
5222 control_handle: std::mem::ManuallyDrop<HostVsockAcceptorControlHandle>,
5223 tx_id: u32,
5224}
5225
5226impl std::ops::Drop for HostVsockAcceptorAcceptResponder {
5230 fn drop(&mut self) {
5231 self.control_handle.shutdown();
5232 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5234 }
5235}
5236
5237impl fidl::endpoints::Responder for HostVsockAcceptorAcceptResponder {
5238 type ControlHandle = HostVsockAcceptorControlHandle;
5239
5240 fn control_handle(&self) -> &HostVsockAcceptorControlHandle {
5241 &self.control_handle
5242 }
5243
5244 fn drop_without_shutdown(mut self) {
5245 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5247 std::mem::forget(self);
5249 }
5250}
5251
5252impl HostVsockAcceptorAcceptResponder {
5253 pub fn send(self, mut result: Result<fidl::Socket, i32>) -> Result<(), fidl::Error> {
5257 let _result = self.send_raw(result);
5258 if _result.is_err() {
5259 self.control_handle.shutdown();
5260 }
5261 self.drop_without_shutdown();
5262 _result
5263 }
5264
5265 pub fn send_no_shutdown_on_err(
5267 self,
5268 mut result: Result<fidl::Socket, i32>,
5269 ) -> Result<(), fidl::Error> {
5270 let _result = self.send_raw(result);
5271 self.drop_without_shutdown();
5272 _result
5273 }
5274
5275 fn send_raw(&self, mut result: Result<fidl::Socket, i32>) -> Result<(), fidl::Error> {
5276 self.control_handle
5277 .inner
5278 .send::<fidl::encoding::ResultType<HostVsockAcceptorAcceptResponse, i32>>(
5279 result.map(|socket| (socket,)),
5280 self.tx_id,
5281 0x6996ed935beaa2d7,
5282 fidl::encoding::DynamicFlags::empty(),
5283 )
5284 }
5285}
5286
5287#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5288pub struct HostVsockEndpointMarker;
5289
5290impl fidl::endpoints::ProtocolMarker for HostVsockEndpointMarker {
5291 type Proxy = HostVsockEndpointProxy;
5292 type RequestStream = HostVsockEndpointRequestStream;
5293 #[cfg(target_os = "fuchsia")]
5294 type SynchronousProxy = HostVsockEndpointSynchronousProxy;
5295
5296 const DEBUG_NAME: &'static str = "fuchsia.virtualization.HostVsockEndpoint";
5297}
5298impl fidl::endpoints::DiscoverableProtocolMarker for HostVsockEndpointMarker {}
5299pub type HostVsockEndpointListenResult = Result<(), i32>;
5300pub type HostVsockEndpointConnectResult = Result<fidl::Socket, i32>;
5301
5302pub trait HostVsockEndpointProxyInterface: Send + Sync {
5303 type ListenResponseFut: std::future::Future<Output = Result<HostVsockEndpointListenResult, fidl::Error>>
5304 + Send;
5305 fn r#listen(
5306 &self,
5307 port: u32,
5308 acceptor: fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>,
5309 ) -> Self::ListenResponseFut;
5310 type ConnectResponseFut: std::future::Future<Output = Result<HostVsockEndpointConnectResult, fidl::Error>>
5311 + Send;
5312 fn r#connect(&self, guest_port: u32) -> Self::ConnectResponseFut;
5313}
5314#[derive(Debug)]
5315#[cfg(target_os = "fuchsia")]
5316pub struct HostVsockEndpointSynchronousProxy {
5317 client: fidl::client::sync::Client,
5318}
5319
5320#[cfg(target_os = "fuchsia")]
5321impl fidl::endpoints::SynchronousProxy for HostVsockEndpointSynchronousProxy {
5322 type Proxy = HostVsockEndpointProxy;
5323 type Protocol = HostVsockEndpointMarker;
5324
5325 fn from_channel(inner: fidl::Channel) -> Self {
5326 Self::new(inner)
5327 }
5328
5329 fn into_channel(self) -> fidl::Channel {
5330 self.client.into_channel()
5331 }
5332
5333 fn as_channel(&self) -> &fidl::Channel {
5334 self.client.as_channel()
5335 }
5336}
5337
5338#[cfg(target_os = "fuchsia")]
5339impl HostVsockEndpointSynchronousProxy {
5340 pub fn new(channel: fidl::Channel) -> Self {
5341 let protocol_name =
5342 <HostVsockEndpointMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5343 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5344 }
5345
5346 pub fn into_channel(self) -> fidl::Channel {
5347 self.client.into_channel()
5348 }
5349
5350 pub fn wait_for_event(
5353 &self,
5354 deadline: zx::MonotonicInstant,
5355 ) -> Result<HostVsockEndpointEvent, fidl::Error> {
5356 HostVsockEndpointEvent::decode(self.client.wait_for_event(deadline)?)
5357 }
5358
5359 pub fn r#listen(
5365 &self,
5366 mut port: u32,
5367 mut acceptor: fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>,
5368 ___deadline: zx::MonotonicInstant,
5369 ) -> Result<HostVsockEndpointListenResult, fidl::Error> {
5370 let _response = self
5371 .client
5372 .send_query::<Listener, fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5373 (port, acceptor),
5374 0xfd88f3b4767f2c7,
5375 fidl::encoding::DynamicFlags::empty(),
5376 ___deadline,
5377 )?;
5378 Ok(_response.map(|x| x))
5379 }
5380
5381 pub fn r#connect(
5391 &self,
5392 mut guest_port: u32,
5393 ___deadline: zx::MonotonicInstant,
5394 ) -> Result<HostVsockEndpointConnectResult, fidl::Error> {
5395 let _response = self.client.send_query::<
5396 HostVsockEndpointConnectRequest,
5397 fidl::encoding::ResultType<HostVsockEndpointConnectResponse, i32>,
5398 >(
5399 (guest_port,),
5400 0x4d12e10e946b43e4,
5401 fidl::encoding::DynamicFlags::empty(),
5402 ___deadline,
5403 )?;
5404 Ok(_response.map(|x| x.socket))
5405 }
5406}
5407
5408#[cfg(target_os = "fuchsia")]
5409impl From<HostVsockEndpointSynchronousProxy> for zx::Handle {
5410 fn from(value: HostVsockEndpointSynchronousProxy) -> Self {
5411 value.into_channel().into()
5412 }
5413}
5414
5415#[cfg(target_os = "fuchsia")]
5416impl From<fidl::Channel> for HostVsockEndpointSynchronousProxy {
5417 fn from(value: fidl::Channel) -> Self {
5418 Self::new(value)
5419 }
5420}
5421
5422#[derive(Debug, Clone)]
5423pub struct HostVsockEndpointProxy {
5424 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5425}
5426
5427impl fidl::endpoints::Proxy for HostVsockEndpointProxy {
5428 type Protocol = HostVsockEndpointMarker;
5429
5430 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5431 Self::new(inner)
5432 }
5433
5434 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5435 self.client.into_channel().map_err(|client| Self { client })
5436 }
5437
5438 fn as_channel(&self) -> &::fidl::AsyncChannel {
5439 self.client.as_channel()
5440 }
5441}
5442
5443impl HostVsockEndpointProxy {
5444 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5446 let protocol_name =
5447 <HostVsockEndpointMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5448 Self { client: fidl::client::Client::new(channel, protocol_name) }
5449 }
5450
5451 pub fn take_event_stream(&self) -> HostVsockEndpointEventStream {
5457 HostVsockEndpointEventStream { event_receiver: self.client.take_event_receiver() }
5458 }
5459
5460 pub fn r#listen(
5466 &self,
5467 mut port: u32,
5468 mut acceptor: fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>,
5469 ) -> fidl::client::QueryResponseFut<
5470 HostVsockEndpointListenResult,
5471 fidl::encoding::DefaultFuchsiaResourceDialect,
5472 > {
5473 HostVsockEndpointProxyInterface::r#listen(self, port, acceptor)
5474 }
5475
5476 pub fn r#connect(
5486 &self,
5487 mut guest_port: u32,
5488 ) -> fidl::client::QueryResponseFut<
5489 HostVsockEndpointConnectResult,
5490 fidl::encoding::DefaultFuchsiaResourceDialect,
5491 > {
5492 HostVsockEndpointProxyInterface::r#connect(self, guest_port)
5493 }
5494}
5495
5496impl HostVsockEndpointProxyInterface for HostVsockEndpointProxy {
5497 type ListenResponseFut = fidl::client::QueryResponseFut<
5498 HostVsockEndpointListenResult,
5499 fidl::encoding::DefaultFuchsiaResourceDialect,
5500 >;
5501 fn r#listen(
5502 &self,
5503 mut port: u32,
5504 mut acceptor: fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>,
5505 ) -> Self::ListenResponseFut {
5506 fn _decode(
5507 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5508 ) -> Result<HostVsockEndpointListenResult, fidl::Error> {
5509 let _response = fidl::client::decode_transaction_body::<
5510 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5511 fidl::encoding::DefaultFuchsiaResourceDialect,
5512 0xfd88f3b4767f2c7,
5513 >(_buf?)?;
5514 Ok(_response.map(|x| x))
5515 }
5516 self.client.send_query_and_decode::<Listener, HostVsockEndpointListenResult>(
5517 (port, acceptor),
5518 0xfd88f3b4767f2c7,
5519 fidl::encoding::DynamicFlags::empty(),
5520 _decode,
5521 )
5522 }
5523
5524 type ConnectResponseFut = fidl::client::QueryResponseFut<
5525 HostVsockEndpointConnectResult,
5526 fidl::encoding::DefaultFuchsiaResourceDialect,
5527 >;
5528 fn r#connect(&self, mut guest_port: u32) -> Self::ConnectResponseFut {
5529 fn _decode(
5530 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5531 ) -> Result<HostVsockEndpointConnectResult, fidl::Error> {
5532 let _response = fidl::client::decode_transaction_body::<
5533 fidl::encoding::ResultType<HostVsockEndpointConnectResponse, i32>,
5534 fidl::encoding::DefaultFuchsiaResourceDialect,
5535 0x4d12e10e946b43e4,
5536 >(_buf?)?;
5537 Ok(_response.map(|x| x.socket))
5538 }
5539 self.client.send_query_and_decode::<
5540 HostVsockEndpointConnectRequest,
5541 HostVsockEndpointConnectResult,
5542 >(
5543 (guest_port,),
5544 0x4d12e10e946b43e4,
5545 fidl::encoding::DynamicFlags::empty(),
5546 _decode,
5547 )
5548 }
5549}
5550
5551pub struct HostVsockEndpointEventStream {
5552 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5553}
5554
5555impl std::marker::Unpin for HostVsockEndpointEventStream {}
5556
5557impl futures::stream::FusedStream for HostVsockEndpointEventStream {
5558 fn is_terminated(&self) -> bool {
5559 self.event_receiver.is_terminated()
5560 }
5561}
5562
5563impl futures::Stream for HostVsockEndpointEventStream {
5564 type Item = Result<HostVsockEndpointEvent, fidl::Error>;
5565
5566 fn poll_next(
5567 mut self: std::pin::Pin<&mut Self>,
5568 cx: &mut std::task::Context<'_>,
5569 ) -> std::task::Poll<Option<Self::Item>> {
5570 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5571 &mut self.event_receiver,
5572 cx
5573 )?) {
5574 Some(buf) => std::task::Poll::Ready(Some(HostVsockEndpointEvent::decode(buf))),
5575 None => std::task::Poll::Ready(None),
5576 }
5577 }
5578}
5579
5580#[derive(Debug)]
5581pub enum HostVsockEndpointEvent {}
5582
5583impl HostVsockEndpointEvent {
5584 fn decode(
5586 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5587 ) -> Result<HostVsockEndpointEvent, fidl::Error> {
5588 let (bytes, _handles) = buf.split_mut();
5589 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5590 debug_assert_eq!(tx_header.tx_id, 0);
5591 match tx_header.ordinal {
5592 _ => Err(fidl::Error::UnknownOrdinal {
5593 ordinal: tx_header.ordinal,
5594 protocol_name:
5595 <HostVsockEndpointMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5596 }),
5597 }
5598 }
5599}
5600
5601pub struct HostVsockEndpointRequestStream {
5603 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5604 is_terminated: bool,
5605}
5606
5607impl std::marker::Unpin for HostVsockEndpointRequestStream {}
5608
5609impl futures::stream::FusedStream for HostVsockEndpointRequestStream {
5610 fn is_terminated(&self) -> bool {
5611 self.is_terminated
5612 }
5613}
5614
5615impl fidl::endpoints::RequestStream for HostVsockEndpointRequestStream {
5616 type Protocol = HostVsockEndpointMarker;
5617 type ControlHandle = HostVsockEndpointControlHandle;
5618
5619 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5620 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5621 }
5622
5623 fn control_handle(&self) -> Self::ControlHandle {
5624 HostVsockEndpointControlHandle { inner: self.inner.clone() }
5625 }
5626
5627 fn into_inner(
5628 self,
5629 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5630 {
5631 (self.inner, self.is_terminated)
5632 }
5633
5634 fn from_inner(
5635 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5636 is_terminated: bool,
5637 ) -> Self {
5638 Self { inner, is_terminated }
5639 }
5640}
5641
5642impl futures::Stream for HostVsockEndpointRequestStream {
5643 type Item = Result<HostVsockEndpointRequest, fidl::Error>;
5644
5645 fn poll_next(
5646 mut self: std::pin::Pin<&mut Self>,
5647 cx: &mut std::task::Context<'_>,
5648 ) -> std::task::Poll<Option<Self::Item>> {
5649 let this = &mut *self;
5650 if this.inner.check_shutdown(cx) {
5651 this.is_terminated = true;
5652 return std::task::Poll::Ready(None);
5653 }
5654 if this.is_terminated {
5655 panic!("polled HostVsockEndpointRequestStream after completion");
5656 }
5657 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5658 |bytes, handles| {
5659 match this.inner.channel().read_etc(cx, bytes, handles) {
5660 std::task::Poll::Ready(Ok(())) => {}
5661 std::task::Poll::Pending => return std::task::Poll::Pending,
5662 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5663 this.is_terminated = true;
5664 return std::task::Poll::Ready(None);
5665 }
5666 std::task::Poll::Ready(Err(e)) => {
5667 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5668 e.into(),
5669 ))))
5670 }
5671 }
5672
5673 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5675
5676 std::task::Poll::Ready(Some(match header.ordinal {
5677 0xfd88f3b4767f2c7 => {
5678 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5679 let mut req = fidl::new_empty!(
5680 Listener,
5681 fidl::encoding::DefaultFuchsiaResourceDialect
5682 );
5683 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Listener>(&header, _body_bytes, handles, &mut req)?;
5684 let control_handle =
5685 HostVsockEndpointControlHandle { inner: this.inner.clone() };
5686 Ok(HostVsockEndpointRequest::Listen {
5687 port: req.port,
5688 acceptor: req.acceptor,
5689
5690 responder: HostVsockEndpointListenResponder {
5691 control_handle: std::mem::ManuallyDrop::new(control_handle),
5692 tx_id: header.tx_id,
5693 },
5694 })
5695 }
5696 0x4d12e10e946b43e4 => {
5697 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5698 let mut req = fidl::new_empty!(
5699 HostVsockEndpointConnectRequest,
5700 fidl::encoding::DefaultFuchsiaResourceDialect
5701 );
5702 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<HostVsockEndpointConnectRequest>(&header, _body_bytes, handles, &mut req)?;
5703 let control_handle =
5704 HostVsockEndpointControlHandle { inner: this.inner.clone() };
5705 Ok(HostVsockEndpointRequest::Connect {
5706 guest_port: req.guest_port,
5707
5708 responder: HostVsockEndpointConnectResponder {
5709 control_handle: std::mem::ManuallyDrop::new(control_handle),
5710 tx_id: header.tx_id,
5711 },
5712 })
5713 }
5714 _ => Err(fidl::Error::UnknownOrdinal {
5715 ordinal: header.ordinal,
5716 protocol_name:
5717 <HostVsockEndpointMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5718 }),
5719 }))
5720 },
5721 )
5722 }
5723}
5724
5725#[derive(Debug)]
5728pub enum HostVsockEndpointRequest {
5729 Listen {
5735 port: u32,
5736 acceptor: fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>,
5737 responder: HostVsockEndpointListenResponder,
5738 },
5739 Connect { guest_port: u32, responder: HostVsockEndpointConnectResponder },
5749}
5750
5751impl HostVsockEndpointRequest {
5752 #[allow(irrefutable_let_patterns)]
5753 pub fn into_listen(
5754 self,
5755 ) -> Option<(
5756 u32,
5757 fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>,
5758 HostVsockEndpointListenResponder,
5759 )> {
5760 if let HostVsockEndpointRequest::Listen { port, acceptor, responder } = self {
5761 Some((port, acceptor, responder))
5762 } else {
5763 None
5764 }
5765 }
5766
5767 #[allow(irrefutable_let_patterns)]
5768 pub fn into_connect(self) -> Option<(u32, HostVsockEndpointConnectResponder)> {
5769 if let HostVsockEndpointRequest::Connect { guest_port, responder } = self {
5770 Some((guest_port, responder))
5771 } else {
5772 None
5773 }
5774 }
5775
5776 pub fn method_name(&self) -> &'static str {
5778 match *self {
5779 HostVsockEndpointRequest::Listen { .. } => "listen",
5780 HostVsockEndpointRequest::Connect { .. } => "connect",
5781 }
5782 }
5783}
5784
5785#[derive(Debug, Clone)]
5786pub struct HostVsockEndpointControlHandle {
5787 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5788}
5789
5790impl fidl::endpoints::ControlHandle for HostVsockEndpointControlHandle {
5791 fn shutdown(&self) {
5792 self.inner.shutdown()
5793 }
5794 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5795 self.inner.shutdown_with_epitaph(status)
5796 }
5797
5798 fn is_closed(&self) -> bool {
5799 self.inner.channel().is_closed()
5800 }
5801 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5802 self.inner.channel().on_closed()
5803 }
5804
5805 #[cfg(target_os = "fuchsia")]
5806 fn signal_peer(
5807 &self,
5808 clear_mask: zx::Signals,
5809 set_mask: zx::Signals,
5810 ) -> Result<(), zx_status::Status> {
5811 use fidl::Peered;
5812 self.inner.channel().signal_peer(clear_mask, set_mask)
5813 }
5814}
5815
5816impl HostVsockEndpointControlHandle {}
5817
5818#[must_use = "FIDL methods require a response to be sent"]
5819#[derive(Debug)]
5820pub struct HostVsockEndpointListenResponder {
5821 control_handle: std::mem::ManuallyDrop<HostVsockEndpointControlHandle>,
5822 tx_id: u32,
5823}
5824
5825impl std::ops::Drop for HostVsockEndpointListenResponder {
5829 fn drop(&mut self) {
5830 self.control_handle.shutdown();
5831 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5833 }
5834}
5835
5836impl fidl::endpoints::Responder for HostVsockEndpointListenResponder {
5837 type ControlHandle = HostVsockEndpointControlHandle;
5838
5839 fn control_handle(&self) -> &HostVsockEndpointControlHandle {
5840 &self.control_handle
5841 }
5842
5843 fn drop_without_shutdown(mut self) {
5844 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5846 std::mem::forget(self);
5848 }
5849}
5850
5851impl HostVsockEndpointListenResponder {
5852 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5856 let _result = self.send_raw(result);
5857 if _result.is_err() {
5858 self.control_handle.shutdown();
5859 }
5860 self.drop_without_shutdown();
5861 _result
5862 }
5863
5864 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5866 let _result = self.send_raw(result);
5867 self.drop_without_shutdown();
5868 _result
5869 }
5870
5871 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5872 self.control_handle
5873 .inner
5874 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5875 result,
5876 self.tx_id,
5877 0xfd88f3b4767f2c7,
5878 fidl::encoding::DynamicFlags::empty(),
5879 )
5880 }
5881}
5882
5883#[must_use = "FIDL methods require a response to be sent"]
5884#[derive(Debug)]
5885pub struct HostVsockEndpointConnectResponder {
5886 control_handle: std::mem::ManuallyDrop<HostVsockEndpointControlHandle>,
5887 tx_id: u32,
5888}
5889
5890impl std::ops::Drop for HostVsockEndpointConnectResponder {
5894 fn drop(&mut self) {
5895 self.control_handle.shutdown();
5896 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5898 }
5899}
5900
5901impl fidl::endpoints::Responder for HostVsockEndpointConnectResponder {
5902 type ControlHandle = HostVsockEndpointControlHandle;
5903
5904 fn control_handle(&self) -> &HostVsockEndpointControlHandle {
5905 &self.control_handle
5906 }
5907
5908 fn drop_without_shutdown(mut self) {
5909 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5911 std::mem::forget(self);
5913 }
5914}
5915
5916impl HostVsockEndpointConnectResponder {
5917 pub fn send(self, mut result: Result<fidl::Socket, i32>) -> Result<(), fidl::Error> {
5921 let _result = self.send_raw(result);
5922 if _result.is_err() {
5923 self.control_handle.shutdown();
5924 }
5925 self.drop_without_shutdown();
5926 _result
5927 }
5928
5929 pub fn send_no_shutdown_on_err(
5931 self,
5932 mut result: Result<fidl::Socket, i32>,
5933 ) -> Result<(), fidl::Error> {
5934 let _result = self.send_raw(result);
5935 self.drop_without_shutdown();
5936 _result
5937 }
5938
5939 fn send_raw(&self, mut result: Result<fidl::Socket, i32>) -> Result<(), fidl::Error> {
5940 self.control_handle
5941 .inner
5942 .send::<fidl::encoding::ResultType<HostVsockEndpointConnectResponse, i32>>(
5943 result.map(|socket| (socket,)),
5944 self.tx_id,
5945 0x4d12e10e946b43e4,
5946 fidl::encoding::DynamicFlags::empty(),
5947 )
5948 }
5949}
5950
5951#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5952pub struct LinuxManagerMarker;
5953
5954impl fidl::endpoints::ProtocolMarker for LinuxManagerMarker {
5955 type Proxy = LinuxManagerProxy;
5956 type RequestStream = LinuxManagerRequestStream;
5957 #[cfg(target_os = "fuchsia")]
5958 type SynchronousProxy = LinuxManagerSynchronousProxy;
5959
5960 const DEBUG_NAME: &'static str = "fuchsia.virtualization.LinuxManager";
5961}
5962impl fidl::endpoints::DiscoverableProtocolMarker for LinuxManagerMarker {}
5963pub type LinuxManagerStartAndGetLinuxGuestInfoResult = Result<LinuxGuestInfo, i32>;
5964pub type LinuxManagerWipeDataResult = Result<(), i32>;
5965
5966pub trait LinuxManagerProxyInterface: Send + Sync {
5967 type StartAndGetLinuxGuestInfoResponseFut: std::future::Future<
5968 Output = Result<LinuxManagerStartAndGetLinuxGuestInfoResult, fidl::Error>,
5969 > + Send;
5970 fn r#start_and_get_linux_guest_info(
5971 &self,
5972 label: &str,
5973 ) -> Self::StartAndGetLinuxGuestInfoResponseFut;
5974 type WipeDataResponseFut: std::future::Future<Output = Result<LinuxManagerWipeDataResult, fidl::Error>>
5975 + Send;
5976 fn r#wipe_data(&self) -> Self::WipeDataResponseFut;
5977 fn r#graceful_shutdown(&self) -> Result<(), fidl::Error>;
5978}
5979#[derive(Debug)]
5980#[cfg(target_os = "fuchsia")]
5981pub struct LinuxManagerSynchronousProxy {
5982 client: fidl::client::sync::Client,
5983}
5984
5985#[cfg(target_os = "fuchsia")]
5986impl fidl::endpoints::SynchronousProxy for LinuxManagerSynchronousProxy {
5987 type Proxy = LinuxManagerProxy;
5988 type Protocol = LinuxManagerMarker;
5989
5990 fn from_channel(inner: fidl::Channel) -> Self {
5991 Self::new(inner)
5992 }
5993
5994 fn into_channel(self) -> fidl::Channel {
5995 self.client.into_channel()
5996 }
5997
5998 fn as_channel(&self) -> &fidl::Channel {
5999 self.client.as_channel()
6000 }
6001}
6002
6003#[cfg(target_os = "fuchsia")]
6004impl LinuxManagerSynchronousProxy {
6005 pub fn new(channel: fidl::Channel) -> Self {
6006 let protocol_name = <LinuxManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6007 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6008 }
6009
6010 pub fn into_channel(self) -> fidl::Channel {
6011 self.client.into_channel()
6012 }
6013
6014 pub fn wait_for_event(
6017 &self,
6018 deadline: zx::MonotonicInstant,
6019 ) -> Result<LinuxManagerEvent, fidl::Error> {
6020 LinuxManagerEvent::decode(self.client.wait_for_event(deadline)?)
6021 }
6022
6023 pub fn r#start_and_get_linux_guest_info(
6027 &self,
6028 mut label: &str,
6029 ___deadline: zx::MonotonicInstant,
6030 ) -> Result<LinuxManagerStartAndGetLinuxGuestInfoResult, fidl::Error> {
6031 let _response = self.client.send_query::<
6032 LinuxManagerStartAndGetLinuxGuestInfoRequest,
6033 fidl::encoding::ResultType<LinuxManagerStartAndGetLinuxGuestInfoResponse, i32>,
6034 >(
6035 (label,),
6036 0x11809ced100a2bea,
6037 fidl::encoding::DynamicFlags::empty(),
6038 ___deadline,
6039 )?;
6040 Ok(_response.map(|x| x.info))
6041 }
6042
6043 pub fn r#wipe_data(
6050 &self,
6051 ___deadline: zx::MonotonicInstant,
6052 ) -> Result<LinuxManagerWipeDataResult, fidl::Error> {
6053 let _response = self.client.send_query::<
6054 fidl::encoding::EmptyPayload,
6055 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6056 >(
6057 (),
6058 0x732c69394548a76a,
6059 fidl::encoding::DynamicFlags::empty(),
6060 ___deadline,
6061 )?;
6062 Ok(_response.map(|x| x))
6063 }
6064
6065 pub fn r#graceful_shutdown(&self) -> Result<(), fidl::Error> {
6073 self.client.send::<fidl::encoding::EmptyPayload>(
6074 (),
6075 0x5dab12b50bc9909d,
6076 fidl::encoding::DynamicFlags::empty(),
6077 )
6078 }
6079}
6080
6081#[cfg(target_os = "fuchsia")]
6082impl From<LinuxManagerSynchronousProxy> for zx::Handle {
6083 fn from(value: LinuxManagerSynchronousProxy) -> Self {
6084 value.into_channel().into()
6085 }
6086}
6087
6088#[cfg(target_os = "fuchsia")]
6089impl From<fidl::Channel> for LinuxManagerSynchronousProxy {
6090 fn from(value: fidl::Channel) -> Self {
6091 Self::new(value)
6092 }
6093}
6094
6095#[derive(Debug, Clone)]
6096pub struct LinuxManagerProxy {
6097 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6098}
6099
6100impl fidl::endpoints::Proxy for LinuxManagerProxy {
6101 type Protocol = LinuxManagerMarker;
6102
6103 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6104 Self::new(inner)
6105 }
6106
6107 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6108 self.client.into_channel().map_err(|client| Self { client })
6109 }
6110
6111 fn as_channel(&self) -> &::fidl::AsyncChannel {
6112 self.client.as_channel()
6113 }
6114}
6115
6116impl LinuxManagerProxy {
6117 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6119 let protocol_name = <LinuxManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6120 Self { client: fidl::client::Client::new(channel, protocol_name) }
6121 }
6122
6123 pub fn take_event_stream(&self) -> LinuxManagerEventStream {
6129 LinuxManagerEventStream { event_receiver: self.client.take_event_receiver() }
6130 }
6131
6132 pub fn r#start_and_get_linux_guest_info(
6136 &self,
6137 mut label: &str,
6138 ) -> fidl::client::QueryResponseFut<
6139 LinuxManagerStartAndGetLinuxGuestInfoResult,
6140 fidl::encoding::DefaultFuchsiaResourceDialect,
6141 > {
6142 LinuxManagerProxyInterface::r#start_and_get_linux_guest_info(self, label)
6143 }
6144
6145 pub fn r#wipe_data(
6152 &self,
6153 ) -> fidl::client::QueryResponseFut<
6154 LinuxManagerWipeDataResult,
6155 fidl::encoding::DefaultFuchsiaResourceDialect,
6156 > {
6157 LinuxManagerProxyInterface::r#wipe_data(self)
6158 }
6159
6160 pub fn r#graceful_shutdown(&self) -> Result<(), fidl::Error> {
6168 LinuxManagerProxyInterface::r#graceful_shutdown(self)
6169 }
6170}
6171
6172impl LinuxManagerProxyInterface for LinuxManagerProxy {
6173 type StartAndGetLinuxGuestInfoResponseFut = fidl::client::QueryResponseFut<
6174 LinuxManagerStartAndGetLinuxGuestInfoResult,
6175 fidl::encoding::DefaultFuchsiaResourceDialect,
6176 >;
6177 fn r#start_and_get_linux_guest_info(
6178 &self,
6179 mut label: &str,
6180 ) -> Self::StartAndGetLinuxGuestInfoResponseFut {
6181 fn _decode(
6182 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6183 ) -> Result<LinuxManagerStartAndGetLinuxGuestInfoResult, fidl::Error> {
6184 let _response = fidl::client::decode_transaction_body::<
6185 fidl::encoding::ResultType<LinuxManagerStartAndGetLinuxGuestInfoResponse, i32>,
6186 fidl::encoding::DefaultFuchsiaResourceDialect,
6187 0x11809ced100a2bea,
6188 >(_buf?)?;
6189 Ok(_response.map(|x| x.info))
6190 }
6191 self.client.send_query_and_decode::<
6192 LinuxManagerStartAndGetLinuxGuestInfoRequest,
6193 LinuxManagerStartAndGetLinuxGuestInfoResult,
6194 >(
6195 (label,),
6196 0x11809ced100a2bea,
6197 fidl::encoding::DynamicFlags::empty(),
6198 _decode,
6199 )
6200 }
6201
6202 type WipeDataResponseFut = fidl::client::QueryResponseFut<
6203 LinuxManagerWipeDataResult,
6204 fidl::encoding::DefaultFuchsiaResourceDialect,
6205 >;
6206 fn r#wipe_data(&self) -> Self::WipeDataResponseFut {
6207 fn _decode(
6208 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6209 ) -> Result<LinuxManagerWipeDataResult, fidl::Error> {
6210 let _response = fidl::client::decode_transaction_body::<
6211 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6212 fidl::encoding::DefaultFuchsiaResourceDialect,
6213 0x732c69394548a76a,
6214 >(_buf?)?;
6215 Ok(_response.map(|x| x))
6216 }
6217 self.client
6218 .send_query_and_decode::<fidl::encoding::EmptyPayload, LinuxManagerWipeDataResult>(
6219 (),
6220 0x732c69394548a76a,
6221 fidl::encoding::DynamicFlags::empty(),
6222 _decode,
6223 )
6224 }
6225
6226 fn r#graceful_shutdown(&self) -> Result<(), fidl::Error> {
6227 self.client.send::<fidl::encoding::EmptyPayload>(
6228 (),
6229 0x5dab12b50bc9909d,
6230 fidl::encoding::DynamicFlags::empty(),
6231 )
6232 }
6233}
6234
6235pub struct LinuxManagerEventStream {
6236 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6237}
6238
6239impl std::marker::Unpin for LinuxManagerEventStream {}
6240
6241impl futures::stream::FusedStream for LinuxManagerEventStream {
6242 fn is_terminated(&self) -> bool {
6243 self.event_receiver.is_terminated()
6244 }
6245}
6246
6247impl futures::Stream for LinuxManagerEventStream {
6248 type Item = Result<LinuxManagerEvent, fidl::Error>;
6249
6250 fn poll_next(
6251 mut self: std::pin::Pin<&mut Self>,
6252 cx: &mut std::task::Context<'_>,
6253 ) -> std::task::Poll<Option<Self::Item>> {
6254 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6255 &mut self.event_receiver,
6256 cx
6257 )?) {
6258 Some(buf) => std::task::Poll::Ready(Some(LinuxManagerEvent::decode(buf))),
6259 None => std::task::Poll::Ready(None),
6260 }
6261 }
6262}
6263
6264#[derive(Debug)]
6265pub enum LinuxManagerEvent {
6266 OnGuestInfoChanged { label: String, info: LinuxGuestInfo },
6267}
6268
6269impl LinuxManagerEvent {
6270 #[allow(irrefutable_let_patterns)]
6271 pub fn into_on_guest_info_changed(self) -> Option<(String, LinuxGuestInfo)> {
6272 if let LinuxManagerEvent::OnGuestInfoChanged { label, info } = self {
6273 Some((label, info))
6274 } else {
6275 None
6276 }
6277 }
6278
6279 fn decode(
6281 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6282 ) -> Result<LinuxManagerEvent, fidl::Error> {
6283 let (bytes, _handles) = buf.split_mut();
6284 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6285 debug_assert_eq!(tx_header.tx_id, 0);
6286 match tx_header.ordinal {
6287 0x30a9be4c43d6a2d6 => {
6288 let mut out = fidl::new_empty!(
6289 LinuxManagerOnGuestInfoChangedRequest,
6290 fidl::encoding::DefaultFuchsiaResourceDialect
6291 );
6292 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinuxManagerOnGuestInfoChangedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
6293 Ok((LinuxManagerEvent::OnGuestInfoChanged { label: out.label, info: out.info }))
6294 }
6295 _ => Err(fidl::Error::UnknownOrdinal {
6296 ordinal: tx_header.ordinal,
6297 protocol_name: <LinuxManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6298 }),
6299 }
6300 }
6301}
6302
6303pub struct LinuxManagerRequestStream {
6305 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6306 is_terminated: bool,
6307}
6308
6309impl std::marker::Unpin for LinuxManagerRequestStream {}
6310
6311impl futures::stream::FusedStream for LinuxManagerRequestStream {
6312 fn is_terminated(&self) -> bool {
6313 self.is_terminated
6314 }
6315}
6316
6317impl fidl::endpoints::RequestStream for LinuxManagerRequestStream {
6318 type Protocol = LinuxManagerMarker;
6319 type ControlHandle = LinuxManagerControlHandle;
6320
6321 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6322 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6323 }
6324
6325 fn control_handle(&self) -> Self::ControlHandle {
6326 LinuxManagerControlHandle { inner: self.inner.clone() }
6327 }
6328
6329 fn into_inner(
6330 self,
6331 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6332 {
6333 (self.inner, self.is_terminated)
6334 }
6335
6336 fn from_inner(
6337 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6338 is_terminated: bool,
6339 ) -> Self {
6340 Self { inner, is_terminated }
6341 }
6342}
6343
6344impl futures::Stream for LinuxManagerRequestStream {
6345 type Item = Result<LinuxManagerRequest, fidl::Error>;
6346
6347 fn poll_next(
6348 mut self: std::pin::Pin<&mut Self>,
6349 cx: &mut std::task::Context<'_>,
6350 ) -> std::task::Poll<Option<Self::Item>> {
6351 let this = &mut *self;
6352 if this.inner.check_shutdown(cx) {
6353 this.is_terminated = true;
6354 return std::task::Poll::Ready(None);
6355 }
6356 if this.is_terminated {
6357 panic!("polled LinuxManagerRequestStream after completion");
6358 }
6359 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6360 |bytes, handles| {
6361 match this.inner.channel().read_etc(cx, bytes, handles) {
6362 std::task::Poll::Ready(Ok(())) => {}
6363 std::task::Poll::Pending => return std::task::Poll::Pending,
6364 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6365 this.is_terminated = true;
6366 return std::task::Poll::Ready(None);
6367 }
6368 std::task::Poll::Ready(Err(e)) => {
6369 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6370 e.into(),
6371 ))))
6372 }
6373 }
6374
6375 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6377
6378 std::task::Poll::Ready(Some(match header.ordinal {
6379 0x11809ced100a2bea => {
6380 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6381 let mut req = fidl::new_empty!(
6382 LinuxManagerStartAndGetLinuxGuestInfoRequest,
6383 fidl::encoding::DefaultFuchsiaResourceDialect
6384 );
6385 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinuxManagerStartAndGetLinuxGuestInfoRequest>(&header, _body_bytes, handles, &mut req)?;
6386 let control_handle =
6387 LinuxManagerControlHandle { inner: this.inner.clone() };
6388 Ok(LinuxManagerRequest::StartAndGetLinuxGuestInfo {
6389 label: req.label,
6390
6391 responder: LinuxManagerStartAndGetLinuxGuestInfoResponder {
6392 control_handle: std::mem::ManuallyDrop::new(control_handle),
6393 tx_id: header.tx_id,
6394 },
6395 })
6396 }
6397 0x732c69394548a76a => {
6398 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6399 let mut req = fidl::new_empty!(
6400 fidl::encoding::EmptyPayload,
6401 fidl::encoding::DefaultFuchsiaResourceDialect
6402 );
6403 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6404 let control_handle =
6405 LinuxManagerControlHandle { inner: this.inner.clone() };
6406 Ok(LinuxManagerRequest::WipeData {
6407 responder: LinuxManagerWipeDataResponder {
6408 control_handle: std::mem::ManuallyDrop::new(control_handle),
6409 tx_id: header.tx_id,
6410 },
6411 })
6412 }
6413 0x5dab12b50bc9909d => {
6414 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6415 let mut req = fidl::new_empty!(
6416 fidl::encoding::EmptyPayload,
6417 fidl::encoding::DefaultFuchsiaResourceDialect
6418 );
6419 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6420 let control_handle =
6421 LinuxManagerControlHandle { inner: this.inner.clone() };
6422 Ok(LinuxManagerRequest::GracefulShutdown { control_handle })
6423 }
6424 _ => Err(fidl::Error::UnknownOrdinal {
6425 ordinal: header.ordinal,
6426 protocol_name:
6427 <LinuxManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6428 }),
6429 }))
6430 },
6431 )
6432 }
6433}
6434
6435#[derive(Debug)]
6437pub enum LinuxManagerRequest {
6438 StartAndGetLinuxGuestInfo {
6442 label: String,
6443 responder: LinuxManagerStartAndGetLinuxGuestInfoResponder,
6444 },
6445 WipeData { responder: LinuxManagerWipeDataResponder },
6452 GracefulShutdown { control_handle: LinuxManagerControlHandle },
6460}
6461
6462impl LinuxManagerRequest {
6463 #[allow(irrefutable_let_patterns)]
6464 pub fn into_start_and_get_linux_guest_info(
6465 self,
6466 ) -> Option<(String, LinuxManagerStartAndGetLinuxGuestInfoResponder)> {
6467 if let LinuxManagerRequest::StartAndGetLinuxGuestInfo { label, responder } = self {
6468 Some((label, responder))
6469 } else {
6470 None
6471 }
6472 }
6473
6474 #[allow(irrefutable_let_patterns)]
6475 pub fn into_wipe_data(self) -> Option<(LinuxManagerWipeDataResponder)> {
6476 if let LinuxManagerRequest::WipeData { responder } = self {
6477 Some((responder))
6478 } else {
6479 None
6480 }
6481 }
6482
6483 #[allow(irrefutable_let_patterns)]
6484 pub fn into_graceful_shutdown(self) -> Option<(LinuxManagerControlHandle)> {
6485 if let LinuxManagerRequest::GracefulShutdown { control_handle } = self {
6486 Some((control_handle))
6487 } else {
6488 None
6489 }
6490 }
6491
6492 pub fn method_name(&self) -> &'static str {
6494 match *self {
6495 LinuxManagerRequest::StartAndGetLinuxGuestInfo { .. } => {
6496 "start_and_get_linux_guest_info"
6497 }
6498 LinuxManagerRequest::WipeData { .. } => "wipe_data",
6499 LinuxManagerRequest::GracefulShutdown { .. } => "graceful_shutdown",
6500 }
6501 }
6502}
6503
6504#[derive(Debug, Clone)]
6505pub struct LinuxManagerControlHandle {
6506 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6507}
6508
6509impl fidl::endpoints::ControlHandle for LinuxManagerControlHandle {
6510 fn shutdown(&self) {
6511 self.inner.shutdown()
6512 }
6513 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6514 self.inner.shutdown_with_epitaph(status)
6515 }
6516
6517 fn is_closed(&self) -> bool {
6518 self.inner.channel().is_closed()
6519 }
6520 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6521 self.inner.channel().on_closed()
6522 }
6523
6524 #[cfg(target_os = "fuchsia")]
6525 fn signal_peer(
6526 &self,
6527 clear_mask: zx::Signals,
6528 set_mask: zx::Signals,
6529 ) -> Result<(), zx_status::Status> {
6530 use fidl::Peered;
6531 self.inner.channel().signal_peer(clear_mask, set_mask)
6532 }
6533}
6534
6535impl LinuxManagerControlHandle {
6536 pub fn send_on_guest_info_changed(
6537 &self,
6538 mut label: &str,
6539 mut info: &LinuxGuestInfo,
6540 ) -> Result<(), fidl::Error> {
6541 self.inner.send::<LinuxManagerOnGuestInfoChangedRequest>(
6542 (label, info),
6543 0,
6544 0x30a9be4c43d6a2d6,
6545 fidl::encoding::DynamicFlags::empty(),
6546 )
6547 }
6548}
6549
6550#[must_use = "FIDL methods require a response to be sent"]
6551#[derive(Debug)]
6552pub struct LinuxManagerStartAndGetLinuxGuestInfoResponder {
6553 control_handle: std::mem::ManuallyDrop<LinuxManagerControlHandle>,
6554 tx_id: u32,
6555}
6556
6557impl std::ops::Drop for LinuxManagerStartAndGetLinuxGuestInfoResponder {
6561 fn drop(&mut self) {
6562 self.control_handle.shutdown();
6563 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6565 }
6566}
6567
6568impl fidl::endpoints::Responder for LinuxManagerStartAndGetLinuxGuestInfoResponder {
6569 type ControlHandle = LinuxManagerControlHandle;
6570
6571 fn control_handle(&self) -> &LinuxManagerControlHandle {
6572 &self.control_handle
6573 }
6574
6575 fn drop_without_shutdown(mut self) {
6576 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6578 std::mem::forget(self);
6580 }
6581}
6582
6583impl LinuxManagerStartAndGetLinuxGuestInfoResponder {
6584 pub fn send(self, mut result: Result<&LinuxGuestInfo, i32>) -> Result<(), fidl::Error> {
6588 let _result = self.send_raw(result);
6589 if _result.is_err() {
6590 self.control_handle.shutdown();
6591 }
6592 self.drop_without_shutdown();
6593 _result
6594 }
6595
6596 pub fn send_no_shutdown_on_err(
6598 self,
6599 mut result: Result<&LinuxGuestInfo, i32>,
6600 ) -> Result<(), fidl::Error> {
6601 let _result = self.send_raw(result);
6602 self.drop_without_shutdown();
6603 _result
6604 }
6605
6606 fn send_raw(&self, mut result: Result<&LinuxGuestInfo, i32>) -> Result<(), fidl::Error> {
6607 self.control_handle.inner.send::<fidl::encoding::ResultType<
6608 LinuxManagerStartAndGetLinuxGuestInfoResponse,
6609 i32,
6610 >>(
6611 result.map(|info| (info,)),
6612 self.tx_id,
6613 0x11809ced100a2bea,
6614 fidl::encoding::DynamicFlags::empty(),
6615 )
6616 }
6617}
6618
6619#[must_use = "FIDL methods require a response to be sent"]
6620#[derive(Debug)]
6621pub struct LinuxManagerWipeDataResponder {
6622 control_handle: std::mem::ManuallyDrop<LinuxManagerControlHandle>,
6623 tx_id: u32,
6624}
6625
6626impl std::ops::Drop for LinuxManagerWipeDataResponder {
6630 fn drop(&mut self) {
6631 self.control_handle.shutdown();
6632 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6634 }
6635}
6636
6637impl fidl::endpoints::Responder for LinuxManagerWipeDataResponder {
6638 type ControlHandle = LinuxManagerControlHandle;
6639
6640 fn control_handle(&self) -> &LinuxManagerControlHandle {
6641 &self.control_handle
6642 }
6643
6644 fn drop_without_shutdown(mut self) {
6645 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6647 std::mem::forget(self);
6649 }
6650}
6651
6652impl LinuxManagerWipeDataResponder {
6653 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6657 let _result = self.send_raw(result);
6658 if _result.is_err() {
6659 self.control_handle.shutdown();
6660 }
6661 self.drop_without_shutdown();
6662 _result
6663 }
6664
6665 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6667 let _result = self.send_raw(result);
6668 self.drop_without_shutdown();
6669 _result
6670 }
6671
6672 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6673 self.control_handle
6674 .inner
6675 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6676 result,
6677 self.tx_id,
6678 0x732c69394548a76a,
6679 fidl::encoding::DynamicFlags::empty(),
6680 )
6681 }
6682}
6683
6684#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6685pub struct MemControllerMarker;
6686
6687impl fidl::endpoints::ProtocolMarker for MemControllerMarker {
6688 type Proxy = MemControllerProxy;
6689 type RequestStream = MemControllerRequestStream;
6690 #[cfg(target_os = "fuchsia")]
6691 type SynchronousProxy = MemControllerSynchronousProxy;
6692
6693 const DEBUG_NAME: &'static str = "fuchsia.virtualization.MemController";
6694}
6695impl fidl::endpoints::DiscoverableProtocolMarker for MemControllerMarker {}
6696
6697pub trait MemControllerProxyInterface: Send + Sync {
6698 type GetMemSizeResponseFut: std::future::Future<Output = Result<(u64, u64, u64, u64, u64), fidl::Error>>
6699 + Send;
6700 fn r#get_mem_size(&self) -> Self::GetMemSizeResponseFut;
6701 fn r#request_size(&self, requested_size: u64) -> Result<(), fidl::Error>;
6702}
6703#[derive(Debug)]
6704#[cfg(target_os = "fuchsia")]
6705pub struct MemControllerSynchronousProxy {
6706 client: fidl::client::sync::Client,
6707}
6708
6709#[cfg(target_os = "fuchsia")]
6710impl fidl::endpoints::SynchronousProxy for MemControllerSynchronousProxy {
6711 type Proxy = MemControllerProxy;
6712 type Protocol = MemControllerMarker;
6713
6714 fn from_channel(inner: fidl::Channel) -> Self {
6715 Self::new(inner)
6716 }
6717
6718 fn into_channel(self) -> fidl::Channel {
6719 self.client.into_channel()
6720 }
6721
6722 fn as_channel(&self) -> &fidl::Channel {
6723 self.client.as_channel()
6724 }
6725}
6726
6727#[cfg(target_os = "fuchsia")]
6728impl MemControllerSynchronousProxy {
6729 pub fn new(channel: fidl::Channel) -> Self {
6730 let protocol_name = <MemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6731 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6732 }
6733
6734 pub fn into_channel(self) -> fidl::Channel {
6735 self.client.into_channel()
6736 }
6737
6738 pub fn wait_for_event(
6741 &self,
6742 deadline: zx::MonotonicInstant,
6743 ) -> Result<MemControllerEvent, fidl::Error> {
6744 MemControllerEvent::decode(self.client.wait_for_event(deadline)?)
6745 }
6746
6747 pub fn r#get_mem_size(
6758 &self,
6759 ___deadline: zx::MonotonicInstant,
6760 ) -> Result<(u64, u64, u64, u64, u64), fidl::Error> {
6761 let _response = self
6762 .client
6763 .send_query::<fidl::encoding::EmptyPayload, MemControllerGetMemSizeResponse>(
6764 (),
6765 0x6e9d496f9b66ea56,
6766 fidl::encoding::DynamicFlags::empty(),
6767 ___deadline,
6768 )?;
6769 Ok((
6770 _response.block_size,
6771 _response.region_size,
6772 _response.usable_region_size,
6773 _response.plugged_size,
6774 _response.requested_size,
6775 ))
6776 }
6777
6778 pub fn r#request_size(&self, mut requested_size: u64) -> Result<(), fidl::Error> {
6783 self.client.send::<MemControllerRequestSizeRequest>(
6784 (requested_size,),
6785 0x12f8e2cc21ee8102,
6786 fidl::encoding::DynamicFlags::empty(),
6787 )
6788 }
6789}
6790
6791#[cfg(target_os = "fuchsia")]
6792impl From<MemControllerSynchronousProxy> for zx::Handle {
6793 fn from(value: MemControllerSynchronousProxy) -> Self {
6794 value.into_channel().into()
6795 }
6796}
6797
6798#[cfg(target_os = "fuchsia")]
6799impl From<fidl::Channel> for MemControllerSynchronousProxy {
6800 fn from(value: fidl::Channel) -> Self {
6801 Self::new(value)
6802 }
6803}
6804
6805#[derive(Debug, Clone)]
6806pub struct MemControllerProxy {
6807 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6808}
6809
6810impl fidl::endpoints::Proxy for MemControllerProxy {
6811 type Protocol = MemControllerMarker;
6812
6813 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6814 Self::new(inner)
6815 }
6816
6817 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6818 self.client.into_channel().map_err(|client| Self { client })
6819 }
6820
6821 fn as_channel(&self) -> &::fidl::AsyncChannel {
6822 self.client.as_channel()
6823 }
6824}
6825
6826impl MemControllerProxy {
6827 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6829 let protocol_name = <MemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6830 Self { client: fidl::client::Client::new(channel, protocol_name) }
6831 }
6832
6833 pub fn take_event_stream(&self) -> MemControllerEventStream {
6839 MemControllerEventStream { event_receiver: self.client.take_event_receiver() }
6840 }
6841
6842 pub fn r#get_mem_size(
6853 &self,
6854 ) -> fidl::client::QueryResponseFut<
6855 (u64, u64, u64, u64, u64),
6856 fidl::encoding::DefaultFuchsiaResourceDialect,
6857 > {
6858 MemControllerProxyInterface::r#get_mem_size(self)
6859 }
6860
6861 pub fn r#request_size(&self, mut requested_size: u64) -> Result<(), fidl::Error> {
6866 MemControllerProxyInterface::r#request_size(self, requested_size)
6867 }
6868}
6869
6870impl MemControllerProxyInterface for MemControllerProxy {
6871 type GetMemSizeResponseFut = fidl::client::QueryResponseFut<
6872 (u64, u64, u64, u64, u64),
6873 fidl::encoding::DefaultFuchsiaResourceDialect,
6874 >;
6875 fn r#get_mem_size(&self) -> Self::GetMemSizeResponseFut {
6876 fn _decode(
6877 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6878 ) -> Result<(u64, u64, u64, u64, u64), fidl::Error> {
6879 let _response = fidl::client::decode_transaction_body::<
6880 MemControllerGetMemSizeResponse,
6881 fidl::encoding::DefaultFuchsiaResourceDialect,
6882 0x6e9d496f9b66ea56,
6883 >(_buf?)?;
6884 Ok((
6885 _response.block_size,
6886 _response.region_size,
6887 _response.usable_region_size,
6888 _response.plugged_size,
6889 _response.requested_size,
6890 ))
6891 }
6892 self.client
6893 .send_query_and_decode::<fidl::encoding::EmptyPayload, (u64, u64, u64, u64, u64)>(
6894 (),
6895 0x6e9d496f9b66ea56,
6896 fidl::encoding::DynamicFlags::empty(),
6897 _decode,
6898 )
6899 }
6900
6901 fn r#request_size(&self, mut requested_size: u64) -> Result<(), fidl::Error> {
6902 self.client.send::<MemControllerRequestSizeRequest>(
6903 (requested_size,),
6904 0x12f8e2cc21ee8102,
6905 fidl::encoding::DynamicFlags::empty(),
6906 )
6907 }
6908}
6909
6910pub struct MemControllerEventStream {
6911 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6912}
6913
6914impl std::marker::Unpin for MemControllerEventStream {}
6915
6916impl futures::stream::FusedStream for MemControllerEventStream {
6917 fn is_terminated(&self) -> bool {
6918 self.event_receiver.is_terminated()
6919 }
6920}
6921
6922impl futures::Stream for MemControllerEventStream {
6923 type Item = Result<MemControllerEvent, fidl::Error>;
6924
6925 fn poll_next(
6926 mut self: std::pin::Pin<&mut Self>,
6927 cx: &mut std::task::Context<'_>,
6928 ) -> std::task::Poll<Option<Self::Item>> {
6929 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6930 &mut self.event_receiver,
6931 cx
6932 )?) {
6933 Some(buf) => std::task::Poll::Ready(Some(MemControllerEvent::decode(buf))),
6934 None => std::task::Poll::Ready(None),
6935 }
6936 }
6937}
6938
6939#[derive(Debug)]
6940pub enum MemControllerEvent {}
6941
6942impl MemControllerEvent {
6943 fn decode(
6945 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6946 ) -> Result<MemControllerEvent, fidl::Error> {
6947 let (bytes, _handles) = buf.split_mut();
6948 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6949 debug_assert_eq!(tx_header.tx_id, 0);
6950 match tx_header.ordinal {
6951 _ => Err(fidl::Error::UnknownOrdinal {
6952 ordinal: tx_header.ordinal,
6953 protocol_name: <MemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6954 }),
6955 }
6956 }
6957}
6958
6959pub struct MemControllerRequestStream {
6961 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6962 is_terminated: bool,
6963}
6964
6965impl std::marker::Unpin for MemControllerRequestStream {}
6966
6967impl futures::stream::FusedStream for MemControllerRequestStream {
6968 fn is_terminated(&self) -> bool {
6969 self.is_terminated
6970 }
6971}
6972
6973impl fidl::endpoints::RequestStream for MemControllerRequestStream {
6974 type Protocol = MemControllerMarker;
6975 type ControlHandle = MemControllerControlHandle;
6976
6977 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6978 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6979 }
6980
6981 fn control_handle(&self) -> Self::ControlHandle {
6982 MemControllerControlHandle { inner: self.inner.clone() }
6983 }
6984
6985 fn into_inner(
6986 self,
6987 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6988 {
6989 (self.inner, self.is_terminated)
6990 }
6991
6992 fn from_inner(
6993 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6994 is_terminated: bool,
6995 ) -> Self {
6996 Self { inner, is_terminated }
6997 }
6998}
6999
7000impl futures::Stream for MemControllerRequestStream {
7001 type Item = Result<MemControllerRequest, fidl::Error>;
7002
7003 fn poll_next(
7004 mut self: std::pin::Pin<&mut Self>,
7005 cx: &mut std::task::Context<'_>,
7006 ) -> std::task::Poll<Option<Self::Item>> {
7007 let this = &mut *self;
7008 if this.inner.check_shutdown(cx) {
7009 this.is_terminated = true;
7010 return std::task::Poll::Ready(None);
7011 }
7012 if this.is_terminated {
7013 panic!("polled MemControllerRequestStream after completion");
7014 }
7015 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7016 |bytes, handles| {
7017 match this.inner.channel().read_etc(cx, bytes, handles) {
7018 std::task::Poll::Ready(Ok(())) => {}
7019 std::task::Poll::Pending => return std::task::Poll::Pending,
7020 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7021 this.is_terminated = true;
7022 return std::task::Poll::Ready(None);
7023 }
7024 std::task::Poll::Ready(Err(e)) => {
7025 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7026 e.into(),
7027 ))))
7028 }
7029 }
7030
7031 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7033
7034 std::task::Poll::Ready(Some(match header.ordinal {
7035 0x6e9d496f9b66ea56 => {
7036 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7037 let mut req = fidl::new_empty!(
7038 fidl::encoding::EmptyPayload,
7039 fidl::encoding::DefaultFuchsiaResourceDialect
7040 );
7041 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7042 let control_handle =
7043 MemControllerControlHandle { inner: this.inner.clone() };
7044 Ok(MemControllerRequest::GetMemSize {
7045 responder: MemControllerGetMemSizeResponder {
7046 control_handle: std::mem::ManuallyDrop::new(control_handle),
7047 tx_id: header.tx_id,
7048 },
7049 })
7050 }
7051 0x12f8e2cc21ee8102 => {
7052 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7053 let mut req = fidl::new_empty!(
7054 MemControllerRequestSizeRequest,
7055 fidl::encoding::DefaultFuchsiaResourceDialect
7056 );
7057 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MemControllerRequestSizeRequest>(&header, _body_bytes, handles, &mut req)?;
7058 let control_handle =
7059 MemControllerControlHandle { inner: this.inner.clone() };
7060 Ok(MemControllerRequest::RequestSize {
7061 requested_size: req.requested_size,
7062
7063 control_handle,
7064 })
7065 }
7066 _ => Err(fidl::Error::UnknownOrdinal {
7067 ordinal: header.ordinal,
7068 protocol_name:
7069 <MemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7070 }),
7071 }))
7072 },
7073 )
7074 }
7075}
7076
7077#[derive(Debug)]
7079pub enum MemControllerRequest {
7080 GetMemSize { responder: MemControllerGetMemSizeResponder },
7091 RequestSize { requested_size: u64, control_handle: MemControllerControlHandle },
7096}
7097
7098impl MemControllerRequest {
7099 #[allow(irrefutable_let_patterns)]
7100 pub fn into_get_mem_size(self) -> Option<(MemControllerGetMemSizeResponder)> {
7101 if let MemControllerRequest::GetMemSize { responder } = self {
7102 Some((responder))
7103 } else {
7104 None
7105 }
7106 }
7107
7108 #[allow(irrefutable_let_patterns)]
7109 pub fn into_request_size(self) -> Option<(u64, MemControllerControlHandle)> {
7110 if let MemControllerRequest::RequestSize { requested_size, control_handle } = self {
7111 Some((requested_size, control_handle))
7112 } else {
7113 None
7114 }
7115 }
7116
7117 pub fn method_name(&self) -> &'static str {
7119 match *self {
7120 MemControllerRequest::GetMemSize { .. } => "get_mem_size",
7121 MemControllerRequest::RequestSize { .. } => "request_size",
7122 }
7123 }
7124}
7125
7126#[derive(Debug, Clone)]
7127pub struct MemControllerControlHandle {
7128 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7129}
7130
7131impl fidl::endpoints::ControlHandle for MemControllerControlHandle {
7132 fn shutdown(&self) {
7133 self.inner.shutdown()
7134 }
7135 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7136 self.inner.shutdown_with_epitaph(status)
7137 }
7138
7139 fn is_closed(&self) -> bool {
7140 self.inner.channel().is_closed()
7141 }
7142 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7143 self.inner.channel().on_closed()
7144 }
7145
7146 #[cfg(target_os = "fuchsia")]
7147 fn signal_peer(
7148 &self,
7149 clear_mask: zx::Signals,
7150 set_mask: zx::Signals,
7151 ) -> Result<(), zx_status::Status> {
7152 use fidl::Peered;
7153 self.inner.channel().signal_peer(clear_mask, set_mask)
7154 }
7155}
7156
7157impl MemControllerControlHandle {}
7158
7159#[must_use = "FIDL methods require a response to be sent"]
7160#[derive(Debug)]
7161pub struct MemControllerGetMemSizeResponder {
7162 control_handle: std::mem::ManuallyDrop<MemControllerControlHandle>,
7163 tx_id: u32,
7164}
7165
7166impl std::ops::Drop for MemControllerGetMemSizeResponder {
7170 fn drop(&mut self) {
7171 self.control_handle.shutdown();
7172 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7174 }
7175}
7176
7177impl fidl::endpoints::Responder for MemControllerGetMemSizeResponder {
7178 type ControlHandle = MemControllerControlHandle;
7179
7180 fn control_handle(&self) -> &MemControllerControlHandle {
7181 &self.control_handle
7182 }
7183
7184 fn drop_without_shutdown(mut self) {
7185 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7187 std::mem::forget(self);
7189 }
7190}
7191
7192impl MemControllerGetMemSizeResponder {
7193 pub fn send(
7197 self,
7198 mut block_size: u64,
7199 mut region_size: u64,
7200 mut usable_region_size: u64,
7201 mut plugged_size: u64,
7202 mut requested_size: u64,
7203 ) -> Result<(), fidl::Error> {
7204 let _result = self.send_raw(
7205 block_size,
7206 region_size,
7207 usable_region_size,
7208 plugged_size,
7209 requested_size,
7210 );
7211 if _result.is_err() {
7212 self.control_handle.shutdown();
7213 }
7214 self.drop_without_shutdown();
7215 _result
7216 }
7217
7218 pub fn send_no_shutdown_on_err(
7220 self,
7221 mut block_size: u64,
7222 mut region_size: u64,
7223 mut usable_region_size: u64,
7224 mut plugged_size: u64,
7225 mut requested_size: u64,
7226 ) -> Result<(), fidl::Error> {
7227 let _result = self.send_raw(
7228 block_size,
7229 region_size,
7230 usable_region_size,
7231 plugged_size,
7232 requested_size,
7233 );
7234 self.drop_without_shutdown();
7235 _result
7236 }
7237
7238 fn send_raw(
7239 &self,
7240 mut block_size: u64,
7241 mut region_size: u64,
7242 mut usable_region_size: u64,
7243 mut plugged_size: u64,
7244 mut requested_size: u64,
7245 ) -> Result<(), fidl::Error> {
7246 self.control_handle.inner.send::<MemControllerGetMemSizeResponse>(
7247 (block_size, region_size, usable_region_size, plugged_size, requested_size),
7248 self.tx_id,
7249 0x6e9d496f9b66ea56,
7250 fidl::encoding::DynamicFlags::empty(),
7251 )
7252 }
7253}
7254
7255#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7256pub struct TerminaGuestManagerMarker;
7257
7258impl fidl::endpoints::ProtocolMarker for TerminaGuestManagerMarker {
7259 type Proxy = TerminaGuestManagerProxy;
7260 type RequestStream = TerminaGuestManagerRequestStream;
7261 #[cfg(target_os = "fuchsia")]
7262 type SynchronousProxy = TerminaGuestManagerSynchronousProxy;
7263
7264 const DEBUG_NAME: &'static str = "fuchsia.virtualization.TerminaGuestManager";
7265}
7266impl fidl::endpoints::DiscoverableProtocolMarker for TerminaGuestManagerMarker {}
7267
7268pub trait TerminaGuestManagerProxyInterface: Send + Sync {
7269 type LaunchResponseFut: std::future::Future<Output = Result<GuestManagerLaunchResult, fidl::Error>>
7270 + Send;
7271 fn r#launch(
7272 &self,
7273 guest_config: GuestConfig,
7274 controller: fidl::endpoints::ServerEnd<GuestMarker>,
7275 ) -> Self::LaunchResponseFut;
7276 type ForceShutdownResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
7277 fn r#force_shutdown(&self) -> Self::ForceShutdownResponseFut;
7278 type ConnectResponseFut: std::future::Future<Output = Result<GuestManagerConnectResult, fidl::Error>>
7279 + Send;
7280 fn r#connect(
7281 &self,
7282 controller: fidl::endpoints::ServerEnd<GuestMarker>,
7283 ) -> Self::ConnectResponseFut;
7284 type GetInfoResponseFut: std::future::Future<Output = Result<GuestInfo, fidl::Error>> + Send;
7285 fn r#get_info(&self) -> Self::GetInfoResponseFut;
7286}
7287#[derive(Debug)]
7288#[cfg(target_os = "fuchsia")]
7289pub struct TerminaGuestManagerSynchronousProxy {
7290 client: fidl::client::sync::Client,
7291}
7292
7293#[cfg(target_os = "fuchsia")]
7294impl fidl::endpoints::SynchronousProxy for TerminaGuestManagerSynchronousProxy {
7295 type Proxy = TerminaGuestManagerProxy;
7296 type Protocol = TerminaGuestManagerMarker;
7297
7298 fn from_channel(inner: fidl::Channel) -> Self {
7299 Self::new(inner)
7300 }
7301
7302 fn into_channel(self) -> fidl::Channel {
7303 self.client.into_channel()
7304 }
7305
7306 fn as_channel(&self) -> &fidl::Channel {
7307 self.client.as_channel()
7308 }
7309}
7310
7311#[cfg(target_os = "fuchsia")]
7312impl TerminaGuestManagerSynchronousProxy {
7313 pub fn new(channel: fidl::Channel) -> Self {
7314 let protocol_name =
7315 <TerminaGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7316 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7317 }
7318
7319 pub fn into_channel(self) -> fidl::Channel {
7320 self.client.into_channel()
7321 }
7322
7323 pub fn wait_for_event(
7326 &self,
7327 deadline: zx::MonotonicInstant,
7328 ) -> Result<TerminaGuestManagerEvent, fidl::Error> {
7329 TerminaGuestManagerEvent::decode(self.client.wait_for_event(deadline)?)
7330 }
7331
7332 pub fn r#launch(
7341 &self,
7342 mut guest_config: GuestConfig,
7343 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
7344 ___deadline: zx::MonotonicInstant,
7345 ) -> Result<GuestManagerLaunchResult, fidl::Error> {
7346 let _response =
7347 self.client.send_query::<GuestManagerLaunchRequest, fidl::encoding::ResultType<
7348 fidl::encoding::EmptyStruct,
7349 GuestManagerError,
7350 >>(
7351 (&mut guest_config, controller),
7352 0x394a2e29f750323e,
7353 fidl::encoding::DynamicFlags::empty(),
7354 ___deadline,
7355 )?;
7356 Ok(_response.map(|x| x))
7357 }
7358
7359 pub fn r#force_shutdown(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
7362 let _response =
7363 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
7364 (),
7365 0x3ad9a012982f872d,
7366 fidl::encoding::DynamicFlags::empty(),
7367 ___deadline,
7368 )?;
7369 Ok(_response)
7370 }
7371
7372 pub fn r#connect(
7378 &self,
7379 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
7380 ___deadline: zx::MonotonicInstant,
7381 ) -> Result<GuestManagerConnectResult, fidl::Error> {
7382 let _response =
7383 self.client.send_query::<GuestManagerConnectRequest, fidl::encoding::ResultType<
7384 fidl::encoding::EmptyStruct,
7385 GuestManagerError,
7386 >>(
7387 (controller,),
7388 0x4e489076e3bb15b4,
7389 fidl::encoding::DynamicFlags::empty(),
7390 ___deadline,
7391 )?;
7392 Ok(_response.map(|x| x))
7393 }
7394
7395 pub fn r#get_info(&self, ___deadline: zx::MonotonicInstant) -> Result<GuestInfo, fidl::Error> {
7397 let _response =
7398 self.client.send_query::<fidl::encoding::EmptyPayload, GuestManagerGetInfoResponse>(
7399 (),
7400 0x76892614aea695dc,
7401 fidl::encoding::DynamicFlags::empty(),
7402 ___deadline,
7403 )?;
7404 Ok(_response.guest_info)
7405 }
7406}
7407
7408#[cfg(target_os = "fuchsia")]
7409impl From<TerminaGuestManagerSynchronousProxy> for zx::Handle {
7410 fn from(value: TerminaGuestManagerSynchronousProxy) -> Self {
7411 value.into_channel().into()
7412 }
7413}
7414
7415#[cfg(target_os = "fuchsia")]
7416impl From<fidl::Channel> for TerminaGuestManagerSynchronousProxy {
7417 fn from(value: fidl::Channel) -> Self {
7418 Self::new(value)
7419 }
7420}
7421
7422#[derive(Debug, Clone)]
7423pub struct TerminaGuestManagerProxy {
7424 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7425}
7426
7427impl fidl::endpoints::Proxy for TerminaGuestManagerProxy {
7428 type Protocol = TerminaGuestManagerMarker;
7429
7430 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7431 Self::new(inner)
7432 }
7433
7434 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7435 self.client.into_channel().map_err(|client| Self { client })
7436 }
7437
7438 fn as_channel(&self) -> &::fidl::AsyncChannel {
7439 self.client.as_channel()
7440 }
7441}
7442
7443impl TerminaGuestManagerProxy {
7444 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7446 let protocol_name =
7447 <TerminaGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7448 Self { client: fidl::client::Client::new(channel, protocol_name) }
7449 }
7450
7451 pub fn take_event_stream(&self) -> TerminaGuestManagerEventStream {
7457 TerminaGuestManagerEventStream { event_receiver: self.client.take_event_receiver() }
7458 }
7459
7460 pub fn r#launch(
7469 &self,
7470 mut guest_config: GuestConfig,
7471 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
7472 ) -> fidl::client::QueryResponseFut<
7473 GuestManagerLaunchResult,
7474 fidl::encoding::DefaultFuchsiaResourceDialect,
7475 > {
7476 TerminaGuestManagerProxyInterface::r#launch(self, guest_config, controller)
7477 }
7478
7479 pub fn r#force_shutdown(
7482 &self,
7483 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
7484 TerminaGuestManagerProxyInterface::r#force_shutdown(self)
7485 }
7486
7487 pub fn r#connect(
7493 &self,
7494 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
7495 ) -> fidl::client::QueryResponseFut<
7496 GuestManagerConnectResult,
7497 fidl::encoding::DefaultFuchsiaResourceDialect,
7498 > {
7499 TerminaGuestManagerProxyInterface::r#connect(self, controller)
7500 }
7501
7502 pub fn r#get_info(
7504 &self,
7505 ) -> fidl::client::QueryResponseFut<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
7506 {
7507 TerminaGuestManagerProxyInterface::r#get_info(self)
7508 }
7509}
7510
7511impl TerminaGuestManagerProxyInterface for TerminaGuestManagerProxy {
7512 type LaunchResponseFut = fidl::client::QueryResponseFut<
7513 GuestManagerLaunchResult,
7514 fidl::encoding::DefaultFuchsiaResourceDialect,
7515 >;
7516 fn r#launch(
7517 &self,
7518 mut guest_config: GuestConfig,
7519 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
7520 ) -> Self::LaunchResponseFut {
7521 fn _decode(
7522 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7523 ) -> Result<GuestManagerLaunchResult, fidl::Error> {
7524 let _response = fidl::client::decode_transaction_body::<
7525 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestManagerError>,
7526 fidl::encoding::DefaultFuchsiaResourceDialect,
7527 0x394a2e29f750323e,
7528 >(_buf?)?;
7529 Ok(_response.map(|x| x))
7530 }
7531 self.client.send_query_and_decode::<GuestManagerLaunchRequest, GuestManagerLaunchResult>(
7532 (&mut guest_config, controller),
7533 0x394a2e29f750323e,
7534 fidl::encoding::DynamicFlags::empty(),
7535 _decode,
7536 )
7537 }
7538
7539 type ForceShutdownResponseFut =
7540 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7541 fn r#force_shutdown(&self) -> Self::ForceShutdownResponseFut {
7542 fn _decode(
7543 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7544 ) -> Result<(), fidl::Error> {
7545 let _response = fidl::client::decode_transaction_body::<
7546 fidl::encoding::EmptyPayload,
7547 fidl::encoding::DefaultFuchsiaResourceDialect,
7548 0x3ad9a012982f872d,
7549 >(_buf?)?;
7550 Ok(_response)
7551 }
7552 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
7553 (),
7554 0x3ad9a012982f872d,
7555 fidl::encoding::DynamicFlags::empty(),
7556 _decode,
7557 )
7558 }
7559
7560 type ConnectResponseFut = fidl::client::QueryResponseFut<
7561 GuestManagerConnectResult,
7562 fidl::encoding::DefaultFuchsiaResourceDialect,
7563 >;
7564 fn r#connect(
7565 &self,
7566 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
7567 ) -> Self::ConnectResponseFut {
7568 fn _decode(
7569 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7570 ) -> Result<GuestManagerConnectResult, fidl::Error> {
7571 let _response = fidl::client::decode_transaction_body::<
7572 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestManagerError>,
7573 fidl::encoding::DefaultFuchsiaResourceDialect,
7574 0x4e489076e3bb15b4,
7575 >(_buf?)?;
7576 Ok(_response.map(|x| x))
7577 }
7578 self.client.send_query_and_decode::<GuestManagerConnectRequest, GuestManagerConnectResult>(
7579 (controller,),
7580 0x4e489076e3bb15b4,
7581 fidl::encoding::DynamicFlags::empty(),
7582 _decode,
7583 )
7584 }
7585
7586 type GetInfoResponseFut =
7587 fidl::client::QueryResponseFut<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
7588 fn r#get_info(&self) -> Self::GetInfoResponseFut {
7589 fn _decode(
7590 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7591 ) -> Result<GuestInfo, fidl::Error> {
7592 let _response = fidl::client::decode_transaction_body::<
7593 GuestManagerGetInfoResponse,
7594 fidl::encoding::DefaultFuchsiaResourceDialect,
7595 0x76892614aea695dc,
7596 >(_buf?)?;
7597 Ok(_response.guest_info)
7598 }
7599 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GuestInfo>(
7600 (),
7601 0x76892614aea695dc,
7602 fidl::encoding::DynamicFlags::empty(),
7603 _decode,
7604 )
7605 }
7606}
7607
7608pub struct TerminaGuestManagerEventStream {
7609 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7610}
7611
7612impl std::marker::Unpin for TerminaGuestManagerEventStream {}
7613
7614impl futures::stream::FusedStream for TerminaGuestManagerEventStream {
7615 fn is_terminated(&self) -> bool {
7616 self.event_receiver.is_terminated()
7617 }
7618}
7619
7620impl futures::Stream for TerminaGuestManagerEventStream {
7621 type Item = Result<TerminaGuestManagerEvent, fidl::Error>;
7622
7623 fn poll_next(
7624 mut self: std::pin::Pin<&mut Self>,
7625 cx: &mut std::task::Context<'_>,
7626 ) -> std::task::Poll<Option<Self::Item>> {
7627 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7628 &mut self.event_receiver,
7629 cx
7630 )?) {
7631 Some(buf) => std::task::Poll::Ready(Some(TerminaGuestManagerEvent::decode(buf))),
7632 None => std::task::Poll::Ready(None),
7633 }
7634 }
7635}
7636
7637#[derive(Debug)]
7638pub enum TerminaGuestManagerEvent {}
7639
7640impl TerminaGuestManagerEvent {
7641 fn decode(
7643 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7644 ) -> Result<TerminaGuestManagerEvent, fidl::Error> {
7645 let (bytes, _handles) = buf.split_mut();
7646 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7647 debug_assert_eq!(tx_header.tx_id, 0);
7648 match tx_header.ordinal {
7649 _ => Err(fidl::Error::UnknownOrdinal {
7650 ordinal: tx_header.ordinal,
7651 protocol_name:
7652 <TerminaGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7653 }),
7654 }
7655 }
7656}
7657
7658pub struct TerminaGuestManagerRequestStream {
7660 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7661 is_terminated: bool,
7662}
7663
7664impl std::marker::Unpin for TerminaGuestManagerRequestStream {}
7665
7666impl futures::stream::FusedStream for TerminaGuestManagerRequestStream {
7667 fn is_terminated(&self) -> bool {
7668 self.is_terminated
7669 }
7670}
7671
7672impl fidl::endpoints::RequestStream for TerminaGuestManagerRequestStream {
7673 type Protocol = TerminaGuestManagerMarker;
7674 type ControlHandle = TerminaGuestManagerControlHandle;
7675
7676 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7677 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7678 }
7679
7680 fn control_handle(&self) -> Self::ControlHandle {
7681 TerminaGuestManagerControlHandle { inner: self.inner.clone() }
7682 }
7683
7684 fn into_inner(
7685 self,
7686 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7687 {
7688 (self.inner, self.is_terminated)
7689 }
7690
7691 fn from_inner(
7692 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7693 is_terminated: bool,
7694 ) -> Self {
7695 Self { inner, is_terminated }
7696 }
7697}
7698
7699impl futures::Stream for TerminaGuestManagerRequestStream {
7700 type Item = Result<TerminaGuestManagerRequest, fidl::Error>;
7701
7702 fn poll_next(
7703 mut self: std::pin::Pin<&mut Self>,
7704 cx: &mut std::task::Context<'_>,
7705 ) -> std::task::Poll<Option<Self::Item>> {
7706 let this = &mut *self;
7707 if this.inner.check_shutdown(cx) {
7708 this.is_terminated = true;
7709 return std::task::Poll::Ready(None);
7710 }
7711 if this.is_terminated {
7712 panic!("polled TerminaGuestManagerRequestStream after completion");
7713 }
7714 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7715 |bytes, handles| {
7716 match this.inner.channel().read_etc(cx, bytes, handles) {
7717 std::task::Poll::Ready(Ok(())) => {}
7718 std::task::Poll::Pending => return std::task::Poll::Pending,
7719 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7720 this.is_terminated = true;
7721 return std::task::Poll::Ready(None);
7722 }
7723 std::task::Poll::Ready(Err(e)) => {
7724 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7725 e.into(),
7726 ))))
7727 }
7728 }
7729
7730 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7732
7733 std::task::Poll::Ready(Some(match header.ordinal {
7734 0x394a2e29f750323e => {
7735 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7736 let mut req = fidl::new_empty!(GuestManagerLaunchRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7737 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestManagerLaunchRequest>(&header, _body_bytes, handles, &mut req)?;
7738 let control_handle = TerminaGuestManagerControlHandle {
7739 inner: this.inner.clone(),
7740 };
7741 Ok(TerminaGuestManagerRequest::Launch {guest_config: req.guest_config,
7742controller: req.controller,
7743
7744 responder: TerminaGuestManagerLaunchResponder {
7745 control_handle: std::mem::ManuallyDrop::new(control_handle),
7746 tx_id: header.tx_id,
7747 },
7748 })
7749 }
7750 0x3ad9a012982f872d => {
7751 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7752 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7753 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7754 let control_handle = TerminaGuestManagerControlHandle {
7755 inner: this.inner.clone(),
7756 };
7757 Ok(TerminaGuestManagerRequest::ForceShutdown {
7758 responder: TerminaGuestManagerForceShutdownResponder {
7759 control_handle: std::mem::ManuallyDrop::new(control_handle),
7760 tx_id: header.tx_id,
7761 },
7762 })
7763 }
7764 0x4e489076e3bb15b4 => {
7765 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7766 let mut req = fidl::new_empty!(GuestManagerConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7767 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestManagerConnectRequest>(&header, _body_bytes, handles, &mut req)?;
7768 let control_handle = TerminaGuestManagerControlHandle {
7769 inner: this.inner.clone(),
7770 };
7771 Ok(TerminaGuestManagerRequest::Connect {controller: req.controller,
7772
7773 responder: TerminaGuestManagerConnectResponder {
7774 control_handle: std::mem::ManuallyDrop::new(control_handle),
7775 tx_id: header.tx_id,
7776 },
7777 })
7778 }
7779 0x76892614aea695dc => {
7780 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7781 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7782 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7783 let control_handle = TerminaGuestManagerControlHandle {
7784 inner: this.inner.clone(),
7785 };
7786 Ok(TerminaGuestManagerRequest::GetInfo {
7787 responder: TerminaGuestManagerGetInfoResponder {
7788 control_handle: std::mem::ManuallyDrop::new(control_handle),
7789 tx_id: header.tx_id,
7790 },
7791 })
7792 }
7793 _ => Err(fidl::Error::UnknownOrdinal {
7794 ordinal: header.ordinal,
7795 protocol_name: <TerminaGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7796 }),
7797 }))
7798 },
7799 )
7800 }
7801}
7802
7803#[derive(Debug)]
7804pub enum TerminaGuestManagerRequest {
7805 Launch {
7814 guest_config: GuestConfig,
7815 controller: fidl::endpoints::ServerEnd<GuestMarker>,
7816 responder: TerminaGuestManagerLaunchResponder,
7817 },
7818 ForceShutdown { responder: TerminaGuestManagerForceShutdownResponder },
7821 Connect {
7827 controller: fidl::endpoints::ServerEnd<GuestMarker>,
7828 responder: TerminaGuestManagerConnectResponder,
7829 },
7830 GetInfo { responder: TerminaGuestManagerGetInfoResponder },
7832}
7833
7834impl TerminaGuestManagerRequest {
7835 #[allow(irrefutable_let_patterns)]
7836 pub fn into_launch(
7837 self,
7838 ) -> Option<(
7839 GuestConfig,
7840 fidl::endpoints::ServerEnd<GuestMarker>,
7841 TerminaGuestManagerLaunchResponder,
7842 )> {
7843 if let TerminaGuestManagerRequest::Launch { guest_config, controller, responder } = self {
7844 Some((guest_config, controller, responder))
7845 } else {
7846 None
7847 }
7848 }
7849
7850 #[allow(irrefutable_let_patterns)]
7851 pub fn into_force_shutdown(self) -> Option<(TerminaGuestManagerForceShutdownResponder)> {
7852 if let TerminaGuestManagerRequest::ForceShutdown { responder } = self {
7853 Some((responder))
7854 } else {
7855 None
7856 }
7857 }
7858
7859 #[allow(irrefutable_let_patterns)]
7860 pub fn into_connect(
7861 self,
7862 ) -> Option<(fidl::endpoints::ServerEnd<GuestMarker>, TerminaGuestManagerConnectResponder)>
7863 {
7864 if let TerminaGuestManagerRequest::Connect { controller, responder } = self {
7865 Some((controller, responder))
7866 } else {
7867 None
7868 }
7869 }
7870
7871 #[allow(irrefutable_let_patterns)]
7872 pub fn into_get_info(self) -> Option<(TerminaGuestManagerGetInfoResponder)> {
7873 if let TerminaGuestManagerRequest::GetInfo { responder } = self {
7874 Some((responder))
7875 } else {
7876 None
7877 }
7878 }
7879
7880 pub fn method_name(&self) -> &'static str {
7882 match *self {
7883 TerminaGuestManagerRequest::Launch { .. } => "launch",
7884 TerminaGuestManagerRequest::ForceShutdown { .. } => "force_shutdown",
7885 TerminaGuestManagerRequest::Connect { .. } => "connect",
7886 TerminaGuestManagerRequest::GetInfo { .. } => "get_info",
7887 }
7888 }
7889}
7890
7891#[derive(Debug, Clone)]
7892pub struct TerminaGuestManagerControlHandle {
7893 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7894}
7895
7896impl fidl::endpoints::ControlHandle for TerminaGuestManagerControlHandle {
7897 fn shutdown(&self) {
7898 self.inner.shutdown()
7899 }
7900 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7901 self.inner.shutdown_with_epitaph(status)
7902 }
7903
7904 fn is_closed(&self) -> bool {
7905 self.inner.channel().is_closed()
7906 }
7907 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7908 self.inner.channel().on_closed()
7909 }
7910
7911 #[cfg(target_os = "fuchsia")]
7912 fn signal_peer(
7913 &self,
7914 clear_mask: zx::Signals,
7915 set_mask: zx::Signals,
7916 ) -> Result<(), zx_status::Status> {
7917 use fidl::Peered;
7918 self.inner.channel().signal_peer(clear_mask, set_mask)
7919 }
7920}
7921
7922impl TerminaGuestManagerControlHandle {}
7923
7924#[must_use = "FIDL methods require a response to be sent"]
7925#[derive(Debug)]
7926pub struct TerminaGuestManagerLaunchResponder {
7927 control_handle: std::mem::ManuallyDrop<TerminaGuestManagerControlHandle>,
7928 tx_id: u32,
7929}
7930
7931impl std::ops::Drop for TerminaGuestManagerLaunchResponder {
7935 fn drop(&mut self) {
7936 self.control_handle.shutdown();
7937 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7939 }
7940}
7941
7942impl fidl::endpoints::Responder for TerminaGuestManagerLaunchResponder {
7943 type ControlHandle = TerminaGuestManagerControlHandle;
7944
7945 fn control_handle(&self) -> &TerminaGuestManagerControlHandle {
7946 &self.control_handle
7947 }
7948
7949 fn drop_without_shutdown(mut self) {
7950 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7952 std::mem::forget(self);
7954 }
7955}
7956
7957impl TerminaGuestManagerLaunchResponder {
7958 pub fn send(self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
7962 let _result = self.send_raw(result);
7963 if _result.is_err() {
7964 self.control_handle.shutdown();
7965 }
7966 self.drop_without_shutdown();
7967 _result
7968 }
7969
7970 pub fn send_no_shutdown_on_err(
7972 self,
7973 mut result: Result<(), GuestManagerError>,
7974 ) -> Result<(), fidl::Error> {
7975 let _result = self.send_raw(result);
7976 self.drop_without_shutdown();
7977 _result
7978 }
7979
7980 fn send_raw(&self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
7981 self.control_handle.inner.send::<fidl::encoding::ResultType<
7982 fidl::encoding::EmptyStruct,
7983 GuestManagerError,
7984 >>(
7985 result,
7986 self.tx_id,
7987 0x394a2e29f750323e,
7988 fidl::encoding::DynamicFlags::empty(),
7989 )
7990 }
7991}
7992
7993#[must_use = "FIDL methods require a response to be sent"]
7994#[derive(Debug)]
7995pub struct TerminaGuestManagerForceShutdownResponder {
7996 control_handle: std::mem::ManuallyDrop<TerminaGuestManagerControlHandle>,
7997 tx_id: u32,
7998}
7999
8000impl std::ops::Drop for TerminaGuestManagerForceShutdownResponder {
8004 fn drop(&mut self) {
8005 self.control_handle.shutdown();
8006 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8008 }
8009}
8010
8011impl fidl::endpoints::Responder for TerminaGuestManagerForceShutdownResponder {
8012 type ControlHandle = TerminaGuestManagerControlHandle;
8013
8014 fn control_handle(&self) -> &TerminaGuestManagerControlHandle {
8015 &self.control_handle
8016 }
8017
8018 fn drop_without_shutdown(mut self) {
8019 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8021 std::mem::forget(self);
8023 }
8024}
8025
8026impl TerminaGuestManagerForceShutdownResponder {
8027 pub fn send(self) -> Result<(), fidl::Error> {
8031 let _result = self.send_raw();
8032 if _result.is_err() {
8033 self.control_handle.shutdown();
8034 }
8035 self.drop_without_shutdown();
8036 _result
8037 }
8038
8039 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8041 let _result = self.send_raw();
8042 self.drop_without_shutdown();
8043 _result
8044 }
8045
8046 fn send_raw(&self) -> Result<(), fidl::Error> {
8047 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
8048 (),
8049 self.tx_id,
8050 0x3ad9a012982f872d,
8051 fidl::encoding::DynamicFlags::empty(),
8052 )
8053 }
8054}
8055
8056#[must_use = "FIDL methods require a response to be sent"]
8057#[derive(Debug)]
8058pub struct TerminaGuestManagerConnectResponder {
8059 control_handle: std::mem::ManuallyDrop<TerminaGuestManagerControlHandle>,
8060 tx_id: u32,
8061}
8062
8063impl std::ops::Drop for TerminaGuestManagerConnectResponder {
8067 fn drop(&mut self) {
8068 self.control_handle.shutdown();
8069 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8071 }
8072}
8073
8074impl fidl::endpoints::Responder for TerminaGuestManagerConnectResponder {
8075 type ControlHandle = TerminaGuestManagerControlHandle;
8076
8077 fn control_handle(&self) -> &TerminaGuestManagerControlHandle {
8078 &self.control_handle
8079 }
8080
8081 fn drop_without_shutdown(mut self) {
8082 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8084 std::mem::forget(self);
8086 }
8087}
8088
8089impl TerminaGuestManagerConnectResponder {
8090 pub fn send(self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
8094 let _result = self.send_raw(result);
8095 if _result.is_err() {
8096 self.control_handle.shutdown();
8097 }
8098 self.drop_without_shutdown();
8099 _result
8100 }
8101
8102 pub fn send_no_shutdown_on_err(
8104 self,
8105 mut result: Result<(), GuestManagerError>,
8106 ) -> Result<(), fidl::Error> {
8107 let _result = self.send_raw(result);
8108 self.drop_without_shutdown();
8109 _result
8110 }
8111
8112 fn send_raw(&self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
8113 self.control_handle.inner.send::<fidl::encoding::ResultType<
8114 fidl::encoding::EmptyStruct,
8115 GuestManagerError,
8116 >>(
8117 result,
8118 self.tx_id,
8119 0x4e489076e3bb15b4,
8120 fidl::encoding::DynamicFlags::empty(),
8121 )
8122 }
8123}
8124
8125#[must_use = "FIDL methods require a response to be sent"]
8126#[derive(Debug)]
8127pub struct TerminaGuestManagerGetInfoResponder {
8128 control_handle: std::mem::ManuallyDrop<TerminaGuestManagerControlHandle>,
8129 tx_id: u32,
8130}
8131
8132impl std::ops::Drop for TerminaGuestManagerGetInfoResponder {
8136 fn drop(&mut self) {
8137 self.control_handle.shutdown();
8138 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8140 }
8141}
8142
8143impl fidl::endpoints::Responder for TerminaGuestManagerGetInfoResponder {
8144 type ControlHandle = TerminaGuestManagerControlHandle;
8145
8146 fn control_handle(&self) -> &TerminaGuestManagerControlHandle {
8147 &self.control_handle
8148 }
8149
8150 fn drop_without_shutdown(mut self) {
8151 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8153 std::mem::forget(self);
8155 }
8156}
8157
8158impl TerminaGuestManagerGetInfoResponder {
8159 pub fn send(self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
8163 let _result = self.send_raw(guest_info);
8164 if _result.is_err() {
8165 self.control_handle.shutdown();
8166 }
8167 self.drop_without_shutdown();
8168 _result
8169 }
8170
8171 pub fn send_no_shutdown_on_err(self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
8173 let _result = self.send_raw(guest_info);
8174 self.drop_without_shutdown();
8175 _result
8176 }
8177
8178 fn send_raw(&self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
8179 self.control_handle.inner.send::<GuestManagerGetInfoResponse>(
8180 (guest_info,),
8181 self.tx_id,
8182 0x76892614aea695dc,
8183 fidl::encoding::DynamicFlags::empty(),
8184 )
8185 }
8186}
8187
8188#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8189pub struct ZirconGuestManagerMarker;
8190
8191impl fidl::endpoints::ProtocolMarker for ZirconGuestManagerMarker {
8192 type Proxy = ZirconGuestManagerProxy;
8193 type RequestStream = ZirconGuestManagerRequestStream;
8194 #[cfg(target_os = "fuchsia")]
8195 type SynchronousProxy = ZirconGuestManagerSynchronousProxy;
8196
8197 const DEBUG_NAME: &'static str = "fuchsia.virtualization.ZirconGuestManager";
8198}
8199impl fidl::endpoints::DiscoverableProtocolMarker for ZirconGuestManagerMarker {}
8200
8201pub trait ZirconGuestManagerProxyInterface: Send + Sync {
8202 type LaunchResponseFut: std::future::Future<Output = Result<GuestManagerLaunchResult, fidl::Error>>
8203 + Send;
8204 fn r#launch(
8205 &self,
8206 guest_config: GuestConfig,
8207 controller: fidl::endpoints::ServerEnd<GuestMarker>,
8208 ) -> Self::LaunchResponseFut;
8209 type ForceShutdownResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
8210 fn r#force_shutdown(&self) -> Self::ForceShutdownResponseFut;
8211 type ConnectResponseFut: std::future::Future<Output = Result<GuestManagerConnectResult, fidl::Error>>
8212 + Send;
8213 fn r#connect(
8214 &self,
8215 controller: fidl::endpoints::ServerEnd<GuestMarker>,
8216 ) -> Self::ConnectResponseFut;
8217 type GetInfoResponseFut: std::future::Future<Output = Result<GuestInfo, fidl::Error>> + Send;
8218 fn r#get_info(&self) -> Self::GetInfoResponseFut;
8219}
8220#[derive(Debug)]
8221#[cfg(target_os = "fuchsia")]
8222pub struct ZirconGuestManagerSynchronousProxy {
8223 client: fidl::client::sync::Client,
8224}
8225
8226#[cfg(target_os = "fuchsia")]
8227impl fidl::endpoints::SynchronousProxy for ZirconGuestManagerSynchronousProxy {
8228 type Proxy = ZirconGuestManagerProxy;
8229 type Protocol = ZirconGuestManagerMarker;
8230
8231 fn from_channel(inner: fidl::Channel) -> Self {
8232 Self::new(inner)
8233 }
8234
8235 fn into_channel(self) -> fidl::Channel {
8236 self.client.into_channel()
8237 }
8238
8239 fn as_channel(&self) -> &fidl::Channel {
8240 self.client.as_channel()
8241 }
8242}
8243
8244#[cfg(target_os = "fuchsia")]
8245impl ZirconGuestManagerSynchronousProxy {
8246 pub fn new(channel: fidl::Channel) -> Self {
8247 let protocol_name =
8248 <ZirconGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8249 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8250 }
8251
8252 pub fn into_channel(self) -> fidl::Channel {
8253 self.client.into_channel()
8254 }
8255
8256 pub fn wait_for_event(
8259 &self,
8260 deadline: zx::MonotonicInstant,
8261 ) -> Result<ZirconGuestManagerEvent, fidl::Error> {
8262 ZirconGuestManagerEvent::decode(self.client.wait_for_event(deadline)?)
8263 }
8264
8265 pub fn r#launch(
8274 &self,
8275 mut guest_config: GuestConfig,
8276 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
8277 ___deadline: zx::MonotonicInstant,
8278 ) -> Result<GuestManagerLaunchResult, fidl::Error> {
8279 let _response =
8280 self.client.send_query::<GuestManagerLaunchRequest, fidl::encoding::ResultType<
8281 fidl::encoding::EmptyStruct,
8282 GuestManagerError,
8283 >>(
8284 (&mut guest_config, controller),
8285 0x394a2e29f750323e,
8286 fidl::encoding::DynamicFlags::empty(),
8287 ___deadline,
8288 )?;
8289 Ok(_response.map(|x| x))
8290 }
8291
8292 pub fn r#force_shutdown(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
8295 let _response =
8296 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
8297 (),
8298 0x3ad9a012982f872d,
8299 fidl::encoding::DynamicFlags::empty(),
8300 ___deadline,
8301 )?;
8302 Ok(_response)
8303 }
8304
8305 pub fn r#connect(
8311 &self,
8312 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
8313 ___deadline: zx::MonotonicInstant,
8314 ) -> Result<GuestManagerConnectResult, fidl::Error> {
8315 let _response =
8316 self.client.send_query::<GuestManagerConnectRequest, fidl::encoding::ResultType<
8317 fidl::encoding::EmptyStruct,
8318 GuestManagerError,
8319 >>(
8320 (controller,),
8321 0x4e489076e3bb15b4,
8322 fidl::encoding::DynamicFlags::empty(),
8323 ___deadline,
8324 )?;
8325 Ok(_response.map(|x| x))
8326 }
8327
8328 pub fn r#get_info(&self, ___deadline: zx::MonotonicInstant) -> Result<GuestInfo, fidl::Error> {
8330 let _response =
8331 self.client.send_query::<fidl::encoding::EmptyPayload, GuestManagerGetInfoResponse>(
8332 (),
8333 0x76892614aea695dc,
8334 fidl::encoding::DynamicFlags::empty(),
8335 ___deadline,
8336 )?;
8337 Ok(_response.guest_info)
8338 }
8339}
8340
8341#[cfg(target_os = "fuchsia")]
8342impl From<ZirconGuestManagerSynchronousProxy> for zx::Handle {
8343 fn from(value: ZirconGuestManagerSynchronousProxy) -> Self {
8344 value.into_channel().into()
8345 }
8346}
8347
8348#[cfg(target_os = "fuchsia")]
8349impl From<fidl::Channel> for ZirconGuestManagerSynchronousProxy {
8350 fn from(value: fidl::Channel) -> Self {
8351 Self::new(value)
8352 }
8353}
8354
8355#[derive(Debug, Clone)]
8356pub struct ZirconGuestManagerProxy {
8357 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8358}
8359
8360impl fidl::endpoints::Proxy for ZirconGuestManagerProxy {
8361 type Protocol = ZirconGuestManagerMarker;
8362
8363 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8364 Self::new(inner)
8365 }
8366
8367 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8368 self.client.into_channel().map_err(|client| Self { client })
8369 }
8370
8371 fn as_channel(&self) -> &::fidl::AsyncChannel {
8372 self.client.as_channel()
8373 }
8374}
8375
8376impl ZirconGuestManagerProxy {
8377 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8379 let protocol_name =
8380 <ZirconGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8381 Self { client: fidl::client::Client::new(channel, protocol_name) }
8382 }
8383
8384 pub fn take_event_stream(&self) -> ZirconGuestManagerEventStream {
8390 ZirconGuestManagerEventStream { event_receiver: self.client.take_event_receiver() }
8391 }
8392
8393 pub fn r#launch(
8402 &self,
8403 mut guest_config: GuestConfig,
8404 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
8405 ) -> fidl::client::QueryResponseFut<
8406 GuestManagerLaunchResult,
8407 fidl::encoding::DefaultFuchsiaResourceDialect,
8408 > {
8409 ZirconGuestManagerProxyInterface::r#launch(self, guest_config, controller)
8410 }
8411
8412 pub fn r#force_shutdown(
8415 &self,
8416 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
8417 ZirconGuestManagerProxyInterface::r#force_shutdown(self)
8418 }
8419
8420 pub fn r#connect(
8426 &self,
8427 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
8428 ) -> fidl::client::QueryResponseFut<
8429 GuestManagerConnectResult,
8430 fidl::encoding::DefaultFuchsiaResourceDialect,
8431 > {
8432 ZirconGuestManagerProxyInterface::r#connect(self, controller)
8433 }
8434
8435 pub fn r#get_info(
8437 &self,
8438 ) -> fidl::client::QueryResponseFut<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
8439 {
8440 ZirconGuestManagerProxyInterface::r#get_info(self)
8441 }
8442}
8443
8444impl ZirconGuestManagerProxyInterface for ZirconGuestManagerProxy {
8445 type LaunchResponseFut = fidl::client::QueryResponseFut<
8446 GuestManagerLaunchResult,
8447 fidl::encoding::DefaultFuchsiaResourceDialect,
8448 >;
8449 fn r#launch(
8450 &self,
8451 mut guest_config: GuestConfig,
8452 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
8453 ) -> Self::LaunchResponseFut {
8454 fn _decode(
8455 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8456 ) -> Result<GuestManagerLaunchResult, fidl::Error> {
8457 let _response = fidl::client::decode_transaction_body::<
8458 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestManagerError>,
8459 fidl::encoding::DefaultFuchsiaResourceDialect,
8460 0x394a2e29f750323e,
8461 >(_buf?)?;
8462 Ok(_response.map(|x| x))
8463 }
8464 self.client.send_query_and_decode::<GuestManagerLaunchRequest, GuestManagerLaunchResult>(
8465 (&mut guest_config, controller),
8466 0x394a2e29f750323e,
8467 fidl::encoding::DynamicFlags::empty(),
8468 _decode,
8469 )
8470 }
8471
8472 type ForceShutdownResponseFut =
8473 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
8474 fn r#force_shutdown(&self) -> Self::ForceShutdownResponseFut {
8475 fn _decode(
8476 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8477 ) -> Result<(), fidl::Error> {
8478 let _response = fidl::client::decode_transaction_body::<
8479 fidl::encoding::EmptyPayload,
8480 fidl::encoding::DefaultFuchsiaResourceDialect,
8481 0x3ad9a012982f872d,
8482 >(_buf?)?;
8483 Ok(_response)
8484 }
8485 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
8486 (),
8487 0x3ad9a012982f872d,
8488 fidl::encoding::DynamicFlags::empty(),
8489 _decode,
8490 )
8491 }
8492
8493 type ConnectResponseFut = fidl::client::QueryResponseFut<
8494 GuestManagerConnectResult,
8495 fidl::encoding::DefaultFuchsiaResourceDialect,
8496 >;
8497 fn r#connect(
8498 &self,
8499 mut controller: fidl::endpoints::ServerEnd<GuestMarker>,
8500 ) -> Self::ConnectResponseFut {
8501 fn _decode(
8502 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8503 ) -> Result<GuestManagerConnectResult, fidl::Error> {
8504 let _response = fidl::client::decode_transaction_body::<
8505 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GuestManagerError>,
8506 fidl::encoding::DefaultFuchsiaResourceDialect,
8507 0x4e489076e3bb15b4,
8508 >(_buf?)?;
8509 Ok(_response.map(|x| x))
8510 }
8511 self.client.send_query_and_decode::<GuestManagerConnectRequest, GuestManagerConnectResult>(
8512 (controller,),
8513 0x4e489076e3bb15b4,
8514 fidl::encoding::DynamicFlags::empty(),
8515 _decode,
8516 )
8517 }
8518
8519 type GetInfoResponseFut =
8520 fidl::client::QueryResponseFut<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
8521 fn r#get_info(&self) -> Self::GetInfoResponseFut {
8522 fn _decode(
8523 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8524 ) -> Result<GuestInfo, fidl::Error> {
8525 let _response = fidl::client::decode_transaction_body::<
8526 GuestManagerGetInfoResponse,
8527 fidl::encoding::DefaultFuchsiaResourceDialect,
8528 0x76892614aea695dc,
8529 >(_buf?)?;
8530 Ok(_response.guest_info)
8531 }
8532 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GuestInfo>(
8533 (),
8534 0x76892614aea695dc,
8535 fidl::encoding::DynamicFlags::empty(),
8536 _decode,
8537 )
8538 }
8539}
8540
8541pub struct ZirconGuestManagerEventStream {
8542 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8543}
8544
8545impl std::marker::Unpin for ZirconGuestManagerEventStream {}
8546
8547impl futures::stream::FusedStream for ZirconGuestManagerEventStream {
8548 fn is_terminated(&self) -> bool {
8549 self.event_receiver.is_terminated()
8550 }
8551}
8552
8553impl futures::Stream for ZirconGuestManagerEventStream {
8554 type Item = Result<ZirconGuestManagerEvent, fidl::Error>;
8555
8556 fn poll_next(
8557 mut self: std::pin::Pin<&mut Self>,
8558 cx: &mut std::task::Context<'_>,
8559 ) -> std::task::Poll<Option<Self::Item>> {
8560 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8561 &mut self.event_receiver,
8562 cx
8563 )?) {
8564 Some(buf) => std::task::Poll::Ready(Some(ZirconGuestManagerEvent::decode(buf))),
8565 None => std::task::Poll::Ready(None),
8566 }
8567 }
8568}
8569
8570#[derive(Debug)]
8571pub enum ZirconGuestManagerEvent {}
8572
8573impl ZirconGuestManagerEvent {
8574 fn decode(
8576 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8577 ) -> Result<ZirconGuestManagerEvent, fidl::Error> {
8578 let (bytes, _handles) = buf.split_mut();
8579 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8580 debug_assert_eq!(tx_header.tx_id, 0);
8581 match tx_header.ordinal {
8582 _ => Err(fidl::Error::UnknownOrdinal {
8583 ordinal: tx_header.ordinal,
8584 protocol_name:
8585 <ZirconGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8586 }),
8587 }
8588 }
8589}
8590
8591pub struct ZirconGuestManagerRequestStream {
8593 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8594 is_terminated: bool,
8595}
8596
8597impl std::marker::Unpin for ZirconGuestManagerRequestStream {}
8598
8599impl futures::stream::FusedStream for ZirconGuestManagerRequestStream {
8600 fn is_terminated(&self) -> bool {
8601 self.is_terminated
8602 }
8603}
8604
8605impl fidl::endpoints::RequestStream for ZirconGuestManagerRequestStream {
8606 type Protocol = ZirconGuestManagerMarker;
8607 type ControlHandle = ZirconGuestManagerControlHandle;
8608
8609 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8610 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8611 }
8612
8613 fn control_handle(&self) -> Self::ControlHandle {
8614 ZirconGuestManagerControlHandle { inner: self.inner.clone() }
8615 }
8616
8617 fn into_inner(
8618 self,
8619 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8620 {
8621 (self.inner, self.is_terminated)
8622 }
8623
8624 fn from_inner(
8625 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8626 is_terminated: bool,
8627 ) -> Self {
8628 Self { inner, is_terminated }
8629 }
8630}
8631
8632impl futures::Stream for ZirconGuestManagerRequestStream {
8633 type Item = Result<ZirconGuestManagerRequest, fidl::Error>;
8634
8635 fn poll_next(
8636 mut self: std::pin::Pin<&mut Self>,
8637 cx: &mut std::task::Context<'_>,
8638 ) -> std::task::Poll<Option<Self::Item>> {
8639 let this = &mut *self;
8640 if this.inner.check_shutdown(cx) {
8641 this.is_terminated = true;
8642 return std::task::Poll::Ready(None);
8643 }
8644 if this.is_terminated {
8645 panic!("polled ZirconGuestManagerRequestStream after completion");
8646 }
8647 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8648 |bytes, handles| {
8649 match this.inner.channel().read_etc(cx, bytes, handles) {
8650 std::task::Poll::Ready(Ok(())) => {}
8651 std::task::Poll::Pending => return std::task::Poll::Pending,
8652 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8653 this.is_terminated = true;
8654 return std::task::Poll::Ready(None);
8655 }
8656 std::task::Poll::Ready(Err(e)) => {
8657 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8658 e.into(),
8659 ))))
8660 }
8661 }
8662
8663 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8665
8666 std::task::Poll::Ready(Some(match header.ordinal {
8667 0x394a2e29f750323e => {
8668 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8669 let mut req = fidl::new_empty!(GuestManagerLaunchRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8670 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestManagerLaunchRequest>(&header, _body_bytes, handles, &mut req)?;
8671 let control_handle = ZirconGuestManagerControlHandle {
8672 inner: this.inner.clone(),
8673 };
8674 Ok(ZirconGuestManagerRequest::Launch {guest_config: req.guest_config,
8675controller: req.controller,
8676
8677 responder: ZirconGuestManagerLaunchResponder {
8678 control_handle: std::mem::ManuallyDrop::new(control_handle),
8679 tx_id: header.tx_id,
8680 },
8681 })
8682 }
8683 0x3ad9a012982f872d => {
8684 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8685 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
8686 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8687 let control_handle = ZirconGuestManagerControlHandle {
8688 inner: this.inner.clone(),
8689 };
8690 Ok(ZirconGuestManagerRequest::ForceShutdown {
8691 responder: ZirconGuestManagerForceShutdownResponder {
8692 control_handle: std::mem::ManuallyDrop::new(control_handle),
8693 tx_id: header.tx_id,
8694 },
8695 })
8696 }
8697 0x4e489076e3bb15b4 => {
8698 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8699 let mut req = fidl::new_empty!(GuestManagerConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8700 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GuestManagerConnectRequest>(&header, _body_bytes, handles, &mut req)?;
8701 let control_handle = ZirconGuestManagerControlHandle {
8702 inner: this.inner.clone(),
8703 };
8704 Ok(ZirconGuestManagerRequest::Connect {controller: req.controller,
8705
8706 responder: ZirconGuestManagerConnectResponder {
8707 control_handle: std::mem::ManuallyDrop::new(control_handle),
8708 tx_id: header.tx_id,
8709 },
8710 })
8711 }
8712 0x76892614aea695dc => {
8713 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8714 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
8715 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8716 let control_handle = ZirconGuestManagerControlHandle {
8717 inner: this.inner.clone(),
8718 };
8719 Ok(ZirconGuestManagerRequest::GetInfo {
8720 responder: ZirconGuestManagerGetInfoResponder {
8721 control_handle: std::mem::ManuallyDrop::new(control_handle),
8722 tx_id: header.tx_id,
8723 },
8724 })
8725 }
8726 _ => Err(fidl::Error::UnknownOrdinal {
8727 ordinal: header.ordinal,
8728 protocol_name: <ZirconGuestManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8729 }),
8730 }))
8731 },
8732 )
8733 }
8734}
8735
8736#[derive(Debug)]
8737pub enum ZirconGuestManagerRequest {
8738 Launch {
8747 guest_config: GuestConfig,
8748 controller: fidl::endpoints::ServerEnd<GuestMarker>,
8749 responder: ZirconGuestManagerLaunchResponder,
8750 },
8751 ForceShutdown { responder: ZirconGuestManagerForceShutdownResponder },
8754 Connect {
8760 controller: fidl::endpoints::ServerEnd<GuestMarker>,
8761 responder: ZirconGuestManagerConnectResponder,
8762 },
8763 GetInfo { responder: ZirconGuestManagerGetInfoResponder },
8765}
8766
8767impl ZirconGuestManagerRequest {
8768 #[allow(irrefutable_let_patterns)]
8769 pub fn into_launch(
8770 self,
8771 ) -> Option<(
8772 GuestConfig,
8773 fidl::endpoints::ServerEnd<GuestMarker>,
8774 ZirconGuestManagerLaunchResponder,
8775 )> {
8776 if let ZirconGuestManagerRequest::Launch { guest_config, controller, responder } = self {
8777 Some((guest_config, controller, responder))
8778 } else {
8779 None
8780 }
8781 }
8782
8783 #[allow(irrefutable_let_patterns)]
8784 pub fn into_force_shutdown(self) -> Option<(ZirconGuestManagerForceShutdownResponder)> {
8785 if let ZirconGuestManagerRequest::ForceShutdown { responder } = self {
8786 Some((responder))
8787 } else {
8788 None
8789 }
8790 }
8791
8792 #[allow(irrefutable_let_patterns)]
8793 pub fn into_connect(
8794 self,
8795 ) -> Option<(fidl::endpoints::ServerEnd<GuestMarker>, ZirconGuestManagerConnectResponder)> {
8796 if let ZirconGuestManagerRequest::Connect { controller, responder } = self {
8797 Some((controller, responder))
8798 } else {
8799 None
8800 }
8801 }
8802
8803 #[allow(irrefutable_let_patterns)]
8804 pub fn into_get_info(self) -> Option<(ZirconGuestManagerGetInfoResponder)> {
8805 if let ZirconGuestManagerRequest::GetInfo { responder } = self {
8806 Some((responder))
8807 } else {
8808 None
8809 }
8810 }
8811
8812 pub fn method_name(&self) -> &'static str {
8814 match *self {
8815 ZirconGuestManagerRequest::Launch { .. } => "launch",
8816 ZirconGuestManagerRequest::ForceShutdown { .. } => "force_shutdown",
8817 ZirconGuestManagerRequest::Connect { .. } => "connect",
8818 ZirconGuestManagerRequest::GetInfo { .. } => "get_info",
8819 }
8820 }
8821}
8822
8823#[derive(Debug, Clone)]
8824pub struct ZirconGuestManagerControlHandle {
8825 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8826}
8827
8828impl fidl::endpoints::ControlHandle for ZirconGuestManagerControlHandle {
8829 fn shutdown(&self) {
8830 self.inner.shutdown()
8831 }
8832 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8833 self.inner.shutdown_with_epitaph(status)
8834 }
8835
8836 fn is_closed(&self) -> bool {
8837 self.inner.channel().is_closed()
8838 }
8839 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8840 self.inner.channel().on_closed()
8841 }
8842
8843 #[cfg(target_os = "fuchsia")]
8844 fn signal_peer(
8845 &self,
8846 clear_mask: zx::Signals,
8847 set_mask: zx::Signals,
8848 ) -> Result<(), zx_status::Status> {
8849 use fidl::Peered;
8850 self.inner.channel().signal_peer(clear_mask, set_mask)
8851 }
8852}
8853
8854impl ZirconGuestManagerControlHandle {}
8855
8856#[must_use = "FIDL methods require a response to be sent"]
8857#[derive(Debug)]
8858pub struct ZirconGuestManagerLaunchResponder {
8859 control_handle: std::mem::ManuallyDrop<ZirconGuestManagerControlHandle>,
8860 tx_id: u32,
8861}
8862
8863impl std::ops::Drop for ZirconGuestManagerLaunchResponder {
8867 fn drop(&mut self) {
8868 self.control_handle.shutdown();
8869 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8871 }
8872}
8873
8874impl fidl::endpoints::Responder for ZirconGuestManagerLaunchResponder {
8875 type ControlHandle = ZirconGuestManagerControlHandle;
8876
8877 fn control_handle(&self) -> &ZirconGuestManagerControlHandle {
8878 &self.control_handle
8879 }
8880
8881 fn drop_without_shutdown(mut self) {
8882 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8884 std::mem::forget(self);
8886 }
8887}
8888
8889impl ZirconGuestManagerLaunchResponder {
8890 pub fn send(self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
8894 let _result = self.send_raw(result);
8895 if _result.is_err() {
8896 self.control_handle.shutdown();
8897 }
8898 self.drop_without_shutdown();
8899 _result
8900 }
8901
8902 pub fn send_no_shutdown_on_err(
8904 self,
8905 mut result: Result<(), GuestManagerError>,
8906 ) -> Result<(), fidl::Error> {
8907 let _result = self.send_raw(result);
8908 self.drop_without_shutdown();
8909 _result
8910 }
8911
8912 fn send_raw(&self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
8913 self.control_handle.inner.send::<fidl::encoding::ResultType<
8914 fidl::encoding::EmptyStruct,
8915 GuestManagerError,
8916 >>(
8917 result,
8918 self.tx_id,
8919 0x394a2e29f750323e,
8920 fidl::encoding::DynamicFlags::empty(),
8921 )
8922 }
8923}
8924
8925#[must_use = "FIDL methods require a response to be sent"]
8926#[derive(Debug)]
8927pub struct ZirconGuestManagerForceShutdownResponder {
8928 control_handle: std::mem::ManuallyDrop<ZirconGuestManagerControlHandle>,
8929 tx_id: u32,
8930}
8931
8932impl std::ops::Drop for ZirconGuestManagerForceShutdownResponder {
8936 fn drop(&mut self) {
8937 self.control_handle.shutdown();
8938 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8940 }
8941}
8942
8943impl fidl::endpoints::Responder for ZirconGuestManagerForceShutdownResponder {
8944 type ControlHandle = ZirconGuestManagerControlHandle;
8945
8946 fn control_handle(&self) -> &ZirconGuestManagerControlHandle {
8947 &self.control_handle
8948 }
8949
8950 fn drop_without_shutdown(mut self) {
8951 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8953 std::mem::forget(self);
8955 }
8956}
8957
8958impl ZirconGuestManagerForceShutdownResponder {
8959 pub fn send(self) -> Result<(), fidl::Error> {
8963 let _result = self.send_raw();
8964 if _result.is_err() {
8965 self.control_handle.shutdown();
8966 }
8967 self.drop_without_shutdown();
8968 _result
8969 }
8970
8971 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8973 let _result = self.send_raw();
8974 self.drop_without_shutdown();
8975 _result
8976 }
8977
8978 fn send_raw(&self) -> Result<(), fidl::Error> {
8979 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
8980 (),
8981 self.tx_id,
8982 0x3ad9a012982f872d,
8983 fidl::encoding::DynamicFlags::empty(),
8984 )
8985 }
8986}
8987
8988#[must_use = "FIDL methods require a response to be sent"]
8989#[derive(Debug)]
8990pub struct ZirconGuestManagerConnectResponder {
8991 control_handle: std::mem::ManuallyDrop<ZirconGuestManagerControlHandle>,
8992 tx_id: u32,
8993}
8994
8995impl std::ops::Drop for ZirconGuestManagerConnectResponder {
8999 fn drop(&mut self) {
9000 self.control_handle.shutdown();
9001 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9003 }
9004}
9005
9006impl fidl::endpoints::Responder for ZirconGuestManagerConnectResponder {
9007 type ControlHandle = ZirconGuestManagerControlHandle;
9008
9009 fn control_handle(&self) -> &ZirconGuestManagerControlHandle {
9010 &self.control_handle
9011 }
9012
9013 fn drop_without_shutdown(mut self) {
9014 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9016 std::mem::forget(self);
9018 }
9019}
9020
9021impl ZirconGuestManagerConnectResponder {
9022 pub fn send(self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
9026 let _result = self.send_raw(result);
9027 if _result.is_err() {
9028 self.control_handle.shutdown();
9029 }
9030 self.drop_without_shutdown();
9031 _result
9032 }
9033
9034 pub fn send_no_shutdown_on_err(
9036 self,
9037 mut result: Result<(), GuestManagerError>,
9038 ) -> Result<(), fidl::Error> {
9039 let _result = self.send_raw(result);
9040 self.drop_without_shutdown();
9041 _result
9042 }
9043
9044 fn send_raw(&self, mut result: Result<(), GuestManagerError>) -> Result<(), fidl::Error> {
9045 self.control_handle.inner.send::<fidl::encoding::ResultType<
9046 fidl::encoding::EmptyStruct,
9047 GuestManagerError,
9048 >>(
9049 result,
9050 self.tx_id,
9051 0x4e489076e3bb15b4,
9052 fidl::encoding::DynamicFlags::empty(),
9053 )
9054 }
9055}
9056
9057#[must_use = "FIDL methods require a response to be sent"]
9058#[derive(Debug)]
9059pub struct ZirconGuestManagerGetInfoResponder {
9060 control_handle: std::mem::ManuallyDrop<ZirconGuestManagerControlHandle>,
9061 tx_id: u32,
9062}
9063
9064impl std::ops::Drop for ZirconGuestManagerGetInfoResponder {
9068 fn drop(&mut self) {
9069 self.control_handle.shutdown();
9070 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9072 }
9073}
9074
9075impl fidl::endpoints::Responder for ZirconGuestManagerGetInfoResponder {
9076 type ControlHandle = ZirconGuestManagerControlHandle;
9077
9078 fn control_handle(&self) -> &ZirconGuestManagerControlHandle {
9079 &self.control_handle
9080 }
9081
9082 fn drop_without_shutdown(mut self) {
9083 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9085 std::mem::forget(self);
9087 }
9088}
9089
9090impl ZirconGuestManagerGetInfoResponder {
9091 pub fn send(self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
9095 let _result = self.send_raw(guest_info);
9096 if _result.is_err() {
9097 self.control_handle.shutdown();
9098 }
9099 self.drop_without_shutdown();
9100 _result
9101 }
9102
9103 pub fn send_no_shutdown_on_err(self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
9105 let _result = self.send_raw(guest_info);
9106 self.drop_without_shutdown();
9107 _result
9108 }
9109
9110 fn send_raw(&self, mut guest_info: &GuestInfo) -> Result<(), fidl::Error> {
9111 self.control_handle.inner.send::<GuestManagerGetInfoResponse>(
9112 (guest_info,),
9113 self.tx_id,
9114 0x76892614aea695dc,
9115 fidl::encoding::DynamicFlags::empty(),
9116 )
9117 }
9118}
9119
9120mod internal {
9121 use super::*;
9122
9123 impl fidl::encoding::ResourceTypeMarker for BlockSpec {
9124 type Borrowed<'a> = &'a mut Self;
9125 fn take_or_borrow<'a>(
9126 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9127 ) -> Self::Borrowed<'a> {
9128 value
9129 }
9130 }
9131
9132 unsafe impl fidl::encoding::TypeMarker for BlockSpec {
9133 type Owned = Self;
9134
9135 #[inline(always)]
9136 fn inline_align(_context: fidl::encoding::Context) -> usize {
9137 8
9138 }
9139
9140 #[inline(always)]
9141 fn inline_size(_context: fidl::encoding::Context) -> usize {
9142 40
9143 }
9144 }
9145
9146 unsafe impl fidl::encoding::Encode<BlockSpec, fidl::encoding::DefaultFuchsiaResourceDialect>
9147 for &mut BlockSpec
9148 {
9149 #[inline]
9150 unsafe fn encode(
9151 self,
9152 encoder: &mut fidl::encoding::Encoder<
9153 '_,
9154 fidl::encoding::DefaultFuchsiaResourceDialect,
9155 >,
9156 offset: usize,
9157 _depth: fidl::encoding::Depth,
9158 ) -> fidl::Result<()> {
9159 encoder.debug_check_bounds::<BlockSpec>(offset);
9160 fidl::encoding::Encode::<BlockSpec, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9162 (
9163 <fidl::encoding::BoundedString<20> as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9164 <BlockMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
9165 <BlockFormat as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.format),
9166 ),
9167 encoder, offset, _depth
9168 )
9169 }
9170 }
9171 unsafe impl<
9172 T0: fidl::encoding::Encode<
9173 fidl::encoding::BoundedString<20>,
9174 fidl::encoding::DefaultFuchsiaResourceDialect,
9175 >,
9176 T1: fidl::encoding::Encode<BlockMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
9177 T2: fidl::encoding::Encode<BlockFormat, fidl::encoding::DefaultFuchsiaResourceDialect>,
9178 > fidl::encoding::Encode<BlockSpec, fidl::encoding::DefaultFuchsiaResourceDialect>
9179 for (T0, T1, T2)
9180 {
9181 #[inline]
9182 unsafe fn encode(
9183 self,
9184 encoder: &mut fidl::encoding::Encoder<
9185 '_,
9186 fidl::encoding::DefaultFuchsiaResourceDialect,
9187 >,
9188 offset: usize,
9189 depth: fidl::encoding::Depth,
9190 ) -> fidl::Result<()> {
9191 encoder.debug_check_bounds::<BlockSpec>(offset);
9192 unsafe {
9195 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9196 (ptr as *mut u64).write_unaligned(0);
9197 }
9198 self.0.encode(encoder, offset + 0, depth)?;
9200 self.1.encode(encoder, offset + 16, depth)?;
9201 self.2.encode(encoder, offset + 24, depth)?;
9202 Ok(())
9203 }
9204 }
9205
9206 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for BlockSpec {
9207 #[inline(always)]
9208 fn new_empty() -> Self {
9209 Self {
9210 id: fidl::new_empty!(
9211 fidl::encoding::BoundedString<20>,
9212 fidl::encoding::DefaultFuchsiaResourceDialect
9213 ),
9214 mode: fidl::new_empty!(BlockMode, fidl::encoding::DefaultFuchsiaResourceDialect),
9215 format: fidl::new_empty!(
9216 BlockFormat,
9217 fidl::encoding::DefaultFuchsiaResourceDialect
9218 ),
9219 }
9220 }
9221
9222 #[inline]
9223 unsafe fn decode(
9224 &mut self,
9225 decoder: &mut fidl::encoding::Decoder<
9226 '_,
9227 fidl::encoding::DefaultFuchsiaResourceDialect,
9228 >,
9229 offset: usize,
9230 _depth: fidl::encoding::Depth,
9231 ) -> fidl::Result<()> {
9232 decoder.debug_check_bounds::<Self>(offset);
9233 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9235 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9236 let mask = 0xffffffff00000000u64;
9237 let maskedval = padval & mask;
9238 if maskedval != 0 {
9239 return Err(fidl::Error::NonZeroPadding {
9240 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9241 });
9242 }
9243 fidl::decode!(
9244 fidl::encoding::BoundedString<20>,
9245 fidl::encoding::DefaultFuchsiaResourceDialect,
9246 &mut self.id,
9247 decoder,
9248 offset + 0,
9249 _depth
9250 )?;
9251 fidl::decode!(
9252 BlockMode,
9253 fidl::encoding::DefaultFuchsiaResourceDialect,
9254 &mut self.mode,
9255 decoder,
9256 offset + 16,
9257 _depth
9258 )?;
9259 fidl::decode!(
9260 BlockFormat,
9261 fidl::encoding::DefaultFuchsiaResourceDialect,
9262 &mut self.format,
9263 decoder,
9264 offset + 24,
9265 _depth
9266 )?;
9267 Ok(())
9268 }
9269 }
9270
9271 impl fidl::encoding::ResourceTypeMarker for GuestGetBalloonControllerRequest {
9272 type Borrowed<'a> = &'a mut Self;
9273 fn take_or_borrow<'a>(
9274 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9275 ) -> Self::Borrowed<'a> {
9276 value
9277 }
9278 }
9279
9280 unsafe impl fidl::encoding::TypeMarker for GuestGetBalloonControllerRequest {
9281 type Owned = Self;
9282
9283 #[inline(always)]
9284 fn inline_align(_context: fidl::encoding::Context) -> usize {
9285 4
9286 }
9287
9288 #[inline(always)]
9289 fn inline_size(_context: fidl::encoding::Context) -> usize {
9290 4
9291 }
9292 }
9293
9294 unsafe impl
9295 fidl::encoding::Encode<
9296 GuestGetBalloonControllerRequest,
9297 fidl::encoding::DefaultFuchsiaResourceDialect,
9298 > for &mut GuestGetBalloonControllerRequest
9299 {
9300 #[inline]
9301 unsafe fn encode(
9302 self,
9303 encoder: &mut fidl::encoding::Encoder<
9304 '_,
9305 fidl::encoding::DefaultFuchsiaResourceDialect,
9306 >,
9307 offset: usize,
9308 _depth: fidl::encoding::Depth,
9309 ) -> fidl::Result<()> {
9310 encoder.debug_check_bounds::<GuestGetBalloonControllerRequest>(offset);
9311 fidl::encoding::Encode::<GuestGetBalloonControllerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9313 (
9314 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BalloonControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
9315 ),
9316 encoder, offset, _depth
9317 )
9318 }
9319 }
9320 unsafe impl<
9321 T0: fidl::encoding::Encode<
9322 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BalloonControllerMarker>>,
9323 fidl::encoding::DefaultFuchsiaResourceDialect,
9324 >,
9325 >
9326 fidl::encoding::Encode<
9327 GuestGetBalloonControllerRequest,
9328 fidl::encoding::DefaultFuchsiaResourceDialect,
9329 > for (T0,)
9330 {
9331 #[inline]
9332 unsafe fn encode(
9333 self,
9334 encoder: &mut fidl::encoding::Encoder<
9335 '_,
9336 fidl::encoding::DefaultFuchsiaResourceDialect,
9337 >,
9338 offset: usize,
9339 depth: fidl::encoding::Depth,
9340 ) -> fidl::Result<()> {
9341 encoder.debug_check_bounds::<GuestGetBalloonControllerRequest>(offset);
9342 self.0.encode(encoder, offset + 0, depth)?;
9346 Ok(())
9347 }
9348 }
9349
9350 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9351 for GuestGetBalloonControllerRequest
9352 {
9353 #[inline(always)]
9354 fn new_empty() -> Self {
9355 Self {
9356 controller: fidl::new_empty!(
9357 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BalloonControllerMarker>>,
9358 fidl::encoding::DefaultFuchsiaResourceDialect
9359 ),
9360 }
9361 }
9362
9363 #[inline]
9364 unsafe fn decode(
9365 &mut self,
9366 decoder: &mut fidl::encoding::Decoder<
9367 '_,
9368 fidl::encoding::DefaultFuchsiaResourceDialect,
9369 >,
9370 offset: usize,
9371 _depth: fidl::encoding::Depth,
9372 ) -> fidl::Result<()> {
9373 decoder.debug_check_bounds::<Self>(offset);
9374 fidl::decode!(
9376 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BalloonControllerMarker>>,
9377 fidl::encoding::DefaultFuchsiaResourceDialect,
9378 &mut self.controller,
9379 decoder,
9380 offset + 0,
9381 _depth
9382 )?;
9383 Ok(())
9384 }
9385 }
9386
9387 impl fidl::encoding::ResourceTypeMarker for GuestGetHostVsockEndpointRequest {
9388 type Borrowed<'a> = &'a mut Self;
9389 fn take_or_borrow<'a>(
9390 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9391 ) -> Self::Borrowed<'a> {
9392 value
9393 }
9394 }
9395
9396 unsafe impl fidl::encoding::TypeMarker for GuestGetHostVsockEndpointRequest {
9397 type Owned = Self;
9398
9399 #[inline(always)]
9400 fn inline_align(_context: fidl::encoding::Context) -> usize {
9401 4
9402 }
9403
9404 #[inline(always)]
9405 fn inline_size(_context: fidl::encoding::Context) -> usize {
9406 4
9407 }
9408 }
9409
9410 unsafe impl
9411 fidl::encoding::Encode<
9412 GuestGetHostVsockEndpointRequest,
9413 fidl::encoding::DefaultFuchsiaResourceDialect,
9414 > for &mut GuestGetHostVsockEndpointRequest
9415 {
9416 #[inline]
9417 unsafe fn encode(
9418 self,
9419 encoder: &mut fidl::encoding::Encoder<
9420 '_,
9421 fidl::encoding::DefaultFuchsiaResourceDialect,
9422 >,
9423 offset: usize,
9424 _depth: fidl::encoding::Depth,
9425 ) -> fidl::Result<()> {
9426 encoder.debug_check_bounds::<GuestGetHostVsockEndpointRequest>(offset);
9427 fidl::encoding::Encode::<GuestGetHostVsockEndpointRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9429 (
9430 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<HostVsockEndpointMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.endpoint),
9431 ),
9432 encoder, offset, _depth
9433 )
9434 }
9435 }
9436 unsafe impl<
9437 T0: fidl::encoding::Encode<
9438 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<HostVsockEndpointMarker>>,
9439 fidl::encoding::DefaultFuchsiaResourceDialect,
9440 >,
9441 >
9442 fidl::encoding::Encode<
9443 GuestGetHostVsockEndpointRequest,
9444 fidl::encoding::DefaultFuchsiaResourceDialect,
9445 > for (T0,)
9446 {
9447 #[inline]
9448 unsafe fn encode(
9449 self,
9450 encoder: &mut fidl::encoding::Encoder<
9451 '_,
9452 fidl::encoding::DefaultFuchsiaResourceDialect,
9453 >,
9454 offset: usize,
9455 depth: fidl::encoding::Depth,
9456 ) -> fidl::Result<()> {
9457 encoder.debug_check_bounds::<GuestGetHostVsockEndpointRequest>(offset);
9458 self.0.encode(encoder, offset + 0, depth)?;
9462 Ok(())
9463 }
9464 }
9465
9466 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9467 for GuestGetHostVsockEndpointRequest
9468 {
9469 #[inline(always)]
9470 fn new_empty() -> Self {
9471 Self {
9472 endpoint: fidl::new_empty!(
9473 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<HostVsockEndpointMarker>>,
9474 fidl::encoding::DefaultFuchsiaResourceDialect
9475 ),
9476 }
9477 }
9478
9479 #[inline]
9480 unsafe fn decode(
9481 &mut self,
9482 decoder: &mut fidl::encoding::Decoder<
9483 '_,
9484 fidl::encoding::DefaultFuchsiaResourceDialect,
9485 >,
9486 offset: usize,
9487 _depth: fidl::encoding::Depth,
9488 ) -> fidl::Result<()> {
9489 decoder.debug_check_bounds::<Self>(offset);
9490 fidl::decode!(
9492 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<HostVsockEndpointMarker>>,
9493 fidl::encoding::DefaultFuchsiaResourceDialect,
9494 &mut self.endpoint,
9495 decoder,
9496 offset + 0,
9497 _depth
9498 )?;
9499 Ok(())
9500 }
9501 }
9502
9503 impl fidl::encoding::ResourceTypeMarker for GuestGetMemControllerRequest {
9504 type Borrowed<'a> = &'a mut Self;
9505 fn take_or_borrow<'a>(
9506 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9507 ) -> Self::Borrowed<'a> {
9508 value
9509 }
9510 }
9511
9512 unsafe impl fidl::encoding::TypeMarker for GuestGetMemControllerRequest {
9513 type Owned = Self;
9514
9515 #[inline(always)]
9516 fn inline_align(_context: fidl::encoding::Context) -> usize {
9517 4
9518 }
9519
9520 #[inline(always)]
9521 fn inline_size(_context: fidl::encoding::Context) -> usize {
9522 4
9523 }
9524 }
9525
9526 unsafe impl
9527 fidl::encoding::Encode<
9528 GuestGetMemControllerRequest,
9529 fidl::encoding::DefaultFuchsiaResourceDialect,
9530 > for &mut GuestGetMemControllerRequest
9531 {
9532 #[inline]
9533 unsafe fn encode(
9534 self,
9535 encoder: &mut fidl::encoding::Encoder<
9536 '_,
9537 fidl::encoding::DefaultFuchsiaResourceDialect,
9538 >,
9539 offset: usize,
9540 _depth: fidl::encoding::Depth,
9541 ) -> fidl::Result<()> {
9542 encoder.debug_check_bounds::<GuestGetMemControllerRequest>(offset);
9543 fidl::encoding::Encode::<GuestGetMemControllerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9545 (
9546 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MemControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
9547 ),
9548 encoder, offset, _depth
9549 )
9550 }
9551 }
9552 unsafe impl<
9553 T0: fidl::encoding::Encode<
9554 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MemControllerMarker>>,
9555 fidl::encoding::DefaultFuchsiaResourceDialect,
9556 >,
9557 >
9558 fidl::encoding::Encode<
9559 GuestGetMemControllerRequest,
9560 fidl::encoding::DefaultFuchsiaResourceDialect,
9561 > for (T0,)
9562 {
9563 #[inline]
9564 unsafe fn encode(
9565 self,
9566 encoder: &mut fidl::encoding::Encoder<
9567 '_,
9568 fidl::encoding::DefaultFuchsiaResourceDialect,
9569 >,
9570 offset: usize,
9571 depth: fidl::encoding::Depth,
9572 ) -> fidl::Result<()> {
9573 encoder.debug_check_bounds::<GuestGetMemControllerRequest>(offset);
9574 self.0.encode(encoder, offset + 0, depth)?;
9578 Ok(())
9579 }
9580 }
9581
9582 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9583 for GuestGetMemControllerRequest
9584 {
9585 #[inline(always)]
9586 fn new_empty() -> Self {
9587 Self {
9588 controller: fidl::new_empty!(
9589 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MemControllerMarker>>,
9590 fidl::encoding::DefaultFuchsiaResourceDialect
9591 ),
9592 }
9593 }
9594
9595 #[inline]
9596 unsafe fn decode(
9597 &mut self,
9598 decoder: &mut fidl::encoding::Decoder<
9599 '_,
9600 fidl::encoding::DefaultFuchsiaResourceDialect,
9601 >,
9602 offset: usize,
9603 _depth: fidl::encoding::Depth,
9604 ) -> fidl::Result<()> {
9605 decoder.debug_check_bounds::<Self>(offset);
9606 fidl::decode!(
9608 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MemControllerMarker>>,
9609 fidl::encoding::DefaultFuchsiaResourceDialect,
9610 &mut self.controller,
9611 decoder,
9612 offset + 0,
9613 _depth
9614 )?;
9615 Ok(())
9616 }
9617 }
9618
9619 impl fidl::encoding::ResourceTypeMarker for GuestGetSerialResponse {
9620 type Borrowed<'a> = &'a mut Self;
9621 fn take_or_borrow<'a>(
9622 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9623 ) -> Self::Borrowed<'a> {
9624 value
9625 }
9626 }
9627
9628 unsafe impl fidl::encoding::TypeMarker for GuestGetSerialResponse {
9629 type Owned = Self;
9630
9631 #[inline(always)]
9632 fn inline_align(_context: fidl::encoding::Context) -> usize {
9633 4
9634 }
9635
9636 #[inline(always)]
9637 fn inline_size(_context: fidl::encoding::Context) -> usize {
9638 4
9639 }
9640 }
9641
9642 unsafe impl
9643 fidl::encoding::Encode<
9644 GuestGetSerialResponse,
9645 fidl::encoding::DefaultFuchsiaResourceDialect,
9646 > for &mut GuestGetSerialResponse
9647 {
9648 #[inline]
9649 unsafe fn encode(
9650 self,
9651 encoder: &mut fidl::encoding::Encoder<
9652 '_,
9653 fidl::encoding::DefaultFuchsiaResourceDialect,
9654 >,
9655 offset: usize,
9656 _depth: fidl::encoding::Depth,
9657 ) -> fidl::Result<()> {
9658 encoder.debug_check_bounds::<GuestGetSerialResponse>(offset);
9659 fidl::encoding::Encode::<
9661 GuestGetSerialResponse,
9662 fidl::encoding::DefaultFuchsiaResourceDialect,
9663 >::encode(
9664 (<fidl::encoding::HandleType<
9665 fidl::Socket,
9666 { fidl::ObjectType::SOCKET.into_raw() },
9667 2147483648,
9668 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9669 &mut self.socket
9670 ),),
9671 encoder,
9672 offset,
9673 _depth,
9674 )
9675 }
9676 }
9677 unsafe impl<
9678 T0: fidl::encoding::Encode<
9679 fidl::encoding::HandleType<
9680 fidl::Socket,
9681 { fidl::ObjectType::SOCKET.into_raw() },
9682 2147483648,
9683 >,
9684 fidl::encoding::DefaultFuchsiaResourceDialect,
9685 >,
9686 >
9687 fidl::encoding::Encode<
9688 GuestGetSerialResponse,
9689 fidl::encoding::DefaultFuchsiaResourceDialect,
9690 > for (T0,)
9691 {
9692 #[inline]
9693 unsafe fn encode(
9694 self,
9695 encoder: &mut fidl::encoding::Encoder<
9696 '_,
9697 fidl::encoding::DefaultFuchsiaResourceDialect,
9698 >,
9699 offset: usize,
9700 depth: fidl::encoding::Depth,
9701 ) -> fidl::Result<()> {
9702 encoder.debug_check_bounds::<GuestGetSerialResponse>(offset);
9703 self.0.encode(encoder, offset + 0, depth)?;
9707 Ok(())
9708 }
9709 }
9710
9711 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9712 for GuestGetSerialResponse
9713 {
9714 #[inline(always)]
9715 fn new_empty() -> Self {
9716 Self {
9717 socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9718 }
9719 }
9720
9721 #[inline]
9722 unsafe fn decode(
9723 &mut self,
9724 decoder: &mut fidl::encoding::Decoder<
9725 '_,
9726 fidl::encoding::DefaultFuchsiaResourceDialect,
9727 >,
9728 offset: usize,
9729 _depth: fidl::encoding::Depth,
9730 ) -> fidl::Result<()> {
9731 decoder.debug_check_bounds::<Self>(offset);
9732 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
9734 Ok(())
9735 }
9736 }
9737
9738 impl fidl::encoding::ResourceTypeMarker for GuestLifecycleBindRequest {
9739 type Borrowed<'a> = &'a mut Self;
9740 fn take_or_borrow<'a>(
9741 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9742 ) -> Self::Borrowed<'a> {
9743 value
9744 }
9745 }
9746
9747 unsafe impl fidl::encoding::TypeMarker for GuestLifecycleBindRequest {
9748 type Owned = Self;
9749
9750 #[inline(always)]
9751 fn inline_align(_context: fidl::encoding::Context) -> usize {
9752 4
9753 }
9754
9755 #[inline(always)]
9756 fn inline_size(_context: fidl::encoding::Context) -> usize {
9757 4
9758 }
9759 }
9760
9761 unsafe impl
9762 fidl::encoding::Encode<
9763 GuestLifecycleBindRequest,
9764 fidl::encoding::DefaultFuchsiaResourceDialect,
9765 > for &mut GuestLifecycleBindRequest
9766 {
9767 #[inline]
9768 unsafe fn encode(
9769 self,
9770 encoder: &mut fidl::encoding::Encoder<
9771 '_,
9772 fidl::encoding::DefaultFuchsiaResourceDialect,
9773 >,
9774 offset: usize,
9775 _depth: fidl::encoding::Depth,
9776 ) -> fidl::Result<()> {
9777 encoder.debug_check_bounds::<GuestLifecycleBindRequest>(offset);
9778 fidl::encoding::Encode::<GuestLifecycleBindRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9780 (
9781 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.guest),
9782 ),
9783 encoder, offset, _depth
9784 )
9785 }
9786 }
9787 unsafe impl<
9788 T0: fidl::encoding::Encode<
9789 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
9790 fidl::encoding::DefaultFuchsiaResourceDialect,
9791 >,
9792 >
9793 fidl::encoding::Encode<
9794 GuestLifecycleBindRequest,
9795 fidl::encoding::DefaultFuchsiaResourceDialect,
9796 > for (T0,)
9797 {
9798 #[inline]
9799 unsafe fn encode(
9800 self,
9801 encoder: &mut fidl::encoding::Encoder<
9802 '_,
9803 fidl::encoding::DefaultFuchsiaResourceDialect,
9804 >,
9805 offset: usize,
9806 depth: fidl::encoding::Depth,
9807 ) -> fidl::Result<()> {
9808 encoder.debug_check_bounds::<GuestLifecycleBindRequest>(offset);
9809 self.0.encode(encoder, offset + 0, depth)?;
9813 Ok(())
9814 }
9815 }
9816
9817 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9818 for GuestLifecycleBindRequest
9819 {
9820 #[inline(always)]
9821 fn new_empty() -> Self {
9822 Self {
9823 guest: fidl::new_empty!(
9824 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
9825 fidl::encoding::DefaultFuchsiaResourceDialect
9826 ),
9827 }
9828 }
9829
9830 #[inline]
9831 unsafe fn decode(
9832 &mut self,
9833 decoder: &mut fidl::encoding::Decoder<
9834 '_,
9835 fidl::encoding::DefaultFuchsiaResourceDialect,
9836 >,
9837 offset: usize,
9838 _depth: fidl::encoding::Depth,
9839 ) -> fidl::Result<()> {
9840 decoder.debug_check_bounds::<Self>(offset);
9841 fidl::decode!(
9843 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
9844 fidl::encoding::DefaultFuchsiaResourceDialect,
9845 &mut self.guest,
9846 decoder,
9847 offset + 0,
9848 _depth
9849 )?;
9850 Ok(())
9851 }
9852 }
9853
9854 impl fidl::encoding::ResourceTypeMarker for GuestLifecycleCreateRequest {
9855 type Borrowed<'a> = &'a mut Self;
9856 fn take_or_borrow<'a>(
9857 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9858 ) -> Self::Borrowed<'a> {
9859 value
9860 }
9861 }
9862
9863 unsafe impl fidl::encoding::TypeMarker for GuestLifecycleCreateRequest {
9864 type Owned = Self;
9865
9866 #[inline(always)]
9867 fn inline_align(_context: fidl::encoding::Context) -> usize {
9868 8
9869 }
9870
9871 #[inline(always)]
9872 fn inline_size(_context: fidl::encoding::Context) -> usize {
9873 16
9874 }
9875 }
9876
9877 unsafe impl
9878 fidl::encoding::Encode<
9879 GuestLifecycleCreateRequest,
9880 fidl::encoding::DefaultFuchsiaResourceDialect,
9881 > for &mut GuestLifecycleCreateRequest
9882 {
9883 #[inline]
9884 unsafe fn encode(
9885 self,
9886 encoder: &mut fidl::encoding::Encoder<
9887 '_,
9888 fidl::encoding::DefaultFuchsiaResourceDialect,
9889 >,
9890 offset: usize,
9891 _depth: fidl::encoding::Depth,
9892 ) -> fidl::Result<()> {
9893 encoder.debug_check_bounds::<GuestLifecycleCreateRequest>(offset);
9894 fidl::encoding::Encode::<
9896 GuestLifecycleCreateRequest,
9897 fidl::encoding::DefaultFuchsiaResourceDialect,
9898 >::encode(
9899 (<GuestConfig as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9900 &mut self.guest_config,
9901 ),),
9902 encoder,
9903 offset,
9904 _depth,
9905 )
9906 }
9907 }
9908 unsafe impl<
9909 T0: fidl::encoding::Encode<GuestConfig, fidl::encoding::DefaultFuchsiaResourceDialect>,
9910 >
9911 fidl::encoding::Encode<
9912 GuestLifecycleCreateRequest,
9913 fidl::encoding::DefaultFuchsiaResourceDialect,
9914 > for (T0,)
9915 {
9916 #[inline]
9917 unsafe fn encode(
9918 self,
9919 encoder: &mut fidl::encoding::Encoder<
9920 '_,
9921 fidl::encoding::DefaultFuchsiaResourceDialect,
9922 >,
9923 offset: usize,
9924 depth: fidl::encoding::Depth,
9925 ) -> fidl::Result<()> {
9926 encoder.debug_check_bounds::<GuestLifecycleCreateRequest>(offset);
9927 self.0.encode(encoder, offset + 0, depth)?;
9931 Ok(())
9932 }
9933 }
9934
9935 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9936 for GuestLifecycleCreateRequest
9937 {
9938 #[inline(always)]
9939 fn new_empty() -> Self {
9940 Self {
9941 guest_config: fidl::new_empty!(
9942 GuestConfig,
9943 fidl::encoding::DefaultFuchsiaResourceDialect
9944 ),
9945 }
9946 }
9947
9948 #[inline]
9949 unsafe fn decode(
9950 &mut self,
9951 decoder: &mut fidl::encoding::Decoder<
9952 '_,
9953 fidl::encoding::DefaultFuchsiaResourceDialect,
9954 >,
9955 offset: usize,
9956 _depth: fidl::encoding::Depth,
9957 ) -> fidl::Result<()> {
9958 decoder.debug_check_bounds::<Self>(offset);
9959 fidl::decode!(
9961 GuestConfig,
9962 fidl::encoding::DefaultFuchsiaResourceDialect,
9963 &mut self.guest_config,
9964 decoder,
9965 offset + 0,
9966 _depth
9967 )?;
9968 Ok(())
9969 }
9970 }
9971
9972 impl fidl::encoding::ResourceTypeMarker for GuestManagerConnectRequest {
9973 type Borrowed<'a> = &'a mut Self;
9974 fn take_or_borrow<'a>(
9975 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9976 ) -> Self::Borrowed<'a> {
9977 value
9978 }
9979 }
9980
9981 unsafe impl fidl::encoding::TypeMarker for GuestManagerConnectRequest {
9982 type Owned = Self;
9983
9984 #[inline(always)]
9985 fn inline_align(_context: fidl::encoding::Context) -> usize {
9986 4
9987 }
9988
9989 #[inline(always)]
9990 fn inline_size(_context: fidl::encoding::Context) -> usize {
9991 4
9992 }
9993 }
9994
9995 unsafe impl
9996 fidl::encoding::Encode<
9997 GuestManagerConnectRequest,
9998 fidl::encoding::DefaultFuchsiaResourceDialect,
9999 > for &mut GuestManagerConnectRequest
10000 {
10001 #[inline]
10002 unsafe fn encode(
10003 self,
10004 encoder: &mut fidl::encoding::Encoder<
10005 '_,
10006 fidl::encoding::DefaultFuchsiaResourceDialect,
10007 >,
10008 offset: usize,
10009 _depth: fidl::encoding::Depth,
10010 ) -> fidl::Result<()> {
10011 encoder.debug_check_bounds::<GuestManagerConnectRequest>(offset);
10012 fidl::encoding::Encode::<GuestManagerConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10014 (
10015 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
10016 ),
10017 encoder, offset, _depth
10018 )
10019 }
10020 }
10021 unsafe impl<
10022 T0: fidl::encoding::Encode<
10023 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
10024 fidl::encoding::DefaultFuchsiaResourceDialect,
10025 >,
10026 >
10027 fidl::encoding::Encode<
10028 GuestManagerConnectRequest,
10029 fidl::encoding::DefaultFuchsiaResourceDialect,
10030 > for (T0,)
10031 {
10032 #[inline]
10033 unsafe fn encode(
10034 self,
10035 encoder: &mut fidl::encoding::Encoder<
10036 '_,
10037 fidl::encoding::DefaultFuchsiaResourceDialect,
10038 >,
10039 offset: usize,
10040 depth: fidl::encoding::Depth,
10041 ) -> fidl::Result<()> {
10042 encoder.debug_check_bounds::<GuestManagerConnectRequest>(offset);
10043 self.0.encode(encoder, offset + 0, depth)?;
10047 Ok(())
10048 }
10049 }
10050
10051 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10052 for GuestManagerConnectRequest
10053 {
10054 #[inline(always)]
10055 fn new_empty() -> Self {
10056 Self {
10057 controller: fidl::new_empty!(
10058 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
10059 fidl::encoding::DefaultFuchsiaResourceDialect
10060 ),
10061 }
10062 }
10063
10064 #[inline]
10065 unsafe fn decode(
10066 &mut self,
10067 decoder: &mut fidl::encoding::Decoder<
10068 '_,
10069 fidl::encoding::DefaultFuchsiaResourceDialect,
10070 >,
10071 offset: usize,
10072 _depth: fidl::encoding::Depth,
10073 ) -> fidl::Result<()> {
10074 decoder.debug_check_bounds::<Self>(offset);
10075 fidl::decode!(
10077 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
10078 fidl::encoding::DefaultFuchsiaResourceDialect,
10079 &mut self.controller,
10080 decoder,
10081 offset + 0,
10082 _depth
10083 )?;
10084 Ok(())
10085 }
10086 }
10087
10088 impl fidl::encoding::ResourceTypeMarker for GuestManagerGetInfoResponse {
10089 type Borrowed<'a> = &'a mut Self;
10090 fn take_or_borrow<'a>(
10091 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10092 ) -> Self::Borrowed<'a> {
10093 value
10094 }
10095 }
10096
10097 unsafe impl fidl::encoding::TypeMarker for GuestManagerGetInfoResponse {
10098 type Owned = Self;
10099
10100 #[inline(always)]
10101 fn inline_align(_context: fidl::encoding::Context) -> usize {
10102 8
10103 }
10104
10105 #[inline(always)]
10106 fn inline_size(_context: fidl::encoding::Context) -> usize {
10107 16
10108 }
10109 }
10110
10111 unsafe impl
10112 fidl::encoding::Encode<
10113 GuestManagerGetInfoResponse,
10114 fidl::encoding::DefaultFuchsiaResourceDialect,
10115 > for &mut GuestManagerGetInfoResponse
10116 {
10117 #[inline]
10118 unsafe fn encode(
10119 self,
10120 encoder: &mut fidl::encoding::Encoder<
10121 '_,
10122 fidl::encoding::DefaultFuchsiaResourceDialect,
10123 >,
10124 offset: usize,
10125 _depth: fidl::encoding::Depth,
10126 ) -> fidl::Result<()> {
10127 encoder.debug_check_bounds::<GuestManagerGetInfoResponse>(offset);
10128 fidl::encoding::Encode::<
10130 GuestManagerGetInfoResponse,
10131 fidl::encoding::DefaultFuchsiaResourceDialect,
10132 >::encode(
10133 (<GuestInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.guest_info),),
10134 encoder,
10135 offset,
10136 _depth,
10137 )
10138 }
10139 }
10140 unsafe impl<T0: fidl::encoding::Encode<GuestInfo, fidl::encoding::DefaultFuchsiaResourceDialect>>
10141 fidl::encoding::Encode<
10142 GuestManagerGetInfoResponse,
10143 fidl::encoding::DefaultFuchsiaResourceDialect,
10144 > for (T0,)
10145 {
10146 #[inline]
10147 unsafe fn encode(
10148 self,
10149 encoder: &mut fidl::encoding::Encoder<
10150 '_,
10151 fidl::encoding::DefaultFuchsiaResourceDialect,
10152 >,
10153 offset: usize,
10154 depth: fidl::encoding::Depth,
10155 ) -> fidl::Result<()> {
10156 encoder.debug_check_bounds::<GuestManagerGetInfoResponse>(offset);
10157 self.0.encode(encoder, offset + 0, depth)?;
10161 Ok(())
10162 }
10163 }
10164
10165 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10166 for GuestManagerGetInfoResponse
10167 {
10168 #[inline(always)]
10169 fn new_empty() -> Self {
10170 Self {
10171 guest_info: fidl::new_empty!(
10172 GuestInfo,
10173 fidl::encoding::DefaultFuchsiaResourceDialect
10174 ),
10175 }
10176 }
10177
10178 #[inline]
10179 unsafe fn decode(
10180 &mut self,
10181 decoder: &mut fidl::encoding::Decoder<
10182 '_,
10183 fidl::encoding::DefaultFuchsiaResourceDialect,
10184 >,
10185 offset: usize,
10186 _depth: fidl::encoding::Depth,
10187 ) -> fidl::Result<()> {
10188 decoder.debug_check_bounds::<Self>(offset);
10189 fidl::decode!(
10191 GuestInfo,
10192 fidl::encoding::DefaultFuchsiaResourceDialect,
10193 &mut self.guest_info,
10194 decoder,
10195 offset + 0,
10196 _depth
10197 )?;
10198 Ok(())
10199 }
10200 }
10201
10202 impl fidl::encoding::ResourceTypeMarker for GuestManagerLaunchRequest {
10203 type Borrowed<'a> = &'a mut Self;
10204 fn take_or_borrow<'a>(
10205 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10206 ) -> Self::Borrowed<'a> {
10207 value
10208 }
10209 }
10210
10211 unsafe impl fidl::encoding::TypeMarker for GuestManagerLaunchRequest {
10212 type Owned = Self;
10213
10214 #[inline(always)]
10215 fn inline_align(_context: fidl::encoding::Context) -> usize {
10216 8
10217 }
10218
10219 #[inline(always)]
10220 fn inline_size(_context: fidl::encoding::Context) -> usize {
10221 24
10222 }
10223 }
10224
10225 unsafe impl
10226 fidl::encoding::Encode<
10227 GuestManagerLaunchRequest,
10228 fidl::encoding::DefaultFuchsiaResourceDialect,
10229 > for &mut GuestManagerLaunchRequest
10230 {
10231 #[inline]
10232 unsafe fn encode(
10233 self,
10234 encoder: &mut fidl::encoding::Encoder<
10235 '_,
10236 fidl::encoding::DefaultFuchsiaResourceDialect,
10237 >,
10238 offset: usize,
10239 _depth: fidl::encoding::Depth,
10240 ) -> fidl::Result<()> {
10241 encoder.debug_check_bounds::<GuestManagerLaunchRequest>(offset);
10242 fidl::encoding::Encode::<GuestManagerLaunchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10244 (
10245 <GuestConfig as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.guest_config),
10246 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
10247 ),
10248 encoder, offset, _depth
10249 )
10250 }
10251 }
10252 unsafe impl<
10253 T0: fidl::encoding::Encode<GuestConfig, fidl::encoding::DefaultFuchsiaResourceDialect>,
10254 T1: fidl::encoding::Encode<
10255 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
10256 fidl::encoding::DefaultFuchsiaResourceDialect,
10257 >,
10258 >
10259 fidl::encoding::Encode<
10260 GuestManagerLaunchRequest,
10261 fidl::encoding::DefaultFuchsiaResourceDialect,
10262 > for (T0, T1)
10263 {
10264 #[inline]
10265 unsafe fn encode(
10266 self,
10267 encoder: &mut fidl::encoding::Encoder<
10268 '_,
10269 fidl::encoding::DefaultFuchsiaResourceDialect,
10270 >,
10271 offset: usize,
10272 depth: fidl::encoding::Depth,
10273 ) -> fidl::Result<()> {
10274 encoder.debug_check_bounds::<GuestManagerLaunchRequest>(offset);
10275 unsafe {
10278 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10279 (ptr as *mut u64).write_unaligned(0);
10280 }
10281 self.0.encode(encoder, offset + 0, depth)?;
10283 self.1.encode(encoder, offset + 16, depth)?;
10284 Ok(())
10285 }
10286 }
10287
10288 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10289 for GuestManagerLaunchRequest
10290 {
10291 #[inline(always)]
10292 fn new_empty() -> Self {
10293 Self {
10294 guest_config: fidl::new_empty!(
10295 GuestConfig,
10296 fidl::encoding::DefaultFuchsiaResourceDialect
10297 ),
10298 controller: fidl::new_empty!(
10299 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
10300 fidl::encoding::DefaultFuchsiaResourceDialect
10301 ),
10302 }
10303 }
10304
10305 #[inline]
10306 unsafe fn decode(
10307 &mut self,
10308 decoder: &mut fidl::encoding::Decoder<
10309 '_,
10310 fidl::encoding::DefaultFuchsiaResourceDialect,
10311 >,
10312 offset: usize,
10313 _depth: fidl::encoding::Depth,
10314 ) -> fidl::Result<()> {
10315 decoder.debug_check_bounds::<Self>(offset);
10316 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10318 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10319 let mask = 0xffffffff00000000u64;
10320 let maskedval = padval & mask;
10321 if maskedval != 0 {
10322 return Err(fidl::Error::NonZeroPadding {
10323 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10324 });
10325 }
10326 fidl::decode!(
10327 GuestConfig,
10328 fidl::encoding::DefaultFuchsiaResourceDialect,
10329 &mut self.guest_config,
10330 decoder,
10331 offset + 0,
10332 _depth
10333 )?;
10334 fidl::decode!(
10335 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GuestMarker>>,
10336 fidl::encoding::DefaultFuchsiaResourceDialect,
10337 &mut self.controller,
10338 decoder,
10339 offset + 16,
10340 _depth
10341 )?;
10342 Ok(())
10343 }
10344 }
10345
10346 impl fidl::encoding::ResourceTypeMarker for GuestGetConsoleResponse {
10347 type Borrowed<'a> = &'a mut Self;
10348 fn take_or_borrow<'a>(
10349 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10350 ) -> Self::Borrowed<'a> {
10351 value
10352 }
10353 }
10354
10355 unsafe impl fidl::encoding::TypeMarker for GuestGetConsoleResponse {
10356 type Owned = Self;
10357
10358 #[inline(always)]
10359 fn inline_align(_context: fidl::encoding::Context) -> usize {
10360 4
10361 }
10362
10363 #[inline(always)]
10364 fn inline_size(_context: fidl::encoding::Context) -> usize {
10365 4
10366 }
10367 }
10368
10369 unsafe impl
10370 fidl::encoding::Encode<
10371 GuestGetConsoleResponse,
10372 fidl::encoding::DefaultFuchsiaResourceDialect,
10373 > for &mut GuestGetConsoleResponse
10374 {
10375 #[inline]
10376 unsafe fn encode(
10377 self,
10378 encoder: &mut fidl::encoding::Encoder<
10379 '_,
10380 fidl::encoding::DefaultFuchsiaResourceDialect,
10381 >,
10382 offset: usize,
10383 _depth: fidl::encoding::Depth,
10384 ) -> fidl::Result<()> {
10385 encoder.debug_check_bounds::<GuestGetConsoleResponse>(offset);
10386 fidl::encoding::Encode::<
10388 GuestGetConsoleResponse,
10389 fidl::encoding::DefaultFuchsiaResourceDialect,
10390 >::encode(
10391 (<fidl::encoding::HandleType<
10392 fidl::Socket,
10393 { fidl::ObjectType::SOCKET.into_raw() },
10394 2147483648,
10395 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10396 &mut self.socket
10397 ),),
10398 encoder,
10399 offset,
10400 _depth,
10401 )
10402 }
10403 }
10404 unsafe impl<
10405 T0: fidl::encoding::Encode<
10406 fidl::encoding::HandleType<
10407 fidl::Socket,
10408 { fidl::ObjectType::SOCKET.into_raw() },
10409 2147483648,
10410 >,
10411 fidl::encoding::DefaultFuchsiaResourceDialect,
10412 >,
10413 >
10414 fidl::encoding::Encode<
10415 GuestGetConsoleResponse,
10416 fidl::encoding::DefaultFuchsiaResourceDialect,
10417 > for (T0,)
10418 {
10419 #[inline]
10420 unsafe fn encode(
10421 self,
10422 encoder: &mut fidl::encoding::Encoder<
10423 '_,
10424 fidl::encoding::DefaultFuchsiaResourceDialect,
10425 >,
10426 offset: usize,
10427 depth: fidl::encoding::Depth,
10428 ) -> fidl::Result<()> {
10429 encoder.debug_check_bounds::<GuestGetConsoleResponse>(offset);
10430 self.0.encode(encoder, offset + 0, depth)?;
10434 Ok(())
10435 }
10436 }
10437
10438 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10439 for GuestGetConsoleResponse
10440 {
10441 #[inline(always)]
10442 fn new_empty() -> Self {
10443 Self {
10444 socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10445 }
10446 }
10447
10448 #[inline]
10449 unsafe fn decode(
10450 &mut self,
10451 decoder: &mut fidl::encoding::Decoder<
10452 '_,
10453 fidl::encoding::DefaultFuchsiaResourceDialect,
10454 >,
10455 offset: usize,
10456 _depth: fidl::encoding::Depth,
10457 ) -> fidl::Result<()> {
10458 decoder.debug_check_bounds::<Self>(offset);
10459 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
10461 Ok(())
10462 }
10463 }
10464
10465 impl fidl::encoding::ResourceTypeMarker for HostVsockAcceptorAcceptResponse {
10466 type Borrowed<'a> = &'a mut Self;
10467 fn take_or_borrow<'a>(
10468 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10469 ) -> Self::Borrowed<'a> {
10470 value
10471 }
10472 }
10473
10474 unsafe impl fidl::encoding::TypeMarker for HostVsockAcceptorAcceptResponse {
10475 type Owned = Self;
10476
10477 #[inline(always)]
10478 fn inline_align(_context: fidl::encoding::Context) -> usize {
10479 4
10480 }
10481
10482 #[inline(always)]
10483 fn inline_size(_context: fidl::encoding::Context) -> usize {
10484 4
10485 }
10486 }
10487
10488 unsafe impl
10489 fidl::encoding::Encode<
10490 HostVsockAcceptorAcceptResponse,
10491 fidl::encoding::DefaultFuchsiaResourceDialect,
10492 > for &mut HostVsockAcceptorAcceptResponse
10493 {
10494 #[inline]
10495 unsafe fn encode(
10496 self,
10497 encoder: &mut fidl::encoding::Encoder<
10498 '_,
10499 fidl::encoding::DefaultFuchsiaResourceDialect,
10500 >,
10501 offset: usize,
10502 _depth: fidl::encoding::Depth,
10503 ) -> fidl::Result<()> {
10504 encoder.debug_check_bounds::<HostVsockAcceptorAcceptResponse>(offset);
10505 fidl::encoding::Encode::<
10507 HostVsockAcceptorAcceptResponse,
10508 fidl::encoding::DefaultFuchsiaResourceDialect,
10509 >::encode(
10510 (<fidl::encoding::HandleType<
10511 fidl::Socket,
10512 { fidl::ObjectType::SOCKET.into_raw() },
10513 2147483648,
10514 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10515 &mut self.socket
10516 ),),
10517 encoder,
10518 offset,
10519 _depth,
10520 )
10521 }
10522 }
10523 unsafe impl<
10524 T0: fidl::encoding::Encode<
10525 fidl::encoding::HandleType<
10526 fidl::Socket,
10527 { fidl::ObjectType::SOCKET.into_raw() },
10528 2147483648,
10529 >,
10530 fidl::encoding::DefaultFuchsiaResourceDialect,
10531 >,
10532 >
10533 fidl::encoding::Encode<
10534 HostVsockAcceptorAcceptResponse,
10535 fidl::encoding::DefaultFuchsiaResourceDialect,
10536 > for (T0,)
10537 {
10538 #[inline]
10539 unsafe fn encode(
10540 self,
10541 encoder: &mut fidl::encoding::Encoder<
10542 '_,
10543 fidl::encoding::DefaultFuchsiaResourceDialect,
10544 >,
10545 offset: usize,
10546 depth: fidl::encoding::Depth,
10547 ) -> fidl::Result<()> {
10548 encoder.debug_check_bounds::<HostVsockAcceptorAcceptResponse>(offset);
10549 self.0.encode(encoder, offset + 0, depth)?;
10553 Ok(())
10554 }
10555 }
10556
10557 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10558 for HostVsockAcceptorAcceptResponse
10559 {
10560 #[inline(always)]
10561 fn new_empty() -> Self {
10562 Self {
10563 socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10564 }
10565 }
10566
10567 #[inline]
10568 unsafe fn decode(
10569 &mut self,
10570 decoder: &mut fidl::encoding::Decoder<
10571 '_,
10572 fidl::encoding::DefaultFuchsiaResourceDialect,
10573 >,
10574 offset: usize,
10575 _depth: fidl::encoding::Depth,
10576 ) -> fidl::Result<()> {
10577 decoder.debug_check_bounds::<Self>(offset);
10578 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
10580 Ok(())
10581 }
10582 }
10583
10584 impl fidl::encoding::ResourceTypeMarker for HostVsockEndpointConnectResponse {
10585 type Borrowed<'a> = &'a mut Self;
10586 fn take_or_borrow<'a>(
10587 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10588 ) -> Self::Borrowed<'a> {
10589 value
10590 }
10591 }
10592
10593 unsafe impl fidl::encoding::TypeMarker for HostVsockEndpointConnectResponse {
10594 type Owned = Self;
10595
10596 #[inline(always)]
10597 fn inline_align(_context: fidl::encoding::Context) -> usize {
10598 4
10599 }
10600
10601 #[inline(always)]
10602 fn inline_size(_context: fidl::encoding::Context) -> usize {
10603 4
10604 }
10605 }
10606
10607 unsafe impl
10608 fidl::encoding::Encode<
10609 HostVsockEndpointConnectResponse,
10610 fidl::encoding::DefaultFuchsiaResourceDialect,
10611 > for &mut HostVsockEndpointConnectResponse
10612 {
10613 #[inline]
10614 unsafe fn encode(
10615 self,
10616 encoder: &mut fidl::encoding::Encoder<
10617 '_,
10618 fidl::encoding::DefaultFuchsiaResourceDialect,
10619 >,
10620 offset: usize,
10621 _depth: fidl::encoding::Depth,
10622 ) -> fidl::Result<()> {
10623 encoder.debug_check_bounds::<HostVsockEndpointConnectResponse>(offset);
10624 fidl::encoding::Encode::<
10626 HostVsockEndpointConnectResponse,
10627 fidl::encoding::DefaultFuchsiaResourceDialect,
10628 >::encode(
10629 (<fidl::encoding::HandleType<
10630 fidl::Socket,
10631 { fidl::ObjectType::SOCKET.into_raw() },
10632 2147483648,
10633 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10634 &mut self.socket
10635 ),),
10636 encoder,
10637 offset,
10638 _depth,
10639 )
10640 }
10641 }
10642 unsafe impl<
10643 T0: fidl::encoding::Encode<
10644 fidl::encoding::HandleType<
10645 fidl::Socket,
10646 { fidl::ObjectType::SOCKET.into_raw() },
10647 2147483648,
10648 >,
10649 fidl::encoding::DefaultFuchsiaResourceDialect,
10650 >,
10651 >
10652 fidl::encoding::Encode<
10653 HostVsockEndpointConnectResponse,
10654 fidl::encoding::DefaultFuchsiaResourceDialect,
10655 > for (T0,)
10656 {
10657 #[inline]
10658 unsafe fn encode(
10659 self,
10660 encoder: &mut fidl::encoding::Encoder<
10661 '_,
10662 fidl::encoding::DefaultFuchsiaResourceDialect,
10663 >,
10664 offset: usize,
10665 depth: fidl::encoding::Depth,
10666 ) -> fidl::Result<()> {
10667 encoder.debug_check_bounds::<HostVsockEndpointConnectResponse>(offset);
10668 self.0.encode(encoder, offset + 0, depth)?;
10672 Ok(())
10673 }
10674 }
10675
10676 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10677 for HostVsockEndpointConnectResponse
10678 {
10679 #[inline(always)]
10680 fn new_empty() -> Self {
10681 Self {
10682 socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10683 }
10684 }
10685
10686 #[inline]
10687 unsafe fn decode(
10688 &mut self,
10689 decoder: &mut fidl::encoding::Decoder<
10690 '_,
10691 fidl::encoding::DefaultFuchsiaResourceDialect,
10692 >,
10693 offset: usize,
10694 _depth: fidl::encoding::Depth,
10695 ) -> fidl::Result<()> {
10696 decoder.debug_check_bounds::<Self>(offset);
10697 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
10699 Ok(())
10700 }
10701 }
10702
10703 impl fidl::encoding::ResourceTypeMarker for Listener {
10704 type Borrowed<'a> = &'a mut Self;
10705 fn take_or_borrow<'a>(
10706 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10707 ) -> Self::Borrowed<'a> {
10708 value
10709 }
10710 }
10711
10712 unsafe impl fidl::encoding::TypeMarker for Listener {
10713 type Owned = Self;
10714
10715 #[inline(always)]
10716 fn inline_align(_context: fidl::encoding::Context) -> usize {
10717 4
10718 }
10719
10720 #[inline(always)]
10721 fn inline_size(_context: fidl::encoding::Context) -> usize {
10722 8
10723 }
10724 }
10725
10726 unsafe impl fidl::encoding::Encode<Listener, fidl::encoding::DefaultFuchsiaResourceDialect>
10727 for &mut Listener
10728 {
10729 #[inline]
10730 unsafe fn encode(
10731 self,
10732 encoder: &mut fidl::encoding::Encoder<
10733 '_,
10734 fidl::encoding::DefaultFuchsiaResourceDialect,
10735 >,
10736 offset: usize,
10737 _depth: fidl::encoding::Depth,
10738 ) -> fidl::Result<()> {
10739 encoder.debug_check_bounds::<Listener>(offset);
10740 fidl::encoding::Encode::<Listener, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10742 (
10743 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.port),
10744 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.acceptor),
10745 ),
10746 encoder, offset, _depth
10747 )
10748 }
10749 }
10750 unsafe impl<
10751 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
10752 T1: fidl::encoding::Encode<
10753 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>>,
10754 fidl::encoding::DefaultFuchsiaResourceDialect,
10755 >,
10756 > fidl::encoding::Encode<Listener, fidl::encoding::DefaultFuchsiaResourceDialect>
10757 for (T0, T1)
10758 {
10759 #[inline]
10760 unsafe fn encode(
10761 self,
10762 encoder: &mut fidl::encoding::Encoder<
10763 '_,
10764 fidl::encoding::DefaultFuchsiaResourceDialect,
10765 >,
10766 offset: usize,
10767 depth: fidl::encoding::Depth,
10768 ) -> fidl::Result<()> {
10769 encoder.debug_check_bounds::<Listener>(offset);
10770 self.0.encode(encoder, offset + 0, depth)?;
10774 self.1.encode(encoder, offset + 4, depth)?;
10775 Ok(())
10776 }
10777 }
10778
10779 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Listener {
10780 #[inline(always)]
10781 fn new_empty() -> Self {
10782 Self {
10783 port: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
10784 acceptor: fidl::new_empty!(
10785 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>>,
10786 fidl::encoding::DefaultFuchsiaResourceDialect
10787 ),
10788 }
10789 }
10790
10791 #[inline]
10792 unsafe fn decode(
10793 &mut self,
10794 decoder: &mut fidl::encoding::Decoder<
10795 '_,
10796 fidl::encoding::DefaultFuchsiaResourceDialect,
10797 >,
10798 offset: usize,
10799 _depth: fidl::encoding::Depth,
10800 ) -> fidl::Result<()> {
10801 decoder.debug_check_bounds::<Self>(offset);
10802 fidl::decode!(
10804 u32,
10805 fidl::encoding::DefaultFuchsiaResourceDialect,
10806 &mut self.port,
10807 decoder,
10808 offset + 0,
10809 _depth
10810 )?;
10811 fidl::decode!(
10812 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<HostVsockAcceptorMarker>>,
10813 fidl::encoding::DefaultFuchsiaResourceDialect,
10814 &mut self.acceptor,
10815 decoder,
10816 offset + 4,
10817 _depth
10818 )?;
10819 Ok(())
10820 }
10821 }
10822
10823 impl fidl::encoding::ResourceTypeMarker for WaylandDevice {
10824 type Borrowed<'a> = &'a mut Self;
10825 fn take_or_borrow<'a>(
10826 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10827 ) -> Self::Borrowed<'a> {
10828 value
10829 }
10830 }
10831
10832 unsafe impl fidl::encoding::TypeMarker for WaylandDevice {
10833 type Owned = Self;
10834
10835 #[inline(always)]
10836 fn inline_align(_context: fidl::encoding::Context) -> usize {
10837 8
10838 }
10839
10840 #[inline(always)]
10841 fn inline_size(_context: fidl::encoding::Context) -> usize {
10842 16
10843 }
10844 }
10845
10846 unsafe impl fidl::encoding::Encode<WaylandDevice, fidl::encoding::DefaultFuchsiaResourceDialect>
10847 for &mut WaylandDevice
10848 {
10849 #[inline]
10850 unsafe fn encode(
10851 self,
10852 encoder: &mut fidl::encoding::Encoder<
10853 '_,
10854 fidl::encoding::DefaultFuchsiaResourceDialect,
10855 >,
10856 offset: usize,
10857 _depth: fidl::encoding::Depth,
10858 ) -> fidl::Result<()> {
10859 encoder.debug_check_bounds::<WaylandDevice>(offset);
10860 fidl::encoding::Encode::<WaylandDevice, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10862 (
10863 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory),
10864 <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_wayland::Server_Marker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server),
10865 ),
10866 encoder, offset, _depth
10867 )
10868 }
10869 }
10870 unsafe impl<
10871 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10872 T1: fidl::encoding::Encode<
10873 fidl::encoding::Optional<
10874 fidl::encoding::Endpoint<
10875 fidl::endpoints::ClientEnd<fidl_fuchsia_wayland::Server_Marker>,
10876 >,
10877 >,
10878 fidl::encoding::DefaultFuchsiaResourceDialect,
10879 >,
10880 > fidl::encoding::Encode<WaylandDevice, fidl::encoding::DefaultFuchsiaResourceDialect>
10881 for (T0, T1)
10882 {
10883 #[inline]
10884 unsafe fn encode(
10885 self,
10886 encoder: &mut fidl::encoding::Encoder<
10887 '_,
10888 fidl::encoding::DefaultFuchsiaResourceDialect,
10889 >,
10890 offset: usize,
10891 depth: fidl::encoding::Depth,
10892 ) -> fidl::Result<()> {
10893 encoder.debug_check_bounds::<WaylandDevice>(offset);
10894 unsafe {
10897 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10898 (ptr as *mut u64).write_unaligned(0);
10899 }
10900 self.0.encode(encoder, offset + 0, depth)?;
10902 self.1.encode(encoder, offset + 8, depth)?;
10903 Ok(())
10904 }
10905 }
10906
10907 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for WaylandDevice {
10908 #[inline(always)]
10909 fn new_empty() -> Self {
10910 Self {
10911 memory: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10912 server: fidl::new_empty!(
10913 fidl::encoding::Optional<
10914 fidl::encoding::Endpoint<
10915 fidl::endpoints::ClientEnd<fidl_fuchsia_wayland::Server_Marker>,
10916 >,
10917 >,
10918 fidl::encoding::DefaultFuchsiaResourceDialect
10919 ),
10920 }
10921 }
10922
10923 #[inline]
10924 unsafe fn decode(
10925 &mut self,
10926 decoder: &mut fidl::encoding::Decoder<
10927 '_,
10928 fidl::encoding::DefaultFuchsiaResourceDialect,
10929 >,
10930 offset: usize,
10931 _depth: fidl::encoding::Depth,
10932 ) -> fidl::Result<()> {
10933 decoder.debug_check_bounds::<Self>(offset);
10934 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10936 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10937 let mask = 0xffffffff00000000u64;
10938 let maskedval = padval & mask;
10939 if maskedval != 0 {
10940 return Err(fidl::Error::NonZeroPadding {
10941 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10942 });
10943 }
10944 fidl::decode!(
10945 u64,
10946 fidl::encoding::DefaultFuchsiaResourceDialect,
10947 &mut self.memory,
10948 decoder,
10949 offset + 0,
10950 _depth
10951 )?;
10952 fidl::decode!(
10953 fidl::encoding::Optional<
10954 fidl::encoding::Endpoint<
10955 fidl::endpoints::ClientEnd<fidl_fuchsia_wayland::Server_Marker>,
10956 >,
10957 >,
10958 fidl::encoding::DefaultFuchsiaResourceDialect,
10959 &mut self.server,
10960 decoder,
10961 offset + 8,
10962 _depth
10963 )?;
10964 Ok(())
10965 }
10966 }
10967
10968 impl GuestConfig {
10969 #[inline(always)]
10970 fn max_ordinal_present(&self) -> u64 {
10971 if let Some(_) = self.virtio_mem_region_alignment {
10972 return 25;
10973 }
10974 if let Some(_) = self.virtio_mem_region_size {
10975 return 24;
10976 }
10977 if let Some(_) = self.virtio_mem_block_size {
10978 return 23;
10979 }
10980 if let Some(_) = self.virtio_mem {
10981 return 22;
10982 }
10983 if let Some(_) = self.vsock_listeners {
10984 return 21;
10985 }
10986 if let Some(_) = self.virtio_sound_input {
10987 return 20;
10988 }
10989 if let Some(_) = self.virtio_sound {
10990 return 19;
10991 }
10992 if let Some(_) = self.virtio_vsock {
10993 return 18;
10994 }
10995 if let Some(_) = self.virtio_rng {
10996 return 17;
10997 }
10998 if let Some(_) = self.virtio_gpu {
10999 return 16;
11000 }
11001 if let Some(_) = self.virtio_console {
11002 return 15;
11003 }
11004 if let Some(_) = self.virtio_balloon {
11005 return 14;
11006 }
11007 if let Some(_) = self.default_net {
11008 return 13;
11009 }
11010 if let Some(_) = self.magma_device {
11011 return 12;
11012 }
11013 if let Some(_) = self.wayland_device {
11014 return 11;
11015 }
11016 if let Some(_) = self.net_devices {
11017 return 10;
11018 }
11019 if let Some(_) = self.block_devices {
11020 return 9;
11021 }
11022 if let Some(_) = self.guest_memory {
11023 return 8;
11024 }
11025 if let Some(_) = self.cpus {
11026 return 7;
11027 }
11028 if let Some(_) = self.cmdline_add {
11029 return 6;
11030 }
11031 if let Some(_) = self.cmdline {
11032 return 5;
11033 }
11034 if let Some(_) = self.dtb_overlay {
11035 return 4;
11036 }
11037 if let Some(_) = self.ramdisk {
11038 return 3;
11039 }
11040 if let Some(_) = self.kernel {
11041 return 2;
11042 }
11043 if let Some(_) = self.kernel_type {
11044 return 1;
11045 }
11046 0
11047 }
11048 }
11049
11050 impl fidl::encoding::ResourceTypeMarker for GuestConfig {
11051 type Borrowed<'a> = &'a mut Self;
11052 fn take_or_borrow<'a>(
11053 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11054 ) -> Self::Borrowed<'a> {
11055 value
11056 }
11057 }
11058
11059 unsafe impl fidl::encoding::TypeMarker for GuestConfig {
11060 type Owned = Self;
11061
11062 #[inline(always)]
11063 fn inline_align(_context: fidl::encoding::Context) -> usize {
11064 8
11065 }
11066
11067 #[inline(always)]
11068 fn inline_size(_context: fidl::encoding::Context) -> usize {
11069 16
11070 }
11071 }
11072
11073 unsafe impl fidl::encoding::Encode<GuestConfig, fidl::encoding::DefaultFuchsiaResourceDialect>
11074 for &mut GuestConfig
11075 {
11076 unsafe fn encode(
11077 self,
11078 encoder: &mut fidl::encoding::Encoder<
11079 '_,
11080 fidl::encoding::DefaultFuchsiaResourceDialect,
11081 >,
11082 offset: usize,
11083 mut depth: fidl::encoding::Depth,
11084 ) -> fidl::Result<()> {
11085 encoder.debug_check_bounds::<GuestConfig>(offset);
11086 let max_ordinal: u64 = self.max_ordinal_present();
11088 encoder.write_num(max_ordinal, offset);
11089 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11090 if max_ordinal == 0 {
11092 return Ok(());
11093 }
11094 depth.increment()?;
11095 let envelope_size = 8;
11096 let bytes_len = max_ordinal as usize * envelope_size;
11097 #[allow(unused_variables)]
11098 let offset = encoder.out_of_line_offset(bytes_len);
11099 let mut _prev_end_offset: usize = 0;
11100 if 1 > max_ordinal {
11101 return Ok(());
11102 }
11103
11104 let cur_offset: usize = (1 - 1) * envelope_size;
11107
11108 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11110
11111 fidl::encoding::encode_in_envelope_optional::<
11116 KernelType,
11117 fidl::encoding::DefaultFuchsiaResourceDialect,
11118 >(
11119 self.kernel_type
11120 .as_ref()
11121 .map(<KernelType as fidl::encoding::ValueTypeMarker>::borrow),
11122 encoder,
11123 offset + cur_offset,
11124 depth,
11125 )?;
11126
11127 _prev_end_offset = cur_offset + envelope_size;
11128 if 2 > max_ordinal {
11129 return Ok(());
11130 }
11131
11132 let cur_offset: usize = (2 - 1) * envelope_size;
11135
11136 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11138
11139 fidl::encoding::encode_in_envelope_optional::<
11144 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
11145 fidl::encoding::DefaultFuchsiaResourceDialect,
11146 >(
11147 self.kernel.as_mut().map(
11148 <fidl::encoding::Endpoint<
11149 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11150 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11151 ),
11152 encoder,
11153 offset + cur_offset,
11154 depth,
11155 )?;
11156
11157 _prev_end_offset = cur_offset + envelope_size;
11158 if 3 > max_ordinal {
11159 return Ok(());
11160 }
11161
11162 let cur_offset: usize = (3 - 1) * envelope_size;
11165
11166 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11168
11169 fidl::encoding::encode_in_envelope_optional::<
11174 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
11175 fidl::encoding::DefaultFuchsiaResourceDialect,
11176 >(
11177 self.ramdisk.as_mut().map(
11178 <fidl::encoding::Endpoint<
11179 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11180 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11181 ),
11182 encoder,
11183 offset + cur_offset,
11184 depth,
11185 )?;
11186
11187 _prev_end_offset = cur_offset + envelope_size;
11188 if 4 > max_ordinal {
11189 return Ok(());
11190 }
11191
11192 let cur_offset: usize = (4 - 1) * envelope_size;
11195
11196 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11198
11199 fidl::encoding::encode_in_envelope_optional::<
11204 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
11205 fidl::encoding::DefaultFuchsiaResourceDialect,
11206 >(
11207 self.dtb_overlay.as_mut().map(
11208 <fidl::encoding::Endpoint<
11209 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11210 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11211 ),
11212 encoder,
11213 offset + cur_offset,
11214 depth,
11215 )?;
11216
11217 _prev_end_offset = cur_offset + envelope_size;
11218 if 5 > max_ordinal {
11219 return Ok(());
11220 }
11221
11222 let cur_offset: usize = (5 - 1) * envelope_size;
11225
11226 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11228
11229 fidl::encoding::encode_in_envelope_optional::<
11234 fidl::encoding::UnboundedString,
11235 fidl::encoding::DefaultFuchsiaResourceDialect,
11236 >(
11237 self.cmdline.as_ref().map(
11238 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
11239 ),
11240 encoder,
11241 offset + cur_offset,
11242 depth,
11243 )?;
11244
11245 _prev_end_offset = cur_offset + envelope_size;
11246 if 6 > max_ordinal {
11247 return Ok(());
11248 }
11249
11250 let cur_offset: usize = (6 - 1) * envelope_size;
11253
11254 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11256
11257 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11262 self.cmdline_add.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
11263 encoder, offset + cur_offset, depth
11264 )?;
11265
11266 _prev_end_offset = cur_offset + envelope_size;
11267 if 7 > max_ordinal {
11268 return Ok(());
11269 }
11270
11271 let cur_offset: usize = (7 - 1) * envelope_size;
11274
11275 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11277
11278 fidl::encoding::encode_in_envelope_optional::<
11283 u8,
11284 fidl::encoding::DefaultFuchsiaResourceDialect,
11285 >(
11286 self.cpus.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
11287 encoder,
11288 offset + cur_offset,
11289 depth,
11290 )?;
11291
11292 _prev_end_offset = cur_offset + envelope_size;
11293 if 8 > max_ordinal {
11294 return Ok(());
11295 }
11296
11297 let cur_offset: usize = (8 - 1) * envelope_size;
11300
11301 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11303
11304 fidl::encoding::encode_in_envelope_optional::<
11309 u64,
11310 fidl::encoding::DefaultFuchsiaResourceDialect,
11311 >(
11312 self.guest_memory.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
11313 encoder,
11314 offset + cur_offset,
11315 depth,
11316 )?;
11317
11318 _prev_end_offset = cur_offset + envelope_size;
11319 if 9 > max_ordinal {
11320 return Ok(());
11321 }
11322
11323 let cur_offset: usize = (9 - 1) * envelope_size;
11326
11327 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11329
11330 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<BlockSpec, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11335 self.block_devices.as_mut().map(<fidl::encoding::Vector<BlockSpec, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11336 encoder, offset + cur_offset, depth
11337 )?;
11338
11339 _prev_end_offset = cur_offset + envelope_size;
11340 if 10 > max_ordinal {
11341 return Ok(());
11342 }
11343
11344 let cur_offset: usize = (10 - 1) * envelope_size;
11347
11348 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11350
11351 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NetSpec, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11356 self.net_devices.as_ref().map(<fidl::encoding::Vector<NetSpec, 32> as fidl::encoding::ValueTypeMarker>::borrow),
11357 encoder, offset + cur_offset, depth
11358 )?;
11359
11360 _prev_end_offset = cur_offset + envelope_size;
11361 if 11 > max_ordinal {
11362 return Ok(());
11363 }
11364
11365 let cur_offset: usize = (11 - 1) * envelope_size;
11368
11369 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11371
11372 fidl::encoding::encode_in_envelope_optional::<
11377 WaylandDevice,
11378 fidl::encoding::DefaultFuchsiaResourceDialect,
11379 >(
11380 self.wayland_device
11381 .as_mut()
11382 .map(<WaylandDevice as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11383 encoder,
11384 offset + cur_offset,
11385 depth,
11386 )?;
11387
11388 _prev_end_offset = cur_offset + envelope_size;
11389 if 12 > max_ordinal {
11390 return Ok(());
11391 }
11392
11393 let cur_offset: usize = (12 - 1) * envelope_size;
11396
11397 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11399
11400 fidl::encoding::encode_in_envelope_optional::<
11405 MagmaDevice,
11406 fidl::encoding::DefaultFuchsiaResourceDialect,
11407 >(
11408 self.magma_device
11409 .as_ref()
11410 .map(<MagmaDevice as fidl::encoding::ValueTypeMarker>::borrow),
11411 encoder,
11412 offset + cur_offset,
11413 depth,
11414 )?;
11415
11416 _prev_end_offset = cur_offset + envelope_size;
11417 if 13 > max_ordinal {
11418 return Ok(());
11419 }
11420
11421 let cur_offset: usize = (13 - 1) * envelope_size;
11424
11425 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11427
11428 fidl::encoding::encode_in_envelope_optional::<
11433 bool,
11434 fidl::encoding::DefaultFuchsiaResourceDialect,
11435 >(
11436 self.default_net.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11437 encoder,
11438 offset + cur_offset,
11439 depth,
11440 )?;
11441
11442 _prev_end_offset = cur_offset + envelope_size;
11443 if 14 > max_ordinal {
11444 return Ok(());
11445 }
11446
11447 let cur_offset: usize = (14 - 1) * envelope_size;
11450
11451 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11453
11454 fidl::encoding::encode_in_envelope_optional::<
11459 bool,
11460 fidl::encoding::DefaultFuchsiaResourceDialect,
11461 >(
11462 self.virtio_balloon.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11463 encoder,
11464 offset + cur_offset,
11465 depth,
11466 )?;
11467
11468 _prev_end_offset = cur_offset + envelope_size;
11469 if 15 > max_ordinal {
11470 return Ok(());
11471 }
11472
11473 let cur_offset: usize = (15 - 1) * envelope_size;
11476
11477 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11479
11480 fidl::encoding::encode_in_envelope_optional::<
11485 bool,
11486 fidl::encoding::DefaultFuchsiaResourceDialect,
11487 >(
11488 self.virtio_console.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11489 encoder,
11490 offset + cur_offset,
11491 depth,
11492 )?;
11493
11494 _prev_end_offset = cur_offset + envelope_size;
11495 if 16 > max_ordinal {
11496 return Ok(());
11497 }
11498
11499 let cur_offset: usize = (16 - 1) * envelope_size;
11502
11503 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11505
11506 fidl::encoding::encode_in_envelope_optional::<
11511 bool,
11512 fidl::encoding::DefaultFuchsiaResourceDialect,
11513 >(
11514 self.virtio_gpu.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11515 encoder,
11516 offset + cur_offset,
11517 depth,
11518 )?;
11519
11520 _prev_end_offset = cur_offset + envelope_size;
11521 if 17 > max_ordinal {
11522 return Ok(());
11523 }
11524
11525 let cur_offset: usize = (17 - 1) * envelope_size;
11528
11529 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11531
11532 fidl::encoding::encode_in_envelope_optional::<
11537 bool,
11538 fidl::encoding::DefaultFuchsiaResourceDialect,
11539 >(
11540 self.virtio_rng.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11541 encoder,
11542 offset + cur_offset,
11543 depth,
11544 )?;
11545
11546 _prev_end_offset = cur_offset + envelope_size;
11547 if 18 > max_ordinal {
11548 return Ok(());
11549 }
11550
11551 let cur_offset: usize = (18 - 1) * envelope_size;
11554
11555 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11557
11558 fidl::encoding::encode_in_envelope_optional::<
11563 bool,
11564 fidl::encoding::DefaultFuchsiaResourceDialect,
11565 >(
11566 self.virtio_vsock.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11567 encoder,
11568 offset + cur_offset,
11569 depth,
11570 )?;
11571
11572 _prev_end_offset = cur_offset + envelope_size;
11573 if 19 > max_ordinal {
11574 return Ok(());
11575 }
11576
11577 let cur_offset: usize = (19 - 1) * envelope_size;
11580
11581 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11583
11584 fidl::encoding::encode_in_envelope_optional::<
11589 bool,
11590 fidl::encoding::DefaultFuchsiaResourceDialect,
11591 >(
11592 self.virtio_sound.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11593 encoder,
11594 offset + cur_offset,
11595 depth,
11596 )?;
11597
11598 _prev_end_offset = cur_offset + envelope_size;
11599 if 20 > max_ordinal {
11600 return Ok(());
11601 }
11602
11603 let cur_offset: usize = (20 - 1) * envelope_size;
11606
11607 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11609
11610 fidl::encoding::encode_in_envelope_optional::<
11615 bool,
11616 fidl::encoding::DefaultFuchsiaResourceDialect,
11617 >(
11618 self.virtio_sound_input
11619 .as_ref()
11620 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11621 encoder,
11622 offset + cur_offset,
11623 depth,
11624 )?;
11625
11626 _prev_end_offset = cur_offset + envelope_size;
11627 if 21 > max_ordinal {
11628 return Ok(());
11629 }
11630
11631 let cur_offset: usize = (21 - 1) * envelope_size;
11634
11635 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11637
11638 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Listener>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11643 self.vsock_listeners.as_mut().map(<fidl::encoding::UnboundedVector<Listener> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11644 encoder, offset + cur_offset, depth
11645 )?;
11646
11647 _prev_end_offset = cur_offset + envelope_size;
11648 if 22 > max_ordinal {
11649 return Ok(());
11650 }
11651
11652 let cur_offset: usize = (22 - 1) * envelope_size;
11655
11656 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11658
11659 fidl::encoding::encode_in_envelope_optional::<
11664 bool,
11665 fidl::encoding::DefaultFuchsiaResourceDialect,
11666 >(
11667 self.virtio_mem.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11668 encoder,
11669 offset + cur_offset,
11670 depth,
11671 )?;
11672
11673 _prev_end_offset = cur_offset + envelope_size;
11674 if 23 > max_ordinal {
11675 return Ok(());
11676 }
11677
11678 let cur_offset: usize = (23 - 1) * envelope_size;
11681
11682 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11684
11685 fidl::encoding::encode_in_envelope_optional::<
11690 u64,
11691 fidl::encoding::DefaultFuchsiaResourceDialect,
11692 >(
11693 self.virtio_mem_block_size
11694 .as_ref()
11695 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
11696 encoder,
11697 offset + cur_offset,
11698 depth,
11699 )?;
11700
11701 _prev_end_offset = cur_offset + envelope_size;
11702 if 24 > max_ordinal {
11703 return Ok(());
11704 }
11705
11706 let cur_offset: usize = (24 - 1) * envelope_size;
11709
11710 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11712
11713 fidl::encoding::encode_in_envelope_optional::<
11718 u64,
11719 fidl::encoding::DefaultFuchsiaResourceDialect,
11720 >(
11721 self.virtio_mem_region_size
11722 .as_ref()
11723 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
11724 encoder,
11725 offset + cur_offset,
11726 depth,
11727 )?;
11728
11729 _prev_end_offset = cur_offset + envelope_size;
11730 if 25 > max_ordinal {
11731 return Ok(());
11732 }
11733
11734 let cur_offset: usize = (25 - 1) * envelope_size;
11737
11738 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11740
11741 fidl::encoding::encode_in_envelope_optional::<
11746 u64,
11747 fidl::encoding::DefaultFuchsiaResourceDialect,
11748 >(
11749 self.virtio_mem_region_alignment
11750 .as_ref()
11751 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
11752 encoder,
11753 offset + cur_offset,
11754 depth,
11755 )?;
11756
11757 _prev_end_offset = cur_offset + envelope_size;
11758
11759 Ok(())
11760 }
11761 }
11762
11763 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for GuestConfig {
11764 #[inline(always)]
11765 fn new_empty() -> Self {
11766 Self::default()
11767 }
11768
11769 unsafe fn decode(
11770 &mut self,
11771 decoder: &mut fidl::encoding::Decoder<
11772 '_,
11773 fidl::encoding::DefaultFuchsiaResourceDialect,
11774 >,
11775 offset: usize,
11776 mut depth: fidl::encoding::Depth,
11777 ) -> fidl::Result<()> {
11778 decoder.debug_check_bounds::<Self>(offset);
11779 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11780 None => return Err(fidl::Error::NotNullable),
11781 Some(len) => len,
11782 };
11783 if len == 0 {
11785 return Ok(());
11786 };
11787 depth.increment()?;
11788 let envelope_size = 8;
11789 let bytes_len = len * envelope_size;
11790 let offset = decoder.out_of_line_offset(bytes_len)?;
11791 let mut _next_ordinal_to_read = 0;
11793 let mut next_offset = offset;
11794 let end_offset = offset + bytes_len;
11795 _next_ordinal_to_read += 1;
11796 if next_offset >= end_offset {
11797 return Ok(());
11798 }
11799
11800 while _next_ordinal_to_read < 1 {
11802 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11803 _next_ordinal_to_read += 1;
11804 next_offset += envelope_size;
11805 }
11806
11807 let next_out_of_line = decoder.next_out_of_line();
11808 let handles_before = decoder.remaining_handles();
11809 if let Some((inlined, num_bytes, num_handles)) =
11810 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11811 {
11812 let member_inline_size =
11813 <KernelType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11814 if inlined != (member_inline_size <= 4) {
11815 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11816 }
11817 let inner_offset;
11818 let mut inner_depth = depth.clone();
11819 if inlined {
11820 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11821 inner_offset = next_offset;
11822 } else {
11823 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11824 inner_depth.increment()?;
11825 }
11826 let val_ref = self.kernel_type.get_or_insert_with(|| {
11827 fidl::new_empty!(KernelType, fidl::encoding::DefaultFuchsiaResourceDialect)
11828 });
11829 fidl::decode!(
11830 KernelType,
11831 fidl::encoding::DefaultFuchsiaResourceDialect,
11832 val_ref,
11833 decoder,
11834 inner_offset,
11835 inner_depth
11836 )?;
11837 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11838 {
11839 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11840 }
11841 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11842 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11843 }
11844 }
11845
11846 next_offset += envelope_size;
11847 _next_ordinal_to_read += 1;
11848 if next_offset >= end_offset {
11849 return Ok(());
11850 }
11851
11852 while _next_ordinal_to_read < 2 {
11854 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11855 _next_ordinal_to_read += 1;
11856 next_offset += envelope_size;
11857 }
11858
11859 let next_out_of_line = decoder.next_out_of_line();
11860 let handles_before = decoder.remaining_handles();
11861 if let Some((inlined, num_bytes, num_handles)) =
11862 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11863 {
11864 let member_inline_size = <fidl::encoding::Endpoint<
11865 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11866 > as fidl::encoding::TypeMarker>::inline_size(
11867 decoder.context
11868 );
11869 if inlined != (member_inline_size <= 4) {
11870 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11871 }
11872 let inner_offset;
11873 let mut inner_depth = depth.clone();
11874 if inlined {
11875 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11876 inner_offset = next_offset;
11877 } else {
11878 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11879 inner_depth.increment()?;
11880 }
11881 let val_ref = self.kernel.get_or_insert_with(|| {
11882 fidl::new_empty!(
11883 fidl::encoding::Endpoint<
11884 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11885 >,
11886 fidl::encoding::DefaultFuchsiaResourceDialect
11887 )
11888 });
11889 fidl::decode!(
11890 fidl::encoding::Endpoint<
11891 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11892 >,
11893 fidl::encoding::DefaultFuchsiaResourceDialect,
11894 val_ref,
11895 decoder,
11896 inner_offset,
11897 inner_depth
11898 )?;
11899 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11900 {
11901 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11902 }
11903 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11904 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11905 }
11906 }
11907
11908 next_offset += envelope_size;
11909 _next_ordinal_to_read += 1;
11910 if next_offset >= end_offset {
11911 return Ok(());
11912 }
11913
11914 while _next_ordinal_to_read < 3 {
11916 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11917 _next_ordinal_to_read += 1;
11918 next_offset += envelope_size;
11919 }
11920
11921 let next_out_of_line = decoder.next_out_of_line();
11922 let handles_before = decoder.remaining_handles();
11923 if let Some((inlined, num_bytes, num_handles)) =
11924 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11925 {
11926 let member_inline_size = <fidl::encoding::Endpoint<
11927 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11928 > as fidl::encoding::TypeMarker>::inline_size(
11929 decoder.context
11930 );
11931 if inlined != (member_inline_size <= 4) {
11932 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11933 }
11934 let inner_offset;
11935 let mut inner_depth = depth.clone();
11936 if inlined {
11937 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11938 inner_offset = next_offset;
11939 } else {
11940 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11941 inner_depth.increment()?;
11942 }
11943 let val_ref = self.ramdisk.get_or_insert_with(|| {
11944 fidl::new_empty!(
11945 fidl::encoding::Endpoint<
11946 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11947 >,
11948 fidl::encoding::DefaultFuchsiaResourceDialect
11949 )
11950 });
11951 fidl::decode!(
11952 fidl::encoding::Endpoint<
11953 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11954 >,
11955 fidl::encoding::DefaultFuchsiaResourceDialect,
11956 val_ref,
11957 decoder,
11958 inner_offset,
11959 inner_depth
11960 )?;
11961 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11962 {
11963 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11964 }
11965 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11966 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11967 }
11968 }
11969
11970 next_offset += envelope_size;
11971 _next_ordinal_to_read += 1;
11972 if next_offset >= end_offset {
11973 return Ok(());
11974 }
11975
11976 while _next_ordinal_to_read < 4 {
11978 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11979 _next_ordinal_to_read += 1;
11980 next_offset += envelope_size;
11981 }
11982
11983 let next_out_of_line = decoder.next_out_of_line();
11984 let handles_before = decoder.remaining_handles();
11985 if let Some((inlined, num_bytes, num_handles)) =
11986 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11987 {
11988 let member_inline_size = <fidl::encoding::Endpoint<
11989 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
11990 > as fidl::encoding::TypeMarker>::inline_size(
11991 decoder.context
11992 );
11993 if inlined != (member_inline_size <= 4) {
11994 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11995 }
11996 let inner_offset;
11997 let mut inner_depth = depth.clone();
11998 if inlined {
11999 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12000 inner_offset = next_offset;
12001 } else {
12002 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12003 inner_depth.increment()?;
12004 }
12005 let val_ref = self.dtb_overlay.get_or_insert_with(|| {
12006 fidl::new_empty!(
12007 fidl::encoding::Endpoint<
12008 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
12009 >,
12010 fidl::encoding::DefaultFuchsiaResourceDialect
12011 )
12012 });
12013 fidl::decode!(
12014 fidl::encoding::Endpoint<
12015 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
12016 >,
12017 fidl::encoding::DefaultFuchsiaResourceDialect,
12018 val_ref,
12019 decoder,
12020 inner_offset,
12021 inner_depth
12022 )?;
12023 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12024 {
12025 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12026 }
12027 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12028 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12029 }
12030 }
12031
12032 next_offset += envelope_size;
12033 _next_ordinal_to_read += 1;
12034 if next_offset >= end_offset {
12035 return Ok(());
12036 }
12037
12038 while _next_ordinal_to_read < 5 {
12040 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12041 _next_ordinal_to_read += 1;
12042 next_offset += envelope_size;
12043 }
12044
12045 let next_out_of_line = decoder.next_out_of_line();
12046 let handles_before = decoder.remaining_handles();
12047 if let Some((inlined, num_bytes, num_handles)) =
12048 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12049 {
12050 let member_inline_size =
12051 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
12052 decoder.context,
12053 );
12054 if inlined != (member_inline_size <= 4) {
12055 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12056 }
12057 let inner_offset;
12058 let mut inner_depth = depth.clone();
12059 if inlined {
12060 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12061 inner_offset = next_offset;
12062 } else {
12063 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12064 inner_depth.increment()?;
12065 }
12066 let val_ref = self.cmdline.get_or_insert_with(|| {
12067 fidl::new_empty!(
12068 fidl::encoding::UnboundedString,
12069 fidl::encoding::DefaultFuchsiaResourceDialect
12070 )
12071 });
12072 fidl::decode!(
12073 fidl::encoding::UnboundedString,
12074 fidl::encoding::DefaultFuchsiaResourceDialect,
12075 val_ref,
12076 decoder,
12077 inner_offset,
12078 inner_depth
12079 )?;
12080 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12081 {
12082 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12083 }
12084 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12085 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12086 }
12087 }
12088
12089 next_offset += envelope_size;
12090 _next_ordinal_to_read += 1;
12091 if next_offset >= end_offset {
12092 return Ok(());
12093 }
12094
12095 while _next_ordinal_to_read < 6 {
12097 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12098 _next_ordinal_to_read += 1;
12099 next_offset += envelope_size;
12100 }
12101
12102 let next_out_of_line = decoder.next_out_of_line();
12103 let handles_before = decoder.remaining_handles();
12104 if let Some((inlined, num_bytes, num_handles)) =
12105 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12106 {
12107 let member_inline_size = <fidl::encoding::UnboundedVector<
12108 fidl::encoding::UnboundedString,
12109 > as fidl::encoding::TypeMarker>::inline_size(
12110 decoder.context
12111 );
12112 if inlined != (member_inline_size <= 4) {
12113 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12114 }
12115 let inner_offset;
12116 let mut inner_depth = depth.clone();
12117 if inlined {
12118 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12119 inner_offset = next_offset;
12120 } else {
12121 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12122 inner_depth.increment()?;
12123 }
12124 let val_ref = self.cmdline_add.get_or_insert_with(|| {
12125 fidl::new_empty!(
12126 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
12127 fidl::encoding::DefaultFuchsiaResourceDialect
12128 )
12129 });
12130 fidl::decode!(
12131 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
12132 fidl::encoding::DefaultFuchsiaResourceDialect,
12133 val_ref,
12134 decoder,
12135 inner_offset,
12136 inner_depth
12137 )?;
12138 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12139 {
12140 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12141 }
12142 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12143 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12144 }
12145 }
12146
12147 next_offset += envelope_size;
12148 _next_ordinal_to_read += 1;
12149 if next_offset >= end_offset {
12150 return Ok(());
12151 }
12152
12153 while _next_ordinal_to_read < 7 {
12155 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12156 _next_ordinal_to_read += 1;
12157 next_offset += envelope_size;
12158 }
12159
12160 let next_out_of_line = decoder.next_out_of_line();
12161 let handles_before = decoder.remaining_handles();
12162 if let Some((inlined, num_bytes, num_handles)) =
12163 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12164 {
12165 let member_inline_size =
12166 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12167 if inlined != (member_inline_size <= 4) {
12168 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12169 }
12170 let inner_offset;
12171 let mut inner_depth = depth.clone();
12172 if inlined {
12173 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12174 inner_offset = next_offset;
12175 } else {
12176 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12177 inner_depth.increment()?;
12178 }
12179 let val_ref = self.cpus.get_or_insert_with(|| {
12180 fidl::new_empty!(u8, fidl::encoding::DefaultFuchsiaResourceDialect)
12181 });
12182 fidl::decode!(
12183 u8,
12184 fidl::encoding::DefaultFuchsiaResourceDialect,
12185 val_ref,
12186 decoder,
12187 inner_offset,
12188 inner_depth
12189 )?;
12190 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12191 {
12192 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12193 }
12194 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12195 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12196 }
12197 }
12198
12199 next_offset += envelope_size;
12200 _next_ordinal_to_read += 1;
12201 if next_offset >= end_offset {
12202 return Ok(());
12203 }
12204
12205 while _next_ordinal_to_read < 8 {
12207 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12208 _next_ordinal_to_read += 1;
12209 next_offset += envelope_size;
12210 }
12211
12212 let next_out_of_line = decoder.next_out_of_line();
12213 let handles_before = decoder.remaining_handles();
12214 if let Some((inlined, num_bytes, num_handles)) =
12215 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12216 {
12217 let member_inline_size =
12218 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12219 if inlined != (member_inline_size <= 4) {
12220 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12221 }
12222 let inner_offset;
12223 let mut inner_depth = depth.clone();
12224 if inlined {
12225 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12226 inner_offset = next_offset;
12227 } else {
12228 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12229 inner_depth.increment()?;
12230 }
12231 let val_ref = self.guest_memory.get_or_insert_with(|| {
12232 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
12233 });
12234 fidl::decode!(
12235 u64,
12236 fidl::encoding::DefaultFuchsiaResourceDialect,
12237 val_ref,
12238 decoder,
12239 inner_offset,
12240 inner_depth
12241 )?;
12242 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12243 {
12244 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12245 }
12246 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12247 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12248 }
12249 }
12250
12251 next_offset += envelope_size;
12252 _next_ordinal_to_read += 1;
12253 if next_offset >= end_offset {
12254 return Ok(());
12255 }
12256
12257 while _next_ordinal_to_read < 9 {
12259 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12260 _next_ordinal_to_read += 1;
12261 next_offset += envelope_size;
12262 }
12263
12264 let next_out_of_line = decoder.next_out_of_line();
12265 let handles_before = decoder.remaining_handles();
12266 if let Some((inlined, num_bytes, num_handles)) =
12267 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12268 {
12269 let member_inline_size = <fidl::encoding::Vector<BlockSpec, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12270 if inlined != (member_inline_size <= 4) {
12271 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12272 }
12273 let inner_offset;
12274 let mut inner_depth = depth.clone();
12275 if inlined {
12276 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12277 inner_offset = next_offset;
12278 } else {
12279 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12280 inner_depth.increment()?;
12281 }
12282 let val_ref =
12283 self.block_devices.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<BlockSpec, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
12284 fidl::decode!(fidl::encoding::Vector<BlockSpec, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12285 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12286 {
12287 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12288 }
12289 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12290 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12291 }
12292 }
12293
12294 next_offset += envelope_size;
12295 _next_ordinal_to_read += 1;
12296 if next_offset >= end_offset {
12297 return Ok(());
12298 }
12299
12300 while _next_ordinal_to_read < 10 {
12302 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12303 _next_ordinal_to_read += 1;
12304 next_offset += envelope_size;
12305 }
12306
12307 let next_out_of_line = decoder.next_out_of_line();
12308 let handles_before = decoder.remaining_handles();
12309 if let Some((inlined, num_bytes, num_handles)) =
12310 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12311 {
12312 let member_inline_size = <fidl::encoding::Vector<NetSpec, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12313 if inlined != (member_inline_size <= 4) {
12314 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12315 }
12316 let inner_offset;
12317 let mut inner_depth = depth.clone();
12318 if inlined {
12319 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12320 inner_offset = next_offset;
12321 } else {
12322 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12323 inner_depth.increment()?;
12324 }
12325 let val_ref =
12326 self.net_devices.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NetSpec, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
12327 fidl::decode!(fidl::encoding::Vector<NetSpec, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12328 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12329 {
12330 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12331 }
12332 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12333 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12334 }
12335 }
12336
12337 next_offset += envelope_size;
12338 _next_ordinal_to_read += 1;
12339 if next_offset >= end_offset {
12340 return Ok(());
12341 }
12342
12343 while _next_ordinal_to_read < 11 {
12345 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12346 _next_ordinal_to_read += 1;
12347 next_offset += envelope_size;
12348 }
12349
12350 let next_out_of_line = decoder.next_out_of_line();
12351 let handles_before = decoder.remaining_handles();
12352 if let Some((inlined, num_bytes, num_handles)) =
12353 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12354 {
12355 let member_inline_size =
12356 <WaylandDevice as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12357 if inlined != (member_inline_size <= 4) {
12358 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12359 }
12360 let inner_offset;
12361 let mut inner_depth = depth.clone();
12362 if inlined {
12363 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12364 inner_offset = next_offset;
12365 } else {
12366 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12367 inner_depth.increment()?;
12368 }
12369 let val_ref = self.wayland_device.get_or_insert_with(|| {
12370 fidl::new_empty!(WaylandDevice, fidl::encoding::DefaultFuchsiaResourceDialect)
12371 });
12372 fidl::decode!(
12373 WaylandDevice,
12374 fidl::encoding::DefaultFuchsiaResourceDialect,
12375 val_ref,
12376 decoder,
12377 inner_offset,
12378 inner_depth
12379 )?;
12380 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12381 {
12382 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12383 }
12384 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12385 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12386 }
12387 }
12388
12389 next_offset += envelope_size;
12390 _next_ordinal_to_read += 1;
12391 if next_offset >= end_offset {
12392 return Ok(());
12393 }
12394
12395 while _next_ordinal_to_read < 12 {
12397 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12398 _next_ordinal_to_read += 1;
12399 next_offset += envelope_size;
12400 }
12401
12402 let next_out_of_line = decoder.next_out_of_line();
12403 let handles_before = decoder.remaining_handles();
12404 if let Some((inlined, num_bytes, num_handles)) =
12405 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12406 {
12407 let member_inline_size =
12408 <MagmaDevice as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12409 if inlined != (member_inline_size <= 4) {
12410 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12411 }
12412 let inner_offset;
12413 let mut inner_depth = depth.clone();
12414 if inlined {
12415 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12416 inner_offset = next_offset;
12417 } else {
12418 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12419 inner_depth.increment()?;
12420 }
12421 let val_ref = self.magma_device.get_or_insert_with(|| {
12422 fidl::new_empty!(MagmaDevice, fidl::encoding::DefaultFuchsiaResourceDialect)
12423 });
12424 fidl::decode!(
12425 MagmaDevice,
12426 fidl::encoding::DefaultFuchsiaResourceDialect,
12427 val_ref,
12428 decoder,
12429 inner_offset,
12430 inner_depth
12431 )?;
12432 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12433 {
12434 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12435 }
12436 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12437 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12438 }
12439 }
12440
12441 next_offset += envelope_size;
12442 _next_ordinal_to_read += 1;
12443 if next_offset >= end_offset {
12444 return Ok(());
12445 }
12446
12447 while _next_ordinal_to_read < 13 {
12449 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12450 _next_ordinal_to_read += 1;
12451 next_offset += envelope_size;
12452 }
12453
12454 let next_out_of_line = decoder.next_out_of_line();
12455 let handles_before = decoder.remaining_handles();
12456 if let Some((inlined, num_bytes, num_handles)) =
12457 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12458 {
12459 let member_inline_size =
12460 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12461 if inlined != (member_inline_size <= 4) {
12462 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12463 }
12464 let inner_offset;
12465 let mut inner_depth = depth.clone();
12466 if inlined {
12467 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12468 inner_offset = next_offset;
12469 } else {
12470 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12471 inner_depth.increment()?;
12472 }
12473 let val_ref = self.default_net.get_or_insert_with(|| {
12474 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12475 });
12476 fidl::decode!(
12477 bool,
12478 fidl::encoding::DefaultFuchsiaResourceDialect,
12479 val_ref,
12480 decoder,
12481 inner_offset,
12482 inner_depth
12483 )?;
12484 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12485 {
12486 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12487 }
12488 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12489 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12490 }
12491 }
12492
12493 next_offset += envelope_size;
12494 _next_ordinal_to_read += 1;
12495 if next_offset >= end_offset {
12496 return Ok(());
12497 }
12498
12499 while _next_ordinal_to_read < 14 {
12501 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12502 _next_ordinal_to_read += 1;
12503 next_offset += envelope_size;
12504 }
12505
12506 let next_out_of_line = decoder.next_out_of_line();
12507 let handles_before = decoder.remaining_handles();
12508 if let Some((inlined, num_bytes, num_handles)) =
12509 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12510 {
12511 let member_inline_size =
12512 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12513 if inlined != (member_inline_size <= 4) {
12514 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12515 }
12516 let inner_offset;
12517 let mut inner_depth = depth.clone();
12518 if inlined {
12519 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12520 inner_offset = next_offset;
12521 } else {
12522 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12523 inner_depth.increment()?;
12524 }
12525 let val_ref = self.virtio_balloon.get_or_insert_with(|| {
12526 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12527 });
12528 fidl::decode!(
12529 bool,
12530 fidl::encoding::DefaultFuchsiaResourceDialect,
12531 val_ref,
12532 decoder,
12533 inner_offset,
12534 inner_depth
12535 )?;
12536 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12537 {
12538 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12539 }
12540 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12541 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12542 }
12543 }
12544
12545 next_offset += envelope_size;
12546 _next_ordinal_to_read += 1;
12547 if next_offset >= end_offset {
12548 return Ok(());
12549 }
12550
12551 while _next_ordinal_to_read < 15 {
12553 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12554 _next_ordinal_to_read += 1;
12555 next_offset += envelope_size;
12556 }
12557
12558 let next_out_of_line = decoder.next_out_of_line();
12559 let handles_before = decoder.remaining_handles();
12560 if let Some((inlined, num_bytes, num_handles)) =
12561 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12562 {
12563 let member_inline_size =
12564 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12565 if inlined != (member_inline_size <= 4) {
12566 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12567 }
12568 let inner_offset;
12569 let mut inner_depth = depth.clone();
12570 if inlined {
12571 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12572 inner_offset = next_offset;
12573 } else {
12574 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12575 inner_depth.increment()?;
12576 }
12577 let val_ref = self.virtio_console.get_or_insert_with(|| {
12578 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12579 });
12580 fidl::decode!(
12581 bool,
12582 fidl::encoding::DefaultFuchsiaResourceDialect,
12583 val_ref,
12584 decoder,
12585 inner_offset,
12586 inner_depth
12587 )?;
12588 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12589 {
12590 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12591 }
12592 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12593 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12594 }
12595 }
12596
12597 next_offset += envelope_size;
12598 _next_ordinal_to_read += 1;
12599 if next_offset >= end_offset {
12600 return Ok(());
12601 }
12602
12603 while _next_ordinal_to_read < 16 {
12605 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12606 _next_ordinal_to_read += 1;
12607 next_offset += envelope_size;
12608 }
12609
12610 let next_out_of_line = decoder.next_out_of_line();
12611 let handles_before = decoder.remaining_handles();
12612 if let Some((inlined, num_bytes, num_handles)) =
12613 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12614 {
12615 let member_inline_size =
12616 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12617 if inlined != (member_inline_size <= 4) {
12618 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12619 }
12620 let inner_offset;
12621 let mut inner_depth = depth.clone();
12622 if inlined {
12623 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12624 inner_offset = next_offset;
12625 } else {
12626 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12627 inner_depth.increment()?;
12628 }
12629 let val_ref = self.virtio_gpu.get_or_insert_with(|| {
12630 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12631 });
12632 fidl::decode!(
12633 bool,
12634 fidl::encoding::DefaultFuchsiaResourceDialect,
12635 val_ref,
12636 decoder,
12637 inner_offset,
12638 inner_depth
12639 )?;
12640 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12641 {
12642 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12643 }
12644 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12645 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12646 }
12647 }
12648
12649 next_offset += envelope_size;
12650 _next_ordinal_to_read += 1;
12651 if next_offset >= end_offset {
12652 return Ok(());
12653 }
12654
12655 while _next_ordinal_to_read < 17 {
12657 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12658 _next_ordinal_to_read += 1;
12659 next_offset += envelope_size;
12660 }
12661
12662 let next_out_of_line = decoder.next_out_of_line();
12663 let handles_before = decoder.remaining_handles();
12664 if let Some((inlined, num_bytes, num_handles)) =
12665 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12666 {
12667 let member_inline_size =
12668 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12669 if inlined != (member_inline_size <= 4) {
12670 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12671 }
12672 let inner_offset;
12673 let mut inner_depth = depth.clone();
12674 if inlined {
12675 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12676 inner_offset = next_offset;
12677 } else {
12678 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12679 inner_depth.increment()?;
12680 }
12681 let val_ref = self.virtio_rng.get_or_insert_with(|| {
12682 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12683 });
12684 fidl::decode!(
12685 bool,
12686 fidl::encoding::DefaultFuchsiaResourceDialect,
12687 val_ref,
12688 decoder,
12689 inner_offset,
12690 inner_depth
12691 )?;
12692 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12693 {
12694 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12695 }
12696 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12697 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12698 }
12699 }
12700
12701 next_offset += envelope_size;
12702 _next_ordinal_to_read += 1;
12703 if next_offset >= end_offset {
12704 return Ok(());
12705 }
12706
12707 while _next_ordinal_to_read < 18 {
12709 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12710 _next_ordinal_to_read += 1;
12711 next_offset += envelope_size;
12712 }
12713
12714 let next_out_of_line = decoder.next_out_of_line();
12715 let handles_before = decoder.remaining_handles();
12716 if let Some((inlined, num_bytes, num_handles)) =
12717 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12718 {
12719 let member_inline_size =
12720 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12721 if inlined != (member_inline_size <= 4) {
12722 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12723 }
12724 let inner_offset;
12725 let mut inner_depth = depth.clone();
12726 if inlined {
12727 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12728 inner_offset = next_offset;
12729 } else {
12730 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12731 inner_depth.increment()?;
12732 }
12733 let val_ref = self.virtio_vsock.get_or_insert_with(|| {
12734 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12735 });
12736 fidl::decode!(
12737 bool,
12738 fidl::encoding::DefaultFuchsiaResourceDialect,
12739 val_ref,
12740 decoder,
12741 inner_offset,
12742 inner_depth
12743 )?;
12744 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12745 {
12746 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12747 }
12748 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12749 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12750 }
12751 }
12752
12753 next_offset += envelope_size;
12754 _next_ordinal_to_read += 1;
12755 if next_offset >= end_offset {
12756 return Ok(());
12757 }
12758
12759 while _next_ordinal_to_read < 19 {
12761 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12762 _next_ordinal_to_read += 1;
12763 next_offset += envelope_size;
12764 }
12765
12766 let next_out_of_line = decoder.next_out_of_line();
12767 let handles_before = decoder.remaining_handles();
12768 if let Some((inlined, num_bytes, num_handles)) =
12769 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12770 {
12771 let member_inline_size =
12772 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12773 if inlined != (member_inline_size <= 4) {
12774 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12775 }
12776 let inner_offset;
12777 let mut inner_depth = depth.clone();
12778 if inlined {
12779 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12780 inner_offset = next_offset;
12781 } else {
12782 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12783 inner_depth.increment()?;
12784 }
12785 let val_ref = self.virtio_sound.get_or_insert_with(|| {
12786 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12787 });
12788 fidl::decode!(
12789 bool,
12790 fidl::encoding::DefaultFuchsiaResourceDialect,
12791 val_ref,
12792 decoder,
12793 inner_offset,
12794 inner_depth
12795 )?;
12796 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12797 {
12798 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12799 }
12800 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12801 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12802 }
12803 }
12804
12805 next_offset += envelope_size;
12806 _next_ordinal_to_read += 1;
12807 if next_offset >= end_offset {
12808 return Ok(());
12809 }
12810
12811 while _next_ordinal_to_read < 20 {
12813 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12814 _next_ordinal_to_read += 1;
12815 next_offset += envelope_size;
12816 }
12817
12818 let next_out_of_line = decoder.next_out_of_line();
12819 let handles_before = decoder.remaining_handles();
12820 if let Some((inlined, num_bytes, num_handles)) =
12821 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12822 {
12823 let member_inline_size =
12824 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12825 if inlined != (member_inline_size <= 4) {
12826 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12827 }
12828 let inner_offset;
12829 let mut inner_depth = depth.clone();
12830 if inlined {
12831 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12832 inner_offset = next_offset;
12833 } else {
12834 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12835 inner_depth.increment()?;
12836 }
12837 let val_ref = self.virtio_sound_input.get_or_insert_with(|| {
12838 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12839 });
12840 fidl::decode!(
12841 bool,
12842 fidl::encoding::DefaultFuchsiaResourceDialect,
12843 val_ref,
12844 decoder,
12845 inner_offset,
12846 inner_depth
12847 )?;
12848 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12849 {
12850 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12851 }
12852 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12853 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12854 }
12855 }
12856
12857 next_offset += envelope_size;
12858 _next_ordinal_to_read += 1;
12859 if next_offset >= end_offset {
12860 return Ok(());
12861 }
12862
12863 while _next_ordinal_to_read < 21 {
12865 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12866 _next_ordinal_to_read += 1;
12867 next_offset += envelope_size;
12868 }
12869
12870 let next_out_of_line = decoder.next_out_of_line();
12871 let handles_before = decoder.remaining_handles();
12872 if let Some((inlined, num_bytes, num_handles)) =
12873 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12874 {
12875 let member_inline_size = <fidl::encoding::UnboundedVector<Listener> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12876 if inlined != (member_inline_size <= 4) {
12877 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12878 }
12879 let inner_offset;
12880 let mut inner_depth = depth.clone();
12881 if inlined {
12882 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12883 inner_offset = next_offset;
12884 } else {
12885 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12886 inner_depth.increment()?;
12887 }
12888 let val_ref = self.vsock_listeners.get_or_insert_with(|| {
12889 fidl::new_empty!(
12890 fidl::encoding::UnboundedVector<Listener>,
12891 fidl::encoding::DefaultFuchsiaResourceDialect
12892 )
12893 });
12894 fidl::decode!(
12895 fidl::encoding::UnboundedVector<Listener>,
12896 fidl::encoding::DefaultFuchsiaResourceDialect,
12897 val_ref,
12898 decoder,
12899 inner_offset,
12900 inner_depth
12901 )?;
12902 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12903 {
12904 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12905 }
12906 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12907 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12908 }
12909 }
12910
12911 next_offset += envelope_size;
12912 _next_ordinal_to_read += 1;
12913 if next_offset >= end_offset {
12914 return Ok(());
12915 }
12916
12917 while _next_ordinal_to_read < 22 {
12919 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12920 _next_ordinal_to_read += 1;
12921 next_offset += envelope_size;
12922 }
12923
12924 let next_out_of_line = decoder.next_out_of_line();
12925 let handles_before = decoder.remaining_handles();
12926 if let Some((inlined, num_bytes, num_handles)) =
12927 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12928 {
12929 let member_inline_size =
12930 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12931 if inlined != (member_inline_size <= 4) {
12932 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12933 }
12934 let inner_offset;
12935 let mut inner_depth = depth.clone();
12936 if inlined {
12937 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12938 inner_offset = next_offset;
12939 } else {
12940 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12941 inner_depth.increment()?;
12942 }
12943 let val_ref = self.virtio_mem.get_or_insert_with(|| {
12944 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
12945 });
12946 fidl::decode!(
12947 bool,
12948 fidl::encoding::DefaultFuchsiaResourceDialect,
12949 val_ref,
12950 decoder,
12951 inner_offset,
12952 inner_depth
12953 )?;
12954 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12955 {
12956 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12957 }
12958 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12959 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12960 }
12961 }
12962
12963 next_offset += envelope_size;
12964 _next_ordinal_to_read += 1;
12965 if next_offset >= end_offset {
12966 return Ok(());
12967 }
12968
12969 while _next_ordinal_to_read < 23 {
12971 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12972 _next_ordinal_to_read += 1;
12973 next_offset += envelope_size;
12974 }
12975
12976 let next_out_of_line = decoder.next_out_of_line();
12977 let handles_before = decoder.remaining_handles();
12978 if let Some((inlined, num_bytes, num_handles)) =
12979 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12980 {
12981 let member_inline_size =
12982 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12983 if inlined != (member_inline_size <= 4) {
12984 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12985 }
12986 let inner_offset;
12987 let mut inner_depth = depth.clone();
12988 if inlined {
12989 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12990 inner_offset = next_offset;
12991 } else {
12992 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12993 inner_depth.increment()?;
12994 }
12995 let val_ref = self.virtio_mem_block_size.get_or_insert_with(|| {
12996 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
12997 });
12998 fidl::decode!(
12999 u64,
13000 fidl::encoding::DefaultFuchsiaResourceDialect,
13001 val_ref,
13002 decoder,
13003 inner_offset,
13004 inner_depth
13005 )?;
13006 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13007 {
13008 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13009 }
13010 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13011 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13012 }
13013 }
13014
13015 next_offset += envelope_size;
13016 _next_ordinal_to_read += 1;
13017 if next_offset >= end_offset {
13018 return Ok(());
13019 }
13020
13021 while _next_ordinal_to_read < 24 {
13023 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13024 _next_ordinal_to_read += 1;
13025 next_offset += envelope_size;
13026 }
13027
13028 let next_out_of_line = decoder.next_out_of_line();
13029 let handles_before = decoder.remaining_handles();
13030 if let Some((inlined, num_bytes, num_handles)) =
13031 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13032 {
13033 let member_inline_size =
13034 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13035 if inlined != (member_inline_size <= 4) {
13036 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13037 }
13038 let inner_offset;
13039 let mut inner_depth = depth.clone();
13040 if inlined {
13041 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13042 inner_offset = next_offset;
13043 } else {
13044 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13045 inner_depth.increment()?;
13046 }
13047 let val_ref = self.virtio_mem_region_size.get_or_insert_with(|| {
13048 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
13049 });
13050 fidl::decode!(
13051 u64,
13052 fidl::encoding::DefaultFuchsiaResourceDialect,
13053 val_ref,
13054 decoder,
13055 inner_offset,
13056 inner_depth
13057 )?;
13058 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13059 {
13060 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13061 }
13062 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13063 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13064 }
13065 }
13066
13067 next_offset += envelope_size;
13068 _next_ordinal_to_read += 1;
13069 if next_offset >= end_offset {
13070 return Ok(());
13071 }
13072
13073 while _next_ordinal_to_read < 25 {
13075 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13076 _next_ordinal_to_read += 1;
13077 next_offset += envelope_size;
13078 }
13079
13080 let next_out_of_line = decoder.next_out_of_line();
13081 let handles_before = decoder.remaining_handles();
13082 if let Some((inlined, num_bytes, num_handles)) =
13083 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13084 {
13085 let member_inline_size =
13086 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13087 if inlined != (member_inline_size <= 4) {
13088 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13089 }
13090 let inner_offset;
13091 let mut inner_depth = depth.clone();
13092 if inlined {
13093 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13094 inner_offset = next_offset;
13095 } else {
13096 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13097 inner_depth.increment()?;
13098 }
13099 let val_ref = self.virtio_mem_region_alignment.get_or_insert_with(|| {
13100 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
13101 });
13102 fidl::decode!(
13103 u64,
13104 fidl::encoding::DefaultFuchsiaResourceDialect,
13105 val_ref,
13106 decoder,
13107 inner_offset,
13108 inner_depth
13109 )?;
13110 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13111 {
13112 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13113 }
13114 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13115 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13116 }
13117 }
13118
13119 next_offset += envelope_size;
13120
13121 while next_offset < end_offset {
13123 _next_ordinal_to_read += 1;
13124 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13125 next_offset += envelope_size;
13126 }
13127
13128 Ok(())
13129 }
13130 }
13131
13132 impl fidl::encoding::ResourceTypeMarker for BlockFormat {
13133 type Borrowed<'a> = &'a mut Self;
13134 fn take_or_borrow<'a>(
13135 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13136 ) -> Self::Borrowed<'a> {
13137 value
13138 }
13139 }
13140
13141 unsafe impl fidl::encoding::TypeMarker for BlockFormat {
13142 type Owned = Self;
13143
13144 #[inline(always)]
13145 fn inline_align(_context: fidl::encoding::Context) -> usize {
13146 8
13147 }
13148
13149 #[inline(always)]
13150 fn inline_size(_context: fidl::encoding::Context) -> usize {
13151 16
13152 }
13153 }
13154
13155 unsafe impl fidl::encoding::Encode<BlockFormat, fidl::encoding::DefaultFuchsiaResourceDialect>
13156 for &mut BlockFormat
13157 {
13158 #[inline]
13159 unsafe fn encode(
13160 self,
13161 encoder: &mut fidl::encoding::Encoder<
13162 '_,
13163 fidl::encoding::DefaultFuchsiaResourceDialect,
13164 >,
13165 offset: usize,
13166 _depth: fidl::encoding::Depth,
13167 ) -> fidl::Result<()> {
13168 encoder.debug_check_bounds::<BlockFormat>(offset);
13169 encoder.write_num::<u64>(self.ordinal(), offset);
13170 match self {
13171 BlockFormat::File(ref mut val) => fidl::encoding::encode_in_envelope::<
13172 fidl::encoding::Endpoint<
13173 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
13174 >,
13175 fidl::encoding::DefaultFuchsiaResourceDialect,
13176 >(
13177 <fidl::encoding::Endpoint<
13178 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
13179 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13180 val
13181 ),
13182 encoder,
13183 offset + 8,
13184 _depth,
13185 ),
13186 BlockFormat::Qcow(ref mut val) => fidl::encoding::encode_in_envelope::<
13187 fidl::encoding::HandleType<
13188 fidl::Channel,
13189 { fidl::ObjectType::CHANNEL.into_raw() },
13190 2147483648,
13191 >,
13192 fidl::encoding::DefaultFuchsiaResourceDialect,
13193 >(
13194 <fidl::encoding::HandleType<
13195 fidl::Channel,
13196 { fidl::ObjectType::CHANNEL.into_raw() },
13197 2147483648,
13198 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13199 val
13200 ),
13201 encoder,
13202 offset + 8,
13203 _depth,
13204 ),
13205 BlockFormat::Block(ref mut val) => fidl::encoding::encode_in_envelope::<
13206 fidl::encoding::Endpoint<
13207 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
13208 >,
13209 fidl::encoding::DefaultFuchsiaResourceDialect,
13210 >(
13211 <fidl::encoding::Endpoint<
13212 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
13213 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13214 val
13215 ),
13216 encoder,
13217 offset + 8,
13218 _depth,
13219 ),
13220 }
13221 }
13222 }
13223
13224 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for BlockFormat {
13225 #[inline(always)]
13226 fn new_empty() -> Self {
13227 Self::File(fidl::new_empty!(
13228 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
13229 fidl::encoding::DefaultFuchsiaResourceDialect
13230 ))
13231 }
13232
13233 #[inline]
13234 unsafe fn decode(
13235 &mut self,
13236 decoder: &mut fidl::encoding::Decoder<
13237 '_,
13238 fidl::encoding::DefaultFuchsiaResourceDialect,
13239 >,
13240 offset: usize,
13241 mut depth: fidl::encoding::Depth,
13242 ) -> fidl::Result<()> {
13243 decoder.debug_check_bounds::<Self>(offset);
13244 #[allow(unused_variables)]
13245 let next_out_of_line = decoder.next_out_of_line();
13246 let handles_before = decoder.remaining_handles();
13247 let (ordinal, inlined, num_bytes, num_handles) =
13248 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13249
13250 let member_inline_size = match ordinal {
13251 1 => <fidl::encoding::Endpoint<
13252 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
13253 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13254 2 => <fidl::encoding::HandleType<
13255 fidl::Channel,
13256 { fidl::ObjectType::CHANNEL.into_raw() },
13257 2147483648,
13258 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13259 3 => <fidl::encoding::Endpoint<
13260 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
13261 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13262 _ => return Err(fidl::Error::UnknownUnionTag),
13263 };
13264
13265 if inlined != (member_inline_size <= 4) {
13266 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13267 }
13268 let _inner_offset;
13269 if inlined {
13270 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13271 _inner_offset = offset + 8;
13272 } else {
13273 depth.increment()?;
13274 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13275 }
13276 match ordinal {
13277 1 => {
13278 #[allow(irrefutable_let_patterns)]
13279 if let BlockFormat::File(_) = self {
13280 } else {
13282 *self = BlockFormat::File(fidl::new_empty!(
13284 fidl::encoding::Endpoint<
13285 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
13286 >,
13287 fidl::encoding::DefaultFuchsiaResourceDialect
13288 ));
13289 }
13290 #[allow(irrefutable_let_patterns)]
13291 if let BlockFormat::File(ref mut val) = self {
13292 fidl::decode!(
13293 fidl::encoding::Endpoint<
13294 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
13295 >,
13296 fidl::encoding::DefaultFuchsiaResourceDialect,
13297 val,
13298 decoder,
13299 _inner_offset,
13300 depth
13301 )?;
13302 } else {
13303 unreachable!()
13304 }
13305 }
13306 2 => {
13307 #[allow(irrefutable_let_patterns)]
13308 if let BlockFormat::Qcow(_) = self {
13309 } else {
13311 *self = BlockFormat::Qcow(
13313 fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13314 );
13315 }
13316 #[allow(irrefutable_let_patterns)]
13317 if let BlockFormat::Qcow(ref mut val) = self {
13318 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
13319 } else {
13320 unreachable!()
13321 }
13322 }
13323 3 => {
13324 #[allow(irrefutable_let_patterns)]
13325 if let BlockFormat::Block(_) = self {
13326 } else {
13328 *self = BlockFormat::Block(fidl::new_empty!(
13330 fidl::encoding::Endpoint<
13331 fidl::endpoints::ClientEnd<
13332 fidl_fuchsia_hardware_block::BlockMarker,
13333 >,
13334 >,
13335 fidl::encoding::DefaultFuchsiaResourceDialect
13336 ));
13337 }
13338 #[allow(irrefutable_let_patterns)]
13339 if let BlockFormat::Block(ref mut val) = self {
13340 fidl::decode!(
13341 fidl::encoding::Endpoint<
13342 fidl::endpoints::ClientEnd<
13343 fidl_fuchsia_hardware_block::BlockMarker,
13344 >,
13345 >,
13346 fidl::encoding::DefaultFuchsiaResourceDialect,
13347 val,
13348 decoder,
13349 _inner_offset,
13350 depth
13351 )?;
13352 } else {
13353 unreachable!()
13354 }
13355 }
13356 ordinal => panic!("unexpected ordinal {:?}", ordinal),
13357 }
13358 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13359 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13360 }
13361 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13362 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13363 }
13364 Ok(())
13365 }
13366 }
13367}