1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fdomain_client::fidl::{ControlHandle as _, FDomainFlexibleIntoResult as _, Responder as _};
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9pub use fidl_fuchsia_component__common::*;
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13#[derive(Debug, PartialEq)]
14pub struct ControllerStartRequest {
15 pub args: StartChildArgs,
16 pub execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
17}
18
19impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ControllerStartRequest {}
20
21#[derive(Debug, PartialEq)]
22pub struct ControllerGetExposedDictionaryResponse {
23 pub dictionary: fdomain_fuchsia_component_sandbox::DictionaryRef,
24}
25
26impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
27 for ControllerGetExposedDictionaryResponse
28{
29}
30
31#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
32pub struct ControllerIsStartedResponse {
33 pub is_started: bool,
34}
35
36impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
37 for ControllerIsStartedResponse
38{
39}
40
41#[derive(Debug, PartialEq)]
42pub struct EventStreamGetNextResponse {
43 pub events: Vec<Event>,
44}
45
46impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for EventStreamGetNextResponse {}
47
48#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
49pub struct IntrospectorGetMonikerRequest {
50 pub component_instance: fdomain_client::Event,
51}
52
53impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
54 for IntrospectorGetMonikerRequest
55{
56}
57
58#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
59pub struct NamespaceCreateRequest {
60 pub entries: Vec<NamespaceInputEntry>,
61}
62
63impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceCreateRequest {}
64
65#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
66pub struct NamespaceInputEntry {
67 pub path: String,
68 pub dictionary:
69 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_component_sandbox::DictionaryMarker>,
70}
71
72impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceInputEntry {}
73
74#[derive(Debug, PartialEq)]
75pub struct NamespaceCreateResponse {
76 pub entries: Vec<NamespaceEntry>,
77}
78
79impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceCreateResponse {}
80
81#[derive(Debug, PartialEq)]
82pub struct RealmCreateChildRequest {
83 pub collection: fdomain_fuchsia_component_decl::CollectionRef,
84 pub decl: fdomain_fuchsia_component_decl::Child,
85 pub args: CreateChildArgs,
86}
87
88impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmCreateChildRequest {}
89
90#[derive(Debug, PartialEq)]
91pub struct RealmGetChildOutputDictionaryRequest {
92 pub child: fdomain_fuchsia_component_decl::ChildRef,
93}
94
95impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
96 for RealmGetChildOutputDictionaryRequest
97{
98}
99
100#[derive(Debug, PartialEq)]
101pub struct RealmListChildrenRequest {
102 pub collection: fdomain_fuchsia_component_decl::CollectionRef,
103 pub iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
104}
105
106impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmListChildrenRequest {}
107
108#[derive(Debug, PartialEq)]
109pub struct RealmOpenControllerRequest {
110 pub child: fdomain_fuchsia_component_decl::ChildRef,
111 pub controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
112}
113
114impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmOpenControllerRequest {}
115
116#[derive(Debug, PartialEq)]
117pub struct RealmOpenExposedDirRequest {
118 pub child: fdomain_fuchsia_component_decl::ChildRef,
119 pub exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
120}
121
122impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmOpenExposedDirRequest {}
123
124#[derive(Debug, PartialEq)]
125pub struct RealmGetChildOutputDictionaryResponse {
126 pub dictionary: fdomain_fuchsia_component_sandbox::DictionaryRef,
127}
128
129impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
130 for RealmGetChildOutputDictionaryResponse
131{
132}
133
134#[derive(Debug, PartialEq)]
135pub struct RealmGetResolvedInfoResponse {
136 pub resolved_info: fdomain_fuchsia_component_resolution::Component,
137}
138
139impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
140 for RealmGetResolvedInfoResponse
141{
142}
143
144#[derive(Debug, Default, PartialEq)]
146pub struct CapabilityRequestedPayload {
147 pub name: Option<String>,
149 pub capability: Option<fdomain_client::Channel>,
152 #[doc(hidden)]
153 pub __source_breaking: fidl::marker::SourceBreaking,
154}
155
156impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CapabilityRequestedPayload {}
157
158#[derive(Debug, Default, PartialEq)]
159pub struct CreateChildArgs {
160 pub numbered_handles: Option<Vec<fdomain_fuchsia_process::HandleInfo>>,
165 pub dynamic_offers: Option<Vec<fdomain_fuchsia_component_decl::Offer>>,
189 pub controller: Option<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
192 pub dictionary: Option<fdomain_fuchsia_component_sandbox::DictionaryRef>,
194 #[doc(hidden)]
195 pub __source_breaking: fidl::marker::SourceBreaking,
196}
197
198impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CreateChildArgs {}
199
200#[derive(Debug, Default, PartialEq)]
202pub struct DebugStartedPayload {
203 pub runtime_dir: Option<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>,
208 pub break_on_start: Option<fdomain_client::EventPair>,
213 #[doc(hidden)]
214 pub __source_breaking: fidl::marker::SourceBreaking,
215}
216
217impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DebugStartedPayload {}
218
219#[derive(Debug, Default, PartialEq)]
221pub struct Event {
222 pub header: Option<EventHeader>,
224 pub payload: Option<EventPayload>,
226 #[doc(hidden)]
227 pub __source_breaking: fidl::marker::SourceBreaking,
228}
229
230impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Event {}
231
232#[derive(Debug, Default, PartialEq)]
236pub struct NamespaceEntry {
237 pub path: Option<String>,
240 pub directory: Option<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>,
242 #[doc(hidden)]
243 pub __source_breaking: fidl::marker::SourceBreaking,
244}
245
246impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceEntry {}
247
248#[derive(Debug, Default, PartialEq)]
249pub struct StartChildArgs {
250 pub numbered_handles: Option<Vec<fdomain_fuchsia_process::HandleInfo>>,
258 pub namespace_entries: Option<Vec<NamespaceEntry>>,
265 pub dictionary: Option<fdomain_fuchsia_component_sandbox::DictionaryRef>,
267 #[doc(hidden)]
268 pub __source_breaking: fidl::marker::SourceBreaking,
269}
270
271impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for StartChildArgs {}
272
273#[derive(Debug)]
275pub enum EventPayload {
276 CapabilityRequested(CapabilityRequestedPayload),
278 Purged(PurgedPayload),
280 Discovered(DiscoveredPayload),
282 Destroyed(DestroyedPayload),
284 Resolved(ResolvedPayload),
286 Started(StartedPayload),
288 Stopped(StoppedPayload),
290 DebugStarted(DebugStartedPayload),
292 Unresolved(UnresolvedPayload),
294 #[doc(hidden)]
295 __SourceBreaking { unknown_ordinal: u64 },
296}
297
298#[macro_export]
300macro_rules! EventPayloadUnknown {
301 () => {
302 _
303 };
304}
305
306impl PartialEq for EventPayload {
308 fn eq(&self, other: &Self) -> bool {
309 match (self, other) {
310 (Self::CapabilityRequested(x), Self::CapabilityRequested(y)) => *x == *y,
311 (Self::Purged(x), Self::Purged(y)) => *x == *y,
312 (Self::Discovered(x), Self::Discovered(y)) => *x == *y,
313 (Self::Destroyed(x), Self::Destroyed(y)) => *x == *y,
314 (Self::Resolved(x), Self::Resolved(y)) => *x == *y,
315 (Self::Started(x), Self::Started(y)) => *x == *y,
316 (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
317 (Self::DebugStarted(x), Self::DebugStarted(y)) => *x == *y,
318 (Self::Unresolved(x), Self::Unresolved(y)) => *x == *y,
319 _ => false,
320 }
321 }
322}
323
324impl EventPayload {
325 #[inline]
326 pub fn ordinal(&self) -> u64 {
327 match *self {
328 Self::CapabilityRequested(_) => 1,
329 Self::Purged(_) => 2,
330 Self::Discovered(_) => 4,
331 Self::Destroyed(_) => 5,
332 Self::Resolved(_) => 6,
333 Self::Started(_) => 7,
334 Self::Stopped(_) => 8,
335 Self::DebugStarted(_) => 9,
336 Self::Unresolved(_) => 10,
337 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
338 }
339 }
340
341 #[inline]
342 pub fn unknown_variant_for_testing() -> Self {
343 Self::__SourceBreaking { unknown_ordinal: 0 }
344 }
345
346 #[inline]
347 pub fn is_unknown(&self) -> bool {
348 match self {
349 Self::__SourceBreaking { .. } => true,
350 _ => false,
351 }
352 }
353}
354
355impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for EventPayload {}
356
357#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
358pub struct BinderMarker;
359
360impl fdomain_client::fidl::ProtocolMarker for BinderMarker {
361 type Proxy = BinderProxy;
362 type RequestStream = BinderRequestStream;
363
364 const DEBUG_NAME: &'static str = "fuchsia.component.Binder";
365}
366impl fdomain_client::fidl::DiscoverableProtocolMarker for BinderMarker {}
367
368pub trait BinderProxyInterface: Send + Sync {}
369
370#[derive(Debug, Clone)]
371pub struct BinderProxy {
372 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
373}
374
375impl fdomain_client::fidl::Proxy for BinderProxy {
376 type Protocol = BinderMarker;
377
378 fn from_channel(inner: fdomain_client::Channel) -> Self {
379 Self::new(inner)
380 }
381
382 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
383 self.client.into_channel().map_err(|client| Self { client })
384 }
385
386 fn as_channel(&self) -> &fdomain_client::Channel {
387 self.client.as_channel()
388 }
389}
390
391impl BinderProxy {
392 pub fn new(channel: fdomain_client::Channel) -> Self {
394 let protocol_name = <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
395 Self { client: fidl::client::Client::new(channel, protocol_name) }
396 }
397
398 pub fn take_event_stream(&self) -> BinderEventStream {
404 BinderEventStream { event_receiver: self.client.take_event_receiver() }
405 }
406}
407
408impl BinderProxyInterface for BinderProxy {}
409
410pub struct BinderEventStream {
411 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
412}
413
414impl std::marker::Unpin for BinderEventStream {}
415
416impl futures::stream::FusedStream for BinderEventStream {
417 fn is_terminated(&self) -> bool {
418 self.event_receiver.is_terminated()
419 }
420}
421
422impl futures::Stream for BinderEventStream {
423 type Item = Result<BinderEvent, fidl::Error>;
424
425 fn poll_next(
426 mut self: std::pin::Pin<&mut Self>,
427 cx: &mut std::task::Context<'_>,
428 ) -> std::task::Poll<Option<Self::Item>> {
429 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
430 &mut self.event_receiver,
431 cx
432 )?) {
433 Some(buf) => std::task::Poll::Ready(Some(BinderEvent::decode(buf))),
434 None => std::task::Poll::Ready(None),
435 }
436 }
437}
438
439#[derive(Debug)]
440pub enum BinderEvent {}
441
442impl BinderEvent {
443 fn decode(
445 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
446 ) -> Result<BinderEvent, fidl::Error> {
447 let (bytes, _handles) = buf.split_mut();
448 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
449 debug_assert_eq!(tx_header.tx_id, 0);
450 match tx_header.ordinal {
451 _ => Err(fidl::Error::UnknownOrdinal {
452 ordinal: tx_header.ordinal,
453 protocol_name: <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
454 }),
455 }
456 }
457}
458
459pub struct BinderRequestStream {
461 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
462 is_terminated: bool,
463}
464
465impl std::marker::Unpin for BinderRequestStream {}
466
467impl futures::stream::FusedStream for BinderRequestStream {
468 fn is_terminated(&self) -> bool {
469 self.is_terminated
470 }
471}
472
473impl fdomain_client::fidl::RequestStream for BinderRequestStream {
474 type Protocol = BinderMarker;
475 type ControlHandle = BinderControlHandle;
476
477 fn from_channel(channel: fdomain_client::Channel) -> Self {
478 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
479 }
480
481 fn control_handle(&self) -> Self::ControlHandle {
482 BinderControlHandle { inner: self.inner.clone() }
483 }
484
485 fn into_inner(
486 self,
487 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
488 {
489 (self.inner, self.is_terminated)
490 }
491
492 fn from_inner(
493 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
494 is_terminated: bool,
495 ) -> Self {
496 Self { inner, is_terminated }
497 }
498}
499
500impl futures::Stream for BinderRequestStream {
501 type Item = Result<BinderRequest, fidl::Error>;
502
503 fn poll_next(
504 mut self: std::pin::Pin<&mut Self>,
505 cx: &mut std::task::Context<'_>,
506 ) -> std::task::Poll<Option<Self::Item>> {
507 let this = &mut *self;
508 if this.inner.check_shutdown(cx) {
509 this.is_terminated = true;
510 return std::task::Poll::Ready(None);
511 }
512 if this.is_terminated {
513 panic!("polled BinderRequestStream after completion");
514 }
515 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
516 |bytes, handles| {
517 match this.inner.channel().read_etc(cx, bytes, handles) {
518 std::task::Poll::Ready(Ok(())) => {}
519 std::task::Poll::Pending => return std::task::Poll::Pending,
520 std::task::Poll::Ready(Err(None)) => {
521 this.is_terminated = true;
522 return std::task::Poll::Ready(None);
523 }
524 std::task::Poll::Ready(Err(Some(e))) => {
525 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
526 e.into(),
527 ))))
528 }
529 }
530
531 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
533
534 std::task::Poll::Ready(Some(match header.ordinal {
535 _ => Err(fidl::Error::UnknownOrdinal {
536 ordinal: header.ordinal,
537 protocol_name:
538 <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
539 }),
540 }))
541 },
542 )
543 }
544}
545
546#[derive(Debug)]
557pub enum BinderRequest {}
558
559impl BinderRequest {
560 pub fn method_name(&self) -> &'static str {
562 match *self {}
563 }
564}
565
566#[derive(Debug, Clone)]
567pub struct BinderControlHandle {
568 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
569}
570
571impl fdomain_client::fidl::ControlHandle for BinderControlHandle {
572 fn shutdown(&self) {
573 self.inner.shutdown()
574 }
575
576 fn is_closed(&self) -> bool {
577 self.inner.channel().is_closed()
578 }
579 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
580 self.inner.channel().on_closed()
581 }
582}
583
584impl BinderControlHandle {}
585
586#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
587pub struct ChildIteratorMarker;
588
589impl fdomain_client::fidl::ProtocolMarker for ChildIteratorMarker {
590 type Proxy = ChildIteratorProxy;
591 type RequestStream = ChildIteratorRequestStream;
592
593 const DEBUG_NAME: &'static str = "(anonymous) ChildIterator";
594}
595
596pub trait ChildIteratorProxyInterface: Send + Sync {
597 type NextResponseFut: std::future::Future<
598 Output = Result<Vec<fdomain_fuchsia_component_decl::ChildRef>, fidl::Error>,
599 > + Send;
600 fn r#next(&self) -> Self::NextResponseFut;
601}
602
603#[derive(Debug, Clone)]
604pub struct ChildIteratorProxy {
605 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
606}
607
608impl fdomain_client::fidl::Proxy for ChildIteratorProxy {
609 type Protocol = ChildIteratorMarker;
610
611 fn from_channel(inner: fdomain_client::Channel) -> Self {
612 Self::new(inner)
613 }
614
615 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
616 self.client.into_channel().map_err(|client| Self { client })
617 }
618
619 fn as_channel(&self) -> &fdomain_client::Channel {
620 self.client.as_channel()
621 }
622}
623
624impl ChildIteratorProxy {
625 pub fn new(channel: fdomain_client::Channel) -> Self {
627 let protocol_name =
628 <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
629 Self { client: fidl::client::Client::new(channel, protocol_name) }
630 }
631
632 pub fn take_event_stream(&self) -> ChildIteratorEventStream {
638 ChildIteratorEventStream { event_receiver: self.client.take_event_receiver() }
639 }
640
641 pub fn r#next(
646 &self,
647 ) -> fidl::client::QueryResponseFut<
648 Vec<fdomain_fuchsia_component_decl::ChildRef>,
649 fdomain_client::fidl::FDomainResourceDialect,
650 > {
651 ChildIteratorProxyInterface::r#next(self)
652 }
653}
654
655impl ChildIteratorProxyInterface for ChildIteratorProxy {
656 type NextResponseFut = fidl::client::QueryResponseFut<
657 Vec<fdomain_fuchsia_component_decl::ChildRef>,
658 fdomain_client::fidl::FDomainResourceDialect,
659 >;
660 fn r#next(&self) -> Self::NextResponseFut {
661 fn _decode(
662 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
663 ) -> Result<Vec<fdomain_fuchsia_component_decl::ChildRef>, fidl::Error> {
664 let _response = fidl::client::decode_transaction_body::<
665 ChildIteratorNextResponse,
666 fdomain_client::fidl::FDomainResourceDialect,
667 0x40e4c3882b050d08,
668 >(_buf?)?;
669 Ok(_response.children)
670 }
671 self.client.send_query_and_decode::<
672 fidl::encoding::EmptyPayload,
673 Vec<fdomain_fuchsia_component_decl::ChildRef>,
674 >(
675 (),
676 0x40e4c3882b050d08,
677 fidl::encoding::DynamicFlags::empty(),
678 _decode,
679 )
680 }
681}
682
683pub struct ChildIteratorEventStream {
684 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
685}
686
687impl std::marker::Unpin for ChildIteratorEventStream {}
688
689impl futures::stream::FusedStream for ChildIteratorEventStream {
690 fn is_terminated(&self) -> bool {
691 self.event_receiver.is_terminated()
692 }
693}
694
695impl futures::Stream for ChildIteratorEventStream {
696 type Item = Result<ChildIteratorEvent, fidl::Error>;
697
698 fn poll_next(
699 mut self: std::pin::Pin<&mut Self>,
700 cx: &mut std::task::Context<'_>,
701 ) -> std::task::Poll<Option<Self::Item>> {
702 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
703 &mut self.event_receiver,
704 cx
705 )?) {
706 Some(buf) => std::task::Poll::Ready(Some(ChildIteratorEvent::decode(buf))),
707 None => std::task::Poll::Ready(None),
708 }
709 }
710}
711
712#[derive(Debug)]
713pub enum ChildIteratorEvent {}
714
715impl ChildIteratorEvent {
716 fn decode(
718 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
719 ) -> Result<ChildIteratorEvent, fidl::Error> {
720 let (bytes, _handles) = buf.split_mut();
721 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
722 debug_assert_eq!(tx_header.tx_id, 0);
723 match tx_header.ordinal {
724 _ => Err(fidl::Error::UnknownOrdinal {
725 ordinal: tx_header.ordinal,
726 protocol_name:
727 <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
728 }),
729 }
730 }
731}
732
733pub struct ChildIteratorRequestStream {
735 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
736 is_terminated: bool,
737}
738
739impl std::marker::Unpin for ChildIteratorRequestStream {}
740
741impl futures::stream::FusedStream for ChildIteratorRequestStream {
742 fn is_terminated(&self) -> bool {
743 self.is_terminated
744 }
745}
746
747impl fdomain_client::fidl::RequestStream for ChildIteratorRequestStream {
748 type Protocol = ChildIteratorMarker;
749 type ControlHandle = ChildIteratorControlHandle;
750
751 fn from_channel(channel: fdomain_client::Channel) -> Self {
752 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
753 }
754
755 fn control_handle(&self) -> Self::ControlHandle {
756 ChildIteratorControlHandle { inner: self.inner.clone() }
757 }
758
759 fn into_inner(
760 self,
761 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
762 {
763 (self.inner, self.is_terminated)
764 }
765
766 fn from_inner(
767 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
768 is_terminated: bool,
769 ) -> Self {
770 Self { inner, is_terminated }
771 }
772}
773
774impl futures::Stream for ChildIteratorRequestStream {
775 type Item = Result<ChildIteratorRequest, fidl::Error>;
776
777 fn poll_next(
778 mut self: std::pin::Pin<&mut Self>,
779 cx: &mut std::task::Context<'_>,
780 ) -> std::task::Poll<Option<Self::Item>> {
781 let this = &mut *self;
782 if this.inner.check_shutdown(cx) {
783 this.is_terminated = true;
784 return std::task::Poll::Ready(None);
785 }
786 if this.is_terminated {
787 panic!("polled ChildIteratorRequestStream after completion");
788 }
789 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
790 |bytes, handles| {
791 match this.inner.channel().read_etc(cx, bytes, handles) {
792 std::task::Poll::Ready(Ok(())) => {}
793 std::task::Poll::Pending => return std::task::Poll::Pending,
794 std::task::Poll::Ready(Err(None)) => {
795 this.is_terminated = true;
796 return std::task::Poll::Ready(None);
797 }
798 std::task::Poll::Ready(Err(Some(e))) => {
799 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
800 e.into(),
801 ))))
802 }
803 }
804
805 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
807
808 std::task::Poll::Ready(Some(match header.ordinal {
809 0x40e4c3882b050d08 => {
810 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
811 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
812 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
813 let control_handle = ChildIteratorControlHandle {
814 inner: this.inner.clone(),
815 };
816 Ok(ChildIteratorRequest::Next {
817 responder: ChildIteratorNextResponder {
818 control_handle: std::mem::ManuallyDrop::new(control_handle),
819 tx_id: header.tx_id,
820 },
821 })
822 }
823 _ => Err(fidl::Error::UnknownOrdinal {
824 ordinal: header.ordinal,
825 protocol_name: <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
826 }),
827 }))
828 },
829 )
830 }
831}
832
833#[derive(Debug)]
835pub enum ChildIteratorRequest {
836 Next { responder: ChildIteratorNextResponder },
841}
842
843impl ChildIteratorRequest {
844 #[allow(irrefutable_let_patterns)]
845 pub fn into_next(self) -> Option<(ChildIteratorNextResponder)> {
846 if let ChildIteratorRequest::Next { responder } = self {
847 Some((responder))
848 } else {
849 None
850 }
851 }
852
853 pub fn method_name(&self) -> &'static str {
855 match *self {
856 ChildIteratorRequest::Next { .. } => "next",
857 }
858 }
859}
860
861#[derive(Debug, Clone)]
862pub struct ChildIteratorControlHandle {
863 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
864}
865
866impl fdomain_client::fidl::ControlHandle for ChildIteratorControlHandle {
867 fn shutdown(&self) {
868 self.inner.shutdown()
869 }
870
871 fn is_closed(&self) -> bool {
872 self.inner.channel().is_closed()
873 }
874 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
875 self.inner.channel().on_closed()
876 }
877}
878
879impl ChildIteratorControlHandle {}
880
881#[must_use = "FIDL methods require a response to be sent"]
882#[derive(Debug)]
883pub struct ChildIteratorNextResponder {
884 control_handle: std::mem::ManuallyDrop<ChildIteratorControlHandle>,
885 tx_id: u32,
886}
887
888impl std::ops::Drop for ChildIteratorNextResponder {
892 fn drop(&mut self) {
893 self.control_handle.shutdown();
894 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
896 }
897}
898
899impl fdomain_client::fidl::Responder for ChildIteratorNextResponder {
900 type ControlHandle = ChildIteratorControlHandle;
901
902 fn control_handle(&self) -> &ChildIteratorControlHandle {
903 &self.control_handle
904 }
905
906 fn drop_without_shutdown(mut self) {
907 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
909 std::mem::forget(self);
911 }
912}
913
914impl ChildIteratorNextResponder {
915 pub fn send(
919 self,
920 mut children: &[fdomain_fuchsia_component_decl::ChildRef],
921 ) -> Result<(), fidl::Error> {
922 let _result = self.send_raw(children);
923 if _result.is_err() {
924 self.control_handle.shutdown();
925 }
926 self.drop_without_shutdown();
927 _result
928 }
929
930 pub fn send_no_shutdown_on_err(
932 self,
933 mut children: &[fdomain_fuchsia_component_decl::ChildRef],
934 ) -> Result<(), fidl::Error> {
935 let _result = self.send_raw(children);
936 self.drop_without_shutdown();
937 _result
938 }
939
940 fn send_raw(
941 &self,
942 mut children: &[fdomain_fuchsia_component_decl::ChildRef],
943 ) -> Result<(), fidl::Error> {
944 self.control_handle.inner.send::<ChildIteratorNextResponse>(
945 (children,),
946 self.tx_id,
947 0x40e4c3882b050d08,
948 fidl::encoding::DynamicFlags::empty(),
949 )
950 }
951}
952
953#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
954pub struct ControllerMarker;
955
956impl fdomain_client::fidl::ProtocolMarker for ControllerMarker {
957 type Proxy = ControllerProxy;
958 type RequestStream = ControllerRequestStream;
959
960 const DEBUG_NAME: &'static str = "(anonymous) Controller";
961}
962pub type ControllerStartResult = Result<(), Error>;
963pub type ControllerIsStartedResult = Result<bool, Error>;
964pub type ControllerGetExposedDictionaryResult =
965 Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>;
966pub type ControllerDestroyResult = Result<(), Error>;
967
968pub trait ControllerProxyInterface: Send + Sync {
969 type StartResponseFut: std::future::Future<Output = Result<ControllerStartResult, fidl::Error>>
970 + Send;
971 fn r#start(
972 &self,
973 args: StartChildArgs,
974 execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
975 ) -> Self::StartResponseFut;
976 type IsStartedResponseFut: std::future::Future<Output = Result<ControllerIsStartedResult, fidl::Error>>
977 + Send;
978 fn r#is_started(&self) -> Self::IsStartedResponseFut;
979 type GetExposedDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetExposedDictionaryResult, fidl::Error>>
980 + Send;
981 fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut;
982 type DestroyResponseFut: std::future::Future<Output = Result<ControllerDestroyResult, fidl::Error>>
983 + Send;
984 fn r#destroy(&self) -> Self::DestroyResponseFut;
985}
986
987#[derive(Debug, Clone)]
988pub struct ControllerProxy {
989 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
990}
991
992impl fdomain_client::fidl::Proxy for ControllerProxy {
993 type Protocol = ControllerMarker;
994
995 fn from_channel(inner: fdomain_client::Channel) -> Self {
996 Self::new(inner)
997 }
998
999 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1000 self.client.into_channel().map_err(|client| Self { client })
1001 }
1002
1003 fn as_channel(&self) -> &fdomain_client::Channel {
1004 self.client.as_channel()
1005 }
1006}
1007
1008impl ControllerProxy {
1009 pub fn new(channel: fdomain_client::Channel) -> Self {
1011 let protocol_name = <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1012 Self { client: fidl::client::Client::new(channel, protocol_name) }
1013 }
1014
1015 pub fn take_event_stream(&self) -> ControllerEventStream {
1021 ControllerEventStream { event_receiver: self.client.take_event_receiver() }
1022 }
1023
1024 pub fn r#start(
1028 &self,
1029 mut args: StartChildArgs,
1030 mut execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1031 ) -> fidl::client::QueryResponseFut<
1032 ControllerStartResult,
1033 fdomain_client::fidl::FDomainResourceDialect,
1034 > {
1035 ControllerProxyInterface::r#start(self, args, execution_controller)
1036 }
1037
1038 pub fn r#is_started(
1040 &self,
1041 ) -> fidl::client::QueryResponseFut<
1042 ControllerIsStartedResult,
1043 fdomain_client::fidl::FDomainResourceDialect,
1044 > {
1045 ControllerProxyInterface::r#is_started(self)
1046 }
1047
1048 pub fn r#get_exposed_dictionary(
1050 &self,
1051 ) -> fidl::client::QueryResponseFut<
1052 ControllerGetExposedDictionaryResult,
1053 fdomain_client::fidl::FDomainResourceDialect,
1054 > {
1055 ControllerProxyInterface::r#get_exposed_dictionary(self)
1056 }
1057
1058 pub fn r#destroy(
1073 &self,
1074 ) -> fidl::client::QueryResponseFut<
1075 ControllerDestroyResult,
1076 fdomain_client::fidl::FDomainResourceDialect,
1077 > {
1078 ControllerProxyInterface::r#destroy(self)
1079 }
1080}
1081
1082impl ControllerProxyInterface for ControllerProxy {
1083 type StartResponseFut = fidl::client::QueryResponseFut<
1084 ControllerStartResult,
1085 fdomain_client::fidl::FDomainResourceDialect,
1086 >;
1087 fn r#start(
1088 &self,
1089 mut args: StartChildArgs,
1090 mut execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1091 ) -> Self::StartResponseFut {
1092 fn _decode(
1093 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1094 ) -> Result<ControllerStartResult, fidl::Error> {
1095 let _response = fidl::client::decode_transaction_body::<
1096 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1097 fdomain_client::fidl::FDomainResourceDialect,
1098 0x68878076b8d2eac5,
1099 >(_buf?)?
1100 .into_result_fdomain::<ControllerMarker>("start")?;
1101 Ok(_response.map(|x| x))
1102 }
1103 self.client.send_query_and_decode::<ControllerStartRequest, ControllerStartResult>(
1104 (&mut args, execution_controller),
1105 0x68878076b8d2eac5,
1106 fidl::encoding::DynamicFlags::FLEXIBLE,
1107 _decode,
1108 )
1109 }
1110
1111 type IsStartedResponseFut = fidl::client::QueryResponseFut<
1112 ControllerIsStartedResult,
1113 fdomain_client::fidl::FDomainResourceDialect,
1114 >;
1115 fn r#is_started(&self) -> Self::IsStartedResponseFut {
1116 fn _decode(
1117 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1118 ) -> Result<ControllerIsStartedResult, fidl::Error> {
1119 let _response = fidl::client::decode_transaction_body::<
1120 fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1121 fdomain_client::fidl::FDomainResourceDialect,
1122 0x2155e6e1db2083c3,
1123 >(_buf?)?
1124 .into_result_fdomain::<ControllerMarker>("is_started")?;
1125 Ok(_response.map(|x| x.is_started))
1126 }
1127 self.client
1128 .send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerIsStartedResult>(
1129 (),
1130 0x2155e6e1db2083c3,
1131 fidl::encoding::DynamicFlags::FLEXIBLE,
1132 _decode,
1133 )
1134 }
1135
1136 type GetExposedDictionaryResponseFut = fidl::client::QueryResponseFut<
1137 ControllerGetExposedDictionaryResult,
1138 fdomain_client::fidl::FDomainResourceDialect,
1139 >;
1140 fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut {
1141 fn _decode(
1142 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1143 ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1144 let _response = fidl::client::decode_transaction_body::<
1145 fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1146 fdomain_client::fidl::FDomainResourceDialect,
1147 0x7e48373e5eda1f9b,
1148 >(_buf?)?
1149 .into_result_fdomain::<ControllerMarker>("get_exposed_dictionary")?;
1150 Ok(_response.map(|x| x.dictionary))
1151 }
1152 self.client.send_query_and_decode::<
1153 fidl::encoding::EmptyPayload,
1154 ControllerGetExposedDictionaryResult,
1155 >(
1156 (),
1157 0x7e48373e5eda1f9b,
1158 fidl::encoding::DynamicFlags::FLEXIBLE,
1159 _decode,
1160 )
1161 }
1162
1163 type DestroyResponseFut = fidl::client::QueryResponseFut<
1164 ControllerDestroyResult,
1165 fdomain_client::fidl::FDomainResourceDialect,
1166 >;
1167 fn r#destroy(&self) -> Self::DestroyResponseFut {
1168 fn _decode(
1169 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1170 ) -> Result<ControllerDestroyResult, fidl::Error> {
1171 let _response = fidl::client::decode_transaction_body::<
1172 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1173 fdomain_client::fidl::FDomainResourceDialect,
1174 0x74529fa68b5c1741,
1175 >(_buf?)?
1176 .into_result_fdomain::<ControllerMarker>("destroy")?;
1177 Ok(_response.map(|x| x))
1178 }
1179 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerDestroyResult>(
1180 (),
1181 0x74529fa68b5c1741,
1182 fidl::encoding::DynamicFlags::FLEXIBLE,
1183 _decode,
1184 )
1185 }
1186}
1187
1188pub struct ControllerEventStream {
1189 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1190}
1191
1192impl std::marker::Unpin for ControllerEventStream {}
1193
1194impl futures::stream::FusedStream for ControllerEventStream {
1195 fn is_terminated(&self) -> bool {
1196 self.event_receiver.is_terminated()
1197 }
1198}
1199
1200impl futures::Stream for ControllerEventStream {
1201 type Item = Result<ControllerEvent, fidl::Error>;
1202
1203 fn poll_next(
1204 mut self: std::pin::Pin<&mut Self>,
1205 cx: &mut std::task::Context<'_>,
1206 ) -> std::task::Poll<Option<Self::Item>> {
1207 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1208 &mut self.event_receiver,
1209 cx
1210 )?) {
1211 Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1212 None => std::task::Poll::Ready(None),
1213 }
1214 }
1215}
1216
1217#[derive(Debug)]
1218pub enum ControllerEvent {
1219 #[non_exhaustive]
1220 _UnknownEvent {
1221 ordinal: u64,
1223 },
1224}
1225
1226impl ControllerEvent {
1227 fn decode(
1229 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1230 ) -> Result<ControllerEvent, fidl::Error> {
1231 let (bytes, _handles) = buf.split_mut();
1232 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1233 debug_assert_eq!(tx_header.tx_id, 0);
1234 match tx_header.ordinal {
1235 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1236 Ok(ControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1237 }
1238 _ => Err(fidl::Error::UnknownOrdinal {
1239 ordinal: tx_header.ordinal,
1240 protocol_name:
1241 <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1242 }),
1243 }
1244 }
1245}
1246
1247pub struct ControllerRequestStream {
1249 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1250 is_terminated: bool,
1251}
1252
1253impl std::marker::Unpin for ControllerRequestStream {}
1254
1255impl futures::stream::FusedStream for ControllerRequestStream {
1256 fn is_terminated(&self) -> bool {
1257 self.is_terminated
1258 }
1259}
1260
1261impl fdomain_client::fidl::RequestStream for ControllerRequestStream {
1262 type Protocol = ControllerMarker;
1263 type ControlHandle = ControllerControlHandle;
1264
1265 fn from_channel(channel: fdomain_client::Channel) -> Self {
1266 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1267 }
1268
1269 fn control_handle(&self) -> Self::ControlHandle {
1270 ControllerControlHandle { inner: self.inner.clone() }
1271 }
1272
1273 fn into_inner(
1274 self,
1275 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1276 {
1277 (self.inner, self.is_terminated)
1278 }
1279
1280 fn from_inner(
1281 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1282 is_terminated: bool,
1283 ) -> Self {
1284 Self { inner, is_terminated }
1285 }
1286}
1287
1288impl futures::Stream for ControllerRequestStream {
1289 type Item = Result<ControllerRequest, fidl::Error>;
1290
1291 fn poll_next(
1292 mut self: std::pin::Pin<&mut Self>,
1293 cx: &mut std::task::Context<'_>,
1294 ) -> std::task::Poll<Option<Self::Item>> {
1295 let this = &mut *self;
1296 if this.inner.check_shutdown(cx) {
1297 this.is_terminated = true;
1298 return std::task::Poll::Ready(None);
1299 }
1300 if this.is_terminated {
1301 panic!("polled ControllerRequestStream after completion");
1302 }
1303 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1304 |bytes, handles| {
1305 match this.inner.channel().read_etc(cx, bytes, handles) {
1306 std::task::Poll::Ready(Ok(())) => {}
1307 std::task::Poll::Pending => return std::task::Poll::Pending,
1308 std::task::Poll::Ready(Err(None)) => {
1309 this.is_terminated = true;
1310 return std::task::Poll::Ready(None);
1311 }
1312 std::task::Poll::Ready(Err(Some(e))) => {
1313 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1314 e.into(),
1315 ))))
1316 }
1317 }
1318
1319 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1321
1322 std::task::Poll::Ready(Some(match header.ordinal {
1323 0x68878076b8d2eac5 => {
1324 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1325 let mut req = fidl::new_empty!(
1326 ControllerStartRequest,
1327 fdomain_client::fidl::FDomainResourceDialect
1328 );
1329 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerStartRequest>(&header, _body_bytes, handles, &mut req)?;
1330 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1331 Ok(ControllerRequest::Start {
1332 args: req.args,
1333 execution_controller: req.execution_controller,
1334
1335 responder: ControllerStartResponder {
1336 control_handle: std::mem::ManuallyDrop::new(control_handle),
1337 tx_id: header.tx_id,
1338 },
1339 })
1340 }
1341 0x2155e6e1db2083c3 => {
1342 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1343 let mut req = fidl::new_empty!(
1344 fidl::encoding::EmptyPayload,
1345 fdomain_client::fidl::FDomainResourceDialect
1346 );
1347 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1348 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1349 Ok(ControllerRequest::IsStarted {
1350 responder: ControllerIsStartedResponder {
1351 control_handle: std::mem::ManuallyDrop::new(control_handle),
1352 tx_id: header.tx_id,
1353 },
1354 })
1355 }
1356 0x7e48373e5eda1f9b => {
1357 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1358 let mut req = fidl::new_empty!(
1359 fidl::encoding::EmptyPayload,
1360 fdomain_client::fidl::FDomainResourceDialect
1361 );
1362 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1363 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1364 Ok(ControllerRequest::GetExposedDictionary {
1365 responder: ControllerGetExposedDictionaryResponder {
1366 control_handle: std::mem::ManuallyDrop::new(control_handle),
1367 tx_id: header.tx_id,
1368 },
1369 })
1370 }
1371 0x74529fa68b5c1741 => {
1372 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1373 let mut req = fidl::new_empty!(
1374 fidl::encoding::EmptyPayload,
1375 fdomain_client::fidl::FDomainResourceDialect
1376 );
1377 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1378 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1379 Ok(ControllerRequest::Destroy {
1380 responder: ControllerDestroyResponder {
1381 control_handle: std::mem::ManuallyDrop::new(control_handle),
1382 tx_id: header.tx_id,
1383 },
1384 })
1385 }
1386 _ if header.tx_id == 0
1387 && header
1388 .dynamic_flags()
1389 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1390 {
1391 Ok(ControllerRequest::_UnknownMethod {
1392 ordinal: header.ordinal,
1393 control_handle: ControllerControlHandle { inner: this.inner.clone() },
1394 method_type: fidl::MethodType::OneWay,
1395 })
1396 }
1397 _ if header
1398 .dynamic_flags()
1399 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1400 {
1401 this.inner.send_framework_err(
1402 fidl::encoding::FrameworkErr::UnknownMethod,
1403 header.tx_id,
1404 header.ordinal,
1405 header.dynamic_flags(),
1406 (bytes, handles),
1407 )?;
1408 Ok(ControllerRequest::_UnknownMethod {
1409 ordinal: header.ordinal,
1410 control_handle: ControllerControlHandle { inner: this.inner.clone() },
1411 method_type: fidl::MethodType::TwoWay,
1412 })
1413 }
1414 _ => Err(fidl::Error::UnknownOrdinal {
1415 ordinal: header.ordinal,
1416 protocol_name:
1417 <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1418 }),
1419 }))
1420 },
1421 )
1422 }
1423}
1424
1425#[derive(Debug)]
1431pub enum ControllerRequest {
1432 Start {
1436 args: StartChildArgs,
1437 execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1438 responder: ControllerStartResponder,
1439 },
1440 IsStarted { responder: ControllerIsStartedResponder },
1442 GetExposedDictionary { responder: ControllerGetExposedDictionaryResponder },
1444 Destroy { responder: ControllerDestroyResponder },
1459 #[non_exhaustive]
1461 _UnknownMethod {
1462 ordinal: u64,
1464 control_handle: ControllerControlHandle,
1465 method_type: fidl::MethodType,
1466 },
1467}
1468
1469impl ControllerRequest {
1470 #[allow(irrefutable_let_patterns)]
1471 pub fn into_start(
1472 self,
1473 ) -> Option<(
1474 StartChildArgs,
1475 fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1476 ControllerStartResponder,
1477 )> {
1478 if let ControllerRequest::Start { args, execution_controller, responder } = self {
1479 Some((args, execution_controller, responder))
1480 } else {
1481 None
1482 }
1483 }
1484
1485 #[allow(irrefutable_let_patterns)]
1486 pub fn into_is_started(self) -> Option<(ControllerIsStartedResponder)> {
1487 if let ControllerRequest::IsStarted { responder } = self {
1488 Some((responder))
1489 } else {
1490 None
1491 }
1492 }
1493
1494 #[allow(irrefutable_let_patterns)]
1495 pub fn into_get_exposed_dictionary(self) -> Option<(ControllerGetExposedDictionaryResponder)> {
1496 if let ControllerRequest::GetExposedDictionary { responder } = self {
1497 Some((responder))
1498 } else {
1499 None
1500 }
1501 }
1502
1503 #[allow(irrefutable_let_patterns)]
1504 pub fn into_destroy(self) -> Option<(ControllerDestroyResponder)> {
1505 if let ControllerRequest::Destroy { responder } = self {
1506 Some((responder))
1507 } else {
1508 None
1509 }
1510 }
1511
1512 pub fn method_name(&self) -> &'static str {
1514 match *self {
1515 ControllerRequest::Start { .. } => "start",
1516 ControllerRequest::IsStarted { .. } => "is_started",
1517 ControllerRequest::GetExposedDictionary { .. } => "get_exposed_dictionary",
1518 ControllerRequest::Destroy { .. } => "destroy",
1519 ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1520 "unknown one-way method"
1521 }
1522 ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1523 "unknown two-way method"
1524 }
1525 }
1526 }
1527}
1528
1529#[derive(Debug, Clone)]
1530pub struct ControllerControlHandle {
1531 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1532}
1533
1534impl fdomain_client::fidl::ControlHandle for ControllerControlHandle {
1535 fn shutdown(&self) {
1536 self.inner.shutdown()
1537 }
1538
1539 fn is_closed(&self) -> bool {
1540 self.inner.channel().is_closed()
1541 }
1542 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1543 self.inner.channel().on_closed()
1544 }
1545}
1546
1547impl ControllerControlHandle {}
1548
1549#[must_use = "FIDL methods require a response to be sent"]
1550#[derive(Debug)]
1551pub struct ControllerStartResponder {
1552 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1553 tx_id: u32,
1554}
1555
1556impl std::ops::Drop for ControllerStartResponder {
1560 fn drop(&mut self) {
1561 self.control_handle.shutdown();
1562 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1564 }
1565}
1566
1567impl fdomain_client::fidl::Responder for ControllerStartResponder {
1568 type ControlHandle = ControllerControlHandle;
1569
1570 fn control_handle(&self) -> &ControllerControlHandle {
1571 &self.control_handle
1572 }
1573
1574 fn drop_without_shutdown(mut self) {
1575 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1577 std::mem::forget(self);
1579 }
1580}
1581
1582impl ControllerStartResponder {
1583 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1587 let _result = self.send_raw(result);
1588 if _result.is_err() {
1589 self.control_handle.shutdown();
1590 }
1591 self.drop_without_shutdown();
1592 _result
1593 }
1594
1595 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1597 let _result = self.send_raw(result);
1598 self.drop_without_shutdown();
1599 _result
1600 }
1601
1602 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1603 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1604 fidl::encoding::EmptyStruct,
1605 Error,
1606 >>(
1607 fidl::encoding::FlexibleResult::new(result),
1608 self.tx_id,
1609 0x68878076b8d2eac5,
1610 fidl::encoding::DynamicFlags::FLEXIBLE,
1611 )
1612 }
1613}
1614
1615#[must_use = "FIDL methods require a response to be sent"]
1616#[derive(Debug)]
1617pub struct ControllerIsStartedResponder {
1618 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1619 tx_id: u32,
1620}
1621
1622impl std::ops::Drop for ControllerIsStartedResponder {
1626 fn drop(&mut self) {
1627 self.control_handle.shutdown();
1628 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1630 }
1631}
1632
1633impl fdomain_client::fidl::Responder for ControllerIsStartedResponder {
1634 type ControlHandle = ControllerControlHandle;
1635
1636 fn control_handle(&self) -> &ControllerControlHandle {
1637 &self.control_handle
1638 }
1639
1640 fn drop_without_shutdown(mut self) {
1641 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1643 std::mem::forget(self);
1645 }
1646}
1647
1648impl ControllerIsStartedResponder {
1649 pub fn send(self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
1653 let _result = self.send_raw(result);
1654 if _result.is_err() {
1655 self.control_handle.shutdown();
1656 }
1657 self.drop_without_shutdown();
1658 _result
1659 }
1660
1661 pub fn send_no_shutdown_on_err(
1663 self,
1664 mut result: Result<bool, Error>,
1665 ) -> Result<(), fidl::Error> {
1666 let _result = self.send_raw(result);
1667 self.drop_without_shutdown();
1668 _result
1669 }
1670
1671 fn send_raw(&self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
1672 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1673 ControllerIsStartedResponse,
1674 Error,
1675 >>(
1676 fidl::encoding::FlexibleResult::new(result.map(|is_started| (is_started,))),
1677 self.tx_id,
1678 0x2155e6e1db2083c3,
1679 fidl::encoding::DynamicFlags::FLEXIBLE,
1680 )
1681 }
1682}
1683
1684#[must_use = "FIDL methods require a response to be sent"]
1685#[derive(Debug)]
1686pub struct ControllerGetExposedDictionaryResponder {
1687 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1688 tx_id: u32,
1689}
1690
1691impl std::ops::Drop for ControllerGetExposedDictionaryResponder {
1695 fn drop(&mut self) {
1696 self.control_handle.shutdown();
1697 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1699 }
1700}
1701
1702impl fdomain_client::fidl::Responder for ControllerGetExposedDictionaryResponder {
1703 type ControlHandle = ControllerControlHandle;
1704
1705 fn control_handle(&self) -> &ControllerControlHandle {
1706 &self.control_handle
1707 }
1708
1709 fn drop_without_shutdown(mut self) {
1710 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1712 std::mem::forget(self);
1714 }
1715}
1716
1717impl ControllerGetExposedDictionaryResponder {
1718 pub fn send(
1722 self,
1723 mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
1724 ) -> Result<(), fidl::Error> {
1725 let _result = self.send_raw(result);
1726 if _result.is_err() {
1727 self.control_handle.shutdown();
1728 }
1729 self.drop_without_shutdown();
1730 _result
1731 }
1732
1733 pub fn send_no_shutdown_on_err(
1735 self,
1736 mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
1737 ) -> Result<(), fidl::Error> {
1738 let _result = self.send_raw(result);
1739 self.drop_without_shutdown();
1740 _result
1741 }
1742
1743 fn send_raw(
1744 &self,
1745 mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
1746 ) -> Result<(), fidl::Error> {
1747 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1748 ControllerGetExposedDictionaryResponse,
1749 Error,
1750 >>(
1751 fidl::encoding::FlexibleResult::new(
1752 result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
1753 ),
1754 self.tx_id,
1755 0x7e48373e5eda1f9b,
1756 fidl::encoding::DynamicFlags::FLEXIBLE,
1757 )
1758 }
1759}
1760
1761#[must_use = "FIDL methods require a response to be sent"]
1762#[derive(Debug)]
1763pub struct ControllerDestroyResponder {
1764 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1765 tx_id: u32,
1766}
1767
1768impl std::ops::Drop for ControllerDestroyResponder {
1772 fn drop(&mut self) {
1773 self.control_handle.shutdown();
1774 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1776 }
1777}
1778
1779impl fdomain_client::fidl::Responder for ControllerDestroyResponder {
1780 type ControlHandle = ControllerControlHandle;
1781
1782 fn control_handle(&self) -> &ControllerControlHandle {
1783 &self.control_handle
1784 }
1785
1786 fn drop_without_shutdown(mut self) {
1787 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1789 std::mem::forget(self);
1791 }
1792}
1793
1794impl ControllerDestroyResponder {
1795 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1799 let _result = self.send_raw(result);
1800 if _result.is_err() {
1801 self.control_handle.shutdown();
1802 }
1803 self.drop_without_shutdown();
1804 _result
1805 }
1806
1807 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1809 let _result = self.send_raw(result);
1810 self.drop_without_shutdown();
1811 _result
1812 }
1813
1814 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1815 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1816 fidl::encoding::EmptyStruct,
1817 Error,
1818 >>(
1819 fidl::encoding::FlexibleResult::new(result),
1820 self.tx_id,
1821 0x74529fa68b5c1741,
1822 fidl::encoding::DynamicFlags::FLEXIBLE,
1823 )
1824 }
1825}
1826
1827#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1828pub struct EventStreamMarker;
1829
1830impl fdomain_client::fidl::ProtocolMarker for EventStreamMarker {
1831 type Proxy = EventStreamProxy;
1832 type RequestStream = EventStreamRequestStream;
1833
1834 const DEBUG_NAME: &'static str = "fuchsia.component.EventStream";
1835}
1836impl fdomain_client::fidl::DiscoverableProtocolMarker for EventStreamMarker {}
1837
1838pub trait EventStreamProxyInterface: Send + Sync {
1839 type GetNextResponseFut: std::future::Future<Output = Result<Vec<Event>, fidl::Error>> + Send;
1840 fn r#get_next(&self) -> Self::GetNextResponseFut;
1841 type WaitForReadyResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1842 fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut;
1843}
1844
1845#[derive(Debug, Clone)]
1846pub struct EventStreamProxy {
1847 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1848}
1849
1850impl fdomain_client::fidl::Proxy for EventStreamProxy {
1851 type Protocol = EventStreamMarker;
1852
1853 fn from_channel(inner: fdomain_client::Channel) -> Self {
1854 Self::new(inner)
1855 }
1856
1857 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1858 self.client.into_channel().map_err(|client| Self { client })
1859 }
1860
1861 fn as_channel(&self) -> &fdomain_client::Channel {
1862 self.client.as_channel()
1863 }
1864}
1865
1866impl EventStreamProxy {
1867 pub fn new(channel: fdomain_client::Channel) -> Self {
1869 let protocol_name = <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1870 Self { client: fidl::client::Client::new(channel, protocol_name) }
1871 }
1872
1873 pub fn take_event_stream(&self) -> EventStreamEventStream {
1879 EventStreamEventStream { event_receiver: self.client.take_event_receiver() }
1880 }
1881
1882 pub fn r#get_next(
1883 &self,
1884 ) -> fidl::client::QueryResponseFut<Vec<Event>, fdomain_client::fidl::FDomainResourceDialect>
1885 {
1886 EventStreamProxyInterface::r#get_next(self)
1887 }
1888
1889 pub fn r#wait_for_ready(
1893 &self,
1894 ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
1895 EventStreamProxyInterface::r#wait_for_ready(self)
1896 }
1897}
1898
1899impl EventStreamProxyInterface for EventStreamProxy {
1900 type GetNextResponseFut =
1901 fidl::client::QueryResponseFut<Vec<Event>, fdomain_client::fidl::FDomainResourceDialect>;
1902 fn r#get_next(&self) -> Self::GetNextResponseFut {
1903 fn _decode(
1904 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1905 ) -> Result<Vec<Event>, fidl::Error> {
1906 let _response = fidl::client::decode_transaction_body::<
1907 EventStreamGetNextResponse,
1908 fdomain_client::fidl::FDomainResourceDialect,
1909 0x3f24c9495978eb86,
1910 >(_buf?)?;
1911 Ok(_response.events)
1912 }
1913 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Event>>(
1914 (),
1915 0x3f24c9495978eb86,
1916 fidl::encoding::DynamicFlags::empty(),
1917 _decode,
1918 )
1919 }
1920
1921 type WaitForReadyResponseFut =
1922 fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
1923 fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut {
1924 fn _decode(
1925 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1926 ) -> Result<(), fidl::Error> {
1927 let _response = fidl::client::decode_transaction_body::<
1928 fidl::encoding::EmptyPayload,
1929 fdomain_client::fidl::FDomainResourceDialect,
1930 0x31331f9578d2e682,
1931 >(_buf?)?;
1932 Ok(_response)
1933 }
1934 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1935 (),
1936 0x31331f9578d2e682,
1937 fidl::encoding::DynamicFlags::empty(),
1938 _decode,
1939 )
1940 }
1941}
1942
1943pub struct EventStreamEventStream {
1944 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1945}
1946
1947impl std::marker::Unpin for EventStreamEventStream {}
1948
1949impl futures::stream::FusedStream for EventStreamEventStream {
1950 fn is_terminated(&self) -> bool {
1951 self.event_receiver.is_terminated()
1952 }
1953}
1954
1955impl futures::Stream for EventStreamEventStream {
1956 type Item = Result<EventStreamEvent, fidl::Error>;
1957
1958 fn poll_next(
1959 mut self: std::pin::Pin<&mut Self>,
1960 cx: &mut std::task::Context<'_>,
1961 ) -> std::task::Poll<Option<Self::Item>> {
1962 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1963 &mut self.event_receiver,
1964 cx
1965 )?) {
1966 Some(buf) => std::task::Poll::Ready(Some(EventStreamEvent::decode(buf))),
1967 None => std::task::Poll::Ready(None),
1968 }
1969 }
1970}
1971
1972#[derive(Debug)]
1973pub enum EventStreamEvent {}
1974
1975impl EventStreamEvent {
1976 fn decode(
1978 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1979 ) -> Result<EventStreamEvent, fidl::Error> {
1980 let (bytes, _handles) = buf.split_mut();
1981 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1982 debug_assert_eq!(tx_header.tx_id, 0);
1983 match tx_header.ordinal {
1984 _ => Err(fidl::Error::UnknownOrdinal {
1985 ordinal: tx_header.ordinal,
1986 protocol_name:
1987 <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1988 }),
1989 }
1990 }
1991}
1992
1993pub struct EventStreamRequestStream {
1995 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1996 is_terminated: bool,
1997}
1998
1999impl std::marker::Unpin for EventStreamRequestStream {}
2000
2001impl futures::stream::FusedStream for EventStreamRequestStream {
2002 fn is_terminated(&self) -> bool {
2003 self.is_terminated
2004 }
2005}
2006
2007impl fdomain_client::fidl::RequestStream for EventStreamRequestStream {
2008 type Protocol = EventStreamMarker;
2009 type ControlHandle = EventStreamControlHandle;
2010
2011 fn from_channel(channel: fdomain_client::Channel) -> Self {
2012 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2013 }
2014
2015 fn control_handle(&self) -> Self::ControlHandle {
2016 EventStreamControlHandle { inner: self.inner.clone() }
2017 }
2018
2019 fn into_inner(
2020 self,
2021 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2022 {
2023 (self.inner, self.is_terminated)
2024 }
2025
2026 fn from_inner(
2027 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2028 is_terminated: bool,
2029 ) -> Self {
2030 Self { inner, is_terminated }
2031 }
2032}
2033
2034impl futures::Stream for EventStreamRequestStream {
2035 type Item = Result<EventStreamRequest, fidl::Error>;
2036
2037 fn poll_next(
2038 mut self: std::pin::Pin<&mut Self>,
2039 cx: &mut std::task::Context<'_>,
2040 ) -> std::task::Poll<Option<Self::Item>> {
2041 let this = &mut *self;
2042 if this.inner.check_shutdown(cx) {
2043 this.is_terminated = true;
2044 return std::task::Poll::Ready(None);
2045 }
2046 if this.is_terminated {
2047 panic!("polled EventStreamRequestStream after completion");
2048 }
2049 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2050 |bytes, handles| {
2051 match this.inner.channel().read_etc(cx, bytes, handles) {
2052 std::task::Poll::Ready(Ok(())) => {}
2053 std::task::Poll::Pending => return std::task::Poll::Pending,
2054 std::task::Poll::Ready(Err(None)) => {
2055 this.is_terminated = true;
2056 return std::task::Poll::Ready(None);
2057 }
2058 std::task::Poll::Ready(Err(Some(e))) => {
2059 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2060 e.into(),
2061 ))))
2062 }
2063 }
2064
2065 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2067
2068 std::task::Poll::Ready(Some(match header.ordinal {
2069 0x3f24c9495978eb86 => {
2070 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2071 let mut req = fidl::new_empty!(
2072 fidl::encoding::EmptyPayload,
2073 fdomain_client::fidl::FDomainResourceDialect
2074 );
2075 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2076 let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2077 Ok(EventStreamRequest::GetNext {
2078 responder: EventStreamGetNextResponder {
2079 control_handle: std::mem::ManuallyDrop::new(control_handle),
2080 tx_id: header.tx_id,
2081 },
2082 })
2083 }
2084 0x31331f9578d2e682 => {
2085 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2086 let mut req = fidl::new_empty!(
2087 fidl::encoding::EmptyPayload,
2088 fdomain_client::fidl::FDomainResourceDialect
2089 );
2090 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2091 let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2092 Ok(EventStreamRequest::WaitForReady {
2093 responder: EventStreamWaitForReadyResponder {
2094 control_handle: std::mem::ManuallyDrop::new(control_handle),
2095 tx_id: header.tx_id,
2096 },
2097 })
2098 }
2099 _ => Err(fidl::Error::UnknownOrdinal {
2100 ordinal: header.ordinal,
2101 protocol_name:
2102 <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2103 }),
2104 }))
2105 },
2106 )
2107 }
2108}
2109
2110#[derive(Debug)]
2113pub enum EventStreamRequest {
2114 GetNext {
2115 responder: EventStreamGetNextResponder,
2116 },
2117 WaitForReady {
2121 responder: EventStreamWaitForReadyResponder,
2122 },
2123}
2124
2125impl EventStreamRequest {
2126 #[allow(irrefutable_let_patterns)]
2127 pub fn into_get_next(self) -> Option<(EventStreamGetNextResponder)> {
2128 if let EventStreamRequest::GetNext { responder } = self {
2129 Some((responder))
2130 } else {
2131 None
2132 }
2133 }
2134
2135 #[allow(irrefutable_let_patterns)]
2136 pub fn into_wait_for_ready(self) -> Option<(EventStreamWaitForReadyResponder)> {
2137 if let EventStreamRequest::WaitForReady { responder } = self {
2138 Some((responder))
2139 } else {
2140 None
2141 }
2142 }
2143
2144 pub fn method_name(&self) -> &'static str {
2146 match *self {
2147 EventStreamRequest::GetNext { .. } => "get_next",
2148 EventStreamRequest::WaitForReady { .. } => "wait_for_ready",
2149 }
2150 }
2151}
2152
2153#[derive(Debug, Clone)]
2154pub struct EventStreamControlHandle {
2155 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2156}
2157
2158impl fdomain_client::fidl::ControlHandle for EventStreamControlHandle {
2159 fn shutdown(&self) {
2160 self.inner.shutdown()
2161 }
2162
2163 fn is_closed(&self) -> bool {
2164 self.inner.channel().is_closed()
2165 }
2166 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2167 self.inner.channel().on_closed()
2168 }
2169}
2170
2171impl EventStreamControlHandle {}
2172
2173#[must_use = "FIDL methods require a response to be sent"]
2174#[derive(Debug)]
2175pub struct EventStreamGetNextResponder {
2176 control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
2177 tx_id: u32,
2178}
2179
2180impl std::ops::Drop for EventStreamGetNextResponder {
2184 fn drop(&mut self) {
2185 self.control_handle.shutdown();
2186 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2188 }
2189}
2190
2191impl fdomain_client::fidl::Responder for EventStreamGetNextResponder {
2192 type ControlHandle = EventStreamControlHandle;
2193
2194 fn control_handle(&self) -> &EventStreamControlHandle {
2195 &self.control_handle
2196 }
2197
2198 fn drop_without_shutdown(mut self) {
2199 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2201 std::mem::forget(self);
2203 }
2204}
2205
2206impl EventStreamGetNextResponder {
2207 pub fn send(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2211 let _result = self.send_raw(events);
2212 if _result.is_err() {
2213 self.control_handle.shutdown();
2214 }
2215 self.drop_without_shutdown();
2216 _result
2217 }
2218
2219 pub fn send_no_shutdown_on_err(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2221 let _result = self.send_raw(events);
2222 self.drop_without_shutdown();
2223 _result
2224 }
2225
2226 fn send_raw(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2227 self.control_handle.inner.send::<EventStreamGetNextResponse>(
2228 (events.as_mut(),),
2229 self.tx_id,
2230 0x3f24c9495978eb86,
2231 fidl::encoding::DynamicFlags::empty(),
2232 )
2233 }
2234}
2235
2236#[must_use = "FIDL methods require a response to be sent"]
2237#[derive(Debug)]
2238pub struct EventStreamWaitForReadyResponder {
2239 control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
2240 tx_id: u32,
2241}
2242
2243impl std::ops::Drop for EventStreamWaitForReadyResponder {
2247 fn drop(&mut self) {
2248 self.control_handle.shutdown();
2249 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2251 }
2252}
2253
2254impl fdomain_client::fidl::Responder for EventStreamWaitForReadyResponder {
2255 type ControlHandle = EventStreamControlHandle;
2256
2257 fn control_handle(&self) -> &EventStreamControlHandle {
2258 &self.control_handle
2259 }
2260
2261 fn drop_without_shutdown(mut self) {
2262 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2264 std::mem::forget(self);
2266 }
2267}
2268
2269impl EventStreamWaitForReadyResponder {
2270 pub fn send(self) -> Result<(), fidl::Error> {
2274 let _result = self.send_raw();
2275 if _result.is_err() {
2276 self.control_handle.shutdown();
2277 }
2278 self.drop_without_shutdown();
2279 _result
2280 }
2281
2282 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2284 let _result = self.send_raw();
2285 self.drop_without_shutdown();
2286 _result
2287 }
2288
2289 fn send_raw(&self) -> Result<(), fidl::Error> {
2290 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2291 (),
2292 self.tx_id,
2293 0x31331f9578d2e682,
2294 fidl::encoding::DynamicFlags::empty(),
2295 )
2296 }
2297}
2298
2299#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2300pub struct ExecutionControllerMarker;
2301
2302impl fdomain_client::fidl::ProtocolMarker for ExecutionControllerMarker {
2303 type Proxy = ExecutionControllerProxy;
2304 type RequestStream = ExecutionControllerRequestStream;
2305
2306 const DEBUG_NAME: &'static str = "(anonymous) ExecutionController";
2307}
2308
2309pub trait ExecutionControllerProxyInterface: Send + Sync {
2310 fn r#stop(&self) -> Result<(), fidl::Error>;
2311}
2312
2313#[derive(Debug, Clone)]
2314pub struct ExecutionControllerProxy {
2315 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
2316}
2317
2318impl fdomain_client::fidl::Proxy for ExecutionControllerProxy {
2319 type Protocol = ExecutionControllerMarker;
2320
2321 fn from_channel(inner: fdomain_client::Channel) -> Self {
2322 Self::new(inner)
2323 }
2324
2325 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
2326 self.client.into_channel().map_err(|client| Self { client })
2327 }
2328
2329 fn as_channel(&self) -> &fdomain_client::Channel {
2330 self.client.as_channel()
2331 }
2332}
2333
2334impl ExecutionControllerProxy {
2335 pub fn new(channel: fdomain_client::Channel) -> Self {
2337 let protocol_name =
2338 <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2339 Self { client: fidl::client::Client::new(channel, protocol_name) }
2340 }
2341
2342 pub fn take_event_stream(&self) -> ExecutionControllerEventStream {
2348 ExecutionControllerEventStream { event_receiver: self.client.take_event_receiver() }
2349 }
2350
2351 pub fn r#stop(&self) -> Result<(), fidl::Error> {
2357 ExecutionControllerProxyInterface::r#stop(self)
2358 }
2359}
2360
2361impl ExecutionControllerProxyInterface for ExecutionControllerProxy {
2362 fn r#stop(&self) -> Result<(), fidl::Error> {
2363 self.client.send::<fidl::encoding::EmptyPayload>(
2364 (),
2365 0x56d23cec21036117,
2366 fidl::encoding::DynamicFlags::FLEXIBLE,
2367 )
2368 }
2369}
2370
2371pub struct ExecutionControllerEventStream {
2372 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2373}
2374
2375impl std::marker::Unpin for ExecutionControllerEventStream {}
2376
2377impl futures::stream::FusedStream for ExecutionControllerEventStream {
2378 fn is_terminated(&self) -> bool {
2379 self.event_receiver.is_terminated()
2380 }
2381}
2382
2383impl futures::Stream for ExecutionControllerEventStream {
2384 type Item = Result<ExecutionControllerEvent, fidl::Error>;
2385
2386 fn poll_next(
2387 mut self: std::pin::Pin<&mut Self>,
2388 cx: &mut std::task::Context<'_>,
2389 ) -> std::task::Poll<Option<Self::Item>> {
2390 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2391 &mut self.event_receiver,
2392 cx
2393 )?) {
2394 Some(buf) => std::task::Poll::Ready(Some(ExecutionControllerEvent::decode(buf))),
2395 None => std::task::Poll::Ready(None),
2396 }
2397 }
2398}
2399
2400#[derive(Debug)]
2401pub enum ExecutionControllerEvent {
2402 OnStop {
2403 stopped_payload: StoppedPayload,
2404 },
2405 #[non_exhaustive]
2406 _UnknownEvent {
2407 ordinal: u64,
2409 },
2410}
2411
2412impl ExecutionControllerEvent {
2413 #[allow(irrefutable_let_patterns)]
2414 pub fn into_on_stop(self) -> Option<StoppedPayload> {
2415 if let ExecutionControllerEvent::OnStop { stopped_payload } = self {
2416 Some((stopped_payload))
2417 } else {
2418 None
2419 }
2420 }
2421
2422 fn decode(
2424 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2425 ) -> Result<ExecutionControllerEvent, fidl::Error> {
2426 let (bytes, _handles) = buf.split_mut();
2427 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2428 debug_assert_eq!(tx_header.tx_id, 0);
2429 match tx_header.ordinal {
2430 0x62d5018e2174f57f => {
2431 let mut out = fidl::new_empty!(
2432 ExecutionControllerOnStopRequest,
2433 fdomain_client::fidl::FDomainResourceDialect
2434 );
2435 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ExecutionControllerOnStopRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2436 Ok((ExecutionControllerEvent::OnStop { stopped_payload: out.stopped_payload }))
2437 }
2438 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2439 Ok(ExecutionControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2440 }
2441 _ => Err(fidl::Error::UnknownOrdinal {
2442 ordinal: tx_header.ordinal,
2443 protocol_name:
2444 <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2445 }),
2446 }
2447 }
2448}
2449
2450pub struct ExecutionControllerRequestStream {
2452 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2453 is_terminated: bool,
2454}
2455
2456impl std::marker::Unpin for ExecutionControllerRequestStream {}
2457
2458impl futures::stream::FusedStream for ExecutionControllerRequestStream {
2459 fn is_terminated(&self) -> bool {
2460 self.is_terminated
2461 }
2462}
2463
2464impl fdomain_client::fidl::RequestStream for ExecutionControllerRequestStream {
2465 type Protocol = ExecutionControllerMarker;
2466 type ControlHandle = ExecutionControllerControlHandle;
2467
2468 fn from_channel(channel: fdomain_client::Channel) -> Self {
2469 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2470 }
2471
2472 fn control_handle(&self) -> Self::ControlHandle {
2473 ExecutionControllerControlHandle { inner: self.inner.clone() }
2474 }
2475
2476 fn into_inner(
2477 self,
2478 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2479 {
2480 (self.inner, self.is_terminated)
2481 }
2482
2483 fn from_inner(
2484 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2485 is_terminated: bool,
2486 ) -> Self {
2487 Self { inner, is_terminated }
2488 }
2489}
2490
2491impl futures::Stream for ExecutionControllerRequestStream {
2492 type Item = Result<ExecutionControllerRequest, fidl::Error>;
2493
2494 fn poll_next(
2495 mut self: std::pin::Pin<&mut Self>,
2496 cx: &mut std::task::Context<'_>,
2497 ) -> std::task::Poll<Option<Self::Item>> {
2498 let this = &mut *self;
2499 if this.inner.check_shutdown(cx) {
2500 this.is_terminated = true;
2501 return std::task::Poll::Ready(None);
2502 }
2503 if this.is_terminated {
2504 panic!("polled ExecutionControllerRequestStream after completion");
2505 }
2506 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2507 |bytes, handles| {
2508 match this.inner.channel().read_etc(cx, bytes, handles) {
2509 std::task::Poll::Ready(Ok(())) => {}
2510 std::task::Poll::Pending => return std::task::Poll::Pending,
2511 std::task::Poll::Ready(Err(None)) => {
2512 this.is_terminated = true;
2513 return std::task::Poll::Ready(None);
2514 }
2515 std::task::Poll::Ready(Err(Some(e))) => {
2516 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2517 e.into(),
2518 ))))
2519 }
2520 }
2521
2522 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2524
2525 std::task::Poll::Ready(Some(match header.ordinal {
2526 0x56d23cec21036117 => {
2527 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2528 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
2529 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2530 let control_handle = ExecutionControllerControlHandle {
2531 inner: this.inner.clone(),
2532 };
2533 Ok(ExecutionControllerRequest::Stop {
2534 control_handle,
2535 })
2536 }
2537 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2538 Ok(ExecutionControllerRequest::_UnknownMethod {
2539 ordinal: header.ordinal,
2540 control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
2541 method_type: fidl::MethodType::OneWay,
2542 })
2543 }
2544 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2545 this.inner.send_framework_err(
2546 fidl::encoding::FrameworkErr::UnknownMethod,
2547 header.tx_id,
2548 header.ordinal,
2549 header.dynamic_flags(),
2550 (bytes, handles),
2551 )?;
2552 Ok(ExecutionControllerRequest::_UnknownMethod {
2553 ordinal: header.ordinal,
2554 control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
2555 method_type: fidl::MethodType::TwoWay,
2556 })
2557 }
2558 _ => Err(fidl::Error::UnknownOrdinal {
2559 ordinal: header.ordinal,
2560 protocol_name: <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2561 }),
2562 }))
2563 },
2564 )
2565 }
2566}
2567
2568#[derive(Debug)]
2569pub enum ExecutionControllerRequest {
2570 Stop { control_handle: ExecutionControllerControlHandle },
2576 #[non_exhaustive]
2578 _UnknownMethod {
2579 ordinal: u64,
2581 control_handle: ExecutionControllerControlHandle,
2582 method_type: fidl::MethodType,
2583 },
2584}
2585
2586impl ExecutionControllerRequest {
2587 #[allow(irrefutable_let_patterns)]
2588 pub fn into_stop(self) -> Option<(ExecutionControllerControlHandle)> {
2589 if let ExecutionControllerRequest::Stop { control_handle } = self {
2590 Some((control_handle))
2591 } else {
2592 None
2593 }
2594 }
2595
2596 pub fn method_name(&self) -> &'static str {
2598 match *self {
2599 ExecutionControllerRequest::Stop { .. } => "stop",
2600 ExecutionControllerRequest::_UnknownMethod {
2601 method_type: fidl::MethodType::OneWay,
2602 ..
2603 } => "unknown one-way method",
2604 ExecutionControllerRequest::_UnknownMethod {
2605 method_type: fidl::MethodType::TwoWay,
2606 ..
2607 } => "unknown two-way method",
2608 }
2609 }
2610}
2611
2612#[derive(Debug, Clone)]
2613pub struct ExecutionControllerControlHandle {
2614 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2615}
2616
2617impl fdomain_client::fidl::ControlHandle for ExecutionControllerControlHandle {
2618 fn shutdown(&self) {
2619 self.inner.shutdown()
2620 }
2621
2622 fn is_closed(&self) -> bool {
2623 self.inner.channel().is_closed()
2624 }
2625 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2626 self.inner.channel().on_closed()
2627 }
2628}
2629
2630impl ExecutionControllerControlHandle {
2631 pub fn send_on_stop(&self, mut stopped_payload: &StoppedPayload) -> Result<(), fidl::Error> {
2632 self.inner.send::<ExecutionControllerOnStopRequest>(
2633 (stopped_payload,),
2634 0,
2635 0x62d5018e2174f57f,
2636 fidl::encoding::DynamicFlags::FLEXIBLE,
2637 )
2638 }
2639}
2640
2641#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2642pub struct IntrospectorMarker;
2643
2644impl fdomain_client::fidl::ProtocolMarker for IntrospectorMarker {
2645 type Proxy = IntrospectorProxy;
2646 type RequestStream = IntrospectorRequestStream;
2647
2648 const DEBUG_NAME: &'static str = "fuchsia.component.Introspector";
2649}
2650impl fdomain_client::fidl::DiscoverableProtocolMarker for IntrospectorMarker {}
2651pub type IntrospectorGetMonikerResult = Result<String, Error>;
2652
2653pub trait IntrospectorProxyInterface: Send + Sync {
2654 type GetMonikerResponseFut: std::future::Future<Output = Result<IntrospectorGetMonikerResult, fidl::Error>>
2655 + Send;
2656 fn r#get_moniker(
2657 &self,
2658 component_instance: fdomain_client::Event,
2659 ) -> Self::GetMonikerResponseFut;
2660}
2661
2662#[derive(Debug, Clone)]
2663pub struct IntrospectorProxy {
2664 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
2665}
2666
2667impl fdomain_client::fidl::Proxy for IntrospectorProxy {
2668 type Protocol = IntrospectorMarker;
2669
2670 fn from_channel(inner: fdomain_client::Channel) -> Self {
2671 Self::new(inner)
2672 }
2673
2674 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
2675 self.client.into_channel().map_err(|client| Self { client })
2676 }
2677
2678 fn as_channel(&self) -> &fdomain_client::Channel {
2679 self.client.as_channel()
2680 }
2681}
2682
2683impl IntrospectorProxy {
2684 pub fn new(channel: fdomain_client::Channel) -> Self {
2686 let protocol_name =
2687 <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2688 Self { client: fidl::client::Client::new(channel, protocol_name) }
2689 }
2690
2691 pub fn take_event_stream(&self) -> IntrospectorEventStream {
2697 IntrospectorEventStream { event_receiver: self.client.take_event_receiver() }
2698 }
2699
2700 pub fn r#get_moniker(
2707 &self,
2708 mut component_instance: fdomain_client::Event,
2709 ) -> fidl::client::QueryResponseFut<
2710 IntrospectorGetMonikerResult,
2711 fdomain_client::fidl::FDomainResourceDialect,
2712 > {
2713 IntrospectorProxyInterface::r#get_moniker(self, component_instance)
2714 }
2715}
2716
2717impl IntrospectorProxyInterface for IntrospectorProxy {
2718 type GetMonikerResponseFut = fidl::client::QueryResponseFut<
2719 IntrospectorGetMonikerResult,
2720 fdomain_client::fidl::FDomainResourceDialect,
2721 >;
2722 fn r#get_moniker(
2723 &self,
2724 mut component_instance: fdomain_client::Event,
2725 ) -> Self::GetMonikerResponseFut {
2726 fn _decode(
2727 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2728 ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
2729 let _response = fidl::client::decode_transaction_body::<
2730 fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
2731 fdomain_client::fidl::FDomainResourceDialect,
2732 0x2f980ceb37bf458,
2733 >(_buf?)?
2734 .into_result_fdomain::<IntrospectorMarker>("get_moniker")?;
2735 Ok(_response.map(|x| x.moniker))
2736 }
2737 self.client
2738 .send_query_and_decode::<IntrospectorGetMonikerRequest, IntrospectorGetMonikerResult>(
2739 (component_instance,),
2740 0x2f980ceb37bf458,
2741 fidl::encoding::DynamicFlags::FLEXIBLE,
2742 _decode,
2743 )
2744 }
2745}
2746
2747pub struct IntrospectorEventStream {
2748 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2749}
2750
2751impl std::marker::Unpin for IntrospectorEventStream {}
2752
2753impl futures::stream::FusedStream for IntrospectorEventStream {
2754 fn is_terminated(&self) -> bool {
2755 self.event_receiver.is_terminated()
2756 }
2757}
2758
2759impl futures::Stream for IntrospectorEventStream {
2760 type Item = Result<IntrospectorEvent, fidl::Error>;
2761
2762 fn poll_next(
2763 mut self: std::pin::Pin<&mut Self>,
2764 cx: &mut std::task::Context<'_>,
2765 ) -> std::task::Poll<Option<Self::Item>> {
2766 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2767 &mut self.event_receiver,
2768 cx
2769 )?) {
2770 Some(buf) => std::task::Poll::Ready(Some(IntrospectorEvent::decode(buf))),
2771 None => std::task::Poll::Ready(None),
2772 }
2773 }
2774}
2775
2776#[derive(Debug)]
2777pub enum IntrospectorEvent {
2778 #[non_exhaustive]
2779 _UnknownEvent {
2780 ordinal: u64,
2782 },
2783}
2784
2785impl IntrospectorEvent {
2786 fn decode(
2788 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2789 ) -> Result<IntrospectorEvent, fidl::Error> {
2790 let (bytes, _handles) = buf.split_mut();
2791 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2792 debug_assert_eq!(tx_header.tx_id, 0);
2793 match tx_header.ordinal {
2794 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2795 Ok(IntrospectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2796 }
2797 _ => Err(fidl::Error::UnknownOrdinal {
2798 ordinal: tx_header.ordinal,
2799 protocol_name:
2800 <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2801 }),
2802 }
2803 }
2804}
2805
2806pub struct IntrospectorRequestStream {
2808 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2809 is_terminated: bool,
2810}
2811
2812impl std::marker::Unpin for IntrospectorRequestStream {}
2813
2814impl futures::stream::FusedStream for IntrospectorRequestStream {
2815 fn is_terminated(&self) -> bool {
2816 self.is_terminated
2817 }
2818}
2819
2820impl fdomain_client::fidl::RequestStream for IntrospectorRequestStream {
2821 type Protocol = IntrospectorMarker;
2822 type ControlHandle = IntrospectorControlHandle;
2823
2824 fn from_channel(channel: fdomain_client::Channel) -> Self {
2825 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2826 }
2827
2828 fn control_handle(&self) -> Self::ControlHandle {
2829 IntrospectorControlHandle { inner: self.inner.clone() }
2830 }
2831
2832 fn into_inner(
2833 self,
2834 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2835 {
2836 (self.inner, self.is_terminated)
2837 }
2838
2839 fn from_inner(
2840 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2841 is_terminated: bool,
2842 ) -> Self {
2843 Self { inner, is_terminated }
2844 }
2845}
2846
2847impl futures::Stream for IntrospectorRequestStream {
2848 type Item = Result<IntrospectorRequest, fidl::Error>;
2849
2850 fn poll_next(
2851 mut self: std::pin::Pin<&mut Self>,
2852 cx: &mut std::task::Context<'_>,
2853 ) -> std::task::Poll<Option<Self::Item>> {
2854 let this = &mut *self;
2855 if this.inner.check_shutdown(cx) {
2856 this.is_terminated = true;
2857 return std::task::Poll::Ready(None);
2858 }
2859 if this.is_terminated {
2860 panic!("polled IntrospectorRequestStream after completion");
2861 }
2862 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2863 |bytes, handles| {
2864 match this.inner.channel().read_etc(cx, bytes, handles) {
2865 std::task::Poll::Ready(Ok(())) => {}
2866 std::task::Poll::Pending => return std::task::Poll::Pending,
2867 std::task::Poll::Ready(Err(None)) => {
2868 this.is_terminated = true;
2869 return std::task::Poll::Ready(None);
2870 }
2871 std::task::Poll::Ready(Err(Some(e))) => {
2872 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2873 e.into(),
2874 ))))
2875 }
2876 }
2877
2878 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2880
2881 std::task::Poll::Ready(Some(match header.ordinal {
2882 0x2f980ceb37bf458 => {
2883 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2884 let mut req = fidl::new_empty!(
2885 IntrospectorGetMonikerRequest,
2886 fdomain_client::fidl::FDomainResourceDialect
2887 );
2888 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<IntrospectorGetMonikerRequest>(&header, _body_bytes, handles, &mut req)?;
2889 let control_handle =
2890 IntrospectorControlHandle { inner: this.inner.clone() };
2891 Ok(IntrospectorRequest::GetMoniker {
2892 component_instance: req.component_instance,
2893
2894 responder: IntrospectorGetMonikerResponder {
2895 control_handle: std::mem::ManuallyDrop::new(control_handle),
2896 tx_id: header.tx_id,
2897 },
2898 })
2899 }
2900 _ if header.tx_id == 0
2901 && header
2902 .dynamic_flags()
2903 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2904 {
2905 Ok(IntrospectorRequest::_UnknownMethod {
2906 ordinal: header.ordinal,
2907 control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
2908 method_type: fidl::MethodType::OneWay,
2909 })
2910 }
2911 _ if header
2912 .dynamic_flags()
2913 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2914 {
2915 this.inner.send_framework_err(
2916 fidl::encoding::FrameworkErr::UnknownMethod,
2917 header.tx_id,
2918 header.ordinal,
2919 header.dynamic_flags(),
2920 (bytes, handles),
2921 )?;
2922 Ok(IntrospectorRequest::_UnknownMethod {
2923 ordinal: header.ordinal,
2924 control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
2925 method_type: fidl::MethodType::TwoWay,
2926 })
2927 }
2928 _ => Err(fidl::Error::UnknownOrdinal {
2929 ordinal: header.ordinal,
2930 protocol_name:
2931 <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2932 }),
2933 }))
2934 },
2935 )
2936 }
2937}
2938
2939#[derive(Debug)]
2948pub enum IntrospectorRequest {
2949 GetMoniker {
2956 component_instance: fdomain_client::Event,
2957 responder: IntrospectorGetMonikerResponder,
2958 },
2959 #[non_exhaustive]
2961 _UnknownMethod {
2962 ordinal: u64,
2964 control_handle: IntrospectorControlHandle,
2965 method_type: fidl::MethodType,
2966 },
2967}
2968
2969impl IntrospectorRequest {
2970 #[allow(irrefutable_let_patterns)]
2971 pub fn into_get_moniker(
2972 self,
2973 ) -> Option<(fdomain_client::Event, IntrospectorGetMonikerResponder)> {
2974 if let IntrospectorRequest::GetMoniker { component_instance, responder } = self {
2975 Some((component_instance, responder))
2976 } else {
2977 None
2978 }
2979 }
2980
2981 pub fn method_name(&self) -> &'static str {
2983 match *self {
2984 IntrospectorRequest::GetMoniker { .. } => "get_moniker",
2985 IntrospectorRequest::_UnknownMethod {
2986 method_type: fidl::MethodType::OneWay, ..
2987 } => "unknown one-way method",
2988 IntrospectorRequest::_UnknownMethod {
2989 method_type: fidl::MethodType::TwoWay, ..
2990 } => "unknown two-way method",
2991 }
2992 }
2993}
2994
2995#[derive(Debug, Clone)]
2996pub struct IntrospectorControlHandle {
2997 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2998}
2999
3000impl fdomain_client::fidl::ControlHandle for IntrospectorControlHandle {
3001 fn shutdown(&self) {
3002 self.inner.shutdown()
3003 }
3004
3005 fn is_closed(&self) -> bool {
3006 self.inner.channel().is_closed()
3007 }
3008 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3009 self.inner.channel().on_closed()
3010 }
3011}
3012
3013impl IntrospectorControlHandle {}
3014
3015#[must_use = "FIDL methods require a response to be sent"]
3016#[derive(Debug)]
3017pub struct IntrospectorGetMonikerResponder {
3018 control_handle: std::mem::ManuallyDrop<IntrospectorControlHandle>,
3019 tx_id: u32,
3020}
3021
3022impl std::ops::Drop for IntrospectorGetMonikerResponder {
3026 fn drop(&mut self) {
3027 self.control_handle.shutdown();
3028 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3030 }
3031}
3032
3033impl fdomain_client::fidl::Responder for IntrospectorGetMonikerResponder {
3034 type ControlHandle = IntrospectorControlHandle;
3035
3036 fn control_handle(&self) -> &IntrospectorControlHandle {
3037 &self.control_handle
3038 }
3039
3040 fn drop_without_shutdown(mut self) {
3041 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3043 std::mem::forget(self);
3045 }
3046}
3047
3048impl IntrospectorGetMonikerResponder {
3049 pub fn send(self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
3053 let _result = self.send_raw(result);
3054 if _result.is_err() {
3055 self.control_handle.shutdown();
3056 }
3057 self.drop_without_shutdown();
3058 _result
3059 }
3060
3061 pub fn send_no_shutdown_on_err(
3063 self,
3064 mut result: Result<&str, Error>,
3065 ) -> Result<(), fidl::Error> {
3066 let _result = self.send_raw(result);
3067 self.drop_without_shutdown();
3068 _result
3069 }
3070
3071 fn send_raw(&self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
3072 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3073 IntrospectorGetMonikerResponse,
3074 Error,
3075 >>(
3076 fidl::encoding::FlexibleResult::new(result.map(|moniker| (moniker,))),
3077 self.tx_id,
3078 0x2f980ceb37bf458,
3079 fidl::encoding::DynamicFlags::FLEXIBLE,
3080 )
3081 }
3082}
3083
3084#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3085pub struct NamespaceMarker;
3086
3087impl fdomain_client::fidl::ProtocolMarker for NamespaceMarker {
3088 type Proxy = NamespaceProxy;
3089 type RequestStream = NamespaceRequestStream;
3090
3091 const DEBUG_NAME: &'static str = "fuchsia.component.Namespace";
3092}
3093impl fdomain_client::fidl::DiscoverableProtocolMarker for NamespaceMarker {}
3094pub type NamespaceCreateResult = Result<Vec<NamespaceEntry>, NamespaceError>;
3095
3096pub trait NamespaceProxyInterface: Send + Sync {
3097 type CreateResponseFut: std::future::Future<Output = Result<NamespaceCreateResult, fidl::Error>>
3098 + Send;
3099 fn r#create(&self, entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut;
3100}
3101
3102#[derive(Debug, Clone)]
3103pub struct NamespaceProxy {
3104 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3105}
3106
3107impl fdomain_client::fidl::Proxy for NamespaceProxy {
3108 type Protocol = NamespaceMarker;
3109
3110 fn from_channel(inner: fdomain_client::Channel) -> Self {
3111 Self::new(inner)
3112 }
3113
3114 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3115 self.client.into_channel().map_err(|client| Self { client })
3116 }
3117
3118 fn as_channel(&self) -> &fdomain_client::Channel {
3119 self.client.as_channel()
3120 }
3121}
3122
3123impl NamespaceProxy {
3124 pub fn new(channel: fdomain_client::Channel) -> Self {
3126 let protocol_name = <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3127 Self { client: fidl::client::Client::new(channel, protocol_name) }
3128 }
3129
3130 pub fn take_event_stream(&self) -> NamespaceEventStream {
3136 NamespaceEventStream { event_receiver: self.client.take_event_receiver() }
3137 }
3138
3139 pub fn r#create(
3140 &self,
3141 mut entries: Vec<NamespaceInputEntry>,
3142 ) -> fidl::client::QueryResponseFut<
3143 NamespaceCreateResult,
3144 fdomain_client::fidl::FDomainResourceDialect,
3145 > {
3146 NamespaceProxyInterface::r#create(self, entries)
3147 }
3148}
3149
3150impl NamespaceProxyInterface for NamespaceProxy {
3151 type CreateResponseFut = fidl::client::QueryResponseFut<
3152 NamespaceCreateResult,
3153 fdomain_client::fidl::FDomainResourceDialect,
3154 >;
3155 fn r#create(&self, mut entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut {
3156 fn _decode(
3157 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3158 ) -> Result<NamespaceCreateResult, fidl::Error> {
3159 let _response = fidl::client::decode_transaction_body::<
3160 fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
3161 fdomain_client::fidl::FDomainResourceDialect,
3162 0x4329fe12b2a790f9,
3163 >(_buf?)?
3164 .into_result_fdomain::<NamespaceMarker>("create")?;
3165 Ok(_response.map(|x| x.entries))
3166 }
3167 self.client.send_query_and_decode::<NamespaceCreateRequest, NamespaceCreateResult>(
3168 (entries.as_mut(),),
3169 0x4329fe12b2a790f9,
3170 fidl::encoding::DynamicFlags::FLEXIBLE,
3171 _decode,
3172 )
3173 }
3174}
3175
3176pub struct NamespaceEventStream {
3177 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3178}
3179
3180impl std::marker::Unpin for NamespaceEventStream {}
3181
3182impl futures::stream::FusedStream for NamespaceEventStream {
3183 fn is_terminated(&self) -> bool {
3184 self.event_receiver.is_terminated()
3185 }
3186}
3187
3188impl futures::Stream for NamespaceEventStream {
3189 type Item = Result<NamespaceEvent, fidl::Error>;
3190
3191 fn poll_next(
3192 mut self: std::pin::Pin<&mut Self>,
3193 cx: &mut std::task::Context<'_>,
3194 ) -> std::task::Poll<Option<Self::Item>> {
3195 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3196 &mut self.event_receiver,
3197 cx
3198 )?) {
3199 Some(buf) => std::task::Poll::Ready(Some(NamespaceEvent::decode(buf))),
3200 None => std::task::Poll::Ready(None),
3201 }
3202 }
3203}
3204
3205#[derive(Debug)]
3206pub enum NamespaceEvent {
3207 #[non_exhaustive]
3208 _UnknownEvent {
3209 ordinal: u64,
3211 },
3212}
3213
3214impl NamespaceEvent {
3215 fn decode(
3217 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3218 ) -> Result<NamespaceEvent, fidl::Error> {
3219 let (bytes, _handles) = buf.split_mut();
3220 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3221 debug_assert_eq!(tx_header.tx_id, 0);
3222 match tx_header.ordinal {
3223 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3224 Ok(NamespaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3225 }
3226 _ => Err(fidl::Error::UnknownOrdinal {
3227 ordinal: tx_header.ordinal,
3228 protocol_name:
3229 <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3230 }),
3231 }
3232 }
3233}
3234
3235pub struct NamespaceRequestStream {
3237 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3238 is_terminated: bool,
3239}
3240
3241impl std::marker::Unpin for NamespaceRequestStream {}
3242
3243impl futures::stream::FusedStream for NamespaceRequestStream {
3244 fn is_terminated(&self) -> bool {
3245 self.is_terminated
3246 }
3247}
3248
3249impl fdomain_client::fidl::RequestStream for NamespaceRequestStream {
3250 type Protocol = NamespaceMarker;
3251 type ControlHandle = NamespaceControlHandle;
3252
3253 fn from_channel(channel: fdomain_client::Channel) -> Self {
3254 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3255 }
3256
3257 fn control_handle(&self) -> Self::ControlHandle {
3258 NamespaceControlHandle { inner: self.inner.clone() }
3259 }
3260
3261 fn into_inner(
3262 self,
3263 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3264 {
3265 (self.inner, self.is_terminated)
3266 }
3267
3268 fn from_inner(
3269 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3270 is_terminated: bool,
3271 ) -> Self {
3272 Self { inner, is_terminated }
3273 }
3274}
3275
3276impl futures::Stream for NamespaceRequestStream {
3277 type Item = Result<NamespaceRequest, fidl::Error>;
3278
3279 fn poll_next(
3280 mut self: std::pin::Pin<&mut Self>,
3281 cx: &mut std::task::Context<'_>,
3282 ) -> std::task::Poll<Option<Self::Item>> {
3283 let this = &mut *self;
3284 if this.inner.check_shutdown(cx) {
3285 this.is_terminated = true;
3286 return std::task::Poll::Ready(None);
3287 }
3288 if this.is_terminated {
3289 panic!("polled NamespaceRequestStream after completion");
3290 }
3291 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3292 |bytes, handles| {
3293 match this.inner.channel().read_etc(cx, bytes, handles) {
3294 std::task::Poll::Ready(Ok(())) => {}
3295 std::task::Poll::Pending => return std::task::Poll::Pending,
3296 std::task::Poll::Ready(Err(None)) => {
3297 this.is_terminated = true;
3298 return std::task::Poll::Ready(None);
3299 }
3300 std::task::Poll::Ready(Err(Some(e))) => {
3301 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3302 e.into(),
3303 ))))
3304 }
3305 }
3306
3307 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3309
3310 std::task::Poll::Ready(Some(match header.ordinal {
3311 0x4329fe12b2a790f9 => {
3312 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3313 let mut req = fidl::new_empty!(
3314 NamespaceCreateRequest,
3315 fdomain_client::fidl::FDomainResourceDialect
3316 );
3317 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NamespaceCreateRequest>(&header, _body_bytes, handles, &mut req)?;
3318 let control_handle = NamespaceControlHandle { inner: this.inner.clone() };
3319 Ok(NamespaceRequest::Create {
3320 entries: req.entries,
3321
3322 responder: NamespaceCreateResponder {
3323 control_handle: std::mem::ManuallyDrop::new(control_handle),
3324 tx_id: header.tx_id,
3325 },
3326 })
3327 }
3328 _ if header.tx_id == 0
3329 && header
3330 .dynamic_flags()
3331 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3332 {
3333 Ok(NamespaceRequest::_UnknownMethod {
3334 ordinal: header.ordinal,
3335 control_handle: NamespaceControlHandle { inner: this.inner.clone() },
3336 method_type: fidl::MethodType::OneWay,
3337 })
3338 }
3339 _ if header
3340 .dynamic_flags()
3341 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3342 {
3343 this.inner.send_framework_err(
3344 fidl::encoding::FrameworkErr::UnknownMethod,
3345 header.tx_id,
3346 header.ordinal,
3347 header.dynamic_flags(),
3348 (bytes, handles),
3349 )?;
3350 Ok(NamespaceRequest::_UnknownMethod {
3351 ordinal: header.ordinal,
3352 control_handle: NamespaceControlHandle { inner: this.inner.clone() },
3353 method_type: fidl::MethodType::TwoWay,
3354 })
3355 }
3356 _ => Err(fidl::Error::UnknownOrdinal {
3357 ordinal: header.ordinal,
3358 protocol_name:
3359 <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3360 }),
3361 }))
3362 },
3363 )
3364 }
3365}
3366
3367#[derive(Debug)]
3369pub enum NamespaceRequest {
3370 Create {
3371 entries: Vec<NamespaceInputEntry>,
3372 responder: NamespaceCreateResponder,
3373 },
3374 #[non_exhaustive]
3376 _UnknownMethod {
3377 ordinal: u64,
3379 control_handle: NamespaceControlHandle,
3380 method_type: fidl::MethodType,
3381 },
3382}
3383
3384impl NamespaceRequest {
3385 #[allow(irrefutable_let_patterns)]
3386 pub fn into_create(self) -> Option<(Vec<NamespaceInputEntry>, NamespaceCreateResponder)> {
3387 if let NamespaceRequest::Create { entries, responder } = self {
3388 Some((entries, responder))
3389 } else {
3390 None
3391 }
3392 }
3393
3394 pub fn method_name(&self) -> &'static str {
3396 match *self {
3397 NamespaceRequest::Create { .. } => "create",
3398 NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3399 "unknown one-way method"
3400 }
3401 NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3402 "unknown two-way method"
3403 }
3404 }
3405 }
3406}
3407
3408#[derive(Debug, Clone)]
3409pub struct NamespaceControlHandle {
3410 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3411}
3412
3413impl fdomain_client::fidl::ControlHandle for NamespaceControlHandle {
3414 fn shutdown(&self) {
3415 self.inner.shutdown()
3416 }
3417
3418 fn is_closed(&self) -> bool {
3419 self.inner.channel().is_closed()
3420 }
3421 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3422 self.inner.channel().on_closed()
3423 }
3424}
3425
3426impl NamespaceControlHandle {}
3427
3428#[must_use = "FIDL methods require a response to be sent"]
3429#[derive(Debug)]
3430pub struct NamespaceCreateResponder {
3431 control_handle: std::mem::ManuallyDrop<NamespaceControlHandle>,
3432 tx_id: u32,
3433}
3434
3435impl std::ops::Drop for NamespaceCreateResponder {
3439 fn drop(&mut self) {
3440 self.control_handle.shutdown();
3441 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3443 }
3444}
3445
3446impl fdomain_client::fidl::Responder for NamespaceCreateResponder {
3447 type ControlHandle = NamespaceControlHandle;
3448
3449 fn control_handle(&self) -> &NamespaceControlHandle {
3450 &self.control_handle
3451 }
3452
3453 fn drop_without_shutdown(mut self) {
3454 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3456 std::mem::forget(self);
3458 }
3459}
3460
3461impl NamespaceCreateResponder {
3462 pub fn send(
3466 self,
3467 mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3468 ) -> Result<(), fidl::Error> {
3469 let _result = self.send_raw(result);
3470 if _result.is_err() {
3471 self.control_handle.shutdown();
3472 }
3473 self.drop_without_shutdown();
3474 _result
3475 }
3476
3477 pub fn send_no_shutdown_on_err(
3479 self,
3480 mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3481 ) -> Result<(), fidl::Error> {
3482 let _result = self.send_raw(result);
3483 self.drop_without_shutdown();
3484 _result
3485 }
3486
3487 fn send_raw(
3488 &self,
3489 mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3490 ) -> Result<(), fidl::Error> {
3491 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3492 NamespaceCreateResponse,
3493 NamespaceError,
3494 >>(
3495 fidl::encoding::FlexibleResult::new(
3496 result.as_mut().map_err(|e| *e).map(|entries| (entries.as_mut_slice(),)),
3497 ),
3498 self.tx_id,
3499 0x4329fe12b2a790f9,
3500 fidl::encoding::DynamicFlags::FLEXIBLE,
3501 )
3502 }
3503}
3504
3505#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3506pub struct RealmMarker;
3507
3508impl fdomain_client::fidl::ProtocolMarker for RealmMarker {
3509 type Proxy = RealmProxy;
3510 type RequestStream = RealmRequestStream;
3511
3512 const DEBUG_NAME: &'static str = "fuchsia.component.Realm";
3513}
3514impl fdomain_client::fidl::DiscoverableProtocolMarker for RealmMarker {}
3515pub type RealmOpenControllerResult = Result<(), Error>;
3516pub type RealmOpenExposedDirResult = Result<(), Error>;
3517pub type RealmCreateChildResult = Result<(), Error>;
3518pub type RealmDestroyChildResult = Result<(), Error>;
3519pub type RealmListChildrenResult = Result<(), Error>;
3520pub type RealmGetResolvedInfoResult =
3521 Result<fdomain_fuchsia_component_resolution::Component, Error>;
3522pub type RealmGetChildOutputDictionaryResult =
3523 Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>;
3524
3525pub trait RealmProxyInterface: Send + Sync {
3526 type OpenControllerResponseFut: std::future::Future<Output = Result<RealmOpenControllerResult, fidl::Error>>
3527 + Send;
3528 fn r#open_controller(
3529 &self,
3530 child: &fdomain_fuchsia_component_decl::ChildRef,
3531 controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
3532 ) -> Self::OpenControllerResponseFut;
3533 type OpenExposedDirResponseFut: std::future::Future<Output = Result<RealmOpenExposedDirResult, fidl::Error>>
3534 + Send;
3535 fn r#open_exposed_dir(
3536 &self,
3537 child: &fdomain_fuchsia_component_decl::ChildRef,
3538 exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
3539 ) -> Self::OpenExposedDirResponseFut;
3540 type CreateChildResponseFut: std::future::Future<Output = Result<RealmCreateChildResult, fidl::Error>>
3541 + Send;
3542 fn r#create_child(
3543 &self,
3544 collection: &fdomain_fuchsia_component_decl::CollectionRef,
3545 decl: &fdomain_fuchsia_component_decl::Child,
3546 args: CreateChildArgs,
3547 ) -> Self::CreateChildResponseFut;
3548 type DestroyChildResponseFut: std::future::Future<Output = Result<RealmDestroyChildResult, fidl::Error>>
3549 + Send;
3550 fn r#destroy_child(
3551 &self,
3552 child: &fdomain_fuchsia_component_decl::ChildRef,
3553 ) -> Self::DestroyChildResponseFut;
3554 type ListChildrenResponseFut: std::future::Future<Output = Result<RealmListChildrenResult, fidl::Error>>
3555 + Send;
3556 fn r#list_children(
3557 &self,
3558 collection: &fdomain_fuchsia_component_decl::CollectionRef,
3559 iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
3560 ) -> Self::ListChildrenResponseFut;
3561 type GetResolvedInfoResponseFut: std::future::Future<Output = Result<RealmGetResolvedInfoResult, fidl::Error>>
3562 + Send;
3563 fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut;
3564 type GetChildOutputDictionaryResponseFut: std::future::Future<Output = Result<RealmGetChildOutputDictionaryResult, fidl::Error>>
3565 + Send;
3566 fn r#get_child_output_dictionary(
3567 &self,
3568 child: &fdomain_fuchsia_component_decl::ChildRef,
3569 ) -> Self::GetChildOutputDictionaryResponseFut;
3570}
3571
3572#[derive(Debug, Clone)]
3573pub struct RealmProxy {
3574 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3575}
3576
3577impl fdomain_client::fidl::Proxy for RealmProxy {
3578 type Protocol = RealmMarker;
3579
3580 fn from_channel(inner: fdomain_client::Channel) -> Self {
3581 Self::new(inner)
3582 }
3583
3584 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3585 self.client.into_channel().map_err(|client| Self { client })
3586 }
3587
3588 fn as_channel(&self) -> &fdomain_client::Channel {
3589 self.client.as_channel()
3590 }
3591}
3592
3593impl RealmProxy {
3594 pub fn new(channel: fdomain_client::Channel) -> Self {
3596 let protocol_name = <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3597 Self { client: fidl::client::Client::new(channel, protocol_name) }
3598 }
3599
3600 pub fn take_event_stream(&self) -> RealmEventStream {
3606 RealmEventStream { event_receiver: self.client.take_event_receiver() }
3607 }
3608
3609 pub fn r#open_controller(
3616 &self,
3617 mut child: &fdomain_fuchsia_component_decl::ChildRef,
3618 mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
3619 ) -> fidl::client::QueryResponseFut<
3620 RealmOpenControllerResult,
3621 fdomain_client::fidl::FDomainResourceDialect,
3622 > {
3623 RealmProxyInterface::r#open_controller(self, child, controller)
3624 }
3625
3626 pub fn r#open_exposed_dir(
3642 &self,
3643 mut child: &fdomain_fuchsia_component_decl::ChildRef,
3644 mut exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
3645 ) -> fidl::client::QueryResponseFut<
3646 RealmOpenExposedDirResult,
3647 fdomain_client::fidl::FDomainResourceDialect,
3648 > {
3649 RealmProxyInterface::r#open_exposed_dir(self, child, exposed_dir)
3650 }
3651
3652 pub fn r#create_child(
3673 &self,
3674 mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
3675 mut decl: &fdomain_fuchsia_component_decl::Child,
3676 mut args: CreateChildArgs,
3677 ) -> fidl::client::QueryResponseFut<
3678 RealmCreateChildResult,
3679 fdomain_client::fidl::FDomainResourceDialect,
3680 > {
3681 RealmProxyInterface::r#create_child(self, collection, decl, args)
3682 }
3683
3684 pub fn r#destroy_child(
3696 &self,
3697 mut child: &fdomain_fuchsia_component_decl::ChildRef,
3698 ) -> fidl::client::QueryResponseFut<
3699 RealmDestroyChildResult,
3700 fdomain_client::fidl::FDomainResourceDialect,
3701 > {
3702 RealmProxyInterface::r#destroy_child(self, child)
3703 }
3704
3705 pub fn r#list_children(
3719 &self,
3720 mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
3721 mut iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
3722 ) -> fidl::client::QueryResponseFut<
3723 RealmListChildrenResult,
3724 fdomain_client::fidl::FDomainResourceDialect,
3725 > {
3726 RealmProxyInterface::r#list_children(self, collection, iter)
3727 }
3728
3729 pub fn r#get_resolved_info(
3732 &self,
3733 ) -> fidl::client::QueryResponseFut<
3734 RealmGetResolvedInfoResult,
3735 fdomain_client::fidl::FDomainResourceDialect,
3736 > {
3737 RealmProxyInterface::r#get_resolved_info(self)
3738 }
3739
3740 pub fn r#get_child_output_dictionary(
3741 &self,
3742 mut child: &fdomain_fuchsia_component_decl::ChildRef,
3743 ) -> fidl::client::QueryResponseFut<
3744 RealmGetChildOutputDictionaryResult,
3745 fdomain_client::fidl::FDomainResourceDialect,
3746 > {
3747 RealmProxyInterface::r#get_child_output_dictionary(self, child)
3748 }
3749}
3750
3751impl RealmProxyInterface for RealmProxy {
3752 type OpenControllerResponseFut = fidl::client::QueryResponseFut<
3753 RealmOpenControllerResult,
3754 fdomain_client::fidl::FDomainResourceDialect,
3755 >;
3756 fn r#open_controller(
3757 &self,
3758 mut child: &fdomain_fuchsia_component_decl::ChildRef,
3759 mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
3760 ) -> Self::OpenControllerResponseFut {
3761 fn _decode(
3762 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3763 ) -> Result<RealmOpenControllerResult, fidl::Error> {
3764 let _response = fidl::client::decode_transaction_body::<
3765 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3766 fdomain_client::fidl::FDomainResourceDialect,
3767 0x7150b7898d1b1180,
3768 >(_buf?)?;
3769 Ok(_response.map(|x| x))
3770 }
3771 self.client.send_query_and_decode::<RealmOpenControllerRequest, RealmOpenControllerResult>(
3772 (child, controller),
3773 0x7150b7898d1b1180,
3774 fidl::encoding::DynamicFlags::empty(),
3775 _decode,
3776 )
3777 }
3778
3779 type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
3780 RealmOpenExposedDirResult,
3781 fdomain_client::fidl::FDomainResourceDialect,
3782 >;
3783 fn r#open_exposed_dir(
3784 &self,
3785 mut child: &fdomain_fuchsia_component_decl::ChildRef,
3786 mut exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
3787 ) -> Self::OpenExposedDirResponseFut {
3788 fn _decode(
3789 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3790 ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
3791 let _response = fidl::client::decode_transaction_body::<
3792 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3793 fdomain_client::fidl::FDomainResourceDialect,
3794 0x7f993235ca59f92c,
3795 >(_buf?)?;
3796 Ok(_response.map(|x| x))
3797 }
3798 self.client.send_query_and_decode::<RealmOpenExposedDirRequest, RealmOpenExposedDirResult>(
3799 (child, exposed_dir),
3800 0x7f993235ca59f92c,
3801 fidl::encoding::DynamicFlags::empty(),
3802 _decode,
3803 )
3804 }
3805
3806 type CreateChildResponseFut = fidl::client::QueryResponseFut<
3807 RealmCreateChildResult,
3808 fdomain_client::fidl::FDomainResourceDialect,
3809 >;
3810 fn r#create_child(
3811 &self,
3812 mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
3813 mut decl: &fdomain_fuchsia_component_decl::Child,
3814 mut args: CreateChildArgs,
3815 ) -> Self::CreateChildResponseFut {
3816 fn _decode(
3817 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3818 ) -> Result<RealmCreateChildResult, fidl::Error> {
3819 let _response = fidl::client::decode_transaction_body::<
3820 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3821 fdomain_client::fidl::FDomainResourceDialect,
3822 0x43e48ce8483d7560,
3823 >(_buf?)?;
3824 Ok(_response.map(|x| x))
3825 }
3826 self.client.send_query_and_decode::<RealmCreateChildRequest, RealmCreateChildResult>(
3827 (collection, decl, &mut args),
3828 0x43e48ce8483d7560,
3829 fidl::encoding::DynamicFlags::empty(),
3830 _decode,
3831 )
3832 }
3833
3834 type DestroyChildResponseFut = fidl::client::QueryResponseFut<
3835 RealmDestroyChildResult,
3836 fdomain_client::fidl::FDomainResourceDialect,
3837 >;
3838 fn r#destroy_child(
3839 &self,
3840 mut child: &fdomain_fuchsia_component_decl::ChildRef,
3841 ) -> Self::DestroyChildResponseFut {
3842 fn _decode(
3843 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3844 ) -> Result<RealmDestroyChildResult, fidl::Error> {
3845 let _response = fidl::client::decode_transaction_body::<
3846 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3847 fdomain_client::fidl::FDomainResourceDialect,
3848 0x71d8caf8850c9222,
3849 >(_buf?)?;
3850 Ok(_response.map(|x| x))
3851 }
3852 self.client.send_query_and_decode::<RealmDestroyChildRequest, RealmDestroyChildResult>(
3853 (child,),
3854 0x71d8caf8850c9222,
3855 fidl::encoding::DynamicFlags::empty(),
3856 _decode,
3857 )
3858 }
3859
3860 type ListChildrenResponseFut = fidl::client::QueryResponseFut<
3861 RealmListChildrenResult,
3862 fdomain_client::fidl::FDomainResourceDialect,
3863 >;
3864 fn r#list_children(
3865 &self,
3866 mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
3867 mut iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
3868 ) -> Self::ListChildrenResponseFut {
3869 fn _decode(
3870 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3871 ) -> Result<RealmListChildrenResult, fidl::Error> {
3872 let _response = fidl::client::decode_transaction_body::<
3873 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3874 fdomain_client::fidl::FDomainResourceDialect,
3875 0x6888a76683efc0a1,
3876 >(_buf?)?;
3877 Ok(_response.map(|x| x))
3878 }
3879 self.client.send_query_and_decode::<RealmListChildrenRequest, RealmListChildrenResult>(
3880 (collection, iter),
3881 0x6888a76683efc0a1,
3882 fidl::encoding::DynamicFlags::empty(),
3883 _decode,
3884 )
3885 }
3886
3887 type GetResolvedInfoResponseFut = fidl::client::QueryResponseFut<
3888 RealmGetResolvedInfoResult,
3889 fdomain_client::fidl::FDomainResourceDialect,
3890 >;
3891 fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut {
3892 fn _decode(
3893 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3894 ) -> Result<RealmGetResolvedInfoResult, fidl::Error> {
3895 let _response = fidl::client::decode_transaction_body::<
3896 fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>,
3897 fdomain_client::fidl::FDomainResourceDialect,
3898 0x734f744cb7d210a2,
3899 >(_buf?)?;
3900 Ok(_response.map(|x| x.resolved_info))
3901 }
3902 self.client
3903 .send_query_and_decode::<fidl::encoding::EmptyPayload, RealmGetResolvedInfoResult>(
3904 (),
3905 0x734f744cb7d210a2,
3906 fidl::encoding::DynamicFlags::empty(),
3907 _decode,
3908 )
3909 }
3910
3911 type GetChildOutputDictionaryResponseFut = fidl::client::QueryResponseFut<
3912 RealmGetChildOutputDictionaryResult,
3913 fdomain_client::fidl::FDomainResourceDialect,
3914 >;
3915 fn r#get_child_output_dictionary(
3916 &self,
3917 mut child: &fdomain_fuchsia_component_decl::ChildRef,
3918 ) -> Self::GetChildOutputDictionaryResponseFut {
3919 fn _decode(
3920 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3921 ) -> Result<RealmGetChildOutputDictionaryResult, fidl::Error> {
3922 let _response = fidl::client::decode_transaction_body::<
3923 fidl::encoding::ResultType<RealmGetChildOutputDictionaryResponse, Error>,
3924 fdomain_client::fidl::FDomainResourceDialect,
3925 0x4259d08d261d5610,
3926 >(_buf?)?;
3927 Ok(_response.map(|x| x.dictionary))
3928 }
3929 self.client.send_query_and_decode::<
3930 RealmGetChildOutputDictionaryRequest,
3931 RealmGetChildOutputDictionaryResult,
3932 >(
3933 (child,),
3934 0x4259d08d261d5610,
3935 fidl::encoding::DynamicFlags::empty(),
3936 _decode,
3937 )
3938 }
3939}
3940
3941pub struct RealmEventStream {
3942 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3943}
3944
3945impl std::marker::Unpin for RealmEventStream {}
3946
3947impl futures::stream::FusedStream for RealmEventStream {
3948 fn is_terminated(&self) -> bool {
3949 self.event_receiver.is_terminated()
3950 }
3951}
3952
3953impl futures::Stream for RealmEventStream {
3954 type Item = Result<RealmEvent, fidl::Error>;
3955
3956 fn poll_next(
3957 mut self: std::pin::Pin<&mut Self>,
3958 cx: &mut std::task::Context<'_>,
3959 ) -> std::task::Poll<Option<Self::Item>> {
3960 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3961 &mut self.event_receiver,
3962 cx
3963 )?) {
3964 Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
3965 None => std::task::Poll::Ready(None),
3966 }
3967 }
3968}
3969
3970#[derive(Debug)]
3971pub enum RealmEvent {}
3972
3973impl RealmEvent {
3974 fn decode(
3976 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3977 ) -> Result<RealmEvent, fidl::Error> {
3978 let (bytes, _handles) = buf.split_mut();
3979 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3980 debug_assert_eq!(tx_header.tx_id, 0);
3981 match tx_header.ordinal {
3982 _ => Err(fidl::Error::UnknownOrdinal {
3983 ordinal: tx_header.ordinal,
3984 protocol_name: <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3985 }),
3986 }
3987 }
3988}
3989
3990pub struct RealmRequestStream {
3992 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3993 is_terminated: bool,
3994}
3995
3996impl std::marker::Unpin for RealmRequestStream {}
3997
3998impl futures::stream::FusedStream for RealmRequestStream {
3999 fn is_terminated(&self) -> bool {
4000 self.is_terminated
4001 }
4002}
4003
4004impl fdomain_client::fidl::RequestStream for RealmRequestStream {
4005 type Protocol = RealmMarker;
4006 type ControlHandle = RealmControlHandle;
4007
4008 fn from_channel(channel: fdomain_client::Channel) -> Self {
4009 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4010 }
4011
4012 fn control_handle(&self) -> Self::ControlHandle {
4013 RealmControlHandle { inner: self.inner.clone() }
4014 }
4015
4016 fn into_inner(
4017 self,
4018 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4019 {
4020 (self.inner, self.is_terminated)
4021 }
4022
4023 fn from_inner(
4024 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4025 is_terminated: bool,
4026 ) -> Self {
4027 Self { inner, is_terminated }
4028 }
4029}
4030
4031impl futures::Stream for RealmRequestStream {
4032 type Item = Result<RealmRequest, fidl::Error>;
4033
4034 fn poll_next(
4035 mut self: std::pin::Pin<&mut Self>,
4036 cx: &mut std::task::Context<'_>,
4037 ) -> std::task::Poll<Option<Self::Item>> {
4038 let this = &mut *self;
4039 if this.inner.check_shutdown(cx) {
4040 this.is_terminated = true;
4041 return std::task::Poll::Ready(None);
4042 }
4043 if this.is_terminated {
4044 panic!("polled RealmRequestStream after completion");
4045 }
4046 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4047 |bytes, handles| {
4048 match this.inner.channel().read_etc(cx, bytes, handles) {
4049 std::task::Poll::Ready(Ok(())) => {}
4050 std::task::Poll::Pending => return std::task::Poll::Pending,
4051 std::task::Poll::Ready(Err(None)) => {
4052 this.is_terminated = true;
4053 return std::task::Poll::Ready(None);
4054 }
4055 std::task::Poll::Ready(Err(Some(e))) => {
4056 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4057 e.into(),
4058 ))))
4059 }
4060 }
4061
4062 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4064
4065 std::task::Poll::Ready(Some(match header.ordinal {
4066 0x7150b7898d1b1180 => {
4067 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4068 let mut req = fidl::new_empty!(
4069 RealmOpenControllerRequest,
4070 fdomain_client::fidl::FDomainResourceDialect
4071 );
4072 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmOpenControllerRequest>(&header, _body_bytes, handles, &mut req)?;
4073 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4074 Ok(RealmRequest::OpenController {
4075 child: req.child,
4076 controller: req.controller,
4077
4078 responder: RealmOpenControllerResponder {
4079 control_handle: std::mem::ManuallyDrop::new(control_handle),
4080 tx_id: header.tx_id,
4081 },
4082 })
4083 }
4084 0x7f993235ca59f92c => {
4085 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4086 let mut req = fidl::new_empty!(
4087 RealmOpenExposedDirRequest,
4088 fdomain_client::fidl::FDomainResourceDialect
4089 );
4090 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
4091 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4092 Ok(RealmRequest::OpenExposedDir {
4093 child: req.child,
4094 exposed_dir: req.exposed_dir,
4095
4096 responder: RealmOpenExposedDirResponder {
4097 control_handle: std::mem::ManuallyDrop::new(control_handle),
4098 tx_id: header.tx_id,
4099 },
4100 })
4101 }
4102 0x43e48ce8483d7560 => {
4103 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4104 let mut req = fidl::new_empty!(
4105 RealmCreateChildRequest,
4106 fdomain_client::fidl::FDomainResourceDialect
4107 );
4108 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmCreateChildRequest>(&header, _body_bytes, handles, &mut req)?;
4109 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4110 Ok(RealmRequest::CreateChild {
4111 collection: req.collection,
4112 decl: req.decl,
4113 args: req.args,
4114
4115 responder: RealmCreateChildResponder {
4116 control_handle: std::mem::ManuallyDrop::new(control_handle),
4117 tx_id: header.tx_id,
4118 },
4119 })
4120 }
4121 0x71d8caf8850c9222 => {
4122 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4123 let mut req = fidl::new_empty!(
4124 RealmDestroyChildRequest,
4125 fdomain_client::fidl::FDomainResourceDialect
4126 );
4127 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmDestroyChildRequest>(&header, _body_bytes, handles, &mut req)?;
4128 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4129 Ok(RealmRequest::DestroyChild {
4130 child: req.child,
4131
4132 responder: RealmDestroyChildResponder {
4133 control_handle: std::mem::ManuallyDrop::new(control_handle),
4134 tx_id: header.tx_id,
4135 },
4136 })
4137 }
4138 0x6888a76683efc0a1 => {
4139 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4140 let mut req = fidl::new_empty!(
4141 RealmListChildrenRequest,
4142 fdomain_client::fidl::FDomainResourceDialect
4143 );
4144 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmListChildrenRequest>(&header, _body_bytes, handles, &mut req)?;
4145 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4146 Ok(RealmRequest::ListChildren {
4147 collection: req.collection,
4148 iter: req.iter,
4149
4150 responder: RealmListChildrenResponder {
4151 control_handle: std::mem::ManuallyDrop::new(control_handle),
4152 tx_id: header.tx_id,
4153 },
4154 })
4155 }
4156 0x734f744cb7d210a2 => {
4157 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4158 let mut req = fidl::new_empty!(
4159 fidl::encoding::EmptyPayload,
4160 fdomain_client::fidl::FDomainResourceDialect
4161 );
4162 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4163 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4164 Ok(RealmRequest::GetResolvedInfo {
4165 responder: RealmGetResolvedInfoResponder {
4166 control_handle: std::mem::ManuallyDrop::new(control_handle),
4167 tx_id: header.tx_id,
4168 },
4169 })
4170 }
4171 0x4259d08d261d5610 => {
4172 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4173 let mut req = fidl::new_empty!(
4174 RealmGetChildOutputDictionaryRequest,
4175 fdomain_client::fidl::FDomainResourceDialect
4176 );
4177 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmGetChildOutputDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
4178 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4179 Ok(RealmRequest::GetChildOutputDictionary {
4180 child: req.child,
4181
4182 responder: RealmGetChildOutputDictionaryResponder {
4183 control_handle: std::mem::ManuallyDrop::new(control_handle),
4184 tx_id: header.tx_id,
4185 },
4186 })
4187 }
4188 _ => Err(fidl::Error::UnknownOrdinal {
4189 ordinal: header.ordinal,
4190 protocol_name:
4191 <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4192 }),
4193 }))
4194 },
4195 )
4196 }
4197}
4198
4199#[derive(Debug)]
4209pub enum RealmRequest {
4210 OpenController {
4217 child: fdomain_fuchsia_component_decl::ChildRef,
4218 controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4219 responder: RealmOpenControllerResponder,
4220 },
4221 OpenExposedDir {
4237 child: fdomain_fuchsia_component_decl::ChildRef,
4238 exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4239 responder: RealmOpenExposedDirResponder,
4240 },
4241 CreateChild {
4262 collection: fdomain_fuchsia_component_decl::CollectionRef,
4263 decl: fdomain_fuchsia_component_decl::Child,
4264 args: CreateChildArgs,
4265 responder: RealmCreateChildResponder,
4266 },
4267 DestroyChild {
4279 child: fdomain_fuchsia_component_decl::ChildRef,
4280 responder: RealmDestroyChildResponder,
4281 },
4282 ListChildren {
4296 collection: fdomain_fuchsia_component_decl::CollectionRef,
4297 iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
4298 responder: RealmListChildrenResponder,
4299 },
4300 GetResolvedInfo { responder: RealmGetResolvedInfoResponder },
4303 GetChildOutputDictionary {
4304 child: fdomain_fuchsia_component_decl::ChildRef,
4305 responder: RealmGetChildOutputDictionaryResponder,
4306 },
4307}
4308
4309impl RealmRequest {
4310 #[allow(irrefutable_let_patterns)]
4311 pub fn into_open_controller(
4312 self,
4313 ) -> Option<(
4314 fdomain_fuchsia_component_decl::ChildRef,
4315 fdomain_client::fidl::ServerEnd<ControllerMarker>,
4316 RealmOpenControllerResponder,
4317 )> {
4318 if let RealmRequest::OpenController { child, controller, responder } = self {
4319 Some((child, controller, responder))
4320 } else {
4321 None
4322 }
4323 }
4324
4325 #[allow(irrefutable_let_patterns)]
4326 pub fn into_open_exposed_dir(
4327 self,
4328 ) -> Option<(
4329 fdomain_fuchsia_component_decl::ChildRef,
4330 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4331 RealmOpenExposedDirResponder,
4332 )> {
4333 if let RealmRequest::OpenExposedDir { child, exposed_dir, responder } = self {
4334 Some((child, exposed_dir, responder))
4335 } else {
4336 None
4337 }
4338 }
4339
4340 #[allow(irrefutable_let_patterns)]
4341 pub fn into_create_child(
4342 self,
4343 ) -> Option<(
4344 fdomain_fuchsia_component_decl::CollectionRef,
4345 fdomain_fuchsia_component_decl::Child,
4346 CreateChildArgs,
4347 RealmCreateChildResponder,
4348 )> {
4349 if let RealmRequest::CreateChild { collection, decl, args, responder } = self {
4350 Some((collection, decl, args, responder))
4351 } else {
4352 None
4353 }
4354 }
4355
4356 #[allow(irrefutable_let_patterns)]
4357 pub fn into_destroy_child(
4358 self,
4359 ) -> Option<(fdomain_fuchsia_component_decl::ChildRef, RealmDestroyChildResponder)> {
4360 if let RealmRequest::DestroyChild { child, responder } = self {
4361 Some((child, responder))
4362 } else {
4363 None
4364 }
4365 }
4366
4367 #[allow(irrefutable_let_patterns)]
4368 pub fn into_list_children(
4369 self,
4370 ) -> Option<(
4371 fdomain_fuchsia_component_decl::CollectionRef,
4372 fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
4373 RealmListChildrenResponder,
4374 )> {
4375 if let RealmRequest::ListChildren { collection, iter, responder } = self {
4376 Some((collection, iter, responder))
4377 } else {
4378 None
4379 }
4380 }
4381
4382 #[allow(irrefutable_let_patterns)]
4383 pub fn into_get_resolved_info(self) -> Option<(RealmGetResolvedInfoResponder)> {
4384 if let RealmRequest::GetResolvedInfo { responder } = self {
4385 Some((responder))
4386 } else {
4387 None
4388 }
4389 }
4390
4391 #[allow(irrefutable_let_patterns)]
4392 pub fn into_get_child_output_dictionary(
4393 self,
4394 ) -> Option<(fdomain_fuchsia_component_decl::ChildRef, RealmGetChildOutputDictionaryResponder)>
4395 {
4396 if let RealmRequest::GetChildOutputDictionary { child, responder } = self {
4397 Some((child, responder))
4398 } else {
4399 None
4400 }
4401 }
4402
4403 pub fn method_name(&self) -> &'static str {
4405 match *self {
4406 RealmRequest::OpenController { .. } => "open_controller",
4407 RealmRequest::OpenExposedDir { .. } => "open_exposed_dir",
4408 RealmRequest::CreateChild { .. } => "create_child",
4409 RealmRequest::DestroyChild { .. } => "destroy_child",
4410 RealmRequest::ListChildren { .. } => "list_children",
4411 RealmRequest::GetResolvedInfo { .. } => "get_resolved_info",
4412 RealmRequest::GetChildOutputDictionary { .. } => "get_child_output_dictionary",
4413 }
4414 }
4415}
4416
4417#[derive(Debug, Clone)]
4418pub struct RealmControlHandle {
4419 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4420}
4421
4422impl fdomain_client::fidl::ControlHandle for RealmControlHandle {
4423 fn shutdown(&self) {
4424 self.inner.shutdown()
4425 }
4426
4427 fn is_closed(&self) -> bool {
4428 self.inner.channel().is_closed()
4429 }
4430 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4431 self.inner.channel().on_closed()
4432 }
4433}
4434
4435impl RealmControlHandle {}
4436
4437#[must_use = "FIDL methods require a response to be sent"]
4438#[derive(Debug)]
4439pub struct RealmOpenControllerResponder {
4440 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4441 tx_id: u32,
4442}
4443
4444impl std::ops::Drop for RealmOpenControllerResponder {
4448 fn drop(&mut self) {
4449 self.control_handle.shutdown();
4450 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4452 }
4453}
4454
4455impl fdomain_client::fidl::Responder for RealmOpenControllerResponder {
4456 type ControlHandle = RealmControlHandle;
4457
4458 fn control_handle(&self) -> &RealmControlHandle {
4459 &self.control_handle
4460 }
4461
4462 fn drop_without_shutdown(mut self) {
4463 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4465 std::mem::forget(self);
4467 }
4468}
4469
4470impl RealmOpenControllerResponder {
4471 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4475 let _result = self.send_raw(result);
4476 if _result.is_err() {
4477 self.control_handle.shutdown();
4478 }
4479 self.drop_without_shutdown();
4480 _result
4481 }
4482
4483 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4485 let _result = self.send_raw(result);
4486 self.drop_without_shutdown();
4487 _result
4488 }
4489
4490 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4491 self.control_handle
4492 .inner
4493 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4494 result,
4495 self.tx_id,
4496 0x7150b7898d1b1180,
4497 fidl::encoding::DynamicFlags::empty(),
4498 )
4499 }
4500}
4501
4502#[must_use = "FIDL methods require a response to be sent"]
4503#[derive(Debug)]
4504pub struct RealmOpenExposedDirResponder {
4505 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4506 tx_id: u32,
4507}
4508
4509impl std::ops::Drop for RealmOpenExposedDirResponder {
4513 fn drop(&mut self) {
4514 self.control_handle.shutdown();
4515 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4517 }
4518}
4519
4520impl fdomain_client::fidl::Responder for RealmOpenExposedDirResponder {
4521 type ControlHandle = RealmControlHandle;
4522
4523 fn control_handle(&self) -> &RealmControlHandle {
4524 &self.control_handle
4525 }
4526
4527 fn drop_without_shutdown(mut self) {
4528 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4530 std::mem::forget(self);
4532 }
4533}
4534
4535impl RealmOpenExposedDirResponder {
4536 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4540 let _result = self.send_raw(result);
4541 if _result.is_err() {
4542 self.control_handle.shutdown();
4543 }
4544 self.drop_without_shutdown();
4545 _result
4546 }
4547
4548 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4550 let _result = self.send_raw(result);
4551 self.drop_without_shutdown();
4552 _result
4553 }
4554
4555 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4556 self.control_handle
4557 .inner
4558 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4559 result,
4560 self.tx_id,
4561 0x7f993235ca59f92c,
4562 fidl::encoding::DynamicFlags::empty(),
4563 )
4564 }
4565}
4566
4567#[must_use = "FIDL methods require a response to be sent"]
4568#[derive(Debug)]
4569pub struct RealmCreateChildResponder {
4570 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4571 tx_id: u32,
4572}
4573
4574impl std::ops::Drop for RealmCreateChildResponder {
4578 fn drop(&mut self) {
4579 self.control_handle.shutdown();
4580 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4582 }
4583}
4584
4585impl fdomain_client::fidl::Responder for RealmCreateChildResponder {
4586 type ControlHandle = RealmControlHandle;
4587
4588 fn control_handle(&self) -> &RealmControlHandle {
4589 &self.control_handle
4590 }
4591
4592 fn drop_without_shutdown(mut self) {
4593 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4595 std::mem::forget(self);
4597 }
4598}
4599
4600impl RealmCreateChildResponder {
4601 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4605 let _result = self.send_raw(result);
4606 if _result.is_err() {
4607 self.control_handle.shutdown();
4608 }
4609 self.drop_without_shutdown();
4610 _result
4611 }
4612
4613 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4615 let _result = self.send_raw(result);
4616 self.drop_without_shutdown();
4617 _result
4618 }
4619
4620 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4621 self.control_handle
4622 .inner
4623 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4624 result,
4625 self.tx_id,
4626 0x43e48ce8483d7560,
4627 fidl::encoding::DynamicFlags::empty(),
4628 )
4629 }
4630}
4631
4632#[must_use = "FIDL methods require a response to be sent"]
4633#[derive(Debug)]
4634pub struct RealmDestroyChildResponder {
4635 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4636 tx_id: u32,
4637}
4638
4639impl std::ops::Drop for RealmDestroyChildResponder {
4643 fn drop(&mut self) {
4644 self.control_handle.shutdown();
4645 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4647 }
4648}
4649
4650impl fdomain_client::fidl::Responder for RealmDestroyChildResponder {
4651 type ControlHandle = RealmControlHandle;
4652
4653 fn control_handle(&self) -> &RealmControlHandle {
4654 &self.control_handle
4655 }
4656
4657 fn drop_without_shutdown(mut self) {
4658 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4660 std::mem::forget(self);
4662 }
4663}
4664
4665impl RealmDestroyChildResponder {
4666 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4670 let _result = self.send_raw(result);
4671 if _result.is_err() {
4672 self.control_handle.shutdown();
4673 }
4674 self.drop_without_shutdown();
4675 _result
4676 }
4677
4678 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4680 let _result = self.send_raw(result);
4681 self.drop_without_shutdown();
4682 _result
4683 }
4684
4685 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4686 self.control_handle
4687 .inner
4688 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4689 result,
4690 self.tx_id,
4691 0x71d8caf8850c9222,
4692 fidl::encoding::DynamicFlags::empty(),
4693 )
4694 }
4695}
4696
4697#[must_use = "FIDL methods require a response to be sent"]
4698#[derive(Debug)]
4699pub struct RealmListChildrenResponder {
4700 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4701 tx_id: u32,
4702}
4703
4704impl std::ops::Drop for RealmListChildrenResponder {
4708 fn drop(&mut self) {
4709 self.control_handle.shutdown();
4710 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4712 }
4713}
4714
4715impl fdomain_client::fidl::Responder for RealmListChildrenResponder {
4716 type ControlHandle = RealmControlHandle;
4717
4718 fn control_handle(&self) -> &RealmControlHandle {
4719 &self.control_handle
4720 }
4721
4722 fn drop_without_shutdown(mut self) {
4723 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4725 std::mem::forget(self);
4727 }
4728}
4729
4730impl RealmListChildrenResponder {
4731 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4735 let _result = self.send_raw(result);
4736 if _result.is_err() {
4737 self.control_handle.shutdown();
4738 }
4739 self.drop_without_shutdown();
4740 _result
4741 }
4742
4743 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4745 let _result = self.send_raw(result);
4746 self.drop_without_shutdown();
4747 _result
4748 }
4749
4750 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4751 self.control_handle
4752 .inner
4753 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4754 result,
4755 self.tx_id,
4756 0x6888a76683efc0a1,
4757 fidl::encoding::DynamicFlags::empty(),
4758 )
4759 }
4760}
4761
4762#[must_use = "FIDL methods require a response to be sent"]
4763#[derive(Debug)]
4764pub struct RealmGetResolvedInfoResponder {
4765 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4766 tx_id: u32,
4767}
4768
4769impl std::ops::Drop for RealmGetResolvedInfoResponder {
4773 fn drop(&mut self) {
4774 self.control_handle.shutdown();
4775 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4777 }
4778}
4779
4780impl fdomain_client::fidl::Responder for RealmGetResolvedInfoResponder {
4781 type ControlHandle = RealmControlHandle;
4782
4783 fn control_handle(&self) -> &RealmControlHandle {
4784 &self.control_handle
4785 }
4786
4787 fn drop_without_shutdown(mut self) {
4788 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4790 std::mem::forget(self);
4792 }
4793}
4794
4795impl RealmGetResolvedInfoResponder {
4796 pub fn send(
4800 self,
4801 mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
4802 ) -> Result<(), fidl::Error> {
4803 let _result = self.send_raw(result);
4804 if _result.is_err() {
4805 self.control_handle.shutdown();
4806 }
4807 self.drop_without_shutdown();
4808 _result
4809 }
4810
4811 pub fn send_no_shutdown_on_err(
4813 self,
4814 mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
4815 ) -> Result<(), fidl::Error> {
4816 let _result = self.send_raw(result);
4817 self.drop_without_shutdown();
4818 _result
4819 }
4820
4821 fn send_raw(
4822 &self,
4823 mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
4824 ) -> Result<(), fidl::Error> {
4825 self.control_handle
4826 .inner
4827 .send::<fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>>(
4828 result.as_mut().map_err(|e| *e).map(|resolved_info| (resolved_info,)),
4829 self.tx_id,
4830 0x734f744cb7d210a2,
4831 fidl::encoding::DynamicFlags::empty(),
4832 )
4833 }
4834}
4835
4836#[must_use = "FIDL methods require a response to be sent"]
4837#[derive(Debug)]
4838pub struct RealmGetChildOutputDictionaryResponder {
4839 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4840 tx_id: u32,
4841}
4842
4843impl std::ops::Drop for RealmGetChildOutputDictionaryResponder {
4847 fn drop(&mut self) {
4848 self.control_handle.shutdown();
4849 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4851 }
4852}
4853
4854impl fdomain_client::fidl::Responder for RealmGetChildOutputDictionaryResponder {
4855 type ControlHandle = RealmControlHandle;
4856
4857 fn control_handle(&self) -> &RealmControlHandle {
4858 &self.control_handle
4859 }
4860
4861 fn drop_without_shutdown(mut self) {
4862 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4864 std::mem::forget(self);
4866 }
4867}
4868
4869impl RealmGetChildOutputDictionaryResponder {
4870 pub fn send(
4874 self,
4875 mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
4876 ) -> Result<(), fidl::Error> {
4877 let _result = self.send_raw(result);
4878 if _result.is_err() {
4879 self.control_handle.shutdown();
4880 }
4881 self.drop_without_shutdown();
4882 _result
4883 }
4884
4885 pub fn send_no_shutdown_on_err(
4887 self,
4888 mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
4889 ) -> Result<(), fidl::Error> {
4890 let _result = self.send_raw(result);
4891 self.drop_without_shutdown();
4892 _result
4893 }
4894
4895 fn send_raw(
4896 &self,
4897 mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
4898 ) -> Result<(), fidl::Error> {
4899 self.control_handle.inner.send::<fidl::encoding::ResultType<
4900 RealmGetChildOutputDictionaryResponse,
4901 Error,
4902 >>(
4903 result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
4904 self.tx_id,
4905 0x4259d08d261d5610,
4906 fidl::encoding::DynamicFlags::empty(),
4907 )
4908 }
4909}
4910
4911mod internal {
4912 use super::*;
4913
4914 impl fidl::encoding::ResourceTypeMarker for ControllerStartRequest {
4915 type Borrowed<'a> = &'a mut Self;
4916 fn take_or_borrow<'a>(
4917 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4918 ) -> Self::Borrowed<'a> {
4919 value
4920 }
4921 }
4922
4923 unsafe impl fidl::encoding::TypeMarker for ControllerStartRequest {
4924 type Owned = Self;
4925
4926 #[inline(always)]
4927 fn inline_align(_context: fidl::encoding::Context) -> usize {
4928 8
4929 }
4930
4931 #[inline(always)]
4932 fn inline_size(_context: fidl::encoding::Context) -> usize {
4933 24
4934 }
4935 }
4936
4937 unsafe impl
4938 fidl::encoding::Encode<ControllerStartRequest, fdomain_client::fidl::FDomainResourceDialect>
4939 for &mut ControllerStartRequest
4940 {
4941 #[inline]
4942 unsafe fn encode(
4943 self,
4944 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
4945 offset: usize,
4946 _depth: fidl::encoding::Depth,
4947 ) -> fidl::Result<()> {
4948 encoder.debug_check_bounds::<ControllerStartRequest>(offset);
4949 fidl::encoding::Encode::<
4951 ControllerStartRequest,
4952 fdomain_client::fidl::FDomainResourceDialect,
4953 >::encode(
4954 (
4955 <StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4956 &mut self.args,
4957 ),
4958 <fidl::encoding::Endpoint<
4959 fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
4960 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4961 &mut self.execution_controller,
4962 ),
4963 ),
4964 encoder,
4965 offset,
4966 _depth,
4967 )
4968 }
4969 }
4970 unsafe impl<
4971 T0: fidl::encoding::Encode<StartChildArgs, fdomain_client::fidl::FDomainResourceDialect>,
4972 T1: fidl::encoding::Encode<
4973 fidl::encoding::Endpoint<
4974 fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
4975 >,
4976 fdomain_client::fidl::FDomainResourceDialect,
4977 >,
4978 >
4979 fidl::encoding::Encode<ControllerStartRequest, fdomain_client::fidl::FDomainResourceDialect>
4980 for (T0, T1)
4981 {
4982 #[inline]
4983 unsafe fn encode(
4984 self,
4985 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
4986 offset: usize,
4987 depth: fidl::encoding::Depth,
4988 ) -> fidl::Result<()> {
4989 encoder.debug_check_bounds::<ControllerStartRequest>(offset);
4990 unsafe {
4993 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4994 (ptr as *mut u64).write_unaligned(0);
4995 }
4996 self.0.encode(encoder, offset + 0, depth)?;
4998 self.1.encode(encoder, offset + 16, depth)?;
4999 Ok(())
5000 }
5001 }
5002
5003 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5004 for ControllerStartRequest
5005 {
5006 #[inline(always)]
5007 fn new_empty() -> Self {
5008 Self {
5009 args: fidl::new_empty!(
5010 StartChildArgs,
5011 fdomain_client::fidl::FDomainResourceDialect
5012 ),
5013 execution_controller: fidl::new_empty!(
5014 fidl::encoding::Endpoint<
5015 fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
5016 >,
5017 fdomain_client::fidl::FDomainResourceDialect
5018 ),
5019 }
5020 }
5021
5022 #[inline]
5023 unsafe fn decode(
5024 &mut self,
5025 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5026 offset: usize,
5027 _depth: fidl::encoding::Depth,
5028 ) -> fidl::Result<()> {
5029 decoder.debug_check_bounds::<Self>(offset);
5030 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5032 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5033 let mask = 0xffffffff00000000u64;
5034 let maskedval = padval & mask;
5035 if maskedval != 0 {
5036 return Err(fidl::Error::NonZeroPadding {
5037 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5038 });
5039 }
5040 fidl::decode!(
5041 StartChildArgs,
5042 fdomain_client::fidl::FDomainResourceDialect,
5043 &mut self.args,
5044 decoder,
5045 offset + 0,
5046 _depth
5047 )?;
5048 fidl::decode!(
5049 fidl::encoding::Endpoint<
5050 fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
5051 >,
5052 fdomain_client::fidl::FDomainResourceDialect,
5053 &mut self.execution_controller,
5054 decoder,
5055 offset + 16,
5056 _depth
5057 )?;
5058 Ok(())
5059 }
5060 }
5061
5062 impl fidl::encoding::ResourceTypeMarker for ControllerGetExposedDictionaryResponse {
5063 type Borrowed<'a> = &'a mut Self;
5064 fn take_or_borrow<'a>(
5065 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5066 ) -> Self::Borrowed<'a> {
5067 value
5068 }
5069 }
5070
5071 unsafe impl fidl::encoding::TypeMarker for ControllerGetExposedDictionaryResponse {
5072 type Owned = Self;
5073
5074 #[inline(always)]
5075 fn inline_align(_context: fidl::encoding::Context) -> usize {
5076 4
5077 }
5078
5079 #[inline(always)]
5080 fn inline_size(_context: fidl::encoding::Context) -> usize {
5081 4
5082 }
5083 }
5084
5085 unsafe impl
5086 fidl::encoding::Encode<
5087 ControllerGetExposedDictionaryResponse,
5088 fdomain_client::fidl::FDomainResourceDialect,
5089 > for &mut ControllerGetExposedDictionaryResponse
5090 {
5091 #[inline]
5092 unsafe fn encode(
5093 self,
5094 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5095 offset: usize,
5096 _depth: fidl::encoding::Depth,
5097 ) -> fidl::Result<()> {
5098 encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
5099 fidl::encoding::Encode::<ControllerGetExposedDictionaryResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
5101 (
5102 <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
5103 ),
5104 encoder, offset, _depth
5105 )
5106 }
5107 }
5108 unsafe impl<
5109 T0: fidl::encoding::Encode<
5110 fdomain_fuchsia_component_sandbox::DictionaryRef,
5111 fdomain_client::fidl::FDomainResourceDialect,
5112 >,
5113 >
5114 fidl::encoding::Encode<
5115 ControllerGetExposedDictionaryResponse,
5116 fdomain_client::fidl::FDomainResourceDialect,
5117 > for (T0,)
5118 {
5119 #[inline]
5120 unsafe fn encode(
5121 self,
5122 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5123 offset: usize,
5124 depth: fidl::encoding::Depth,
5125 ) -> fidl::Result<()> {
5126 encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
5127 self.0.encode(encoder, offset + 0, depth)?;
5131 Ok(())
5132 }
5133 }
5134
5135 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5136 for ControllerGetExposedDictionaryResponse
5137 {
5138 #[inline(always)]
5139 fn new_empty() -> Self {
5140 Self {
5141 dictionary: fidl::new_empty!(
5142 fdomain_fuchsia_component_sandbox::DictionaryRef,
5143 fdomain_client::fidl::FDomainResourceDialect
5144 ),
5145 }
5146 }
5147
5148 #[inline]
5149 unsafe fn decode(
5150 &mut self,
5151 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5152 offset: usize,
5153 _depth: fidl::encoding::Depth,
5154 ) -> fidl::Result<()> {
5155 decoder.debug_check_bounds::<Self>(offset);
5156 fidl::decode!(
5158 fdomain_fuchsia_component_sandbox::DictionaryRef,
5159 fdomain_client::fidl::FDomainResourceDialect,
5160 &mut self.dictionary,
5161 decoder,
5162 offset + 0,
5163 _depth
5164 )?;
5165 Ok(())
5166 }
5167 }
5168
5169 impl fidl::encoding::ResourceTypeMarker for ControllerIsStartedResponse {
5170 type Borrowed<'a> = &'a mut Self;
5171 fn take_or_borrow<'a>(
5172 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5173 ) -> Self::Borrowed<'a> {
5174 value
5175 }
5176 }
5177
5178 unsafe impl fidl::encoding::TypeMarker for ControllerIsStartedResponse {
5179 type Owned = Self;
5180
5181 #[inline(always)]
5182 fn inline_align(_context: fidl::encoding::Context) -> usize {
5183 1
5184 }
5185
5186 #[inline(always)]
5187 fn inline_size(_context: fidl::encoding::Context) -> usize {
5188 1
5189 }
5190 }
5191
5192 unsafe impl
5193 fidl::encoding::Encode<
5194 ControllerIsStartedResponse,
5195 fdomain_client::fidl::FDomainResourceDialect,
5196 > for &mut ControllerIsStartedResponse
5197 {
5198 #[inline]
5199 unsafe fn encode(
5200 self,
5201 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5202 offset: usize,
5203 _depth: fidl::encoding::Depth,
5204 ) -> fidl::Result<()> {
5205 encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
5206 fidl::encoding::Encode::<
5208 ControllerIsStartedResponse,
5209 fdomain_client::fidl::FDomainResourceDialect,
5210 >::encode(
5211 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_started),),
5212 encoder,
5213 offset,
5214 _depth,
5215 )
5216 }
5217 }
5218 unsafe impl<T0: fidl::encoding::Encode<bool, fdomain_client::fidl::FDomainResourceDialect>>
5219 fidl::encoding::Encode<
5220 ControllerIsStartedResponse,
5221 fdomain_client::fidl::FDomainResourceDialect,
5222 > for (T0,)
5223 {
5224 #[inline]
5225 unsafe fn encode(
5226 self,
5227 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5228 offset: usize,
5229 depth: fidl::encoding::Depth,
5230 ) -> fidl::Result<()> {
5231 encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
5232 self.0.encode(encoder, offset + 0, depth)?;
5236 Ok(())
5237 }
5238 }
5239
5240 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5241 for ControllerIsStartedResponse
5242 {
5243 #[inline(always)]
5244 fn new_empty() -> Self {
5245 Self {
5246 is_started: fidl::new_empty!(bool, fdomain_client::fidl::FDomainResourceDialect),
5247 }
5248 }
5249
5250 #[inline]
5251 unsafe fn decode(
5252 &mut self,
5253 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5254 offset: usize,
5255 _depth: fidl::encoding::Depth,
5256 ) -> fidl::Result<()> {
5257 decoder.debug_check_bounds::<Self>(offset);
5258 fidl::decode!(
5260 bool,
5261 fdomain_client::fidl::FDomainResourceDialect,
5262 &mut self.is_started,
5263 decoder,
5264 offset + 0,
5265 _depth
5266 )?;
5267 Ok(())
5268 }
5269 }
5270
5271 impl fidl::encoding::ResourceTypeMarker for EventStreamGetNextResponse {
5272 type Borrowed<'a> = &'a mut Self;
5273 fn take_or_borrow<'a>(
5274 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5275 ) -> Self::Borrowed<'a> {
5276 value
5277 }
5278 }
5279
5280 unsafe impl fidl::encoding::TypeMarker for EventStreamGetNextResponse {
5281 type Owned = Self;
5282
5283 #[inline(always)]
5284 fn inline_align(_context: fidl::encoding::Context) -> usize {
5285 8
5286 }
5287
5288 #[inline(always)]
5289 fn inline_size(_context: fidl::encoding::Context) -> usize {
5290 16
5291 }
5292 }
5293
5294 unsafe impl
5295 fidl::encoding::Encode<
5296 EventStreamGetNextResponse,
5297 fdomain_client::fidl::FDomainResourceDialect,
5298 > for &mut EventStreamGetNextResponse
5299 {
5300 #[inline]
5301 unsafe fn encode(
5302 self,
5303 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5304 offset: usize,
5305 _depth: fidl::encoding::Depth,
5306 ) -> fidl::Result<()> {
5307 encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
5308 fidl::encoding::Encode::<EventStreamGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
5310 (
5311 <fidl::encoding::UnboundedVector<Event> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
5312 ),
5313 encoder, offset, _depth
5314 )
5315 }
5316 }
5317 unsafe impl<
5318 T0: fidl::encoding::Encode<
5319 fidl::encoding::UnboundedVector<Event>,
5320 fdomain_client::fidl::FDomainResourceDialect,
5321 >,
5322 >
5323 fidl::encoding::Encode<
5324 EventStreamGetNextResponse,
5325 fdomain_client::fidl::FDomainResourceDialect,
5326 > for (T0,)
5327 {
5328 #[inline]
5329 unsafe fn encode(
5330 self,
5331 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5332 offset: usize,
5333 depth: fidl::encoding::Depth,
5334 ) -> fidl::Result<()> {
5335 encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
5336 self.0.encode(encoder, offset + 0, depth)?;
5340 Ok(())
5341 }
5342 }
5343
5344 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5345 for EventStreamGetNextResponse
5346 {
5347 #[inline(always)]
5348 fn new_empty() -> Self {
5349 Self {
5350 events: fidl::new_empty!(
5351 fidl::encoding::UnboundedVector<Event>,
5352 fdomain_client::fidl::FDomainResourceDialect
5353 ),
5354 }
5355 }
5356
5357 #[inline]
5358 unsafe fn decode(
5359 &mut self,
5360 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5361 offset: usize,
5362 _depth: fidl::encoding::Depth,
5363 ) -> fidl::Result<()> {
5364 decoder.debug_check_bounds::<Self>(offset);
5365 fidl::decode!(
5367 fidl::encoding::UnboundedVector<Event>,
5368 fdomain_client::fidl::FDomainResourceDialect,
5369 &mut self.events,
5370 decoder,
5371 offset + 0,
5372 _depth
5373 )?;
5374 Ok(())
5375 }
5376 }
5377
5378 impl fidl::encoding::ResourceTypeMarker for IntrospectorGetMonikerRequest {
5379 type Borrowed<'a> = &'a mut Self;
5380 fn take_or_borrow<'a>(
5381 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5382 ) -> Self::Borrowed<'a> {
5383 value
5384 }
5385 }
5386
5387 unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerRequest {
5388 type Owned = Self;
5389
5390 #[inline(always)]
5391 fn inline_align(_context: fidl::encoding::Context) -> usize {
5392 4
5393 }
5394
5395 #[inline(always)]
5396 fn inline_size(_context: fidl::encoding::Context) -> usize {
5397 4
5398 }
5399 }
5400
5401 unsafe impl
5402 fidl::encoding::Encode<
5403 IntrospectorGetMonikerRequest,
5404 fdomain_client::fidl::FDomainResourceDialect,
5405 > for &mut IntrospectorGetMonikerRequest
5406 {
5407 #[inline]
5408 unsafe fn encode(
5409 self,
5410 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5411 offset: usize,
5412 _depth: fidl::encoding::Depth,
5413 ) -> fidl::Result<()> {
5414 encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
5415 fidl::encoding::Encode::<
5417 IntrospectorGetMonikerRequest,
5418 fdomain_client::fidl::FDomainResourceDialect,
5419 >::encode(
5420 (<fidl::encoding::HandleType<
5421 fdomain_client::Event,
5422 { fidl::ObjectType::EVENT.into_raw() },
5423 2147483648,
5424 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5425 &mut self.component_instance,
5426 ),),
5427 encoder,
5428 offset,
5429 _depth,
5430 )
5431 }
5432 }
5433 unsafe impl<
5434 T0: fidl::encoding::Encode<
5435 fidl::encoding::HandleType<
5436 fdomain_client::Event,
5437 { fidl::ObjectType::EVENT.into_raw() },
5438 2147483648,
5439 >,
5440 fdomain_client::fidl::FDomainResourceDialect,
5441 >,
5442 >
5443 fidl::encoding::Encode<
5444 IntrospectorGetMonikerRequest,
5445 fdomain_client::fidl::FDomainResourceDialect,
5446 > for (T0,)
5447 {
5448 #[inline]
5449 unsafe fn encode(
5450 self,
5451 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5452 offset: usize,
5453 depth: fidl::encoding::Depth,
5454 ) -> fidl::Result<()> {
5455 encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
5456 self.0.encode(encoder, offset + 0, depth)?;
5460 Ok(())
5461 }
5462 }
5463
5464 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5465 for IntrospectorGetMonikerRequest
5466 {
5467 #[inline(always)]
5468 fn new_empty() -> Self {
5469 Self {
5470 component_instance: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
5471 }
5472 }
5473
5474 #[inline]
5475 unsafe fn decode(
5476 &mut self,
5477 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5478 offset: usize,
5479 _depth: fidl::encoding::Depth,
5480 ) -> fidl::Result<()> {
5481 decoder.debug_check_bounds::<Self>(offset);
5482 fidl::decode!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.component_instance, decoder, offset + 0, _depth)?;
5484 Ok(())
5485 }
5486 }
5487
5488 impl fidl::encoding::ResourceTypeMarker for NamespaceCreateRequest {
5489 type Borrowed<'a> = &'a mut Self;
5490 fn take_or_borrow<'a>(
5491 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5492 ) -> Self::Borrowed<'a> {
5493 value
5494 }
5495 }
5496
5497 unsafe impl fidl::encoding::TypeMarker for NamespaceCreateRequest {
5498 type Owned = Self;
5499
5500 #[inline(always)]
5501 fn inline_align(_context: fidl::encoding::Context) -> usize {
5502 8
5503 }
5504
5505 #[inline(always)]
5506 fn inline_size(_context: fidl::encoding::Context) -> usize {
5507 16
5508 }
5509 }
5510
5511 unsafe impl
5512 fidl::encoding::Encode<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>
5513 for &mut NamespaceCreateRequest
5514 {
5515 #[inline]
5516 unsafe fn encode(
5517 self,
5518 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5519 offset: usize,
5520 _depth: fidl::encoding::Depth,
5521 ) -> fidl::Result<()> {
5522 encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
5523 fidl::encoding::Encode::<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
5525 (
5526 <fidl::encoding::UnboundedVector<NamespaceInputEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
5527 ),
5528 encoder, offset, _depth
5529 )
5530 }
5531 }
5532 unsafe impl<
5533 T0: fidl::encoding::Encode<
5534 fidl::encoding::UnboundedVector<NamespaceInputEntry>,
5535 fdomain_client::fidl::FDomainResourceDialect,
5536 >,
5537 >
5538 fidl::encoding::Encode<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>
5539 for (T0,)
5540 {
5541 #[inline]
5542 unsafe fn encode(
5543 self,
5544 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5545 offset: usize,
5546 depth: fidl::encoding::Depth,
5547 ) -> fidl::Result<()> {
5548 encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
5549 self.0.encode(encoder, offset + 0, depth)?;
5553 Ok(())
5554 }
5555 }
5556
5557 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5558 for NamespaceCreateRequest
5559 {
5560 #[inline(always)]
5561 fn new_empty() -> Self {
5562 Self {
5563 entries: fidl::new_empty!(
5564 fidl::encoding::UnboundedVector<NamespaceInputEntry>,
5565 fdomain_client::fidl::FDomainResourceDialect
5566 ),
5567 }
5568 }
5569
5570 #[inline]
5571 unsafe fn decode(
5572 &mut self,
5573 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5574 offset: usize,
5575 _depth: fidl::encoding::Depth,
5576 ) -> fidl::Result<()> {
5577 decoder.debug_check_bounds::<Self>(offset);
5578 fidl::decode!(
5580 fidl::encoding::UnboundedVector<NamespaceInputEntry>,
5581 fdomain_client::fidl::FDomainResourceDialect,
5582 &mut self.entries,
5583 decoder,
5584 offset + 0,
5585 _depth
5586 )?;
5587 Ok(())
5588 }
5589 }
5590
5591 impl fidl::encoding::ResourceTypeMarker for NamespaceInputEntry {
5592 type Borrowed<'a> = &'a mut Self;
5593 fn take_or_borrow<'a>(
5594 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5595 ) -> Self::Borrowed<'a> {
5596 value
5597 }
5598 }
5599
5600 unsafe impl fidl::encoding::TypeMarker for NamespaceInputEntry {
5601 type Owned = Self;
5602
5603 #[inline(always)]
5604 fn inline_align(_context: fidl::encoding::Context) -> usize {
5605 8
5606 }
5607
5608 #[inline(always)]
5609 fn inline_size(_context: fidl::encoding::Context) -> usize {
5610 24
5611 }
5612 }
5613
5614 unsafe impl
5615 fidl::encoding::Encode<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>
5616 for &mut NamespaceInputEntry
5617 {
5618 #[inline]
5619 unsafe fn encode(
5620 self,
5621 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5622 offset: usize,
5623 _depth: fidl::encoding::Depth,
5624 ) -> fidl::Result<()> {
5625 encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
5626 fidl::encoding::Encode::<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>::encode(
5628 (
5629 <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
5630 <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_component_sandbox::DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
5631 ),
5632 encoder, offset, _depth
5633 )
5634 }
5635 }
5636 unsafe impl<
5637 T0: fidl::encoding::Encode<
5638 fidl::encoding::BoundedString<4095>,
5639 fdomain_client::fidl::FDomainResourceDialect,
5640 >,
5641 T1: fidl::encoding::Encode<
5642 fidl::encoding::Endpoint<
5643 fdomain_client::fidl::ClientEnd<
5644 fdomain_fuchsia_component_sandbox::DictionaryMarker,
5645 >,
5646 >,
5647 fdomain_client::fidl::FDomainResourceDialect,
5648 >,
5649 >
5650 fidl::encoding::Encode<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>
5651 for (T0, T1)
5652 {
5653 #[inline]
5654 unsafe fn encode(
5655 self,
5656 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5657 offset: usize,
5658 depth: fidl::encoding::Depth,
5659 ) -> fidl::Result<()> {
5660 encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
5661 unsafe {
5664 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5665 (ptr as *mut u64).write_unaligned(0);
5666 }
5667 self.0.encode(encoder, offset + 0, depth)?;
5669 self.1.encode(encoder, offset + 16, depth)?;
5670 Ok(())
5671 }
5672 }
5673
5674 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5675 for NamespaceInputEntry
5676 {
5677 #[inline(always)]
5678 fn new_empty() -> Self {
5679 Self {
5680 path: fidl::new_empty!(
5681 fidl::encoding::BoundedString<4095>,
5682 fdomain_client::fidl::FDomainResourceDialect
5683 ),
5684 dictionary: fidl::new_empty!(
5685 fidl::encoding::Endpoint<
5686 fdomain_client::fidl::ClientEnd<
5687 fdomain_fuchsia_component_sandbox::DictionaryMarker,
5688 >,
5689 >,
5690 fdomain_client::fidl::FDomainResourceDialect
5691 ),
5692 }
5693 }
5694
5695 #[inline]
5696 unsafe fn decode(
5697 &mut self,
5698 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5699 offset: usize,
5700 _depth: fidl::encoding::Depth,
5701 ) -> fidl::Result<()> {
5702 decoder.debug_check_bounds::<Self>(offset);
5703 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5705 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5706 let mask = 0xffffffff00000000u64;
5707 let maskedval = padval & mask;
5708 if maskedval != 0 {
5709 return Err(fidl::Error::NonZeroPadding {
5710 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5711 });
5712 }
5713 fidl::decode!(
5714 fidl::encoding::BoundedString<4095>,
5715 fdomain_client::fidl::FDomainResourceDialect,
5716 &mut self.path,
5717 decoder,
5718 offset + 0,
5719 _depth
5720 )?;
5721 fidl::decode!(
5722 fidl::encoding::Endpoint<
5723 fdomain_client::fidl::ClientEnd<
5724 fdomain_fuchsia_component_sandbox::DictionaryMarker,
5725 >,
5726 >,
5727 fdomain_client::fidl::FDomainResourceDialect,
5728 &mut self.dictionary,
5729 decoder,
5730 offset + 16,
5731 _depth
5732 )?;
5733 Ok(())
5734 }
5735 }
5736
5737 impl fidl::encoding::ResourceTypeMarker for NamespaceCreateResponse {
5738 type Borrowed<'a> = &'a mut Self;
5739 fn take_or_borrow<'a>(
5740 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5741 ) -> Self::Borrowed<'a> {
5742 value
5743 }
5744 }
5745
5746 unsafe impl fidl::encoding::TypeMarker for NamespaceCreateResponse {
5747 type Owned = Self;
5748
5749 #[inline(always)]
5750 fn inline_align(_context: fidl::encoding::Context) -> usize {
5751 8
5752 }
5753
5754 #[inline(always)]
5755 fn inline_size(_context: fidl::encoding::Context) -> usize {
5756 16
5757 }
5758 }
5759
5760 unsafe impl
5761 fidl::encoding::Encode<
5762 NamespaceCreateResponse,
5763 fdomain_client::fidl::FDomainResourceDialect,
5764 > for &mut NamespaceCreateResponse
5765 {
5766 #[inline]
5767 unsafe fn encode(
5768 self,
5769 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5770 offset: usize,
5771 _depth: fidl::encoding::Depth,
5772 ) -> fidl::Result<()> {
5773 encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
5774 fidl::encoding::Encode::<NamespaceCreateResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
5776 (
5777 <fidl::encoding::UnboundedVector<NamespaceEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
5778 ),
5779 encoder, offset, _depth
5780 )
5781 }
5782 }
5783 unsafe impl<
5784 T0: fidl::encoding::Encode<
5785 fidl::encoding::UnboundedVector<NamespaceEntry>,
5786 fdomain_client::fidl::FDomainResourceDialect,
5787 >,
5788 >
5789 fidl::encoding::Encode<
5790 NamespaceCreateResponse,
5791 fdomain_client::fidl::FDomainResourceDialect,
5792 > for (T0,)
5793 {
5794 #[inline]
5795 unsafe fn encode(
5796 self,
5797 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5798 offset: usize,
5799 depth: fidl::encoding::Depth,
5800 ) -> fidl::Result<()> {
5801 encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
5802 self.0.encode(encoder, offset + 0, depth)?;
5806 Ok(())
5807 }
5808 }
5809
5810 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5811 for NamespaceCreateResponse
5812 {
5813 #[inline(always)]
5814 fn new_empty() -> Self {
5815 Self {
5816 entries: fidl::new_empty!(
5817 fidl::encoding::UnboundedVector<NamespaceEntry>,
5818 fdomain_client::fidl::FDomainResourceDialect
5819 ),
5820 }
5821 }
5822
5823 #[inline]
5824 unsafe fn decode(
5825 &mut self,
5826 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5827 offset: usize,
5828 _depth: fidl::encoding::Depth,
5829 ) -> fidl::Result<()> {
5830 decoder.debug_check_bounds::<Self>(offset);
5831 fidl::decode!(
5833 fidl::encoding::UnboundedVector<NamespaceEntry>,
5834 fdomain_client::fidl::FDomainResourceDialect,
5835 &mut self.entries,
5836 decoder,
5837 offset + 0,
5838 _depth
5839 )?;
5840 Ok(())
5841 }
5842 }
5843
5844 impl fidl::encoding::ResourceTypeMarker for RealmCreateChildRequest {
5845 type Borrowed<'a> = &'a mut Self;
5846 fn take_or_borrow<'a>(
5847 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5848 ) -> Self::Borrowed<'a> {
5849 value
5850 }
5851 }
5852
5853 unsafe impl fidl::encoding::TypeMarker for RealmCreateChildRequest {
5854 type Owned = Self;
5855
5856 #[inline(always)]
5857 fn inline_align(_context: fidl::encoding::Context) -> usize {
5858 8
5859 }
5860
5861 #[inline(always)]
5862 fn inline_size(_context: fidl::encoding::Context) -> usize {
5863 48
5864 }
5865 }
5866
5867 unsafe impl
5868 fidl::encoding::Encode<
5869 RealmCreateChildRequest,
5870 fdomain_client::fidl::FDomainResourceDialect,
5871 > for &mut RealmCreateChildRequest
5872 {
5873 #[inline]
5874 unsafe fn encode(
5875 self,
5876 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5877 offset: usize,
5878 _depth: fidl::encoding::Depth,
5879 ) -> fidl::Result<()> {
5880 encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
5881 fidl::encoding::Encode::<RealmCreateChildRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
5883 (
5884 <fdomain_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
5885 <fdomain_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
5886 <CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
5887 ),
5888 encoder, offset, _depth
5889 )
5890 }
5891 }
5892 unsafe impl<
5893 T0: fidl::encoding::Encode<
5894 fdomain_fuchsia_component_decl::CollectionRef,
5895 fdomain_client::fidl::FDomainResourceDialect,
5896 >,
5897 T1: fidl::encoding::Encode<
5898 fdomain_fuchsia_component_decl::Child,
5899 fdomain_client::fidl::FDomainResourceDialect,
5900 >,
5901 T2: fidl::encoding::Encode<CreateChildArgs, fdomain_client::fidl::FDomainResourceDialect>,
5902 >
5903 fidl::encoding::Encode<
5904 RealmCreateChildRequest,
5905 fdomain_client::fidl::FDomainResourceDialect,
5906 > for (T0, T1, T2)
5907 {
5908 #[inline]
5909 unsafe fn encode(
5910 self,
5911 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5912 offset: usize,
5913 depth: fidl::encoding::Depth,
5914 ) -> fidl::Result<()> {
5915 encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
5916 self.0.encode(encoder, offset + 0, depth)?;
5920 self.1.encode(encoder, offset + 16, depth)?;
5921 self.2.encode(encoder, offset + 32, depth)?;
5922 Ok(())
5923 }
5924 }
5925
5926 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
5927 for RealmCreateChildRequest
5928 {
5929 #[inline(always)]
5930 fn new_empty() -> Self {
5931 Self {
5932 collection: fidl::new_empty!(
5933 fdomain_fuchsia_component_decl::CollectionRef,
5934 fdomain_client::fidl::FDomainResourceDialect
5935 ),
5936 decl: fidl::new_empty!(
5937 fdomain_fuchsia_component_decl::Child,
5938 fdomain_client::fidl::FDomainResourceDialect
5939 ),
5940 args: fidl::new_empty!(
5941 CreateChildArgs,
5942 fdomain_client::fidl::FDomainResourceDialect
5943 ),
5944 }
5945 }
5946
5947 #[inline]
5948 unsafe fn decode(
5949 &mut self,
5950 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
5951 offset: usize,
5952 _depth: fidl::encoding::Depth,
5953 ) -> fidl::Result<()> {
5954 decoder.debug_check_bounds::<Self>(offset);
5955 fidl::decode!(
5957 fdomain_fuchsia_component_decl::CollectionRef,
5958 fdomain_client::fidl::FDomainResourceDialect,
5959 &mut self.collection,
5960 decoder,
5961 offset + 0,
5962 _depth
5963 )?;
5964 fidl::decode!(
5965 fdomain_fuchsia_component_decl::Child,
5966 fdomain_client::fidl::FDomainResourceDialect,
5967 &mut self.decl,
5968 decoder,
5969 offset + 16,
5970 _depth
5971 )?;
5972 fidl::decode!(
5973 CreateChildArgs,
5974 fdomain_client::fidl::FDomainResourceDialect,
5975 &mut self.args,
5976 decoder,
5977 offset + 32,
5978 _depth
5979 )?;
5980 Ok(())
5981 }
5982 }
5983
5984 impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryRequest {
5985 type Borrowed<'a> = &'a mut Self;
5986 fn take_or_borrow<'a>(
5987 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5988 ) -> Self::Borrowed<'a> {
5989 value
5990 }
5991 }
5992
5993 unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryRequest {
5994 type Owned = Self;
5995
5996 #[inline(always)]
5997 fn inline_align(_context: fidl::encoding::Context) -> usize {
5998 8
5999 }
6000
6001 #[inline(always)]
6002 fn inline_size(_context: fidl::encoding::Context) -> usize {
6003 32
6004 }
6005 }
6006
6007 unsafe impl
6008 fidl::encoding::Encode<
6009 RealmGetChildOutputDictionaryRequest,
6010 fdomain_client::fidl::FDomainResourceDialect,
6011 > for &mut RealmGetChildOutputDictionaryRequest
6012 {
6013 #[inline]
6014 unsafe fn encode(
6015 self,
6016 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6017 offset: usize,
6018 _depth: fidl::encoding::Depth,
6019 ) -> fidl::Result<()> {
6020 encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
6021 fidl::encoding::Encode::<RealmGetChildOutputDictionaryRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
6023 (
6024 <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
6025 ),
6026 encoder, offset, _depth
6027 )
6028 }
6029 }
6030 unsafe impl<
6031 T0: fidl::encoding::Encode<
6032 fdomain_fuchsia_component_decl::ChildRef,
6033 fdomain_client::fidl::FDomainResourceDialect,
6034 >,
6035 >
6036 fidl::encoding::Encode<
6037 RealmGetChildOutputDictionaryRequest,
6038 fdomain_client::fidl::FDomainResourceDialect,
6039 > for (T0,)
6040 {
6041 #[inline]
6042 unsafe fn encode(
6043 self,
6044 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6045 offset: usize,
6046 depth: fidl::encoding::Depth,
6047 ) -> fidl::Result<()> {
6048 encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
6049 self.0.encode(encoder, offset + 0, depth)?;
6053 Ok(())
6054 }
6055 }
6056
6057 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6058 for RealmGetChildOutputDictionaryRequest
6059 {
6060 #[inline(always)]
6061 fn new_empty() -> Self {
6062 Self {
6063 child: fidl::new_empty!(
6064 fdomain_fuchsia_component_decl::ChildRef,
6065 fdomain_client::fidl::FDomainResourceDialect
6066 ),
6067 }
6068 }
6069
6070 #[inline]
6071 unsafe fn decode(
6072 &mut self,
6073 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6074 offset: usize,
6075 _depth: fidl::encoding::Depth,
6076 ) -> fidl::Result<()> {
6077 decoder.debug_check_bounds::<Self>(offset);
6078 fidl::decode!(
6080 fdomain_fuchsia_component_decl::ChildRef,
6081 fdomain_client::fidl::FDomainResourceDialect,
6082 &mut self.child,
6083 decoder,
6084 offset + 0,
6085 _depth
6086 )?;
6087 Ok(())
6088 }
6089 }
6090
6091 impl fidl::encoding::ResourceTypeMarker for RealmListChildrenRequest {
6092 type Borrowed<'a> = &'a mut Self;
6093 fn take_or_borrow<'a>(
6094 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6095 ) -> Self::Borrowed<'a> {
6096 value
6097 }
6098 }
6099
6100 unsafe impl fidl::encoding::TypeMarker for RealmListChildrenRequest {
6101 type Owned = Self;
6102
6103 #[inline(always)]
6104 fn inline_align(_context: fidl::encoding::Context) -> usize {
6105 8
6106 }
6107
6108 #[inline(always)]
6109 fn inline_size(_context: fidl::encoding::Context) -> usize {
6110 24
6111 }
6112 }
6113
6114 unsafe impl
6115 fidl::encoding::Encode<
6116 RealmListChildrenRequest,
6117 fdomain_client::fidl::FDomainResourceDialect,
6118 > for &mut RealmListChildrenRequest
6119 {
6120 #[inline]
6121 unsafe fn encode(
6122 self,
6123 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6124 offset: usize,
6125 _depth: fidl::encoding::Depth,
6126 ) -> fidl::Result<()> {
6127 encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
6128 fidl::encoding::Encode::<RealmListChildrenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
6130 (
6131 <fdomain_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
6132 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iter),
6133 ),
6134 encoder, offset, _depth
6135 )
6136 }
6137 }
6138 unsafe impl<
6139 T0: fidl::encoding::Encode<
6140 fdomain_fuchsia_component_decl::CollectionRef,
6141 fdomain_client::fidl::FDomainResourceDialect,
6142 >,
6143 T1: fidl::encoding::Encode<
6144 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
6145 fdomain_client::fidl::FDomainResourceDialect,
6146 >,
6147 >
6148 fidl::encoding::Encode<
6149 RealmListChildrenRequest,
6150 fdomain_client::fidl::FDomainResourceDialect,
6151 > for (T0, T1)
6152 {
6153 #[inline]
6154 unsafe fn encode(
6155 self,
6156 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6157 offset: usize,
6158 depth: fidl::encoding::Depth,
6159 ) -> fidl::Result<()> {
6160 encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
6161 unsafe {
6164 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
6165 (ptr as *mut u64).write_unaligned(0);
6166 }
6167 self.0.encode(encoder, offset + 0, depth)?;
6169 self.1.encode(encoder, offset + 16, depth)?;
6170 Ok(())
6171 }
6172 }
6173
6174 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6175 for RealmListChildrenRequest
6176 {
6177 #[inline(always)]
6178 fn new_empty() -> Self {
6179 Self {
6180 collection: fidl::new_empty!(
6181 fdomain_fuchsia_component_decl::CollectionRef,
6182 fdomain_client::fidl::FDomainResourceDialect
6183 ),
6184 iter: fidl::new_empty!(
6185 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
6186 fdomain_client::fidl::FDomainResourceDialect
6187 ),
6188 }
6189 }
6190
6191 #[inline]
6192 unsafe fn decode(
6193 &mut self,
6194 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6195 offset: usize,
6196 _depth: fidl::encoding::Depth,
6197 ) -> fidl::Result<()> {
6198 decoder.debug_check_bounds::<Self>(offset);
6199 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
6201 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6202 let mask = 0xffffffff00000000u64;
6203 let maskedval = padval & mask;
6204 if maskedval != 0 {
6205 return Err(fidl::Error::NonZeroPadding {
6206 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
6207 });
6208 }
6209 fidl::decode!(
6210 fdomain_fuchsia_component_decl::CollectionRef,
6211 fdomain_client::fidl::FDomainResourceDialect,
6212 &mut self.collection,
6213 decoder,
6214 offset + 0,
6215 _depth
6216 )?;
6217 fidl::decode!(
6218 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
6219 fdomain_client::fidl::FDomainResourceDialect,
6220 &mut self.iter,
6221 decoder,
6222 offset + 16,
6223 _depth
6224 )?;
6225 Ok(())
6226 }
6227 }
6228
6229 impl fidl::encoding::ResourceTypeMarker for RealmOpenControllerRequest {
6230 type Borrowed<'a> = &'a mut Self;
6231 fn take_or_borrow<'a>(
6232 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6233 ) -> Self::Borrowed<'a> {
6234 value
6235 }
6236 }
6237
6238 unsafe impl fidl::encoding::TypeMarker for RealmOpenControllerRequest {
6239 type Owned = Self;
6240
6241 #[inline(always)]
6242 fn inline_align(_context: fidl::encoding::Context) -> usize {
6243 8
6244 }
6245
6246 #[inline(always)]
6247 fn inline_size(_context: fidl::encoding::Context) -> usize {
6248 40
6249 }
6250 }
6251
6252 unsafe impl
6253 fidl::encoding::Encode<
6254 RealmOpenControllerRequest,
6255 fdomain_client::fidl::FDomainResourceDialect,
6256 > for &mut RealmOpenControllerRequest
6257 {
6258 #[inline]
6259 unsafe fn encode(
6260 self,
6261 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6262 offset: usize,
6263 _depth: fidl::encoding::Depth,
6264 ) -> fidl::Result<()> {
6265 encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
6266 fidl::encoding::Encode::<RealmOpenControllerRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
6268 (
6269 <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
6270 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
6271 ),
6272 encoder, offset, _depth
6273 )
6274 }
6275 }
6276 unsafe impl<
6277 T0: fidl::encoding::Encode<
6278 fdomain_fuchsia_component_decl::ChildRef,
6279 fdomain_client::fidl::FDomainResourceDialect,
6280 >,
6281 T1: fidl::encoding::Encode<
6282 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
6283 fdomain_client::fidl::FDomainResourceDialect,
6284 >,
6285 >
6286 fidl::encoding::Encode<
6287 RealmOpenControllerRequest,
6288 fdomain_client::fidl::FDomainResourceDialect,
6289 > for (T0, T1)
6290 {
6291 #[inline]
6292 unsafe fn encode(
6293 self,
6294 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6295 offset: usize,
6296 depth: fidl::encoding::Depth,
6297 ) -> fidl::Result<()> {
6298 encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
6299 unsafe {
6302 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
6303 (ptr as *mut u64).write_unaligned(0);
6304 }
6305 self.0.encode(encoder, offset + 0, depth)?;
6307 self.1.encode(encoder, offset + 32, depth)?;
6308 Ok(())
6309 }
6310 }
6311
6312 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6313 for RealmOpenControllerRequest
6314 {
6315 #[inline(always)]
6316 fn new_empty() -> Self {
6317 Self {
6318 child: fidl::new_empty!(
6319 fdomain_fuchsia_component_decl::ChildRef,
6320 fdomain_client::fidl::FDomainResourceDialect
6321 ),
6322 controller: fidl::new_empty!(
6323 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
6324 fdomain_client::fidl::FDomainResourceDialect
6325 ),
6326 }
6327 }
6328
6329 #[inline]
6330 unsafe fn decode(
6331 &mut self,
6332 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6333 offset: usize,
6334 _depth: fidl::encoding::Depth,
6335 ) -> fidl::Result<()> {
6336 decoder.debug_check_bounds::<Self>(offset);
6337 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
6339 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6340 let mask = 0xffffffff00000000u64;
6341 let maskedval = padval & mask;
6342 if maskedval != 0 {
6343 return Err(fidl::Error::NonZeroPadding {
6344 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
6345 });
6346 }
6347 fidl::decode!(
6348 fdomain_fuchsia_component_decl::ChildRef,
6349 fdomain_client::fidl::FDomainResourceDialect,
6350 &mut self.child,
6351 decoder,
6352 offset + 0,
6353 _depth
6354 )?;
6355 fidl::decode!(
6356 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
6357 fdomain_client::fidl::FDomainResourceDialect,
6358 &mut self.controller,
6359 decoder,
6360 offset + 32,
6361 _depth
6362 )?;
6363 Ok(())
6364 }
6365 }
6366
6367 impl fidl::encoding::ResourceTypeMarker for RealmOpenExposedDirRequest {
6368 type Borrowed<'a> = &'a mut Self;
6369 fn take_or_borrow<'a>(
6370 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6371 ) -> Self::Borrowed<'a> {
6372 value
6373 }
6374 }
6375
6376 unsafe impl fidl::encoding::TypeMarker for RealmOpenExposedDirRequest {
6377 type Owned = Self;
6378
6379 #[inline(always)]
6380 fn inline_align(_context: fidl::encoding::Context) -> usize {
6381 8
6382 }
6383
6384 #[inline(always)]
6385 fn inline_size(_context: fidl::encoding::Context) -> usize {
6386 40
6387 }
6388 }
6389
6390 unsafe impl
6391 fidl::encoding::Encode<
6392 RealmOpenExposedDirRequest,
6393 fdomain_client::fidl::FDomainResourceDialect,
6394 > for &mut RealmOpenExposedDirRequest
6395 {
6396 #[inline]
6397 unsafe fn encode(
6398 self,
6399 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6400 offset: usize,
6401 _depth: fidl::encoding::Depth,
6402 ) -> fidl::Result<()> {
6403 encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
6404 fidl::encoding::Encode::<RealmOpenExposedDirRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
6406 (
6407 <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
6408 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.exposed_dir),
6409 ),
6410 encoder, offset, _depth
6411 )
6412 }
6413 }
6414 unsafe impl<
6415 T0: fidl::encoding::Encode<
6416 fdomain_fuchsia_component_decl::ChildRef,
6417 fdomain_client::fidl::FDomainResourceDialect,
6418 >,
6419 T1: fidl::encoding::Encode<
6420 fidl::encoding::Endpoint<
6421 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
6422 >,
6423 fdomain_client::fidl::FDomainResourceDialect,
6424 >,
6425 >
6426 fidl::encoding::Encode<
6427 RealmOpenExposedDirRequest,
6428 fdomain_client::fidl::FDomainResourceDialect,
6429 > for (T0, T1)
6430 {
6431 #[inline]
6432 unsafe fn encode(
6433 self,
6434 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6435 offset: usize,
6436 depth: fidl::encoding::Depth,
6437 ) -> fidl::Result<()> {
6438 encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
6439 unsafe {
6442 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
6443 (ptr as *mut u64).write_unaligned(0);
6444 }
6445 self.0.encode(encoder, offset + 0, depth)?;
6447 self.1.encode(encoder, offset + 32, depth)?;
6448 Ok(())
6449 }
6450 }
6451
6452 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6453 for RealmOpenExposedDirRequest
6454 {
6455 #[inline(always)]
6456 fn new_empty() -> Self {
6457 Self {
6458 child: fidl::new_empty!(
6459 fdomain_fuchsia_component_decl::ChildRef,
6460 fdomain_client::fidl::FDomainResourceDialect
6461 ),
6462 exposed_dir: fidl::new_empty!(
6463 fidl::encoding::Endpoint<
6464 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
6465 >,
6466 fdomain_client::fidl::FDomainResourceDialect
6467 ),
6468 }
6469 }
6470
6471 #[inline]
6472 unsafe fn decode(
6473 &mut self,
6474 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6475 offset: usize,
6476 _depth: fidl::encoding::Depth,
6477 ) -> fidl::Result<()> {
6478 decoder.debug_check_bounds::<Self>(offset);
6479 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
6481 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6482 let mask = 0xffffffff00000000u64;
6483 let maskedval = padval & mask;
6484 if maskedval != 0 {
6485 return Err(fidl::Error::NonZeroPadding {
6486 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
6487 });
6488 }
6489 fidl::decode!(
6490 fdomain_fuchsia_component_decl::ChildRef,
6491 fdomain_client::fidl::FDomainResourceDialect,
6492 &mut self.child,
6493 decoder,
6494 offset + 0,
6495 _depth
6496 )?;
6497 fidl::decode!(
6498 fidl::encoding::Endpoint<
6499 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
6500 >,
6501 fdomain_client::fidl::FDomainResourceDialect,
6502 &mut self.exposed_dir,
6503 decoder,
6504 offset + 32,
6505 _depth
6506 )?;
6507 Ok(())
6508 }
6509 }
6510
6511 impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryResponse {
6512 type Borrowed<'a> = &'a mut Self;
6513 fn take_or_borrow<'a>(
6514 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6515 ) -> Self::Borrowed<'a> {
6516 value
6517 }
6518 }
6519
6520 unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryResponse {
6521 type Owned = Self;
6522
6523 #[inline(always)]
6524 fn inline_align(_context: fidl::encoding::Context) -> usize {
6525 4
6526 }
6527
6528 #[inline(always)]
6529 fn inline_size(_context: fidl::encoding::Context) -> usize {
6530 4
6531 }
6532 }
6533
6534 unsafe impl
6535 fidl::encoding::Encode<
6536 RealmGetChildOutputDictionaryResponse,
6537 fdomain_client::fidl::FDomainResourceDialect,
6538 > for &mut RealmGetChildOutputDictionaryResponse
6539 {
6540 #[inline]
6541 unsafe fn encode(
6542 self,
6543 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6544 offset: usize,
6545 _depth: fidl::encoding::Depth,
6546 ) -> fidl::Result<()> {
6547 encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
6548 fidl::encoding::Encode::<RealmGetChildOutputDictionaryResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
6550 (
6551 <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
6552 ),
6553 encoder, offset, _depth
6554 )
6555 }
6556 }
6557 unsafe impl<
6558 T0: fidl::encoding::Encode<
6559 fdomain_fuchsia_component_sandbox::DictionaryRef,
6560 fdomain_client::fidl::FDomainResourceDialect,
6561 >,
6562 >
6563 fidl::encoding::Encode<
6564 RealmGetChildOutputDictionaryResponse,
6565 fdomain_client::fidl::FDomainResourceDialect,
6566 > for (T0,)
6567 {
6568 #[inline]
6569 unsafe fn encode(
6570 self,
6571 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6572 offset: usize,
6573 depth: fidl::encoding::Depth,
6574 ) -> fidl::Result<()> {
6575 encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
6576 self.0.encode(encoder, offset + 0, depth)?;
6580 Ok(())
6581 }
6582 }
6583
6584 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6585 for RealmGetChildOutputDictionaryResponse
6586 {
6587 #[inline(always)]
6588 fn new_empty() -> Self {
6589 Self {
6590 dictionary: fidl::new_empty!(
6591 fdomain_fuchsia_component_sandbox::DictionaryRef,
6592 fdomain_client::fidl::FDomainResourceDialect
6593 ),
6594 }
6595 }
6596
6597 #[inline]
6598 unsafe fn decode(
6599 &mut self,
6600 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6601 offset: usize,
6602 _depth: fidl::encoding::Depth,
6603 ) -> fidl::Result<()> {
6604 decoder.debug_check_bounds::<Self>(offset);
6605 fidl::decode!(
6607 fdomain_fuchsia_component_sandbox::DictionaryRef,
6608 fdomain_client::fidl::FDomainResourceDialect,
6609 &mut self.dictionary,
6610 decoder,
6611 offset + 0,
6612 _depth
6613 )?;
6614 Ok(())
6615 }
6616 }
6617
6618 impl fidl::encoding::ResourceTypeMarker for RealmGetResolvedInfoResponse {
6619 type Borrowed<'a> = &'a mut Self;
6620 fn take_or_borrow<'a>(
6621 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6622 ) -> Self::Borrowed<'a> {
6623 value
6624 }
6625 }
6626
6627 unsafe impl fidl::encoding::TypeMarker for RealmGetResolvedInfoResponse {
6628 type Owned = Self;
6629
6630 #[inline(always)]
6631 fn inline_align(_context: fidl::encoding::Context) -> usize {
6632 8
6633 }
6634
6635 #[inline(always)]
6636 fn inline_size(_context: fidl::encoding::Context) -> usize {
6637 16
6638 }
6639 }
6640
6641 unsafe impl
6642 fidl::encoding::Encode<
6643 RealmGetResolvedInfoResponse,
6644 fdomain_client::fidl::FDomainResourceDialect,
6645 > for &mut RealmGetResolvedInfoResponse
6646 {
6647 #[inline]
6648 unsafe fn encode(
6649 self,
6650 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6651 offset: usize,
6652 _depth: fidl::encoding::Depth,
6653 ) -> fidl::Result<()> {
6654 encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
6655 fidl::encoding::Encode::<RealmGetResolvedInfoResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
6657 (
6658 <fdomain_fuchsia_component_resolution::Component as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resolved_info),
6659 ),
6660 encoder, offset, _depth
6661 )
6662 }
6663 }
6664 unsafe impl<
6665 T0: fidl::encoding::Encode<
6666 fdomain_fuchsia_component_resolution::Component,
6667 fdomain_client::fidl::FDomainResourceDialect,
6668 >,
6669 >
6670 fidl::encoding::Encode<
6671 RealmGetResolvedInfoResponse,
6672 fdomain_client::fidl::FDomainResourceDialect,
6673 > for (T0,)
6674 {
6675 #[inline]
6676 unsafe fn encode(
6677 self,
6678 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6679 offset: usize,
6680 depth: fidl::encoding::Depth,
6681 ) -> fidl::Result<()> {
6682 encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
6683 self.0.encode(encoder, offset + 0, depth)?;
6687 Ok(())
6688 }
6689 }
6690
6691 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6692 for RealmGetResolvedInfoResponse
6693 {
6694 #[inline(always)]
6695 fn new_empty() -> Self {
6696 Self {
6697 resolved_info: fidl::new_empty!(
6698 fdomain_fuchsia_component_resolution::Component,
6699 fdomain_client::fidl::FDomainResourceDialect
6700 ),
6701 }
6702 }
6703
6704 #[inline]
6705 unsafe fn decode(
6706 &mut self,
6707 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6708 offset: usize,
6709 _depth: fidl::encoding::Depth,
6710 ) -> fidl::Result<()> {
6711 decoder.debug_check_bounds::<Self>(offset);
6712 fidl::decode!(
6714 fdomain_fuchsia_component_resolution::Component,
6715 fdomain_client::fidl::FDomainResourceDialect,
6716 &mut self.resolved_info,
6717 decoder,
6718 offset + 0,
6719 _depth
6720 )?;
6721 Ok(())
6722 }
6723 }
6724
6725 impl CapabilityRequestedPayload {
6726 #[inline(always)]
6727 fn max_ordinal_present(&self) -> u64 {
6728 if let Some(_) = self.capability {
6729 return 2;
6730 }
6731 if let Some(_) = self.name {
6732 return 1;
6733 }
6734 0
6735 }
6736 }
6737
6738 impl fidl::encoding::ResourceTypeMarker for CapabilityRequestedPayload {
6739 type Borrowed<'a> = &'a mut Self;
6740 fn take_or_borrow<'a>(
6741 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6742 ) -> Self::Borrowed<'a> {
6743 value
6744 }
6745 }
6746
6747 unsafe impl fidl::encoding::TypeMarker for CapabilityRequestedPayload {
6748 type Owned = Self;
6749
6750 #[inline(always)]
6751 fn inline_align(_context: fidl::encoding::Context) -> usize {
6752 8
6753 }
6754
6755 #[inline(always)]
6756 fn inline_size(_context: fidl::encoding::Context) -> usize {
6757 16
6758 }
6759 }
6760
6761 unsafe impl
6762 fidl::encoding::Encode<
6763 CapabilityRequestedPayload,
6764 fdomain_client::fidl::FDomainResourceDialect,
6765 > for &mut CapabilityRequestedPayload
6766 {
6767 unsafe fn encode(
6768 self,
6769 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6770 offset: usize,
6771 mut depth: fidl::encoding::Depth,
6772 ) -> fidl::Result<()> {
6773 encoder.debug_check_bounds::<CapabilityRequestedPayload>(offset);
6774 let max_ordinal: u64 = self.max_ordinal_present();
6776 encoder.write_num(max_ordinal, offset);
6777 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6778 if max_ordinal == 0 {
6780 return Ok(());
6781 }
6782 depth.increment()?;
6783 let envelope_size = 8;
6784 let bytes_len = max_ordinal as usize * envelope_size;
6785 #[allow(unused_variables)]
6786 let offset = encoder.out_of_line_offset(bytes_len);
6787 let mut _prev_end_offset: usize = 0;
6788 if 1 > max_ordinal {
6789 return Ok(());
6790 }
6791
6792 let cur_offset: usize = (1 - 1) * envelope_size;
6795
6796 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6798
6799 fidl::encoding::encode_in_envelope_optional::<
6804 fidl::encoding::BoundedString<255>,
6805 fdomain_client::fidl::FDomainResourceDialect,
6806 >(
6807 self.name.as_ref().map(
6808 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
6809 ),
6810 encoder,
6811 offset + cur_offset,
6812 depth,
6813 )?;
6814
6815 _prev_end_offset = cur_offset + envelope_size;
6816 if 2 > max_ordinal {
6817 return Ok(());
6818 }
6819
6820 let cur_offset: usize = (2 - 1) * envelope_size;
6823
6824 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6826
6827 fidl::encoding::encode_in_envelope_optional::<
6832 fidl::encoding::HandleType<
6833 fdomain_client::Channel,
6834 { fidl::ObjectType::CHANNEL.into_raw() },
6835 2147483648,
6836 >,
6837 fdomain_client::fidl::FDomainResourceDialect,
6838 >(
6839 self.capability.as_mut().map(
6840 <fidl::encoding::HandleType<
6841 fdomain_client::Channel,
6842 { fidl::ObjectType::CHANNEL.into_raw() },
6843 2147483648,
6844 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
6845 ),
6846 encoder,
6847 offset + cur_offset,
6848 depth,
6849 )?;
6850
6851 _prev_end_offset = cur_offset + envelope_size;
6852
6853 Ok(())
6854 }
6855 }
6856
6857 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6858 for CapabilityRequestedPayload
6859 {
6860 #[inline(always)]
6861 fn new_empty() -> Self {
6862 Self::default()
6863 }
6864
6865 unsafe fn decode(
6866 &mut self,
6867 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6868 offset: usize,
6869 mut depth: fidl::encoding::Depth,
6870 ) -> fidl::Result<()> {
6871 decoder.debug_check_bounds::<Self>(offset);
6872 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6873 None => return Err(fidl::Error::NotNullable),
6874 Some(len) => len,
6875 };
6876 if len == 0 {
6878 return Ok(());
6879 };
6880 depth.increment()?;
6881 let envelope_size = 8;
6882 let bytes_len = len * envelope_size;
6883 let offset = decoder.out_of_line_offset(bytes_len)?;
6884 let mut _next_ordinal_to_read = 0;
6886 let mut next_offset = offset;
6887 let end_offset = offset + bytes_len;
6888 _next_ordinal_to_read += 1;
6889 if next_offset >= end_offset {
6890 return Ok(());
6891 }
6892
6893 while _next_ordinal_to_read < 1 {
6895 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6896 _next_ordinal_to_read += 1;
6897 next_offset += envelope_size;
6898 }
6899
6900 let next_out_of_line = decoder.next_out_of_line();
6901 let handles_before = decoder.remaining_handles();
6902 if let Some((inlined, num_bytes, num_handles)) =
6903 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6904 {
6905 let member_inline_size =
6906 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
6907 decoder.context,
6908 );
6909 if inlined != (member_inline_size <= 4) {
6910 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6911 }
6912 let inner_offset;
6913 let mut inner_depth = depth.clone();
6914 if inlined {
6915 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6916 inner_offset = next_offset;
6917 } else {
6918 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6919 inner_depth.increment()?;
6920 }
6921 let val_ref = self.name.get_or_insert_with(|| {
6922 fidl::new_empty!(
6923 fidl::encoding::BoundedString<255>,
6924 fdomain_client::fidl::FDomainResourceDialect
6925 )
6926 });
6927 fidl::decode!(
6928 fidl::encoding::BoundedString<255>,
6929 fdomain_client::fidl::FDomainResourceDialect,
6930 val_ref,
6931 decoder,
6932 inner_offset,
6933 inner_depth
6934 )?;
6935 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6936 {
6937 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6938 }
6939 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6940 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6941 }
6942 }
6943
6944 next_offset += envelope_size;
6945 _next_ordinal_to_read += 1;
6946 if next_offset >= end_offset {
6947 return Ok(());
6948 }
6949
6950 while _next_ordinal_to_read < 2 {
6952 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6953 _next_ordinal_to_read += 1;
6954 next_offset += envelope_size;
6955 }
6956
6957 let next_out_of_line = decoder.next_out_of_line();
6958 let handles_before = decoder.remaining_handles();
6959 if let Some((inlined, num_bytes, num_handles)) =
6960 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6961 {
6962 let member_inline_size = <fidl::encoding::HandleType<
6963 fdomain_client::Channel,
6964 { fidl::ObjectType::CHANNEL.into_raw() },
6965 2147483648,
6966 > as fidl::encoding::TypeMarker>::inline_size(
6967 decoder.context
6968 );
6969 if inlined != (member_inline_size <= 4) {
6970 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6971 }
6972 let inner_offset;
6973 let mut inner_depth = depth.clone();
6974 if inlined {
6975 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6976 inner_offset = next_offset;
6977 } else {
6978 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6979 inner_depth.increment()?;
6980 }
6981 let val_ref =
6982 self.capability.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
6983 fidl::decode!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6984 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6985 {
6986 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6987 }
6988 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6989 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6990 }
6991 }
6992
6993 next_offset += envelope_size;
6994
6995 while next_offset < end_offset {
6997 _next_ordinal_to_read += 1;
6998 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6999 next_offset += envelope_size;
7000 }
7001
7002 Ok(())
7003 }
7004 }
7005
7006 impl CreateChildArgs {
7007 #[inline(always)]
7008 fn max_ordinal_present(&self) -> u64 {
7009 if let Some(_) = self.dictionary {
7010 return 4;
7011 }
7012 if let Some(_) = self.controller {
7013 return 3;
7014 }
7015 if let Some(_) = self.dynamic_offers {
7016 return 2;
7017 }
7018 if let Some(_) = self.numbered_handles {
7019 return 1;
7020 }
7021 0
7022 }
7023 }
7024
7025 impl fidl::encoding::ResourceTypeMarker for CreateChildArgs {
7026 type Borrowed<'a> = &'a mut Self;
7027 fn take_or_borrow<'a>(
7028 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7029 ) -> Self::Borrowed<'a> {
7030 value
7031 }
7032 }
7033
7034 unsafe impl fidl::encoding::TypeMarker for CreateChildArgs {
7035 type Owned = Self;
7036
7037 #[inline(always)]
7038 fn inline_align(_context: fidl::encoding::Context) -> usize {
7039 8
7040 }
7041
7042 #[inline(always)]
7043 fn inline_size(_context: fidl::encoding::Context) -> usize {
7044 16
7045 }
7046 }
7047
7048 unsafe impl
7049 fidl::encoding::Encode<CreateChildArgs, fdomain_client::fidl::FDomainResourceDialect>
7050 for &mut CreateChildArgs
7051 {
7052 unsafe fn encode(
7053 self,
7054 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7055 offset: usize,
7056 mut depth: fidl::encoding::Depth,
7057 ) -> fidl::Result<()> {
7058 encoder.debug_check_bounds::<CreateChildArgs>(offset);
7059 let max_ordinal: u64 = self.max_ordinal_present();
7061 encoder.write_num(max_ordinal, offset);
7062 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7063 if max_ordinal == 0 {
7065 return Ok(());
7066 }
7067 depth.increment()?;
7068 let envelope_size = 8;
7069 let bytes_len = max_ordinal as usize * envelope_size;
7070 #[allow(unused_variables)]
7071 let offset = encoder.out_of_line_offset(bytes_len);
7072 let mut _prev_end_offset: usize = 0;
7073 if 1 > max_ordinal {
7074 return Ok(());
7075 }
7076
7077 let cur_offset: usize = (1 - 1) * envelope_size;
7080
7081 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7083
7084 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect>(
7089 self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7090 encoder, offset + cur_offset, depth
7091 )?;
7092
7093 _prev_end_offset = cur_offset + envelope_size;
7094 if 2 > max_ordinal {
7095 return Ok(());
7096 }
7097
7098 let cur_offset: usize = (2 - 1) * envelope_size;
7101
7102 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7104
7105 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect>(
7110 self.dynamic_offers.as_ref().map(<fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow),
7111 encoder, offset + cur_offset, depth
7112 )?;
7113
7114 _prev_end_offset = cur_offset + envelope_size;
7115 if 3 > max_ordinal {
7116 return Ok(());
7117 }
7118
7119 let cur_offset: usize = (3 - 1) * envelope_size;
7122
7123 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7125
7126 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
7131 self.controller.as_mut().map(<fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7132 encoder, offset + cur_offset, depth
7133 )?;
7134
7135 _prev_end_offset = cur_offset + envelope_size;
7136 if 4 > max_ordinal {
7137 return Ok(());
7138 }
7139
7140 let cur_offset: usize = (4 - 1) * envelope_size;
7143
7144 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7146
7147 fidl::encoding::encode_in_envelope_optional::<fdomain_fuchsia_component_sandbox::DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
7152 self.dictionary.as_mut().map(<fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7153 encoder, offset + cur_offset, depth
7154 )?;
7155
7156 _prev_end_offset = cur_offset + envelope_size;
7157
7158 Ok(())
7159 }
7160 }
7161
7162 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7163 for CreateChildArgs
7164 {
7165 #[inline(always)]
7166 fn new_empty() -> Self {
7167 Self::default()
7168 }
7169
7170 unsafe fn decode(
7171 &mut self,
7172 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7173 offset: usize,
7174 mut depth: fidl::encoding::Depth,
7175 ) -> fidl::Result<()> {
7176 decoder.debug_check_bounds::<Self>(offset);
7177 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7178 None => return Err(fidl::Error::NotNullable),
7179 Some(len) => len,
7180 };
7181 if len == 0 {
7183 return Ok(());
7184 };
7185 depth.increment()?;
7186 let envelope_size = 8;
7187 let bytes_len = len * envelope_size;
7188 let offset = decoder.out_of_line_offset(bytes_len)?;
7189 let mut _next_ordinal_to_read = 0;
7191 let mut next_offset = offset;
7192 let end_offset = offset + bytes_len;
7193 _next_ordinal_to_read += 1;
7194 if next_offset >= end_offset {
7195 return Ok(());
7196 }
7197
7198 while _next_ordinal_to_read < 1 {
7200 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7201 _next_ordinal_to_read += 1;
7202 next_offset += envelope_size;
7203 }
7204
7205 let next_out_of_line = decoder.next_out_of_line();
7206 let handles_before = decoder.remaining_handles();
7207 if let Some((inlined, num_bytes, num_handles)) =
7208 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7209 {
7210 let member_inline_size = <fidl::encoding::Vector<
7211 fdomain_fuchsia_process::HandleInfo,
7212 128,
7213 > as fidl::encoding::TypeMarker>::inline_size(
7214 decoder.context
7215 );
7216 if inlined != (member_inline_size <= 4) {
7217 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7218 }
7219 let inner_offset;
7220 let mut inner_depth = depth.clone();
7221 if inlined {
7222 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7223 inner_offset = next_offset;
7224 } else {
7225 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7226 inner_depth.increment()?;
7227 }
7228 let val_ref =
7229 self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect));
7230 fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7231 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7232 {
7233 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7234 }
7235 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7236 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7237 }
7238 }
7239
7240 next_offset += envelope_size;
7241 _next_ordinal_to_read += 1;
7242 if next_offset >= end_offset {
7243 return Ok(());
7244 }
7245
7246 while _next_ordinal_to_read < 2 {
7248 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7249 _next_ordinal_to_read += 1;
7250 next_offset += envelope_size;
7251 }
7252
7253 let next_out_of_line = decoder.next_out_of_line();
7254 let handles_before = decoder.remaining_handles();
7255 if let Some((inlined, num_bytes, num_handles)) =
7256 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7257 {
7258 let member_inline_size = <fidl::encoding::Vector<
7259 fdomain_fuchsia_component_decl::Offer,
7260 128,
7261 > as fidl::encoding::TypeMarker>::inline_size(
7262 decoder.context
7263 );
7264 if inlined != (member_inline_size <= 4) {
7265 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7266 }
7267 let inner_offset;
7268 let mut inner_depth = depth.clone();
7269 if inlined {
7270 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7271 inner_offset = next_offset;
7272 } else {
7273 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7274 inner_depth.increment()?;
7275 }
7276 let val_ref =
7277 self.dynamic_offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect));
7278 fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7279 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7280 {
7281 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7282 }
7283 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7284 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7285 }
7286 }
7287
7288 next_offset += envelope_size;
7289 _next_ordinal_to_read += 1;
7290 if next_offset >= end_offset {
7291 return Ok(());
7292 }
7293
7294 while _next_ordinal_to_read < 3 {
7296 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7297 _next_ordinal_to_read += 1;
7298 next_offset += envelope_size;
7299 }
7300
7301 let next_out_of_line = decoder.next_out_of_line();
7302 let handles_before = decoder.remaining_handles();
7303 if let Some((inlined, num_bytes, num_handles)) =
7304 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7305 {
7306 let member_inline_size = <fidl::encoding::Endpoint<
7307 fdomain_client::fidl::ServerEnd<ControllerMarker>,
7308 > as fidl::encoding::TypeMarker>::inline_size(
7309 decoder.context
7310 );
7311 if inlined != (member_inline_size <= 4) {
7312 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7313 }
7314 let inner_offset;
7315 let mut inner_depth = depth.clone();
7316 if inlined {
7317 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7318 inner_offset = next_offset;
7319 } else {
7320 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7321 inner_depth.increment()?;
7322 }
7323 let val_ref = self.controller.get_or_insert_with(|| {
7324 fidl::new_empty!(
7325 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
7326 fdomain_client::fidl::FDomainResourceDialect
7327 )
7328 });
7329 fidl::decode!(
7330 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
7331 fdomain_client::fidl::FDomainResourceDialect,
7332 val_ref,
7333 decoder,
7334 inner_offset,
7335 inner_depth
7336 )?;
7337 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7338 {
7339 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7340 }
7341 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7342 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7343 }
7344 }
7345
7346 next_offset += envelope_size;
7347 _next_ordinal_to_read += 1;
7348 if next_offset >= end_offset {
7349 return Ok(());
7350 }
7351
7352 while _next_ordinal_to_read < 4 {
7354 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7355 _next_ordinal_to_read += 1;
7356 next_offset += envelope_size;
7357 }
7358
7359 let next_out_of_line = decoder.next_out_of_line();
7360 let handles_before = decoder.remaining_handles();
7361 if let Some((inlined, num_bytes, num_handles)) =
7362 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7363 {
7364 let member_inline_size = <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7365 if inlined != (member_inline_size <= 4) {
7366 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7367 }
7368 let inner_offset;
7369 let mut inner_depth = depth.clone();
7370 if inlined {
7371 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7372 inner_offset = next_offset;
7373 } else {
7374 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7375 inner_depth.increment()?;
7376 }
7377 let val_ref = self.dictionary.get_or_insert_with(|| {
7378 fidl::new_empty!(
7379 fdomain_fuchsia_component_sandbox::DictionaryRef,
7380 fdomain_client::fidl::FDomainResourceDialect
7381 )
7382 });
7383 fidl::decode!(
7384 fdomain_fuchsia_component_sandbox::DictionaryRef,
7385 fdomain_client::fidl::FDomainResourceDialect,
7386 val_ref,
7387 decoder,
7388 inner_offset,
7389 inner_depth
7390 )?;
7391 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7392 {
7393 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7394 }
7395 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7396 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7397 }
7398 }
7399
7400 next_offset += envelope_size;
7401
7402 while next_offset < end_offset {
7404 _next_ordinal_to_read += 1;
7405 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7406 next_offset += envelope_size;
7407 }
7408
7409 Ok(())
7410 }
7411 }
7412
7413 impl DebugStartedPayload {
7414 #[inline(always)]
7415 fn max_ordinal_present(&self) -> u64 {
7416 if let Some(_) = self.break_on_start {
7417 return 2;
7418 }
7419 if let Some(_) = self.runtime_dir {
7420 return 1;
7421 }
7422 0
7423 }
7424 }
7425
7426 impl fidl::encoding::ResourceTypeMarker for DebugStartedPayload {
7427 type Borrowed<'a> = &'a mut Self;
7428 fn take_or_borrow<'a>(
7429 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7430 ) -> Self::Borrowed<'a> {
7431 value
7432 }
7433 }
7434
7435 unsafe impl fidl::encoding::TypeMarker for DebugStartedPayload {
7436 type Owned = Self;
7437
7438 #[inline(always)]
7439 fn inline_align(_context: fidl::encoding::Context) -> usize {
7440 8
7441 }
7442
7443 #[inline(always)]
7444 fn inline_size(_context: fidl::encoding::Context) -> usize {
7445 16
7446 }
7447 }
7448
7449 unsafe impl
7450 fidl::encoding::Encode<DebugStartedPayload, fdomain_client::fidl::FDomainResourceDialect>
7451 for &mut DebugStartedPayload
7452 {
7453 unsafe fn encode(
7454 self,
7455 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7456 offset: usize,
7457 mut depth: fidl::encoding::Depth,
7458 ) -> fidl::Result<()> {
7459 encoder.debug_check_bounds::<DebugStartedPayload>(offset);
7460 let max_ordinal: u64 = self.max_ordinal_present();
7462 encoder.write_num(max_ordinal, offset);
7463 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7464 if max_ordinal == 0 {
7466 return Ok(());
7467 }
7468 depth.increment()?;
7469 let envelope_size = 8;
7470 let bytes_len = max_ordinal as usize * envelope_size;
7471 #[allow(unused_variables)]
7472 let offset = encoder.out_of_line_offset(bytes_len);
7473 let mut _prev_end_offset: usize = 0;
7474 if 1 > max_ordinal {
7475 return Ok(());
7476 }
7477
7478 let cur_offset: usize = (1 - 1) * envelope_size;
7481
7482 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7484
7485 fidl::encoding::encode_in_envelope_optional::<
7490 fidl::encoding::Endpoint<
7491 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
7492 >,
7493 fdomain_client::fidl::FDomainResourceDialect,
7494 >(
7495 self.runtime_dir.as_mut().map(
7496 <fidl::encoding::Endpoint<
7497 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
7498 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7499 ),
7500 encoder,
7501 offset + cur_offset,
7502 depth,
7503 )?;
7504
7505 _prev_end_offset = cur_offset + envelope_size;
7506 if 2 > max_ordinal {
7507 return Ok(());
7508 }
7509
7510 let cur_offset: usize = (2 - 1) * envelope_size;
7513
7514 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7516
7517 fidl::encoding::encode_in_envelope_optional::<
7522 fidl::encoding::HandleType<
7523 fdomain_client::EventPair,
7524 { fidl::ObjectType::EVENTPAIR.into_raw() },
7525 2147483648,
7526 >,
7527 fdomain_client::fidl::FDomainResourceDialect,
7528 >(
7529 self.break_on_start.as_mut().map(
7530 <fidl::encoding::HandleType<
7531 fdomain_client::EventPair,
7532 { fidl::ObjectType::EVENTPAIR.into_raw() },
7533 2147483648,
7534 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7535 ),
7536 encoder,
7537 offset + cur_offset,
7538 depth,
7539 )?;
7540
7541 _prev_end_offset = cur_offset + envelope_size;
7542
7543 Ok(())
7544 }
7545 }
7546
7547 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7548 for DebugStartedPayload
7549 {
7550 #[inline(always)]
7551 fn new_empty() -> Self {
7552 Self::default()
7553 }
7554
7555 unsafe fn decode(
7556 &mut self,
7557 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7558 offset: usize,
7559 mut depth: fidl::encoding::Depth,
7560 ) -> fidl::Result<()> {
7561 decoder.debug_check_bounds::<Self>(offset);
7562 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7563 None => return Err(fidl::Error::NotNullable),
7564 Some(len) => len,
7565 };
7566 if len == 0 {
7568 return Ok(());
7569 };
7570 depth.increment()?;
7571 let envelope_size = 8;
7572 let bytes_len = len * envelope_size;
7573 let offset = decoder.out_of_line_offset(bytes_len)?;
7574 let mut _next_ordinal_to_read = 0;
7576 let mut next_offset = offset;
7577 let end_offset = offset + bytes_len;
7578 _next_ordinal_to_read += 1;
7579 if next_offset >= end_offset {
7580 return Ok(());
7581 }
7582
7583 while _next_ordinal_to_read < 1 {
7585 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7586 _next_ordinal_to_read += 1;
7587 next_offset += envelope_size;
7588 }
7589
7590 let next_out_of_line = decoder.next_out_of_line();
7591 let handles_before = decoder.remaining_handles();
7592 if let Some((inlined, num_bytes, num_handles)) =
7593 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7594 {
7595 let member_inline_size = <fidl::encoding::Endpoint<
7596 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
7597 > as fidl::encoding::TypeMarker>::inline_size(
7598 decoder.context
7599 );
7600 if inlined != (member_inline_size <= 4) {
7601 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7602 }
7603 let inner_offset;
7604 let mut inner_depth = depth.clone();
7605 if inlined {
7606 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7607 inner_offset = next_offset;
7608 } else {
7609 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7610 inner_depth.increment()?;
7611 }
7612 let val_ref = self.runtime_dir.get_or_insert_with(|| {
7613 fidl::new_empty!(
7614 fidl::encoding::Endpoint<
7615 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
7616 >,
7617 fdomain_client::fidl::FDomainResourceDialect
7618 )
7619 });
7620 fidl::decode!(
7621 fidl::encoding::Endpoint<
7622 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
7623 >,
7624 fdomain_client::fidl::FDomainResourceDialect,
7625 val_ref,
7626 decoder,
7627 inner_offset,
7628 inner_depth
7629 )?;
7630 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7631 {
7632 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7633 }
7634 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7635 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7636 }
7637 }
7638
7639 next_offset += envelope_size;
7640 _next_ordinal_to_read += 1;
7641 if next_offset >= end_offset {
7642 return Ok(());
7643 }
7644
7645 while _next_ordinal_to_read < 2 {
7647 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7648 _next_ordinal_to_read += 1;
7649 next_offset += envelope_size;
7650 }
7651
7652 let next_out_of_line = decoder.next_out_of_line();
7653 let handles_before = decoder.remaining_handles();
7654 if let Some((inlined, num_bytes, num_handles)) =
7655 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7656 {
7657 let member_inline_size = <fidl::encoding::HandleType<
7658 fdomain_client::EventPair,
7659 { fidl::ObjectType::EVENTPAIR.into_raw() },
7660 2147483648,
7661 > as fidl::encoding::TypeMarker>::inline_size(
7662 decoder.context
7663 );
7664 if inlined != (member_inline_size <= 4) {
7665 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7666 }
7667 let inner_offset;
7668 let mut inner_depth = depth.clone();
7669 if inlined {
7670 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7671 inner_offset = next_offset;
7672 } else {
7673 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7674 inner_depth.increment()?;
7675 }
7676 let val_ref =
7677 self.break_on_start.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
7678 fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7679 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7680 {
7681 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7682 }
7683 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7684 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7685 }
7686 }
7687
7688 next_offset += envelope_size;
7689
7690 while next_offset < end_offset {
7692 _next_ordinal_to_read += 1;
7693 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7694 next_offset += envelope_size;
7695 }
7696
7697 Ok(())
7698 }
7699 }
7700
7701 impl Event {
7702 #[inline(always)]
7703 fn max_ordinal_present(&self) -> u64 {
7704 if let Some(_) = self.payload {
7705 return 2;
7706 }
7707 if let Some(_) = self.header {
7708 return 1;
7709 }
7710 0
7711 }
7712 }
7713
7714 impl fidl::encoding::ResourceTypeMarker for Event {
7715 type Borrowed<'a> = &'a mut Self;
7716 fn take_or_borrow<'a>(
7717 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7718 ) -> Self::Borrowed<'a> {
7719 value
7720 }
7721 }
7722
7723 unsafe impl fidl::encoding::TypeMarker for Event {
7724 type Owned = Self;
7725
7726 #[inline(always)]
7727 fn inline_align(_context: fidl::encoding::Context) -> usize {
7728 8
7729 }
7730
7731 #[inline(always)]
7732 fn inline_size(_context: fidl::encoding::Context) -> usize {
7733 16
7734 }
7735 }
7736
7737 unsafe impl fidl::encoding::Encode<Event, fdomain_client::fidl::FDomainResourceDialect>
7738 for &mut Event
7739 {
7740 unsafe fn encode(
7741 self,
7742 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7743 offset: usize,
7744 mut depth: fidl::encoding::Depth,
7745 ) -> fidl::Result<()> {
7746 encoder.debug_check_bounds::<Event>(offset);
7747 let max_ordinal: u64 = self.max_ordinal_present();
7749 encoder.write_num(max_ordinal, offset);
7750 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7751 if max_ordinal == 0 {
7753 return Ok(());
7754 }
7755 depth.increment()?;
7756 let envelope_size = 8;
7757 let bytes_len = max_ordinal as usize * envelope_size;
7758 #[allow(unused_variables)]
7759 let offset = encoder.out_of_line_offset(bytes_len);
7760 let mut _prev_end_offset: usize = 0;
7761 if 1 > max_ordinal {
7762 return Ok(());
7763 }
7764
7765 let cur_offset: usize = (1 - 1) * envelope_size;
7768
7769 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7771
7772 fidl::encoding::encode_in_envelope_optional::<
7777 EventHeader,
7778 fdomain_client::fidl::FDomainResourceDialect,
7779 >(
7780 self.header.as_ref().map(<EventHeader as fidl::encoding::ValueTypeMarker>::borrow),
7781 encoder,
7782 offset + cur_offset,
7783 depth,
7784 )?;
7785
7786 _prev_end_offset = cur_offset + envelope_size;
7787 if 2 > max_ordinal {
7788 return Ok(());
7789 }
7790
7791 let cur_offset: usize = (2 - 1) * envelope_size;
7794
7795 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7797
7798 fidl::encoding::encode_in_envelope_optional::<
7803 EventPayload,
7804 fdomain_client::fidl::FDomainResourceDialect,
7805 >(
7806 self.payload
7807 .as_mut()
7808 .map(<EventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7809 encoder,
7810 offset + cur_offset,
7811 depth,
7812 )?;
7813
7814 _prev_end_offset = cur_offset + envelope_size;
7815
7816 Ok(())
7817 }
7818 }
7819
7820 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Event {
7821 #[inline(always)]
7822 fn new_empty() -> Self {
7823 Self::default()
7824 }
7825
7826 unsafe fn decode(
7827 &mut self,
7828 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7829 offset: usize,
7830 mut depth: fidl::encoding::Depth,
7831 ) -> fidl::Result<()> {
7832 decoder.debug_check_bounds::<Self>(offset);
7833 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7834 None => return Err(fidl::Error::NotNullable),
7835 Some(len) => len,
7836 };
7837 if len == 0 {
7839 return Ok(());
7840 };
7841 depth.increment()?;
7842 let envelope_size = 8;
7843 let bytes_len = len * envelope_size;
7844 let offset = decoder.out_of_line_offset(bytes_len)?;
7845 let mut _next_ordinal_to_read = 0;
7847 let mut next_offset = offset;
7848 let end_offset = offset + bytes_len;
7849 _next_ordinal_to_read += 1;
7850 if next_offset >= end_offset {
7851 return Ok(());
7852 }
7853
7854 while _next_ordinal_to_read < 1 {
7856 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7857 _next_ordinal_to_read += 1;
7858 next_offset += envelope_size;
7859 }
7860
7861 let next_out_of_line = decoder.next_out_of_line();
7862 let handles_before = decoder.remaining_handles();
7863 if let Some((inlined, num_bytes, num_handles)) =
7864 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7865 {
7866 let member_inline_size =
7867 <EventHeader as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7868 if inlined != (member_inline_size <= 4) {
7869 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7870 }
7871 let inner_offset;
7872 let mut inner_depth = depth.clone();
7873 if inlined {
7874 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7875 inner_offset = next_offset;
7876 } else {
7877 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7878 inner_depth.increment()?;
7879 }
7880 let val_ref = self.header.get_or_insert_with(|| {
7881 fidl::new_empty!(EventHeader, fdomain_client::fidl::FDomainResourceDialect)
7882 });
7883 fidl::decode!(
7884 EventHeader,
7885 fdomain_client::fidl::FDomainResourceDialect,
7886 val_ref,
7887 decoder,
7888 inner_offset,
7889 inner_depth
7890 )?;
7891 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7892 {
7893 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7894 }
7895 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7896 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7897 }
7898 }
7899
7900 next_offset += envelope_size;
7901 _next_ordinal_to_read += 1;
7902 if next_offset >= end_offset {
7903 return Ok(());
7904 }
7905
7906 while _next_ordinal_to_read < 2 {
7908 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7909 _next_ordinal_to_read += 1;
7910 next_offset += envelope_size;
7911 }
7912
7913 let next_out_of_line = decoder.next_out_of_line();
7914 let handles_before = decoder.remaining_handles();
7915 if let Some((inlined, num_bytes, num_handles)) =
7916 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7917 {
7918 let member_inline_size =
7919 <EventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7920 if inlined != (member_inline_size <= 4) {
7921 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7922 }
7923 let inner_offset;
7924 let mut inner_depth = depth.clone();
7925 if inlined {
7926 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7927 inner_offset = next_offset;
7928 } else {
7929 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7930 inner_depth.increment()?;
7931 }
7932 let val_ref = self.payload.get_or_insert_with(|| {
7933 fidl::new_empty!(EventPayload, fdomain_client::fidl::FDomainResourceDialect)
7934 });
7935 fidl::decode!(
7936 EventPayload,
7937 fdomain_client::fidl::FDomainResourceDialect,
7938 val_ref,
7939 decoder,
7940 inner_offset,
7941 inner_depth
7942 )?;
7943 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7944 {
7945 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7946 }
7947 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7948 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7949 }
7950 }
7951
7952 next_offset += envelope_size;
7953
7954 while next_offset < end_offset {
7956 _next_ordinal_to_read += 1;
7957 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7958 next_offset += envelope_size;
7959 }
7960
7961 Ok(())
7962 }
7963 }
7964
7965 impl NamespaceEntry {
7966 #[inline(always)]
7967 fn max_ordinal_present(&self) -> u64 {
7968 if let Some(_) = self.directory {
7969 return 2;
7970 }
7971 if let Some(_) = self.path {
7972 return 1;
7973 }
7974 0
7975 }
7976 }
7977
7978 impl fidl::encoding::ResourceTypeMarker for NamespaceEntry {
7979 type Borrowed<'a> = &'a mut Self;
7980 fn take_or_borrow<'a>(
7981 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7982 ) -> Self::Borrowed<'a> {
7983 value
7984 }
7985 }
7986
7987 unsafe impl fidl::encoding::TypeMarker for NamespaceEntry {
7988 type Owned = Self;
7989
7990 #[inline(always)]
7991 fn inline_align(_context: fidl::encoding::Context) -> usize {
7992 8
7993 }
7994
7995 #[inline(always)]
7996 fn inline_size(_context: fidl::encoding::Context) -> usize {
7997 16
7998 }
7999 }
8000
8001 unsafe impl fidl::encoding::Encode<NamespaceEntry, fdomain_client::fidl::FDomainResourceDialect>
8002 for &mut NamespaceEntry
8003 {
8004 unsafe fn encode(
8005 self,
8006 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8007 offset: usize,
8008 mut depth: fidl::encoding::Depth,
8009 ) -> fidl::Result<()> {
8010 encoder.debug_check_bounds::<NamespaceEntry>(offset);
8011 let max_ordinal: u64 = self.max_ordinal_present();
8013 encoder.write_num(max_ordinal, offset);
8014 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8015 if max_ordinal == 0 {
8017 return Ok(());
8018 }
8019 depth.increment()?;
8020 let envelope_size = 8;
8021 let bytes_len = max_ordinal as usize * envelope_size;
8022 #[allow(unused_variables)]
8023 let offset = encoder.out_of_line_offset(bytes_len);
8024 let mut _prev_end_offset: usize = 0;
8025 if 1 > max_ordinal {
8026 return Ok(());
8027 }
8028
8029 let cur_offset: usize = (1 - 1) * envelope_size;
8032
8033 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8035
8036 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fdomain_client::fidl::FDomainResourceDialect>(
8041 self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
8042 encoder, offset + cur_offset, depth
8043 )?;
8044
8045 _prev_end_offset = cur_offset + envelope_size;
8046 if 2 > max_ordinal {
8047 return Ok(());
8048 }
8049
8050 let cur_offset: usize = (2 - 1) * envelope_size;
8053
8054 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8056
8057 fidl::encoding::encode_in_envelope_optional::<
8062 fidl::encoding::Endpoint<
8063 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
8064 >,
8065 fdomain_client::fidl::FDomainResourceDialect,
8066 >(
8067 self.directory.as_mut().map(
8068 <fidl::encoding::Endpoint<
8069 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
8070 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8071 ),
8072 encoder,
8073 offset + cur_offset,
8074 depth,
8075 )?;
8076
8077 _prev_end_offset = cur_offset + envelope_size;
8078
8079 Ok(())
8080 }
8081 }
8082
8083 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for NamespaceEntry {
8084 #[inline(always)]
8085 fn new_empty() -> Self {
8086 Self::default()
8087 }
8088
8089 unsafe fn decode(
8090 &mut self,
8091 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8092 offset: usize,
8093 mut depth: fidl::encoding::Depth,
8094 ) -> fidl::Result<()> {
8095 decoder.debug_check_bounds::<Self>(offset);
8096 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8097 None => return Err(fidl::Error::NotNullable),
8098 Some(len) => len,
8099 };
8100 if len == 0 {
8102 return Ok(());
8103 };
8104 depth.increment()?;
8105 let envelope_size = 8;
8106 let bytes_len = len * envelope_size;
8107 let offset = decoder.out_of_line_offset(bytes_len)?;
8108 let mut _next_ordinal_to_read = 0;
8110 let mut next_offset = offset;
8111 let end_offset = offset + bytes_len;
8112 _next_ordinal_to_read += 1;
8113 if next_offset >= end_offset {
8114 return Ok(());
8115 }
8116
8117 while _next_ordinal_to_read < 1 {
8119 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8120 _next_ordinal_to_read += 1;
8121 next_offset += envelope_size;
8122 }
8123
8124 let next_out_of_line = decoder.next_out_of_line();
8125 let handles_before = decoder.remaining_handles();
8126 if let Some((inlined, num_bytes, num_handles)) =
8127 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8128 {
8129 let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8130 if inlined != (member_inline_size <= 4) {
8131 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8132 }
8133 let inner_offset;
8134 let mut inner_depth = depth.clone();
8135 if inlined {
8136 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8137 inner_offset = next_offset;
8138 } else {
8139 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8140 inner_depth.increment()?;
8141 }
8142 let val_ref = self.path.get_or_insert_with(|| {
8143 fidl::new_empty!(
8144 fidl::encoding::BoundedString<4095>,
8145 fdomain_client::fidl::FDomainResourceDialect
8146 )
8147 });
8148 fidl::decode!(
8149 fidl::encoding::BoundedString<4095>,
8150 fdomain_client::fidl::FDomainResourceDialect,
8151 val_ref,
8152 decoder,
8153 inner_offset,
8154 inner_depth
8155 )?;
8156 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8157 {
8158 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8159 }
8160 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8161 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8162 }
8163 }
8164
8165 next_offset += envelope_size;
8166 _next_ordinal_to_read += 1;
8167 if next_offset >= end_offset {
8168 return Ok(());
8169 }
8170
8171 while _next_ordinal_to_read < 2 {
8173 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8174 _next_ordinal_to_read += 1;
8175 next_offset += envelope_size;
8176 }
8177
8178 let next_out_of_line = decoder.next_out_of_line();
8179 let handles_before = decoder.remaining_handles();
8180 if let Some((inlined, num_bytes, num_handles)) =
8181 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8182 {
8183 let member_inline_size = <fidl::encoding::Endpoint<
8184 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
8185 > as fidl::encoding::TypeMarker>::inline_size(
8186 decoder.context
8187 );
8188 if inlined != (member_inline_size <= 4) {
8189 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8190 }
8191 let inner_offset;
8192 let mut inner_depth = depth.clone();
8193 if inlined {
8194 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8195 inner_offset = next_offset;
8196 } else {
8197 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8198 inner_depth.increment()?;
8199 }
8200 let val_ref = self.directory.get_or_insert_with(|| {
8201 fidl::new_empty!(
8202 fidl::encoding::Endpoint<
8203 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
8204 >,
8205 fdomain_client::fidl::FDomainResourceDialect
8206 )
8207 });
8208 fidl::decode!(
8209 fidl::encoding::Endpoint<
8210 fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
8211 >,
8212 fdomain_client::fidl::FDomainResourceDialect,
8213 val_ref,
8214 decoder,
8215 inner_offset,
8216 inner_depth
8217 )?;
8218 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8219 {
8220 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8221 }
8222 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8223 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8224 }
8225 }
8226
8227 next_offset += envelope_size;
8228
8229 while next_offset < end_offset {
8231 _next_ordinal_to_read += 1;
8232 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8233 next_offset += envelope_size;
8234 }
8235
8236 Ok(())
8237 }
8238 }
8239
8240 impl StartChildArgs {
8241 #[inline(always)]
8242 fn max_ordinal_present(&self) -> u64 {
8243 if let Some(_) = self.dictionary {
8244 return 3;
8245 }
8246 if let Some(_) = self.namespace_entries {
8247 return 2;
8248 }
8249 if let Some(_) = self.numbered_handles {
8250 return 1;
8251 }
8252 0
8253 }
8254 }
8255
8256 impl fidl::encoding::ResourceTypeMarker for StartChildArgs {
8257 type Borrowed<'a> = &'a mut Self;
8258 fn take_or_borrow<'a>(
8259 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8260 ) -> Self::Borrowed<'a> {
8261 value
8262 }
8263 }
8264
8265 unsafe impl fidl::encoding::TypeMarker for StartChildArgs {
8266 type Owned = Self;
8267
8268 #[inline(always)]
8269 fn inline_align(_context: fidl::encoding::Context) -> usize {
8270 8
8271 }
8272
8273 #[inline(always)]
8274 fn inline_size(_context: fidl::encoding::Context) -> usize {
8275 16
8276 }
8277 }
8278
8279 unsafe impl fidl::encoding::Encode<StartChildArgs, fdomain_client::fidl::FDomainResourceDialect>
8280 for &mut StartChildArgs
8281 {
8282 unsafe fn encode(
8283 self,
8284 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8285 offset: usize,
8286 mut depth: fidl::encoding::Depth,
8287 ) -> fidl::Result<()> {
8288 encoder.debug_check_bounds::<StartChildArgs>(offset);
8289 let max_ordinal: u64 = self.max_ordinal_present();
8291 encoder.write_num(max_ordinal, offset);
8292 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8293 if max_ordinal == 0 {
8295 return Ok(());
8296 }
8297 depth.increment()?;
8298 let envelope_size = 8;
8299 let bytes_len = max_ordinal as usize * envelope_size;
8300 #[allow(unused_variables)]
8301 let offset = encoder.out_of_line_offset(bytes_len);
8302 let mut _prev_end_offset: usize = 0;
8303 if 1 > max_ordinal {
8304 return Ok(());
8305 }
8306
8307 let cur_offset: usize = (1 - 1) * envelope_size;
8310
8311 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8313
8314 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect>(
8319 self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
8320 encoder, offset + cur_offset, depth
8321 )?;
8322
8323 _prev_end_offset = cur_offset + envelope_size;
8324 if 2 > max_ordinal {
8325 return Ok(());
8326 }
8327
8328 let cur_offset: usize = (2 - 1) * envelope_size;
8331
8332 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8334
8335 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect>(
8340 self.namespace_entries.as_mut().map(<fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
8341 encoder, offset + cur_offset, depth
8342 )?;
8343
8344 _prev_end_offset = cur_offset + envelope_size;
8345 if 3 > max_ordinal {
8346 return Ok(());
8347 }
8348
8349 let cur_offset: usize = (3 - 1) * envelope_size;
8352
8353 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8355
8356 fidl::encoding::encode_in_envelope_optional::<fdomain_fuchsia_component_sandbox::DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
8361 self.dictionary.as_mut().map(<fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
8362 encoder, offset + cur_offset, depth
8363 )?;
8364
8365 _prev_end_offset = cur_offset + envelope_size;
8366
8367 Ok(())
8368 }
8369 }
8370
8371 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for StartChildArgs {
8372 #[inline(always)]
8373 fn new_empty() -> Self {
8374 Self::default()
8375 }
8376
8377 unsafe fn decode(
8378 &mut self,
8379 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8380 offset: usize,
8381 mut depth: fidl::encoding::Depth,
8382 ) -> fidl::Result<()> {
8383 decoder.debug_check_bounds::<Self>(offset);
8384 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8385 None => return Err(fidl::Error::NotNullable),
8386 Some(len) => len,
8387 };
8388 if len == 0 {
8390 return Ok(());
8391 };
8392 depth.increment()?;
8393 let envelope_size = 8;
8394 let bytes_len = len * envelope_size;
8395 let offset = decoder.out_of_line_offset(bytes_len)?;
8396 let mut _next_ordinal_to_read = 0;
8398 let mut next_offset = offset;
8399 let end_offset = offset + bytes_len;
8400 _next_ordinal_to_read += 1;
8401 if next_offset >= end_offset {
8402 return Ok(());
8403 }
8404
8405 while _next_ordinal_to_read < 1 {
8407 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8408 _next_ordinal_to_read += 1;
8409 next_offset += envelope_size;
8410 }
8411
8412 let next_out_of_line = decoder.next_out_of_line();
8413 let handles_before = decoder.remaining_handles();
8414 if let Some((inlined, num_bytes, num_handles)) =
8415 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8416 {
8417 let member_inline_size = <fidl::encoding::Vector<
8418 fdomain_fuchsia_process::HandleInfo,
8419 128,
8420 > as fidl::encoding::TypeMarker>::inline_size(
8421 decoder.context
8422 );
8423 if inlined != (member_inline_size <= 4) {
8424 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8425 }
8426 let inner_offset;
8427 let mut inner_depth = depth.clone();
8428 if inlined {
8429 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8430 inner_offset = next_offset;
8431 } else {
8432 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8433 inner_depth.increment()?;
8434 }
8435 let val_ref =
8436 self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect));
8437 fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
8438 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8439 {
8440 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8441 }
8442 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8443 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8444 }
8445 }
8446
8447 next_offset += envelope_size;
8448 _next_ordinal_to_read += 1;
8449 if next_offset >= end_offset {
8450 return Ok(());
8451 }
8452
8453 while _next_ordinal_to_read < 2 {
8455 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8456 _next_ordinal_to_read += 1;
8457 next_offset += envelope_size;
8458 }
8459
8460 let next_out_of_line = decoder.next_out_of_line();
8461 let handles_before = decoder.remaining_handles();
8462 if let Some((inlined, num_bytes, num_handles)) =
8463 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8464 {
8465 let member_inline_size = <fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8466 if inlined != (member_inline_size <= 4) {
8467 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8468 }
8469 let inner_offset;
8470 let mut inner_depth = depth.clone();
8471 if inlined {
8472 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8473 inner_offset = next_offset;
8474 } else {
8475 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8476 inner_depth.increment()?;
8477 }
8478 let val_ref =
8479 self.namespace_entries.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect));
8480 fidl::decode!(fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
8481 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8482 {
8483 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8484 }
8485 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8486 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8487 }
8488 }
8489
8490 next_offset += envelope_size;
8491 _next_ordinal_to_read += 1;
8492 if next_offset >= end_offset {
8493 return Ok(());
8494 }
8495
8496 while _next_ordinal_to_read < 3 {
8498 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8499 _next_ordinal_to_read += 1;
8500 next_offset += envelope_size;
8501 }
8502
8503 let next_out_of_line = decoder.next_out_of_line();
8504 let handles_before = decoder.remaining_handles();
8505 if let Some((inlined, num_bytes, num_handles)) =
8506 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8507 {
8508 let member_inline_size = <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8509 if inlined != (member_inline_size <= 4) {
8510 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8511 }
8512 let inner_offset;
8513 let mut inner_depth = depth.clone();
8514 if inlined {
8515 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8516 inner_offset = next_offset;
8517 } else {
8518 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8519 inner_depth.increment()?;
8520 }
8521 let val_ref = self.dictionary.get_or_insert_with(|| {
8522 fidl::new_empty!(
8523 fdomain_fuchsia_component_sandbox::DictionaryRef,
8524 fdomain_client::fidl::FDomainResourceDialect
8525 )
8526 });
8527 fidl::decode!(
8528 fdomain_fuchsia_component_sandbox::DictionaryRef,
8529 fdomain_client::fidl::FDomainResourceDialect,
8530 val_ref,
8531 decoder,
8532 inner_offset,
8533 inner_depth
8534 )?;
8535 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8536 {
8537 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8538 }
8539 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8540 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8541 }
8542 }
8543
8544 next_offset += envelope_size;
8545
8546 while next_offset < end_offset {
8548 _next_ordinal_to_read += 1;
8549 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8550 next_offset += envelope_size;
8551 }
8552
8553 Ok(())
8554 }
8555 }
8556
8557 impl fidl::encoding::ResourceTypeMarker for EventPayload {
8558 type Borrowed<'a> = &'a mut Self;
8559 fn take_or_borrow<'a>(
8560 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8561 ) -> Self::Borrowed<'a> {
8562 value
8563 }
8564 }
8565
8566 unsafe impl fidl::encoding::TypeMarker for EventPayload {
8567 type Owned = Self;
8568
8569 #[inline(always)]
8570 fn inline_align(_context: fidl::encoding::Context) -> usize {
8571 8
8572 }
8573
8574 #[inline(always)]
8575 fn inline_size(_context: fidl::encoding::Context) -> usize {
8576 16
8577 }
8578 }
8579
8580 unsafe impl fidl::encoding::Encode<EventPayload, fdomain_client::fidl::FDomainResourceDialect>
8581 for &mut EventPayload
8582 {
8583 #[inline]
8584 unsafe fn encode(
8585 self,
8586 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8587 offset: usize,
8588 _depth: fidl::encoding::Depth,
8589 ) -> fidl::Result<()> {
8590 encoder.debug_check_bounds::<EventPayload>(offset);
8591 encoder.write_num::<u64>(self.ordinal(), offset);
8592 match self {
8593 EventPayload::CapabilityRequested(ref mut val) => {
8594 fidl::encoding::encode_in_envelope::<CapabilityRequestedPayload, fdomain_client::fidl::FDomainResourceDialect>(
8595 <CapabilityRequestedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
8596 encoder, offset + 8, _depth
8597 )
8598 }
8599 EventPayload::Purged(ref val) => {
8600 fidl::encoding::encode_in_envelope::<PurgedPayload, fdomain_client::fidl::FDomainResourceDialect>(
8601 <PurgedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
8602 encoder, offset + 8, _depth
8603 )
8604 }
8605 EventPayload::Discovered(ref val) => {
8606 fidl::encoding::encode_in_envelope::<DiscoveredPayload, fdomain_client::fidl::FDomainResourceDialect>(
8607 <DiscoveredPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
8608 encoder, offset + 8, _depth
8609 )
8610 }
8611 EventPayload::Destroyed(ref val) => {
8612 fidl::encoding::encode_in_envelope::<DestroyedPayload, fdomain_client::fidl::FDomainResourceDialect>(
8613 <DestroyedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
8614 encoder, offset + 8, _depth
8615 )
8616 }
8617 EventPayload::Resolved(ref val) => {
8618 fidl::encoding::encode_in_envelope::<ResolvedPayload, fdomain_client::fidl::FDomainResourceDialect>(
8619 <ResolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
8620 encoder, offset + 8, _depth
8621 )
8622 }
8623 EventPayload::Started(ref val) => {
8624 fidl::encoding::encode_in_envelope::<StartedPayload, fdomain_client::fidl::FDomainResourceDialect>(
8625 <StartedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
8626 encoder, offset + 8, _depth
8627 )
8628 }
8629 EventPayload::Stopped(ref val) => {
8630 fidl::encoding::encode_in_envelope::<StoppedPayload, fdomain_client::fidl::FDomainResourceDialect>(
8631 <StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
8632 encoder, offset + 8, _depth
8633 )
8634 }
8635 EventPayload::DebugStarted(ref mut val) => {
8636 fidl::encoding::encode_in_envelope::<DebugStartedPayload, fdomain_client::fidl::FDomainResourceDialect>(
8637 <DebugStartedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
8638 encoder, offset + 8, _depth
8639 )
8640 }
8641 EventPayload::Unresolved(ref val) => {
8642 fidl::encoding::encode_in_envelope::<UnresolvedPayload, fdomain_client::fidl::FDomainResourceDialect>(
8643 <UnresolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
8644 encoder, offset + 8, _depth
8645 )
8646 }
8647 EventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
8648 }
8649 }
8650 }
8651
8652 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for EventPayload {
8653 #[inline(always)]
8654 fn new_empty() -> Self {
8655 Self::__SourceBreaking { unknown_ordinal: 0 }
8656 }
8657
8658 #[inline]
8659 unsafe fn decode(
8660 &mut self,
8661 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8662 offset: usize,
8663 mut depth: fidl::encoding::Depth,
8664 ) -> fidl::Result<()> {
8665 decoder.debug_check_bounds::<Self>(offset);
8666 #[allow(unused_variables)]
8667 let next_out_of_line = decoder.next_out_of_line();
8668 let handles_before = decoder.remaining_handles();
8669 let (ordinal, inlined, num_bytes, num_handles) =
8670 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8671
8672 let member_inline_size = match ordinal {
8673 1 => <CapabilityRequestedPayload as fidl::encoding::TypeMarker>::inline_size(
8674 decoder.context,
8675 ),
8676 2 => <PurgedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8677 4 => {
8678 <DiscoveredPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
8679 }
8680 5 => <DestroyedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8681 6 => <ResolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8682 7 => <StartedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8683 8 => <StoppedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8684 9 => <DebugStartedPayload as fidl::encoding::TypeMarker>::inline_size(
8685 decoder.context,
8686 ),
8687 10 => {
8688 <UnresolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
8689 }
8690 0 => return Err(fidl::Error::UnknownUnionTag),
8691 _ => num_bytes as usize,
8692 };
8693
8694 if inlined != (member_inline_size <= 4) {
8695 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8696 }
8697 let _inner_offset;
8698 if inlined {
8699 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8700 _inner_offset = offset + 8;
8701 } else {
8702 depth.increment()?;
8703 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8704 }
8705 match ordinal {
8706 1 => {
8707 #[allow(irrefutable_let_patterns)]
8708 if let EventPayload::CapabilityRequested(_) = self {
8709 } else {
8711 *self = EventPayload::CapabilityRequested(fidl::new_empty!(
8713 CapabilityRequestedPayload,
8714 fdomain_client::fidl::FDomainResourceDialect
8715 ));
8716 }
8717 #[allow(irrefutable_let_patterns)]
8718 if let EventPayload::CapabilityRequested(ref mut val) = self {
8719 fidl::decode!(
8720 CapabilityRequestedPayload,
8721 fdomain_client::fidl::FDomainResourceDialect,
8722 val,
8723 decoder,
8724 _inner_offset,
8725 depth
8726 )?;
8727 } else {
8728 unreachable!()
8729 }
8730 }
8731 2 => {
8732 #[allow(irrefutable_let_patterns)]
8733 if let EventPayload::Purged(_) = self {
8734 } else {
8736 *self = EventPayload::Purged(fidl::new_empty!(
8738 PurgedPayload,
8739 fdomain_client::fidl::FDomainResourceDialect
8740 ));
8741 }
8742 #[allow(irrefutable_let_patterns)]
8743 if let EventPayload::Purged(ref mut val) = self {
8744 fidl::decode!(
8745 PurgedPayload,
8746 fdomain_client::fidl::FDomainResourceDialect,
8747 val,
8748 decoder,
8749 _inner_offset,
8750 depth
8751 )?;
8752 } else {
8753 unreachable!()
8754 }
8755 }
8756 4 => {
8757 #[allow(irrefutable_let_patterns)]
8758 if let EventPayload::Discovered(_) = self {
8759 } else {
8761 *self = EventPayload::Discovered(fidl::new_empty!(
8763 DiscoveredPayload,
8764 fdomain_client::fidl::FDomainResourceDialect
8765 ));
8766 }
8767 #[allow(irrefutable_let_patterns)]
8768 if let EventPayload::Discovered(ref mut val) = self {
8769 fidl::decode!(
8770 DiscoveredPayload,
8771 fdomain_client::fidl::FDomainResourceDialect,
8772 val,
8773 decoder,
8774 _inner_offset,
8775 depth
8776 )?;
8777 } else {
8778 unreachable!()
8779 }
8780 }
8781 5 => {
8782 #[allow(irrefutable_let_patterns)]
8783 if let EventPayload::Destroyed(_) = self {
8784 } else {
8786 *self = EventPayload::Destroyed(fidl::new_empty!(
8788 DestroyedPayload,
8789 fdomain_client::fidl::FDomainResourceDialect
8790 ));
8791 }
8792 #[allow(irrefutable_let_patterns)]
8793 if let EventPayload::Destroyed(ref mut val) = self {
8794 fidl::decode!(
8795 DestroyedPayload,
8796 fdomain_client::fidl::FDomainResourceDialect,
8797 val,
8798 decoder,
8799 _inner_offset,
8800 depth
8801 )?;
8802 } else {
8803 unreachable!()
8804 }
8805 }
8806 6 => {
8807 #[allow(irrefutable_let_patterns)]
8808 if let EventPayload::Resolved(_) = self {
8809 } else {
8811 *self = EventPayload::Resolved(fidl::new_empty!(
8813 ResolvedPayload,
8814 fdomain_client::fidl::FDomainResourceDialect
8815 ));
8816 }
8817 #[allow(irrefutable_let_patterns)]
8818 if let EventPayload::Resolved(ref mut val) = self {
8819 fidl::decode!(
8820 ResolvedPayload,
8821 fdomain_client::fidl::FDomainResourceDialect,
8822 val,
8823 decoder,
8824 _inner_offset,
8825 depth
8826 )?;
8827 } else {
8828 unreachable!()
8829 }
8830 }
8831 7 => {
8832 #[allow(irrefutable_let_patterns)]
8833 if let EventPayload::Started(_) = self {
8834 } else {
8836 *self = EventPayload::Started(fidl::new_empty!(
8838 StartedPayload,
8839 fdomain_client::fidl::FDomainResourceDialect
8840 ));
8841 }
8842 #[allow(irrefutable_let_patterns)]
8843 if let EventPayload::Started(ref mut val) = self {
8844 fidl::decode!(
8845 StartedPayload,
8846 fdomain_client::fidl::FDomainResourceDialect,
8847 val,
8848 decoder,
8849 _inner_offset,
8850 depth
8851 )?;
8852 } else {
8853 unreachable!()
8854 }
8855 }
8856 8 => {
8857 #[allow(irrefutable_let_patterns)]
8858 if let EventPayload::Stopped(_) = self {
8859 } else {
8861 *self = EventPayload::Stopped(fidl::new_empty!(
8863 StoppedPayload,
8864 fdomain_client::fidl::FDomainResourceDialect
8865 ));
8866 }
8867 #[allow(irrefutable_let_patterns)]
8868 if let EventPayload::Stopped(ref mut val) = self {
8869 fidl::decode!(
8870 StoppedPayload,
8871 fdomain_client::fidl::FDomainResourceDialect,
8872 val,
8873 decoder,
8874 _inner_offset,
8875 depth
8876 )?;
8877 } else {
8878 unreachable!()
8879 }
8880 }
8881 9 => {
8882 #[allow(irrefutable_let_patterns)]
8883 if let EventPayload::DebugStarted(_) = self {
8884 } else {
8886 *self = EventPayload::DebugStarted(fidl::new_empty!(
8888 DebugStartedPayload,
8889 fdomain_client::fidl::FDomainResourceDialect
8890 ));
8891 }
8892 #[allow(irrefutable_let_patterns)]
8893 if let EventPayload::DebugStarted(ref mut val) = self {
8894 fidl::decode!(
8895 DebugStartedPayload,
8896 fdomain_client::fidl::FDomainResourceDialect,
8897 val,
8898 decoder,
8899 _inner_offset,
8900 depth
8901 )?;
8902 } else {
8903 unreachable!()
8904 }
8905 }
8906 10 => {
8907 #[allow(irrefutable_let_patterns)]
8908 if let EventPayload::Unresolved(_) = self {
8909 } else {
8911 *self = EventPayload::Unresolved(fidl::new_empty!(
8913 UnresolvedPayload,
8914 fdomain_client::fidl::FDomainResourceDialect
8915 ));
8916 }
8917 #[allow(irrefutable_let_patterns)]
8918 if let EventPayload::Unresolved(ref mut val) = self {
8919 fidl::decode!(
8920 UnresolvedPayload,
8921 fdomain_client::fidl::FDomainResourceDialect,
8922 val,
8923 decoder,
8924 _inner_offset,
8925 depth
8926 )?;
8927 } else {
8928 unreachable!()
8929 }
8930 }
8931 #[allow(deprecated)]
8932 ordinal => {
8933 for _ in 0..num_handles {
8934 decoder.drop_next_handle()?;
8935 }
8936 *self = EventPayload::__SourceBreaking { unknown_ordinal: ordinal };
8937 }
8938 }
8939 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8940 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8941 }
8942 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8943 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8944 }
8945 Ok(())
8946 }
8947 }
8948}