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_runner_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ComponentControllerOnPublishDiagnosticsRequest {
16 pub payload: ComponentDiagnostics,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for ComponentControllerOnPublishDiagnosticsRequest
21{
22}
23
24#[derive(Debug, PartialEq)]
25pub struct ComponentRunnerStartRequest {
26 pub start_info: ComponentStartInfo,
27 pub controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
31 for ComponentRunnerStartRequest
32{
33}
34
35#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub struct TaskProviderGetJobResponse {
37 pub job: fidl::Job,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41 for TaskProviderGetJobResponse
42{
43}
44
45#[derive(Debug, Default, PartialEq)]
46pub struct ComponentControllerOnEscrowRequest {
47 pub outgoing_dir: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
51 pub escrowed_dictionary: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
66 pub escrowed_dictionary_handle: Option<fidl::EventPair>,
79 pub recoverable_bytes: Option<u64>,
83 #[doc(hidden)]
84 pub __source_breaking: fidl::marker::SourceBreaking,
85}
86
87impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
88 for ComponentControllerOnEscrowRequest
89{
90}
91
92#[derive(Debug, Default, PartialEq)]
93pub struct ComponentDiagnostics {
94 pub tasks: Option<ComponentTasks>,
95 #[doc(hidden)]
96 pub __source_breaking: fidl::marker::SourceBreaking,
97}
98
99impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ComponentDiagnostics {}
100
101#[derive(Debug, Default, PartialEq)]
105pub struct ComponentNamespaceEntry {
106 pub path: Option<String>,
109 pub directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
111 #[doc(hidden)]
112 pub __source_breaking: fidl::marker::SourceBreaking,
113}
114
115impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ComponentNamespaceEntry {}
116
117#[derive(Debug, Default, PartialEq)]
119pub struct ComponentStartInfo {
120 pub resolved_url: Option<String>,
123 pub program: Option<fidl_fuchsia_data::Dictionary>,
126 pub ns: Option<Vec<ComponentNamespaceEntry>>,
147 pub outgoing_dir: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
149 pub runtime_dir: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
153 pub numbered_handles: Option<Vec<fidl_fuchsia_process::HandleInfo>>,
158 pub encoded_config: Option<fidl_fuchsia_mem::Data>,
169 pub break_on_start: Option<fidl::EventPair>,
178 pub component_instance: Option<fidl::Event>,
188 pub escrowed_dictionary: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
193 pub escrowed_dictionary_handle: Option<fidl::EventPair>,
196 #[doc(hidden)]
197 pub __source_breaking: fidl::marker::SourceBreaking,
198}
199
200impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ComponentStartInfo {}
201
202#[derive(Debug, Default, PartialEq)]
203pub struct ComponentStopInfo {
204 pub termination_status: Option<i32>,
209 pub exit_code: Option<i64>,
215 #[doc(hidden)]
216 pub __source_breaking: fidl::marker::SourceBreaking,
217}
218
219impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ComponentStopInfo {}
220
221#[derive(Debug, Default, PartialEq)]
222pub struct ComponentTasks {
223 pub component_task: Option<Task>,
224 pub parent_task: Option<Task>,
225 #[doc(hidden)]
226 pub __source_breaking: fidl::marker::SourceBreaking,
227}
228
229impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ComponentTasks {}
230
231#[derive(Debug)]
232pub enum Task {
233 Job(fidl::Job),
234 Process(fidl::Process),
235 Thread(fidl::Thread),
236 #[doc(hidden)]
237 __SourceBreaking {
238 unknown_ordinal: u64,
239 },
240}
241
242#[macro_export]
244macro_rules! TaskUnknown {
245 () => {
246 _
247 };
248}
249
250impl PartialEq for Task {
252 fn eq(&self, other: &Self) -> bool {
253 match (self, other) {
254 (Self::Job(x), Self::Job(y)) => *x == *y,
255 (Self::Process(x), Self::Process(y)) => *x == *y,
256 (Self::Thread(x), Self::Thread(y)) => *x == *y,
257 _ => false,
258 }
259 }
260}
261
262impl Task {
263 #[inline]
264 pub fn ordinal(&self) -> u64 {
265 match *self {
266 Self::Job(_) => 1,
267 Self::Process(_) => 2,
268 Self::Thread(_) => 3,
269 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
270 }
271 }
272
273 #[inline]
274 pub fn unknown_variant_for_testing() -> Self {
275 Self::__SourceBreaking { unknown_ordinal: 0 }
276 }
277
278 #[inline]
279 pub fn is_unknown(&self) -> bool {
280 match self {
281 Self::__SourceBreaking { .. } => true,
282 _ => false,
283 }
284 }
285}
286
287impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Task {}
288
289#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
290pub struct ComponentControllerMarker;
291
292impl fidl::endpoints::ProtocolMarker for ComponentControllerMarker {
293 type Proxy = ComponentControllerProxy;
294 type RequestStream = ComponentControllerRequestStream;
295 #[cfg(target_os = "fuchsia")]
296 type SynchronousProxy = ComponentControllerSynchronousProxy;
297
298 const DEBUG_NAME: &'static str = "(anonymous) ComponentController";
299}
300
301pub trait ComponentControllerProxyInterface: Send + Sync {
302 fn r#stop(&self) -> Result<(), fidl::Error>;
303 fn r#kill(&self) -> Result<(), fidl::Error>;
304}
305#[derive(Debug)]
306#[cfg(target_os = "fuchsia")]
307pub struct ComponentControllerSynchronousProxy {
308 client: fidl::client::sync::Client,
309}
310
311#[cfg(target_os = "fuchsia")]
312impl fidl::endpoints::SynchronousProxy for ComponentControllerSynchronousProxy {
313 type Proxy = ComponentControllerProxy;
314 type Protocol = ComponentControllerMarker;
315
316 fn from_channel(inner: fidl::Channel) -> Self {
317 Self::new(inner)
318 }
319
320 fn into_channel(self) -> fidl::Channel {
321 self.client.into_channel()
322 }
323
324 fn as_channel(&self) -> &fidl::Channel {
325 self.client.as_channel()
326 }
327}
328
329#[cfg(target_os = "fuchsia")]
330impl ComponentControllerSynchronousProxy {
331 pub fn new(channel: fidl::Channel) -> Self {
332 Self { client: fidl::client::sync::Client::new(channel) }
333 }
334
335 pub fn into_channel(self) -> fidl::Channel {
336 self.client.into_channel()
337 }
338
339 pub fn wait_for_event(
342 &self,
343 deadline: zx::MonotonicInstant,
344 ) -> Result<ComponentControllerEvent, fidl::Error> {
345 ComponentControllerEvent::decode(
346 self.client.wait_for_event::<ComponentControllerMarker>(deadline)?,
347 )
348 }
349
350 pub fn r#stop(&self) -> Result<(), fidl::Error> {
357 self.client.send::<fidl::encoding::EmptyPayload>(
358 (),
359 0x42ad097fa07c1b62,
360 fidl::encoding::DynamicFlags::empty(),
361 )
362 }
363
364 pub fn r#kill(&self) -> Result<(), fidl::Error> {
374 self.client.send::<fidl::encoding::EmptyPayload>(
375 (),
376 0x3ea62e200a45aeb4,
377 fidl::encoding::DynamicFlags::empty(),
378 )
379 }
380}
381
382#[cfg(target_os = "fuchsia")]
383impl From<ComponentControllerSynchronousProxy> for zx::NullableHandle {
384 fn from(value: ComponentControllerSynchronousProxy) -> Self {
385 value.into_channel().into()
386 }
387}
388
389#[cfg(target_os = "fuchsia")]
390impl From<fidl::Channel> for ComponentControllerSynchronousProxy {
391 fn from(value: fidl::Channel) -> Self {
392 Self::new(value)
393 }
394}
395
396#[cfg(target_os = "fuchsia")]
397impl fidl::endpoints::FromClient for ComponentControllerSynchronousProxy {
398 type Protocol = ComponentControllerMarker;
399
400 fn from_client(value: fidl::endpoints::ClientEnd<ComponentControllerMarker>) -> Self {
401 Self::new(value.into_channel())
402 }
403}
404
405#[derive(Debug, Clone)]
406pub struct ComponentControllerProxy {
407 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
408}
409
410impl fidl::endpoints::Proxy for ComponentControllerProxy {
411 type Protocol = ComponentControllerMarker;
412
413 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
414 Self::new(inner)
415 }
416
417 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
418 self.client.into_channel().map_err(|client| Self { client })
419 }
420
421 fn as_channel(&self) -> &::fidl::AsyncChannel {
422 self.client.as_channel()
423 }
424}
425
426impl ComponentControllerProxy {
427 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
429 let protocol_name =
430 <ComponentControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
431 Self { client: fidl::client::Client::new(channel, protocol_name) }
432 }
433
434 pub fn take_event_stream(&self) -> ComponentControllerEventStream {
440 ComponentControllerEventStream { event_receiver: self.client.take_event_receiver() }
441 }
442
443 pub fn r#stop(&self) -> Result<(), fidl::Error> {
450 ComponentControllerProxyInterface::r#stop(self)
451 }
452
453 pub fn r#kill(&self) -> Result<(), fidl::Error> {
463 ComponentControllerProxyInterface::r#kill(self)
464 }
465}
466
467impl ComponentControllerProxyInterface for ComponentControllerProxy {
468 fn r#stop(&self) -> Result<(), fidl::Error> {
469 self.client.send::<fidl::encoding::EmptyPayload>(
470 (),
471 0x42ad097fa07c1b62,
472 fidl::encoding::DynamicFlags::empty(),
473 )
474 }
475
476 fn r#kill(&self) -> Result<(), fidl::Error> {
477 self.client.send::<fidl::encoding::EmptyPayload>(
478 (),
479 0x3ea62e200a45aeb4,
480 fidl::encoding::DynamicFlags::empty(),
481 )
482 }
483}
484
485pub struct ComponentControllerEventStream {
486 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
487}
488
489impl std::marker::Unpin for ComponentControllerEventStream {}
490
491impl futures::stream::FusedStream for ComponentControllerEventStream {
492 fn is_terminated(&self) -> bool {
493 self.event_receiver.is_terminated()
494 }
495}
496
497impl futures::Stream for ComponentControllerEventStream {
498 type Item = Result<ComponentControllerEvent, fidl::Error>;
499
500 fn poll_next(
501 mut self: std::pin::Pin<&mut Self>,
502 cx: &mut std::task::Context<'_>,
503 ) -> std::task::Poll<Option<Self::Item>> {
504 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
505 &mut self.event_receiver,
506 cx
507 )?) {
508 Some(buf) => std::task::Poll::Ready(Some(ComponentControllerEvent::decode(buf))),
509 None => std::task::Poll::Ready(None),
510 }
511 }
512}
513
514#[derive(Debug)]
515pub enum ComponentControllerEvent {
516 OnPublishDiagnostics {
517 payload: ComponentDiagnostics,
518 },
519 OnEscrow {
520 payload: ComponentControllerOnEscrowRequest,
521 },
522 OnStop {
523 payload: ComponentStopInfo,
524 },
525 #[non_exhaustive]
526 _UnknownEvent {
527 ordinal: u64,
529 },
530}
531
532impl ComponentControllerEvent {
533 #[allow(irrefutable_let_patterns)]
534 pub fn into_on_publish_diagnostics(self) -> Option<ComponentDiagnostics> {
535 if let ComponentControllerEvent::OnPublishDiagnostics { payload } = self {
536 Some((payload))
537 } else {
538 None
539 }
540 }
541 #[allow(irrefutable_let_patterns)]
542 pub fn into_on_escrow(self) -> Option<ComponentControllerOnEscrowRequest> {
543 if let ComponentControllerEvent::OnEscrow { payload } = self {
544 Some((payload))
545 } else {
546 None
547 }
548 }
549 #[allow(irrefutable_let_patterns)]
550 pub fn into_on_stop(self) -> Option<ComponentStopInfo> {
551 if let ComponentControllerEvent::OnStop { payload } = self { Some((payload)) } else { None }
552 }
553
554 fn decode(
556 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
557 ) -> Result<ComponentControllerEvent, fidl::Error> {
558 let (bytes, _handles) = buf.split_mut();
559 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
560 debug_assert_eq!(tx_header.tx_id, 0);
561 match tx_header.ordinal {
562 0x1f16d8c3c49c6947 => {
563 let mut out = fidl::new_empty!(
564 ComponentControllerOnPublishDiagnosticsRequest,
565 fidl::encoding::DefaultFuchsiaResourceDialect
566 );
567 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ComponentControllerOnPublishDiagnosticsRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
568 Ok((ComponentControllerEvent::OnPublishDiagnostics { payload: out.payload }))
569 }
570 0xa231349355343fc => {
571 let mut out = fidl::new_empty!(
572 ComponentControllerOnEscrowRequest,
573 fidl::encoding::DefaultFuchsiaResourceDialect
574 );
575 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ComponentControllerOnEscrowRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
576 Ok((ComponentControllerEvent::OnEscrow { payload: out }))
577 }
578 0x3bfd24b031878ab2 => {
579 let mut out = fidl::new_empty!(
580 ComponentStopInfo,
581 fidl::encoding::DefaultFuchsiaResourceDialect
582 );
583 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ComponentStopInfo>(&tx_header, _body_bytes, _handles, &mut out)?;
584 Ok((ComponentControllerEvent::OnStop { payload: out }))
585 }
586 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
587 Ok(ComponentControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
588 }
589 _ => Err(fidl::Error::UnknownOrdinal {
590 ordinal: tx_header.ordinal,
591 protocol_name:
592 <ComponentControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
593 }),
594 }
595 }
596}
597
598pub struct ComponentControllerRequestStream {
600 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
601 is_terminated: bool,
602}
603
604impl std::marker::Unpin for ComponentControllerRequestStream {}
605
606impl futures::stream::FusedStream for ComponentControllerRequestStream {
607 fn is_terminated(&self) -> bool {
608 self.is_terminated
609 }
610}
611
612impl fidl::endpoints::RequestStream for ComponentControllerRequestStream {
613 type Protocol = ComponentControllerMarker;
614 type ControlHandle = ComponentControllerControlHandle;
615
616 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
617 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
618 }
619
620 fn control_handle(&self) -> Self::ControlHandle {
621 ComponentControllerControlHandle { inner: self.inner.clone() }
622 }
623
624 fn into_inner(
625 self,
626 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
627 {
628 (self.inner, self.is_terminated)
629 }
630
631 fn from_inner(
632 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
633 is_terminated: bool,
634 ) -> Self {
635 Self { inner, is_terminated }
636 }
637}
638
639impl futures::Stream for ComponentControllerRequestStream {
640 type Item = Result<ComponentControllerRequest, fidl::Error>;
641
642 fn poll_next(
643 mut self: std::pin::Pin<&mut Self>,
644 cx: &mut std::task::Context<'_>,
645 ) -> std::task::Poll<Option<Self::Item>> {
646 let this = &mut *self;
647 if this.inner.check_shutdown(cx) {
648 this.is_terminated = true;
649 return std::task::Poll::Ready(None);
650 }
651 if this.is_terminated {
652 panic!("polled ComponentControllerRequestStream after completion");
653 }
654 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
655 |bytes, handles| {
656 match this.inner.channel().read_etc(cx, bytes, handles) {
657 std::task::Poll::Ready(Ok(())) => {}
658 std::task::Poll::Pending => return std::task::Poll::Pending,
659 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
660 this.is_terminated = true;
661 return std::task::Poll::Ready(None);
662 }
663 std::task::Poll::Ready(Err(e)) => {
664 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
665 e.into(),
666 ))));
667 }
668 }
669
670 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
672
673 std::task::Poll::Ready(Some(match header.ordinal {
674 0x42ad097fa07c1b62 => {
675 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
676 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
677 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
678 let control_handle = ComponentControllerControlHandle {
679 inner: this.inner.clone(),
680 };
681 Ok(ComponentControllerRequest::Stop {
682 control_handle,
683 })
684 }
685 0x3ea62e200a45aeb4 => {
686 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
687 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
688 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
689 let control_handle = ComponentControllerControlHandle {
690 inner: this.inner.clone(),
691 };
692 Ok(ComponentControllerRequest::Kill {
693 control_handle,
694 })
695 }
696 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
697 Ok(ComponentControllerRequest::_UnknownMethod {
698 ordinal: header.ordinal,
699 control_handle: ComponentControllerControlHandle { inner: this.inner.clone() },
700 method_type: fidl::MethodType::OneWay,
701 })
702 }
703 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
704 this.inner.send_framework_err(
705 fidl::encoding::FrameworkErr::UnknownMethod,
706 header.tx_id,
707 header.ordinal,
708 header.dynamic_flags(),
709 (bytes, handles),
710 )?;
711 Ok(ComponentControllerRequest::_UnknownMethod {
712 ordinal: header.ordinal,
713 control_handle: ComponentControllerControlHandle { inner: this.inner.clone() },
714 method_type: fidl::MethodType::TwoWay,
715 })
716 }
717 _ => Err(fidl::Error::UnknownOrdinal {
718 ordinal: header.ordinal,
719 protocol_name: <ComponentControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
720 }),
721 }))
722 },
723 )
724 }
725}
726
727#[derive(Debug)]
806pub enum ComponentControllerRequest {
807 Stop { control_handle: ComponentControllerControlHandle },
814 Kill { control_handle: ComponentControllerControlHandle },
824 #[non_exhaustive]
826 _UnknownMethod {
827 ordinal: u64,
829 control_handle: ComponentControllerControlHandle,
830 method_type: fidl::MethodType,
831 },
832}
833
834impl ComponentControllerRequest {
835 #[allow(irrefutable_let_patterns)]
836 pub fn into_stop(self) -> Option<(ComponentControllerControlHandle)> {
837 if let ComponentControllerRequest::Stop { control_handle } = self {
838 Some((control_handle))
839 } else {
840 None
841 }
842 }
843
844 #[allow(irrefutable_let_patterns)]
845 pub fn into_kill(self) -> Option<(ComponentControllerControlHandle)> {
846 if let ComponentControllerRequest::Kill { control_handle } = self {
847 Some((control_handle))
848 } else {
849 None
850 }
851 }
852
853 pub fn method_name(&self) -> &'static str {
855 match *self {
856 ComponentControllerRequest::Stop { .. } => "stop",
857 ComponentControllerRequest::Kill { .. } => "kill",
858 ComponentControllerRequest::_UnknownMethod {
859 method_type: fidl::MethodType::OneWay,
860 ..
861 } => "unknown one-way method",
862 ComponentControllerRequest::_UnknownMethod {
863 method_type: fidl::MethodType::TwoWay,
864 ..
865 } => "unknown two-way method",
866 }
867 }
868}
869
870#[derive(Debug, Clone)]
871pub struct ComponentControllerControlHandle {
872 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
873}
874
875impl fidl::endpoints::ControlHandle for ComponentControllerControlHandle {
876 fn shutdown(&self) {
877 self.inner.shutdown()
878 }
879
880 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
881 self.inner.shutdown_with_epitaph(status)
882 }
883
884 fn is_closed(&self) -> bool {
885 self.inner.channel().is_closed()
886 }
887 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
888 self.inner.channel().on_closed()
889 }
890
891 #[cfg(target_os = "fuchsia")]
892 fn signal_peer(
893 &self,
894 clear_mask: zx::Signals,
895 set_mask: zx::Signals,
896 ) -> Result<(), zx_status::Status> {
897 use fidl::Peered;
898 self.inner.channel().signal_peer(clear_mask, set_mask)
899 }
900}
901
902impl ComponentControllerControlHandle {
903 pub fn send_on_publish_diagnostics(
904 &self,
905 mut payload: ComponentDiagnostics,
906 ) -> Result<(), fidl::Error> {
907 self.inner.send::<ComponentControllerOnPublishDiagnosticsRequest>(
908 (&mut payload,),
909 0,
910 0x1f16d8c3c49c6947,
911 fidl::encoding::DynamicFlags::empty(),
912 )
913 }
914
915 pub fn send_on_escrow(
916 &self,
917 mut payload: ComponentControllerOnEscrowRequest,
918 ) -> Result<(), fidl::Error> {
919 self.inner.send::<ComponentControllerOnEscrowRequest>(
920 &mut payload,
921 0,
922 0xa231349355343fc,
923 fidl::encoding::DynamicFlags::FLEXIBLE,
924 )
925 }
926
927 pub fn send_on_stop(&self, mut payload: ComponentStopInfo) -> Result<(), fidl::Error> {
928 self.inner.send::<ComponentStopInfo>(
929 &mut payload,
930 0,
931 0x3bfd24b031878ab2,
932 fidl::encoding::DynamicFlags::FLEXIBLE,
933 )
934 }
935}
936
937#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
938pub struct ComponentRunnerMarker;
939
940impl fidl::endpoints::ProtocolMarker for ComponentRunnerMarker {
941 type Proxy = ComponentRunnerProxy;
942 type RequestStream = ComponentRunnerRequestStream;
943 #[cfg(target_os = "fuchsia")]
944 type SynchronousProxy = ComponentRunnerSynchronousProxy;
945
946 const DEBUG_NAME: &'static str = "fuchsia.component.runner.ComponentRunner";
947}
948impl fidl::endpoints::DiscoverableProtocolMarker for ComponentRunnerMarker {}
949
950pub trait ComponentRunnerProxyInterface: Send + Sync {
951 fn r#start(
952 &self,
953 start_info: ComponentStartInfo,
954 controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
955 ) -> Result<(), fidl::Error>;
956}
957#[derive(Debug)]
958#[cfg(target_os = "fuchsia")]
959pub struct ComponentRunnerSynchronousProxy {
960 client: fidl::client::sync::Client,
961}
962
963#[cfg(target_os = "fuchsia")]
964impl fidl::endpoints::SynchronousProxy for ComponentRunnerSynchronousProxy {
965 type Proxy = ComponentRunnerProxy;
966 type Protocol = ComponentRunnerMarker;
967
968 fn from_channel(inner: fidl::Channel) -> Self {
969 Self::new(inner)
970 }
971
972 fn into_channel(self) -> fidl::Channel {
973 self.client.into_channel()
974 }
975
976 fn as_channel(&self) -> &fidl::Channel {
977 self.client.as_channel()
978 }
979}
980
981#[cfg(target_os = "fuchsia")]
982impl ComponentRunnerSynchronousProxy {
983 pub fn new(channel: fidl::Channel) -> Self {
984 Self { client: fidl::client::sync::Client::new(channel) }
985 }
986
987 pub fn into_channel(self) -> fidl::Channel {
988 self.client.into_channel()
989 }
990
991 pub fn wait_for_event(
994 &self,
995 deadline: zx::MonotonicInstant,
996 ) -> Result<ComponentRunnerEvent, fidl::Error> {
997 ComponentRunnerEvent::decode(self.client.wait_for_event::<ComponentRunnerMarker>(deadline)?)
998 }
999
1000 pub fn r#start(
1009 &self,
1010 mut start_info: ComponentStartInfo,
1011 mut controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1012 ) -> Result<(), fidl::Error> {
1013 self.client.send::<ComponentRunnerStartRequest>(
1014 (&mut start_info, controller),
1015 0xad5a8c19f25ee09,
1016 fidl::encoding::DynamicFlags::empty(),
1017 )
1018 }
1019}
1020
1021#[cfg(target_os = "fuchsia")]
1022impl From<ComponentRunnerSynchronousProxy> for zx::NullableHandle {
1023 fn from(value: ComponentRunnerSynchronousProxy) -> Self {
1024 value.into_channel().into()
1025 }
1026}
1027
1028#[cfg(target_os = "fuchsia")]
1029impl From<fidl::Channel> for ComponentRunnerSynchronousProxy {
1030 fn from(value: fidl::Channel) -> Self {
1031 Self::new(value)
1032 }
1033}
1034
1035#[cfg(target_os = "fuchsia")]
1036impl fidl::endpoints::FromClient for ComponentRunnerSynchronousProxy {
1037 type Protocol = ComponentRunnerMarker;
1038
1039 fn from_client(value: fidl::endpoints::ClientEnd<ComponentRunnerMarker>) -> Self {
1040 Self::new(value.into_channel())
1041 }
1042}
1043
1044#[derive(Debug, Clone)]
1045pub struct ComponentRunnerProxy {
1046 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1047}
1048
1049impl fidl::endpoints::Proxy for ComponentRunnerProxy {
1050 type Protocol = ComponentRunnerMarker;
1051
1052 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1053 Self::new(inner)
1054 }
1055
1056 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1057 self.client.into_channel().map_err(|client| Self { client })
1058 }
1059
1060 fn as_channel(&self) -> &::fidl::AsyncChannel {
1061 self.client.as_channel()
1062 }
1063}
1064
1065impl ComponentRunnerProxy {
1066 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1068 let protocol_name = <ComponentRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1069 Self { client: fidl::client::Client::new(channel, protocol_name) }
1070 }
1071
1072 pub fn take_event_stream(&self) -> ComponentRunnerEventStream {
1078 ComponentRunnerEventStream { event_receiver: self.client.take_event_receiver() }
1079 }
1080
1081 pub fn r#start(
1090 &self,
1091 mut start_info: ComponentStartInfo,
1092 mut controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1093 ) -> Result<(), fidl::Error> {
1094 ComponentRunnerProxyInterface::r#start(self, start_info, controller)
1095 }
1096}
1097
1098impl ComponentRunnerProxyInterface for ComponentRunnerProxy {
1099 fn r#start(
1100 &self,
1101 mut start_info: ComponentStartInfo,
1102 mut controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1103 ) -> Result<(), fidl::Error> {
1104 self.client.send::<ComponentRunnerStartRequest>(
1105 (&mut start_info, controller),
1106 0xad5a8c19f25ee09,
1107 fidl::encoding::DynamicFlags::empty(),
1108 )
1109 }
1110}
1111
1112pub struct ComponentRunnerEventStream {
1113 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1114}
1115
1116impl std::marker::Unpin for ComponentRunnerEventStream {}
1117
1118impl futures::stream::FusedStream for ComponentRunnerEventStream {
1119 fn is_terminated(&self) -> bool {
1120 self.event_receiver.is_terminated()
1121 }
1122}
1123
1124impl futures::Stream for ComponentRunnerEventStream {
1125 type Item = Result<ComponentRunnerEvent, fidl::Error>;
1126
1127 fn poll_next(
1128 mut self: std::pin::Pin<&mut Self>,
1129 cx: &mut std::task::Context<'_>,
1130 ) -> std::task::Poll<Option<Self::Item>> {
1131 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1132 &mut self.event_receiver,
1133 cx
1134 )?) {
1135 Some(buf) => std::task::Poll::Ready(Some(ComponentRunnerEvent::decode(buf))),
1136 None => std::task::Poll::Ready(None),
1137 }
1138 }
1139}
1140
1141#[derive(Debug)]
1142pub enum ComponentRunnerEvent {
1143 #[non_exhaustive]
1144 _UnknownEvent {
1145 ordinal: u64,
1147 },
1148}
1149
1150impl ComponentRunnerEvent {
1151 fn decode(
1153 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1154 ) -> Result<ComponentRunnerEvent, fidl::Error> {
1155 let (bytes, _handles) = buf.split_mut();
1156 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1157 debug_assert_eq!(tx_header.tx_id, 0);
1158 match tx_header.ordinal {
1159 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1160 Ok(ComponentRunnerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1161 }
1162 _ => Err(fidl::Error::UnknownOrdinal {
1163 ordinal: tx_header.ordinal,
1164 protocol_name:
1165 <ComponentRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1166 }),
1167 }
1168 }
1169}
1170
1171pub struct ComponentRunnerRequestStream {
1173 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1174 is_terminated: bool,
1175}
1176
1177impl std::marker::Unpin for ComponentRunnerRequestStream {}
1178
1179impl futures::stream::FusedStream for ComponentRunnerRequestStream {
1180 fn is_terminated(&self) -> bool {
1181 self.is_terminated
1182 }
1183}
1184
1185impl fidl::endpoints::RequestStream for ComponentRunnerRequestStream {
1186 type Protocol = ComponentRunnerMarker;
1187 type ControlHandle = ComponentRunnerControlHandle;
1188
1189 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1190 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1191 }
1192
1193 fn control_handle(&self) -> Self::ControlHandle {
1194 ComponentRunnerControlHandle { inner: self.inner.clone() }
1195 }
1196
1197 fn into_inner(
1198 self,
1199 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1200 {
1201 (self.inner, self.is_terminated)
1202 }
1203
1204 fn from_inner(
1205 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1206 is_terminated: bool,
1207 ) -> Self {
1208 Self { inner, is_terminated }
1209 }
1210}
1211
1212impl futures::Stream for ComponentRunnerRequestStream {
1213 type Item = Result<ComponentRunnerRequest, fidl::Error>;
1214
1215 fn poll_next(
1216 mut self: std::pin::Pin<&mut Self>,
1217 cx: &mut std::task::Context<'_>,
1218 ) -> std::task::Poll<Option<Self::Item>> {
1219 let this = &mut *self;
1220 if this.inner.check_shutdown(cx) {
1221 this.is_terminated = true;
1222 return std::task::Poll::Ready(None);
1223 }
1224 if this.is_terminated {
1225 panic!("polled ComponentRunnerRequestStream after completion");
1226 }
1227 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1228 |bytes, handles| {
1229 match this.inner.channel().read_etc(cx, bytes, handles) {
1230 std::task::Poll::Ready(Ok(())) => {}
1231 std::task::Poll::Pending => return std::task::Poll::Pending,
1232 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1233 this.is_terminated = true;
1234 return std::task::Poll::Ready(None);
1235 }
1236 std::task::Poll::Ready(Err(e)) => {
1237 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1238 e.into(),
1239 ))));
1240 }
1241 }
1242
1243 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1245
1246 std::task::Poll::Ready(Some(match header.ordinal {
1247 0xad5a8c19f25ee09 => {
1248 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1249 let mut req = fidl::new_empty!(
1250 ComponentRunnerStartRequest,
1251 fidl::encoding::DefaultFuchsiaResourceDialect
1252 );
1253 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ComponentRunnerStartRequest>(&header, _body_bytes, handles, &mut req)?;
1254 let control_handle =
1255 ComponentRunnerControlHandle { inner: this.inner.clone() };
1256 Ok(ComponentRunnerRequest::Start {
1257 start_info: req.start_info,
1258 controller: req.controller,
1259
1260 control_handle,
1261 })
1262 }
1263 _ if header.tx_id == 0
1264 && header
1265 .dynamic_flags()
1266 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1267 {
1268 Ok(ComponentRunnerRequest::_UnknownMethod {
1269 ordinal: header.ordinal,
1270 control_handle: ComponentRunnerControlHandle {
1271 inner: this.inner.clone(),
1272 },
1273 method_type: fidl::MethodType::OneWay,
1274 })
1275 }
1276 _ if header
1277 .dynamic_flags()
1278 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1279 {
1280 this.inner.send_framework_err(
1281 fidl::encoding::FrameworkErr::UnknownMethod,
1282 header.tx_id,
1283 header.ordinal,
1284 header.dynamic_flags(),
1285 (bytes, handles),
1286 )?;
1287 Ok(ComponentRunnerRequest::_UnknownMethod {
1288 ordinal: header.ordinal,
1289 control_handle: ComponentRunnerControlHandle {
1290 inner: this.inner.clone(),
1291 },
1292 method_type: fidl::MethodType::TwoWay,
1293 })
1294 }
1295 _ => Err(fidl::Error::UnknownOrdinal {
1296 ordinal: header.ordinal,
1297 protocol_name:
1298 <ComponentRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1299 }),
1300 }))
1301 },
1302 )
1303 }
1304}
1305
1306#[derive(Debug)]
1314pub enum ComponentRunnerRequest {
1315 Start {
1324 start_info: ComponentStartInfo,
1325 controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1326 control_handle: ComponentRunnerControlHandle,
1327 },
1328 #[non_exhaustive]
1330 _UnknownMethod {
1331 ordinal: u64,
1333 control_handle: ComponentRunnerControlHandle,
1334 method_type: fidl::MethodType,
1335 },
1336}
1337
1338impl ComponentRunnerRequest {
1339 #[allow(irrefutable_let_patterns)]
1340 pub fn into_start(
1341 self,
1342 ) -> Option<(
1343 ComponentStartInfo,
1344 fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1345 ComponentRunnerControlHandle,
1346 )> {
1347 if let ComponentRunnerRequest::Start { start_info, controller, control_handle } = self {
1348 Some((start_info, controller, control_handle))
1349 } else {
1350 None
1351 }
1352 }
1353
1354 pub fn method_name(&self) -> &'static str {
1356 match *self {
1357 ComponentRunnerRequest::Start { .. } => "start",
1358 ComponentRunnerRequest::_UnknownMethod {
1359 method_type: fidl::MethodType::OneWay,
1360 ..
1361 } => "unknown one-way method",
1362 ComponentRunnerRequest::_UnknownMethod {
1363 method_type: fidl::MethodType::TwoWay,
1364 ..
1365 } => "unknown two-way method",
1366 }
1367 }
1368}
1369
1370#[derive(Debug, Clone)]
1371pub struct ComponentRunnerControlHandle {
1372 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1373}
1374
1375impl fidl::endpoints::ControlHandle for ComponentRunnerControlHandle {
1376 fn shutdown(&self) {
1377 self.inner.shutdown()
1378 }
1379
1380 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1381 self.inner.shutdown_with_epitaph(status)
1382 }
1383
1384 fn is_closed(&self) -> bool {
1385 self.inner.channel().is_closed()
1386 }
1387 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1388 self.inner.channel().on_closed()
1389 }
1390
1391 #[cfg(target_os = "fuchsia")]
1392 fn signal_peer(
1393 &self,
1394 clear_mask: zx::Signals,
1395 set_mask: zx::Signals,
1396 ) -> Result<(), zx_status::Status> {
1397 use fidl::Peered;
1398 self.inner.channel().signal_peer(clear_mask, set_mask)
1399 }
1400}
1401
1402impl ComponentRunnerControlHandle {}
1403
1404#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1405pub struct TaskProviderMarker;
1406
1407impl fidl::endpoints::ProtocolMarker for TaskProviderMarker {
1408 type Proxy = TaskProviderProxy;
1409 type RequestStream = TaskProviderRequestStream;
1410 #[cfg(target_os = "fuchsia")]
1411 type SynchronousProxy = TaskProviderSynchronousProxy;
1412
1413 const DEBUG_NAME: &'static str = "fuchsia.component.runner.TaskProvider";
1414}
1415impl fidl::endpoints::DiscoverableProtocolMarker for TaskProviderMarker {}
1416pub type TaskProviderGetJobResult = Result<fidl::Job, i32>;
1417
1418pub trait TaskProviderProxyInterface: Send + Sync {
1419 type GetJobResponseFut: std::future::Future<Output = Result<TaskProviderGetJobResult, fidl::Error>>
1420 + Send;
1421 fn r#get_job(&self) -> Self::GetJobResponseFut;
1422}
1423#[derive(Debug)]
1424#[cfg(target_os = "fuchsia")]
1425pub struct TaskProviderSynchronousProxy {
1426 client: fidl::client::sync::Client,
1427}
1428
1429#[cfg(target_os = "fuchsia")]
1430impl fidl::endpoints::SynchronousProxy for TaskProviderSynchronousProxy {
1431 type Proxy = TaskProviderProxy;
1432 type Protocol = TaskProviderMarker;
1433
1434 fn from_channel(inner: fidl::Channel) -> Self {
1435 Self::new(inner)
1436 }
1437
1438 fn into_channel(self) -> fidl::Channel {
1439 self.client.into_channel()
1440 }
1441
1442 fn as_channel(&self) -> &fidl::Channel {
1443 self.client.as_channel()
1444 }
1445}
1446
1447#[cfg(target_os = "fuchsia")]
1448impl TaskProviderSynchronousProxy {
1449 pub fn new(channel: fidl::Channel) -> Self {
1450 Self { client: fidl::client::sync::Client::new(channel) }
1451 }
1452
1453 pub fn into_channel(self) -> fidl::Channel {
1454 self.client.into_channel()
1455 }
1456
1457 pub fn wait_for_event(
1460 &self,
1461 deadline: zx::MonotonicInstant,
1462 ) -> Result<TaskProviderEvent, fidl::Error> {
1463 TaskProviderEvent::decode(self.client.wait_for_event::<TaskProviderMarker>(deadline)?)
1464 }
1465
1466 pub fn r#get_job(
1470 &self,
1471 ___deadline: zx::MonotonicInstant,
1472 ) -> Result<TaskProviderGetJobResult, fidl::Error> {
1473 let _response = self.client.send_query::<
1474 fidl::encoding::EmptyPayload,
1475 fidl::encoding::ResultType<TaskProviderGetJobResponse, i32>,
1476 TaskProviderMarker,
1477 >(
1478 (),
1479 0x4c9ca4f4fdece3ad,
1480 fidl::encoding::DynamicFlags::empty(),
1481 ___deadline,
1482 )?;
1483 Ok(_response.map(|x| x.job))
1484 }
1485}
1486
1487#[cfg(target_os = "fuchsia")]
1488impl From<TaskProviderSynchronousProxy> for zx::NullableHandle {
1489 fn from(value: TaskProviderSynchronousProxy) -> Self {
1490 value.into_channel().into()
1491 }
1492}
1493
1494#[cfg(target_os = "fuchsia")]
1495impl From<fidl::Channel> for TaskProviderSynchronousProxy {
1496 fn from(value: fidl::Channel) -> Self {
1497 Self::new(value)
1498 }
1499}
1500
1501#[cfg(target_os = "fuchsia")]
1502impl fidl::endpoints::FromClient for TaskProviderSynchronousProxy {
1503 type Protocol = TaskProviderMarker;
1504
1505 fn from_client(value: fidl::endpoints::ClientEnd<TaskProviderMarker>) -> Self {
1506 Self::new(value.into_channel())
1507 }
1508}
1509
1510#[derive(Debug, Clone)]
1511pub struct TaskProviderProxy {
1512 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1513}
1514
1515impl fidl::endpoints::Proxy for TaskProviderProxy {
1516 type Protocol = TaskProviderMarker;
1517
1518 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1519 Self::new(inner)
1520 }
1521
1522 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1523 self.client.into_channel().map_err(|client| Self { client })
1524 }
1525
1526 fn as_channel(&self) -> &::fidl::AsyncChannel {
1527 self.client.as_channel()
1528 }
1529}
1530
1531impl TaskProviderProxy {
1532 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1534 let protocol_name = <TaskProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1535 Self { client: fidl::client::Client::new(channel, protocol_name) }
1536 }
1537
1538 pub fn take_event_stream(&self) -> TaskProviderEventStream {
1544 TaskProviderEventStream { event_receiver: self.client.take_event_receiver() }
1545 }
1546
1547 pub fn r#get_job(
1551 &self,
1552 ) -> fidl::client::QueryResponseFut<
1553 TaskProviderGetJobResult,
1554 fidl::encoding::DefaultFuchsiaResourceDialect,
1555 > {
1556 TaskProviderProxyInterface::r#get_job(self)
1557 }
1558}
1559
1560impl TaskProviderProxyInterface for TaskProviderProxy {
1561 type GetJobResponseFut = fidl::client::QueryResponseFut<
1562 TaskProviderGetJobResult,
1563 fidl::encoding::DefaultFuchsiaResourceDialect,
1564 >;
1565 fn r#get_job(&self) -> Self::GetJobResponseFut {
1566 fn _decode(
1567 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1568 ) -> Result<TaskProviderGetJobResult, fidl::Error> {
1569 let _response = fidl::client::decode_transaction_body::<
1570 fidl::encoding::ResultType<TaskProviderGetJobResponse, i32>,
1571 fidl::encoding::DefaultFuchsiaResourceDialect,
1572 0x4c9ca4f4fdece3ad,
1573 >(_buf?)?;
1574 Ok(_response.map(|x| x.job))
1575 }
1576 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, TaskProviderGetJobResult>(
1577 (),
1578 0x4c9ca4f4fdece3ad,
1579 fidl::encoding::DynamicFlags::empty(),
1580 _decode,
1581 )
1582 }
1583}
1584
1585pub struct TaskProviderEventStream {
1586 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1587}
1588
1589impl std::marker::Unpin for TaskProviderEventStream {}
1590
1591impl futures::stream::FusedStream for TaskProviderEventStream {
1592 fn is_terminated(&self) -> bool {
1593 self.event_receiver.is_terminated()
1594 }
1595}
1596
1597impl futures::Stream for TaskProviderEventStream {
1598 type Item = Result<TaskProviderEvent, fidl::Error>;
1599
1600 fn poll_next(
1601 mut self: std::pin::Pin<&mut Self>,
1602 cx: &mut std::task::Context<'_>,
1603 ) -> std::task::Poll<Option<Self::Item>> {
1604 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1605 &mut self.event_receiver,
1606 cx
1607 )?) {
1608 Some(buf) => std::task::Poll::Ready(Some(TaskProviderEvent::decode(buf))),
1609 None => std::task::Poll::Ready(None),
1610 }
1611 }
1612}
1613
1614#[derive(Debug)]
1615pub enum TaskProviderEvent {
1616 #[non_exhaustive]
1617 _UnknownEvent {
1618 ordinal: u64,
1620 },
1621}
1622
1623impl TaskProviderEvent {
1624 fn decode(
1626 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1627 ) -> Result<TaskProviderEvent, fidl::Error> {
1628 let (bytes, _handles) = buf.split_mut();
1629 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1630 debug_assert_eq!(tx_header.tx_id, 0);
1631 match tx_header.ordinal {
1632 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1633 Ok(TaskProviderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1634 }
1635 _ => Err(fidl::Error::UnknownOrdinal {
1636 ordinal: tx_header.ordinal,
1637 protocol_name: <TaskProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1638 }),
1639 }
1640 }
1641}
1642
1643pub struct TaskProviderRequestStream {
1645 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1646 is_terminated: bool,
1647}
1648
1649impl std::marker::Unpin for TaskProviderRequestStream {}
1650
1651impl futures::stream::FusedStream for TaskProviderRequestStream {
1652 fn is_terminated(&self) -> bool {
1653 self.is_terminated
1654 }
1655}
1656
1657impl fidl::endpoints::RequestStream for TaskProviderRequestStream {
1658 type Protocol = TaskProviderMarker;
1659 type ControlHandle = TaskProviderControlHandle;
1660
1661 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1662 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1663 }
1664
1665 fn control_handle(&self) -> Self::ControlHandle {
1666 TaskProviderControlHandle { inner: self.inner.clone() }
1667 }
1668
1669 fn into_inner(
1670 self,
1671 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1672 {
1673 (self.inner, self.is_terminated)
1674 }
1675
1676 fn from_inner(
1677 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1678 is_terminated: bool,
1679 ) -> Self {
1680 Self { inner, is_terminated }
1681 }
1682}
1683
1684impl futures::Stream for TaskProviderRequestStream {
1685 type Item = Result<TaskProviderRequest, fidl::Error>;
1686
1687 fn poll_next(
1688 mut self: std::pin::Pin<&mut Self>,
1689 cx: &mut std::task::Context<'_>,
1690 ) -> std::task::Poll<Option<Self::Item>> {
1691 let this = &mut *self;
1692 if this.inner.check_shutdown(cx) {
1693 this.is_terminated = true;
1694 return std::task::Poll::Ready(None);
1695 }
1696 if this.is_terminated {
1697 panic!("polled TaskProviderRequestStream after completion");
1698 }
1699 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1700 |bytes, handles| {
1701 match this.inner.channel().read_etc(cx, bytes, handles) {
1702 std::task::Poll::Ready(Ok(())) => {}
1703 std::task::Poll::Pending => return std::task::Poll::Pending,
1704 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1705 this.is_terminated = true;
1706 return std::task::Poll::Ready(None);
1707 }
1708 std::task::Poll::Ready(Err(e)) => {
1709 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1710 e.into(),
1711 ))));
1712 }
1713 }
1714
1715 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1717
1718 std::task::Poll::Ready(Some(match header.ordinal {
1719 0x4c9ca4f4fdece3ad => {
1720 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1721 let mut req = fidl::new_empty!(
1722 fidl::encoding::EmptyPayload,
1723 fidl::encoding::DefaultFuchsiaResourceDialect
1724 );
1725 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1726 let control_handle =
1727 TaskProviderControlHandle { inner: this.inner.clone() };
1728 Ok(TaskProviderRequest::GetJob {
1729 responder: TaskProviderGetJobResponder {
1730 control_handle: std::mem::ManuallyDrop::new(control_handle),
1731 tx_id: header.tx_id,
1732 },
1733 })
1734 }
1735 _ if header.tx_id == 0
1736 && header
1737 .dynamic_flags()
1738 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1739 {
1740 Ok(TaskProviderRequest::_UnknownMethod {
1741 ordinal: header.ordinal,
1742 control_handle: TaskProviderControlHandle { inner: this.inner.clone() },
1743 method_type: fidl::MethodType::OneWay,
1744 })
1745 }
1746 _ if header
1747 .dynamic_flags()
1748 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1749 {
1750 this.inner.send_framework_err(
1751 fidl::encoding::FrameworkErr::UnknownMethod,
1752 header.tx_id,
1753 header.ordinal,
1754 header.dynamic_flags(),
1755 (bytes, handles),
1756 )?;
1757 Ok(TaskProviderRequest::_UnknownMethod {
1758 ordinal: header.ordinal,
1759 control_handle: TaskProviderControlHandle { inner: this.inner.clone() },
1760 method_type: fidl::MethodType::TwoWay,
1761 })
1762 }
1763 _ => Err(fidl::Error::UnknownOrdinal {
1764 ordinal: header.ordinal,
1765 protocol_name:
1766 <TaskProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1767 }),
1768 }))
1769 },
1770 )
1771 }
1772}
1773
1774#[derive(Debug)]
1776pub enum TaskProviderRequest {
1777 GetJob { responder: TaskProviderGetJobResponder },
1781 #[non_exhaustive]
1783 _UnknownMethod {
1784 ordinal: u64,
1786 control_handle: TaskProviderControlHandle,
1787 method_type: fidl::MethodType,
1788 },
1789}
1790
1791impl TaskProviderRequest {
1792 #[allow(irrefutable_let_patterns)]
1793 pub fn into_get_job(self) -> Option<(TaskProviderGetJobResponder)> {
1794 if let TaskProviderRequest::GetJob { responder } = self { Some((responder)) } else { None }
1795 }
1796
1797 pub fn method_name(&self) -> &'static str {
1799 match *self {
1800 TaskProviderRequest::GetJob { .. } => "get_job",
1801 TaskProviderRequest::_UnknownMethod {
1802 method_type: fidl::MethodType::OneWay, ..
1803 } => "unknown one-way method",
1804 TaskProviderRequest::_UnknownMethod {
1805 method_type: fidl::MethodType::TwoWay, ..
1806 } => "unknown two-way method",
1807 }
1808 }
1809}
1810
1811#[derive(Debug, Clone)]
1812pub struct TaskProviderControlHandle {
1813 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1814}
1815
1816impl fidl::endpoints::ControlHandle for TaskProviderControlHandle {
1817 fn shutdown(&self) {
1818 self.inner.shutdown()
1819 }
1820
1821 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1822 self.inner.shutdown_with_epitaph(status)
1823 }
1824
1825 fn is_closed(&self) -> bool {
1826 self.inner.channel().is_closed()
1827 }
1828 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1829 self.inner.channel().on_closed()
1830 }
1831
1832 #[cfg(target_os = "fuchsia")]
1833 fn signal_peer(
1834 &self,
1835 clear_mask: zx::Signals,
1836 set_mask: zx::Signals,
1837 ) -> Result<(), zx_status::Status> {
1838 use fidl::Peered;
1839 self.inner.channel().signal_peer(clear_mask, set_mask)
1840 }
1841}
1842
1843impl TaskProviderControlHandle {}
1844
1845#[must_use = "FIDL methods require a response to be sent"]
1846#[derive(Debug)]
1847pub struct TaskProviderGetJobResponder {
1848 control_handle: std::mem::ManuallyDrop<TaskProviderControlHandle>,
1849 tx_id: u32,
1850}
1851
1852impl std::ops::Drop for TaskProviderGetJobResponder {
1856 fn drop(&mut self) {
1857 self.control_handle.shutdown();
1858 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1860 }
1861}
1862
1863impl fidl::endpoints::Responder for TaskProviderGetJobResponder {
1864 type ControlHandle = TaskProviderControlHandle;
1865
1866 fn control_handle(&self) -> &TaskProviderControlHandle {
1867 &self.control_handle
1868 }
1869
1870 fn drop_without_shutdown(mut self) {
1871 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1873 std::mem::forget(self);
1875 }
1876}
1877
1878impl TaskProviderGetJobResponder {
1879 pub fn send(self, mut result: Result<fidl::Job, i32>) -> Result<(), fidl::Error> {
1883 let _result = self.send_raw(result);
1884 if _result.is_err() {
1885 self.control_handle.shutdown();
1886 }
1887 self.drop_without_shutdown();
1888 _result
1889 }
1890
1891 pub fn send_no_shutdown_on_err(
1893 self,
1894 mut result: Result<fidl::Job, i32>,
1895 ) -> Result<(), fidl::Error> {
1896 let _result = self.send_raw(result);
1897 self.drop_without_shutdown();
1898 _result
1899 }
1900
1901 fn send_raw(&self, mut result: Result<fidl::Job, i32>) -> Result<(), fidl::Error> {
1902 self.control_handle
1903 .inner
1904 .send::<fidl::encoding::ResultType<TaskProviderGetJobResponse, i32>>(
1905 result.map(|job| (job,)),
1906 self.tx_id,
1907 0x4c9ca4f4fdece3ad,
1908 fidl::encoding::DynamicFlags::empty(),
1909 )
1910 }
1911}
1912
1913mod internal {
1914 use super::*;
1915
1916 impl fidl::encoding::ResourceTypeMarker for ComponentControllerOnPublishDiagnosticsRequest {
1917 type Borrowed<'a> = &'a mut Self;
1918 fn take_or_borrow<'a>(
1919 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1920 ) -> Self::Borrowed<'a> {
1921 value
1922 }
1923 }
1924
1925 unsafe impl fidl::encoding::TypeMarker for ComponentControllerOnPublishDiagnosticsRequest {
1926 type Owned = Self;
1927
1928 #[inline(always)]
1929 fn inline_align(_context: fidl::encoding::Context) -> usize {
1930 8
1931 }
1932
1933 #[inline(always)]
1934 fn inline_size(_context: fidl::encoding::Context) -> usize {
1935 16
1936 }
1937 }
1938
1939 unsafe impl
1940 fidl::encoding::Encode<
1941 ComponentControllerOnPublishDiagnosticsRequest,
1942 fidl::encoding::DefaultFuchsiaResourceDialect,
1943 > for &mut ComponentControllerOnPublishDiagnosticsRequest
1944 {
1945 #[inline]
1946 unsafe fn encode(
1947 self,
1948 encoder: &mut fidl::encoding::Encoder<
1949 '_,
1950 fidl::encoding::DefaultFuchsiaResourceDialect,
1951 >,
1952 offset: usize,
1953 _depth: fidl::encoding::Depth,
1954 ) -> fidl::Result<()> {
1955 encoder.debug_check_bounds::<ComponentControllerOnPublishDiagnosticsRequest>(offset);
1956 fidl::encoding::Encode::<
1958 ComponentControllerOnPublishDiagnosticsRequest,
1959 fidl::encoding::DefaultFuchsiaResourceDialect,
1960 >::encode(
1961 (<ComponentDiagnostics as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1962 &mut self.payload,
1963 ),),
1964 encoder,
1965 offset,
1966 _depth,
1967 )
1968 }
1969 }
1970 unsafe impl<
1971 T0: fidl::encoding::Encode<ComponentDiagnostics, fidl::encoding::DefaultFuchsiaResourceDialect>,
1972 >
1973 fidl::encoding::Encode<
1974 ComponentControllerOnPublishDiagnosticsRequest,
1975 fidl::encoding::DefaultFuchsiaResourceDialect,
1976 > for (T0,)
1977 {
1978 #[inline]
1979 unsafe fn encode(
1980 self,
1981 encoder: &mut fidl::encoding::Encoder<
1982 '_,
1983 fidl::encoding::DefaultFuchsiaResourceDialect,
1984 >,
1985 offset: usize,
1986 depth: fidl::encoding::Depth,
1987 ) -> fidl::Result<()> {
1988 encoder.debug_check_bounds::<ComponentControllerOnPublishDiagnosticsRequest>(offset);
1989 self.0.encode(encoder, offset + 0, depth)?;
1993 Ok(())
1994 }
1995 }
1996
1997 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1998 for ComponentControllerOnPublishDiagnosticsRequest
1999 {
2000 #[inline(always)]
2001 fn new_empty() -> Self {
2002 Self {
2003 payload: fidl::new_empty!(
2004 ComponentDiagnostics,
2005 fidl::encoding::DefaultFuchsiaResourceDialect
2006 ),
2007 }
2008 }
2009
2010 #[inline]
2011 unsafe fn decode(
2012 &mut self,
2013 decoder: &mut fidl::encoding::Decoder<
2014 '_,
2015 fidl::encoding::DefaultFuchsiaResourceDialect,
2016 >,
2017 offset: usize,
2018 _depth: fidl::encoding::Depth,
2019 ) -> fidl::Result<()> {
2020 decoder.debug_check_bounds::<Self>(offset);
2021 fidl::decode!(
2023 ComponentDiagnostics,
2024 fidl::encoding::DefaultFuchsiaResourceDialect,
2025 &mut self.payload,
2026 decoder,
2027 offset + 0,
2028 _depth
2029 )?;
2030 Ok(())
2031 }
2032 }
2033
2034 impl fidl::encoding::ResourceTypeMarker for ComponentRunnerStartRequest {
2035 type Borrowed<'a> = &'a mut Self;
2036 fn take_or_borrow<'a>(
2037 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2038 ) -> Self::Borrowed<'a> {
2039 value
2040 }
2041 }
2042
2043 unsafe impl fidl::encoding::TypeMarker for ComponentRunnerStartRequest {
2044 type Owned = Self;
2045
2046 #[inline(always)]
2047 fn inline_align(_context: fidl::encoding::Context) -> usize {
2048 8
2049 }
2050
2051 #[inline(always)]
2052 fn inline_size(_context: fidl::encoding::Context) -> usize {
2053 24
2054 }
2055 }
2056
2057 unsafe impl
2058 fidl::encoding::Encode<
2059 ComponentRunnerStartRequest,
2060 fidl::encoding::DefaultFuchsiaResourceDialect,
2061 > for &mut ComponentRunnerStartRequest
2062 {
2063 #[inline]
2064 unsafe fn encode(
2065 self,
2066 encoder: &mut fidl::encoding::Encoder<
2067 '_,
2068 fidl::encoding::DefaultFuchsiaResourceDialect,
2069 >,
2070 offset: usize,
2071 _depth: fidl::encoding::Depth,
2072 ) -> fidl::Result<()> {
2073 encoder.debug_check_bounds::<ComponentRunnerStartRequest>(offset);
2074 fidl::encoding::Encode::<ComponentRunnerStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2076 (
2077 <ComponentStartInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.start_info),
2078 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
2079 ),
2080 encoder, offset, _depth
2081 )
2082 }
2083 }
2084 unsafe impl<
2085 T0: fidl::encoding::Encode<ComponentStartInfo, fidl::encoding::DefaultFuchsiaResourceDialect>,
2086 T1: fidl::encoding::Encode<
2087 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
2088 fidl::encoding::DefaultFuchsiaResourceDialect,
2089 >,
2090 >
2091 fidl::encoding::Encode<
2092 ComponentRunnerStartRequest,
2093 fidl::encoding::DefaultFuchsiaResourceDialect,
2094 > for (T0, T1)
2095 {
2096 #[inline]
2097 unsafe fn encode(
2098 self,
2099 encoder: &mut fidl::encoding::Encoder<
2100 '_,
2101 fidl::encoding::DefaultFuchsiaResourceDialect,
2102 >,
2103 offset: usize,
2104 depth: fidl::encoding::Depth,
2105 ) -> fidl::Result<()> {
2106 encoder.debug_check_bounds::<ComponentRunnerStartRequest>(offset);
2107 unsafe {
2110 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2111 (ptr as *mut u64).write_unaligned(0);
2112 }
2113 self.0.encode(encoder, offset + 0, depth)?;
2115 self.1.encode(encoder, offset + 16, depth)?;
2116 Ok(())
2117 }
2118 }
2119
2120 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2121 for ComponentRunnerStartRequest
2122 {
2123 #[inline(always)]
2124 fn new_empty() -> Self {
2125 Self {
2126 start_info: fidl::new_empty!(
2127 ComponentStartInfo,
2128 fidl::encoding::DefaultFuchsiaResourceDialect
2129 ),
2130 controller: fidl::new_empty!(
2131 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
2132 fidl::encoding::DefaultFuchsiaResourceDialect
2133 ),
2134 }
2135 }
2136
2137 #[inline]
2138 unsafe fn decode(
2139 &mut self,
2140 decoder: &mut fidl::encoding::Decoder<
2141 '_,
2142 fidl::encoding::DefaultFuchsiaResourceDialect,
2143 >,
2144 offset: usize,
2145 _depth: fidl::encoding::Depth,
2146 ) -> fidl::Result<()> {
2147 decoder.debug_check_bounds::<Self>(offset);
2148 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2150 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2151 let mask = 0xffffffff00000000u64;
2152 let maskedval = padval & mask;
2153 if maskedval != 0 {
2154 return Err(fidl::Error::NonZeroPadding {
2155 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2156 });
2157 }
2158 fidl::decode!(
2159 ComponentStartInfo,
2160 fidl::encoding::DefaultFuchsiaResourceDialect,
2161 &mut self.start_info,
2162 decoder,
2163 offset + 0,
2164 _depth
2165 )?;
2166 fidl::decode!(
2167 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
2168 fidl::encoding::DefaultFuchsiaResourceDialect,
2169 &mut self.controller,
2170 decoder,
2171 offset + 16,
2172 _depth
2173 )?;
2174 Ok(())
2175 }
2176 }
2177
2178 impl fidl::encoding::ResourceTypeMarker for TaskProviderGetJobResponse {
2179 type Borrowed<'a> = &'a mut Self;
2180 fn take_or_borrow<'a>(
2181 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2182 ) -> Self::Borrowed<'a> {
2183 value
2184 }
2185 }
2186
2187 unsafe impl fidl::encoding::TypeMarker for TaskProviderGetJobResponse {
2188 type Owned = Self;
2189
2190 #[inline(always)]
2191 fn inline_align(_context: fidl::encoding::Context) -> usize {
2192 4
2193 }
2194
2195 #[inline(always)]
2196 fn inline_size(_context: fidl::encoding::Context) -> usize {
2197 4
2198 }
2199 }
2200
2201 unsafe impl
2202 fidl::encoding::Encode<
2203 TaskProviderGetJobResponse,
2204 fidl::encoding::DefaultFuchsiaResourceDialect,
2205 > for &mut TaskProviderGetJobResponse
2206 {
2207 #[inline]
2208 unsafe fn encode(
2209 self,
2210 encoder: &mut fidl::encoding::Encoder<
2211 '_,
2212 fidl::encoding::DefaultFuchsiaResourceDialect,
2213 >,
2214 offset: usize,
2215 _depth: fidl::encoding::Depth,
2216 ) -> fidl::Result<()> {
2217 encoder.debug_check_bounds::<TaskProviderGetJobResponse>(offset);
2218 fidl::encoding::Encode::<
2220 TaskProviderGetJobResponse,
2221 fidl::encoding::DefaultFuchsiaResourceDialect,
2222 >::encode(
2223 (<fidl::encoding::HandleType<
2224 fidl::Job,
2225 { fidl::ObjectType::JOB.into_raw() },
2226 2147483648,
2227 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2228 &mut self.job
2229 ),),
2230 encoder,
2231 offset,
2232 _depth,
2233 )
2234 }
2235 }
2236 unsafe impl<
2237 T0: fidl::encoding::Encode<
2238 fidl::encoding::HandleType<
2239 fidl::Job,
2240 { fidl::ObjectType::JOB.into_raw() },
2241 2147483648,
2242 >,
2243 fidl::encoding::DefaultFuchsiaResourceDialect,
2244 >,
2245 >
2246 fidl::encoding::Encode<
2247 TaskProviderGetJobResponse,
2248 fidl::encoding::DefaultFuchsiaResourceDialect,
2249 > for (T0,)
2250 {
2251 #[inline]
2252 unsafe fn encode(
2253 self,
2254 encoder: &mut fidl::encoding::Encoder<
2255 '_,
2256 fidl::encoding::DefaultFuchsiaResourceDialect,
2257 >,
2258 offset: usize,
2259 depth: fidl::encoding::Depth,
2260 ) -> fidl::Result<()> {
2261 encoder.debug_check_bounds::<TaskProviderGetJobResponse>(offset);
2262 self.0.encode(encoder, offset + 0, depth)?;
2266 Ok(())
2267 }
2268 }
2269
2270 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2271 for TaskProviderGetJobResponse
2272 {
2273 #[inline(always)]
2274 fn new_empty() -> Self {
2275 Self {
2276 job: fidl::new_empty!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2277 }
2278 }
2279
2280 #[inline]
2281 unsafe fn decode(
2282 &mut self,
2283 decoder: &mut fidl::encoding::Decoder<
2284 '_,
2285 fidl::encoding::DefaultFuchsiaResourceDialect,
2286 >,
2287 offset: usize,
2288 _depth: fidl::encoding::Depth,
2289 ) -> fidl::Result<()> {
2290 decoder.debug_check_bounds::<Self>(offset);
2291 fidl::decode!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.job, decoder, offset + 0, _depth)?;
2293 Ok(())
2294 }
2295 }
2296
2297 impl ComponentControllerOnEscrowRequest {
2298 #[inline(always)]
2299 fn max_ordinal_present(&self) -> u64 {
2300 if let Some(_) = self.recoverable_bytes {
2301 return 4;
2302 }
2303 if let Some(_) = self.escrowed_dictionary_handle {
2304 return 3;
2305 }
2306 if let Some(_) = self.escrowed_dictionary {
2307 return 2;
2308 }
2309 if let Some(_) = self.outgoing_dir {
2310 return 1;
2311 }
2312 0
2313 }
2314 }
2315
2316 impl fidl::encoding::ResourceTypeMarker for ComponentControllerOnEscrowRequest {
2317 type Borrowed<'a> = &'a mut Self;
2318 fn take_or_borrow<'a>(
2319 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2320 ) -> Self::Borrowed<'a> {
2321 value
2322 }
2323 }
2324
2325 unsafe impl fidl::encoding::TypeMarker for ComponentControllerOnEscrowRequest {
2326 type Owned = Self;
2327
2328 #[inline(always)]
2329 fn inline_align(_context: fidl::encoding::Context) -> usize {
2330 8
2331 }
2332
2333 #[inline(always)]
2334 fn inline_size(_context: fidl::encoding::Context) -> usize {
2335 16
2336 }
2337 }
2338
2339 unsafe impl
2340 fidl::encoding::Encode<
2341 ComponentControllerOnEscrowRequest,
2342 fidl::encoding::DefaultFuchsiaResourceDialect,
2343 > for &mut ComponentControllerOnEscrowRequest
2344 {
2345 unsafe fn encode(
2346 self,
2347 encoder: &mut fidl::encoding::Encoder<
2348 '_,
2349 fidl::encoding::DefaultFuchsiaResourceDialect,
2350 >,
2351 offset: usize,
2352 mut depth: fidl::encoding::Depth,
2353 ) -> fidl::Result<()> {
2354 encoder.debug_check_bounds::<ComponentControllerOnEscrowRequest>(offset);
2355 let max_ordinal: u64 = self.max_ordinal_present();
2357 encoder.write_num(max_ordinal, offset);
2358 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2359 if max_ordinal == 0 {
2361 return Ok(());
2362 }
2363 depth.increment()?;
2364 let envelope_size = 8;
2365 let bytes_len = max_ordinal as usize * envelope_size;
2366 #[allow(unused_variables)]
2367 let offset = encoder.out_of_line_offset(bytes_len);
2368 let mut _prev_end_offset: usize = 0;
2369 if 1 > max_ordinal {
2370 return Ok(());
2371 }
2372
2373 let cur_offset: usize = (1 - 1) * envelope_size;
2376
2377 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2379
2380 fidl::encoding::encode_in_envelope_optional::<
2385 fidl::encoding::Endpoint<
2386 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2387 >,
2388 fidl::encoding::DefaultFuchsiaResourceDialect,
2389 >(
2390 self.outgoing_dir.as_mut().map(
2391 <fidl::encoding::Endpoint<
2392 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2393 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2394 ),
2395 encoder,
2396 offset + cur_offset,
2397 depth,
2398 )?;
2399
2400 _prev_end_offset = cur_offset + envelope_size;
2401 if 2 > max_ordinal {
2402 return Ok(());
2403 }
2404
2405 let cur_offset: usize = (2 - 1) * envelope_size;
2408
2409 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2411
2412 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
2417 self.escrowed_dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
2418 encoder, offset + cur_offset, depth
2419 )?;
2420
2421 _prev_end_offset = cur_offset + envelope_size;
2422 if 3 > max_ordinal {
2423 return Ok(());
2424 }
2425
2426 let cur_offset: usize = (3 - 1) * envelope_size;
2429
2430 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2432
2433 fidl::encoding::encode_in_envelope_optional::<
2438 fidl::encoding::HandleType<
2439 fidl::EventPair,
2440 { fidl::ObjectType::EVENTPAIR.into_raw() },
2441 2147483648,
2442 >,
2443 fidl::encoding::DefaultFuchsiaResourceDialect,
2444 >(
2445 self.escrowed_dictionary_handle.as_mut().map(
2446 <fidl::encoding::HandleType<
2447 fidl::EventPair,
2448 { fidl::ObjectType::EVENTPAIR.into_raw() },
2449 2147483648,
2450 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2451 ),
2452 encoder,
2453 offset + cur_offset,
2454 depth,
2455 )?;
2456
2457 _prev_end_offset = cur_offset + envelope_size;
2458 if 4 > max_ordinal {
2459 return Ok(());
2460 }
2461
2462 let cur_offset: usize = (4 - 1) * envelope_size;
2465
2466 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2468
2469 fidl::encoding::encode_in_envelope_optional::<
2474 u64,
2475 fidl::encoding::DefaultFuchsiaResourceDialect,
2476 >(
2477 self.recoverable_bytes
2478 .as_ref()
2479 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2480 encoder,
2481 offset + cur_offset,
2482 depth,
2483 )?;
2484
2485 _prev_end_offset = cur_offset + envelope_size;
2486
2487 Ok(())
2488 }
2489 }
2490
2491 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2492 for ComponentControllerOnEscrowRequest
2493 {
2494 #[inline(always)]
2495 fn new_empty() -> Self {
2496 Self::default()
2497 }
2498
2499 unsafe fn decode(
2500 &mut self,
2501 decoder: &mut fidl::encoding::Decoder<
2502 '_,
2503 fidl::encoding::DefaultFuchsiaResourceDialect,
2504 >,
2505 offset: usize,
2506 mut depth: fidl::encoding::Depth,
2507 ) -> fidl::Result<()> {
2508 decoder.debug_check_bounds::<Self>(offset);
2509 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2510 None => return Err(fidl::Error::NotNullable),
2511 Some(len) => len,
2512 };
2513 if len == 0 {
2515 return Ok(());
2516 };
2517 depth.increment()?;
2518 let envelope_size = 8;
2519 let bytes_len = len * envelope_size;
2520 let offset = decoder.out_of_line_offset(bytes_len)?;
2521 let mut _next_ordinal_to_read = 0;
2523 let mut next_offset = offset;
2524 let end_offset = offset + bytes_len;
2525 _next_ordinal_to_read += 1;
2526 if next_offset >= end_offset {
2527 return Ok(());
2528 }
2529
2530 while _next_ordinal_to_read < 1 {
2532 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2533 _next_ordinal_to_read += 1;
2534 next_offset += envelope_size;
2535 }
2536
2537 let next_out_of_line = decoder.next_out_of_line();
2538 let handles_before = decoder.remaining_handles();
2539 if let Some((inlined, num_bytes, num_handles)) =
2540 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2541 {
2542 let member_inline_size = <fidl::encoding::Endpoint<
2543 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2544 > as fidl::encoding::TypeMarker>::inline_size(
2545 decoder.context
2546 );
2547 if inlined != (member_inline_size <= 4) {
2548 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2549 }
2550 let inner_offset;
2551 let mut inner_depth = depth.clone();
2552 if inlined {
2553 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2554 inner_offset = next_offset;
2555 } else {
2556 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2557 inner_depth.increment()?;
2558 }
2559 let val_ref = self.outgoing_dir.get_or_insert_with(|| {
2560 fidl::new_empty!(
2561 fidl::encoding::Endpoint<
2562 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2563 >,
2564 fidl::encoding::DefaultFuchsiaResourceDialect
2565 )
2566 });
2567 fidl::decode!(
2568 fidl::encoding::Endpoint<
2569 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2570 >,
2571 fidl::encoding::DefaultFuchsiaResourceDialect,
2572 val_ref,
2573 decoder,
2574 inner_offset,
2575 inner_depth
2576 )?;
2577 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2578 {
2579 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2580 }
2581 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2582 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2583 }
2584 }
2585
2586 next_offset += envelope_size;
2587 _next_ordinal_to_read += 1;
2588 if next_offset >= end_offset {
2589 return Ok(());
2590 }
2591
2592 while _next_ordinal_to_read < 2 {
2594 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2595 _next_ordinal_to_read += 1;
2596 next_offset += envelope_size;
2597 }
2598
2599 let next_out_of_line = decoder.next_out_of_line();
2600 let handles_before = decoder.remaining_handles();
2601 if let Some((inlined, num_bytes, num_handles)) =
2602 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2603 {
2604 let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2605 if inlined != (member_inline_size <= 4) {
2606 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2607 }
2608 let inner_offset;
2609 let mut inner_depth = depth.clone();
2610 if inlined {
2611 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2612 inner_offset = next_offset;
2613 } else {
2614 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2615 inner_depth.increment()?;
2616 }
2617 let val_ref = self.escrowed_dictionary.get_or_insert_with(|| {
2618 fidl::new_empty!(
2619 fidl_fuchsia_component_sandbox::DictionaryRef,
2620 fidl::encoding::DefaultFuchsiaResourceDialect
2621 )
2622 });
2623 fidl::decode!(
2624 fidl_fuchsia_component_sandbox::DictionaryRef,
2625 fidl::encoding::DefaultFuchsiaResourceDialect,
2626 val_ref,
2627 decoder,
2628 inner_offset,
2629 inner_depth
2630 )?;
2631 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2632 {
2633 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2634 }
2635 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2636 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2637 }
2638 }
2639
2640 next_offset += envelope_size;
2641 _next_ordinal_to_read += 1;
2642 if next_offset >= end_offset {
2643 return Ok(());
2644 }
2645
2646 while _next_ordinal_to_read < 3 {
2648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2649 _next_ordinal_to_read += 1;
2650 next_offset += envelope_size;
2651 }
2652
2653 let next_out_of_line = decoder.next_out_of_line();
2654 let handles_before = decoder.remaining_handles();
2655 if let Some((inlined, num_bytes, num_handles)) =
2656 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2657 {
2658 let member_inline_size = <fidl::encoding::HandleType<
2659 fidl::EventPair,
2660 { fidl::ObjectType::EVENTPAIR.into_raw() },
2661 2147483648,
2662 > as fidl::encoding::TypeMarker>::inline_size(
2663 decoder.context
2664 );
2665 if inlined != (member_inline_size <= 4) {
2666 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2667 }
2668 let inner_offset;
2669 let mut inner_depth = depth.clone();
2670 if inlined {
2671 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2672 inner_offset = next_offset;
2673 } else {
2674 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2675 inner_depth.increment()?;
2676 }
2677 let val_ref =
2678 self.escrowed_dictionary_handle.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
2679 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
2680 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2681 {
2682 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2683 }
2684 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2685 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2686 }
2687 }
2688
2689 next_offset += envelope_size;
2690 _next_ordinal_to_read += 1;
2691 if next_offset >= end_offset {
2692 return Ok(());
2693 }
2694
2695 while _next_ordinal_to_read < 4 {
2697 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2698 _next_ordinal_to_read += 1;
2699 next_offset += envelope_size;
2700 }
2701
2702 let next_out_of_line = decoder.next_out_of_line();
2703 let handles_before = decoder.remaining_handles();
2704 if let Some((inlined, num_bytes, num_handles)) =
2705 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2706 {
2707 let member_inline_size =
2708 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2709 if inlined != (member_inline_size <= 4) {
2710 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2711 }
2712 let inner_offset;
2713 let mut inner_depth = depth.clone();
2714 if inlined {
2715 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2716 inner_offset = next_offset;
2717 } else {
2718 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2719 inner_depth.increment()?;
2720 }
2721 let val_ref = self.recoverable_bytes.get_or_insert_with(|| {
2722 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
2723 });
2724 fidl::decode!(
2725 u64,
2726 fidl::encoding::DefaultFuchsiaResourceDialect,
2727 val_ref,
2728 decoder,
2729 inner_offset,
2730 inner_depth
2731 )?;
2732 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2733 {
2734 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2735 }
2736 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2737 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2738 }
2739 }
2740
2741 next_offset += envelope_size;
2742
2743 while next_offset < end_offset {
2745 _next_ordinal_to_read += 1;
2746 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2747 next_offset += envelope_size;
2748 }
2749
2750 Ok(())
2751 }
2752 }
2753
2754 impl ComponentDiagnostics {
2755 #[inline(always)]
2756 fn max_ordinal_present(&self) -> u64 {
2757 if let Some(_) = self.tasks {
2758 return 1;
2759 }
2760 0
2761 }
2762 }
2763
2764 impl fidl::encoding::ResourceTypeMarker for ComponentDiagnostics {
2765 type Borrowed<'a> = &'a mut Self;
2766 fn take_or_borrow<'a>(
2767 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2768 ) -> Self::Borrowed<'a> {
2769 value
2770 }
2771 }
2772
2773 unsafe impl fidl::encoding::TypeMarker for ComponentDiagnostics {
2774 type Owned = Self;
2775
2776 #[inline(always)]
2777 fn inline_align(_context: fidl::encoding::Context) -> usize {
2778 8
2779 }
2780
2781 #[inline(always)]
2782 fn inline_size(_context: fidl::encoding::Context) -> usize {
2783 16
2784 }
2785 }
2786
2787 unsafe impl
2788 fidl::encoding::Encode<ComponentDiagnostics, fidl::encoding::DefaultFuchsiaResourceDialect>
2789 for &mut ComponentDiagnostics
2790 {
2791 unsafe fn encode(
2792 self,
2793 encoder: &mut fidl::encoding::Encoder<
2794 '_,
2795 fidl::encoding::DefaultFuchsiaResourceDialect,
2796 >,
2797 offset: usize,
2798 mut depth: fidl::encoding::Depth,
2799 ) -> fidl::Result<()> {
2800 encoder.debug_check_bounds::<ComponentDiagnostics>(offset);
2801 let max_ordinal: u64 = self.max_ordinal_present();
2803 encoder.write_num(max_ordinal, offset);
2804 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2805 if max_ordinal == 0 {
2807 return Ok(());
2808 }
2809 depth.increment()?;
2810 let envelope_size = 8;
2811 let bytes_len = max_ordinal as usize * envelope_size;
2812 #[allow(unused_variables)]
2813 let offset = encoder.out_of_line_offset(bytes_len);
2814 let mut _prev_end_offset: usize = 0;
2815 if 1 > max_ordinal {
2816 return Ok(());
2817 }
2818
2819 let cur_offset: usize = (1 - 1) * envelope_size;
2822
2823 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2825
2826 fidl::encoding::encode_in_envelope_optional::<
2831 ComponentTasks,
2832 fidl::encoding::DefaultFuchsiaResourceDialect,
2833 >(
2834 self.tasks
2835 .as_mut()
2836 .map(<ComponentTasks as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
2837 encoder,
2838 offset + cur_offset,
2839 depth,
2840 )?;
2841
2842 _prev_end_offset = cur_offset + envelope_size;
2843
2844 Ok(())
2845 }
2846 }
2847
2848 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2849 for ComponentDiagnostics
2850 {
2851 #[inline(always)]
2852 fn new_empty() -> Self {
2853 Self::default()
2854 }
2855
2856 unsafe fn decode(
2857 &mut self,
2858 decoder: &mut fidl::encoding::Decoder<
2859 '_,
2860 fidl::encoding::DefaultFuchsiaResourceDialect,
2861 >,
2862 offset: usize,
2863 mut depth: fidl::encoding::Depth,
2864 ) -> fidl::Result<()> {
2865 decoder.debug_check_bounds::<Self>(offset);
2866 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2867 None => return Err(fidl::Error::NotNullable),
2868 Some(len) => len,
2869 };
2870 if len == 0 {
2872 return Ok(());
2873 };
2874 depth.increment()?;
2875 let envelope_size = 8;
2876 let bytes_len = len * envelope_size;
2877 let offset = decoder.out_of_line_offset(bytes_len)?;
2878 let mut _next_ordinal_to_read = 0;
2880 let mut next_offset = offset;
2881 let end_offset = offset + bytes_len;
2882 _next_ordinal_to_read += 1;
2883 if next_offset >= end_offset {
2884 return Ok(());
2885 }
2886
2887 while _next_ordinal_to_read < 1 {
2889 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2890 _next_ordinal_to_read += 1;
2891 next_offset += envelope_size;
2892 }
2893
2894 let next_out_of_line = decoder.next_out_of_line();
2895 let handles_before = decoder.remaining_handles();
2896 if let Some((inlined, num_bytes, num_handles)) =
2897 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2898 {
2899 let member_inline_size =
2900 <ComponentTasks as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2901 if inlined != (member_inline_size <= 4) {
2902 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2903 }
2904 let inner_offset;
2905 let mut inner_depth = depth.clone();
2906 if inlined {
2907 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2908 inner_offset = next_offset;
2909 } else {
2910 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2911 inner_depth.increment()?;
2912 }
2913 let val_ref = self.tasks.get_or_insert_with(|| {
2914 fidl::new_empty!(ComponentTasks, fidl::encoding::DefaultFuchsiaResourceDialect)
2915 });
2916 fidl::decode!(
2917 ComponentTasks,
2918 fidl::encoding::DefaultFuchsiaResourceDialect,
2919 val_ref,
2920 decoder,
2921 inner_offset,
2922 inner_depth
2923 )?;
2924 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2925 {
2926 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2927 }
2928 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2929 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2930 }
2931 }
2932
2933 next_offset += envelope_size;
2934
2935 while next_offset < end_offset {
2937 _next_ordinal_to_read += 1;
2938 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2939 next_offset += envelope_size;
2940 }
2941
2942 Ok(())
2943 }
2944 }
2945
2946 impl ComponentNamespaceEntry {
2947 #[inline(always)]
2948 fn max_ordinal_present(&self) -> u64 {
2949 if let Some(_) = self.directory {
2950 return 2;
2951 }
2952 if let Some(_) = self.path {
2953 return 1;
2954 }
2955 0
2956 }
2957 }
2958
2959 impl fidl::encoding::ResourceTypeMarker for ComponentNamespaceEntry {
2960 type Borrowed<'a> = &'a mut Self;
2961 fn take_or_borrow<'a>(
2962 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2963 ) -> Self::Borrowed<'a> {
2964 value
2965 }
2966 }
2967
2968 unsafe impl fidl::encoding::TypeMarker for ComponentNamespaceEntry {
2969 type Owned = Self;
2970
2971 #[inline(always)]
2972 fn inline_align(_context: fidl::encoding::Context) -> usize {
2973 8
2974 }
2975
2976 #[inline(always)]
2977 fn inline_size(_context: fidl::encoding::Context) -> usize {
2978 16
2979 }
2980 }
2981
2982 unsafe impl
2983 fidl::encoding::Encode<
2984 ComponentNamespaceEntry,
2985 fidl::encoding::DefaultFuchsiaResourceDialect,
2986 > for &mut ComponentNamespaceEntry
2987 {
2988 unsafe fn encode(
2989 self,
2990 encoder: &mut fidl::encoding::Encoder<
2991 '_,
2992 fidl::encoding::DefaultFuchsiaResourceDialect,
2993 >,
2994 offset: usize,
2995 mut depth: fidl::encoding::Depth,
2996 ) -> fidl::Result<()> {
2997 encoder.debug_check_bounds::<ComponentNamespaceEntry>(offset);
2998 let max_ordinal: u64 = self.max_ordinal_present();
3000 encoder.write_num(max_ordinal, offset);
3001 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3002 if max_ordinal == 0 {
3004 return Ok(());
3005 }
3006 depth.increment()?;
3007 let envelope_size = 8;
3008 let bytes_len = max_ordinal as usize * envelope_size;
3009 #[allow(unused_variables)]
3010 let offset = encoder.out_of_line_offset(bytes_len);
3011 let mut _prev_end_offset: usize = 0;
3012 if 1 > max_ordinal {
3013 return Ok(());
3014 }
3015
3016 let cur_offset: usize = (1 - 1) * envelope_size;
3019
3020 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3022
3023 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3028 self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
3029 encoder, offset + cur_offset, depth
3030 )?;
3031
3032 _prev_end_offset = cur_offset + envelope_size;
3033 if 2 > max_ordinal {
3034 return Ok(());
3035 }
3036
3037 let cur_offset: usize = (2 - 1) * envelope_size;
3040
3041 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3043
3044 fidl::encoding::encode_in_envelope_optional::<
3049 fidl::encoding::Endpoint<
3050 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3051 >,
3052 fidl::encoding::DefaultFuchsiaResourceDialect,
3053 >(
3054 self.directory.as_mut().map(
3055 <fidl::encoding::Endpoint<
3056 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3057 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3058 ),
3059 encoder,
3060 offset + cur_offset,
3061 depth,
3062 )?;
3063
3064 _prev_end_offset = cur_offset + envelope_size;
3065
3066 Ok(())
3067 }
3068 }
3069
3070 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3071 for ComponentNamespaceEntry
3072 {
3073 #[inline(always)]
3074 fn new_empty() -> Self {
3075 Self::default()
3076 }
3077
3078 unsafe fn decode(
3079 &mut self,
3080 decoder: &mut fidl::encoding::Decoder<
3081 '_,
3082 fidl::encoding::DefaultFuchsiaResourceDialect,
3083 >,
3084 offset: usize,
3085 mut depth: fidl::encoding::Depth,
3086 ) -> fidl::Result<()> {
3087 decoder.debug_check_bounds::<Self>(offset);
3088 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3089 None => return Err(fidl::Error::NotNullable),
3090 Some(len) => len,
3091 };
3092 if len == 0 {
3094 return Ok(());
3095 };
3096 depth.increment()?;
3097 let envelope_size = 8;
3098 let bytes_len = len * envelope_size;
3099 let offset = decoder.out_of_line_offset(bytes_len)?;
3100 let mut _next_ordinal_to_read = 0;
3102 let mut next_offset = offset;
3103 let end_offset = offset + bytes_len;
3104 _next_ordinal_to_read += 1;
3105 if next_offset >= end_offset {
3106 return Ok(());
3107 }
3108
3109 while _next_ordinal_to_read < 1 {
3111 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3112 _next_ordinal_to_read += 1;
3113 next_offset += envelope_size;
3114 }
3115
3116 let next_out_of_line = decoder.next_out_of_line();
3117 let handles_before = decoder.remaining_handles();
3118 if let Some((inlined, num_bytes, num_handles)) =
3119 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3120 {
3121 let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3122 if inlined != (member_inline_size <= 4) {
3123 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3124 }
3125 let inner_offset;
3126 let mut inner_depth = depth.clone();
3127 if inlined {
3128 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3129 inner_offset = next_offset;
3130 } else {
3131 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3132 inner_depth.increment()?;
3133 }
3134 let val_ref = self.path.get_or_insert_with(|| {
3135 fidl::new_empty!(
3136 fidl::encoding::BoundedString<4095>,
3137 fidl::encoding::DefaultFuchsiaResourceDialect
3138 )
3139 });
3140 fidl::decode!(
3141 fidl::encoding::BoundedString<4095>,
3142 fidl::encoding::DefaultFuchsiaResourceDialect,
3143 val_ref,
3144 decoder,
3145 inner_offset,
3146 inner_depth
3147 )?;
3148 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3149 {
3150 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3151 }
3152 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3153 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3154 }
3155 }
3156
3157 next_offset += envelope_size;
3158 _next_ordinal_to_read += 1;
3159 if next_offset >= end_offset {
3160 return Ok(());
3161 }
3162
3163 while _next_ordinal_to_read < 2 {
3165 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3166 _next_ordinal_to_read += 1;
3167 next_offset += envelope_size;
3168 }
3169
3170 let next_out_of_line = decoder.next_out_of_line();
3171 let handles_before = decoder.remaining_handles();
3172 if let Some((inlined, num_bytes, num_handles)) =
3173 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3174 {
3175 let member_inline_size = <fidl::encoding::Endpoint<
3176 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3177 > as fidl::encoding::TypeMarker>::inline_size(
3178 decoder.context
3179 );
3180 if inlined != (member_inline_size <= 4) {
3181 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3182 }
3183 let inner_offset;
3184 let mut inner_depth = depth.clone();
3185 if inlined {
3186 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3187 inner_offset = next_offset;
3188 } else {
3189 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3190 inner_depth.increment()?;
3191 }
3192 let val_ref = self.directory.get_or_insert_with(|| {
3193 fidl::new_empty!(
3194 fidl::encoding::Endpoint<
3195 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3196 >,
3197 fidl::encoding::DefaultFuchsiaResourceDialect
3198 )
3199 });
3200 fidl::decode!(
3201 fidl::encoding::Endpoint<
3202 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3203 >,
3204 fidl::encoding::DefaultFuchsiaResourceDialect,
3205 val_ref,
3206 decoder,
3207 inner_offset,
3208 inner_depth
3209 )?;
3210 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3211 {
3212 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3213 }
3214 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3215 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3216 }
3217 }
3218
3219 next_offset += envelope_size;
3220
3221 while next_offset < end_offset {
3223 _next_ordinal_to_read += 1;
3224 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3225 next_offset += envelope_size;
3226 }
3227
3228 Ok(())
3229 }
3230 }
3231
3232 impl ComponentStartInfo {
3233 #[inline(always)]
3234 fn max_ordinal_present(&self) -> u64 {
3235 if let Some(_) = self.escrowed_dictionary_handle {
3236 return 11;
3237 }
3238 if let Some(_) = self.escrowed_dictionary {
3239 return 10;
3240 }
3241 if let Some(_) = self.component_instance {
3242 return 9;
3243 }
3244 if let Some(_) = self.break_on_start {
3245 return 8;
3246 }
3247 if let Some(_) = self.encoded_config {
3248 return 7;
3249 }
3250 if let Some(_) = self.numbered_handles {
3251 return 6;
3252 }
3253 if let Some(_) = self.runtime_dir {
3254 return 5;
3255 }
3256 if let Some(_) = self.outgoing_dir {
3257 return 4;
3258 }
3259 if let Some(_) = self.ns {
3260 return 3;
3261 }
3262 if let Some(_) = self.program {
3263 return 2;
3264 }
3265 if let Some(_) = self.resolved_url {
3266 return 1;
3267 }
3268 0
3269 }
3270 }
3271
3272 impl fidl::encoding::ResourceTypeMarker for ComponentStartInfo {
3273 type Borrowed<'a> = &'a mut Self;
3274 fn take_or_borrow<'a>(
3275 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3276 ) -> Self::Borrowed<'a> {
3277 value
3278 }
3279 }
3280
3281 unsafe impl fidl::encoding::TypeMarker for ComponentStartInfo {
3282 type Owned = Self;
3283
3284 #[inline(always)]
3285 fn inline_align(_context: fidl::encoding::Context) -> usize {
3286 8
3287 }
3288
3289 #[inline(always)]
3290 fn inline_size(_context: fidl::encoding::Context) -> usize {
3291 16
3292 }
3293 }
3294
3295 unsafe impl
3296 fidl::encoding::Encode<ComponentStartInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
3297 for &mut ComponentStartInfo
3298 {
3299 unsafe fn encode(
3300 self,
3301 encoder: &mut fidl::encoding::Encoder<
3302 '_,
3303 fidl::encoding::DefaultFuchsiaResourceDialect,
3304 >,
3305 offset: usize,
3306 mut depth: fidl::encoding::Depth,
3307 ) -> fidl::Result<()> {
3308 encoder.debug_check_bounds::<ComponentStartInfo>(offset);
3309 let max_ordinal: u64 = self.max_ordinal_present();
3311 encoder.write_num(max_ordinal, offset);
3312 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3313 if max_ordinal == 0 {
3315 return Ok(());
3316 }
3317 depth.increment()?;
3318 let envelope_size = 8;
3319 let bytes_len = max_ordinal as usize * envelope_size;
3320 #[allow(unused_variables)]
3321 let offset = encoder.out_of_line_offset(bytes_len);
3322 let mut _prev_end_offset: usize = 0;
3323 if 1 > max_ordinal {
3324 return Ok(());
3325 }
3326
3327 let cur_offset: usize = (1 - 1) * envelope_size;
3330
3331 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3333
3334 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3339 self.resolved_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
3340 encoder, offset + cur_offset, depth
3341 )?;
3342
3343 _prev_end_offset = cur_offset + envelope_size;
3344 if 2 > max_ordinal {
3345 return Ok(());
3346 }
3347
3348 let cur_offset: usize = (2 - 1) * envelope_size;
3351
3352 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3354
3355 fidl::encoding::encode_in_envelope_optional::<
3360 fidl_fuchsia_data::Dictionary,
3361 fidl::encoding::DefaultFuchsiaResourceDialect,
3362 >(
3363 self.program.as_ref().map(
3364 <fidl_fuchsia_data::Dictionary as fidl::encoding::ValueTypeMarker>::borrow,
3365 ),
3366 encoder,
3367 offset + cur_offset,
3368 depth,
3369 )?;
3370
3371 _prev_end_offset = cur_offset + envelope_size;
3372 if 3 > max_ordinal {
3373 return Ok(());
3374 }
3375
3376 let cur_offset: usize = (3 - 1) * envelope_size;
3379
3380 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3382
3383 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ComponentNamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3388 self.ns.as_mut().map(<fidl::encoding::Vector<ComponentNamespaceEntry, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
3389 encoder, offset + cur_offset, depth
3390 )?;
3391
3392 _prev_end_offset = cur_offset + envelope_size;
3393 if 4 > max_ordinal {
3394 return Ok(());
3395 }
3396
3397 let cur_offset: usize = (4 - 1) * envelope_size;
3400
3401 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3403
3404 fidl::encoding::encode_in_envelope_optional::<
3409 fidl::encoding::Endpoint<
3410 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3411 >,
3412 fidl::encoding::DefaultFuchsiaResourceDialect,
3413 >(
3414 self.outgoing_dir.as_mut().map(
3415 <fidl::encoding::Endpoint<
3416 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3417 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3418 ),
3419 encoder,
3420 offset + cur_offset,
3421 depth,
3422 )?;
3423
3424 _prev_end_offset = cur_offset + envelope_size;
3425 if 5 > max_ordinal {
3426 return Ok(());
3427 }
3428
3429 let cur_offset: usize = (5 - 1) * envelope_size;
3432
3433 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3435
3436 fidl::encoding::encode_in_envelope_optional::<
3441 fidl::encoding::Endpoint<
3442 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3443 >,
3444 fidl::encoding::DefaultFuchsiaResourceDialect,
3445 >(
3446 self.runtime_dir.as_mut().map(
3447 <fidl::encoding::Endpoint<
3448 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3449 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3450 ),
3451 encoder,
3452 offset + cur_offset,
3453 depth,
3454 )?;
3455
3456 _prev_end_offset = cur_offset + envelope_size;
3457 if 6 > max_ordinal {
3458 return Ok(());
3459 }
3460
3461 let cur_offset: usize = (6 - 1) * envelope_size;
3464
3465 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3467
3468 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3473 self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
3474 encoder, offset + cur_offset, depth
3475 )?;
3476
3477 _prev_end_offset = cur_offset + envelope_size;
3478 if 7 > max_ordinal {
3479 return Ok(());
3480 }
3481
3482 let cur_offset: usize = (7 - 1) * envelope_size;
3485
3486 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3488
3489 fidl::encoding::encode_in_envelope_optional::<
3494 fidl_fuchsia_mem::Data,
3495 fidl::encoding::DefaultFuchsiaResourceDialect,
3496 >(
3497 self.encoded_config.as_mut().map(
3498 <fidl_fuchsia_mem::Data as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3499 ),
3500 encoder,
3501 offset + cur_offset,
3502 depth,
3503 )?;
3504
3505 _prev_end_offset = cur_offset + envelope_size;
3506 if 8 > max_ordinal {
3507 return Ok(());
3508 }
3509
3510 let cur_offset: usize = (8 - 1) * envelope_size;
3513
3514 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3516
3517 fidl::encoding::encode_in_envelope_optional::<
3522 fidl::encoding::HandleType<
3523 fidl::EventPair,
3524 { fidl::ObjectType::EVENTPAIR.into_raw() },
3525 2147483648,
3526 >,
3527 fidl::encoding::DefaultFuchsiaResourceDialect,
3528 >(
3529 self.break_on_start.as_mut().map(
3530 <fidl::encoding::HandleType<
3531 fidl::EventPair,
3532 { fidl::ObjectType::EVENTPAIR.into_raw() },
3533 2147483648,
3534 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3535 ),
3536 encoder,
3537 offset + cur_offset,
3538 depth,
3539 )?;
3540
3541 _prev_end_offset = cur_offset + envelope_size;
3542 if 9 > max_ordinal {
3543 return Ok(());
3544 }
3545
3546 let cur_offset: usize = (9 - 1) * envelope_size;
3549
3550 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3552
3553 fidl::encoding::encode_in_envelope_optional::<
3558 fidl::encoding::HandleType<
3559 fidl::Event,
3560 { fidl::ObjectType::EVENT.into_raw() },
3561 2147483648,
3562 >,
3563 fidl::encoding::DefaultFuchsiaResourceDialect,
3564 >(
3565 self.component_instance.as_mut().map(
3566 <fidl::encoding::HandleType<
3567 fidl::Event,
3568 { fidl::ObjectType::EVENT.into_raw() },
3569 2147483648,
3570 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3571 ),
3572 encoder,
3573 offset + cur_offset,
3574 depth,
3575 )?;
3576
3577 _prev_end_offset = cur_offset + envelope_size;
3578 if 10 > max_ordinal {
3579 return Ok(());
3580 }
3581
3582 let cur_offset: usize = (10 - 1) * envelope_size;
3585
3586 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3588
3589 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
3594 self.escrowed_dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
3595 encoder, offset + cur_offset, depth
3596 )?;
3597
3598 _prev_end_offset = cur_offset + envelope_size;
3599 if 11 > max_ordinal {
3600 return Ok(());
3601 }
3602
3603 let cur_offset: usize = (11 - 1) * envelope_size;
3606
3607 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3609
3610 fidl::encoding::encode_in_envelope_optional::<
3615 fidl::encoding::HandleType<
3616 fidl::EventPair,
3617 { fidl::ObjectType::EVENTPAIR.into_raw() },
3618 2147483648,
3619 >,
3620 fidl::encoding::DefaultFuchsiaResourceDialect,
3621 >(
3622 self.escrowed_dictionary_handle.as_mut().map(
3623 <fidl::encoding::HandleType<
3624 fidl::EventPair,
3625 { fidl::ObjectType::EVENTPAIR.into_raw() },
3626 2147483648,
3627 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3628 ),
3629 encoder,
3630 offset + cur_offset,
3631 depth,
3632 )?;
3633
3634 _prev_end_offset = cur_offset + envelope_size;
3635
3636 Ok(())
3637 }
3638 }
3639
3640 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3641 for ComponentStartInfo
3642 {
3643 #[inline(always)]
3644 fn new_empty() -> Self {
3645 Self::default()
3646 }
3647
3648 unsafe fn decode(
3649 &mut self,
3650 decoder: &mut fidl::encoding::Decoder<
3651 '_,
3652 fidl::encoding::DefaultFuchsiaResourceDialect,
3653 >,
3654 offset: usize,
3655 mut depth: fidl::encoding::Depth,
3656 ) -> fidl::Result<()> {
3657 decoder.debug_check_bounds::<Self>(offset);
3658 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3659 None => return Err(fidl::Error::NotNullable),
3660 Some(len) => len,
3661 };
3662 if len == 0 {
3664 return Ok(());
3665 };
3666 depth.increment()?;
3667 let envelope_size = 8;
3668 let bytes_len = len * envelope_size;
3669 let offset = decoder.out_of_line_offset(bytes_len)?;
3670 let mut _next_ordinal_to_read = 0;
3672 let mut next_offset = offset;
3673 let end_offset = offset + bytes_len;
3674 _next_ordinal_to_read += 1;
3675 if next_offset >= end_offset {
3676 return Ok(());
3677 }
3678
3679 while _next_ordinal_to_read < 1 {
3681 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3682 _next_ordinal_to_read += 1;
3683 next_offset += envelope_size;
3684 }
3685
3686 let next_out_of_line = decoder.next_out_of_line();
3687 let handles_before = decoder.remaining_handles();
3688 if let Some((inlined, num_bytes, num_handles)) =
3689 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3690 {
3691 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3692 if inlined != (member_inline_size <= 4) {
3693 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3694 }
3695 let inner_offset;
3696 let mut inner_depth = depth.clone();
3697 if inlined {
3698 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3699 inner_offset = next_offset;
3700 } else {
3701 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3702 inner_depth.increment()?;
3703 }
3704 let val_ref = self.resolved_url.get_or_insert_with(|| {
3705 fidl::new_empty!(
3706 fidl::encoding::BoundedString<4096>,
3707 fidl::encoding::DefaultFuchsiaResourceDialect
3708 )
3709 });
3710 fidl::decode!(
3711 fidl::encoding::BoundedString<4096>,
3712 fidl::encoding::DefaultFuchsiaResourceDialect,
3713 val_ref,
3714 decoder,
3715 inner_offset,
3716 inner_depth
3717 )?;
3718 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3719 {
3720 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3721 }
3722 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3723 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3724 }
3725 }
3726
3727 next_offset += envelope_size;
3728 _next_ordinal_to_read += 1;
3729 if next_offset >= end_offset {
3730 return Ok(());
3731 }
3732
3733 while _next_ordinal_to_read < 2 {
3735 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3736 _next_ordinal_to_read += 1;
3737 next_offset += envelope_size;
3738 }
3739
3740 let next_out_of_line = decoder.next_out_of_line();
3741 let handles_before = decoder.remaining_handles();
3742 if let Some((inlined, num_bytes, num_handles)) =
3743 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3744 {
3745 let member_inline_size =
3746 <fidl_fuchsia_data::Dictionary as fidl::encoding::TypeMarker>::inline_size(
3747 decoder.context,
3748 );
3749 if inlined != (member_inline_size <= 4) {
3750 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3751 }
3752 let inner_offset;
3753 let mut inner_depth = depth.clone();
3754 if inlined {
3755 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3756 inner_offset = next_offset;
3757 } else {
3758 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3759 inner_depth.increment()?;
3760 }
3761 let val_ref = self.program.get_or_insert_with(|| {
3762 fidl::new_empty!(
3763 fidl_fuchsia_data::Dictionary,
3764 fidl::encoding::DefaultFuchsiaResourceDialect
3765 )
3766 });
3767 fidl::decode!(
3768 fidl_fuchsia_data::Dictionary,
3769 fidl::encoding::DefaultFuchsiaResourceDialect,
3770 val_ref,
3771 decoder,
3772 inner_offset,
3773 inner_depth
3774 )?;
3775 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3776 {
3777 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3778 }
3779 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3780 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3781 }
3782 }
3783
3784 next_offset += envelope_size;
3785 _next_ordinal_to_read += 1;
3786 if next_offset >= end_offset {
3787 return Ok(());
3788 }
3789
3790 while _next_ordinal_to_read < 3 {
3792 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3793 _next_ordinal_to_read += 1;
3794 next_offset += envelope_size;
3795 }
3796
3797 let next_out_of_line = decoder.next_out_of_line();
3798 let handles_before = decoder.remaining_handles();
3799 if let Some((inlined, num_bytes, num_handles)) =
3800 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3801 {
3802 let member_inline_size = <fidl::encoding::Vector<ComponentNamespaceEntry, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3803 if inlined != (member_inline_size <= 4) {
3804 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3805 }
3806 let inner_offset;
3807 let mut inner_depth = depth.clone();
3808 if inlined {
3809 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3810 inner_offset = next_offset;
3811 } else {
3812 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3813 inner_depth.increment()?;
3814 }
3815 let val_ref =
3816 self.ns.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<ComponentNamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
3817 fidl::decode!(fidl::encoding::Vector<ComponentNamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3818 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3819 {
3820 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3821 }
3822 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3823 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3824 }
3825 }
3826
3827 next_offset += envelope_size;
3828 _next_ordinal_to_read += 1;
3829 if next_offset >= end_offset {
3830 return Ok(());
3831 }
3832
3833 while _next_ordinal_to_read < 4 {
3835 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3836 _next_ordinal_to_read += 1;
3837 next_offset += envelope_size;
3838 }
3839
3840 let next_out_of_line = decoder.next_out_of_line();
3841 let handles_before = decoder.remaining_handles();
3842 if let Some((inlined, num_bytes, num_handles)) =
3843 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3844 {
3845 let member_inline_size = <fidl::encoding::Endpoint<
3846 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3847 > as fidl::encoding::TypeMarker>::inline_size(
3848 decoder.context
3849 );
3850 if inlined != (member_inline_size <= 4) {
3851 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3852 }
3853 let inner_offset;
3854 let mut inner_depth = depth.clone();
3855 if inlined {
3856 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3857 inner_offset = next_offset;
3858 } else {
3859 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3860 inner_depth.increment()?;
3861 }
3862 let val_ref = self.outgoing_dir.get_or_insert_with(|| {
3863 fidl::new_empty!(
3864 fidl::encoding::Endpoint<
3865 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3866 >,
3867 fidl::encoding::DefaultFuchsiaResourceDialect
3868 )
3869 });
3870 fidl::decode!(
3871 fidl::encoding::Endpoint<
3872 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3873 >,
3874 fidl::encoding::DefaultFuchsiaResourceDialect,
3875 val_ref,
3876 decoder,
3877 inner_offset,
3878 inner_depth
3879 )?;
3880 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3881 {
3882 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3883 }
3884 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3885 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3886 }
3887 }
3888
3889 next_offset += envelope_size;
3890 _next_ordinal_to_read += 1;
3891 if next_offset >= end_offset {
3892 return Ok(());
3893 }
3894
3895 while _next_ordinal_to_read < 5 {
3897 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3898 _next_ordinal_to_read += 1;
3899 next_offset += envelope_size;
3900 }
3901
3902 let next_out_of_line = decoder.next_out_of_line();
3903 let handles_before = decoder.remaining_handles();
3904 if let Some((inlined, num_bytes, num_handles)) =
3905 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3906 {
3907 let member_inline_size = <fidl::encoding::Endpoint<
3908 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3909 > as fidl::encoding::TypeMarker>::inline_size(
3910 decoder.context
3911 );
3912 if inlined != (member_inline_size <= 4) {
3913 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3914 }
3915 let inner_offset;
3916 let mut inner_depth = depth.clone();
3917 if inlined {
3918 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3919 inner_offset = next_offset;
3920 } else {
3921 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3922 inner_depth.increment()?;
3923 }
3924 let val_ref = self.runtime_dir.get_or_insert_with(|| {
3925 fidl::new_empty!(
3926 fidl::encoding::Endpoint<
3927 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3928 >,
3929 fidl::encoding::DefaultFuchsiaResourceDialect
3930 )
3931 });
3932 fidl::decode!(
3933 fidl::encoding::Endpoint<
3934 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3935 >,
3936 fidl::encoding::DefaultFuchsiaResourceDialect,
3937 val_ref,
3938 decoder,
3939 inner_offset,
3940 inner_depth
3941 )?;
3942 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3943 {
3944 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3945 }
3946 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3947 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3948 }
3949 }
3950
3951 next_offset += envelope_size;
3952 _next_ordinal_to_read += 1;
3953 if next_offset >= end_offset {
3954 return Ok(());
3955 }
3956
3957 while _next_ordinal_to_read < 6 {
3959 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3960 _next_ordinal_to_read += 1;
3961 next_offset += envelope_size;
3962 }
3963
3964 let next_out_of_line = decoder.next_out_of_line();
3965 let handles_before = decoder.remaining_handles();
3966 if let Some((inlined, num_bytes, num_handles)) =
3967 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3968 {
3969 let member_inline_size = <fidl::encoding::Vector<
3970 fidl_fuchsia_process::HandleInfo,
3971 128,
3972 > as fidl::encoding::TypeMarker>::inline_size(
3973 decoder.context
3974 );
3975 if inlined != (member_inline_size <= 4) {
3976 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3977 }
3978 let inner_offset;
3979 let mut inner_depth = depth.clone();
3980 if inlined {
3981 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3982 inner_offset = next_offset;
3983 } else {
3984 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3985 inner_depth.increment()?;
3986 }
3987 let val_ref =
3988 self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
3989 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3990 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3991 {
3992 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3993 }
3994 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3995 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3996 }
3997 }
3998
3999 next_offset += envelope_size;
4000 _next_ordinal_to_read += 1;
4001 if next_offset >= end_offset {
4002 return Ok(());
4003 }
4004
4005 while _next_ordinal_to_read < 7 {
4007 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4008 _next_ordinal_to_read += 1;
4009 next_offset += envelope_size;
4010 }
4011
4012 let next_out_of_line = decoder.next_out_of_line();
4013 let handles_before = decoder.remaining_handles();
4014 if let Some((inlined, num_bytes, num_handles)) =
4015 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4016 {
4017 let member_inline_size =
4018 <fidl_fuchsia_mem::Data as fidl::encoding::TypeMarker>::inline_size(
4019 decoder.context,
4020 );
4021 if inlined != (member_inline_size <= 4) {
4022 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4023 }
4024 let inner_offset;
4025 let mut inner_depth = depth.clone();
4026 if inlined {
4027 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4028 inner_offset = next_offset;
4029 } else {
4030 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4031 inner_depth.increment()?;
4032 }
4033 let val_ref = self.encoded_config.get_or_insert_with(|| {
4034 fidl::new_empty!(
4035 fidl_fuchsia_mem::Data,
4036 fidl::encoding::DefaultFuchsiaResourceDialect
4037 )
4038 });
4039 fidl::decode!(
4040 fidl_fuchsia_mem::Data,
4041 fidl::encoding::DefaultFuchsiaResourceDialect,
4042 val_ref,
4043 decoder,
4044 inner_offset,
4045 inner_depth
4046 )?;
4047 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4048 {
4049 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4050 }
4051 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4052 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4053 }
4054 }
4055
4056 next_offset += envelope_size;
4057 _next_ordinal_to_read += 1;
4058 if next_offset >= end_offset {
4059 return Ok(());
4060 }
4061
4062 while _next_ordinal_to_read < 8 {
4064 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4065 _next_ordinal_to_read += 1;
4066 next_offset += envelope_size;
4067 }
4068
4069 let next_out_of_line = decoder.next_out_of_line();
4070 let handles_before = decoder.remaining_handles();
4071 if let Some((inlined, num_bytes, num_handles)) =
4072 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4073 {
4074 let member_inline_size = <fidl::encoding::HandleType<
4075 fidl::EventPair,
4076 { fidl::ObjectType::EVENTPAIR.into_raw() },
4077 2147483648,
4078 > as fidl::encoding::TypeMarker>::inline_size(
4079 decoder.context
4080 );
4081 if inlined != (member_inline_size <= 4) {
4082 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4083 }
4084 let inner_offset;
4085 let mut inner_depth = depth.clone();
4086 if inlined {
4087 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4088 inner_offset = next_offset;
4089 } else {
4090 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4091 inner_depth.increment()?;
4092 }
4093 let val_ref =
4094 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));
4095 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4096 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4097 {
4098 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4099 }
4100 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4101 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4102 }
4103 }
4104
4105 next_offset += envelope_size;
4106 _next_ordinal_to_read += 1;
4107 if next_offset >= end_offset {
4108 return Ok(());
4109 }
4110
4111 while _next_ordinal_to_read < 9 {
4113 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4114 _next_ordinal_to_read += 1;
4115 next_offset += envelope_size;
4116 }
4117
4118 let next_out_of_line = decoder.next_out_of_line();
4119 let handles_before = decoder.remaining_handles();
4120 if let Some((inlined, num_bytes, num_handles)) =
4121 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4122 {
4123 let member_inline_size = <fidl::encoding::HandleType<
4124 fidl::Event,
4125 { fidl::ObjectType::EVENT.into_raw() },
4126 2147483648,
4127 > as fidl::encoding::TypeMarker>::inline_size(
4128 decoder.context
4129 );
4130 if inlined != (member_inline_size <= 4) {
4131 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4132 }
4133 let inner_offset;
4134 let mut inner_depth = depth.clone();
4135 if inlined {
4136 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4137 inner_offset = next_offset;
4138 } else {
4139 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4140 inner_depth.increment()?;
4141 }
4142 let val_ref =
4143 self.component_instance.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
4144 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4145 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4146 {
4147 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4148 }
4149 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4150 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4151 }
4152 }
4153
4154 next_offset += envelope_size;
4155 _next_ordinal_to_read += 1;
4156 if next_offset >= end_offset {
4157 return Ok(());
4158 }
4159
4160 while _next_ordinal_to_read < 10 {
4162 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4163 _next_ordinal_to_read += 1;
4164 next_offset += envelope_size;
4165 }
4166
4167 let next_out_of_line = decoder.next_out_of_line();
4168 let handles_before = decoder.remaining_handles();
4169 if let Some((inlined, num_bytes, num_handles)) =
4170 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4171 {
4172 let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4173 if inlined != (member_inline_size <= 4) {
4174 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4175 }
4176 let inner_offset;
4177 let mut inner_depth = depth.clone();
4178 if inlined {
4179 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4180 inner_offset = next_offset;
4181 } else {
4182 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4183 inner_depth.increment()?;
4184 }
4185 let val_ref = self.escrowed_dictionary.get_or_insert_with(|| {
4186 fidl::new_empty!(
4187 fidl_fuchsia_component_sandbox::DictionaryRef,
4188 fidl::encoding::DefaultFuchsiaResourceDialect
4189 )
4190 });
4191 fidl::decode!(
4192 fidl_fuchsia_component_sandbox::DictionaryRef,
4193 fidl::encoding::DefaultFuchsiaResourceDialect,
4194 val_ref,
4195 decoder,
4196 inner_offset,
4197 inner_depth
4198 )?;
4199 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4200 {
4201 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4202 }
4203 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4204 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4205 }
4206 }
4207
4208 next_offset += envelope_size;
4209 _next_ordinal_to_read += 1;
4210 if next_offset >= end_offset {
4211 return Ok(());
4212 }
4213
4214 while _next_ordinal_to_read < 11 {
4216 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4217 _next_ordinal_to_read += 1;
4218 next_offset += envelope_size;
4219 }
4220
4221 let next_out_of_line = decoder.next_out_of_line();
4222 let handles_before = decoder.remaining_handles();
4223 if let Some((inlined, num_bytes, num_handles)) =
4224 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4225 {
4226 let member_inline_size = <fidl::encoding::HandleType<
4227 fidl::EventPair,
4228 { fidl::ObjectType::EVENTPAIR.into_raw() },
4229 2147483648,
4230 > as fidl::encoding::TypeMarker>::inline_size(
4231 decoder.context
4232 );
4233 if inlined != (member_inline_size <= 4) {
4234 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4235 }
4236 let inner_offset;
4237 let mut inner_depth = depth.clone();
4238 if inlined {
4239 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4240 inner_offset = next_offset;
4241 } else {
4242 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4243 inner_depth.increment()?;
4244 }
4245 let val_ref =
4246 self.escrowed_dictionary_handle.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
4247 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4248 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4249 {
4250 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4251 }
4252 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4253 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4254 }
4255 }
4256
4257 next_offset += envelope_size;
4258
4259 while next_offset < end_offset {
4261 _next_ordinal_to_read += 1;
4262 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4263 next_offset += envelope_size;
4264 }
4265
4266 Ok(())
4267 }
4268 }
4269
4270 impl ComponentStopInfo {
4271 #[inline(always)]
4272 fn max_ordinal_present(&self) -> u64 {
4273 if let Some(_) = self.exit_code {
4274 return 2;
4275 }
4276 if let Some(_) = self.termination_status {
4277 return 1;
4278 }
4279 0
4280 }
4281 }
4282
4283 impl fidl::encoding::ResourceTypeMarker for ComponentStopInfo {
4284 type Borrowed<'a> = &'a mut Self;
4285 fn take_or_borrow<'a>(
4286 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4287 ) -> Self::Borrowed<'a> {
4288 value
4289 }
4290 }
4291
4292 unsafe impl fidl::encoding::TypeMarker for ComponentStopInfo {
4293 type Owned = Self;
4294
4295 #[inline(always)]
4296 fn inline_align(_context: fidl::encoding::Context) -> usize {
4297 8
4298 }
4299
4300 #[inline(always)]
4301 fn inline_size(_context: fidl::encoding::Context) -> usize {
4302 16
4303 }
4304 }
4305
4306 unsafe impl
4307 fidl::encoding::Encode<ComponentStopInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
4308 for &mut ComponentStopInfo
4309 {
4310 unsafe fn encode(
4311 self,
4312 encoder: &mut fidl::encoding::Encoder<
4313 '_,
4314 fidl::encoding::DefaultFuchsiaResourceDialect,
4315 >,
4316 offset: usize,
4317 mut depth: fidl::encoding::Depth,
4318 ) -> fidl::Result<()> {
4319 encoder.debug_check_bounds::<ComponentStopInfo>(offset);
4320 let max_ordinal: u64 = self.max_ordinal_present();
4322 encoder.write_num(max_ordinal, offset);
4323 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4324 if max_ordinal == 0 {
4326 return Ok(());
4327 }
4328 depth.increment()?;
4329 let envelope_size = 8;
4330 let bytes_len = max_ordinal as usize * envelope_size;
4331 #[allow(unused_variables)]
4332 let offset = encoder.out_of_line_offset(bytes_len);
4333 let mut _prev_end_offset: usize = 0;
4334 if 1 > max_ordinal {
4335 return Ok(());
4336 }
4337
4338 let cur_offset: usize = (1 - 1) * envelope_size;
4341
4342 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4344
4345 fidl::encoding::encode_in_envelope_optional::<
4350 i32,
4351 fidl::encoding::DefaultFuchsiaResourceDialect,
4352 >(
4353 self.termination_status
4354 .as_ref()
4355 .map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
4356 encoder,
4357 offset + cur_offset,
4358 depth,
4359 )?;
4360
4361 _prev_end_offset = cur_offset + envelope_size;
4362 if 2 > max_ordinal {
4363 return Ok(());
4364 }
4365
4366 let cur_offset: usize = (2 - 1) * envelope_size;
4369
4370 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4372
4373 fidl::encoding::encode_in_envelope_optional::<
4378 i64,
4379 fidl::encoding::DefaultFuchsiaResourceDialect,
4380 >(
4381 self.exit_code.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
4382 encoder,
4383 offset + cur_offset,
4384 depth,
4385 )?;
4386
4387 _prev_end_offset = cur_offset + envelope_size;
4388
4389 Ok(())
4390 }
4391 }
4392
4393 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4394 for ComponentStopInfo
4395 {
4396 #[inline(always)]
4397 fn new_empty() -> Self {
4398 Self::default()
4399 }
4400
4401 unsafe fn decode(
4402 &mut self,
4403 decoder: &mut fidl::encoding::Decoder<
4404 '_,
4405 fidl::encoding::DefaultFuchsiaResourceDialect,
4406 >,
4407 offset: usize,
4408 mut depth: fidl::encoding::Depth,
4409 ) -> fidl::Result<()> {
4410 decoder.debug_check_bounds::<Self>(offset);
4411 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4412 None => return Err(fidl::Error::NotNullable),
4413 Some(len) => len,
4414 };
4415 if len == 0 {
4417 return Ok(());
4418 };
4419 depth.increment()?;
4420 let envelope_size = 8;
4421 let bytes_len = len * envelope_size;
4422 let offset = decoder.out_of_line_offset(bytes_len)?;
4423 let mut _next_ordinal_to_read = 0;
4425 let mut next_offset = offset;
4426 let end_offset = offset + bytes_len;
4427 _next_ordinal_to_read += 1;
4428 if next_offset >= end_offset {
4429 return Ok(());
4430 }
4431
4432 while _next_ordinal_to_read < 1 {
4434 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4435 _next_ordinal_to_read += 1;
4436 next_offset += envelope_size;
4437 }
4438
4439 let next_out_of_line = decoder.next_out_of_line();
4440 let handles_before = decoder.remaining_handles();
4441 if let Some((inlined, num_bytes, num_handles)) =
4442 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4443 {
4444 let member_inline_size =
4445 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4446 if inlined != (member_inline_size <= 4) {
4447 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4448 }
4449 let inner_offset;
4450 let mut inner_depth = depth.clone();
4451 if inlined {
4452 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4453 inner_offset = next_offset;
4454 } else {
4455 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4456 inner_depth.increment()?;
4457 }
4458 let val_ref = self.termination_status.get_or_insert_with(|| {
4459 fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
4460 });
4461 fidl::decode!(
4462 i32,
4463 fidl::encoding::DefaultFuchsiaResourceDialect,
4464 val_ref,
4465 decoder,
4466 inner_offset,
4467 inner_depth
4468 )?;
4469 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4470 {
4471 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4472 }
4473 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4474 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4475 }
4476 }
4477
4478 next_offset += envelope_size;
4479 _next_ordinal_to_read += 1;
4480 if next_offset >= end_offset {
4481 return Ok(());
4482 }
4483
4484 while _next_ordinal_to_read < 2 {
4486 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4487 _next_ordinal_to_read += 1;
4488 next_offset += envelope_size;
4489 }
4490
4491 let next_out_of_line = decoder.next_out_of_line();
4492 let handles_before = decoder.remaining_handles();
4493 if let Some((inlined, num_bytes, num_handles)) =
4494 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4495 {
4496 let member_inline_size =
4497 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4498 if inlined != (member_inline_size <= 4) {
4499 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4500 }
4501 let inner_offset;
4502 let mut inner_depth = depth.clone();
4503 if inlined {
4504 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4505 inner_offset = next_offset;
4506 } else {
4507 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4508 inner_depth.increment()?;
4509 }
4510 let val_ref = self.exit_code.get_or_insert_with(|| {
4511 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
4512 });
4513 fidl::decode!(
4514 i64,
4515 fidl::encoding::DefaultFuchsiaResourceDialect,
4516 val_ref,
4517 decoder,
4518 inner_offset,
4519 inner_depth
4520 )?;
4521 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4522 {
4523 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4524 }
4525 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4526 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4527 }
4528 }
4529
4530 next_offset += envelope_size;
4531
4532 while next_offset < end_offset {
4534 _next_ordinal_to_read += 1;
4535 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4536 next_offset += envelope_size;
4537 }
4538
4539 Ok(())
4540 }
4541 }
4542
4543 impl ComponentTasks {
4544 #[inline(always)]
4545 fn max_ordinal_present(&self) -> u64 {
4546 if let Some(_) = self.parent_task {
4547 return 2;
4548 }
4549 if let Some(_) = self.component_task {
4550 return 1;
4551 }
4552 0
4553 }
4554 }
4555
4556 impl fidl::encoding::ResourceTypeMarker for ComponentTasks {
4557 type Borrowed<'a> = &'a mut Self;
4558 fn take_or_borrow<'a>(
4559 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4560 ) -> Self::Borrowed<'a> {
4561 value
4562 }
4563 }
4564
4565 unsafe impl fidl::encoding::TypeMarker for ComponentTasks {
4566 type Owned = Self;
4567
4568 #[inline(always)]
4569 fn inline_align(_context: fidl::encoding::Context) -> usize {
4570 8
4571 }
4572
4573 #[inline(always)]
4574 fn inline_size(_context: fidl::encoding::Context) -> usize {
4575 16
4576 }
4577 }
4578
4579 unsafe impl
4580 fidl::encoding::Encode<ComponentTasks, fidl::encoding::DefaultFuchsiaResourceDialect>
4581 for &mut ComponentTasks
4582 {
4583 unsafe fn encode(
4584 self,
4585 encoder: &mut fidl::encoding::Encoder<
4586 '_,
4587 fidl::encoding::DefaultFuchsiaResourceDialect,
4588 >,
4589 offset: usize,
4590 mut depth: fidl::encoding::Depth,
4591 ) -> fidl::Result<()> {
4592 encoder.debug_check_bounds::<ComponentTasks>(offset);
4593 let max_ordinal: u64 = self.max_ordinal_present();
4595 encoder.write_num(max_ordinal, offset);
4596 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4597 if max_ordinal == 0 {
4599 return Ok(());
4600 }
4601 depth.increment()?;
4602 let envelope_size = 8;
4603 let bytes_len = max_ordinal as usize * envelope_size;
4604 #[allow(unused_variables)]
4605 let offset = encoder.out_of_line_offset(bytes_len);
4606 let mut _prev_end_offset: usize = 0;
4607 if 1 > max_ordinal {
4608 return Ok(());
4609 }
4610
4611 let cur_offset: usize = (1 - 1) * envelope_size;
4614
4615 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4617
4618 fidl::encoding::encode_in_envelope_optional::<
4623 Task,
4624 fidl::encoding::DefaultFuchsiaResourceDialect,
4625 >(
4626 self.component_task
4627 .as_mut()
4628 .map(<Task as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4629 encoder,
4630 offset + cur_offset,
4631 depth,
4632 )?;
4633
4634 _prev_end_offset = cur_offset + envelope_size;
4635 if 2 > max_ordinal {
4636 return Ok(());
4637 }
4638
4639 let cur_offset: usize = (2 - 1) * envelope_size;
4642
4643 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4645
4646 fidl::encoding::encode_in_envelope_optional::<
4651 Task,
4652 fidl::encoding::DefaultFuchsiaResourceDialect,
4653 >(
4654 self.parent_task
4655 .as_mut()
4656 .map(<Task as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4657 encoder,
4658 offset + cur_offset,
4659 depth,
4660 )?;
4661
4662 _prev_end_offset = cur_offset + envelope_size;
4663
4664 Ok(())
4665 }
4666 }
4667
4668 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4669 for ComponentTasks
4670 {
4671 #[inline(always)]
4672 fn new_empty() -> Self {
4673 Self::default()
4674 }
4675
4676 unsafe fn decode(
4677 &mut self,
4678 decoder: &mut fidl::encoding::Decoder<
4679 '_,
4680 fidl::encoding::DefaultFuchsiaResourceDialect,
4681 >,
4682 offset: usize,
4683 mut depth: fidl::encoding::Depth,
4684 ) -> fidl::Result<()> {
4685 decoder.debug_check_bounds::<Self>(offset);
4686 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4687 None => return Err(fidl::Error::NotNullable),
4688 Some(len) => len,
4689 };
4690 if len == 0 {
4692 return Ok(());
4693 };
4694 depth.increment()?;
4695 let envelope_size = 8;
4696 let bytes_len = len * envelope_size;
4697 let offset = decoder.out_of_line_offset(bytes_len)?;
4698 let mut _next_ordinal_to_read = 0;
4700 let mut next_offset = offset;
4701 let end_offset = offset + bytes_len;
4702 _next_ordinal_to_read += 1;
4703 if next_offset >= end_offset {
4704 return Ok(());
4705 }
4706
4707 while _next_ordinal_to_read < 1 {
4709 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4710 _next_ordinal_to_read += 1;
4711 next_offset += envelope_size;
4712 }
4713
4714 let next_out_of_line = decoder.next_out_of_line();
4715 let handles_before = decoder.remaining_handles();
4716 if let Some((inlined, num_bytes, num_handles)) =
4717 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4718 {
4719 let member_inline_size =
4720 <Task as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4721 if inlined != (member_inline_size <= 4) {
4722 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4723 }
4724 let inner_offset;
4725 let mut inner_depth = depth.clone();
4726 if inlined {
4727 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4728 inner_offset = next_offset;
4729 } else {
4730 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4731 inner_depth.increment()?;
4732 }
4733 let val_ref = self.component_task.get_or_insert_with(|| {
4734 fidl::new_empty!(Task, fidl::encoding::DefaultFuchsiaResourceDialect)
4735 });
4736 fidl::decode!(
4737 Task,
4738 fidl::encoding::DefaultFuchsiaResourceDialect,
4739 val_ref,
4740 decoder,
4741 inner_offset,
4742 inner_depth
4743 )?;
4744 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4745 {
4746 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4747 }
4748 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4749 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4750 }
4751 }
4752
4753 next_offset += envelope_size;
4754 _next_ordinal_to_read += 1;
4755 if next_offset >= end_offset {
4756 return Ok(());
4757 }
4758
4759 while _next_ordinal_to_read < 2 {
4761 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4762 _next_ordinal_to_read += 1;
4763 next_offset += envelope_size;
4764 }
4765
4766 let next_out_of_line = decoder.next_out_of_line();
4767 let handles_before = decoder.remaining_handles();
4768 if let Some((inlined, num_bytes, num_handles)) =
4769 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4770 {
4771 let member_inline_size =
4772 <Task as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4773 if inlined != (member_inline_size <= 4) {
4774 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4775 }
4776 let inner_offset;
4777 let mut inner_depth = depth.clone();
4778 if inlined {
4779 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4780 inner_offset = next_offset;
4781 } else {
4782 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4783 inner_depth.increment()?;
4784 }
4785 let val_ref = self.parent_task.get_or_insert_with(|| {
4786 fidl::new_empty!(Task, fidl::encoding::DefaultFuchsiaResourceDialect)
4787 });
4788 fidl::decode!(
4789 Task,
4790 fidl::encoding::DefaultFuchsiaResourceDialect,
4791 val_ref,
4792 decoder,
4793 inner_offset,
4794 inner_depth
4795 )?;
4796 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4797 {
4798 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4799 }
4800 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4801 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4802 }
4803 }
4804
4805 next_offset += envelope_size;
4806
4807 while next_offset < end_offset {
4809 _next_ordinal_to_read += 1;
4810 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4811 next_offset += envelope_size;
4812 }
4813
4814 Ok(())
4815 }
4816 }
4817
4818 impl fidl::encoding::ResourceTypeMarker for Task {
4819 type Borrowed<'a> = &'a mut Self;
4820 fn take_or_borrow<'a>(
4821 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4822 ) -> Self::Borrowed<'a> {
4823 value
4824 }
4825 }
4826
4827 unsafe impl fidl::encoding::TypeMarker for Task {
4828 type Owned = Self;
4829
4830 #[inline(always)]
4831 fn inline_align(_context: fidl::encoding::Context) -> usize {
4832 8
4833 }
4834
4835 #[inline(always)]
4836 fn inline_size(_context: fidl::encoding::Context) -> usize {
4837 16
4838 }
4839 }
4840
4841 unsafe impl fidl::encoding::Encode<Task, fidl::encoding::DefaultFuchsiaResourceDialect>
4842 for &mut Task
4843 {
4844 #[inline]
4845 unsafe fn encode(
4846 self,
4847 encoder: &mut fidl::encoding::Encoder<
4848 '_,
4849 fidl::encoding::DefaultFuchsiaResourceDialect,
4850 >,
4851 offset: usize,
4852 _depth: fidl::encoding::Depth,
4853 ) -> fidl::Result<()> {
4854 encoder.debug_check_bounds::<Task>(offset);
4855 encoder.write_num::<u64>(self.ordinal(), offset);
4856 match self {
4857 Task::Job(ref mut val) => fidl::encoding::encode_in_envelope::<
4858 fidl::encoding::HandleType<
4859 fidl::Job,
4860 { fidl::ObjectType::JOB.into_raw() },
4861 2147483648,
4862 >,
4863 fidl::encoding::DefaultFuchsiaResourceDialect,
4864 >(
4865 <fidl::encoding::HandleType<
4866 fidl::Job,
4867 { fidl::ObjectType::JOB.into_raw() },
4868 2147483648,
4869 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4870 val
4871 ),
4872 encoder,
4873 offset + 8,
4874 _depth,
4875 ),
4876 Task::Process(ref mut val) => fidl::encoding::encode_in_envelope::<
4877 fidl::encoding::HandleType<
4878 fidl::Process,
4879 { fidl::ObjectType::PROCESS.into_raw() },
4880 2147483648,
4881 >,
4882 fidl::encoding::DefaultFuchsiaResourceDialect,
4883 >(
4884 <fidl::encoding::HandleType<
4885 fidl::Process,
4886 { fidl::ObjectType::PROCESS.into_raw() },
4887 2147483648,
4888 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4889 val
4890 ),
4891 encoder,
4892 offset + 8,
4893 _depth,
4894 ),
4895 Task::Thread(ref mut val) => fidl::encoding::encode_in_envelope::<
4896 fidl::encoding::HandleType<
4897 fidl::Thread,
4898 { fidl::ObjectType::THREAD.into_raw() },
4899 2147483648,
4900 >,
4901 fidl::encoding::DefaultFuchsiaResourceDialect,
4902 >(
4903 <fidl::encoding::HandleType<
4904 fidl::Thread,
4905 { fidl::ObjectType::THREAD.into_raw() },
4906 2147483648,
4907 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4908 val
4909 ),
4910 encoder,
4911 offset + 8,
4912 _depth,
4913 ),
4914 Task::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
4915 }
4916 }
4917 }
4918
4919 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Task {
4920 #[inline(always)]
4921 fn new_empty() -> Self {
4922 Self::__SourceBreaking { unknown_ordinal: 0 }
4923 }
4924
4925 #[inline]
4926 unsafe fn decode(
4927 &mut self,
4928 decoder: &mut fidl::encoding::Decoder<
4929 '_,
4930 fidl::encoding::DefaultFuchsiaResourceDialect,
4931 >,
4932 offset: usize,
4933 mut depth: fidl::encoding::Depth,
4934 ) -> fidl::Result<()> {
4935 decoder.debug_check_bounds::<Self>(offset);
4936 #[allow(unused_variables)]
4937 let next_out_of_line = decoder.next_out_of_line();
4938 let handles_before = decoder.remaining_handles();
4939 let (ordinal, inlined, num_bytes, num_handles) =
4940 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4941
4942 let member_inline_size = match ordinal {
4943 1 => <fidl::encoding::HandleType<
4944 fidl::Job,
4945 { fidl::ObjectType::JOB.into_raw() },
4946 2147483648,
4947 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4948 2 => <fidl::encoding::HandleType<
4949 fidl::Process,
4950 { fidl::ObjectType::PROCESS.into_raw() },
4951 2147483648,
4952 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4953 3 => <fidl::encoding::HandleType<
4954 fidl::Thread,
4955 { fidl::ObjectType::THREAD.into_raw() },
4956 2147483648,
4957 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4958 0 => return Err(fidl::Error::UnknownUnionTag),
4959 _ => num_bytes as usize,
4960 };
4961
4962 if inlined != (member_inline_size <= 4) {
4963 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4964 }
4965 let _inner_offset;
4966 if inlined {
4967 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4968 _inner_offset = offset + 8;
4969 } else {
4970 depth.increment()?;
4971 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4972 }
4973 match ordinal {
4974 1 => {
4975 #[allow(irrefutable_let_patterns)]
4976 if let Task::Job(_) = self {
4977 } else {
4979 *self = Task::Job(
4981 fidl::new_empty!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4982 );
4983 }
4984 #[allow(irrefutable_let_patterns)]
4985 if let Task::Job(ref mut val) = self {
4986 fidl::decode!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
4987 } else {
4988 unreachable!()
4989 }
4990 }
4991 2 => {
4992 #[allow(irrefutable_let_patterns)]
4993 if let Task::Process(_) = self {
4994 } else {
4996 *self = Task::Process(
4998 fidl::new_empty!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4999 );
5000 }
5001 #[allow(irrefutable_let_patterns)]
5002 if let Task::Process(ref mut val) = self {
5003 fidl::decode!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
5004 } else {
5005 unreachable!()
5006 }
5007 }
5008 3 => {
5009 #[allow(irrefutable_let_patterns)]
5010 if let Task::Thread(_) = self {
5011 } else {
5013 *self = Task::Thread(
5015 fidl::new_empty!(fidl::encoding::HandleType<fidl::Thread, { fidl::ObjectType::THREAD.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5016 );
5017 }
5018 #[allow(irrefutable_let_patterns)]
5019 if let Task::Thread(ref mut val) = self {
5020 fidl::decode!(fidl::encoding::HandleType<fidl::Thread, { fidl::ObjectType::THREAD.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
5021 } else {
5022 unreachable!()
5023 }
5024 }
5025 #[allow(deprecated)]
5026 ordinal => {
5027 for _ in 0..num_handles {
5028 decoder.drop_next_handle()?;
5029 }
5030 *self = Task::__SourceBreaking { unknown_ordinal: ordinal };
5031 }
5032 }
5033 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5034 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5035 }
5036 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5037 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5038 }
5039 Ok(())
5040 }
5041 }
5042}