1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_component_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ControllerStartRequest {
16 pub args: StartChildArgs,
17 pub execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ControllerStartRequest {}
21
22#[derive(Debug, PartialEq)]
23pub struct ControllerGetExposedDictionaryResponse {
24 pub dictionary: fidl_fuchsia_component_sandbox::DictionaryRef,
25}
26
27impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
28 for ControllerGetExposedDictionaryResponse
29{
30}
31
32#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33pub struct ControllerIsStartedResponse {
34 pub is_started: bool,
35}
36
37impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
38 for ControllerIsStartedResponse
39{
40}
41
42#[derive(Debug, PartialEq)]
43pub struct EventStreamGetNextResponse {
44 pub events: Vec<Event>,
45}
46
47impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
48 for EventStreamGetNextResponse
49{
50}
51
52#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
53pub struct IntrospectorGetMonikerRequest {
54 pub component_instance: fidl::Event,
55}
56
57impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
58 for IntrospectorGetMonikerRequest
59{
60}
61
62#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
63pub struct NamespaceCreateRequest {
64 pub entries: Vec<NamespaceInputEntry>,
65}
66
67impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceCreateRequest {}
68
69#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct NamespaceInputEntry {
71 pub path: String,
72 pub dictionary: fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
73}
74
75impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceInputEntry {}
76
77#[derive(Debug, PartialEq)]
78pub struct NamespaceCreateResponse {
79 pub entries: Vec<NamespaceEntry>,
80}
81
82impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceCreateResponse {}
83
84#[derive(Debug, PartialEq)]
85pub struct RealmCreateChildRequest {
86 pub collection: fidl_fuchsia_component_decl::CollectionRef,
87 pub decl: fidl_fuchsia_component_decl::Child,
88 pub args: CreateChildArgs,
89}
90
91impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmCreateChildRequest {}
92
93#[derive(Debug, PartialEq)]
94pub struct RealmListChildrenRequest {
95 pub collection: fidl_fuchsia_component_decl::CollectionRef,
96 pub iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
97}
98
99impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmListChildrenRequest {}
100
101#[derive(Debug, PartialEq)]
102pub struct RealmOpenControllerRequest {
103 pub child: fidl_fuchsia_component_decl::ChildRef,
104 pub controller: fidl::endpoints::ServerEnd<ControllerMarker>,
105}
106
107impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
108 for RealmOpenControllerRequest
109{
110}
111
112#[derive(Debug, PartialEq)]
113pub struct RealmOpenExposedDirRequest {
114 pub child: fidl_fuchsia_component_decl::ChildRef,
115 pub exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
116}
117
118impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
119 for RealmOpenExposedDirRequest
120{
121}
122
123#[derive(Debug, Default, PartialEq)]
125pub struct CapabilityRequestedPayload {
126 pub name: Option<String>,
128 pub capability: Option<fidl::Channel>,
131 #[doc(hidden)]
132 pub __source_breaking: fidl::marker::SourceBreaking,
133}
134
135impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
136 for CapabilityRequestedPayload
137{
138}
139
140#[derive(Debug, Default, PartialEq)]
141pub struct CreateChildArgs {
142 pub numbered_handles: Option<Vec<fidl_fuchsia_process::HandleInfo>>,
147 pub dynamic_offers: Option<Vec<fidl_fuchsia_component_decl::Offer>>,
171 pub controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
174 pub dictionary: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
176 #[doc(hidden)]
177 pub __source_breaking: fidl::marker::SourceBreaking,
178}
179
180impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateChildArgs {}
181
182#[derive(Debug, Default, PartialEq)]
184pub struct DebugStartedPayload {
185 pub runtime_dir: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
190 pub break_on_start: Option<fidl::EventPair>,
195 #[doc(hidden)]
196 pub __source_breaking: fidl::marker::SourceBreaking,
197}
198
199impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DebugStartedPayload {}
200
201#[derive(Debug, Default, PartialEq)]
203pub struct DirectoryReadyPayload {
204 pub name: Option<String>,
206 pub node: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::NodeMarker>>,
208 #[doc(hidden)]
209 pub __source_breaking: fidl::marker::SourceBreaking,
210}
211
212impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryReadyPayload {}
213
214#[derive(Debug, Default, PartialEq)]
216pub struct Event {
217 pub header: Option<EventHeader>,
219 pub payload: Option<EventPayload>,
221 #[doc(hidden)]
222 pub __source_breaking: fidl::marker::SourceBreaking,
223}
224
225impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Event {}
226
227#[derive(Debug, Default, PartialEq)]
231pub struct NamespaceEntry {
232 pub path: Option<String>,
235 pub directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
237 #[doc(hidden)]
238 pub __source_breaking: fidl::marker::SourceBreaking,
239}
240
241impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceEntry {}
242
243#[derive(Debug, Default, PartialEq)]
244pub struct StartChildArgs {
245 pub numbered_handles: Option<Vec<fidl_fuchsia_process::HandleInfo>>,
253 pub namespace_entries: Option<Vec<NamespaceEntry>>,
260 pub dictionary: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
262 #[doc(hidden)]
263 pub __source_breaking: fidl::marker::SourceBreaking,
264}
265
266impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StartChildArgs {}
267
268#[derive(Debug)]
270pub enum EventPayload {
271 CapabilityRequested(CapabilityRequestedPayload),
273 Purged(PurgedPayload),
275 DirectoryReady(DirectoryReadyPayload),
277 Discovered(DiscoveredPayload),
279 Destroyed(DestroyedPayload),
281 Resolved(ResolvedPayload),
283 Started(StartedPayload),
285 Stopped(StoppedPayload),
287 DebugStarted(DebugStartedPayload),
289 Unresolved(UnresolvedPayload),
291 #[doc(hidden)]
292 __SourceBreaking { unknown_ordinal: u64 },
293}
294
295#[macro_export]
297macro_rules! EventPayloadUnknown {
298 () => {
299 _
300 };
301}
302
303impl PartialEq for EventPayload {
305 fn eq(&self, other: &Self) -> bool {
306 match (self, other) {
307 (Self::CapabilityRequested(x), Self::CapabilityRequested(y)) => *x == *y,
308 (Self::Purged(x), Self::Purged(y)) => *x == *y,
309 (Self::DirectoryReady(x), Self::DirectoryReady(y)) => *x == *y,
310 (Self::Discovered(x), Self::Discovered(y)) => *x == *y,
311 (Self::Destroyed(x), Self::Destroyed(y)) => *x == *y,
312 (Self::Resolved(x), Self::Resolved(y)) => *x == *y,
313 (Self::Started(x), Self::Started(y)) => *x == *y,
314 (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
315 (Self::DebugStarted(x), Self::DebugStarted(y)) => *x == *y,
316 (Self::Unresolved(x), Self::Unresolved(y)) => *x == *y,
317 _ => false,
318 }
319 }
320}
321
322impl EventPayload {
323 #[inline]
324 pub fn ordinal(&self) -> u64 {
325 match *self {
326 Self::CapabilityRequested(_) => 1,
327 Self::Purged(_) => 2,
328 Self::DirectoryReady(_) => 3,
329 Self::Discovered(_) => 4,
330 Self::Destroyed(_) => 5,
331 Self::Resolved(_) => 6,
332 Self::Started(_) => 7,
333 Self::Stopped(_) => 8,
334 Self::DebugStarted(_) => 9,
335 Self::Unresolved(_) => 10,
336 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
337 }
338 }
339
340 #[inline]
341 pub fn unknown_variant_for_testing() -> Self {
342 Self::__SourceBreaking { unknown_ordinal: 0 }
343 }
344
345 #[inline]
346 pub fn is_unknown(&self) -> bool {
347 match self {
348 Self::__SourceBreaking { .. } => true,
349 _ => false,
350 }
351 }
352}
353
354impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EventPayload {}
355
356#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
357pub struct BinderMarker;
358
359impl fidl::endpoints::ProtocolMarker for BinderMarker {
360 type Proxy = BinderProxy;
361 type RequestStream = BinderRequestStream;
362 #[cfg(target_os = "fuchsia")]
363 type SynchronousProxy = BinderSynchronousProxy;
364
365 const DEBUG_NAME: &'static str = "fuchsia.component.Binder";
366}
367impl fidl::endpoints::DiscoverableProtocolMarker for BinderMarker {}
368
369pub trait BinderProxyInterface: Send + Sync {}
370#[derive(Debug)]
371#[cfg(target_os = "fuchsia")]
372pub struct BinderSynchronousProxy {
373 client: fidl::client::sync::Client,
374}
375
376#[cfg(target_os = "fuchsia")]
377impl fidl::endpoints::SynchronousProxy for BinderSynchronousProxy {
378 type Proxy = BinderProxy;
379 type Protocol = BinderMarker;
380
381 fn from_channel(inner: fidl::Channel) -> Self {
382 Self::new(inner)
383 }
384
385 fn into_channel(self) -> fidl::Channel {
386 self.client.into_channel()
387 }
388
389 fn as_channel(&self) -> &fidl::Channel {
390 self.client.as_channel()
391 }
392}
393
394#[cfg(target_os = "fuchsia")]
395impl BinderSynchronousProxy {
396 pub fn new(channel: fidl::Channel) -> Self {
397 let protocol_name = <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
398 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
399 }
400
401 pub fn into_channel(self) -> fidl::Channel {
402 self.client.into_channel()
403 }
404
405 pub fn wait_for_event(
408 &self,
409 deadline: zx::MonotonicInstant,
410 ) -> Result<BinderEvent, fidl::Error> {
411 BinderEvent::decode(self.client.wait_for_event(deadline)?)
412 }
413}
414
415#[cfg(target_os = "fuchsia")]
416impl From<BinderSynchronousProxy> for zx::Handle {
417 fn from(value: BinderSynchronousProxy) -> Self {
418 value.into_channel().into()
419 }
420}
421
422#[cfg(target_os = "fuchsia")]
423impl From<fidl::Channel> for BinderSynchronousProxy {
424 fn from(value: fidl::Channel) -> Self {
425 Self::new(value)
426 }
427}
428
429#[derive(Debug, Clone)]
430pub struct BinderProxy {
431 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
432}
433
434impl fidl::endpoints::Proxy for BinderProxy {
435 type Protocol = BinderMarker;
436
437 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
438 Self::new(inner)
439 }
440
441 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
442 self.client.into_channel().map_err(|client| Self { client })
443 }
444
445 fn as_channel(&self) -> &::fidl::AsyncChannel {
446 self.client.as_channel()
447 }
448}
449
450impl BinderProxy {
451 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
453 let protocol_name = <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
454 Self { client: fidl::client::Client::new(channel, protocol_name) }
455 }
456
457 pub fn take_event_stream(&self) -> BinderEventStream {
463 BinderEventStream { event_receiver: self.client.take_event_receiver() }
464 }
465}
466
467impl BinderProxyInterface for BinderProxy {}
468
469pub struct BinderEventStream {
470 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
471}
472
473impl std::marker::Unpin for BinderEventStream {}
474
475impl futures::stream::FusedStream for BinderEventStream {
476 fn is_terminated(&self) -> bool {
477 self.event_receiver.is_terminated()
478 }
479}
480
481impl futures::Stream for BinderEventStream {
482 type Item = Result<BinderEvent, fidl::Error>;
483
484 fn poll_next(
485 mut self: std::pin::Pin<&mut Self>,
486 cx: &mut std::task::Context<'_>,
487 ) -> std::task::Poll<Option<Self::Item>> {
488 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
489 &mut self.event_receiver,
490 cx
491 )?) {
492 Some(buf) => std::task::Poll::Ready(Some(BinderEvent::decode(buf))),
493 None => std::task::Poll::Ready(None),
494 }
495 }
496}
497
498#[derive(Debug)]
499pub enum BinderEvent {}
500
501impl BinderEvent {
502 fn decode(
504 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
505 ) -> Result<BinderEvent, fidl::Error> {
506 let (bytes, _handles) = buf.split_mut();
507 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
508 debug_assert_eq!(tx_header.tx_id, 0);
509 match tx_header.ordinal {
510 _ => Err(fidl::Error::UnknownOrdinal {
511 ordinal: tx_header.ordinal,
512 protocol_name: <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
513 }),
514 }
515 }
516}
517
518pub struct BinderRequestStream {
520 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
521 is_terminated: bool,
522}
523
524impl std::marker::Unpin for BinderRequestStream {}
525
526impl futures::stream::FusedStream for BinderRequestStream {
527 fn is_terminated(&self) -> bool {
528 self.is_terminated
529 }
530}
531
532impl fidl::endpoints::RequestStream for BinderRequestStream {
533 type Protocol = BinderMarker;
534 type ControlHandle = BinderControlHandle;
535
536 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
537 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
538 }
539
540 fn control_handle(&self) -> Self::ControlHandle {
541 BinderControlHandle { inner: self.inner.clone() }
542 }
543
544 fn into_inner(
545 self,
546 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
547 {
548 (self.inner, self.is_terminated)
549 }
550
551 fn from_inner(
552 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
553 is_terminated: bool,
554 ) -> Self {
555 Self { inner, is_terminated }
556 }
557}
558
559impl futures::Stream for BinderRequestStream {
560 type Item = Result<BinderRequest, fidl::Error>;
561
562 fn poll_next(
563 mut self: std::pin::Pin<&mut Self>,
564 cx: &mut std::task::Context<'_>,
565 ) -> std::task::Poll<Option<Self::Item>> {
566 let this = &mut *self;
567 if this.inner.check_shutdown(cx) {
568 this.is_terminated = true;
569 return std::task::Poll::Ready(None);
570 }
571 if this.is_terminated {
572 panic!("polled BinderRequestStream after completion");
573 }
574 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
575 |bytes, handles| {
576 match this.inner.channel().read_etc(cx, bytes, handles) {
577 std::task::Poll::Ready(Ok(())) => {}
578 std::task::Poll::Pending => return std::task::Poll::Pending,
579 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
580 this.is_terminated = true;
581 return std::task::Poll::Ready(None);
582 }
583 std::task::Poll::Ready(Err(e)) => {
584 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
585 e.into(),
586 ))))
587 }
588 }
589
590 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
592
593 std::task::Poll::Ready(Some(match header.ordinal {
594 _ => Err(fidl::Error::UnknownOrdinal {
595 ordinal: header.ordinal,
596 protocol_name:
597 <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
598 }),
599 }))
600 },
601 )
602 }
603}
604
605#[derive(Debug)]
616pub enum BinderRequest {}
617
618impl BinderRequest {
619 pub fn method_name(&self) -> &'static str {
621 match *self {}
622 }
623}
624
625#[derive(Debug, Clone)]
626pub struct BinderControlHandle {
627 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
628}
629
630impl fidl::endpoints::ControlHandle for BinderControlHandle {
631 fn shutdown(&self) {
632 self.inner.shutdown()
633 }
634 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
635 self.inner.shutdown_with_epitaph(status)
636 }
637
638 fn is_closed(&self) -> bool {
639 self.inner.channel().is_closed()
640 }
641 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
642 self.inner.channel().on_closed()
643 }
644
645 #[cfg(target_os = "fuchsia")]
646 fn signal_peer(
647 &self,
648 clear_mask: zx::Signals,
649 set_mask: zx::Signals,
650 ) -> Result<(), zx_status::Status> {
651 use fidl::Peered;
652 self.inner.channel().signal_peer(clear_mask, set_mask)
653 }
654}
655
656impl BinderControlHandle {}
657
658#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
659pub struct ChildIteratorMarker;
660
661impl fidl::endpoints::ProtocolMarker for ChildIteratorMarker {
662 type Proxy = ChildIteratorProxy;
663 type RequestStream = ChildIteratorRequestStream;
664 #[cfg(target_os = "fuchsia")]
665 type SynchronousProxy = ChildIteratorSynchronousProxy;
666
667 const DEBUG_NAME: &'static str = "(anonymous) ChildIterator";
668}
669
670pub trait ChildIteratorProxyInterface: Send + Sync {
671 type NextResponseFut: std::future::Future<
672 Output = Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error>,
673 > + Send;
674 fn r#next(&self) -> Self::NextResponseFut;
675}
676#[derive(Debug)]
677#[cfg(target_os = "fuchsia")]
678pub struct ChildIteratorSynchronousProxy {
679 client: fidl::client::sync::Client,
680}
681
682#[cfg(target_os = "fuchsia")]
683impl fidl::endpoints::SynchronousProxy for ChildIteratorSynchronousProxy {
684 type Proxy = ChildIteratorProxy;
685 type Protocol = ChildIteratorMarker;
686
687 fn from_channel(inner: fidl::Channel) -> Self {
688 Self::new(inner)
689 }
690
691 fn into_channel(self) -> fidl::Channel {
692 self.client.into_channel()
693 }
694
695 fn as_channel(&self) -> &fidl::Channel {
696 self.client.as_channel()
697 }
698}
699
700#[cfg(target_os = "fuchsia")]
701impl ChildIteratorSynchronousProxy {
702 pub fn new(channel: fidl::Channel) -> Self {
703 let protocol_name = <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
704 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
705 }
706
707 pub fn into_channel(self) -> fidl::Channel {
708 self.client.into_channel()
709 }
710
711 pub fn wait_for_event(
714 &self,
715 deadline: zx::MonotonicInstant,
716 ) -> Result<ChildIteratorEvent, fidl::Error> {
717 ChildIteratorEvent::decode(self.client.wait_for_event(deadline)?)
718 }
719
720 pub fn r#next(
725 &self,
726 ___deadline: zx::MonotonicInstant,
727 ) -> Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error> {
728 let _response =
729 self.client.send_query::<fidl::encoding::EmptyPayload, ChildIteratorNextResponse>(
730 (),
731 0x40e4c3882b050d08,
732 fidl::encoding::DynamicFlags::empty(),
733 ___deadline,
734 )?;
735 Ok(_response.children)
736 }
737}
738
739#[cfg(target_os = "fuchsia")]
740impl From<ChildIteratorSynchronousProxy> for zx::Handle {
741 fn from(value: ChildIteratorSynchronousProxy) -> Self {
742 value.into_channel().into()
743 }
744}
745
746#[cfg(target_os = "fuchsia")]
747impl From<fidl::Channel> for ChildIteratorSynchronousProxy {
748 fn from(value: fidl::Channel) -> Self {
749 Self::new(value)
750 }
751}
752
753#[derive(Debug, Clone)]
754pub struct ChildIteratorProxy {
755 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
756}
757
758impl fidl::endpoints::Proxy for ChildIteratorProxy {
759 type Protocol = ChildIteratorMarker;
760
761 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
762 Self::new(inner)
763 }
764
765 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
766 self.client.into_channel().map_err(|client| Self { client })
767 }
768
769 fn as_channel(&self) -> &::fidl::AsyncChannel {
770 self.client.as_channel()
771 }
772}
773
774impl ChildIteratorProxy {
775 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
777 let protocol_name = <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
778 Self { client: fidl::client::Client::new(channel, protocol_name) }
779 }
780
781 pub fn take_event_stream(&self) -> ChildIteratorEventStream {
787 ChildIteratorEventStream { event_receiver: self.client.take_event_receiver() }
788 }
789
790 pub fn r#next(
795 &self,
796 ) -> fidl::client::QueryResponseFut<
797 Vec<fidl_fuchsia_component_decl::ChildRef>,
798 fidl::encoding::DefaultFuchsiaResourceDialect,
799 > {
800 ChildIteratorProxyInterface::r#next(self)
801 }
802}
803
804impl ChildIteratorProxyInterface for ChildIteratorProxy {
805 type NextResponseFut = fidl::client::QueryResponseFut<
806 Vec<fidl_fuchsia_component_decl::ChildRef>,
807 fidl::encoding::DefaultFuchsiaResourceDialect,
808 >;
809 fn r#next(&self) -> Self::NextResponseFut {
810 fn _decode(
811 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
812 ) -> Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error> {
813 let _response = fidl::client::decode_transaction_body::<
814 ChildIteratorNextResponse,
815 fidl::encoding::DefaultFuchsiaResourceDialect,
816 0x40e4c3882b050d08,
817 >(_buf?)?;
818 Ok(_response.children)
819 }
820 self.client.send_query_and_decode::<
821 fidl::encoding::EmptyPayload,
822 Vec<fidl_fuchsia_component_decl::ChildRef>,
823 >(
824 (),
825 0x40e4c3882b050d08,
826 fidl::encoding::DynamicFlags::empty(),
827 _decode,
828 )
829 }
830}
831
832pub struct ChildIteratorEventStream {
833 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
834}
835
836impl std::marker::Unpin for ChildIteratorEventStream {}
837
838impl futures::stream::FusedStream for ChildIteratorEventStream {
839 fn is_terminated(&self) -> bool {
840 self.event_receiver.is_terminated()
841 }
842}
843
844impl futures::Stream for ChildIteratorEventStream {
845 type Item = Result<ChildIteratorEvent, fidl::Error>;
846
847 fn poll_next(
848 mut self: std::pin::Pin<&mut Self>,
849 cx: &mut std::task::Context<'_>,
850 ) -> std::task::Poll<Option<Self::Item>> {
851 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
852 &mut self.event_receiver,
853 cx
854 )?) {
855 Some(buf) => std::task::Poll::Ready(Some(ChildIteratorEvent::decode(buf))),
856 None => std::task::Poll::Ready(None),
857 }
858 }
859}
860
861#[derive(Debug)]
862pub enum ChildIteratorEvent {}
863
864impl ChildIteratorEvent {
865 fn decode(
867 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
868 ) -> Result<ChildIteratorEvent, fidl::Error> {
869 let (bytes, _handles) = buf.split_mut();
870 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
871 debug_assert_eq!(tx_header.tx_id, 0);
872 match tx_header.ordinal {
873 _ => Err(fidl::Error::UnknownOrdinal {
874 ordinal: tx_header.ordinal,
875 protocol_name: <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
876 }),
877 }
878 }
879}
880
881pub struct ChildIteratorRequestStream {
883 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
884 is_terminated: bool,
885}
886
887impl std::marker::Unpin for ChildIteratorRequestStream {}
888
889impl futures::stream::FusedStream for ChildIteratorRequestStream {
890 fn is_terminated(&self) -> bool {
891 self.is_terminated
892 }
893}
894
895impl fidl::endpoints::RequestStream for ChildIteratorRequestStream {
896 type Protocol = ChildIteratorMarker;
897 type ControlHandle = ChildIteratorControlHandle;
898
899 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
900 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
901 }
902
903 fn control_handle(&self) -> Self::ControlHandle {
904 ChildIteratorControlHandle { inner: self.inner.clone() }
905 }
906
907 fn into_inner(
908 self,
909 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
910 {
911 (self.inner, self.is_terminated)
912 }
913
914 fn from_inner(
915 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
916 is_terminated: bool,
917 ) -> Self {
918 Self { inner, is_terminated }
919 }
920}
921
922impl futures::Stream for ChildIteratorRequestStream {
923 type Item = Result<ChildIteratorRequest, fidl::Error>;
924
925 fn poll_next(
926 mut self: std::pin::Pin<&mut Self>,
927 cx: &mut std::task::Context<'_>,
928 ) -> std::task::Poll<Option<Self::Item>> {
929 let this = &mut *self;
930 if this.inner.check_shutdown(cx) {
931 this.is_terminated = true;
932 return std::task::Poll::Ready(None);
933 }
934 if this.is_terminated {
935 panic!("polled ChildIteratorRequestStream after completion");
936 }
937 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
938 |bytes, handles| {
939 match this.inner.channel().read_etc(cx, bytes, handles) {
940 std::task::Poll::Ready(Ok(())) => {}
941 std::task::Poll::Pending => return std::task::Poll::Pending,
942 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
943 this.is_terminated = true;
944 return std::task::Poll::Ready(None);
945 }
946 std::task::Poll::Ready(Err(e)) => {
947 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
948 e.into(),
949 ))))
950 }
951 }
952
953 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
955
956 std::task::Poll::Ready(Some(match header.ordinal {
957 0x40e4c3882b050d08 => {
958 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
959 let mut req = fidl::new_empty!(
960 fidl::encoding::EmptyPayload,
961 fidl::encoding::DefaultFuchsiaResourceDialect
962 );
963 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
964 let control_handle =
965 ChildIteratorControlHandle { inner: this.inner.clone() };
966 Ok(ChildIteratorRequest::Next {
967 responder: ChildIteratorNextResponder {
968 control_handle: std::mem::ManuallyDrop::new(control_handle),
969 tx_id: header.tx_id,
970 },
971 })
972 }
973 _ => Err(fidl::Error::UnknownOrdinal {
974 ordinal: header.ordinal,
975 protocol_name:
976 <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
977 }),
978 }))
979 },
980 )
981 }
982}
983
984#[derive(Debug)]
986pub enum ChildIteratorRequest {
987 Next { responder: ChildIteratorNextResponder },
992}
993
994impl ChildIteratorRequest {
995 #[allow(irrefutable_let_patterns)]
996 pub fn into_next(self) -> Option<(ChildIteratorNextResponder)> {
997 if let ChildIteratorRequest::Next { responder } = self {
998 Some((responder))
999 } else {
1000 None
1001 }
1002 }
1003
1004 pub fn method_name(&self) -> &'static str {
1006 match *self {
1007 ChildIteratorRequest::Next { .. } => "next",
1008 }
1009 }
1010}
1011
1012#[derive(Debug, Clone)]
1013pub struct ChildIteratorControlHandle {
1014 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1015}
1016
1017impl fidl::endpoints::ControlHandle for ChildIteratorControlHandle {
1018 fn shutdown(&self) {
1019 self.inner.shutdown()
1020 }
1021 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1022 self.inner.shutdown_with_epitaph(status)
1023 }
1024
1025 fn is_closed(&self) -> bool {
1026 self.inner.channel().is_closed()
1027 }
1028 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1029 self.inner.channel().on_closed()
1030 }
1031
1032 #[cfg(target_os = "fuchsia")]
1033 fn signal_peer(
1034 &self,
1035 clear_mask: zx::Signals,
1036 set_mask: zx::Signals,
1037 ) -> Result<(), zx_status::Status> {
1038 use fidl::Peered;
1039 self.inner.channel().signal_peer(clear_mask, set_mask)
1040 }
1041}
1042
1043impl ChildIteratorControlHandle {}
1044
1045#[must_use = "FIDL methods require a response to be sent"]
1046#[derive(Debug)]
1047pub struct ChildIteratorNextResponder {
1048 control_handle: std::mem::ManuallyDrop<ChildIteratorControlHandle>,
1049 tx_id: u32,
1050}
1051
1052impl std::ops::Drop for ChildIteratorNextResponder {
1056 fn drop(&mut self) {
1057 self.control_handle.shutdown();
1058 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1060 }
1061}
1062
1063impl fidl::endpoints::Responder for ChildIteratorNextResponder {
1064 type ControlHandle = ChildIteratorControlHandle;
1065
1066 fn control_handle(&self) -> &ChildIteratorControlHandle {
1067 &self.control_handle
1068 }
1069
1070 fn drop_without_shutdown(mut self) {
1071 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1073 std::mem::forget(self);
1075 }
1076}
1077
1078impl ChildIteratorNextResponder {
1079 pub fn send(
1083 self,
1084 mut children: &[fidl_fuchsia_component_decl::ChildRef],
1085 ) -> Result<(), fidl::Error> {
1086 let _result = self.send_raw(children);
1087 if _result.is_err() {
1088 self.control_handle.shutdown();
1089 }
1090 self.drop_without_shutdown();
1091 _result
1092 }
1093
1094 pub fn send_no_shutdown_on_err(
1096 self,
1097 mut children: &[fidl_fuchsia_component_decl::ChildRef],
1098 ) -> Result<(), fidl::Error> {
1099 let _result = self.send_raw(children);
1100 self.drop_without_shutdown();
1101 _result
1102 }
1103
1104 fn send_raw(
1105 &self,
1106 mut children: &[fidl_fuchsia_component_decl::ChildRef],
1107 ) -> Result<(), fidl::Error> {
1108 self.control_handle.inner.send::<ChildIteratorNextResponse>(
1109 (children,),
1110 self.tx_id,
1111 0x40e4c3882b050d08,
1112 fidl::encoding::DynamicFlags::empty(),
1113 )
1114 }
1115}
1116
1117#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1118pub struct ControllerMarker;
1119
1120impl fidl::endpoints::ProtocolMarker for ControllerMarker {
1121 type Proxy = ControllerProxy;
1122 type RequestStream = ControllerRequestStream;
1123 #[cfg(target_os = "fuchsia")]
1124 type SynchronousProxy = ControllerSynchronousProxy;
1125
1126 const DEBUG_NAME: &'static str = "(anonymous) Controller";
1127}
1128pub type ControllerStartResult = Result<(), Error>;
1129pub type ControllerIsStartedResult = Result<bool, Error>;
1130pub type ControllerGetExposedDictionaryResult =
1131 Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>;
1132pub type ControllerDestroyResult = Result<(), Error>;
1133
1134pub trait ControllerProxyInterface: Send + Sync {
1135 type StartResponseFut: std::future::Future<Output = Result<ControllerStartResult, fidl::Error>>
1136 + Send;
1137 fn r#start(
1138 &self,
1139 args: StartChildArgs,
1140 execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1141 ) -> Self::StartResponseFut;
1142 type IsStartedResponseFut: std::future::Future<Output = Result<ControllerIsStartedResult, fidl::Error>>
1143 + Send;
1144 fn r#is_started(&self) -> Self::IsStartedResponseFut;
1145 type GetExposedDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetExposedDictionaryResult, fidl::Error>>
1146 + Send;
1147 fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut;
1148 type DestroyResponseFut: std::future::Future<Output = Result<ControllerDestroyResult, fidl::Error>>
1149 + Send;
1150 fn r#destroy(&self) -> Self::DestroyResponseFut;
1151}
1152#[derive(Debug)]
1153#[cfg(target_os = "fuchsia")]
1154pub struct ControllerSynchronousProxy {
1155 client: fidl::client::sync::Client,
1156}
1157
1158#[cfg(target_os = "fuchsia")]
1159impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
1160 type Proxy = ControllerProxy;
1161 type Protocol = ControllerMarker;
1162
1163 fn from_channel(inner: fidl::Channel) -> Self {
1164 Self::new(inner)
1165 }
1166
1167 fn into_channel(self) -> fidl::Channel {
1168 self.client.into_channel()
1169 }
1170
1171 fn as_channel(&self) -> &fidl::Channel {
1172 self.client.as_channel()
1173 }
1174}
1175
1176#[cfg(target_os = "fuchsia")]
1177impl ControllerSynchronousProxy {
1178 pub fn new(channel: fidl::Channel) -> Self {
1179 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1180 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1181 }
1182
1183 pub fn into_channel(self) -> fidl::Channel {
1184 self.client.into_channel()
1185 }
1186
1187 pub fn wait_for_event(
1190 &self,
1191 deadline: zx::MonotonicInstant,
1192 ) -> Result<ControllerEvent, fidl::Error> {
1193 ControllerEvent::decode(self.client.wait_for_event(deadline)?)
1194 }
1195
1196 pub fn r#start(
1200 &self,
1201 mut args: StartChildArgs,
1202 mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1203 ___deadline: zx::MonotonicInstant,
1204 ) -> Result<ControllerStartResult, fidl::Error> {
1205 let _response = self.client.send_query::<
1206 ControllerStartRequest,
1207 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1208 >(
1209 (&mut args, execution_controller,),
1210 0x68878076b8d2eac5,
1211 fidl::encoding::DynamicFlags::FLEXIBLE,
1212 ___deadline,
1213 )?
1214 .into_result::<ControllerMarker>("start")?;
1215 Ok(_response.map(|x| x))
1216 }
1217
1218 pub fn r#is_started(
1220 &self,
1221 ___deadline: zx::MonotonicInstant,
1222 ) -> Result<ControllerIsStartedResult, fidl::Error> {
1223 let _response = self.client.send_query::<
1224 fidl::encoding::EmptyPayload,
1225 fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1226 >(
1227 (),
1228 0x2155e6e1db2083c3,
1229 fidl::encoding::DynamicFlags::FLEXIBLE,
1230 ___deadline,
1231 )?
1232 .into_result::<ControllerMarker>("is_started")?;
1233 Ok(_response.map(|x| x.is_started))
1234 }
1235
1236 pub fn r#get_exposed_dictionary(
1238 &self,
1239 ___deadline: zx::MonotonicInstant,
1240 ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1241 let _response = self.client.send_query::<
1242 fidl::encoding::EmptyPayload,
1243 fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1244 >(
1245 (),
1246 0x7e48373e5eda1f9b,
1247 fidl::encoding::DynamicFlags::FLEXIBLE,
1248 ___deadline,
1249 )?
1250 .into_result::<ControllerMarker>("get_exposed_dictionary")?;
1251 Ok(_response.map(|x| x.dictionary))
1252 }
1253
1254 pub fn r#destroy(
1269 &self,
1270 ___deadline: zx::MonotonicInstant,
1271 ) -> Result<ControllerDestroyResult, fidl::Error> {
1272 let _response = self.client.send_query::<
1273 fidl::encoding::EmptyPayload,
1274 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1275 >(
1276 (),
1277 0x74529fa68b5c1741,
1278 fidl::encoding::DynamicFlags::FLEXIBLE,
1279 ___deadline,
1280 )?
1281 .into_result::<ControllerMarker>("destroy")?;
1282 Ok(_response.map(|x| x))
1283 }
1284}
1285
1286#[cfg(target_os = "fuchsia")]
1287impl From<ControllerSynchronousProxy> for zx::Handle {
1288 fn from(value: ControllerSynchronousProxy) -> Self {
1289 value.into_channel().into()
1290 }
1291}
1292
1293#[cfg(target_os = "fuchsia")]
1294impl From<fidl::Channel> for ControllerSynchronousProxy {
1295 fn from(value: fidl::Channel) -> Self {
1296 Self::new(value)
1297 }
1298}
1299
1300#[derive(Debug, Clone)]
1301pub struct ControllerProxy {
1302 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1303}
1304
1305impl fidl::endpoints::Proxy for ControllerProxy {
1306 type Protocol = ControllerMarker;
1307
1308 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1309 Self::new(inner)
1310 }
1311
1312 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1313 self.client.into_channel().map_err(|client| Self { client })
1314 }
1315
1316 fn as_channel(&self) -> &::fidl::AsyncChannel {
1317 self.client.as_channel()
1318 }
1319}
1320
1321impl ControllerProxy {
1322 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1324 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1325 Self { client: fidl::client::Client::new(channel, protocol_name) }
1326 }
1327
1328 pub fn take_event_stream(&self) -> ControllerEventStream {
1334 ControllerEventStream { event_receiver: self.client.take_event_receiver() }
1335 }
1336
1337 pub fn r#start(
1341 &self,
1342 mut args: StartChildArgs,
1343 mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1344 ) -> fidl::client::QueryResponseFut<
1345 ControllerStartResult,
1346 fidl::encoding::DefaultFuchsiaResourceDialect,
1347 > {
1348 ControllerProxyInterface::r#start(self, args, execution_controller)
1349 }
1350
1351 pub fn r#is_started(
1353 &self,
1354 ) -> fidl::client::QueryResponseFut<
1355 ControllerIsStartedResult,
1356 fidl::encoding::DefaultFuchsiaResourceDialect,
1357 > {
1358 ControllerProxyInterface::r#is_started(self)
1359 }
1360
1361 pub fn r#get_exposed_dictionary(
1363 &self,
1364 ) -> fidl::client::QueryResponseFut<
1365 ControllerGetExposedDictionaryResult,
1366 fidl::encoding::DefaultFuchsiaResourceDialect,
1367 > {
1368 ControllerProxyInterface::r#get_exposed_dictionary(self)
1369 }
1370
1371 pub fn r#destroy(
1386 &self,
1387 ) -> fidl::client::QueryResponseFut<
1388 ControllerDestroyResult,
1389 fidl::encoding::DefaultFuchsiaResourceDialect,
1390 > {
1391 ControllerProxyInterface::r#destroy(self)
1392 }
1393}
1394
1395impl ControllerProxyInterface for ControllerProxy {
1396 type StartResponseFut = fidl::client::QueryResponseFut<
1397 ControllerStartResult,
1398 fidl::encoding::DefaultFuchsiaResourceDialect,
1399 >;
1400 fn r#start(
1401 &self,
1402 mut args: StartChildArgs,
1403 mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1404 ) -> Self::StartResponseFut {
1405 fn _decode(
1406 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1407 ) -> Result<ControllerStartResult, fidl::Error> {
1408 let _response = fidl::client::decode_transaction_body::<
1409 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1410 fidl::encoding::DefaultFuchsiaResourceDialect,
1411 0x68878076b8d2eac5,
1412 >(_buf?)?
1413 .into_result::<ControllerMarker>("start")?;
1414 Ok(_response.map(|x| x))
1415 }
1416 self.client.send_query_and_decode::<ControllerStartRequest, ControllerStartResult>(
1417 (&mut args, execution_controller),
1418 0x68878076b8d2eac5,
1419 fidl::encoding::DynamicFlags::FLEXIBLE,
1420 _decode,
1421 )
1422 }
1423
1424 type IsStartedResponseFut = fidl::client::QueryResponseFut<
1425 ControllerIsStartedResult,
1426 fidl::encoding::DefaultFuchsiaResourceDialect,
1427 >;
1428 fn r#is_started(&self) -> Self::IsStartedResponseFut {
1429 fn _decode(
1430 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1431 ) -> Result<ControllerIsStartedResult, fidl::Error> {
1432 let _response = fidl::client::decode_transaction_body::<
1433 fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1434 fidl::encoding::DefaultFuchsiaResourceDialect,
1435 0x2155e6e1db2083c3,
1436 >(_buf?)?
1437 .into_result::<ControllerMarker>("is_started")?;
1438 Ok(_response.map(|x| x.is_started))
1439 }
1440 self.client
1441 .send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerIsStartedResult>(
1442 (),
1443 0x2155e6e1db2083c3,
1444 fidl::encoding::DynamicFlags::FLEXIBLE,
1445 _decode,
1446 )
1447 }
1448
1449 type GetExposedDictionaryResponseFut = fidl::client::QueryResponseFut<
1450 ControllerGetExposedDictionaryResult,
1451 fidl::encoding::DefaultFuchsiaResourceDialect,
1452 >;
1453 fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut {
1454 fn _decode(
1455 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1456 ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1457 let _response = fidl::client::decode_transaction_body::<
1458 fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1459 fidl::encoding::DefaultFuchsiaResourceDialect,
1460 0x7e48373e5eda1f9b,
1461 >(_buf?)?
1462 .into_result::<ControllerMarker>("get_exposed_dictionary")?;
1463 Ok(_response.map(|x| x.dictionary))
1464 }
1465 self.client.send_query_and_decode::<
1466 fidl::encoding::EmptyPayload,
1467 ControllerGetExposedDictionaryResult,
1468 >(
1469 (),
1470 0x7e48373e5eda1f9b,
1471 fidl::encoding::DynamicFlags::FLEXIBLE,
1472 _decode,
1473 )
1474 }
1475
1476 type DestroyResponseFut = fidl::client::QueryResponseFut<
1477 ControllerDestroyResult,
1478 fidl::encoding::DefaultFuchsiaResourceDialect,
1479 >;
1480 fn r#destroy(&self) -> Self::DestroyResponseFut {
1481 fn _decode(
1482 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1483 ) -> Result<ControllerDestroyResult, fidl::Error> {
1484 let _response = fidl::client::decode_transaction_body::<
1485 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1486 fidl::encoding::DefaultFuchsiaResourceDialect,
1487 0x74529fa68b5c1741,
1488 >(_buf?)?
1489 .into_result::<ControllerMarker>("destroy")?;
1490 Ok(_response.map(|x| x))
1491 }
1492 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerDestroyResult>(
1493 (),
1494 0x74529fa68b5c1741,
1495 fidl::encoding::DynamicFlags::FLEXIBLE,
1496 _decode,
1497 )
1498 }
1499}
1500
1501pub struct ControllerEventStream {
1502 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1503}
1504
1505impl std::marker::Unpin for ControllerEventStream {}
1506
1507impl futures::stream::FusedStream for ControllerEventStream {
1508 fn is_terminated(&self) -> bool {
1509 self.event_receiver.is_terminated()
1510 }
1511}
1512
1513impl futures::Stream for ControllerEventStream {
1514 type Item = Result<ControllerEvent, fidl::Error>;
1515
1516 fn poll_next(
1517 mut self: std::pin::Pin<&mut Self>,
1518 cx: &mut std::task::Context<'_>,
1519 ) -> std::task::Poll<Option<Self::Item>> {
1520 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1521 &mut self.event_receiver,
1522 cx
1523 )?) {
1524 Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1525 None => std::task::Poll::Ready(None),
1526 }
1527 }
1528}
1529
1530#[derive(Debug)]
1531pub enum ControllerEvent {
1532 #[non_exhaustive]
1533 _UnknownEvent {
1534 ordinal: u64,
1536 },
1537}
1538
1539impl ControllerEvent {
1540 fn decode(
1542 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1543 ) -> Result<ControllerEvent, fidl::Error> {
1544 let (bytes, _handles) = buf.split_mut();
1545 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1546 debug_assert_eq!(tx_header.tx_id, 0);
1547 match tx_header.ordinal {
1548 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1549 Ok(ControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1550 }
1551 _ => Err(fidl::Error::UnknownOrdinal {
1552 ordinal: tx_header.ordinal,
1553 protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1554 }),
1555 }
1556 }
1557}
1558
1559pub struct ControllerRequestStream {
1561 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1562 is_terminated: bool,
1563}
1564
1565impl std::marker::Unpin for ControllerRequestStream {}
1566
1567impl futures::stream::FusedStream for ControllerRequestStream {
1568 fn is_terminated(&self) -> bool {
1569 self.is_terminated
1570 }
1571}
1572
1573impl fidl::endpoints::RequestStream for ControllerRequestStream {
1574 type Protocol = ControllerMarker;
1575 type ControlHandle = ControllerControlHandle;
1576
1577 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1578 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1579 }
1580
1581 fn control_handle(&self) -> Self::ControlHandle {
1582 ControllerControlHandle { inner: self.inner.clone() }
1583 }
1584
1585 fn into_inner(
1586 self,
1587 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1588 {
1589 (self.inner, self.is_terminated)
1590 }
1591
1592 fn from_inner(
1593 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1594 is_terminated: bool,
1595 ) -> Self {
1596 Self { inner, is_terminated }
1597 }
1598}
1599
1600impl futures::Stream for ControllerRequestStream {
1601 type Item = Result<ControllerRequest, fidl::Error>;
1602
1603 fn poll_next(
1604 mut self: std::pin::Pin<&mut Self>,
1605 cx: &mut std::task::Context<'_>,
1606 ) -> std::task::Poll<Option<Self::Item>> {
1607 let this = &mut *self;
1608 if this.inner.check_shutdown(cx) {
1609 this.is_terminated = true;
1610 return std::task::Poll::Ready(None);
1611 }
1612 if this.is_terminated {
1613 panic!("polled ControllerRequestStream after completion");
1614 }
1615 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1616 |bytes, handles| {
1617 match this.inner.channel().read_etc(cx, bytes, handles) {
1618 std::task::Poll::Ready(Ok(())) => {}
1619 std::task::Poll::Pending => return std::task::Poll::Pending,
1620 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1621 this.is_terminated = true;
1622 return std::task::Poll::Ready(None);
1623 }
1624 std::task::Poll::Ready(Err(e)) => {
1625 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1626 e.into(),
1627 ))))
1628 }
1629 }
1630
1631 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1633
1634 std::task::Poll::Ready(Some(match header.ordinal {
1635 0x68878076b8d2eac5 => {
1636 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1637 let mut req = fidl::new_empty!(
1638 ControllerStartRequest,
1639 fidl::encoding::DefaultFuchsiaResourceDialect
1640 );
1641 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartRequest>(&header, _body_bytes, handles, &mut req)?;
1642 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1643 Ok(ControllerRequest::Start {
1644 args: req.args,
1645 execution_controller: req.execution_controller,
1646
1647 responder: ControllerStartResponder {
1648 control_handle: std::mem::ManuallyDrop::new(control_handle),
1649 tx_id: header.tx_id,
1650 },
1651 })
1652 }
1653 0x2155e6e1db2083c3 => {
1654 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1655 let mut req = fidl::new_empty!(
1656 fidl::encoding::EmptyPayload,
1657 fidl::encoding::DefaultFuchsiaResourceDialect
1658 );
1659 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1660 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1661 Ok(ControllerRequest::IsStarted {
1662 responder: ControllerIsStartedResponder {
1663 control_handle: std::mem::ManuallyDrop::new(control_handle),
1664 tx_id: header.tx_id,
1665 },
1666 })
1667 }
1668 0x7e48373e5eda1f9b => {
1669 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1670 let mut req = fidl::new_empty!(
1671 fidl::encoding::EmptyPayload,
1672 fidl::encoding::DefaultFuchsiaResourceDialect
1673 );
1674 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1675 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1676 Ok(ControllerRequest::GetExposedDictionary {
1677 responder: ControllerGetExposedDictionaryResponder {
1678 control_handle: std::mem::ManuallyDrop::new(control_handle),
1679 tx_id: header.tx_id,
1680 },
1681 })
1682 }
1683 0x74529fa68b5c1741 => {
1684 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1685 let mut req = fidl::new_empty!(
1686 fidl::encoding::EmptyPayload,
1687 fidl::encoding::DefaultFuchsiaResourceDialect
1688 );
1689 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1690 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1691 Ok(ControllerRequest::Destroy {
1692 responder: ControllerDestroyResponder {
1693 control_handle: std::mem::ManuallyDrop::new(control_handle),
1694 tx_id: header.tx_id,
1695 },
1696 })
1697 }
1698 _ if header.tx_id == 0
1699 && header
1700 .dynamic_flags()
1701 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1702 {
1703 Ok(ControllerRequest::_UnknownMethod {
1704 ordinal: header.ordinal,
1705 control_handle: ControllerControlHandle { inner: this.inner.clone() },
1706 method_type: fidl::MethodType::OneWay,
1707 })
1708 }
1709 _ if header
1710 .dynamic_flags()
1711 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1712 {
1713 this.inner.send_framework_err(
1714 fidl::encoding::FrameworkErr::UnknownMethod,
1715 header.tx_id,
1716 header.ordinal,
1717 header.dynamic_flags(),
1718 (bytes, handles),
1719 )?;
1720 Ok(ControllerRequest::_UnknownMethod {
1721 ordinal: header.ordinal,
1722 control_handle: ControllerControlHandle { inner: this.inner.clone() },
1723 method_type: fidl::MethodType::TwoWay,
1724 })
1725 }
1726 _ => Err(fidl::Error::UnknownOrdinal {
1727 ordinal: header.ordinal,
1728 protocol_name:
1729 <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1730 }),
1731 }))
1732 },
1733 )
1734 }
1735}
1736
1737#[derive(Debug)]
1743pub enum ControllerRequest {
1744 Start {
1748 args: StartChildArgs,
1749 execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1750 responder: ControllerStartResponder,
1751 },
1752 IsStarted { responder: ControllerIsStartedResponder },
1754 GetExposedDictionary { responder: ControllerGetExposedDictionaryResponder },
1756 Destroy { responder: ControllerDestroyResponder },
1771 #[non_exhaustive]
1773 _UnknownMethod {
1774 ordinal: u64,
1776 control_handle: ControllerControlHandle,
1777 method_type: fidl::MethodType,
1778 },
1779}
1780
1781impl ControllerRequest {
1782 #[allow(irrefutable_let_patterns)]
1783 pub fn into_start(
1784 self,
1785 ) -> Option<(
1786 StartChildArgs,
1787 fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1788 ControllerStartResponder,
1789 )> {
1790 if let ControllerRequest::Start { args, execution_controller, responder } = self {
1791 Some((args, execution_controller, responder))
1792 } else {
1793 None
1794 }
1795 }
1796
1797 #[allow(irrefutable_let_patterns)]
1798 pub fn into_is_started(self) -> Option<(ControllerIsStartedResponder)> {
1799 if let ControllerRequest::IsStarted { responder } = self {
1800 Some((responder))
1801 } else {
1802 None
1803 }
1804 }
1805
1806 #[allow(irrefutable_let_patterns)]
1807 pub fn into_get_exposed_dictionary(self) -> Option<(ControllerGetExposedDictionaryResponder)> {
1808 if let ControllerRequest::GetExposedDictionary { responder } = self {
1809 Some((responder))
1810 } else {
1811 None
1812 }
1813 }
1814
1815 #[allow(irrefutable_let_patterns)]
1816 pub fn into_destroy(self) -> Option<(ControllerDestroyResponder)> {
1817 if let ControllerRequest::Destroy { responder } = self {
1818 Some((responder))
1819 } else {
1820 None
1821 }
1822 }
1823
1824 pub fn method_name(&self) -> &'static str {
1826 match *self {
1827 ControllerRequest::Start { .. } => "start",
1828 ControllerRequest::IsStarted { .. } => "is_started",
1829 ControllerRequest::GetExposedDictionary { .. } => "get_exposed_dictionary",
1830 ControllerRequest::Destroy { .. } => "destroy",
1831 ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1832 "unknown one-way method"
1833 }
1834 ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1835 "unknown two-way method"
1836 }
1837 }
1838 }
1839}
1840
1841#[derive(Debug, Clone)]
1842pub struct ControllerControlHandle {
1843 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1844}
1845
1846impl fidl::endpoints::ControlHandle for ControllerControlHandle {
1847 fn shutdown(&self) {
1848 self.inner.shutdown()
1849 }
1850 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1851 self.inner.shutdown_with_epitaph(status)
1852 }
1853
1854 fn is_closed(&self) -> bool {
1855 self.inner.channel().is_closed()
1856 }
1857 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1858 self.inner.channel().on_closed()
1859 }
1860
1861 #[cfg(target_os = "fuchsia")]
1862 fn signal_peer(
1863 &self,
1864 clear_mask: zx::Signals,
1865 set_mask: zx::Signals,
1866 ) -> Result<(), zx_status::Status> {
1867 use fidl::Peered;
1868 self.inner.channel().signal_peer(clear_mask, set_mask)
1869 }
1870}
1871
1872impl ControllerControlHandle {}
1873
1874#[must_use = "FIDL methods require a response to be sent"]
1875#[derive(Debug)]
1876pub struct ControllerStartResponder {
1877 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1878 tx_id: u32,
1879}
1880
1881impl std::ops::Drop for ControllerStartResponder {
1885 fn drop(&mut self) {
1886 self.control_handle.shutdown();
1887 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1889 }
1890}
1891
1892impl fidl::endpoints::Responder for ControllerStartResponder {
1893 type ControlHandle = ControllerControlHandle;
1894
1895 fn control_handle(&self) -> &ControllerControlHandle {
1896 &self.control_handle
1897 }
1898
1899 fn drop_without_shutdown(mut self) {
1900 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1902 std::mem::forget(self);
1904 }
1905}
1906
1907impl ControllerStartResponder {
1908 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1912 let _result = self.send_raw(result);
1913 if _result.is_err() {
1914 self.control_handle.shutdown();
1915 }
1916 self.drop_without_shutdown();
1917 _result
1918 }
1919
1920 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1922 let _result = self.send_raw(result);
1923 self.drop_without_shutdown();
1924 _result
1925 }
1926
1927 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1928 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1929 fidl::encoding::EmptyStruct,
1930 Error,
1931 >>(
1932 fidl::encoding::FlexibleResult::new(result),
1933 self.tx_id,
1934 0x68878076b8d2eac5,
1935 fidl::encoding::DynamicFlags::FLEXIBLE,
1936 )
1937 }
1938}
1939
1940#[must_use = "FIDL methods require a response to be sent"]
1941#[derive(Debug)]
1942pub struct ControllerIsStartedResponder {
1943 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1944 tx_id: u32,
1945}
1946
1947impl std::ops::Drop for ControllerIsStartedResponder {
1951 fn drop(&mut self) {
1952 self.control_handle.shutdown();
1953 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1955 }
1956}
1957
1958impl fidl::endpoints::Responder for ControllerIsStartedResponder {
1959 type ControlHandle = ControllerControlHandle;
1960
1961 fn control_handle(&self) -> &ControllerControlHandle {
1962 &self.control_handle
1963 }
1964
1965 fn drop_without_shutdown(mut self) {
1966 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1968 std::mem::forget(self);
1970 }
1971}
1972
1973impl ControllerIsStartedResponder {
1974 pub fn send(self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
1978 let _result = self.send_raw(result);
1979 if _result.is_err() {
1980 self.control_handle.shutdown();
1981 }
1982 self.drop_without_shutdown();
1983 _result
1984 }
1985
1986 pub fn send_no_shutdown_on_err(
1988 self,
1989 mut result: Result<bool, Error>,
1990 ) -> Result<(), fidl::Error> {
1991 let _result = self.send_raw(result);
1992 self.drop_without_shutdown();
1993 _result
1994 }
1995
1996 fn send_raw(&self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
1997 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1998 ControllerIsStartedResponse,
1999 Error,
2000 >>(
2001 fidl::encoding::FlexibleResult::new(result.map(|is_started| (is_started,))),
2002 self.tx_id,
2003 0x2155e6e1db2083c3,
2004 fidl::encoding::DynamicFlags::FLEXIBLE,
2005 )
2006 }
2007}
2008
2009#[must_use = "FIDL methods require a response to be sent"]
2010#[derive(Debug)]
2011pub struct ControllerGetExposedDictionaryResponder {
2012 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2013 tx_id: u32,
2014}
2015
2016impl std::ops::Drop for ControllerGetExposedDictionaryResponder {
2020 fn drop(&mut self) {
2021 self.control_handle.shutdown();
2022 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2024 }
2025}
2026
2027impl fidl::endpoints::Responder for ControllerGetExposedDictionaryResponder {
2028 type ControlHandle = ControllerControlHandle;
2029
2030 fn control_handle(&self) -> &ControllerControlHandle {
2031 &self.control_handle
2032 }
2033
2034 fn drop_without_shutdown(mut self) {
2035 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2037 std::mem::forget(self);
2039 }
2040}
2041
2042impl ControllerGetExposedDictionaryResponder {
2043 pub fn send(
2047 self,
2048 mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2049 ) -> Result<(), fidl::Error> {
2050 let _result = self.send_raw(result);
2051 if _result.is_err() {
2052 self.control_handle.shutdown();
2053 }
2054 self.drop_without_shutdown();
2055 _result
2056 }
2057
2058 pub fn send_no_shutdown_on_err(
2060 self,
2061 mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2062 ) -> Result<(), fidl::Error> {
2063 let _result = self.send_raw(result);
2064 self.drop_without_shutdown();
2065 _result
2066 }
2067
2068 fn send_raw(
2069 &self,
2070 mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2071 ) -> Result<(), fidl::Error> {
2072 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2073 ControllerGetExposedDictionaryResponse,
2074 Error,
2075 >>(
2076 fidl::encoding::FlexibleResult::new(
2077 result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
2078 ),
2079 self.tx_id,
2080 0x7e48373e5eda1f9b,
2081 fidl::encoding::DynamicFlags::FLEXIBLE,
2082 )
2083 }
2084}
2085
2086#[must_use = "FIDL methods require a response to be sent"]
2087#[derive(Debug)]
2088pub struct ControllerDestroyResponder {
2089 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2090 tx_id: u32,
2091}
2092
2093impl std::ops::Drop for ControllerDestroyResponder {
2097 fn drop(&mut self) {
2098 self.control_handle.shutdown();
2099 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2101 }
2102}
2103
2104impl fidl::endpoints::Responder for ControllerDestroyResponder {
2105 type ControlHandle = ControllerControlHandle;
2106
2107 fn control_handle(&self) -> &ControllerControlHandle {
2108 &self.control_handle
2109 }
2110
2111 fn drop_without_shutdown(mut self) {
2112 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2114 std::mem::forget(self);
2116 }
2117}
2118
2119impl ControllerDestroyResponder {
2120 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2124 let _result = self.send_raw(result);
2125 if _result.is_err() {
2126 self.control_handle.shutdown();
2127 }
2128 self.drop_without_shutdown();
2129 _result
2130 }
2131
2132 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2134 let _result = self.send_raw(result);
2135 self.drop_without_shutdown();
2136 _result
2137 }
2138
2139 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2140 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2141 fidl::encoding::EmptyStruct,
2142 Error,
2143 >>(
2144 fidl::encoding::FlexibleResult::new(result),
2145 self.tx_id,
2146 0x74529fa68b5c1741,
2147 fidl::encoding::DynamicFlags::FLEXIBLE,
2148 )
2149 }
2150}
2151
2152#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2153pub struct EventStreamMarker;
2154
2155impl fidl::endpoints::ProtocolMarker for EventStreamMarker {
2156 type Proxy = EventStreamProxy;
2157 type RequestStream = EventStreamRequestStream;
2158 #[cfg(target_os = "fuchsia")]
2159 type SynchronousProxy = EventStreamSynchronousProxy;
2160
2161 const DEBUG_NAME: &'static str = "fuchsia.component.EventStream";
2162}
2163impl fidl::endpoints::DiscoverableProtocolMarker for EventStreamMarker {}
2164
2165pub trait EventStreamProxyInterface: Send + Sync {
2166 type GetNextResponseFut: std::future::Future<Output = Result<Vec<Event>, fidl::Error>> + Send;
2167 fn r#get_next(&self) -> Self::GetNextResponseFut;
2168 type WaitForReadyResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2169 fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut;
2170}
2171#[derive(Debug)]
2172#[cfg(target_os = "fuchsia")]
2173pub struct EventStreamSynchronousProxy {
2174 client: fidl::client::sync::Client,
2175}
2176
2177#[cfg(target_os = "fuchsia")]
2178impl fidl::endpoints::SynchronousProxy for EventStreamSynchronousProxy {
2179 type Proxy = EventStreamProxy;
2180 type Protocol = EventStreamMarker;
2181
2182 fn from_channel(inner: fidl::Channel) -> Self {
2183 Self::new(inner)
2184 }
2185
2186 fn into_channel(self) -> fidl::Channel {
2187 self.client.into_channel()
2188 }
2189
2190 fn as_channel(&self) -> &fidl::Channel {
2191 self.client.as_channel()
2192 }
2193}
2194
2195#[cfg(target_os = "fuchsia")]
2196impl EventStreamSynchronousProxy {
2197 pub fn new(channel: fidl::Channel) -> Self {
2198 let protocol_name = <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2199 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2200 }
2201
2202 pub fn into_channel(self) -> fidl::Channel {
2203 self.client.into_channel()
2204 }
2205
2206 pub fn wait_for_event(
2209 &self,
2210 deadline: zx::MonotonicInstant,
2211 ) -> Result<EventStreamEvent, fidl::Error> {
2212 EventStreamEvent::decode(self.client.wait_for_event(deadline)?)
2213 }
2214
2215 pub fn r#get_next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<Event>, fidl::Error> {
2216 let _response =
2217 self.client.send_query::<fidl::encoding::EmptyPayload, EventStreamGetNextResponse>(
2218 (),
2219 0x3f24c9495978eb86,
2220 fidl::encoding::DynamicFlags::empty(),
2221 ___deadline,
2222 )?;
2223 Ok(_response.events)
2224 }
2225
2226 pub fn r#wait_for_ready(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2230 let _response =
2231 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
2232 (),
2233 0x31331f9578d2e682,
2234 fidl::encoding::DynamicFlags::empty(),
2235 ___deadline,
2236 )?;
2237 Ok(_response)
2238 }
2239}
2240
2241#[cfg(target_os = "fuchsia")]
2242impl From<EventStreamSynchronousProxy> for zx::Handle {
2243 fn from(value: EventStreamSynchronousProxy) -> Self {
2244 value.into_channel().into()
2245 }
2246}
2247
2248#[cfg(target_os = "fuchsia")]
2249impl From<fidl::Channel> for EventStreamSynchronousProxy {
2250 fn from(value: fidl::Channel) -> Self {
2251 Self::new(value)
2252 }
2253}
2254
2255#[derive(Debug, Clone)]
2256pub struct EventStreamProxy {
2257 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2258}
2259
2260impl fidl::endpoints::Proxy for EventStreamProxy {
2261 type Protocol = EventStreamMarker;
2262
2263 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2264 Self::new(inner)
2265 }
2266
2267 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2268 self.client.into_channel().map_err(|client| Self { client })
2269 }
2270
2271 fn as_channel(&self) -> &::fidl::AsyncChannel {
2272 self.client.as_channel()
2273 }
2274}
2275
2276impl EventStreamProxy {
2277 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2279 let protocol_name = <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2280 Self { client: fidl::client::Client::new(channel, protocol_name) }
2281 }
2282
2283 pub fn take_event_stream(&self) -> EventStreamEventStream {
2289 EventStreamEventStream { event_receiver: self.client.take_event_receiver() }
2290 }
2291
2292 pub fn r#get_next(
2293 &self,
2294 ) -> fidl::client::QueryResponseFut<Vec<Event>, fidl::encoding::DefaultFuchsiaResourceDialect>
2295 {
2296 EventStreamProxyInterface::r#get_next(self)
2297 }
2298
2299 pub fn r#wait_for_ready(
2303 &self,
2304 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2305 EventStreamProxyInterface::r#wait_for_ready(self)
2306 }
2307}
2308
2309impl EventStreamProxyInterface for EventStreamProxy {
2310 type GetNextResponseFut =
2311 fidl::client::QueryResponseFut<Vec<Event>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2312 fn r#get_next(&self) -> Self::GetNextResponseFut {
2313 fn _decode(
2314 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2315 ) -> Result<Vec<Event>, fidl::Error> {
2316 let _response = fidl::client::decode_transaction_body::<
2317 EventStreamGetNextResponse,
2318 fidl::encoding::DefaultFuchsiaResourceDialect,
2319 0x3f24c9495978eb86,
2320 >(_buf?)?;
2321 Ok(_response.events)
2322 }
2323 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Event>>(
2324 (),
2325 0x3f24c9495978eb86,
2326 fidl::encoding::DynamicFlags::empty(),
2327 _decode,
2328 )
2329 }
2330
2331 type WaitForReadyResponseFut =
2332 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2333 fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut {
2334 fn _decode(
2335 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2336 ) -> Result<(), fidl::Error> {
2337 let _response = fidl::client::decode_transaction_body::<
2338 fidl::encoding::EmptyPayload,
2339 fidl::encoding::DefaultFuchsiaResourceDialect,
2340 0x31331f9578d2e682,
2341 >(_buf?)?;
2342 Ok(_response)
2343 }
2344 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2345 (),
2346 0x31331f9578d2e682,
2347 fidl::encoding::DynamicFlags::empty(),
2348 _decode,
2349 )
2350 }
2351}
2352
2353pub struct EventStreamEventStream {
2354 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2355}
2356
2357impl std::marker::Unpin for EventStreamEventStream {}
2358
2359impl futures::stream::FusedStream for EventStreamEventStream {
2360 fn is_terminated(&self) -> bool {
2361 self.event_receiver.is_terminated()
2362 }
2363}
2364
2365impl futures::Stream for EventStreamEventStream {
2366 type Item = Result<EventStreamEvent, fidl::Error>;
2367
2368 fn poll_next(
2369 mut self: std::pin::Pin<&mut Self>,
2370 cx: &mut std::task::Context<'_>,
2371 ) -> std::task::Poll<Option<Self::Item>> {
2372 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2373 &mut self.event_receiver,
2374 cx
2375 )?) {
2376 Some(buf) => std::task::Poll::Ready(Some(EventStreamEvent::decode(buf))),
2377 None => std::task::Poll::Ready(None),
2378 }
2379 }
2380}
2381
2382#[derive(Debug)]
2383pub enum EventStreamEvent {}
2384
2385impl EventStreamEvent {
2386 fn decode(
2388 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2389 ) -> Result<EventStreamEvent, fidl::Error> {
2390 let (bytes, _handles) = buf.split_mut();
2391 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2392 debug_assert_eq!(tx_header.tx_id, 0);
2393 match tx_header.ordinal {
2394 _ => Err(fidl::Error::UnknownOrdinal {
2395 ordinal: tx_header.ordinal,
2396 protocol_name: <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2397 }),
2398 }
2399 }
2400}
2401
2402pub struct EventStreamRequestStream {
2404 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2405 is_terminated: bool,
2406}
2407
2408impl std::marker::Unpin for EventStreamRequestStream {}
2409
2410impl futures::stream::FusedStream for EventStreamRequestStream {
2411 fn is_terminated(&self) -> bool {
2412 self.is_terminated
2413 }
2414}
2415
2416impl fidl::endpoints::RequestStream for EventStreamRequestStream {
2417 type Protocol = EventStreamMarker;
2418 type ControlHandle = EventStreamControlHandle;
2419
2420 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2421 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2422 }
2423
2424 fn control_handle(&self) -> Self::ControlHandle {
2425 EventStreamControlHandle { inner: self.inner.clone() }
2426 }
2427
2428 fn into_inner(
2429 self,
2430 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2431 {
2432 (self.inner, self.is_terminated)
2433 }
2434
2435 fn from_inner(
2436 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2437 is_terminated: bool,
2438 ) -> Self {
2439 Self { inner, is_terminated }
2440 }
2441}
2442
2443impl futures::Stream for EventStreamRequestStream {
2444 type Item = Result<EventStreamRequest, fidl::Error>;
2445
2446 fn poll_next(
2447 mut self: std::pin::Pin<&mut Self>,
2448 cx: &mut std::task::Context<'_>,
2449 ) -> std::task::Poll<Option<Self::Item>> {
2450 let this = &mut *self;
2451 if this.inner.check_shutdown(cx) {
2452 this.is_terminated = true;
2453 return std::task::Poll::Ready(None);
2454 }
2455 if this.is_terminated {
2456 panic!("polled EventStreamRequestStream after completion");
2457 }
2458 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2459 |bytes, handles| {
2460 match this.inner.channel().read_etc(cx, bytes, handles) {
2461 std::task::Poll::Ready(Ok(())) => {}
2462 std::task::Poll::Pending => return std::task::Poll::Pending,
2463 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2464 this.is_terminated = true;
2465 return std::task::Poll::Ready(None);
2466 }
2467 std::task::Poll::Ready(Err(e)) => {
2468 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2469 e.into(),
2470 ))))
2471 }
2472 }
2473
2474 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2476
2477 std::task::Poll::Ready(Some(match header.ordinal {
2478 0x3f24c9495978eb86 => {
2479 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2480 let mut req = fidl::new_empty!(
2481 fidl::encoding::EmptyPayload,
2482 fidl::encoding::DefaultFuchsiaResourceDialect
2483 );
2484 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2485 let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2486 Ok(EventStreamRequest::GetNext {
2487 responder: EventStreamGetNextResponder {
2488 control_handle: std::mem::ManuallyDrop::new(control_handle),
2489 tx_id: header.tx_id,
2490 },
2491 })
2492 }
2493 0x31331f9578d2e682 => {
2494 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2495 let mut req = fidl::new_empty!(
2496 fidl::encoding::EmptyPayload,
2497 fidl::encoding::DefaultFuchsiaResourceDialect
2498 );
2499 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2500 let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2501 Ok(EventStreamRequest::WaitForReady {
2502 responder: EventStreamWaitForReadyResponder {
2503 control_handle: std::mem::ManuallyDrop::new(control_handle),
2504 tx_id: header.tx_id,
2505 },
2506 })
2507 }
2508 _ => Err(fidl::Error::UnknownOrdinal {
2509 ordinal: header.ordinal,
2510 protocol_name:
2511 <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2512 }),
2513 }))
2514 },
2515 )
2516 }
2517}
2518
2519#[derive(Debug)]
2522pub enum EventStreamRequest {
2523 GetNext {
2524 responder: EventStreamGetNextResponder,
2525 },
2526 WaitForReady {
2530 responder: EventStreamWaitForReadyResponder,
2531 },
2532}
2533
2534impl EventStreamRequest {
2535 #[allow(irrefutable_let_patterns)]
2536 pub fn into_get_next(self) -> Option<(EventStreamGetNextResponder)> {
2537 if let EventStreamRequest::GetNext { responder } = self {
2538 Some((responder))
2539 } else {
2540 None
2541 }
2542 }
2543
2544 #[allow(irrefutable_let_patterns)]
2545 pub fn into_wait_for_ready(self) -> Option<(EventStreamWaitForReadyResponder)> {
2546 if let EventStreamRequest::WaitForReady { responder } = self {
2547 Some((responder))
2548 } else {
2549 None
2550 }
2551 }
2552
2553 pub fn method_name(&self) -> &'static str {
2555 match *self {
2556 EventStreamRequest::GetNext { .. } => "get_next",
2557 EventStreamRequest::WaitForReady { .. } => "wait_for_ready",
2558 }
2559 }
2560}
2561
2562#[derive(Debug, Clone)]
2563pub struct EventStreamControlHandle {
2564 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2565}
2566
2567impl fidl::endpoints::ControlHandle for EventStreamControlHandle {
2568 fn shutdown(&self) {
2569 self.inner.shutdown()
2570 }
2571 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2572 self.inner.shutdown_with_epitaph(status)
2573 }
2574
2575 fn is_closed(&self) -> bool {
2576 self.inner.channel().is_closed()
2577 }
2578 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2579 self.inner.channel().on_closed()
2580 }
2581
2582 #[cfg(target_os = "fuchsia")]
2583 fn signal_peer(
2584 &self,
2585 clear_mask: zx::Signals,
2586 set_mask: zx::Signals,
2587 ) -> Result<(), zx_status::Status> {
2588 use fidl::Peered;
2589 self.inner.channel().signal_peer(clear_mask, set_mask)
2590 }
2591}
2592
2593impl EventStreamControlHandle {}
2594
2595#[must_use = "FIDL methods require a response to be sent"]
2596#[derive(Debug)]
2597pub struct EventStreamGetNextResponder {
2598 control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
2599 tx_id: u32,
2600}
2601
2602impl std::ops::Drop for EventStreamGetNextResponder {
2606 fn drop(&mut self) {
2607 self.control_handle.shutdown();
2608 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2610 }
2611}
2612
2613impl fidl::endpoints::Responder for EventStreamGetNextResponder {
2614 type ControlHandle = EventStreamControlHandle;
2615
2616 fn control_handle(&self) -> &EventStreamControlHandle {
2617 &self.control_handle
2618 }
2619
2620 fn drop_without_shutdown(mut self) {
2621 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2623 std::mem::forget(self);
2625 }
2626}
2627
2628impl EventStreamGetNextResponder {
2629 pub fn send(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2633 let _result = self.send_raw(events);
2634 if _result.is_err() {
2635 self.control_handle.shutdown();
2636 }
2637 self.drop_without_shutdown();
2638 _result
2639 }
2640
2641 pub fn send_no_shutdown_on_err(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2643 let _result = self.send_raw(events);
2644 self.drop_without_shutdown();
2645 _result
2646 }
2647
2648 fn send_raw(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2649 self.control_handle.inner.send::<EventStreamGetNextResponse>(
2650 (events.as_mut(),),
2651 self.tx_id,
2652 0x3f24c9495978eb86,
2653 fidl::encoding::DynamicFlags::empty(),
2654 )
2655 }
2656}
2657
2658#[must_use = "FIDL methods require a response to be sent"]
2659#[derive(Debug)]
2660pub struct EventStreamWaitForReadyResponder {
2661 control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
2662 tx_id: u32,
2663}
2664
2665impl std::ops::Drop for EventStreamWaitForReadyResponder {
2669 fn drop(&mut self) {
2670 self.control_handle.shutdown();
2671 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2673 }
2674}
2675
2676impl fidl::endpoints::Responder for EventStreamWaitForReadyResponder {
2677 type ControlHandle = EventStreamControlHandle;
2678
2679 fn control_handle(&self) -> &EventStreamControlHandle {
2680 &self.control_handle
2681 }
2682
2683 fn drop_without_shutdown(mut self) {
2684 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2686 std::mem::forget(self);
2688 }
2689}
2690
2691impl EventStreamWaitForReadyResponder {
2692 pub fn send(self) -> Result<(), fidl::Error> {
2696 let _result = self.send_raw();
2697 if _result.is_err() {
2698 self.control_handle.shutdown();
2699 }
2700 self.drop_without_shutdown();
2701 _result
2702 }
2703
2704 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2706 let _result = self.send_raw();
2707 self.drop_without_shutdown();
2708 _result
2709 }
2710
2711 fn send_raw(&self) -> Result<(), fidl::Error> {
2712 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2713 (),
2714 self.tx_id,
2715 0x31331f9578d2e682,
2716 fidl::encoding::DynamicFlags::empty(),
2717 )
2718 }
2719}
2720
2721#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2722pub struct ExecutionControllerMarker;
2723
2724impl fidl::endpoints::ProtocolMarker for ExecutionControllerMarker {
2725 type Proxy = ExecutionControllerProxy;
2726 type RequestStream = ExecutionControllerRequestStream;
2727 #[cfg(target_os = "fuchsia")]
2728 type SynchronousProxy = ExecutionControllerSynchronousProxy;
2729
2730 const DEBUG_NAME: &'static str = "(anonymous) ExecutionController";
2731}
2732
2733pub trait ExecutionControllerProxyInterface: Send + Sync {
2734 fn r#stop(&self) -> Result<(), fidl::Error>;
2735}
2736#[derive(Debug)]
2737#[cfg(target_os = "fuchsia")]
2738pub struct ExecutionControllerSynchronousProxy {
2739 client: fidl::client::sync::Client,
2740}
2741
2742#[cfg(target_os = "fuchsia")]
2743impl fidl::endpoints::SynchronousProxy for ExecutionControllerSynchronousProxy {
2744 type Proxy = ExecutionControllerProxy;
2745 type Protocol = ExecutionControllerMarker;
2746
2747 fn from_channel(inner: fidl::Channel) -> Self {
2748 Self::new(inner)
2749 }
2750
2751 fn into_channel(self) -> fidl::Channel {
2752 self.client.into_channel()
2753 }
2754
2755 fn as_channel(&self) -> &fidl::Channel {
2756 self.client.as_channel()
2757 }
2758}
2759
2760#[cfg(target_os = "fuchsia")]
2761impl ExecutionControllerSynchronousProxy {
2762 pub fn new(channel: fidl::Channel) -> Self {
2763 let protocol_name =
2764 <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2765 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2766 }
2767
2768 pub fn into_channel(self) -> fidl::Channel {
2769 self.client.into_channel()
2770 }
2771
2772 pub fn wait_for_event(
2775 &self,
2776 deadline: zx::MonotonicInstant,
2777 ) -> Result<ExecutionControllerEvent, fidl::Error> {
2778 ExecutionControllerEvent::decode(self.client.wait_for_event(deadline)?)
2779 }
2780
2781 pub fn r#stop(&self) -> Result<(), fidl::Error> {
2787 self.client.send::<fidl::encoding::EmptyPayload>(
2788 (),
2789 0x56d23cec21036117,
2790 fidl::encoding::DynamicFlags::FLEXIBLE,
2791 )
2792 }
2793}
2794
2795#[cfg(target_os = "fuchsia")]
2796impl From<ExecutionControllerSynchronousProxy> for zx::Handle {
2797 fn from(value: ExecutionControllerSynchronousProxy) -> Self {
2798 value.into_channel().into()
2799 }
2800}
2801
2802#[cfg(target_os = "fuchsia")]
2803impl From<fidl::Channel> for ExecutionControllerSynchronousProxy {
2804 fn from(value: fidl::Channel) -> Self {
2805 Self::new(value)
2806 }
2807}
2808
2809#[derive(Debug, Clone)]
2810pub struct ExecutionControllerProxy {
2811 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2812}
2813
2814impl fidl::endpoints::Proxy for ExecutionControllerProxy {
2815 type Protocol = ExecutionControllerMarker;
2816
2817 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2818 Self::new(inner)
2819 }
2820
2821 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2822 self.client.into_channel().map_err(|client| Self { client })
2823 }
2824
2825 fn as_channel(&self) -> &::fidl::AsyncChannel {
2826 self.client.as_channel()
2827 }
2828}
2829
2830impl ExecutionControllerProxy {
2831 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2833 let protocol_name =
2834 <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2835 Self { client: fidl::client::Client::new(channel, protocol_name) }
2836 }
2837
2838 pub fn take_event_stream(&self) -> ExecutionControllerEventStream {
2844 ExecutionControllerEventStream { event_receiver: self.client.take_event_receiver() }
2845 }
2846
2847 pub fn r#stop(&self) -> Result<(), fidl::Error> {
2853 ExecutionControllerProxyInterface::r#stop(self)
2854 }
2855}
2856
2857impl ExecutionControllerProxyInterface for ExecutionControllerProxy {
2858 fn r#stop(&self) -> Result<(), fidl::Error> {
2859 self.client.send::<fidl::encoding::EmptyPayload>(
2860 (),
2861 0x56d23cec21036117,
2862 fidl::encoding::DynamicFlags::FLEXIBLE,
2863 )
2864 }
2865}
2866
2867pub struct ExecutionControllerEventStream {
2868 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2869}
2870
2871impl std::marker::Unpin for ExecutionControllerEventStream {}
2872
2873impl futures::stream::FusedStream for ExecutionControllerEventStream {
2874 fn is_terminated(&self) -> bool {
2875 self.event_receiver.is_terminated()
2876 }
2877}
2878
2879impl futures::Stream for ExecutionControllerEventStream {
2880 type Item = Result<ExecutionControllerEvent, fidl::Error>;
2881
2882 fn poll_next(
2883 mut self: std::pin::Pin<&mut Self>,
2884 cx: &mut std::task::Context<'_>,
2885 ) -> std::task::Poll<Option<Self::Item>> {
2886 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2887 &mut self.event_receiver,
2888 cx
2889 )?) {
2890 Some(buf) => std::task::Poll::Ready(Some(ExecutionControllerEvent::decode(buf))),
2891 None => std::task::Poll::Ready(None),
2892 }
2893 }
2894}
2895
2896#[derive(Debug)]
2897pub enum ExecutionControllerEvent {
2898 OnStop {
2899 stopped_payload: StoppedPayload,
2900 },
2901 #[non_exhaustive]
2902 _UnknownEvent {
2903 ordinal: u64,
2905 },
2906}
2907
2908impl ExecutionControllerEvent {
2909 #[allow(irrefutable_let_patterns)]
2910 pub fn into_on_stop(self) -> Option<StoppedPayload> {
2911 if let ExecutionControllerEvent::OnStop { stopped_payload } = self {
2912 Some((stopped_payload))
2913 } else {
2914 None
2915 }
2916 }
2917
2918 fn decode(
2920 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2921 ) -> Result<ExecutionControllerEvent, fidl::Error> {
2922 let (bytes, _handles) = buf.split_mut();
2923 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2924 debug_assert_eq!(tx_header.tx_id, 0);
2925 match tx_header.ordinal {
2926 0x62d5018e2174f57f => {
2927 let mut out = fidl::new_empty!(
2928 ExecutionControllerOnStopRequest,
2929 fidl::encoding::DefaultFuchsiaResourceDialect
2930 );
2931 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ExecutionControllerOnStopRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2932 Ok((ExecutionControllerEvent::OnStop { stopped_payload: out.stopped_payload }))
2933 }
2934 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2935 Ok(ExecutionControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2936 }
2937 _ => Err(fidl::Error::UnknownOrdinal {
2938 ordinal: tx_header.ordinal,
2939 protocol_name:
2940 <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2941 }),
2942 }
2943 }
2944}
2945
2946pub struct ExecutionControllerRequestStream {
2948 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2949 is_terminated: bool,
2950}
2951
2952impl std::marker::Unpin for ExecutionControllerRequestStream {}
2953
2954impl futures::stream::FusedStream for ExecutionControllerRequestStream {
2955 fn is_terminated(&self) -> bool {
2956 self.is_terminated
2957 }
2958}
2959
2960impl fidl::endpoints::RequestStream for ExecutionControllerRequestStream {
2961 type Protocol = ExecutionControllerMarker;
2962 type ControlHandle = ExecutionControllerControlHandle;
2963
2964 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2965 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2966 }
2967
2968 fn control_handle(&self) -> Self::ControlHandle {
2969 ExecutionControllerControlHandle { inner: self.inner.clone() }
2970 }
2971
2972 fn into_inner(
2973 self,
2974 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2975 {
2976 (self.inner, self.is_terminated)
2977 }
2978
2979 fn from_inner(
2980 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2981 is_terminated: bool,
2982 ) -> Self {
2983 Self { inner, is_terminated }
2984 }
2985}
2986
2987impl futures::Stream for ExecutionControllerRequestStream {
2988 type Item = Result<ExecutionControllerRequest, fidl::Error>;
2989
2990 fn poll_next(
2991 mut self: std::pin::Pin<&mut Self>,
2992 cx: &mut std::task::Context<'_>,
2993 ) -> std::task::Poll<Option<Self::Item>> {
2994 let this = &mut *self;
2995 if this.inner.check_shutdown(cx) {
2996 this.is_terminated = true;
2997 return std::task::Poll::Ready(None);
2998 }
2999 if this.is_terminated {
3000 panic!("polled ExecutionControllerRequestStream after completion");
3001 }
3002 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3003 |bytes, handles| {
3004 match this.inner.channel().read_etc(cx, bytes, handles) {
3005 std::task::Poll::Ready(Ok(())) => {}
3006 std::task::Poll::Pending => return std::task::Poll::Pending,
3007 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3008 this.is_terminated = true;
3009 return std::task::Poll::Ready(None);
3010 }
3011 std::task::Poll::Ready(Err(e)) => {
3012 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3013 e.into(),
3014 ))))
3015 }
3016 }
3017
3018 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3020
3021 std::task::Poll::Ready(Some(match header.ordinal {
3022 0x56d23cec21036117 => {
3023 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3024 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3025 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3026 let control_handle = ExecutionControllerControlHandle {
3027 inner: this.inner.clone(),
3028 };
3029 Ok(ExecutionControllerRequest::Stop {
3030 control_handle,
3031 })
3032 }
3033 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3034 Ok(ExecutionControllerRequest::_UnknownMethod {
3035 ordinal: header.ordinal,
3036 control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
3037 method_type: fidl::MethodType::OneWay,
3038 })
3039 }
3040 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3041 this.inner.send_framework_err(
3042 fidl::encoding::FrameworkErr::UnknownMethod,
3043 header.tx_id,
3044 header.ordinal,
3045 header.dynamic_flags(),
3046 (bytes, handles),
3047 )?;
3048 Ok(ExecutionControllerRequest::_UnknownMethod {
3049 ordinal: header.ordinal,
3050 control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
3051 method_type: fidl::MethodType::TwoWay,
3052 })
3053 }
3054 _ => Err(fidl::Error::UnknownOrdinal {
3055 ordinal: header.ordinal,
3056 protocol_name: <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3057 }),
3058 }))
3059 },
3060 )
3061 }
3062}
3063
3064#[derive(Debug)]
3065pub enum ExecutionControllerRequest {
3066 Stop { control_handle: ExecutionControllerControlHandle },
3072 #[non_exhaustive]
3074 _UnknownMethod {
3075 ordinal: u64,
3077 control_handle: ExecutionControllerControlHandle,
3078 method_type: fidl::MethodType,
3079 },
3080}
3081
3082impl ExecutionControllerRequest {
3083 #[allow(irrefutable_let_patterns)]
3084 pub fn into_stop(self) -> Option<(ExecutionControllerControlHandle)> {
3085 if let ExecutionControllerRequest::Stop { control_handle } = self {
3086 Some((control_handle))
3087 } else {
3088 None
3089 }
3090 }
3091
3092 pub fn method_name(&self) -> &'static str {
3094 match *self {
3095 ExecutionControllerRequest::Stop { .. } => "stop",
3096 ExecutionControllerRequest::_UnknownMethod {
3097 method_type: fidl::MethodType::OneWay,
3098 ..
3099 } => "unknown one-way method",
3100 ExecutionControllerRequest::_UnknownMethod {
3101 method_type: fidl::MethodType::TwoWay,
3102 ..
3103 } => "unknown two-way method",
3104 }
3105 }
3106}
3107
3108#[derive(Debug, Clone)]
3109pub struct ExecutionControllerControlHandle {
3110 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3111}
3112
3113impl fidl::endpoints::ControlHandle for ExecutionControllerControlHandle {
3114 fn shutdown(&self) {
3115 self.inner.shutdown()
3116 }
3117 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3118 self.inner.shutdown_with_epitaph(status)
3119 }
3120
3121 fn is_closed(&self) -> bool {
3122 self.inner.channel().is_closed()
3123 }
3124 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3125 self.inner.channel().on_closed()
3126 }
3127
3128 #[cfg(target_os = "fuchsia")]
3129 fn signal_peer(
3130 &self,
3131 clear_mask: zx::Signals,
3132 set_mask: zx::Signals,
3133 ) -> Result<(), zx_status::Status> {
3134 use fidl::Peered;
3135 self.inner.channel().signal_peer(clear_mask, set_mask)
3136 }
3137}
3138
3139impl ExecutionControllerControlHandle {
3140 pub fn send_on_stop(&self, mut stopped_payload: &StoppedPayload) -> Result<(), fidl::Error> {
3141 self.inner.send::<ExecutionControllerOnStopRequest>(
3142 (stopped_payload,),
3143 0,
3144 0x62d5018e2174f57f,
3145 fidl::encoding::DynamicFlags::FLEXIBLE,
3146 )
3147 }
3148}
3149
3150#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3151pub struct IntrospectorMarker;
3152
3153impl fidl::endpoints::ProtocolMarker for IntrospectorMarker {
3154 type Proxy = IntrospectorProxy;
3155 type RequestStream = IntrospectorRequestStream;
3156 #[cfg(target_os = "fuchsia")]
3157 type SynchronousProxy = IntrospectorSynchronousProxy;
3158
3159 const DEBUG_NAME: &'static str = "fuchsia.component.Introspector";
3160}
3161impl fidl::endpoints::DiscoverableProtocolMarker for IntrospectorMarker {}
3162pub type IntrospectorGetMonikerResult = Result<String, Error>;
3163
3164pub trait IntrospectorProxyInterface: Send + Sync {
3165 type GetMonikerResponseFut: std::future::Future<Output = Result<IntrospectorGetMonikerResult, fidl::Error>>
3166 + Send;
3167 fn r#get_moniker(&self, component_instance: fidl::Event) -> Self::GetMonikerResponseFut;
3168}
3169#[derive(Debug)]
3170#[cfg(target_os = "fuchsia")]
3171pub struct IntrospectorSynchronousProxy {
3172 client: fidl::client::sync::Client,
3173}
3174
3175#[cfg(target_os = "fuchsia")]
3176impl fidl::endpoints::SynchronousProxy for IntrospectorSynchronousProxy {
3177 type Proxy = IntrospectorProxy;
3178 type Protocol = IntrospectorMarker;
3179
3180 fn from_channel(inner: fidl::Channel) -> Self {
3181 Self::new(inner)
3182 }
3183
3184 fn into_channel(self) -> fidl::Channel {
3185 self.client.into_channel()
3186 }
3187
3188 fn as_channel(&self) -> &fidl::Channel {
3189 self.client.as_channel()
3190 }
3191}
3192
3193#[cfg(target_os = "fuchsia")]
3194impl IntrospectorSynchronousProxy {
3195 pub fn new(channel: fidl::Channel) -> Self {
3196 let protocol_name = <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3197 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3198 }
3199
3200 pub fn into_channel(self) -> fidl::Channel {
3201 self.client.into_channel()
3202 }
3203
3204 pub fn wait_for_event(
3207 &self,
3208 deadline: zx::MonotonicInstant,
3209 ) -> Result<IntrospectorEvent, fidl::Error> {
3210 IntrospectorEvent::decode(self.client.wait_for_event(deadline)?)
3211 }
3212
3213 pub fn r#get_moniker(
3220 &self,
3221 mut component_instance: fidl::Event,
3222 ___deadline: zx::MonotonicInstant,
3223 ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
3224 let _response = self.client.send_query::<
3225 IntrospectorGetMonikerRequest,
3226 fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
3227 >(
3228 (component_instance,),
3229 0x2f980ceb37bf458,
3230 fidl::encoding::DynamicFlags::FLEXIBLE,
3231 ___deadline,
3232 )?
3233 .into_result::<IntrospectorMarker>("get_moniker")?;
3234 Ok(_response.map(|x| x.moniker))
3235 }
3236}
3237
3238#[cfg(target_os = "fuchsia")]
3239impl From<IntrospectorSynchronousProxy> for zx::Handle {
3240 fn from(value: IntrospectorSynchronousProxy) -> Self {
3241 value.into_channel().into()
3242 }
3243}
3244
3245#[cfg(target_os = "fuchsia")]
3246impl From<fidl::Channel> for IntrospectorSynchronousProxy {
3247 fn from(value: fidl::Channel) -> Self {
3248 Self::new(value)
3249 }
3250}
3251
3252#[derive(Debug, Clone)]
3253pub struct IntrospectorProxy {
3254 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3255}
3256
3257impl fidl::endpoints::Proxy for IntrospectorProxy {
3258 type Protocol = IntrospectorMarker;
3259
3260 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3261 Self::new(inner)
3262 }
3263
3264 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3265 self.client.into_channel().map_err(|client| Self { client })
3266 }
3267
3268 fn as_channel(&self) -> &::fidl::AsyncChannel {
3269 self.client.as_channel()
3270 }
3271}
3272
3273impl IntrospectorProxy {
3274 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3276 let protocol_name = <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3277 Self { client: fidl::client::Client::new(channel, protocol_name) }
3278 }
3279
3280 pub fn take_event_stream(&self) -> IntrospectorEventStream {
3286 IntrospectorEventStream { event_receiver: self.client.take_event_receiver() }
3287 }
3288
3289 pub fn r#get_moniker(
3296 &self,
3297 mut component_instance: fidl::Event,
3298 ) -> fidl::client::QueryResponseFut<
3299 IntrospectorGetMonikerResult,
3300 fidl::encoding::DefaultFuchsiaResourceDialect,
3301 > {
3302 IntrospectorProxyInterface::r#get_moniker(self, component_instance)
3303 }
3304}
3305
3306impl IntrospectorProxyInterface for IntrospectorProxy {
3307 type GetMonikerResponseFut = fidl::client::QueryResponseFut<
3308 IntrospectorGetMonikerResult,
3309 fidl::encoding::DefaultFuchsiaResourceDialect,
3310 >;
3311 fn r#get_moniker(&self, mut component_instance: fidl::Event) -> Self::GetMonikerResponseFut {
3312 fn _decode(
3313 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3314 ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
3315 let _response = fidl::client::decode_transaction_body::<
3316 fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
3317 fidl::encoding::DefaultFuchsiaResourceDialect,
3318 0x2f980ceb37bf458,
3319 >(_buf?)?
3320 .into_result::<IntrospectorMarker>("get_moniker")?;
3321 Ok(_response.map(|x| x.moniker))
3322 }
3323 self.client
3324 .send_query_and_decode::<IntrospectorGetMonikerRequest, IntrospectorGetMonikerResult>(
3325 (component_instance,),
3326 0x2f980ceb37bf458,
3327 fidl::encoding::DynamicFlags::FLEXIBLE,
3328 _decode,
3329 )
3330 }
3331}
3332
3333pub struct IntrospectorEventStream {
3334 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3335}
3336
3337impl std::marker::Unpin for IntrospectorEventStream {}
3338
3339impl futures::stream::FusedStream for IntrospectorEventStream {
3340 fn is_terminated(&self) -> bool {
3341 self.event_receiver.is_terminated()
3342 }
3343}
3344
3345impl futures::Stream for IntrospectorEventStream {
3346 type Item = Result<IntrospectorEvent, fidl::Error>;
3347
3348 fn poll_next(
3349 mut self: std::pin::Pin<&mut Self>,
3350 cx: &mut std::task::Context<'_>,
3351 ) -> std::task::Poll<Option<Self::Item>> {
3352 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3353 &mut self.event_receiver,
3354 cx
3355 )?) {
3356 Some(buf) => std::task::Poll::Ready(Some(IntrospectorEvent::decode(buf))),
3357 None => std::task::Poll::Ready(None),
3358 }
3359 }
3360}
3361
3362#[derive(Debug)]
3363pub enum IntrospectorEvent {
3364 #[non_exhaustive]
3365 _UnknownEvent {
3366 ordinal: u64,
3368 },
3369}
3370
3371impl IntrospectorEvent {
3372 fn decode(
3374 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3375 ) -> Result<IntrospectorEvent, fidl::Error> {
3376 let (bytes, _handles) = buf.split_mut();
3377 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3378 debug_assert_eq!(tx_header.tx_id, 0);
3379 match tx_header.ordinal {
3380 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3381 Ok(IntrospectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3382 }
3383 _ => Err(fidl::Error::UnknownOrdinal {
3384 ordinal: tx_header.ordinal,
3385 protocol_name: <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3386 }),
3387 }
3388 }
3389}
3390
3391pub struct IntrospectorRequestStream {
3393 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3394 is_terminated: bool,
3395}
3396
3397impl std::marker::Unpin for IntrospectorRequestStream {}
3398
3399impl futures::stream::FusedStream for IntrospectorRequestStream {
3400 fn is_terminated(&self) -> bool {
3401 self.is_terminated
3402 }
3403}
3404
3405impl fidl::endpoints::RequestStream for IntrospectorRequestStream {
3406 type Protocol = IntrospectorMarker;
3407 type ControlHandle = IntrospectorControlHandle;
3408
3409 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3410 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3411 }
3412
3413 fn control_handle(&self) -> Self::ControlHandle {
3414 IntrospectorControlHandle { inner: self.inner.clone() }
3415 }
3416
3417 fn into_inner(
3418 self,
3419 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3420 {
3421 (self.inner, self.is_terminated)
3422 }
3423
3424 fn from_inner(
3425 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3426 is_terminated: bool,
3427 ) -> Self {
3428 Self { inner, is_terminated }
3429 }
3430}
3431
3432impl futures::Stream for IntrospectorRequestStream {
3433 type Item = Result<IntrospectorRequest, fidl::Error>;
3434
3435 fn poll_next(
3436 mut self: std::pin::Pin<&mut Self>,
3437 cx: &mut std::task::Context<'_>,
3438 ) -> std::task::Poll<Option<Self::Item>> {
3439 let this = &mut *self;
3440 if this.inner.check_shutdown(cx) {
3441 this.is_terminated = true;
3442 return std::task::Poll::Ready(None);
3443 }
3444 if this.is_terminated {
3445 panic!("polled IntrospectorRequestStream after completion");
3446 }
3447 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3448 |bytes, handles| {
3449 match this.inner.channel().read_etc(cx, bytes, handles) {
3450 std::task::Poll::Ready(Ok(())) => {}
3451 std::task::Poll::Pending => return std::task::Poll::Pending,
3452 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3453 this.is_terminated = true;
3454 return std::task::Poll::Ready(None);
3455 }
3456 std::task::Poll::Ready(Err(e)) => {
3457 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3458 e.into(),
3459 ))))
3460 }
3461 }
3462
3463 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3465
3466 std::task::Poll::Ready(Some(match header.ordinal {
3467 0x2f980ceb37bf458 => {
3468 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3469 let mut req = fidl::new_empty!(
3470 IntrospectorGetMonikerRequest,
3471 fidl::encoding::DefaultFuchsiaResourceDialect
3472 );
3473 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<IntrospectorGetMonikerRequest>(&header, _body_bytes, handles, &mut req)?;
3474 let control_handle =
3475 IntrospectorControlHandle { inner: this.inner.clone() };
3476 Ok(IntrospectorRequest::GetMoniker {
3477 component_instance: req.component_instance,
3478
3479 responder: IntrospectorGetMonikerResponder {
3480 control_handle: std::mem::ManuallyDrop::new(control_handle),
3481 tx_id: header.tx_id,
3482 },
3483 })
3484 }
3485 _ if header.tx_id == 0
3486 && header
3487 .dynamic_flags()
3488 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3489 {
3490 Ok(IntrospectorRequest::_UnknownMethod {
3491 ordinal: header.ordinal,
3492 control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
3493 method_type: fidl::MethodType::OneWay,
3494 })
3495 }
3496 _ if header
3497 .dynamic_flags()
3498 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3499 {
3500 this.inner.send_framework_err(
3501 fidl::encoding::FrameworkErr::UnknownMethod,
3502 header.tx_id,
3503 header.ordinal,
3504 header.dynamic_flags(),
3505 (bytes, handles),
3506 )?;
3507 Ok(IntrospectorRequest::_UnknownMethod {
3508 ordinal: header.ordinal,
3509 control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
3510 method_type: fidl::MethodType::TwoWay,
3511 })
3512 }
3513 _ => Err(fidl::Error::UnknownOrdinal {
3514 ordinal: header.ordinal,
3515 protocol_name:
3516 <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3517 }),
3518 }))
3519 },
3520 )
3521 }
3522}
3523
3524#[derive(Debug)]
3533pub enum IntrospectorRequest {
3534 GetMoniker { component_instance: fidl::Event, responder: IntrospectorGetMonikerResponder },
3541 #[non_exhaustive]
3543 _UnknownMethod {
3544 ordinal: u64,
3546 control_handle: IntrospectorControlHandle,
3547 method_type: fidl::MethodType,
3548 },
3549}
3550
3551impl IntrospectorRequest {
3552 #[allow(irrefutable_let_patterns)]
3553 pub fn into_get_moniker(self) -> Option<(fidl::Event, IntrospectorGetMonikerResponder)> {
3554 if let IntrospectorRequest::GetMoniker { component_instance, responder } = self {
3555 Some((component_instance, responder))
3556 } else {
3557 None
3558 }
3559 }
3560
3561 pub fn method_name(&self) -> &'static str {
3563 match *self {
3564 IntrospectorRequest::GetMoniker { .. } => "get_moniker",
3565 IntrospectorRequest::_UnknownMethod {
3566 method_type: fidl::MethodType::OneWay, ..
3567 } => "unknown one-way method",
3568 IntrospectorRequest::_UnknownMethod {
3569 method_type: fidl::MethodType::TwoWay, ..
3570 } => "unknown two-way method",
3571 }
3572 }
3573}
3574
3575#[derive(Debug, Clone)]
3576pub struct IntrospectorControlHandle {
3577 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3578}
3579
3580impl fidl::endpoints::ControlHandle for IntrospectorControlHandle {
3581 fn shutdown(&self) {
3582 self.inner.shutdown()
3583 }
3584 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3585 self.inner.shutdown_with_epitaph(status)
3586 }
3587
3588 fn is_closed(&self) -> bool {
3589 self.inner.channel().is_closed()
3590 }
3591 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3592 self.inner.channel().on_closed()
3593 }
3594
3595 #[cfg(target_os = "fuchsia")]
3596 fn signal_peer(
3597 &self,
3598 clear_mask: zx::Signals,
3599 set_mask: zx::Signals,
3600 ) -> Result<(), zx_status::Status> {
3601 use fidl::Peered;
3602 self.inner.channel().signal_peer(clear_mask, set_mask)
3603 }
3604}
3605
3606impl IntrospectorControlHandle {}
3607
3608#[must_use = "FIDL methods require a response to be sent"]
3609#[derive(Debug)]
3610pub struct IntrospectorGetMonikerResponder {
3611 control_handle: std::mem::ManuallyDrop<IntrospectorControlHandle>,
3612 tx_id: u32,
3613}
3614
3615impl std::ops::Drop for IntrospectorGetMonikerResponder {
3619 fn drop(&mut self) {
3620 self.control_handle.shutdown();
3621 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3623 }
3624}
3625
3626impl fidl::endpoints::Responder for IntrospectorGetMonikerResponder {
3627 type ControlHandle = IntrospectorControlHandle;
3628
3629 fn control_handle(&self) -> &IntrospectorControlHandle {
3630 &self.control_handle
3631 }
3632
3633 fn drop_without_shutdown(mut self) {
3634 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3636 std::mem::forget(self);
3638 }
3639}
3640
3641impl IntrospectorGetMonikerResponder {
3642 pub fn send(self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
3646 let _result = self.send_raw(result);
3647 if _result.is_err() {
3648 self.control_handle.shutdown();
3649 }
3650 self.drop_without_shutdown();
3651 _result
3652 }
3653
3654 pub fn send_no_shutdown_on_err(
3656 self,
3657 mut result: Result<&str, Error>,
3658 ) -> Result<(), fidl::Error> {
3659 let _result = self.send_raw(result);
3660 self.drop_without_shutdown();
3661 _result
3662 }
3663
3664 fn send_raw(&self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
3665 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3666 IntrospectorGetMonikerResponse,
3667 Error,
3668 >>(
3669 fidl::encoding::FlexibleResult::new(result.map(|moniker| (moniker,))),
3670 self.tx_id,
3671 0x2f980ceb37bf458,
3672 fidl::encoding::DynamicFlags::FLEXIBLE,
3673 )
3674 }
3675}
3676
3677#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3678pub struct NamespaceMarker;
3679
3680impl fidl::endpoints::ProtocolMarker for NamespaceMarker {
3681 type Proxy = NamespaceProxy;
3682 type RequestStream = NamespaceRequestStream;
3683 #[cfg(target_os = "fuchsia")]
3684 type SynchronousProxy = NamespaceSynchronousProxy;
3685
3686 const DEBUG_NAME: &'static str = "fuchsia.component.Namespace";
3687}
3688impl fidl::endpoints::DiscoverableProtocolMarker for NamespaceMarker {}
3689pub type NamespaceCreateResult = Result<Vec<NamespaceEntry>, NamespaceError>;
3690
3691pub trait NamespaceProxyInterface: Send + Sync {
3692 type CreateResponseFut: std::future::Future<Output = Result<NamespaceCreateResult, fidl::Error>>
3693 + Send;
3694 fn r#create(&self, entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut;
3695}
3696#[derive(Debug)]
3697#[cfg(target_os = "fuchsia")]
3698pub struct NamespaceSynchronousProxy {
3699 client: fidl::client::sync::Client,
3700}
3701
3702#[cfg(target_os = "fuchsia")]
3703impl fidl::endpoints::SynchronousProxy for NamespaceSynchronousProxy {
3704 type Proxy = NamespaceProxy;
3705 type Protocol = NamespaceMarker;
3706
3707 fn from_channel(inner: fidl::Channel) -> Self {
3708 Self::new(inner)
3709 }
3710
3711 fn into_channel(self) -> fidl::Channel {
3712 self.client.into_channel()
3713 }
3714
3715 fn as_channel(&self) -> &fidl::Channel {
3716 self.client.as_channel()
3717 }
3718}
3719
3720#[cfg(target_os = "fuchsia")]
3721impl NamespaceSynchronousProxy {
3722 pub fn new(channel: fidl::Channel) -> Self {
3723 let protocol_name = <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3724 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3725 }
3726
3727 pub fn into_channel(self) -> fidl::Channel {
3728 self.client.into_channel()
3729 }
3730
3731 pub fn wait_for_event(
3734 &self,
3735 deadline: zx::MonotonicInstant,
3736 ) -> Result<NamespaceEvent, fidl::Error> {
3737 NamespaceEvent::decode(self.client.wait_for_event(deadline)?)
3738 }
3739
3740 pub fn r#create(
3741 &self,
3742 mut entries: Vec<NamespaceInputEntry>,
3743 ___deadline: zx::MonotonicInstant,
3744 ) -> Result<NamespaceCreateResult, fidl::Error> {
3745 let _response = self.client.send_query::<
3746 NamespaceCreateRequest,
3747 fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
3748 >(
3749 (entries.as_mut(),),
3750 0x4329fe12b2a790f9,
3751 fidl::encoding::DynamicFlags::FLEXIBLE,
3752 ___deadline,
3753 )?
3754 .into_result::<NamespaceMarker>("create")?;
3755 Ok(_response.map(|x| x.entries))
3756 }
3757}
3758
3759#[cfg(target_os = "fuchsia")]
3760impl From<NamespaceSynchronousProxy> for zx::Handle {
3761 fn from(value: NamespaceSynchronousProxy) -> Self {
3762 value.into_channel().into()
3763 }
3764}
3765
3766#[cfg(target_os = "fuchsia")]
3767impl From<fidl::Channel> for NamespaceSynchronousProxy {
3768 fn from(value: fidl::Channel) -> Self {
3769 Self::new(value)
3770 }
3771}
3772
3773#[derive(Debug, Clone)]
3774pub struct NamespaceProxy {
3775 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3776}
3777
3778impl fidl::endpoints::Proxy for NamespaceProxy {
3779 type Protocol = NamespaceMarker;
3780
3781 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3782 Self::new(inner)
3783 }
3784
3785 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3786 self.client.into_channel().map_err(|client| Self { client })
3787 }
3788
3789 fn as_channel(&self) -> &::fidl::AsyncChannel {
3790 self.client.as_channel()
3791 }
3792}
3793
3794impl NamespaceProxy {
3795 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3797 let protocol_name = <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3798 Self { client: fidl::client::Client::new(channel, protocol_name) }
3799 }
3800
3801 pub fn take_event_stream(&self) -> NamespaceEventStream {
3807 NamespaceEventStream { event_receiver: self.client.take_event_receiver() }
3808 }
3809
3810 pub fn r#create(
3811 &self,
3812 mut entries: Vec<NamespaceInputEntry>,
3813 ) -> fidl::client::QueryResponseFut<
3814 NamespaceCreateResult,
3815 fidl::encoding::DefaultFuchsiaResourceDialect,
3816 > {
3817 NamespaceProxyInterface::r#create(self, entries)
3818 }
3819}
3820
3821impl NamespaceProxyInterface for NamespaceProxy {
3822 type CreateResponseFut = fidl::client::QueryResponseFut<
3823 NamespaceCreateResult,
3824 fidl::encoding::DefaultFuchsiaResourceDialect,
3825 >;
3826 fn r#create(&self, mut entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut {
3827 fn _decode(
3828 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3829 ) -> Result<NamespaceCreateResult, fidl::Error> {
3830 let _response = fidl::client::decode_transaction_body::<
3831 fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
3832 fidl::encoding::DefaultFuchsiaResourceDialect,
3833 0x4329fe12b2a790f9,
3834 >(_buf?)?
3835 .into_result::<NamespaceMarker>("create")?;
3836 Ok(_response.map(|x| x.entries))
3837 }
3838 self.client.send_query_and_decode::<NamespaceCreateRequest, NamespaceCreateResult>(
3839 (entries.as_mut(),),
3840 0x4329fe12b2a790f9,
3841 fidl::encoding::DynamicFlags::FLEXIBLE,
3842 _decode,
3843 )
3844 }
3845}
3846
3847pub struct NamespaceEventStream {
3848 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3849}
3850
3851impl std::marker::Unpin for NamespaceEventStream {}
3852
3853impl futures::stream::FusedStream for NamespaceEventStream {
3854 fn is_terminated(&self) -> bool {
3855 self.event_receiver.is_terminated()
3856 }
3857}
3858
3859impl futures::Stream for NamespaceEventStream {
3860 type Item = Result<NamespaceEvent, fidl::Error>;
3861
3862 fn poll_next(
3863 mut self: std::pin::Pin<&mut Self>,
3864 cx: &mut std::task::Context<'_>,
3865 ) -> std::task::Poll<Option<Self::Item>> {
3866 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3867 &mut self.event_receiver,
3868 cx
3869 )?) {
3870 Some(buf) => std::task::Poll::Ready(Some(NamespaceEvent::decode(buf))),
3871 None => std::task::Poll::Ready(None),
3872 }
3873 }
3874}
3875
3876#[derive(Debug)]
3877pub enum NamespaceEvent {
3878 #[non_exhaustive]
3879 _UnknownEvent {
3880 ordinal: u64,
3882 },
3883}
3884
3885impl NamespaceEvent {
3886 fn decode(
3888 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3889 ) -> Result<NamespaceEvent, fidl::Error> {
3890 let (bytes, _handles) = buf.split_mut();
3891 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3892 debug_assert_eq!(tx_header.tx_id, 0);
3893 match tx_header.ordinal {
3894 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3895 Ok(NamespaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3896 }
3897 _ => Err(fidl::Error::UnknownOrdinal {
3898 ordinal: tx_header.ordinal,
3899 protocol_name: <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3900 }),
3901 }
3902 }
3903}
3904
3905pub struct NamespaceRequestStream {
3907 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3908 is_terminated: bool,
3909}
3910
3911impl std::marker::Unpin for NamespaceRequestStream {}
3912
3913impl futures::stream::FusedStream for NamespaceRequestStream {
3914 fn is_terminated(&self) -> bool {
3915 self.is_terminated
3916 }
3917}
3918
3919impl fidl::endpoints::RequestStream for NamespaceRequestStream {
3920 type Protocol = NamespaceMarker;
3921 type ControlHandle = NamespaceControlHandle;
3922
3923 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3924 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3925 }
3926
3927 fn control_handle(&self) -> Self::ControlHandle {
3928 NamespaceControlHandle { inner: self.inner.clone() }
3929 }
3930
3931 fn into_inner(
3932 self,
3933 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3934 {
3935 (self.inner, self.is_terminated)
3936 }
3937
3938 fn from_inner(
3939 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3940 is_terminated: bool,
3941 ) -> Self {
3942 Self { inner, is_terminated }
3943 }
3944}
3945
3946impl futures::Stream for NamespaceRequestStream {
3947 type Item = Result<NamespaceRequest, fidl::Error>;
3948
3949 fn poll_next(
3950 mut self: std::pin::Pin<&mut Self>,
3951 cx: &mut std::task::Context<'_>,
3952 ) -> std::task::Poll<Option<Self::Item>> {
3953 let this = &mut *self;
3954 if this.inner.check_shutdown(cx) {
3955 this.is_terminated = true;
3956 return std::task::Poll::Ready(None);
3957 }
3958 if this.is_terminated {
3959 panic!("polled NamespaceRequestStream after completion");
3960 }
3961 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3962 |bytes, handles| {
3963 match this.inner.channel().read_etc(cx, bytes, handles) {
3964 std::task::Poll::Ready(Ok(())) => {}
3965 std::task::Poll::Pending => return std::task::Poll::Pending,
3966 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3967 this.is_terminated = true;
3968 return std::task::Poll::Ready(None);
3969 }
3970 std::task::Poll::Ready(Err(e)) => {
3971 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3972 e.into(),
3973 ))))
3974 }
3975 }
3976
3977 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3979
3980 std::task::Poll::Ready(Some(match header.ordinal {
3981 0x4329fe12b2a790f9 => {
3982 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3983 let mut req = fidl::new_empty!(
3984 NamespaceCreateRequest,
3985 fidl::encoding::DefaultFuchsiaResourceDialect
3986 );
3987 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NamespaceCreateRequest>(&header, _body_bytes, handles, &mut req)?;
3988 let control_handle = NamespaceControlHandle { inner: this.inner.clone() };
3989 Ok(NamespaceRequest::Create {
3990 entries: req.entries,
3991
3992 responder: NamespaceCreateResponder {
3993 control_handle: std::mem::ManuallyDrop::new(control_handle),
3994 tx_id: header.tx_id,
3995 },
3996 })
3997 }
3998 _ if header.tx_id == 0
3999 && header
4000 .dynamic_flags()
4001 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4002 {
4003 Ok(NamespaceRequest::_UnknownMethod {
4004 ordinal: header.ordinal,
4005 control_handle: NamespaceControlHandle { inner: this.inner.clone() },
4006 method_type: fidl::MethodType::OneWay,
4007 })
4008 }
4009 _ if header
4010 .dynamic_flags()
4011 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4012 {
4013 this.inner.send_framework_err(
4014 fidl::encoding::FrameworkErr::UnknownMethod,
4015 header.tx_id,
4016 header.ordinal,
4017 header.dynamic_flags(),
4018 (bytes, handles),
4019 )?;
4020 Ok(NamespaceRequest::_UnknownMethod {
4021 ordinal: header.ordinal,
4022 control_handle: NamespaceControlHandle { inner: this.inner.clone() },
4023 method_type: fidl::MethodType::TwoWay,
4024 })
4025 }
4026 _ => Err(fidl::Error::UnknownOrdinal {
4027 ordinal: header.ordinal,
4028 protocol_name:
4029 <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4030 }),
4031 }))
4032 },
4033 )
4034 }
4035}
4036
4037#[derive(Debug)]
4039pub enum NamespaceRequest {
4040 Create {
4041 entries: Vec<NamespaceInputEntry>,
4042 responder: NamespaceCreateResponder,
4043 },
4044 #[non_exhaustive]
4046 _UnknownMethod {
4047 ordinal: u64,
4049 control_handle: NamespaceControlHandle,
4050 method_type: fidl::MethodType,
4051 },
4052}
4053
4054impl NamespaceRequest {
4055 #[allow(irrefutable_let_patterns)]
4056 pub fn into_create(self) -> Option<(Vec<NamespaceInputEntry>, NamespaceCreateResponder)> {
4057 if let NamespaceRequest::Create { entries, responder } = self {
4058 Some((entries, responder))
4059 } else {
4060 None
4061 }
4062 }
4063
4064 pub fn method_name(&self) -> &'static str {
4066 match *self {
4067 NamespaceRequest::Create { .. } => "create",
4068 NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4069 "unknown one-way method"
4070 }
4071 NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4072 "unknown two-way method"
4073 }
4074 }
4075 }
4076}
4077
4078#[derive(Debug, Clone)]
4079pub struct NamespaceControlHandle {
4080 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4081}
4082
4083impl fidl::endpoints::ControlHandle for NamespaceControlHandle {
4084 fn shutdown(&self) {
4085 self.inner.shutdown()
4086 }
4087 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4088 self.inner.shutdown_with_epitaph(status)
4089 }
4090
4091 fn is_closed(&self) -> bool {
4092 self.inner.channel().is_closed()
4093 }
4094 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4095 self.inner.channel().on_closed()
4096 }
4097
4098 #[cfg(target_os = "fuchsia")]
4099 fn signal_peer(
4100 &self,
4101 clear_mask: zx::Signals,
4102 set_mask: zx::Signals,
4103 ) -> Result<(), zx_status::Status> {
4104 use fidl::Peered;
4105 self.inner.channel().signal_peer(clear_mask, set_mask)
4106 }
4107}
4108
4109impl NamespaceControlHandle {}
4110
4111#[must_use = "FIDL methods require a response to be sent"]
4112#[derive(Debug)]
4113pub struct NamespaceCreateResponder {
4114 control_handle: std::mem::ManuallyDrop<NamespaceControlHandle>,
4115 tx_id: u32,
4116}
4117
4118impl std::ops::Drop for NamespaceCreateResponder {
4122 fn drop(&mut self) {
4123 self.control_handle.shutdown();
4124 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4126 }
4127}
4128
4129impl fidl::endpoints::Responder for NamespaceCreateResponder {
4130 type ControlHandle = NamespaceControlHandle;
4131
4132 fn control_handle(&self) -> &NamespaceControlHandle {
4133 &self.control_handle
4134 }
4135
4136 fn drop_without_shutdown(mut self) {
4137 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4139 std::mem::forget(self);
4141 }
4142}
4143
4144impl NamespaceCreateResponder {
4145 pub fn send(
4149 self,
4150 mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4151 ) -> Result<(), fidl::Error> {
4152 let _result = self.send_raw(result);
4153 if _result.is_err() {
4154 self.control_handle.shutdown();
4155 }
4156 self.drop_without_shutdown();
4157 _result
4158 }
4159
4160 pub fn send_no_shutdown_on_err(
4162 self,
4163 mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4164 ) -> Result<(), fidl::Error> {
4165 let _result = self.send_raw(result);
4166 self.drop_without_shutdown();
4167 _result
4168 }
4169
4170 fn send_raw(
4171 &self,
4172 mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4173 ) -> Result<(), fidl::Error> {
4174 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4175 NamespaceCreateResponse,
4176 NamespaceError,
4177 >>(
4178 fidl::encoding::FlexibleResult::new(
4179 result.as_mut().map_err(|e| *e).map(|entries| (entries.as_mut_slice(),)),
4180 ),
4181 self.tx_id,
4182 0x4329fe12b2a790f9,
4183 fidl::encoding::DynamicFlags::FLEXIBLE,
4184 )
4185 }
4186}
4187
4188#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4189pub struct RealmMarker;
4190
4191impl fidl::endpoints::ProtocolMarker for RealmMarker {
4192 type Proxy = RealmProxy;
4193 type RequestStream = RealmRequestStream;
4194 #[cfg(target_os = "fuchsia")]
4195 type SynchronousProxy = RealmSynchronousProxy;
4196
4197 const DEBUG_NAME: &'static str = "fuchsia.component.Realm";
4198}
4199impl fidl::endpoints::DiscoverableProtocolMarker for RealmMarker {}
4200pub type RealmOpenControllerResult = Result<(), Error>;
4201pub type RealmOpenExposedDirResult = Result<(), Error>;
4202pub type RealmCreateChildResult = Result<(), Error>;
4203pub type RealmDestroyChildResult = Result<(), Error>;
4204pub type RealmListChildrenResult = Result<(), Error>;
4205
4206pub trait RealmProxyInterface: Send + Sync {
4207 type OpenControllerResponseFut: std::future::Future<Output = Result<RealmOpenControllerResult, fidl::Error>>
4208 + Send;
4209 fn r#open_controller(
4210 &self,
4211 child: &fidl_fuchsia_component_decl::ChildRef,
4212 controller: fidl::endpoints::ServerEnd<ControllerMarker>,
4213 ) -> Self::OpenControllerResponseFut;
4214 type OpenExposedDirResponseFut: std::future::Future<Output = Result<RealmOpenExposedDirResult, fidl::Error>>
4215 + Send;
4216 fn r#open_exposed_dir(
4217 &self,
4218 child: &fidl_fuchsia_component_decl::ChildRef,
4219 exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4220 ) -> Self::OpenExposedDirResponseFut;
4221 type CreateChildResponseFut: std::future::Future<Output = Result<RealmCreateChildResult, fidl::Error>>
4222 + Send;
4223 fn r#create_child(
4224 &self,
4225 collection: &fidl_fuchsia_component_decl::CollectionRef,
4226 decl: &fidl_fuchsia_component_decl::Child,
4227 args: CreateChildArgs,
4228 ) -> Self::CreateChildResponseFut;
4229 type DestroyChildResponseFut: std::future::Future<Output = Result<RealmDestroyChildResult, fidl::Error>>
4230 + Send;
4231 fn r#destroy_child(
4232 &self,
4233 child: &fidl_fuchsia_component_decl::ChildRef,
4234 ) -> Self::DestroyChildResponseFut;
4235 type ListChildrenResponseFut: std::future::Future<Output = Result<RealmListChildrenResult, fidl::Error>>
4236 + Send;
4237 fn r#list_children(
4238 &self,
4239 collection: &fidl_fuchsia_component_decl::CollectionRef,
4240 iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
4241 ) -> Self::ListChildrenResponseFut;
4242}
4243#[derive(Debug)]
4244#[cfg(target_os = "fuchsia")]
4245pub struct RealmSynchronousProxy {
4246 client: fidl::client::sync::Client,
4247}
4248
4249#[cfg(target_os = "fuchsia")]
4250impl fidl::endpoints::SynchronousProxy for RealmSynchronousProxy {
4251 type Proxy = RealmProxy;
4252 type Protocol = RealmMarker;
4253
4254 fn from_channel(inner: fidl::Channel) -> Self {
4255 Self::new(inner)
4256 }
4257
4258 fn into_channel(self) -> fidl::Channel {
4259 self.client.into_channel()
4260 }
4261
4262 fn as_channel(&self) -> &fidl::Channel {
4263 self.client.as_channel()
4264 }
4265}
4266
4267#[cfg(target_os = "fuchsia")]
4268impl RealmSynchronousProxy {
4269 pub fn new(channel: fidl::Channel) -> Self {
4270 let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4271 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4272 }
4273
4274 pub fn into_channel(self) -> fidl::Channel {
4275 self.client.into_channel()
4276 }
4277
4278 pub fn wait_for_event(
4281 &self,
4282 deadline: zx::MonotonicInstant,
4283 ) -> Result<RealmEvent, fidl::Error> {
4284 RealmEvent::decode(self.client.wait_for_event(deadline)?)
4285 }
4286
4287 pub fn r#open_controller(
4294 &self,
4295 mut child: &fidl_fuchsia_component_decl::ChildRef,
4296 mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
4297 ___deadline: zx::MonotonicInstant,
4298 ) -> Result<RealmOpenControllerResult, fidl::Error> {
4299 let _response = self.client.send_query::<
4300 RealmOpenControllerRequest,
4301 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4302 >(
4303 (child, controller,),
4304 0x7150b7898d1b1180,
4305 fidl::encoding::DynamicFlags::empty(),
4306 ___deadline,
4307 )?;
4308 Ok(_response.map(|x| x))
4309 }
4310
4311 pub fn r#open_exposed_dir(
4327 &self,
4328 mut child: &fidl_fuchsia_component_decl::ChildRef,
4329 mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4330 ___deadline: zx::MonotonicInstant,
4331 ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
4332 let _response = self.client.send_query::<
4333 RealmOpenExposedDirRequest,
4334 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4335 >(
4336 (child, exposed_dir,),
4337 0x7f993235ca59f92c,
4338 fidl::encoding::DynamicFlags::empty(),
4339 ___deadline,
4340 )?;
4341 Ok(_response.map(|x| x))
4342 }
4343
4344 pub fn r#create_child(
4365 &self,
4366 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
4367 mut decl: &fidl_fuchsia_component_decl::Child,
4368 mut args: CreateChildArgs,
4369 ___deadline: zx::MonotonicInstant,
4370 ) -> Result<RealmCreateChildResult, fidl::Error> {
4371 let _response = self.client.send_query::<
4372 RealmCreateChildRequest,
4373 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4374 >(
4375 (collection, decl, &mut args,),
4376 0x43e48ce8483d7560,
4377 fidl::encoding::DynamicFlags::empty(),
4378 ___deadline,
4379 )?;
4380 Ok(_response.map(|x| x))
4381 }
4382
4383 pub fn r#destroy_child(
4395 &self,
4396 mut child: &fidl_fuchsia_component_decl::ChildRef,
4397 ___deadline: zx::MonotonicInstant,
4398 ) -> Result<RealmDestroyChildResult, fidl::Error> {
4399 let _response = self.client.send_query::<
4400 RealmDestroyChildRequest,
4401 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4402 >(
4403 (child,),
4404 0x71d8caf8850c9222,
4405 fidl::encoding::DynamicFlags::empty(),
4406 ___deadline,
4407 )?;
4408 Ok(_response.map(|x| x))
4409 }
4410
4411 pub fn r#list_children(
4425 &self,
4426 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
4427 mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
4428 ___deadline: zx::MonotonicInstant,
4429 ) -> Result<RealmListChildrenResult, fidl::Error> {
4430 let _response = self.client.send_query::<
4431 RealmListChildrenRequest,
4432 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4433 >(
4434 (collection, iter,),
4435 0x6888a76683efc0a1,
4436 fidl::encoding::DynamicFlags::empty(),
4437 ___deadline,
4438 )?;
4439 Ok(_response.map(|x| x))
4440 }
4441}
4442
4443#[cfg(target_os = "fuchsia")]
4444impl From<RealmSynchronousProxy> for zx::Handle {
4445 fn from(value: RealmSynchronousProxy) -> Self {
4446 value.into_channel().into()
4447 }
4448}
4449
4450#[cfg(target_os = "fuchsia")]
4451impl From<fidl::Channel> for RealmSynchronousProxy {
4452 fn from(value: fidl::Channel) -> Self {
4453 Self::new(value)
4454 }
4455}
4456
4457#[derive(Debug, Clone)]
4458pub struct RealmProxy {
4459 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4460}
4461
4462impl fidl::endpoints::Proxy for RealmProxy {
4463 type Protocol = RealmMarker;
4464
4465 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4466 Self::new(inner)
4467 }
4468
4469 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4470 self.client.into_channel().map_err(|client| Self { client })
4471 }
4472
4473 fn as_channel(&self) -> &::fidl::AsyncChannel {
4474 self.client.as_channel()
4475 }
4476}
4477
4478impl RealmProxy {
4479 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4481 let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4482 Self { client: fidl::client::Client::new(channel, protocol_name) }
4483 }
4484
4485 pub fn take_event_stream(&self) -> RealmEventStream {
4491 RealmEventStream { event_receiver: self.client.take_event_receiver() }
4492 }
4493
4494 pub fn r#open_controller(
4501 &self,
4502 mut child: &fidl_fuchsia_component_decl::ChildRef,
4503 mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
4504 ) -> fidl::client::QueryResponseFut<
4505 RealmOpenControllerResult,
4506 fidl::encoding::DefaultFuchsiaResourceDialect,
4507 > {
4508 RealmProxyInterface::r#open_controller(self, child, controller)
4509 }
4510
4511 pub fn r#open_exposed_dir(
4527 &self,
4528 mut child: &fidl_fuchsia_component_decl::ChildRef,
4529 mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4530 ) -> fidl::client::QueryResponseFut<
4531 RealmOpenExposedDirResult,
4532 fidl::encoding::DefaultFuchsiaResourceDialect,
4533 > {
4534 RealmProxyInterface::r#open_exposed_dir(self, child, exposed_dir)
4535 }
4536
4537 pub fn r#create_child(
4558 &self,
4559 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
4560 mut decl: &fidl_fuchsia_component_decl::Child,
4561 mut args: CreateChildArgs,
4562 ) -> fidl::client::QueryResponseFut<
4563 RealmCreateChildResult,
4564 fidl::encoding::DefaultFuchsiaResourceDialect,
4565 > {
4566 RealmProxyInterface::r#create_child(self, collection, decl, args)
4567 }
4568
4569 pub fn r#destroy_child(
4581 &self,
4582 mut child: &fidl_fuchsia_component_decl::ChildRef,
4583 ) -> fidl::client::QueryResponseFut<
4584 RealmDestroyChildResult,
4585 fidl::encoding::DefaultFuchsiaResourceDialect,
4586 > {
4587 RealmProxyInterface::r#destroy_child(self, child)
4588 }
4589
4590 pub fn r#list_children(
4604 &self,
4605 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
4606 mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
4607 ) -> fidl::client::QueryResponseFut<
4608 RealmListChildrenResult,
4609 fidl::encoding::DefaultFuchsiaResourceDialect,
4610 > {
4611 RealmProxyInterface::r#list_children(self, collection, iter)
4612 }
4613}
4614
4615impl RealmProxyInterface for RealmProxy {
4616 type OpenControllerResponseFut = fidl::client::QueryResponseFut<
4617 RealmOpenControllerResult,
4618 fidl::encoding::DefaultFuchsiaResourceDialect,
4619 >;
4620 fn r#open_controller(
4621 &self,
4622 mut child: &fidl_fuchsia_component_decl::ChildRef,
4623 mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
4624 ) -> Self::OpenControllerResponseFut {
4625 fn _decode(
4626 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4627 ) -> Result<RealmOpenControllerResult, fidl::Error> {
4628 let _response = fidl::client::decode_transaction_body::<
4629 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4630 fidl::encoding::DefaultFuchsiaResourceDialect,
4631 0x7150b7898d1b1180,
4632 >(_buf?)?;
4633 Ok(_response.map(|x| x))
4634 }
4635 self.client.send_query_and_decode::<RealmOpenControllerRequest, RealmOpenControllerResult>(
4636 (child, controller),
4637 0x7150b7898d1b1180,
4638 fidl::encoding::DynamicFlags::empty(),
4639 _decode,
4640 )
4641 }
4642
4643 type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
4644 RealmOpenExposedDirResult,
4645 fidl::encoding::DefaultFuchsiaResourceDialect,
4646 >;
4647 fn r#open_exposed_dir(
4648 &self,
4649 mut child: &fidl_fuchsia_component_decl::ChildRef,
4650 mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4651 ) -> Self::OpenExposedDirResponseFut {
4652 fn _decode(
4653 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4654 ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
4655 let _response = fidl::client::decode_transaction_body::<
4656 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4657 fidl::encoding::DefaultFuchsiaResourceDialect,
4658 0x7f993235ca59f92c,
4659 >(_buf?)?;
4660 Ok(_response.map(|x| x))
4661 }
4662 self.client.send_query_and_decode::<RealmOpenExposedDirRequest, RealmOpenExposedDirResult>(
4663 (child, exposed_dir),
4664 0x7f993235ca59f92c,
4665 fidl::encoding::DynamicFlags::empty(),
4666 _decode,
4667 )
4668 }
4669
4670 type CreateChildResponseFut = fidl::client::QueryResponseFut<
4671 RealmCreateChildResult,
4672 fidl::encoding::DefaultFuchsiaResourceDialect,
4673 >;
4674 fn r#create_child(
4675 &self,
4676 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
4677 mut decl: &fidl_fuchsia_component_decl::Child,
4678 mut args: CreateChildArgs,
4679 ) -> Self::CreateChildResponseFut {
4680 fn _decode(
4681 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4682 ) -> Result<RealmCreateChildResult, fidl::Error> {
4683 let _response = fidl::client::decode_transaction_body::<
4684 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4685 fidl::encoding::DefaultFuchsiaResourceDialect,
4686 0x43e48ce8483d7560,
4687 >(_buf?)?;
4688 Ok(_response.map(|x| x))
4689 }
4690 self.client.send_query_and_decode::<RealmCreateChildRequest, RealmCreateChildResult>(
4691 (collection, decl, &mut args),
4692 0x43e48ce8483d7560,
4693 fidl::encoding::DynamicFlags::empty(),
4694 _decode,
4695 )
4696 }
4697
4698 type DestroyChildResponseFut = fidl::client::QueryResponseFut<
4699 RealmDestroyChildResult,
4700 fidl::encoding::DefaultFuchsiaResourceDialect,
4701 >;
4702 fn r#destroy_child(
4703 &self,
4704 mut child: &fidl_fuchsia_component_decl::ChildRef,
4705 ) -> Self::DestroyChildResponseFut {
4706 fn _decode(
4707 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4708 ) -> Result<RealmDestroyChildResult, fidl::Error> {
4709 let _response = fidl::client::decode_transaction_body::<
4710 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4711 fidl::encoding::DefaultFuchsiaResourceDialect,
4712 0x71d8caf8850c9222,
4713 >(_buf?)?;
4714 Ok(_response.map(|x| x))
4715 }
4716 self.client.send_query_and_decode::<RealmDestroyChildRequest, RealmDestroyChildResult>(
4717 (child,),
4718 0x71d8caf8850c9222,
4719 fidl::encoding::DynamicFlags::empty(),
4720 _decode,
4721 )
4722 }
4723
4724 type ListChildrenResponseFut = fidl::client::QueryResponseFut<
4725 RealmListChildrenResult,
4726 fidl::encoding::DefaultFuchsiaResourceDialect,
4727 >;
4728 fn r#list_children(
4729 &self,
4730 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
4731 mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
4732 ) -> Self::ListChildrenResponseFut {
4733 fn _decode(
4734 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4735 ) -> Result<RealmListChildrenResult, fidl::Error> {
4736 let _response = fidl::client::decode_transaction_body::<
4737 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4738 fidl::encoding::DefaultFuchsiaResourceDialect,
4739 0x6888a76683efc0a1,
4740 >(_buf?)?;
4741 Ok(_response.map(|x| x))
4742 }
4743 self.client.send_query_and_decode::<RealmListChildrenRequest, RealmListChildrenResult>(
4744 (collection, iter),
4745 0x6888a76683efc0a1,
4746 fidl::encoding::DynamicFlags::empty(),
4747 _decode,
4748 )
4749 }
4750}
4751
4752pub struct RealmEventStream {
4753 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4754}
4755
4756impl std::marker::Unpin for RealmEventStream {}
4757
4758impl futures::stream::FusedStream for RealmEventStream {
4759 fn is_terminated(&self) -> bool {
4760 self.event_receiver.is_terminated()
4761 }
4762}
4763
4764impl futures::Stream for RealmEventStream {
4765 type Item = Result<RealmEvent, fidl::Error>;
4766
4767 fn poll_next(
4768 mut self: std::pin::Pin<&mut Self>,
4769 cx: &mut std::task::Context<'_>,
4770 ) -> std::task::Poll<Option<Self::Item>> {
4771 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4772 &mut self.event_receiver,
4773 cx
4774 )?) {
4775 Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
4776 None => std::task::Poll::Ready(None),
4777 }
4778 }
4779}
4780
4781#[derive(Debug)]
4782pub enum RealmEvent {}
4783
4784impl RealmEvent {
4785 fn decode(
4787 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4788 ) -> Result<RealmEvent, fidl::Error> {
4789 let (bytes, _handles) = buf.split_mut();
4790 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4791 debug_assert_eq!(tx_header.tx_id, 0);
4792 match tx_header.ordinal {
4793 _ => Err(fidl::Error::UnknownOrdinal {
4794 ordinal: tx_header.ordinal,
4795 protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4796 }),
4797 }
4798 }
4799}
4800
4801pub struct RealmRequestStream {
4803 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4804 is_terminated: bool,
4805}
4806
4807impl std::marker::Unpin for RealmRequestStream {}
4808
4809impl futures::stream::FusedStream for RealmRequestStream {
4810 fn is_terminated(&self) -> bool {
4811 self.is_terminated
4812 }
4813}
4814
4815impl fidl::endpoints::RequestStream for RealmRequestStream {
4816 type Protocol = RealmMarker;
4817 type ControlHandle = RealmControlHandle;
4818
4819 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4820 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4821 }
4822
4823 fn control_handle(&self) -> Self::ControlHandle {
4824 RealmControlHandle { inner: self.inner.clone() }
4825 }
4826
4827 fn into_inner(
4828 self,
4829 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4830 {
4831 (self.inner, self.is_terminated)
4832 }
4833
4834 fn from_inner(
4835 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4836 is_terminated: bool,
4837 ) -> Self {
4838 Self { inner, is_terminated }
4839 }
4840}
4841
4842impl futures::Stream for RealmRequestStream {
4843 type Item = Result<RealmRequest, fidl::Error>;
4844
4845 fn poll_next(
4846 mut self: std::pin::Pin<&mut Self>,
4847 cx: &mut std::task::Context<'_>,
4848 ) -> std::task::Poll<Option<Self::Item>> {
4849 let this = &mut *self;
4850 if this.inner.check_shutdown(cx) {
4851 this.is_terminated = true;
4852 return std::task::Poll::Ready(None);
4853 }
4854 if this.is_terminated {
4855 panic!("polled RealmRequestStream after completion");
4856 }
4857 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4858 |bytes, handles| {
4859 match this.inner.channel().read_etc(cx, bytes, handles) {
4860 std::task::Poll::Ready(Ok(())) => {}
4861 std::task::Poll::Pending => return std::task::Poll::Pending,
4862 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4863 this.is_terminated = true;
4864 return std::task::Poll::Ready(None);
4865 }
4866 std::task::Poll::Ready(Err(e)) => {
4867 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4868 e.into(),
4869 ))))
4870 }
4871 }
4872
4873 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4875
4876 std::task::Poll::Ready(Some(match header.ordinal {
4877 0x7150b7898d1b1180 => {
4878 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4879 let mut req = fidl::new_empty!(
4880 RealmOpenControllerRequest,
4881 fidl::encoding::DefaultFuchsiaResourceDialect
4882 );
4883 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmOpenControllerRequest>(&header, _body_bytes, handles, &mut req)?;
4884 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4885 Ok(RealmRequest::OpenController {
4886 child: req.child,
4887 controller: req.controller,
4888
4889 responder: RealmOpenControllerResponder {
4890 control_handle: std::mem::ManuallyDrop::new(control_handle),
4891 tx_id: header.tx_id,
4892 },
4893 })
4894 }
4895 0x7f993235ca59f92c => {
4896 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4897 let mut req = fidl::new_empty!(
4898 RealmOpenExposedDirRequest,
4899 fidl::encoding::DefaultFuchsiaResourceDialect
4900 );
4901 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
4902 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4903 Ok(RealmRequest::OpenExposedDir {
4904 child: req.child,
4905 exposed_dir: req.exposed_dir,
4906
4907 responder: RealmOpenExposedDirResponder {
4908 control_handle: std::mem::ManuallyDrop::new(control_handle),
4909 tx_id: header.tx_id,
4910 },
4911 })
4912 }
4913 0x43e48ce8483d7560 => {
4914 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4915 let mut req = fidl::new_empty!(
4916 RealmCreateChildRequest,
4917 fidl::encoding::DefaultFuchsiaResourceDialect
4918 );
4919 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmCreateChildRequest>(&header, _body_bytes, handles, &mut req)?;
4920 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4921 Ok(RealmRequest::CreateChild {
4922 collection: req.collection,
4923 decl: req.decl,
4924 args: req.args,
4925
4926 responder: RealmCreateChildResponder {
4927 control_handle: std::mem::ManuallyDrop::new(control_handle),
4928 tx_id: header.tx_id,
4929 },
4930 })
4931 }
4932 0x71d8caf8850c9222 => {
4933 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4934 let mut req = fidl::new_empty!(
4935 RealmDestroyChildRequest,
4936 fidl::encoding::DefaultFuchsiaResourceDialect
4937 );
4938 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmDestroyChildRequest>(&header, _body_bytes, handles, &mut req)?;
4939 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4940 Ok(RealmRequest::DestroyChild {
4941 child: req.child,
4942
4943 responder: RealmDestroyChildResponder {
4944 control_handle: std::mem::ManuallyDrop::new(control_handle),
4945 tx_id: header.tx_id,
4946 },
4947 })
4948 }
4949 0x6888a76683efc0a1 => {
4950 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4951 let mut req = fidl::new_empty!(
4952 RealmListChildrenRequest,
4953 fidl::encoding::DefaultFuchsiaResourceDialect
4954 );
4955 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmListChildrenRequest>(&header, _body_bytes, handles, &mut req)?;
4956 let control_handle = RealmControlHandle { inner: this.inner.clone() };
4957 Ok(RealmRequest::ListChildren {
4958 collection: req.collection,
4959 iter: req.iter,
4960
4961 responder: RealmListChildrenResponder {
4962 control_handle: std::mem::ManuallyDrop::new(control_handle),
4963 tx_id: header.tx_id,
4964 },
4965 })
4966 }
4967 _ => Err(fidl::Error::UnknownOrdinal {
4968 ordinal: header.ordinal,
4969 protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4970 }),
4971 }))
4972 },
4973 )
4974 }
4975}
4976
4977#[derive(Debug)]
4987pub enum RealmRequest {
4988 OpenController {
4995 child: fidl_fuchsia_component_decl::ChildRef,
4996 controller: fidl::endpoints::ServerEnd<ControllerMarker>,
4997 responder: RealmOpenControllerResponder,
4998 },
4999 OpenExposedDir {
5015 child: fidl_fuchsia_component_decl::ChildRef,
5016 exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5017 responder: RealmOpenExposedDirResponder,
5018 },
5019 CreateChild {
5040 collection: fidl_fuchsia_component_decl::CollectionRef,
5041 decl: fidl_fuchsia_component_decl::Child,
5042 args: CreateChildArgs,
5043 responder: RealmCreateChildResponder,
5044 },
5045 DestroyChild {
5057 child: fidl_fuchsia_component_decl::ChildRef,
5058 responder: RealmDestroyChildResponder,
5059 },
5060 ListChildren {
5074 collection: fidl_fuchsia_component_decl::CollectionRef,
5075 iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5076 responder: RealmListChildrenResponder,
5077 },
5078}
5079
5080impl RealmRequest {
5081 #[allow(irrefutable_let_patterns)]
5082 pub fn into_open_controller(
5083 self,
5084 ) -> Option<(
5085 fidl_fuchsia_component_decl::ChildRef,
5086 fidl::endpoints::ServerEnd<ControllerMarker>,
5087 RealmOpenControllerResponder,
5088 )> {
5089 if let RealmRequest::OpenController { child, controller, responder } = self {
5090 Some((child, controller, responder))
5091 } else {
5092 None
5093 }
5094 }
5095
5096 #[allow(irrefutable_let_patterns)]
5097 pub fn into_open_exposed_dir(
5098 self,
5099 ) -> Option<(
5100 fidl_fuchsia_component_decl::ChildRef,
5101 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5102 RealmOpenExposedDirResponder,
5103 )> {
5104 if let RealmRequest::OpenExposedDir { child, exposed_dir, responder } = self {
5105 Some((child, exposed_dir, responder))
5106 } else {
5107 None
5108 }
5109 }
5110
5111 #[allow(irrefutable_let_patterns)]
5112 pub fn into_create_child(
5113 self,
5114 ) -> Option<(
5115 fidl_fuchsia_component_decl::CollectionRef,
5116 fidl_fuchsia_component_decl::Child,
5117 CreateChildArgs,
5118 RealmCreateChildResponder,
5119 )> {
5120 if let RealmRequest::CreateChild { collection, decl, args, responder } = self {
5121 Some((collection, decl, args, responder))
5122 } else {
5123 None
5124 }
5125 }
5126
5127 #[allow(irrefutable_let_patterns)]
5128 pub fn into_destroy_child(
5129 self,
5130 ) -> Option<(fidl_fuchsia_component_decl::ChildRef, RealmDestroyChildResponder)> {
5131 if let RealmRequest::DestroyChild { child, responder } = self {
5132 Some((child, responder))
5133 } else {
5134 None
5135 }
5136 }
5137
5138 #[allow(irrefutable_let_patterns)]
5139 pub fn into_list_children(
5140 self,
5141 ) -> Option<(
5142 fidl_fuchsia_component_decl::CollectionRef,
5143 fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5144 RealmListChildrenResponder,
5145 )> {
5146 if let RealmRequest::ListChildren { collection, iter, responder } = self {
5147 Some((collection, iter, responder))
5148 } else {
5149 None
5150 }
5151 }
5152
5153 pub fn method_name(&self) -> &'static str {
5155 match *self {
5156 RealmRequest::OpenController { .. } => "open_controller",
5157 RealmRequest::OpenExposedDir { .. } => "open_exposed_dir",
5158 RealmRequest::CreateChild { .. } => "create_child",
5159 RealmRequest::DestroyChild { .. } => "destroy_child",
5160 RealmRequest::ListChildren { .. } => "list_children",
5161 }
5162 }
5163}
5164
5165#[derive(Debug, Clone)]
5166pub struct RealmControlHandle {
5167 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5168}
5169
5170impl fidl::endpoints::ControlHandle for RealmControlHandle {
5171 fn shutdown(&self) {
5172 self.inner.shutdown()
5173 }
5174 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5175 self.inner.shutdown_with_epitaph(status)
5176 }
5177
5178 fn is_closed(&self) -> bool {
5179 self.inner.channel().is_closed()
5180 }
5181 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5182 self.inner.channel().on_closed()
5183 }
5184
5185 #[cfg(target_os = "fuchsia")]
5186 fn signal_peer(
5187 &self,
5188 clear_mask: zx::Signals,
5189 set_mask: zx::Signals,
5190 ) -> Result<(), zx_status::Status> {
5191 use fidl::Peered;
5192 self.inner.channel().signal_peer(clear_mask, set_mask)
5193 }
5194}
5195
5196impl RealmControlHandle {}
5197
5198#[must_use = "FIDL methods require a response to be sent"]
5199#[derive(Debug)]
5200pub struct RealmOpenControllerResponder {
5201 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5202 tx_id: u32,
5203}
5204
5205impl std::ops::Drop for RealmOpenControllerResponder {
5209 fn drop(&mut self) {
5210 self.control_handle.shutdown();
5211 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5213 }
5214}
5215
5216impl fidl::endpoints::Responder for RealmOpenControllerResponder {
5217 type ControlHandle = RealmControlHandle;
5218
5219 fn control_handle(&self) -> &RealmControlHandle {
5220 &self.control_handle
5221 }
5222
5223 fn drop_without_shutdown(mut self) {
5224 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5226 std::mem::forget(self);
5228 }
5229}
5230
5231impl RealmOpenControllerResponder {
5232 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5236 let _result = self.send_raw(result);
5237 if _result.is_err() {
5238 self.control_handle.shutdown();
5239 }
5240 self.drop_without_shutdown();
5241 _result
5242 }
5243
5244 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5246 let _result = self.send_raw(result);
5247 self.drop_without_shutdown();
5248 _result
5249 }
5250
5251 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5252 self.control_handle
5253 .inner
5254 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5255 result,
5256 self.tx_id,
5257 0x7150b7898d1b1180,
5258 fidl::encoding::DynamicFlags::empty(),
5259 )
5260 }
5261}
5262
5263#[must_use = "FIDL methods require a response to be sent"]
5264#[derive(Debug)]
5265pub struct RealmOpenExposedDirResponder {
5266 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5267 tx_id: u32,
5268}
5269
5270impl std::ops::Drop for RealmOpenExposedDirResponder {
5274 fn drop(&mut self) {
5275 self.control_handle.shutdown();
5276 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5278 }
5279}
5280
5281impl fidl::endpoints::Responder for RealmOpenExposedDirResponder {
5282 type ControlHandle = RealmControlHandle;
5283
5284 fn control_handle(&self) -> &RealmControlHandle {
5285 &self.control_handle
5286 }
5287
5288 fn drop_without_shutdown(mut self) {
5289 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5291 std::mem::forget(self);
5293 }
5294}
5295
5296impl RealmOpenExposedDirResponder {
5297 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5301 let _result = self.send_raw(result);
5302 if _result.is_err() {
5303 self.control_handle.shutdown();
5304 }
5305 self.drop_without_shutdown();
5306 _result
5307 }
5308
5309 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5311 let _result = self.send_raw(result);
5312 self.drop_without_shutdown();
5313 _result
5314 }
5315
5316 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5317 self.control_handle
5318 .inner
5319 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5320 result,
5321 self.tx_id,
5322 0x7f993235ca59f92c,
5323 fidl::encoding::DynamicFlags::empty(),
5324 )
5325 }
5326}
5327
5328#[must_use = "FIDL methods require a response to be sent"]
5329#[derive(Debug)]
5330pub struct RealmCreateChildResponder {
5331 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5332 tx_id: u32,
5333}
5334
5335impl std::ops::Drop for RealmCreateChildResponder {
5339 fn drop(&mut self) {
5340 self.control_handle.shutdown();
5341 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5343 }
5344}
5345
5346impl fidl::endpoints::Responder for RealmCreateChildResponder {
5347 type ControlHandle = RealmControlHandle;
5348
5349 fn control_handle(&self) -> &RealmControlHandle {
5350 &self.control_handle
5351 }
5352
5353 fn drop_without_shutdown(mut self) {
5354 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5356 std::mem::forget(self);
5358 }
5359}
5360
5361impl RealmCreateChildResponder {
5362 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5366 let _result = self.send_raw(result);
5367 if _result.is_err() {
5368 self.control_handle.shutdown();
5369 }
5370 self.drop_without_shutdown();
5371 _result
5372 }
5373
5374 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5376 let _result = self.send_raw(result);
5377 self.drop_without_shutdown();
5378 _result
5379 }
5380
5381 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5382 self.control_handle
5383 .inner
5384 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5385 result,
5386 self.tx_id,
5387 0x43e48ce8483d7560,
5388 fidl::encoding::DynamicFlags::empty(),
5389 )
5390 }
5391}
5392
5393#[must_use = "FIDL methods require a response to be sent"]
5394#[derive(Debug)]
5395pub struct RealmDestroyChildResponder {
5396 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5397 tx_id: u32,
5398}
5399
5400impl std::ops::Drop for RealmDestroyChildResponder {
5404 fn drop(&mut self) {
5405 self.control_handle.shutdown();
5406 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5408 }
5409}
5410
5411impl fidl::endpoints::Responder for RealmDestroyChildResponder {
5412 type ControlHandle = RealmControlHandle;
5413
5414 fn control_handle(&self) -> &RealmControlHandle {
5415 &self.control_handle
5416 }
5417
5418 fn drop_without_shutdown(mut self) {
5419 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5421 std::mem::forget(self);
5423 }
5424}
5425
5426impl RealmDestroyChildResponder {
5427 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5431 let _result = self.send_raw(result);
5432 if _result.is_err() {
5433 self.control_handle.shutdown();
5434 }
5435 self.drop_without_shutdown();
5436 _result
5437 }
5438
5439 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5441 let _result = self.send_raw(result);
5442 self.drop_without_shutdown();
5443 _result
5444 }
5445
5446 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5447 self.control_handle
5448 .inner
5449 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5450 result,
5451 self.tx_id,
5452 0x71d8caf8850c9222,
5453 fidl::encoding::DynamicFlags::empty(),
5454 )
5455 }
5456}
5457
5458#[must_use = "FIDL methods require a response to be sent"]
5459#[derive(Debug)]
5460pub struct RealmListChildrenResponder {
5461 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5462 tx_id: u32,
5463}
5464
5465impl std::ops::Drop for RealmListChildrenResponder {
5469 fn drop(&mut self) {
5470 self.control_handle.shutdown();
5471 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5473 }
5474}
5475
5476impl fidl::endpoints::Responder for RealmListChildrenResponder {
5477 type ControlHandle = RealmControlHandle;
5478
5479 fn control_handle(&self) -> &RealmControlHandle {
5480 &self.control_handle
5481 }
5482
5483 fn drop_without_shutdown(mut self) {
5484 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5486 std::mem::forget(self);
5488 }
5489}
5490
5491impl RealmListChildrenResponder {
5492 pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5496 let _result = self.send_raw(result);
5497 if _result.is_err() {
5498 self.control_handle.shutdown();
5499 }
5500 self.drop_without_shutdown();
5501 _result
5502 }
5503
5504 pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5506 let _result = self.send_raw(result);
5507 self.drop_without_shutdown();
5508 _result
5509 }
5510
5511 fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5512 self.control_handle
5513 .inner
5514 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5515 result,
5516 self.tx_id,
5517 0x6888a76683efc0a1,
5518 fidl::encoding::DynamicFlags::empty(),
5519 )
5520 }
5521}
5522
5523mod internal {
5524 use super::*;
5525
5526 impl fidl::encoding::ResourceTypeMarker for ControllerStartRequest {
5527 type Borrowed<'a> = &'a mut Self;
5528 fn take_or_borrow<'a>(
5529 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5530 ) -> Self::Borrowed<'a> {
5531 value
5532 }
5533 }
5534
5535 unsafe impl fidl::encoding::TypeMarker for ControllerStartRequest {
5536 type Owned = Self;
5537
5538 #[inline(always)]
5539 fn inline_align(_context: fidl::encoding::Context) -> usize {
5540 8
5541 }
5542
5543 #[inline(always)]
5544 fn inline_size(_context: fidl::encoding::Context) -> usize {
5545 24
5546 }
5547 }
5548
5549 unsafe impl
5550 fidl::encoding::Encode<
5551 ControllerStartRequest,
5552 fidl::encoding::DefaultFuchsiaResourceDialect,
5553 > for &mut ControllerStartRequest
5554 {
5555 #[inline]
5556 unsafe fn encode(
5557 self,
5558 encoder: &mut fidl::encoding::Encoder<
5559 '_,
5560 fidl::encoding::DefaultFuchsiaResourceDialect,
5561 >,
5562 offset: usize,
5563 _depth: fidl::encoding::Depth,
5564 ) -> fidl::Result<()> {
5565 encoder.debug_check_bounds::<ControllerStartRequest>(offset);
5566 fidl::encoding::Encode::<ControllerStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5568 (
5569 <StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
5570 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.execution_controller),
5571 ),
5572 encoder, offset, _depth
5573 )
5574 }
5575 }
5576 unsafe impl<
5577 T0: fidl::encoding::Encode<StartChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
5578 T1: fidl::encoding::Encode<
5579 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
5580 fidl::encoding::DefaultFuchsiaResourceDialect,
5581 >,
5582 >
5583 fidl::encoding::Encode<
5584 ControllerStartRequest,
5585 fidl::encoding::DefaultFuchsiaResourceDialect,
5586 > for (T0, T1)
5587 {
5588 #[inline]
5589 unsafe fn encode(
5590 self,
5591 encoder: &mut fidl::encoding::Encoder<
5592 '_,
5593 fidl::encoding::DefaultFuchsiaResourceDialect,
5594 >,
5595 offset: usize,
5596 depth: fidl::encoding::Depth,
5597 ) -> fidl::Result<()> {
5598 encoder.debug_check_bounds::<ControllerStartRequest>(offset);
5599 unsafe {
5602 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5603 (ptr as *mut u64).write_unaligned(0);
5604 }
5605 self.0.encode(encoder, offset + 0, depth)?;
5607 self.1.encode(encoder, offset + 16, depth)?;
5608 Ok(())
5609 }
5610 }
5611
5612 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5613 for ControllerStartRequest
5614 {
5615 #[inline(always)]
5616 fn new_empty() -> Self {
5617 Self {
5618 args: fidl::new_empty!(
5619 StartChildArgs,
5620 fidl::encoding::DefaultFuchsiaResourceDialect
5621 ),
5622 execution_controller: fidl::new_empty!(
5623 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
5624 fidl::encoding::DefaultFuchsiaResourceDialect
5625 ),
5626 }
5627 }
5628
5629 #[inline]
5630 unsafe fn decode(
5631 &mut self,
5632 decoder: &mut fidl::encoding::Decoder<
5633 '_,
5634 fidl::encoding::DefaultFuchsiaResourceDialect,
5635 >,
5636 offset: usize,
5637 _depth: fidl::encoding::Depth,
5638 ) -> fidl::Result<()> {
5639 decoder.debug_check_bounds::<Self>(offset);
5640 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5642 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5643 let mask = 0xffffffff00000000u64;
5644 let maskedval = padval & mask;
5645 if maskedval != 0 {
5646 return Err(fidl::Error::NonZeroPadding {
5647 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5648 });
5649 }
5650 fidl::decode!(
5651 StartChildArgs,
5652 fidl::encoding::DefaultFuchsiaResourceDialect,
5653 &mut self.args,
5654 decoder,
5655 offset + 0,
5656 _depth
5657 )?;
5658 fidl::decode!(
5659 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
5660 fidl::encoding::DefaultFuchsiaResourceDialect,
5661 &mut self.execution_controller,
5662 decoder,
5663 offset + 16,
5664 _depth
5665 )?;
5666 Ok(())
5667 }
5668 }
5669
5670 impl fidl::encoding::ResourceTypeMarker for ControllerGetExposedDictionaryResponse {
5671 type Borrowed<'a> = &'a mut Self;
5672 fn take_or_borrow<'a>(
5673 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5674 ) -> Self::Borrowed<'a> {
5675 value
5676 }
5677 }
5678
5679 unsafe impl fidl::encoding::TypeMarker for ControllerGetExposedDictionaryResponse {
5680 type Owned = Self;
5681
5682 #[inline(always)]
5683 fn inline_align(_context: fidl::encoding::Context) -> usize {
5684 4
5685 }
5686
5687 #[inline(always)]
5688 fn inline_size(_context: fidl::encoding::Context) -> usize {
5689 4
5690 }
5691 }
5692
5693 unsafe impl
5694 fidl::encoding::Encode<
5695 ControllerGetExposedDictionaryResponse,
5696 fidl::encoding::DefaultFuchsiaResourceDialect,
5697 > for &mut ControllerGetExposedDictionaryResponse
5698 {
5699 #[inline]
5700 unsafe fn encode(
5701 self,
5702 encoder: &mut fidl::encoding::Encoder<
5703 '_,
5704 fidl::encoding::DefaultFuchsiaResourceDialect,
5705 >,
5706 offset: usize,
5707 _depth: fidl::encoding::Depth,
5708 ) -> fidl::Result<()> {
5709 encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
5710 fidl::encoding::Encode::<ControllerGetExposedDictionaryResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5712 (
5713 <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
5714 ),
5715 encoder, offset, _depth
5716 )
5717 }
5718 }
5719 unsafe impl<
5720 T0: fidl::encoding::Encode<
5721 fidl_fuchsia_component_sandbox::DictionaryRef,
5722 fidl::encoding::DefaultFuchsiaResourceDialect,
5723 >,
5724 >
5725 fidl::encoding::Encode<
5726 ControllerGetExposedDictionaryResponse,
5727 fidl::encoding::DefaultFuchsiaResourceDialect,
5728 > for (T0,)
5729 {
5730 #[inline]
5731 unsafe fn encode(
5732 self,
5733 encoder: &mut fidl::encoding::Encoder<
5734 '_,
5735 fidl::encoding::DefaultFuchsiaResourceDialect,
5736 >,
5737 offset: usize,
5738 depth: fidl::encoding::Depth,
5739 ) -> fidl::Result<()> {
5740 encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
5741 self.0.encode(encoder, offset + 0, depth)?;
5745 Ok(())
5746 }
5747 }
5748
5749 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5750 for ControllerGetExposedDictionaryResponse
5751 {
5752 #[inline(always)]
5753 fn new_empty() -> Self {
5754 Self {
5755 dictionary: fidl::new_empty!(
5756 fidl_fuchsia_component_sandbox::DictionaryRef,
5757 fidl::encoding::DefaultFuchsiaResourceDialect
5758 ),
5759 }
5760 }
5761
5762 #[inline]
5763 unsafe fn decode(
5764 &mut self,
5765 decoder: &mut fidl::encoding::Decoder<
5766 '_,
5767 fidl::encoding::DefaultFuchsiaResourceDialect,
5768 >,
5769 offset: usize,
5770 _depth: fidl::encoding::Depth,
5771 ) -> fidl::Result<()> {
5772 decoder.debug_check_bounds::<Self>(offset);
5773 fidl::decode!(
5775 fidl_fuchsia_component_sandbox::DictionaryRef,
5776 fidl::encoding::DefaultFuchsiaResourceDialect,
5777 &mut self.dictionary,
5778 decoder,
5779 offset + 0,
5780 _depth
5781 )?;
5782 Ok(())
5783 }
5784 }
5785
5786 impl fidl::encoding::ResourceTypeMarker for ControllerIsStartedResponse {
5787 type Borrowed<'a> = &'a mut Self;
5788 fn take_or_borrow<'a>(
5789 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5790 ) -> Self::Borrowed<'a> {
5791 value
5792 }
5793 }
5794
5795 unsafe impl fidl::encoding::TypeMarker for ControllerIsStartedResponse {
5796 type Owned = Self;
5797
5798 #[inline(always)]
5799 fn inline_align(_context: fidl::encoding::Context) -> usize {
5800 1
5801 }
5802
5803 #[inline(always)]
5804 fn inline_size(_context: fidl::encoding::Context) -> usize {
5805 1
5806 }
5807 }
5808
5809 unsafe impl
5810 fidl::encoding::Encode<
5811 ControllerIsStartedResponse,
5812 fidl::encoding::DefaultFuchsiaResourceDialect,
5813 > for &mut ControllerIsStartedResponse
5814 {
5815 #[inline]
5816 unsafe fn encode(
5817 self,
5818 encoder: &mut fidl::encoding::Encoder<
5819 '_,
5820 fidl::encoding::DefaultFuchsiaResourceDialect,
5821 >,
5822 offset: usize,
5823 _depth: fidl::encoding::Depth,
5824 ) -> fidl::Result<()> {
5825 encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
5826 fidl::encoding::Encode::<
5828 ControllerIsStartedResponse,
5829 fidl::encoding::DefaultFuchsiaResourceDialect,
5830 >::encode(
5831 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_started),),
5832 encoder,
5833 offset,
5834 _depth,
5835 )
5836 }
5837 }
5838 unsafe impl<T0: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>>
5839 fidl::encoding::Encode<
5840 ControllerIsStartedResponse,
5841 fidl::encoding::DefaultFuchsiaResourceDialect,
5842 > for (T0,)
5843 {
5844 #[inline]
5845 unsafe fn encode(
5846 self,
5847 encoder: &mut fidl::encoding::Encoder<
5848 '_,
5849 fidl::encoding::DefaultFuchsiaResourceDialect,
5850 >,
5851 offset: usize,
5852 depth: fidl::encoding::Depth,
5853 ) -> fidl::Result<()> {
5854 encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
5855 self.0.encode(encoder, offset + 0, depth)?;
5859 Ok(())
5860 }
5861 }
5862
5863 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5864 for ControllerIsStartedResponse
5865 {
5866 #[inline(always)]
5867 fn new_empty() -> Self {
5868 Self {
5869 is_started: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
5870 }
5871 }
5872
5873 #[inline]
5874 unsafe fn decode(
5875 &mut self,
5876 decoder: &mut fidl::encoding::Decoder<
5877 '_,
5878 fidl::encoding::DefaultFuchsiaResourceDialect,
5879 >,
5880 offset: usize,
5881 _depth: fidl::encoding::Depth,
5882 ) -> fidl::Result<()> {
5883 decoder.debug_check_bounds::<Self>(offset);
5884 fidl::decode!(
5886 bool,
5887 fidl::encoding::DefaultFuchsiaResourceDialect,
5888 &mut self.is_started,
5889 decoder,
5890 offset + 0,
5891 _depth
5892 )?;
5893 Ok(())
5894 }
5895 }
5896
5897 impl fidl::encoding::ResourceTypeMarker for EventStreamGetNextResponse {
5898 type Borrowed<'a> = &'a mut Self;
5899 fn take_or_borrow<'a>(
5900 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5901 ) -> Self::Borrowed<'a> {
5902 value
5903 }
5904 }
5905
5906 unsafe impl fidl::encoding::TypeMarker for EventStreamGetNextResponse {
5907 type Owned = Self;
5908
5909 #[inline(always)]
5910 fn inline_align(_context: fidl::encoding::Context) -> usize {
5911 8
5912 }
5913
5914 #[inline(always)]
5915 fn inline_size(_context: fidl::encoding::Context) -> usize {
5916 16
5917 }
5918 }
5919
5920 unsafe impl
5921 fidl::encoding::Encode<
5922 EventStreamGetNextResponse,
5923 fidl::encoding::DefaultFuchsiaResourceDialect,
5924 > for &mut EventStreamGetNextResponse
5925 {
5926 #[inline]
5927 unsafe fn encode(
5928 self,
5929 encoder: &mut fidl::encoding::Encoder<
5930 '_,
5931 fidl::encoding::DefaultFuchsiaResourceDialect,
5932 >,
5933 offset: usize,
5934 _depth: fidl::encoding::Depth,
5935 ) -> fidl::Result<()> {
5936 encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
5937 fidl::encoding::Encode::<EventStreamGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5939 (
5940 <fidl::encoding::UnboundedVector<Event> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
5941 ),
5942 encoder, offset, _depth
5943 )
5944 }
5945 }
5946 unsafe impl<
5947 T0: fidl::encoding::Encode<
5948 fidl::encoding::UnboundedVector<Event>,
5949 fidl::encoding::DefaultFuchsiaResourceDialect,
5950 >,
5951 >
5952 fidl::encoding::Encode<
5953 EventStreamGetNextResponse,
5954 fidl::encoding::DefaultFuchsiaResourceDialect,
5955 > for (T0,)
5956 {
5957 #[inline]
5958 unsafe fn encode(
5959 self,
5960 encoder: &mut fidl::encoding::Encoder<
5961 '_,
5962 fidl::encoding::DefaultFuchsiaResourceDialect,
5963 >,
5964 offset: usize,
5965 depth: fidl::encoding::Depth,
5966 ) -> fidl::Result<()> {
5967 encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
5968 self.0.encode(encoder, offset + 0, depth)?;
5972 Ok(())
5973 }
5974 }
5975
5976 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5977 for EventStreamGetNextResponse
5978 {
5979 #[inline(always)]
5980 fn new_empty() -> Self {
5981 Self {
5982 events: fidl::new_empty!(
5983 fidl::encoding::UnboundedVector<Event>,
5984 fidl::encoding::DefaultFuchsiaResourceDialect
5985 ),
5986 }
5987 }
5988
5989 #[inline]
5990 unsafe fn decode(
5991 &mut self,
5992 decoder: &mut fidl::encoding::Decoder<
5993 '_,
5994 fidl::encoding::DefaultFuchsiaResourceDialect,
5995 >,
5996 offset: usize,
5997 _depth: fidl::encoding::Depth,
5998 ) -> fidl::Result<()> {
5999 decoder.debug_check_bounds::<Self>(offset);
6000 fidl::decode!(
6002 fidl::encoding::UnboundedVector<Event>,
6003 fidl::encoding::DefaultFuchsiaResourceDialect,
6004 &mut self.events,
6005 decoder,
6006 offset + 0,
6007 _depth
6008 )?;
6009 Ok(())
6010 }
6011 }
6012
6013 impl fidl::encoding::ResourceTypeMarker for IntrospectorGetMonikerRequest {
6014 type Borrowed<'a> = &'a mut Self;
6015 fn take_or_borrow<'a>(
6016 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6017 ) -> Self::Borrowed<'a> {
6018 value
6019 }
6020 }
6021
6022 unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerRequest {
6023 type Owned = Self;
6024
6025 #[inline(always)]
6026 fn inline_align(_context: fidl::encoding::Context) -> usize {
6027 4
6028 }
6029
6030 #[inline(always)]
6031 fn inline_size(_context: fidl::encoding::Context) -> usize {
6032 4
6033 }
6034 }
6035
6036 unsafe impl
6037 fidl::encoding::Encode<
6038 IntrospectorGetMonikerRequest,
6039 fidl::encoding::DefaultFuchsiaResourceDialect,
6040 > for &mut IntrospectorGetMonikerRequest
6041 {
6042 #[inline]
6043 unsafe fn encode(
6044 self,
6045 encoder: &mut fidl::encoding::Encoder<
6046 '_,
6047 fidl::encoding::DefaultFuchsiaResourceDialect,
6048 >,
6049 offset: usize,
6050 _depth: fidl::encoding::Depth,
6051 ) -> fidl::Result<()> {
6052 encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
6053 fidl::encoding::Encode::<
6055 IntrospectorGetMonikerRequest,
6056 fidl::encoding::DefaultFuchsiaResourceDialect,
6057 >::encode(
6058 (<fidl::encoding::HandleType<
6059 fidl::Event,
6060 { fidl::ObjectType::EVENT.into_raw() },
6061 2147483648,
6062 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6063 &mut self.component_instance,
6064 ),),
6065 encoder,
6066 offset,
6067 _depth,
6068 )
6069 }
6070 }
6071 unsafe impl<
6072 T0: fidl::encoding::Encode<
6073 fidl::encoding::HandleType<
6074 fidl::Event,
6075 { fidl::ObjectType::EVENT.into_raw() },
6076 2147483648,
6077 >,
6078 fidl::encoding::DefaultFuchsiaResourceDialect,
6079 >,
6080 >
6081 fidl::encoding::Encode<
6082 IntrospectorGetMonikerRequest,
6083 fidl::encoding::DefaultFuchsiaResourceDialect,
6084 > for (T0,)
6085 {
6086 #[inline]
6087 unsafe fn encode(
6088 self,
6089 encoder: &mut fidl::encoding::Encoder<
6090 '_,
6091 fidl::encoding::DefaultFuchsiaResourceDialect,
6092 >,
6093 offset: usize,
6094 depth: fidl::encoding::Depth,
6095 ) -> fidl::Result<()> {
6096 encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
6097 self.0.encode(encoder, offset + 0, depth)?;
6101 Ok(())
6102 }
6103 }
6104
6105 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6106 for IntrospectorGetMonikerRequest
6107 {
6108 #[inline(always)]
6109 fn new_empty() -> Self {
6110 Self {
6111 component_instance: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6112 }
6113 }
6114
6115 #[inline]
6116 unsafe fn decode(
6117 &mut self,
6118 decoder: &mut fidl::encoding::Decoder<
6119 '_,
6120 fidl::encoding::DefaultFuchsiaResourceDialect,
6121 >,
6122 offset: usize,
6123 _depth: fidl::encoding::Depth,
6124 ) -> fidl::Result<()> {
6125 decoder.debug_check_bounds::<Self>(offset);
6126 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.component_instance, decoder, offset + 0, _depth)?;
6128 Ok(())
6129 }
6130 }
6131
6132 impl fidl::encoding::ResourceTypeMarker for NamespaceCreateRequest {
6133 type Borrowed<'a> = &'a mut Self;
6134 fn take_or_borrow<'a>(
6135 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6136 ) -> Self::Borrowed<'a> {
6137 value
6138 }
6139 }
6140
6141 unsafe impl fidl::encoding::TypeMarker for NamespaceCreateRequest {
6142 type Owned = Self;
6143
6144 #[inline(always)]
6145 fn inline_align(_context: fidl::encoding::Context) -> usize {
6146 8
6147 }
6148
6149 #[inline(always)]
6150 fn inline_size(_context: fidl::encoding::Context) -> usize {
6151 16
6152 }
6153 }
6154
6155 unsafe impl
6156 fidl::encoding::Encode<
6157 NamespaceCreateRequest,
6158 fidl::encoding::DefaultFuchsiaResourceDialect,
6159 > for &mut NamespaceCreateRequest
6160 {
6161 #[inline]
6162 unsafe fn encode(
6163 self,
6164 encoder: &mut fidl::encoding::Encoder<
6165 '_,
6166 fidl::encoding::DefaultFuchsiaResourceDialect,
6167 >,
6168 offset: usize,
6169 _depth: fidl::encoding::Depth,
6170 ) -> fidl::Result<()> {
6171 encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
6172 fidl::encoding::Encode::<NamespaceCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6174 (
6175 <fidl::encoding::UnboundedVector<NamespaceInputEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
6176 ),
6177 encoder, offset, _depth
6178 )
6179 }
6180 }
6181 unsafe impl<
6182 T0: fidl::encoding::Encode<
6183 fidl::encoding::UnboundedVector<NamespaceInputEntry>,
6184 fidl::encoding::DefaultFuchsiaResourceDialect,
6185 >,
6186 >
6187 fidl::encoding::Encode<
6188 NamespaceCreateRequest,
6189 fidl::encoding::DefaultFuchsiaResourceDialect,
6190 > for (T0,)
6191 {
6192 #[inline]
6193 unsafe fn encode(
6194 self,
6195 encoder: &mut fidl::encoding::Encoder<
6196 '_,
6197 fidl::encoding::DefaultFuchsiaResourceDialect,
6198 >,
6199 offset: usize,
6200 depth: fidl::encoding::Depth,
6201 ) -> fidl::Result<()> {
6202 encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
6203 self.0.encode(encoder, offset + 0, depth)?;
6207 Ok(())
6208 }
6209 }
6210
6211 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6212 for NamespaceCreateRequest
6213 {
6214 #[inline(always)]
6215 fn new_empty() -> Self {
6216 Self {
6217 entries: fidl::new_empty!(
6218 fidl::encoding::UnboundedVector<NamespaceInputEntry>,
6219 fidl::encoding::DefaultFuchsiaResourceDialect
6220 ),
6221 }
6222 }
6223
6224 #[inline]
6225 unsafe fn decode(
6226 &mut self,
6227 decoder: &mut fidl::encoding::Decoder<
6228 '_,
6229 fidl::encoding::DefaultFuchsiaResourceDialect,
6230 >,
6231 offset: usize,
6232 _depth: fidl::encoding::Depth,
6233 ) -> fidl::Result<()> {
6234 decoder.debug_check_bounds::<Self>(offset);
6235 fidl::decode!(
6237 fidl::encoding::UnboundedVector<NamespaceInputEntry>,
6238 fidl::encoding::DefaultFuchsiaResourceDialect,
6239 &mut self.entries,
6240 decoder,
6241 offset + 0,
6242 _depth
6243 )?;
6244 Ok(())
6245 }
6246 }
6247
6248 impl fidl::encoding::ResourceTypeMarker for NamespaceInputEntry {
6249 type Borrowed<'a> = &'a mut Self;
6250 fn take_or_borrow<'a>(
6251 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6252 ) -> Self::Borrowed<'a> {
6253 value
6254 }
6255 }
6256
6257 unsafe impl fidl::encoding::TypeMarker for NamespaceInputEntry {
6258 type Owned = Self;
6259
6260 #[inline(always)]
6261 fn inline_align(_context: fidl::encoding::Context) -> usize {
6262 8
6263 }
6264
6265 #[inline(always)]
6266 fn inline_size(_context: fidl::encoding::Context) -> usize {
6267 24
6268 }
6269 }
6270
6271 unsafe impl
6272 fidl::encoding::Encode<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
6273 for &mut NamespaceInputEntry
6274 {
6275 #[inline]
6276 unsafe fn encode(
6277 self,
6278 encoder: &mut fidl::encoding::Encoder<
6279 '_,
6280 fidl::encoding::DefaultFuchsiaResourceDialect,
6281 >,
6282 offset: usize,
6283 _depth: fidl::encoding::Depth,
6284 ) -> fidl::Result<()> {
6285 encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
6286 fidl::encoding::Encode::<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6288 (
6289 <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
6290 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
6291 ),
6292 encoder, offset, _depth
6293 )
6294 }
6295 }
6296 unsafe impl<
6297 T0: fidl::encoding::Encode<
6298 fidl::encoding::BoundedString<4095>,
6299 fidl::encoding::DefaultFuchsiaResourceDialect,
6300 >,
6301 T1: fidl::encoding::Encode<
6302 fidl::encoding::Endpoint<
6303 fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
6304 >,
6305 fidl::encoding::DefaultFuchsiaResourceDialect,
6306 >,
6307 >
6308 fidl::encoding::Encode<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
6309 for (T0, T1)
6310 {
6311 #[inline]
6312 unsafe fn encode(
6313 self,
6314 encoder: &mut fidl::encoding::Encoder<
6315 '_,
6316 fidl::encoding::DefaultFuchsiaResourceDialect,
6317 >,
6318 offset: usize,
6319 depth: fidl::encoding::Depth,
6320 ) -> fidl::Result<()> {
6321 encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
6322 unsafe {
6325 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
6326 (ptr as *mut u64).write_unaligned(0);
6327 }
6328 self.0.encode(encoder, offset + 0, depth)?;
6330 self.1.encode(encoder, offset + 16, depth)?;
6331 Ok(())
6332 }
6333 }
6334
6335 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6336 for NamespaceInputEntry
6337 {
6338 #[inline(always)]
6339 fn new_empty() -> Self {
6340 Self {
6341 path: fidl::new_empty!(
6342 fidl::encoding::BoundedString<4095>,
6343 fidl::encoding::DefaultFuchsiaResourceDialect
6344 ),
6345 dictionary: fidl::new_empty!(
6346 fidl::encoding::Endpoint<
6347 fidl::endpoints::ClientEnd<
6348 fidl_fuchsia_component_sandbox::DictionaryMarker,
6349 >,
6350 >,
6351 fidl::encoding::DefaultFuchsiaResourceDialect
6352 ),
6353 }
6354 }
6355
6356 #[inline]
6357 unsafe fn decode(
6358 &mut self,
6359 decoder: &mut fidl::encoding::Decoder<
6360 '_,
6361 fidl::encoding::DefaultFuchsiaResourceDialect,
6362 >,
6363 offset: usize,
6364 _depth: fidl::encoding::Depth,
6365 ) -> fidl::Result<()> {
6366 decoder.debug_check_bounds::<Self>(offset);
6367 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
6369 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6370 let mask = 0xffffffff00000000u64;
6371 let maskedval = padval & mask;
6372 if maskedval != 0 {
6373 return Err(fidl::Error::NonZeroPadding {
6374 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
6375 });
6376 }
6377 fidl::decode!(
6378 fidl::encoding::BoundedString<4095>,
6379 fidl::encoding::DefaultFuchsiaResourceDialect,
6380 &mut self.path,
6381 decoder,
6382 offset + 0,
6383 _depth
6384 )?;
6385 fidl::decode!(
6386 fidl::encoding::Endpoint<
6387 fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
6388 >,
6389 fidl::encoding::DefaultFuchsiaResourceDialect,
6390 &mut self.dictionary,
6391 decoder,
6392 offset + 16,
6393 _depth
6394 )?;
6395 Ok(())
6396 }
6397 }
6398
6399 impl fidl::encoding::ResourceTypeMarker for NamespaceCreateResponse {
6400 type Borrowed<'a> = &'a mut Self;
6401 fn take_or_borrow<'a>(
6402 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6403 ) -> Self::Borrowed<'a> {
6404 value
6405 }
6406 }
6407
6408 unsafe impl fidl::encoding::TypeMarker for NamespaceCreateResponse {
6409 type Owned = Self;
6410
6411 #[inline(always)]
6412 fn inline_align(_context: fidl::encoding::Context) -> usize {
6413 8
6414 }
6415
6416 #[inline(always)]
6417 fn inline_size(_context: fidl::encoding::Context) -> usize {
6418 16
6419 }
6420 }
6421
6422 unsafe impl
6423 fidl::encoding::Encode<
6424 NamespaceCreateResponse,
6425 fidl::encoding::DefaultFuchsiaResourceDialect,
6426 > for &mut NamespaceCreateResponse
6427 {
6428 #[inline]
6429 unsafe fn encode(
6430 self,
6431 encoder: &mut fidl::encoding::Encoder<
6432 '_,
6433 fidl::encoding::DefaultFuchsiaResourceDialect,
6434 >,
6435 offset: usize,
6436 _depth: fidl::encoding::Depth,
6437 ) -> fidl::Result<()> {
6438 encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
6439 fidl::encoding::Encode::<NamespaceCreateResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6441 (
6442 <fidl::encoding::UnboundedVector<NamespaceEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
6443 ),
6444 encoder, offset, _depth
6445 )
6446 }
6447 }
6448 unsafe impl<
6449 T0: fidl::encoding::Encode<
6450 fidl::encoding::UnboundedVector<NamespaceEntry>,
6451 fidl::encoding::DefaultFuchsiaResourceDialect,
6452 >,
6453 >
6454 fidl::encoding::Encode<
6455 NamespaceCreateResponse,
6456 fidl::encoding::DefaultFuchsiaResourceDialect,
6457 > for (T0,)
6458 {
6459 #[inline]
6460 unsafe fn encode(
6461 self,
6462 encoder: &mut fidl::encoding::Encoder<
6463 '_,
6464 fidl::encoding::DefaultFuchsiaResourceDialect,
6465 >,
6466 offset: usize,
6467 depth: fidl::encoding::Depth,
6468 ) -> fidl::Result<()> {
6469 encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
6470 self.0.encode(encoder, offset + 0, depth)?;
6474 Ok(())
6475 }
6476 }
6477
6478 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6479 for NamespaceCreateResponse
6480 {
6481 #[inline(always)]
6482 fn new_empty() -> Self {
6483 Self {
6484 entries: fidl::new_empty!(
6485 fidl::encoding::UnboundedVector<NamespaceEntry>,
6486 fidl::encoding::DefaultFuchsiaResourceDialect
6487 ),
6488 }
6489 }
6490
6491 #[inline]
6492 unsafe fn decode(
6493 &mut self,
6494 decoder: &mut fidl::encoding::Decoder<
6495 '_,
6496 fidl::encoding::DefaultFuchsiaResourceDialect,
6497 >,
6498 offset: usize,
6499 _depth: fidl::encoding::Depth,
6500 ) -> fidl::Result<()> {
6501 decoder.debug_check_bounds::<Self>(offset);
6502 fidl::decode!(
6504 fidl::encoding::UnboundedVector<NamespaceEntry>,
6505 fidl::encoding::DefaultFuchsiaResourceDialect,
6506 &mut self.entries,
6507 decoder,
6508 offset + 0,
6509 _depth
6510 )?;
6511 Ok(())
6512 }
6513 }
6514
6515 impl fidl::encoding::ResourceTypeMarker for RealmCreateChildRequest {
6516 type Borrowed<'a> = &'a mut Self;
6517 fn take_or_borrow<'a>(
6518 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6519 ) -> Self::Borrowed<'a> {
6520 value
6521 }
6522 }
6523
6524 unsafe impl fidl::encoding::TypeMarker for RealmCreateChildRequest {
6525 type Owned = Self;
6526
6527 #[inline(always)]
6528 fn inline_align(_context: fidl::encoding::Context) -> usize {
6529 8
6530 }
6531
6532 #[inline(always)]
6533 fn inline_size(_context: fidl::encoding::Context) -> usize {
6534 48
6535 }
6536 }
6537
6538 unsafe impl
6539 fidl::encoding::Encode<
6540 RealmCreateChildRequest,
6541 fidl::encoding::DefaultFuchsiaResourceDialect,
6542 > for &mut RealmCreateChildRequest
6543 {
6544 #[inline]
6545 unsafe fn encode(
6546 self,
6547 encoder: &mut fidl::encoding::Encoder<
6548 '_,
6549 fidl::encoding::DefaultFuchsiaResourceDialect,
6550 >,
6551 offset: usize,
6552 _depth: fidl::encoding::Depth,
6553 ) -> fidl::Result<()> {
6554 encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
6555 fidl::encoding::Encode::<RealmCreateChildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6557 (
6558 <fidl_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
6559 <fidl_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
6560 <CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
6561 ),
6562 encoder, offset, _depth
6563 )
6564 }
6565 }
6566 unsafe impl<
6567 T0: fidl::encoding::Encode<
6568 fidl_fuchsia_component_decl::CollectionRef,
6569 fidl::encoding::DefaultFuchsiaResourceDialect,
6570 >,
6571 T1: fidl::encoding::Encode<
6572 fidl_fuchsia_component_decl::Child,
6573 fidl::encoding::DefaultFuchsiaResourceDialect,
6574 >,
6575 T2: fidl::encoding::Encode<CreateChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
6576 >
6577 fidl::encoding::Encode<
6578 RealmCreateChildRequest,
6579 fidl::encoding::DefaultFuchsiaResourceDialect,
6580 > for (T0, T1, T2)
6581 {
6582 #[inline]
6583 unsafe fn encode(
6584 self,
6585 encoder: &mut fidl::encoding::Encoder<
6586 '_,
6587 fidl::encoding::DefaultFuchsiaResourceDialect,
6588 >,
6589 offset: usize,
6590 depth: fidl::encoding::Depth,
6591 ) -> fidl::Result<()> {
6592 encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
6593 self.0.encode(encoder, offset + 0, depth)?;
6597 self.1.encode(encoder, offset + 16, depth)?;
6598 self.2.encode(encoder, offset + 32, depth)?;
6599 Ok(())
6600 }
6601 }
6602
6603 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6604 for RealmCreateChildRequest
6605 {
6606 #[inline(always)]
6607 fn new_empty() -> Self {
6608 Self {
6609 collection: fidl::new_empty!(
6610 fidl_fuchsia_component_decl::CollectionRef,
6611 fidl::encoding::DefaultFuchsiaResourceDialect
6612 ),
6613 decl: fidl::new_empty!(
6614 fidl_fuchsia_component_decl::Child,
6615 fidl::encoding::DefaultFuchsiaResourceDialect
6616 ),
6617 args: fidl::new_empty!(
6618 CreateChildArgs,
6619 fidl::encoding::DefaultFuchsiaResourceDialect
6620 ),
6621 }
6622 }
6623
6624 #[inline]
6625 unsafe fn decode(
6626 &mut self,
6627 decoder: &mut fidl::encoding::Decoder<
6628 '_,
6629 fidl::encoding::DefaultFuchsiaResourceDialect,
6630 >,
6631 offset: usize,
6632 _depth: fidl::encoding::Depth,
6633 ) -> fidl::Result<()> {
6634 decoder.debug_check_bounds::<Self>(offset);
6635 fidl::decode!(
6637 fidl_fuchsia_component_decl::CollectionRef,
6638 fidl::encoding::DefaultFuchsiaResourceDialect,
6639 &mut self.collection,
6640 decoder,
6641 offset + 0,
6642 _depth
6643 )?;
6644 fidl::decode!(
6645 fidl_fuchsia_component_decl::Child,
6646 fidl::encoding::DefaultFuchsiaResourceDialect,
6647 &mut self.decl,
6648 decoder,
6649 offset + 16,
6650 _depth
6651 )?;
6652 fidl::decode!(
6653 CreateChildArgs,
6654 fidl::encoding::DefaultFuchsiaResourceDialect,
6655 &mut self.args,
6656 decoder,
6657 offset + 32,
6658 _depth
6659 )?;
6660 Ok(())
6661 }
6662 }
6663
6664 impl fidl::encoding::ResourceTypeMarker for RealmListChildrenRequest {
6665 type Borrowed<'a> = &'a mut Self;
6666 fn take_or_borrow<'a>(
6667 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6668 ) -> Self::Borrowed<'a> {
6669 value
6670 }
6671 }
6672
6673 unsafe impl fidl::encoding::TypeMarker for RealmListChildrenRequest {
6674 type Owned = Self;
6675
6676 #[inline(always)]
6677 fn inline_align(_context: fidl::encoding::Context) -> usize {
6678 8
6679 }
6680
6681 #[inline(always)]
6682 fn inline_size(_context: fidl::encoding::Context) -> usize {
6683 24
6684 }
6685 }
6686
6687 unsafe impl
6688 fidl::encoding::Encode<
6689 RealmListChildrenRequest,
6690 fidl::encoding::DefaultFuchsiaResourceDialect,
6691 > for &mut RealmListChildrenRequest
6692 {
6693 #[inline]
6694 unsafe fn encode(
6695 self,
6696 encoder: &mut fidl::encoding::Encoder<
6697 '_,
6698 fidl::encoding::DefaultFuchsiaResourceDialect,
6699 >,
6700 offset: usize,
6701 _depth: fidl::encoding::Depth,
6702 ) -> fidl::Result<()> {
6703 encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
6704 fidl::encoding::Encode::<RealmListChildrenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6706 (
6707 <fidl_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
6708 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iter),
6709 ),
6710 encoder, offset, _depth
6711 )
6712 }
6713 }
6714 unsafe impl<
6715 T0: fidl::encoding::Encode<
6716 fidl_fuchsia_component_decl::CollectionRef,
6717 fidl::encoding::DefaultFuchsiaResourceDialect,
6718 >,
6719 T1: fidl::encoding::Encode<
6720 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
6721 fidl::encoding::DefaultFuchsiaResourceDialect,
6722 >,
6723 >
6724 fidl::encoding::Encode<
6725 RealmListChildrenRequest,
6726 fidl::encoding::DefaultFuchsiaResourceDialect,
6727 > for (T0, T1)
6728 {
6729 #[inline]
6730 unsafe fn encode(
6731 self,
6732 encoder: &mut fidl::encoding::Encoder<
6733 '_,
6734 fidl::encoding::DefaultFuchsiaResourceDialect,
6735 >,
6736 offset: usize,
6737 depth: fidl::encoding::Depth,
6738 ) -> fidl::Result<()> {
6739 encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
6740 unsafe {
6743 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
6744 (ptr as *mut u64).write_unaligned(0);
6745 }
6746 self.0.encode(encoder, offset + 0, depth)?;
6748 self.1.encode(encoder, offset + 16, depth)?;
6749 Ok(())
6750 }
6751 }
6752
6753 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6754 for RealmListChildrenRequest
6755 {
6756 #[inline(always)]
6757 fn new_empty() -> Self {
6758 Self {
6759 collection: fidl::new_empty!(
6760 fidl_fuchsia_component_decl::CollectionRef,
6761 fidl::encoding::DefaultFuchsiaResourceDialect
6762 ),
6763 iter: fidl::new_empty!(
6764 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
6765 fidl::encoding::DefaultFuchsiaResourceDialect
6766 ),
6767 }
6768 }
6769
6770 #[inline]
6771 unsafe fn decode(
6772 &mut self,
6773 decoder: &mut fidl::encoding::Decoder<
6774 '_,
6775 fidl::encoding::DefaultFuchsiaResourceDialect,
6776 >,
6777 offset: usize,
6778 _depth: fidl::encoding::Depth,
6779 ) -> fidl::Result<()> {
6780 decoder.debug_check_bounds::<Self>(offset);
6781 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
6783 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6784 let mask = 0xffffffff00000000u64;
6785 let maskedval = padval & mask;
6786 if maskedval != 0 {
6787 return Err(fidl::Error::NonZeroPadding {
6788 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
6789 });
6790 }
6791 fidl::decode!(
6792 fidl_fuchsia_component_decl::CollectionRef,
6793 fidl::encoding::DefaultFuchsiaResourceDialect,
6794 &mut self.collection,
6795 decoder,
6796 offset + 0,
6797 _depth
6798 )?;
6799 fidl::decode!(
6800 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
6801 fidl::encoding::DefaultFuchsiaResourceDialect,
6802 &mut self.iter,
6803 decoder,
6804 offset + 16,
6805 _depth
6806 )?;
6807 Ok(())
6808 }
6809 }
6810
6811 impl fidl::encoding::ResourceTypeMarker for RealmOpenControllerRequest {
6812 type Borrowed<'a> = &'a mut Self;
6813 fn take_or_borrow<'a>(
6814 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6815 ) -> Self::Borrowed<'a> {
6816 value
6817 }
6818 }
6819
6820 unsafe impl fidl::encoding::TypeMarker for RealmOpenControllerRequest {
6821 type Owned = Self;
6822
6823 #[inline(always)]
6824 fn inline_align(_context: fidl::encoding::Context) -> usize {
6825 8
6826 }
6827
6828 #[inline(always)]
6829 fn inline_size(_context: fidl::encoding::Context) -> usize {
6830 40
6831 }
6832 }
6833
6834 unsafe impl
6835 fidl::encoding::Encode<
6836 RealmOpenControllerRequest,
6837 fidl::encoding::DefaultFuchsiaResourceDialect,
6838 > for &mut RealmOpenControllerRequest
6839 {
6840 #[inline]
6841 unsafe fn encode(
6842 self,
6843 encoder: &mut fidl::encoding::Encoder<
6844 '_,
6845 fidl::encoding::DefaultFuchsiaResourceDialect,
6846 >,
6847 offset: usize,
6848 _depth: fidl::encoding::Depth,
6849 ) -> fidl::Result<()> {
6850 encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
6851 fidl::encoding::Encode::<RealmOpenControllerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6853 (
6854 <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
6855 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
6856 ),
6857 encoder, offset, _depth
6858 )
6859 }
6860 }
6861 unsafe impl<
6862 T0: fidl::encoding::Encode<
6863 fidl_fuchsia_component_decl::ChildRef,
6864 fidl::encoding::DefaultFuchsiaResourceDialect,
6865 >,
6866 T1: fidl::encoding::Encode<
6867 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
6868 fidl::encoding::DefaultFuchsiaResourceDialect,
6869 >,
6870 >
6871 fidl::encoding::Encode<
6872 RealmOpenControllerRequest,
6873 fidl::encoding::DefaultFuchsiaResourceDialect,
6874 > for (T0, T1)
6875 {
6876 #[inline]
6877 unsafe fn encode(
6878 self,
6879 encoder: &mut fidl::encoding::Encoder<
6880 '_,
6881 fidl::encoding::DefaultFuchsiaResourceDialect,
6882 >,
6883 offset: usize,
6884 depth: fidl::encoding::Depth,
6885 ) -> fidl::Result<()> {
6886 encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
6887 unsafe {
6890 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
6891 (ptr as *mut u64).write_unaligned(0);
6892 }
6893 self.0.encode(encoder, offset + 0, depth)?;
6895 self.1.encode(encoder, offset + 32, depth)?;
6896 Ok(())
6897 }
6898 }
6899
6900 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6901 for RealmOpenControllerRequest
6902 {
6903 #[inline(always)]
6904 fn new_empty() -> Self {
6905 Self {
6906 child: fidl::new_empty!(
6907 fidl_fuchsia_component_decl::ChildRef,
6908 fidl::encoding::DefaultFuchsiaResourceDialect
6909 ),
6910 controller: fidl::new_empty!(
6911 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
6912 fidl::encoding::DefaultFuchsiaResourceDialect
6913 ),
6914 }
6915 }
6916
6917 #[inline]
6918 unsafe fn decode(
6919 &mut self,
6920 decoder: &mut fidl::encoding::Decoder<
6921 '_,
6922 fidl::encoding::DefaultFuchsiaResourceDialect,
6923 >,
6924 offset: usize,
6925 _depth: fidl::encoding::Depth,
6926 ) -> fidl::Result<()> {
6927 decoder.debug_check_bounds::<Self>(offset);
6928 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
6930 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6931 let mask = 0xffffffff00000000u64;
6932 let maskedval = padval & mask;
6933 if maskedval != 0 {
6934 return Err(fidl::Error::NonZeroPadding {
6935 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
6936 });
6937 }
6938 fidl::decode!(
6939 fidl_fuchsia_component_decl::ChildRef,
6940 fidl::encoding::DefaultFuchsiaResourceDialect,
6941 &mut self.child,
6942 decoder,
6943 offset + 0,
6944 _depth
6945 )?;
6946 fidl::decode!(
6947 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
6948 fidl::encoding::DefaultFuchsiaResourceDialect,
6949 &mut self.controller,
6950 decoder,
6951 offset + 32,
6952 _depth
6953 )?;
6954 Ok(())
6955 }
6956 }
6957
6958 impl fidl::encoding::ResourceTypeMarker for RealmOpenExposedDirRequest {
6959 type Borrowed<'a> = &'a mut Self;
6960 fn take_or_borrow<'a>(
6961 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6962 ) -> Self::Borrowed<'a> {
6963 value
6964 }
6965 }
6966
6967 unsafe impl fidl::encoding::TypeMarker for RealmOpenExposedDirRequest {
6968 type Owned = Self;
6969
6970 #[inline(always)]
6971 fn inline_align(_context: fidl::encoding::Context) -> usize {
6972 8
6973 }
6974
6975 #[inline(always)]
6976 fn inline_size(_context: fidl::encoding::Context) -> usize {
6977 40
6978 }
6979 }
6980
6981 unsafe impl
6982 fidl::encoding::Encode<
6983 RealmOpenExposedDirRequest,
6984 fidl::encoding::DefaultFuchsiaResourceDialect,
6985 > for &mut RealmOpenExposedDirRequest
6986 {
6987 #[inline]
6988 unsafe fn encode(
6989 self,
6990 encoder: &mut fidl::encoding::Encoder<
6991 '_,
6992 fidl::encoding::DefaultFuchsiaResourceDialect,
6993 >,
6994 offset: usize,
6995 _depth: fidl::encoding::Depth,
6996 ) -> fidl::Result<()> {
6997 encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
6998 fidl::encoding::Encode::<RealmOpenExposedDirRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7000 (
7001 <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
7002 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.exposed_dir),
7003 ),
7004 encoder, offset, _depth
7005 )
7006 }
7007 }
7008 unsafe impl<
7009 T0: fidl::encoding::Encode<
7010 fidl_fuchsia_component_decl::ChildRef,
7011 fidl::encoding::DefaultFuchsiaResourceDialect,
7012 >,
7013 T1: fidl::encoding::Encode<
7014 fidl::encoding::Endpoint<
7015 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7016 >,
7017 fidl::encoding::DefaultFuchsiaResourceDialect,
7018 >,
7019 >
7020 fidl::encoding::Encode<
7021 RealmOpenExposedDirRequest,
7022 fidl::encoding::DefaultFuchsiaResourceDialect,
7023 > for (T0, T1)
7024 {
7025 #[inline]
7026 unsafe fn encode(
7027 self,
7028 encoder: &mut fidl::encoding::Encoder<
7029 '_,
7030 fidl::encoding::DefaultFuchsiaResourceDialect,
7031 >,
7032 offset: usize,
7033 depth: fidl::encoding::Depth,
7034 ) -> fidl::Result<()> {
7035 encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
7036 unsafe {
7039 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7040 (ptr as *mut u64).write_unaligned(0);
7041 }
7042 self.0.encode(encoder, offset + 0, depth)?;
7044 self.1.encode(encoder, offset + 32, depth)?;
7045 Ok(())
7046 }
7047 }
7048
7049 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7050 for RealmOpenExposedDirRequest
7051 {
7052 #[inline(always)]
7053 fn new_empty() -> Self {
7054 Self {
7055 child: fidl::new_empty!(
7056 fidl_fuchsia_component_decl::ChildRef,
7057 fidl::encoding::DefaultFuchsiaResourceDialect
7058 ),
7059 exposed_dir: fidl::new_empty!(
7060 fidl::encoding::Endpoint<
7061 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7062 >,
7063 fidl::encoding::DefaultFuchsiaResourceDialect
7064 ),
7065 }
7066 }
7067
7068 #[inline]
7069 unsafe fn decode(
7070 &mut self,
7071 decoder: &mut fidl::encoding::Decoder<
7072 '_,
7073 fidl::encoding::DefaultFuchsiaResourceDialect,
7074 >,
7075 offset: usize,
7076 _depth: fidl::encoding::Depth,
7077 ) -> fidl::Result<()> {
7078 decoder.debug_check_bounds::<Self>(offset);
7079 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7081 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7082 let mask = 0xffffffff00000000u64;
7083 let maskedval = padval & mask;
7084 if maskedval != 0 {
7085 return Err(fidl::Error::NonZeroPadding {
7086 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
7087 });
7088 }
7089 fidl::decode!(
7090 fidl_fuchsia_component_decl::ChildRef,
7091 fidl::encoding::DefaultFuchsiaResourceDialect,
7092 &mut self.child,
7093 decoder,
7094 offset + 0,
7095 _depth
7096 )?;
7097 fidl::decode!(
7098 fidl::encoding::Endpoint<
7099 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7100 >,
7101 fidl::encoding::DefaultFuchsiaResourceDialect,
7102 &mut self.exposed_dir,
7103 decoder,
7104 offset + 32,
7105 _depth
7106 )?;
7107 Ok(())
7108 }
7109 }
7110
7111 impl CapabilityRequestedPayload {
7112 #[inline(always)]
7113 fn max_ordinal_present(&self) -> u64 {
7114 if let Some(_) = self.capability {
7115 return 2;
7116 }
7117 if let Some(_) = self.name {
7118 return 1;
7119 }
7120 0
7121 }
7122 }
7123
7124 impl fidl::encoding::ResourceTypeMarker for CapabilityRequestedPayload {
7125 type Borrowed<'a> = &'a mut Self;
7126 fn take_or_borrow<'a>(
7127 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7128 ) -> Self::Borrowed<'a> {
7129 value
7130 }
7131 }
7132
7133 unsafe impl fidl::encoding::TypeMarker for CapabilityRequestedPayload {
7134 type Owned = Self;
7135
7136 #[inline(always)]
7137 fn inline_align(_context: fidl::encoding::Context) -> usize {
7138 8
7139 }
7140
7141 #[inline(always)]
7142 fn inline_size(_context: fidl::encoding::Context) -> usize {
7143 16
7144 }
7145 }
7146
7147 unsafe impl
7148 fidl::encoding::Encode<
7149 CapabilityRequestedPayload,
7150 fidl::encoding::DefaultFuchsiaResourceDialect,
7151 > for &mut CapabilityRequestedPayload
7152 {
7153 unsafe fn encode(
7154 self,
7155 encoder: &mut fidl::encoding::Encoder<
7156 '_,
7157 fidl::encoding::DefaultFuchsiaResourceDialect,
7158 >,
7159 offset: usize,
7160 mut depth: fidl::encoding::Depth,
7161 ) -> fidl::Result<()> {
7162 encoder.debug_check_bounds::<CapabilityRequestedPayload>(offset);
7163 let max_ordinal: u64 = self.max_ordinal_present();
7165 encoder.write_num(max_ordinal, offset);
7166 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7167 if max_ordinal == 0 {
7169 return Ok(());
7170 }
7171 depth.increment()?;
7172 let envelope_size = 8;
7173 let bytes_len = max_ordinal as usize * envelope_size;
7174 #[allow(unused_variables)]
7175 let offset = encoder.out_of_line_offset(bytes_len);
7176 let mut _prev_end_offset: usize = 0;
7177 if 1 > max_ordinal {
7178 return Ok(());
7179 }
7180
7181 let cur_offset: usize = (1 - 1) * envelope_size;
7184
7185 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7187
7188 fidl::encoding::encode_in_envelope_optional::<
7193 fidl::encoding::BoundedString<255>,
7194 fidl::encoding::DefaultFuchsiaResourceDialect,
7195 >(
7196 self.name.as_ref().map(
7197 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
7198 ),
7199 encoder,
7200 offset + cur_offset,
7201 depth,
7202 )?;
7203
7204 _prev_end_offset = cur_offset + envelope_size;
7205 if 2 > max_ordinal {
7206 return Ok(());
7207 }
7208
7209 let cur_offset: usize = (2 - 1) * envelope_size;
7212
7213 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7215
7216 fidl::encoding::encode_in_envelope_optional::<
7221 fidl::encoding::HandleType<
7222 fidl::Channel,
7223 { fidl::ObjectType::CHANNEL.into_raw() },
7224 2147483648,
7225 >,
7226 fidl::encoding::DefaultFuchsiaResourceDialect,
7227 >(
7228 self.capability.as_mut().map(
7229 <fidl::encoding::HandleType<
7230 fidl::Channel,
7231 { fidl::ObjectType::CHANNEL.into_raw() },
7232 2147483648,
7233 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7234 ),
7235 encoder,
7236 offset + cur_offset,
7237 depth,
7238 )?;
7239
7240 _prev_end_offset = cur_offset + envelope_size;
7241
7242 Ok(())
7243 }
7244 }
7245
7246 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7247 for CapabilityRequestedPayload
7248 {
7249 #[inline(always)]
7250 fn new_empty() -> Self {
7251 Self::default()
7252 }
7253
7254 unsafe fn decode(
7255 &mut self,
7256 decoder: &mut fidl::encoding::Decoder<
7257 '_,
7258 fidl::encoding::DefaultFuchsiaResourceDialect,
7259 >,
7260 offset: usize,
7261 mut depth: fidl::encoding::Depth,
7262 ) -> fidl::Result<()> {
7263 decoder.debug_check_bounds::<Self>(offset);
7264 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7265 None => return Err(fidl::Error::NotNullable),
7266 Some(len) => len,
7267 };
7268 if len == 0 {
7270 return Ok(());
7271 };
7272 depth.increment()?;
7273 let envelope_size = 8;
7274 let bytes_len = len * envelope_size;
7275 let offset = decoder.out_of_line_offset(bytes_len)?;
7276 let mut _next_ordinal_to_read = 0;
7278 let mut next_offset = offset;
7279 let end_offset = offset + bytes_len;
7280 _next_ordinal_to_read += 1;
7281 if next_offset >= end_offset {
7282 return Ok(());
7283 }
7284
7285 while _next_ordinal_to_read < 1 {
7287 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7288 _next_ordinal_to_read += 1;
7289 next_offset += envelope_size;
7290 }
7291
7292 let next_out_of_line = decoder.next_out_of_line();
7293 let handles_before = decoder.remaining_handles();
7294 if let Some((inlined, num_bytes, num_handles)) =
7295 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7296 {
7297 let member_inline_size =
7298 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
7299 decoder.context,
7300 );
7301 if inlined != (member_inline_size <= 4) {
7302 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7303 }
7304 let inner_offset;
7305 let mut inner_depth = depth.clone();
7306 if inlined {
7307 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7308 inner_offset = next_offset;
7309 } else {
7310 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7311 inner_depth.increment()?;
7312 }
7313 let val_ref = self.name.get_or_insert_with(|| {
7314 fidl::new_empty!(
7315 fidl::encoding::BoundedString<255>,
7316 fidl::encoding::DefaultFuchsiaResourceDialect
7317 )
7318 });
7319 fidl::decode!(
7320 fidl::encoding::BoundedString<255>,
7321 fidl::encoding::DefaultFuchsiaResourceDialect,
7322 val_ref,
7323 decoder,
7324 inner_offset,
7325 inner_depth
7326 )?;
7327 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7328 {
7329 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7330 }
7331 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7332 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7333 }
7334 }
7335
7336 next_offset += envelope_size;
7337 _next_ordinal_to_read += 1;
7338 if next_offset >= end_offset {
7339 return Ok(());
7340 }
7341
7342 while _next_ordinal_to_read < 2 {
7344 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7345 _next_ordinal_to_read += 1;
7346 next_offset += envelope_size;
7347 }
7348
7349 let next_out_of_line = decoder.next_out_of_line();
7350 let handles_before = decoder.remaining_handles();
7351 if let Some((inlined, num_bytes, num_handles)) =
7352 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7353 {
7354 let member_inline_size = <fidl::encoding::HandleType<
7355 fidl::Channel,
7356 { fidl::ObjectType::CHANNEL.into_raw() },
7357 2147483648,
7358 > as fidl::encoding::TypeMarker>::inline_size(
7359 decoder.context
7360 );
7361 if inlined != (member_inline_size <= 4) {
7362 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7363 }
7364 let inner_offset;
7365 let mut inner_depth = depth.clone();
7366 if inlined {
7367 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7368 inner_offset = next_offset;
7369 } else {
7370 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7371 inner_depth.increment()?;
7372 }
7373 let val_ref =
7374 self.capability.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
7375 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7376 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7377 {
7378 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7379 }
7380 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7381 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7382 }
7383 }
7384
7385 next_offset += envelope_size;
7386
7387 while next_offset < end_offset {
7389 _next_ordinal_to_read += 1;
7390 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7391 next_offset += envelope_size;
7392 }
7393
7394 Ok(())
7395 }
7396 }
7397
7398 impl CreateChildArgs {
7399 #[inline(always)]
7400 fn max_ordinal_present(&self) -> u64 {
7401 if let Some(_) = self.dictionary {
7402 return 4;
7403 }
7404 if let Some(_) = self.controller {
7405 return 3;
7406 }
7407 if let Some(_) = self.dynamic_offers {
7408 return 2;
7409 }
7410 if let Some(_) = self.numbered_handles {
7411 return 1;
7412 }
7413 0
7414 }
7415 }
7416
7417 impl fidl::encoding::ResourceTypeMarker for CreateChildArgs {
7418 type Borrowed<'a> = &'a mut Self;
7419 fn take_or_borrow<'a>(
7420 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7421 ) -> Self::Borrowed<'a> {
7422 value
7423 }
7424 }
7425
7426 unsafe impl fidl::encoding::TypeMarker for CreateChildArgs {
7427 type Owned = Self;
7428
7429 #[inline(always)]
7430 fn inline_align(_context: fidl::encoding::Context) -> usize {
7431 8
7432 }
7433
7434 #[inline(always)]
7435 fn inline_size(_context: fidl::encoding::Context) -> usize {
7436 16
7437 }
7438 }
7439
7440 unsafe impl
7441 fidl::encoding::Encode<CreateChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
7442 for &mut CreateChildArgs
7443 {
7444 unsafe fn encode(
7445 self,
7446 encoder: &mut fidl::encoding::Encoder<
7447 '_,
7448 fidl::encoding::DefaultFuchsiaResourceDialect,
7449 >,
7450 offset: usize,
7451 mut depth: fidl::encoding::Depth,
7452 ) -> fidl::Result<()> {
7453 encoder.debug_check_bounds::<CreateChildArgs>(offset);
7454 let max_ordinal: u64 = self.max_ordinal_present();
7456 encoder.write_num(max_ordinal, offset);
7457 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7458 if max_ordinal == 0 {
7460 return Ok(());
7461 }
7462 depth.increment()?;
7463 let envelope_size = 8;
7464 let bytes_len = max_ordinal as usize * envelope_size;
7465 #[allow(unused_variables)]
7466 let offset = encoder.out_of_line_offset(bytes_len);
7467 let mut _prev_end_offset: usize = 0;
7468 if 1 > max_ordinal {
7469 return Ok(());
7470 }
7471
7472 let cur_offset: usize = (1 - 1) * envelope_size;
7475
7476 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7478
7479 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
7484 self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7485 encoder, offset + cur_offset, depth
7486 )?;
7487
7488 _prev_end_offset = cur_offset + envelope_size;
7489 if 2 > max_ordinal {
7490 return Ok(());
7491 }
7492
7493 let cur_offset: usize = (2 - 1) * envelope_size;
7496
7497 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7499
7500 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
7505 self.dynamic_offers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow),
7506 encoder, offset + cur_offset, depth
7507 )?;
7508
7509 _prev_end_offset = cur_offset + envelope_size;
7510 if 3 > max_ordinal {
7511 return Ok(());
7512 }
7513
7514 let cur_offset: usize = (3 - 1) * envelope_size;
7517
7518 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7520
7521 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
7526 self.controller.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7527 encoder, offset + cur_offset, depth
7528 )?;
7529
7530 _prev_end_offset = cur_offset + envelope_size;
7531 if 4 > max_ordinal {
7532 return Ok(());
7533 }
7534
7535 let cur_offset: usize = (4 - 1) * envelope_size;
7538
7539 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7541
7542 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
7547 self.dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7548 encoder, offset + cur_offset, depth
7549 )?;
7550
7551 _prev_end_offset = cur_offset + envelope_size;
7552
7553 Ok(())
7554 }
7555 }
7556
7557 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7558 for CreateChildArgs
7559 {
7560 #[inline(always)]
7561 fn new_empty() -> Self {
7562 Self::default()
7563 }
7564
7565 unsafe fn decode(
7566 &mut self,
7567 decoder: &mut fidl::encoding::Decoder<
7568 '_,
7569 fidl::encoding::DefaultFuchsiaResourceDialect,
7570 >,
7571 offset: usize,
7572 mut depth: fidl::encoding::Depth,
7573 ) -> fidl::Result<()> {
7574 decoder.debug_check_bounds::<Self>(offset);
7575 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7576 None => return Err(fidl::Error::NotNullable),
7577 Some(len) => len,
7578 };
7579 if len == 0 {
7581 return Ok(());
7582 };
7583 depth.increment()?;
7584 let envelope_size = 8;
7585 let bytes_len = len * envelope_size;
7586 let offset = decoder.out_of_line_offset(bytes_len)?;
7587 let mut _next_ordinal_to_read = 0;
7589 let mut next_offset = offset;
7590 let end_offset = offset + bytes_len;
7591 _next_ordinal_to_read += 1;
7592 if next_offset >= end_offset {
7593 return Ok(());
7594 }
7595
7596 while _next_ordinal_to_read < 1 {
7598 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7599 _next_ordinal_to_read += 1;
7600 next_offset += envelope_size;
7601 }
7602
7603 let next_out_of_line = decoder.next_out_of_line();
7604 let handles_before = decoder.remaining_handles();
7605 if let Some((inlined, num_bytes, num_handles)) =
7606 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7607 {
7608 let member_inline_size = <fidl::encoding::Vector<
7609 fidl_fuchsia_process::HandleInfo,
7610 128,
7611 > as fidl::encoding::TypeMarker>::inline_size(
7612 decoder.context
7613 );
7614 if inlined != (member_inline_size <= 4) {
7615 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7616 }
7617 let inner_offset;
7618 let mut inner_depth = depth.clone();
7619 if inlined {
7620 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7621 inner_offset = next_offset;
7622 } else {
7623 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7624 inner_depth.increment()?;
7625 }
7626 let val_ref =
7627 self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
7628 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7629 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7630 {
7631 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7632 }
7633 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7634 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7635 }
7636 }
7637
7638 next_offset += envelope_size;
7639 _next_ordinal_to_read += 1;
7640 if next_offset >= end_offset {
7641 return Ok(());
7642 }
7643
7644 while _next_ordinal_to_read < 2 {
7646 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7647 _next_ordinal_to_read += 1;
7648 next_offset += envelope_size;
7649 }
7650
7651 let next_out_of_line = decoder.next_out_of_line();
7652 let handles_before = decoder.remaining_handles();
7653 if let Some((inlined, num_bytes, num_handles)) =
7654 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7655 {
7656 let member_inline_size = <fidl::encoding::Vector<
7657 fidl_fuchsia_component_decl::Offer,
7658 128,
7659 > as fidl::encoding::TypeMarker>::inline_size(
7660 decoder.context
7661 );
7662 if inlined != (member_inline_size <= 4) {
7663 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7664 }
7665 let inner_offset;
7666 let mut inner_depth = depth.clone();
7667 if inlined {
7668 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7669 inner_offset = next_offset;
7670 } else {
7671 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7672 inner_depth.increment()?;
7673 }
7674 let val_ref =
7675 self.dynamic_offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
7676 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7677 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7678 {
7679 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7680 }
7681 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7682 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7683 }
7684 }
7685
7686 next_offset += envelope_size;
7687 _next_ordinal_to_read += 1;
7688 if next_offset >= end_offset {
7689 return Ok(());
7690 }
7691
7692 while _next_ordinal_to_read < 3 {
7694 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7695 _next_ordinal_to_read += 1;
7696 next_offset += envelope_size;
7697 }
7698
7699 let next_out_of_line = decoder.next_out_of_line();
7700 let handles_before = decoder.remaining_handles();
7701 if let Some((inlined, num_bytes, num_handles)) =
7702 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7703 {
7704 let member_inline_size = <fidl::encoding::Endpoint<
7705 fidl::endpoints::ServerEnd<ControllerMarker>,
7706 > as fidl::encoding::TypeMarker>::inline_size(
7707 decoder.context
7708 );
7709 if inlined != (member_inline_size <= 4) {
7710 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7711 }
7712 let inner_offset;
7713 let mut inner_depth = depth.clone();
7714 if inlined {
7715 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7716 inner_offset = next_offset;
7717 } else {
7718 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7719 inner_depth.increment()?;
7720 }
7721 let val_ref = self.controller.get_or_insert_with(|| {
7722 fidl::new_empty!(
7723 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
7724 fidl::encoding::DefaultFuchsiaResourceDialect
7725 )
7726 });
7727 fidl::decode!(
7728 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
7729 fidl::encoding::DefaultFuchsiaResourceDialect,
7730 val_ref,
7731 decoder,
7732 inner_offset,
7733 inner_depth
7734 )?;
7735 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7736 {
7737 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7738 }
7739 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7740 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7741 }
7742 }
7743
7744 next_offset += envelope_size;
7745 _next_ordinal_to_read += 1;
7746 if next_offset >= end_offset {
7747 return Ok(());
7748 }
7749
7750 while _next_ordinal_to_read < 4 {
7752 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7753 _next_ordinal_to_read += 1;
7754 next_offset += envelope_size;
7755 }
7756
7757 let next_out_of_line = decoder.next_out_of_line();
7758 let handles_before = decoder.remaining_handles();
7759 if let Some((inlined, num_bytes, num_handles)) =
7760 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7761 {
7762 let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7763 if inlined != (member_inline_size <= 4) {
7764 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7765 }
7766 let inner_offset;
7767 let mut inner_depth = depth.clone();
7768 if inlined {
7769 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7770 inner_offset = next_offset;
7771 } else {
7772 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7773 inner_depth.increment()?;
7774 }
7775 let val_ref = self.dictionary.get_or_insert_with(|| {
7776 fidl::new_empty!(
7777 fidl_fuchsia_component_sandbox::DictionaryRef,
7778 fidl::encoding::DefaultFuchsiaResourceDialect
7779 )
7780 });
7781 fidl::decode!(
7782 fidl_fuchsia_component_sandbox::DictionaryRef,
7783 fidl::encoding::DefaultFuchsiaResourceDialect,
7784 val_ref,
7785 decoder,
7786 inner_offset,
7787 inner_depth
7788 )?;
7789 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7790 {
7791 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7792 }
7793 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7794 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7795 }
7796 }
7797
7798 next_offset += envelope_size;
7799
7800 while next_offset < end_offset {
7802 _next_ordinal_to_read += 1;
7803 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7804 next_offset += envelope_size;
7805 }
7806
7807 Ok(())
7808 }
7809 }
7810
7811 impl DebugStartedPayload {
7812 #[inline(always)]
7813 fn max_ordinal_present(&self) -> u64 {
7814 if let Some(_) = self.break_on_start {
7815 return 2;
7816 }
7817 if let Some(_) = self.runtime_dir {
7818 return 1;
7819 }
7820 0
7821 }
7822 }
7823
7824 impl fidl::encoding::ResourceTypeMarker for DebugStartedPayload {
7825 type Borrowed<'a> = &'a mut Self;
7826 fn take_or_borrow<'a>(
7827 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7828 ) -> Self::Borrowed<'a> {
7829 value
7830 }
7831 }
7832
7833 unsafe impl fidl::encoding::TypeMarker for DebugStartedPayload {
7834 type Owned = Self;
7835
7836 #[inline(always)]
7837 fn inline_align(_context: fidl::encoding::Context) -> usize {
7838 8
7839 }
7840
7841 #[inline(always)]
7842 fn inline_size(_context: fidl::encoding::Context) -> usize {
7843 16
7844 }
7845 }
7846
7847 unsafe impl
7848 fidl::encoding::Encode<DebugStartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
7849 for &mut DebugStartedPayload
7850 {
7851 unsafe fn encode(
7852 self,
7853 encoder: &mut fidl::encoding::Encoder<
7854 '_,
7855 fidl::encoding::DefaultFuchsiaResourceDialect,
7856 >,
7857 offset: usize,
7858 mut depth: fidl::encoding::Depth,
7859 ) -> fidl::Result<()> {
7860 encoder.debug_check_bounds::<DebugStartedPayload>(offset);
7861 let max_ordinal: u64 = self.max_ordinal_present();
7863 encoder.write_num(max_ordinal, offset);
7864 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7865 if max_ordinal == 0 {
7867 return Ok(());
7868 }
7869 depth.increment()?;
7870 let envelope_size = 8;
7871 let bytes_len = max_ordinal as usize * envelope_size;
7872 #[allow(unused_variables)]
7873 let offset = encoder.out_of_line_offset(bytes_len);
7874 let mut _prev_end_offset: usize = 0;
7875 if 1 > max_ordinal {
7876 return Ok(());
7877 }
7878
7879 let cur_offset: usize = (1 - 1) * envelope_size;
7882
7883 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7885
7886 fidl::encoding::encode_in_envelope_optional::<
7891 fidl::encoding::Endpoint<
7892 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7893 >,
7894 fidl::encoding::DefaultFuchsiaResourceDialect,
7895 >(
7896 self.runtime_dir.as_mut().map(
7897 <fidl::encoding::Endpoint<
7898 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
7899 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7900 ),
7901 encoder,
7902 offset + cur_offset,
7903 depth,
7904 )?;
7905
7906 _prev_end_offset = cur_offset + envelope_size;
7907 if 2 > max_ordinal {
7908 return Ok(());
7909 }
7910
7911 let cur_offset: usize = (2 - 1) * envelope_size;
7914
7915 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7917
7918 fidl::encoding::encode_in_envelope_optional::<
7923 fidl::encoding::HandleType<
7924 fidl::EventPair,
7925 { fidl::ObjectType::EVENTPAIR.into_raw() },
7926 2147483648,
7927 >,
7928 fidl::encoding::DefaultFuchsiaResourceDialect,
7929 >(
7930 self.break_on_start.as_mut().map(
7931 <fidl::encoding::HandleType<
7932 fidl::EventPair,
7933 { fidl::ObjectType::EVENTPAIR.into_raw() },
7934 2147483648,
7935 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7936 ),
7937 encoder,
7938 offset + cur_offset,
7939 depth,
7940 )?;
7941
7942 _prev_end_offset = cur_offset + envelope_size;
7943
7944 Ok(())
7945 }
7946 }
7947
7948 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7949 for DebugStartedPayload
7950 {
7951 #[inline(always)]
7952 fn new_empty() -> Self {
7953 Self::default()
7954 }
7955
7956 unsafe fn decode(
7957 &mut self,
7958 decoder: &mut fidl::encoding::Decoder<
7959 '_,
7960 fidl::encoding::DefaultFuchsiaResourceDialect,
7961 >,
7962 offset: usize,
7963 mut depth: fidl::encoding::Depth,
7964 ) -> fidl::Result<()> {
7965 decoder.debug_check_bounds::<Self>(offset);
7966 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7967 None => return Err(fidl::Error::NotNullable),
7968 Some(len) => len,
7969 };
7970 if len == 0 {
7972 return Ok(());
7973 };
7974 depth.increment()?;
7975 let envelope_size = 8;
7976 let bytes_len = len * envelope_size;
7977 let offset = decoder.out_of_line_offset(bytes_len)?;
7978 let mut _next_ordinal_to_read = 0;
7980 let mut next_offset = offset;
7981 let end_offset = offset + bytes_len;
7982 _next_ordinal_to_read += 1;
7983 if next_offset >= end_offset {
7984 return Ok(());
7985 }
7986
7987 while _next_ordinal_to_read < 1 {
7989 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7990 _next_ordinal_to_read += 1;
7991 next_offset += envelope_size;
7992 }
7993
7994 let next_out_of_line = decoder.next_out_of_line();
7995 let handles_before = decoder.remaining_handles();
7996 if let Some((inlined, num_bytes, num_handles)) =
7997 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7998 {
7999 let member_inline_size = <fidl::encoding::Endpoint<
8000 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
8001 > as fidl::encoding::TypeMarker>::inline_size(
8002 decoder.context
8003 );
8004 if inlined != (member_inline_size <= 4) {
8005 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8006 }
8007 let inner_offset;
8008 let mut inner_depth = depth.clone();
8009 if inlined {
8010 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8011 inner_offset = next_offset;
8012 } else {
8013 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8014 inner_depth.increment()?;
8015 }
8016 let val_ref = self.runtime_dir.get_or_insert_with(|| {
8017 fidl::new_empty!(
8018 fidl::encoding::Endpoint<
8019 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
8020 >,
8021 fidl::encoding::DefaultFuchsiaResourceDialect
8022 )
8023 });
8024 fidl::decode!(
8025 fidl::encoding::Endpoint<
8026 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
8027 >,
8028 fidl::encoding::DefaultFuchsiaResourceDialect,
8029 val_ref,
8030 decoder,
8031 inner_offset,
8032 inner_depth
8033 )?;
8034 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8035 {
8036 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8037 }
8038 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8039 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8040 }
8041 }
8042
8043 next_offset += envelope_size;
8044 _next_ordinal_to_read += 1;
8045 if next_offset >= end_offset {
8046 return Ok(());
8047 }
8048
8049 while _next_ordinal_to_read < 2 {
8051 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8052 _next_ordinal_to_read += 1;
8053 next_offset += envelope_size;
8054 }
8055
8056 let next_out_of_line = decoder.next_out_of_line();
8057 let handles_before = decoder.remaining_handles();
8058 if let Some((inlined, num_bytes, num_handles)) =
8059 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8060 {
8061 let member_inline_size = <fidl::encoding::HandleType<
8062 fidl::EventPair,
8063 { fidl::ObjectType::EVENTPAIR.into_raw() },
8064 2147483648,
8065 > as fidl::encoding::TypeMarker>::inline_size(
8066 decoder.context
8067 );
8068 if inlined != (member_inline_size <= 4) {
8069 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8070 }
8071 let inner_offset;
8072 let mut inner_depth = depth.clone();
8073 if inlined {
8074 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8075 inner_offset = next_offset;
8076 } else {
8077 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8078 inner_depth.increment()?;
8079 }
8080 let val_ref =
8081 self.break_on_start.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
8082 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
8083 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8084 {
8085 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8086 }
8087 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8088 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8089 }
8090 }
8091
8092 next_offset += envelope_size;
8093
8094 while next_offset < end_offset {
8096 _next_ordinal_to_read += 1;
8097 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8098 next_offset += envelope_size;
8099 }
8100
8101 Ok(())
8102 }
8103 }
8104
8105 impl DirectoryReadyPayload {
8106 #[inline(always)]
8107 fn max_ordinal_present(&self) -> u64 {
8108 if let Some(_) = self.node {
8109 return 2;
8110 }
8111 if let Some(_) = self.name {
8112 return 1;
8113 }
8114 0
8115 }
8116 }
8117
8118 impl fidl::encoding::ResourceTypeMarker for DirectoryReadyPayload {
8119 type Borrowed<'a> = &'a mut Self;
8120 fn take_or_borrow<'a>(
8121 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8122 ) -> Self::Borrowed<'a> {
8123 value
8124 }
8125 }
8126
8127 unsafe impl fidl::encoding::TypeMarker for DirectoryReadyPayload {
8128 type Owned = Self;
8129
8130 #[inline(always)]
8131 fn inline_align(_context: fidl::encoding::Context) -> usize {
8132 8
8133 }
8134
8135 #[inline(always)]
8136 fn inline_size(_context: fidl::encoding::Context) -> usize {
8137 16
8138 }
8139 }
8140
8141 unsafe impl
8142 fidl::encoding::Encode<DirectoryReadyPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
8143 for &mut DirectoryReadyPayload
8144 {
8145 unsafe fn encode(
8146 self,
8147 encoder: &mut fidl::encoding::Encoder<
8148 '_,
8149 fidl::encoding::DefaultFuchsiaResourceDialect,
8150 >,
8151 offset: usize,
8152 mut depth: fidl::encoding::Depth,
8153 ) -> fidl::Result<()> {
8154 encoder.debug_check_bounds::<DirectoryReadyPayload>(offset);
8155 let max_ordinal: u64 = self.max_ordinal_present();
8157 encoder.write_num(max_ordinal, offset);
8158 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8159 if max_ordinal == 0 {
8161 return Ok(());
8162 }
8163 depth.increment()?;
8164 let envelope_size = 8;
8165 let bytes_len = max_ordinal as usize * envelope_size;
8166 #[allow(unused_variables)]
8167 let offset = encoder.out_of_line_offset(bytes_len);
8168 let mut _prev_end_offset: usize = 0;
8169 if 1 > max_ordinal {
8170 return Ok(());
8171 }
8172
8173 let cur_offset: usize = (1 - 1) * envelope_size;
8176
8177 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8179
8180 fidl::encoding::encode_in_envelope_optional::<
8185 fidl::encoding::BoundedString<255>,
8186 fidl::encoding::DefaultFuchsiaResourceDialect,
8187 >(
8188 self.name.as_ref().map(
8189 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
8190 ),
8191 encoder,
8192 offset + cur_offset,
8193 depth,
8194 )?;
8195
8196 _prev_end_offset = cur_offset + envelope_size;
8197 if 2 > max_ordinal {
8198 return Ok(());
8199 }
8200
8201 let cur_offset: usize = (2 - 1) * envelope_size;
8204
8205 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8207
8208 fidl::encoding::encode_in_envelope_optional::<
8213 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::NodeMarker>>,
8214 fidl::encoding::DefaultFuchsiaResourceDialect,
8215 >(
8216 self.node.as_mut().map(
8217 <fidl::encoding::Endpoint<
8218 fidl::endpoints::ClientEnd<fidl_fuchsia_io::NodeMarker>,
8219 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8220 ),
8221 encoder,
8222 offset + cur_offset,
8223 depth,
8224 )?;
8225
8226 _prev_end_offset = cur_offset + envelope_size;
8227
8228 Ok(())
8229 }
8230 }
8231
8232 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8233 for DirectoryReadyPayload
8234 {
8235 #[inline(always)]
8236 fn new_empty() -> Self {
8237 Self::default()
8238 }
8239
8240 unsafe fn decode(
8241 &mut self,
8242 decoder: &mut fidl::encoding::Decoder<
8243 '_,
8244 fidl::encoding::DefaultFuchsiaResourceDialect,
8245 >,
8246 offset: usize,
8247 mut depth: fidl::encoding::Depth,
8248 ) -> fidl::Result<()> {
8249 decoder.debug_check_bounds::<Self>(offset);
8250 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8251 None => return Err(fidl::Error::NotNullable),
8252 Some(len) => len,
8253 };
8254 if len == 0 {
8256 return Ok(());
8257 };
8258 depth.increment()?;
8259 let envelope_size = 8;
8260 let bytes_len = len * envelope_size;
8261 let offset = decoder.out_of_line_offset(bytes_len)?;
8262 let mut _next_ordinal_to_read = 0;
8264 let mut next_offset = offset;
8265 let end_offset = offset + bytes_len;
8266 _next_ordinal_to_read += 1;
8267 if next_offset >= end_offset {
8268 return Ok(());
8269 }
8270
8271 while _next_ordinal_to_read < 1 {
8273 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8274 _next_ordinal_to_read += 1;
8275 next_offset += envelope_size;
8276 }
8277
8278 let next_out_of_line = decoder.next_out_of_line();
8279 let handles_before = decoder.remaining_handles();
8280 if let Some((inlined, num_bytes, num_handles)) =
8281 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8282 {
8283 let member_inline_size =
8284 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
8285 decoder.context,
8286 );
8287 if inlined != (member_inline_size <= 4) {
8288 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8289 }
8290 let inner_offset;
8291 let mut inner_depth = depth.clone();
8292 if inlined {
8293 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8294 inner_offset = next_offset;
8295 } else {
8296 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8297 inner_depth.increment()?;
8298 }
8299 let val_ref = self.name.get_or_insert_with(|| {
8300 fidl::new_empty!(
8301 fidl::encoding::BoundedString<255>,
8302 fidl::encoding::DefaultFuchsiaResourceDialect
8303 )
8304 });
8305 fidl::decode!(
8306 fidl::encoding::BoundedString<255>,
8307 fidl::encoding::DefaultFuchsiaResourceDialect,
8308 val_ref,
8309 decoder,
8310 inner_offset,
8311 inner_depth
8312 )?;
8313 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8314 {
8315 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8316 }
8317 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8318 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8319 }
8320 }
8321
8322 next_offset += envelope_size;
8323 _next_ordinal_to_read += 1;
8324 if next_offset >= end_offset {
8325 return Ok(());
8326 }
8327
8328 while _next_ordinal_to_read < 2 {
8330 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8331 _next_ordinal_to_read += 1;
8332 next_offset += envelope_size;
8333 }
8334
8335 let next_out_of_line = decoder.next_out_of_line();
8336 let handles_before = decoder.remaining_handles();
8337 if let Some((inlined, num_bytes, num_handles)) =
8338 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8339 {
8340 let member_inline_size = <fidl::encoding::Endpoint<
8341 fidl::endpoints::ClientEnd<fidl_fuchsia_io::NodeMarker>,
8342 > as fidl::encoding::TypeMarker>::inline_size(
8343 decoder.context
8344 );
8345 if inlined != (member_inline_size <= 4) {
8346 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8347 }
8348 let inner_offset;
8349 let mut inner_depth = depth.clone();
8350 if inlined {
8351 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8352 inner_offset = next_offset;
8353 } else {
8354 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8355 inner_depth.increment()?;
8356 }
8357 let val_ref = self.node.get_or_insert_with(|| {
8358 fidl::new_empty!(
8359 fidl::encoding::Endpoint<
8360 fidl::endpoints::ClientEnd<fidl_fuchsia_io::NodeMarker>,
8361 >,
8362 fidl::encoding::DefaultFuchsiaResourceDialect
8363 )
8364 });
8365 fidl::decode!(
8366 fidl::encoding::Endpoint<
8367 fidl::endpoints::ClientEnd<fidl_fuchsia_io::NodeMarker>,
8368 >,
8369 fidl::encoding::DefaultFuchsiaResourceDialect,
8370 val_ref,
8371 decoder,
8372 inner_offset,
8373 inner_depth
8374 )?;
8375 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8376 {
8377 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8378 }
8379 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8380 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8381 }
8382 }
8383
8384 next_offset += envelope_size;
8385
8386 while next_offset < end_offset {
8388 _next_ordinal_to_read += 1;
8389 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8390 next_offset += envelope_size;
8391 }
8392
8393 Ok(())
8394 }
8395 }
8396
8397 impl Event {
8398 #[inline(always)]
8399 fn max_ordinal_present(&self) -> u64 {
8400 if let Some(_) = self.payload {
8401 return 2;
8402 }
8403 if let Some(_) = self.header {
8404 return 1;
8405 }
8406 0
8407 }
8408 }
8409
8410 impl fidl::encoding::ResourceTypeMarker for Event {
8411 type Borrowed<'a> = &'a mut Self;
8412 fn take_or_borrow<'a>(
8413 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8414 ) -> Self::Borrowed<'a> {
8415 value
8416 }
8417 }
8418
8419 unsafe impl fidl::encoding::TypeMarker for Event {
8420 type Owned = Self;
8421
8422 #[inline(always)]
8423 fn inline_align(_context: fidl::encoding::Context) -> usize {
8424 8
8425 }
8426
8427 #[inline(always)]
8428 fn inline_size(_context: fidl::encoding::Context) -> usize {
8429 16
8430 }
8431 }
8432
8433 unsafe impl fidl::encoding::Encode<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
8434 for &mut Event
8435 {
8436 unsafe fn encode(
8437 self,
8438 encoder: &mut fidl::encoding::Encoder<
8439 '_,
8440 fidl::encoding::DefaultFuchsiaResourceDialect,
8441 >,
8442 offset: usize,
8443 mut depth: fidl::encoding::Depth,
8444 ) -> fidl::Result<()> {
8445 encoder.debug_check_bounds::<Event>(offset);
8446 let max_ordinal: u64 = self.max_ordinal_present();
8448 encoder.write_num(max_ordinal, offset);
8449 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8450 if max_ordinal == 0 {
8452 return Ok(());
8453 }
8454 depth.increment()?;
8455 let envelope_size = 8;
8456 let bytes_len = max_ordinal as usize * envelope_size;
8457 #[allow(unused_variables)]
8458 let offset = encoder.out_of_line_offset(bytes_len);
8459 let mut _prev_end_offset: usize = 0;
8460 if 1 > max_ordinal {
8461 return Ok(());
8462 }
8463
8464 let cur_offset: usize = (1 - 1) * envelope_size;
8467
8468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8470
8471 fidl::encoding::encode_in_envelope_optional::<
8476 EventHeader,
8477 fidl::encoding::DefaultFuchsiaResourceDialect,
8478 >(
8479 self.header.as_ref().map(<EventHeader as fidl::encoding::ValueTypeMarker>::borrow),
8480 encoder,
8481 offset + cur_offset,
8482 depth,
8483 )?;
8484
8485 _prev_end_offset = cur_offset + envelope_size;
8486 if 2 > max_ordinal {
8487 return Ok(());
8488 }
8489
8490 let cur_offset: usize = (2 - 1) * envelope_size;
8493
8494 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8496
8497 fidl::encoding::encode_in_envelope_optional::<
8502 EventPayload,
8503 fidl::encoding::DefaultFuchsiaResourceDialect,
8504 >(
8505 self.payload
8506 .as_mut()
8507 .map(<EventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
8508 encoder,
8509 offset + cur_offset,
8510 depth,
8511 )?;
8512
8513 _prev_end_offset = cur_offset + envelope_size;
8514
8515 Ok(())
8516 }
8517 }
8518
8519 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
8520 #[inline(always)]
8521 fn new_empty() -> Self {
8522 Self::default()
8523 }
8524
8525 unsafe fn decode(
8526 &mut self,
8527 decoder: &mut fidl::encoding::Decoder<
8528 '_,
8529 fidl::encoding::DefaultFuchsiaResourceDialect,
8530 >,
8531 offset: usize,
8532 mut depth: fidl::encoding::Depth,
8533 ) -> fidl::Result<()> {
8534 decoder.debug_check_bounds::<Self>(offset);
8535 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8536 None => return Err(fidl::Error::NotNullable),
8537 Some(len) => len,
8538 };
8539 if len == 0 {
8541 return Ok(());
8542 };
8543 depth.increment()?;
8544 let envelope_size = 8;
8545 let bytes_len = len * envelope_size;
8546 let offset = decoder.out_of_line_offset(bytes_len)?;
8547 let mut _next_ordinal_to_read = 0;
8549 let mut next_offset = offset;
8550 let end_offset = offset + bytes_len;
8551 _next_ordinal_to_read += 1;
8552 if next_offset >= end_offset {
8553 return Ok(());
8554 }
8555
8556 while _next_ordinal_to_read < 1 {
8558 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8559 _next_ordinal_to_read += 1;
8560 next_offset += envelope_size;
8561 }
8562
8563 let next_out_of_line = decoder.next_out_of_line();
8564 let handles_before = decoder.remaining_handles();
8565 if let Some((inlined, num_bytes, num_handles)) =
8566 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8567 {
8568 let member_inline_size =
8569 <EventHeader as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8570 if inlined != (member_inline_size <= 4) {
8571 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8572 }
8573 let inner_offset;
8574 let mut inner_depth = depth.clone();
8575 if inlined {
8576 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8577 inner_offset = next_offset;
8578 } else {
8579 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8580 inner_depth.increment()?;
8581 }
8582 let val_ref = self.header.get_or_insert_with(|| {
8583 fidl::new_empty!(EventHeader, fidl::encoding::DefaultFuchsiaResourceDialect)
8584 });
8585 fidl::decode!(
8586 EventHeader,
8587 fidl::encoding::DefaultFuchsiaResourceDialect,
8588 val_ref,
8589 decoder,
8590 inner_offset,
8591 inner_depth
8592 )?;
8593 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8594 {
8595 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8596 }
8597 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8598 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8599 }
8600 }
8601
8602 next_offset += envelope_size;
8603 _next_ordinal_to_read += 1;
8604 if next_offset >= end_offset {
8605 return Ok(());
8606 }
8607
8608 while _next_ordinal_to_read < 2 {
8610 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8611 _next_ordinal_to_read += 1;
8612 next_offset += envelope_size;
8613 }
8614
8615 let next_out_of_line = decoder.next_out_of_line();
8616 let handles_before = decoder.remaining_handles();
8617 if let Some((inlined, num_bytes, num_handles)) =
8618 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8619 {
8620 let member_inline_size =
8621 <EventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8622 if inlined != (member_inline_size <= 4) {
8623 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8624 }
8625 let inner_offset;
8626 let mut inner_depth = depth.clone();
8627 if inlined {
8628 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8629 inner_offset = next_offset;
8630 } else {
8631 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8632 inner_depth.increment()?;
8633 }
8634 let val_ref = self.payload.get_or_insert_with(|| {
8635 fidl::new_empty!(EventPayload, fidl::encoding::DefaultFuchsiaResourceDialect)
8636 });
8637 fidl::decode!(
8638 EventPayload,
8639 fidl::encoding::DefaultFuchsiaResourceDialect,
8640 val_ref,
8641 decoder,
8642 inner_offset,
8643 inner_depth
8644 )?;
8645 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8646 {
8647 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8648 }
8649 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8650 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8651 }
8652 }
8653
8654 next_offset += envelope_size;
8655
8656 while next_offset < end_offset {
8658 _next_ordinal_to_read += 1;
8659 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8660 next_offset += envelope_size;
8661 }
8662
8663 Ok(())
8664 }
8665 }
8666
8667 impl NamespaceEntry {
8668 #[inline(always)]
8669 fn max_ordinal_present(&self) -> u64 {
8670 if let Some(_) = self.directory {
8671 return 2;
8672 }
8673 if let Some(_) = self.path {
8674 return 1;
8675 }
8676 0
8677 }
8678 }
8679
8680 impl fidl::encoding::ResourceTypeMarker for NamespaceEntry {
8681 type Borrowed<'a> = &'a mut Self;
8682 fn take_or_borrow<'a>(
8683 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8684 ) -> Self::Borrowed<'a> {
8685 value
8686 }
8687 }
8688
8689 unsafe impl fidl::encoding::TypeMarker for NamespaceEntry {
8690 type Owned = Self;
8691
8692 #[inline(always)]
8693 fn inline_align(_context: fidl::encoding::Context) -> usize {
8694 8
8695 }
8696
8697 #[inline(always)]
8698 fn inline_size(_context: fidl::encoding::Context) -> usize {
8699 16
8700 }
8701 }
8702
8703 unsafe impl
8704 fidl::encoding::Encode<NamespaceEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
8705 for &mut NamespaceEntry
8706 {
8707 unsafe fn encode(
8708 self,
8709 encoder: &mut fidl::encoding::Encoder<
8710 '_,
8711 fidl::encoding::DefaultFuchsiaResourceDialect,
8712 >,
8713 offset: usize,
8714 mut depth: fidl::encoding::Depth,
8715 ) -> fidl::Result<()> {
8716 encoder.debug_check_bounds::<NamespaceEntry>(offset);
8717 let max_ordinal: u64 = self.max_ordinal_present();
8719 encoder.write_num(max_ordinal, offset);
8720 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8721 if max_ordinal == 0 {
8723 return Ok(());
8724 }
8725 depth.increment()?;
8726 let envelope_size = 8;
8727 let bytes_len = max_ordinal as usize * envelope_size;
8728 #[allow(unused_variables)]
8729 let offset = encoder.out_of_line_offset(bytes_len);
8730 let mut _prev_end_offset: usize = 0;
8731 if 1 > max_ordinal {
8732 return Ok(());
8733 }
8734
8735 let cur_offset: usize = (1 - 1) * envelope_size;
8738
8739 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8741
8742 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
8747 self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
8748 encoder, offset + cur_offset, depth
8749 )?;
8750
8751 _prev_end_offset = cur_offset + envelope_size;
8752 if 2 > max_ordinal {
8753 return Ok(());
8754 }
8755
8756 let cur_offset: usize = (2 - 1) * envelope_size;
8759
8760 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8762
8763 fidl::encoding::encode_in_envelope_optional::<
8768 fidl::encoding::Endpoint<
8769 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
8770 >,
8771 fidl::encoding::DefaultFuchsiaResourceDialect,
8772 >(
8773 self.directory.as_mut().map(
8774 <fidl::encoding::Endpoint<
8775 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
8776 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8777 ),
8778 encoder,
8779 offset + cur_offset,
8780 depth,
8781 )?;
8782
8783 _prev_end_offset = cur_offset + envelope_size;
8784
8785 Ok(())
8786 }
8787 }
8788
8789 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8790 for NamespaceEntry
8791 {
8792 #[inline(always)]
8793 fn new_empty() -> Self {
8794 Self::default()
8795 }
8796
8797 unsafe fn decode(
8798 &mut self,
8799 decoder: &mut fidl::encoding::Decoder<
8800 '_,
8801 fidl::encoding::DefaultFuchsiaResourceDialect,
8802 >,
8803 offset: usize,
8804 mut depth: fidl::encoding::Depth,
8805 ) -> fidl::Result<()> {
8806 decoder.debug_check_bounds::<Self>(offset);
8807 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8808 None => return Err(fidl::Error::NotNullable),
8809 Some(len) => len,
8810 };
8811 if len == 0 {
8813 return Ok(());
8814 };
8815 depth.increment()?;
8816 let envelope_size = 8;
8817 let bytes_len = len * envelope_size;
8818 let offset = decoder.out_of_line_offset(bytes_len)?;
8819 let mut _next_ordinal_to_read = 0;
8821 let mut next_offset = offset;
8822 let end_offset = offset + bytes_len;
8823 _next_ordinal_to_read += 1;
8824 if next_offset >= end_offset {
8825 return Ok(());
8826 }
8827
8828 while _next_ordinal_to_read < 1 {
8830 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8831 _next_ordinal_to_read += 1;
8832 next_offset += envelope_size;
8833 }
8834
8835 let next_out_of_line = decoder.next_out_of_line();
8836 let handles_before = decoder.remaining_handles();
8837 if let Some((inlined, num_bytes, num_handles)) =
8838 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8839 {
8840 let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8841 if inlined != (member_inline_size <= 4) {
8842 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8843 }
8844 let inner_offset;
8845 let mut inner_depth = depth.clone();
8846 if inlined {
8847 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8848 inner_offset = next_offset;
8849 } else {
8850 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8851 inner_depth.increment()?;
8852 }
8853 let val_ref = self.path.get_or_insert_with(|| {
8854 fidl::new_empty!(
8855 fidl::encoding::BoundedString<4095>,
8856 fidl::encoding::DefaultFuchsiaResourceDialect
8857 )
8858 });
8859 fidl::decode!(
8860 fidl::encoding::BoundedString<4095>,
8861 fidl::encoding::DefaultFuchsiaResourceDialect,
8862 val_ref,
8863 decoder,
8864 inner_offset,
8865 inner_depth
8866 )?;
8867 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8868 {
8869 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8870 }
8871 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8872 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8873 }
8874 }
8875
8876 next_offset += envelope_size;
8877 _next_ordinal_to_read += 1;
8878 if next_offset >= end_offset {
8879 return Ok(());
8880 }
8881
8882 while _next_ordinal_to_read < 2 {
8884 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8885 _next_ordinal_to_read += 1;
8886 next_offset += envelope_size;
8887 }
8888
8889 let next_out_of_line = decoder.next_out_of_line();
8890 let handles_before = decoder.remaining_handles();
8891 if let Some((inlined, num_bytes, num_handles)) =
8892 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8893 {
8894 let member_inline_size = <fidl::encoding::Endpoint<
8895 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
8896 > as fidl::encoding::TypeMarker>::inline_size(
8897 decoder.context
8898 );
8899 if inlined != (member_inline_size <= 4) {
8900 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8901 }
8902 let inner_offset;
8903 let mut inner_depth = depth.clone();
8904 if inlined {
8905 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8906 inner_offset = next_offset;
8907 } else {
8908 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8909 inner_depth.increment()?;
8910 }
8911 let val_ref = self.directory.get_or_insert_with(|| {
8912 fidl::new_empty!(
8913 fidl::encoding::Endpoint<
8914 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
8915 >,
8916 fidl::encoding::DefaultFuchsiaResourceDialect
8917 )
8918 });
8919 fidl::decode!(
8920 fidl::encoding::Endpoint<
8921 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
8922 >,
8923 fidl::encoding::DefaultFuchsiaResourceDialect,
8924 val_ref,
8925 decoder,
8926 inner_offset,
8927 inner_depth
8928 )?;
8929 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8930 {
8931 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8932 }
8933 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8934 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8935 }
8936 }
8937
8938 next_offset += envelope_size;
8939
8940 while next_offset < end_offset {
8942 _next_ordinal_to_read += 1;
8943 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8944 next_offset += envelope_size;
8945 }
8946
8947 Ok(())
8948 }
8949 }
8950
8951 impl StartChildArgs {
8952 #[inline(always)]
8953 fn max_ordinal_present(&self) -> u64 {
8954 if let Some(_) = self.dictionary {
8955 return 3;
8956 }
8957 if let Some(_) = self.namespace_entries {
8958 return 2;
8959 }
8960 if let Some(_) = self.numbered_handles {
8961 return 1;
8962 }
8963 0
8964 }
8965 }
8966
8967 impl fidl::encoding::ResourceTypeMarker for StartChildArgs {
8968 type Borrowed<'a> = &'a mut Self;
8969 fn take_or_borrow<'a>(
8970 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8971 ) -> Self::Borrowed<'a> {
8972 value
8973 }
8974 }
8975
8976 unsafe impl fidl::encoding::TypeMarker for StartChildArgs {
8977 type Owned = Self;
8978
8979 #[inline(always)]
8980 fn inline_align(_context: fidl::encoding::Context) -> usize {
8981 8
8982 }
8983
8984 #[inline(always)]
8985 fn inline_size(_context: fidl::encoding::Context) -> usize {
8986 16
8987 }
8988 }
8989
8990 unsafe impl
8991 fidl::encoding::Encode<StartChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
8992 for &mut StartChildArgs
8993 {
8994 unsafe fn encode(
8995 self,
8996 encoder: &mut fidl::encoding::Encoder<
8997 '_,
8998 fidl::encoding::DefaultFuchsiaResourceDialect,
8999 >,
9000 offset: usize,
9001 mut depth: fidl::encoding::Depth,
9002 ) -> fidl::Result<()> {
9003 encoder.debug_check_bounds::<StartChildArgs>(offset);
9004 let max_ordinal: u64 = self.max_ordinal_present();
9006 encoder.write_num(max_ordinal, offset);
9007 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9008 if max_ordinal == 0 {
9010 return Ok(());
9011 }
9012 depth.increment()?;
9013 let envelope_size = 8;
9014 let bytes_len = max_ordinal as usize * envelope_size;
9015 #[allow(unused_variables)]
9016 let offset = encoder.out_of_line_offset(bytes_len);
9017 let mut _prev_end_offset: usize = 0;
9018 if 1 > max_ordinal {
9019 return Ok(());
9020 }
9021
9022 let cur_offset: usize = (1 - 1) * envelope_size;
9025
9026 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9028
9029 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9034 self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9035 encoder, offset + cur_offset, depth
9036 )?;
9037
9038 _prev_end_offset = cur_offset + envelope_size;
9039 if 2 > max_ordinal {
9040 return Ok(());
9041 }
9042
9043 let cur_offset: usize = (2 - 1) * envelope_size;
9046
9047 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9049
9050 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9055 self.namespace_entries.as_mut().map(<fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9056 encoder, offset + cur_offset, depth
9057 )?;
9058
9059 _prev_end_offset = cur_offset + envelope_size;
9060 if 3 > max_ordinal {
9061 return Ok(());
9062 }
9063
9064 let cur_offset: usize = (3 - 1) * envelope_size;
9067
9068 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9070
9071 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
9076 self.dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9077 encoder, offset + cur_offset, depth
9078 )?;
9079
9080 _prev_end_offset = cur_offset + envelope_size;
9081
9082 Ok(())
9083 }
9084 }
9085
9086 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9087 for StartChildArgs
9088 {
9089 #[inline(always)]
9090 fn new_empty() -> Self {
9091 Self::default()
9092 }
9093
9094 unsafe fn decode(
9095 &mut self,
9096 decoder: &mut fidl::encoding::Decoder<
9097 '_,
9098 fidl::encoding::DefaultFuchsiaResourceDialect,
9099 >,
9100 offset: usize,
9101 mut depth: fidl::encoding::Depth,
9102 ) -> fidl::Result<()> {
9103 decoder.debug_check_bounds::<Self>(offset);
9104 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9105 None => return Err(fidl::Error::NotNullable),
9106 Some(len) => len,
9107 };
9108 if len == 0 {
9110 return Ok(());
9111 };
9112 depth.increment()?;
9113 let envelope_size = 8;
9114 let bytes_len = len * envelope_size;
9115 let offset = decoder.out_of_line_offset(bytes_len)?;
9116 let mut _next_ordinal_to_read = 0;
9118 let mut next_offset = offset;
9119 let end_offset = offset + bytes_len;
9120 _next_ordinal_to_read += 1;
9121 if next_offset >= end_offset {
9122 return Ok(());
9123 }
9124
9125 while _next_ordinal_to_read < 1 {
9127 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9128 _next_ordinal_to_read += 1;
9129 next_offset += envelope_size;
9130 }
9131
9132 let next_out_of_line = decoder.next_out_of_line();
9133 let handles_before = decoder.remaining_handles();
9134 if let Some((inlined, num_bytes, num_handles)) =
9135 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9136 {
9137 let member_inline_size = <fidl::encoding::Vector<
9138 fidl_fuchsia_process::HandleInfo,
9139 128,
9140 > as fidl::encoding::TypeMarker>::inline_size(
9141 decoder.context
9142 );
9143 if inlined != (member_inline_size <= 4) {
9144 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9145 }
9146 let inner_offset;
9147 let mut inner_depth = depth.clone();
9148 if inlined {
9149 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9150 inner_offset = next_offset;
9151 } else {
9152 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9153 inner_depth.increment()?;
9154 }
9155 let val_ref =
9156 self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
9157 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9158 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9159 {
9160 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9161 }
9162 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9163 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9164 }
9165 }
9166
9167 next_offset += envelope_size;
9168 _next_ordinal_to_read += 1;
9169 if next_offset >= end_offset {
9170 return Ok(());
9171 }
9172
9173 while _next_ordinal_to_read < 2 {
9175 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9176 _next_ordinal_to_read += 1;
9177 next_offset += envelope_size;
9178 }
9179
9180 let next_out_of_line = decoder.next_out_of_line();
9181 let handles_before = decoder.remaining_handles();
9182 if let Some((inlined, num_bytes, num_handles)) =
9183 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9184 {
9185 let member_inline_size = <fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9186 if inlined != (member_inline_size <= 4) {
9187 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9188 }
9189 let inner_offset;
9190 let mut inner_depth = depth.clone();
9191 if inlined {
9192 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9193 inner_offset = next_offset;
9194 } else {
9195 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9196 inner_depth.increment()?;
9197 }
9198 let val_ref =
9199 self.namespace_entries.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
9200 fidl::decode!(fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9201 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9202 {
9203 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9204 }
9205 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9206 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9207 }
9208 }
9209
9210 next_offset += envelope_size;
9211 _next_ordinal_to_read += 1;
9212 if next_offset >= end_offset {
9213 return Ok(());
9214 }
9215
9216 while _next_ordinal_to_read < 3 {
9218 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9219 _next_ordinal_to_read += 1;
9220 next_offset += envelope_size;
9221 }
9222
9223 let next_out_of_line = decoder.next_out_of_line();
9224 let handles_before = decoder.remaining_handles();
9225 if let Some((inlined, num_bytes, num_handles)) =
9226 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9227 {
9228 let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9229 if inlined != (member_inline_size <= 4) {
9230 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9231 }
9232 let inner_offset;
9233 let mut inner_depth = depth.clone();
9234 if inlined {
9235 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9236 inner_offset = next_offset;
9237 } else {
9238 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9239 inner_depth.increment()?;
9240 }
9241 let val_ref = self.dictionary.get_or_insert_with(|| {
9242 fidl::new_empty!(
9243 fidl_fuchsia_component_sandbox::DictionaryRef,
9244 fidl::encoding::DefaultFuchsiaResourceDialect
9245 )
9246 });
9247 fidl::decode!(
9248 fidl_fuchsia_component_sandbox::DictionaryRef,
9249 fidl::encoding::DefaultFuchsiaResourceDialect,
9250 val_ref,
9251 decoder,
9252 inner_offset,
9253 inner_depth
9254 )?;
9255 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9256 {
9257 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9258 }
9259 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9260 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9261 }
9262 }
9263
9264 next_offset += envelope_size;
9265
9266 while next_offset < end_offset {
9268 _next_ordinal_to_read += 1;
9269 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9270 next_offset += envelope_size;
9271 }
9272
9273 Ok(())
9274 }
9275 }
9276
9277 impl fidl::encoding::ResourceTypeMarker for EventPayload {
9278 type Borrowed<'a> = &'a mut Self;
9279 fn take_or_borrow<'a>(
9280 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9281 ) -> Self::Borrowed<'a> {
9282 value
9283 }
9284 }
9285
9286 unsafe impl fidl::encoding::TypeMarker for EventPayload {
9287 type Owned = Self;
9288
9289 #[inline(always)]
9290 fn inline_align(_context: fidl::encoding::Context) -> usize {
9291 8
9292 }
9293
9294 #[inline(always)]
9295 fn inline_size(_context: fidl::encoding::Context) -> usize {
9296 16
9297 }
9298 }
9299
9300 unsafe impl fidl::encoding::Encode<EventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
9301 for &mut EventPayload
9302 {
9303 #[inline]
9304 unsafe fn encode(
9305 self,
9306 encoder: &mut fidl::encoding::Encoder<
9307 '_,
9308 fidl::encoding::DefaultFuchsiaResourceDialect,
9309 >,
9310 offset: usize,
9311 _depth: fidl::encoding::Depth,
9312 ) -> fidl::Result<()> {
9313 encoder.debug_check_bounds::<EventPayload>(offset);
9314 encoder.write_num::<u64>(self.ordinal(), offset);
9315 match self {
9316 EventPayload::CapabilityRequested(ref mut val) => {
9317 fidl::encoding::encode_in_envelope::<CapabilityRequestedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9318 <CapabilityRequestedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
9319 encoder, offset + 8, _depth
9320 )
9321 }
9322 EventPayload::Purged(ref val) => {
9323 fidl::encoding::encode_in_envelope::<PurgedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9324 <PurgedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
9325 encoder, offset + 8, _depth
9326 )
9327 }
9328 EventPayload::DirectoryReady(ref mut val) => {
9329 fidl::encoding::encode_in_envelope::<DirectoryReadyPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9330 <DirectoryReadyPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
9331 encoder, offset + 8, _depth
9332 )
9333 }
9334 EventPayload::Discovered(ref val) => {
9335 fidl::encoding::encode_in_envelope::<DiscoveredPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9336 <DiscoveredPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
9337 encoder, offset + 8, _depth
9338 )
9339 }
9340 EventPayload::Destroyed(ref val) => {
9341 fidl::encoding::encode_in_envelope::<DestroyedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9342 <DestroyedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
9343 encoder, offset + 8, _depth
9344 )
9345 }
9346 EventPayload::Resolved(ref val) => {
9347 fidl::encoding::encode_in_envelope::<ResolvedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9348 <ResolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
9349 encoder, offset + 8, _depth
9350 )
9351 }
9352 EventPayload::Started(ref val) => {
9353 fidl::encoding::encode_in_envelope::<StartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9354 <StartedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
9355 encoder, offset + 8, _depth
9356 )
9357 }
9358 EventPayload::Stopped(ref val) => {
9359 fidl::encoding::encode_in_envelope::<StoppedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9360 <StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
9361 encoder, offset + 8, _depth
9362 )
9363 }
9364 EventPayload::DebugStarted(ref mut val) => {
9365 fidl::encoding::encode_in_envelope::<DebugStartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9366 <DebugStartedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
9367 encoder, offset + 8, _depth
9368 )
9369 }
9370 EventPayload::Unresolved(ref val) => {
9371 fidl::encoding::encode_in_envelope::<UnresolvedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
9372 <UnresolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
9373 encoder, offset + 8, _depth
9374 )
9375 }
9376 EventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
9377 }
9378 }
9379 }
9380
9381 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for EventPayload {
9382 #[inline(always)]
9383 fn new_empty() -> Self {
9384 Self::__SourceBreaking { unknown_ordinal: 0 }
9385 }
9386
9387 #[inline]
9388 unsafe fn decode(
9389 &mut self,
9390 decoder: &mut fidl::encoding::Decoder<
9391 '_,
9392 fidl::encoding::DefaultFuchsiaResourceDialect,
9393 >,
9394 offset: usize,
9395 mut depth: fidl::encoding::Depth,
9396 ) -> fidl::Result<()> {
9397 decoder.debug_check_bounds::<Self>(offset);
9398 #[allow(unused_variables)]
9399 let next_out_of_line = decoder.next_out_of_line();
9400 let handles_before = decoder.remaining_handles();
9401 let (ordinal, inlined, num_bytes, num_handles) =
9402 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
9403
9404 let member_inline_size = match ordinal {
9405 1 => <CapabilityRequestedPayload as fidl::encoding::TypeMarker>::inline_size(
9406 decoder.context,
9407 ),
9408 2 => <PurgedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9409 3 => <DirectoryReadyPayload as fidl::encoding::TypeMarker>::inline_size(
9410 decoder.context,
9411 ),
9412 4 => {
9413 <DiscoveredPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
9414 }
9415 5 => <DestroyedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9416 6 => <ResolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9417 7 => <StartedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9418 8 => <StoppedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9419 9 => <DebugStartedPayload as fidl::encoding::TypeMarker>::inline_size(
9420 decoder.context,
9421 ),
9422 10 => {
9423 <UnresolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
9424 }
9425 0 => return Err(fidl::Error::UnknownUnionTag),
9426 _ => num_bytes as usize,
9427 };
9428
9429 if inlined != (member_inline_size <= 4) {
9430 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9431 }
9432 let _inner_offset;
9433 if inlined {
9434 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
9435 _inner_offset = offset + 8;
9436 } else {
9437 depth.increment()?;
9438 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9439 }
9440 match ordinal {
9441 1 => {
9442 #[allow(irrefutable_let_patterns)]
9443 if let EventPayload::CapabilityRequested(_) = self {
9444 } else {
9446 *self = EventPayload::CapabilityRequested(fidl::new_empty!(
9448 CapabilityRequestedPayload,
9449 fidl::encoding::DefaultFuchsiaResourceDialect
9450 ));
9451 }
9452 #[allow(irrefutable_let_patterns)]
9453 if let EventPayload::CapabilityRequested(ref mut val) = self {
9454 fidl::decode!(
9455 CapabilityRequestedPayload,
9456 fidl::encoding::DefaultFuchsiaResourceDialect,
9457 val,
9458 decoder,
9459 _inner_offset,
9460 depth
9461 )?;
9462 } else {
9463 unreachable!()
9464 }
9465 }
9466 2 => {
9467 #[allow(irrefutable_let_patterns)]
9468 if let EventPayload::Purged(_) = self {
9469 } else {
9471 *self = EventPayload::Purged(fidl::new_empty!(
9473 PurgedPayload,
9474 fidl::encoding::DefaultFuchsiaResourceDialect
9475 ));
9476 }
9477 #[allow(irrefutable_let_patterns)]
9478 if let EventPayload::Purged(ref mut val) = self {
9479 fidl::decode!(
9480 PurgedPayload,
9481 fidl::encoding::DefaultFuchsiaResourceDialect,
9482 val,
9483 decoder,
9484 _inner_offset,
9485 depth
9486 )?;
9487 } else {
9488 unreachable!()
9489 }
9490 }
9491 3 => {
9492 #[allow(irrefutable_let_patterns)]
9493 if let EventPayload::DirectoryReady(_) = self {
9494 } else {
9496 *self = EventPayload::DirectoryReady(fidl::new_empty!(
9498 DirectoryReadyPayload,
9499 fidl::encoding::DefaultFuchsiaResourceDialect
9500 ));
9501 }
9502 #[allow(irrefutable_let_patterns)]
9503 if let EventPayload::DirectoryReady(ref mut val) = self {
9504 fidl::decode!(
9505 DirectoryReadyPayload,
9506 fidl::encoding::DefaultFuchsiaResourceDialect,
9507 val,
9508 decoder,
9509 _inner_offset,
9510 depth
9511 )?;
9512 } else {
9513 unreachable!()
9514 }
9515 }
9516 4 => {
9517 #[allow(irrefutable_let_patterns)]
9518 if let EventPayload::Discovered(_) = self {
9519 } else {
9521 *self = EventPayload::Discovered(fidl::new_empty!(
9523 DiscoveredPayload,
9524 fidl::encoding::DefaultFuchsiaResourceDialect
9525 ));
9526 }
9527 #[allow(irrefutable_let_patterns)]
9528 if let EventPayload::Discovered(ref mut val) = self {
9529 fidl::decode!(
9530 DiscoveredPayload,
9531 fidl::encoding::DefaultFuchsiaResourceDialect,
9532 val,
9533 decoder,
9534 _inner_offset,
9535 depth
9536 )?;
9537 } else {
9538 unreachable!()
9539 }
9540 }
9541 5 => {
9542 #[allow(irrefutable_let_patterns)]
9543 if let EventPayload::Destroyed(_) = self {
9544 } else {
9546 *self = EventPayload::Destroyed(fidl::new_empty!(
9548 DestroyedPayload,
9549 fidl::encoding::DefaultFuchsiaResourceDialect
9550 ));
9551 }
9552 #[allow(irrefutable_let_patterns)]
9553 if let EventPayload::Destroyed(ref mut val) = self {
9554 fidl::decode!(
9555 DestroyedPayload,
9556 fidl::encoding::DefaultFuchsiaResourceDialect,
9557 val,
9558 decoder,
9559 _inner_offset,
9560 depth
9561 )?;
9562 } else {
9563 unreachable!()
9564 }
9565 }
9566 6 => {
9567 #[allow(irrefutable_let_patterns)]
9568 if let EventPayload::Resolved(_) = self {
9569 } else {
9571 *self = EventPayload::Resolved(fidl::new_empty!(
9573 ResolvedPayload,
9574 fidl::encoding::DefaultFuchsiaResourceDialect
9575 ));
9576 }
9577 #[allow(irrefutable_let_patterns)]
9578 if let EventPayload::Resolved(ref mut val) = self {
9579 fidl::decode!(
9580 ResolvedPayload,
9581 fidl::encoding::DefaultFuchsiaResourceDialect,
9582 val,
9583 decoder,
9584 _inner_offset,
9585 depth
9586 )?;
9587 } else {
9588 unreachable!()
9589 }
9590 }
9591 7 => {
9592 #[allow(irrefutable_let_patterns)]
9593 if let EventPayload::Started(_) = self {
9594 } else {
9596 *self = EventPayload::Started(fidl::new_empty!(
9598 StartedPayload,
9599 fidl::encoding::DefaultFuchsiaResourceDialect
9600 ));
9601 }
9602 #[allow(irrefutable_let_patterns)]
9603 if let EventPayload::Started(ref mut val) = self {
9604 fidl::decode!(
9605 StartedPayload,
9606 fidl::encoding::DefaultFuchsiaResourceDialect,
9607 val,
9608 decoder,
9609 _inner_offset,
9610 depth
9611 )?;
9612 } else {
9613 unreachable!()
9614 }
9615 }
9616 8 => {
9617 #[allow(irrefutable_let_patterns)]
9618 if let EventPayload::Stopped(_) = self {
9619 } else {
9621 *self = EventPayload::Stopped(fidl::new_empty!(
9623 StoppedPayload,
9624 fidl::encoding::DefaultFuchsiaResourceDialect
9625 ));
9626 }
9627 #[allow(irrefutable_let_patterns)]
9628 if let EventPayload::Stopped(ref mut val) = self {
9629 fidl::decode!(
9630 StoppedPayload,
9631 fidl::encoding::DefaultFuchsiaResourceDialect,
9632 val,
9633 decoder,
9634 _inner_offset,
9635 depth
9636 )?;
9637 } else {
9638 unreachable!()
9639 }
9640 }
9641 9 => {
9642 #[allow(irrefutable_let_patterns)]
9643 if let EventPayload::DebugStarted(_) = self {
9644 } else {
9646 *self = EventPayload::DebugStarted(fidl::new_empty!(
9648 DebugStartedPayload,
9649 fidl::encoding::DefaultFuchsiaResourceDialect
9650 ));
9651 }
9652 #[allow(irrefutable_let_patterns)]
9653 if let EventPayload::DebugStarted(ref mut val) = self {
9654 fidl::decode!(
9655 DebugStartedPayload,
9656 fidl::encoding::DefaultFuchsiaResourceDialect,
9657 val,
9658 decoder,
9659 _inner_offset,
9660 depth
9661 )?;
9662 } else {
9663 unreachable!()
9664 }
9665 }
9666 10 => {
9667 #[allow(irrefutable_let_patterns)]
9668 if let EventPayload::Unresolved(_) = self {
9669 } else {
9671 *self = EventPayload::Unresolved(fidl::new_empty!(
9673 UnresolvedPayload,
9674 fidl::encoding::DefaultFuchsiaResourceDialect
9675 ));
9676 }
9677 #[allow(irrefutable_let_patterns)]
9678 if let EventPayload::Unresolved(ref mut val) = self {
9679 fidl::decode!(
9680 UnresolvedPayload,
9681 fidl::encoding::DefaultFuchsiaResourceDialect,
9682 val,
9683 decoder,
9684 _inner_offset,
9685 depth
9686 )?;
9687 } else {
9688 unreachable!()
9689 }
9690 }
9691 #[allow(deprecated)]
9692 ordinal => {
9693 for _ in 0..num_handles {
9694 decoder.drop_next_handle()?;
9695 }
9696 *self = EventPayload::__SourceBreaking { unknown_ordinal: ordinal };
9697 }
9698 }
9699 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
9700 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9701 }
9702 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9703 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9704 }
9705 Ok(())
9706 }
9707 }
9708}