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 ComponentControllerControlHandle {
876 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
877 self.inner.shutdown_with_epitaph(status.into())
878 }
879}
880
881impl fidl::endpoints::ControlHandle for ComponentControllerControlHandle {
882 fn shutdown(&self) {
883 self.inner.shutdown()
884 }
885
886 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
887 self.inner.shutdown_with_epitaph(status)
888 }
889
890 fn is_closed(&self) -> bool {
891 self.inner.channel().is_closed()
892 }
893 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
894 self.inner.channel().on_closed()
895 }
896
897 #[cfg(target_os = "fuchsia")]
898 fn signal_peer(
899 &self,
900 clear_mask: zx::Signals,
901 set_mask: zx::Signals,
902 ) -> Result<(), zx_status::Status> {
903 use fidl::Peered;
904 self.inner.channel().signal_peer(clear_mask, set_mask)
905 }
906}
907
908impl ComponentControllerControlHandle {
909 pub fn send_on_publish_diagnostics(
910 &self,
911 mut payload: ComponentDiagnostics,
912 ) -> Result<(), fidl::Error> {
913 self.inner.send::<ComponentControllerOnPublishDiagnosticsRequest>(
914 (&mut payload,),
915 0,
916 0x1f16d8c3c49c6947,
917 fidl::encoding::DynamicFlags::empty(),
918 )
919 }
920
921 pub fn send_on_escrow(
922 &self,
923 mut payload: ComponentControllerOnEscrowRequest,
924 ) -> Result<(), fidl::Error> {
925 self.inner.send::<ComponentControllerOnEscrowRequest>(
926 &mut payload,
927 0,
928 0xa231349355343fc,
929 fidl::encoding::DynamicFlags::FLEXIBLE,
930 )
931 }
932
933 pub fn send_on_stop(&self, mut payload: ComponentStopInfo) -> Result<(), fidl::Error> {
934 self.inner.send::<ComponentStopInfo>(
935 &mut payload,
936 0,
937 0x3bfd24b031878ab2,
938 fidl::encoding::DynamicFlags::FLEXIBLE,
939 )
940 }
941}
942
943#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
944pub struct ComponentRunnerMarker;
945
946impl fidl::endpoints::ProtocolMarker for ComponentRunnerMarker {
947 type Proxy = ComponentRunnerProxy;
948 type RequestStream = ComponentRunnerRequestStream;
949 #[cfg(target_os = "fuchsia")]
950 type SynchronousProxy = ComponentRunnerSynchronousProxy;
951
952 const DEBUG_NAME: &'static str = "fuchsia.component.runner.ComponentRunner";
953}
954impl fidl::endpoints::DiscoverableProtocolMarker for ComponentRunnerMarker {}
955
956pub trait ComponentRunnerProxyInterface: Send + Sync {
957 fn r#start(
958 &self,
959 start_info: ComponentStartInfo,
960 controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
961 ) -> Result<(), fidl::Error>;
962}
963#[derive(Debug)]
964#[cfg(target_os = "fuchsia")]
965pub struct ComponentRunnerSynchronousProxy {
966 client: fidl::client::sync::Client,
967}
968
969#[cfg(target_os = "fuchsia")]
970impl fidl::endpoints::SynchronousProxy for ComponentRunnerSynchronousProxy {
971 type Proxy = ComponentRunnerProxy;
972 type Protocol = ComponentRunnerMarker;
973
974 fn from_channel(inner: fidl::Channel) -> Self {
975 Self::new(inner)
976 }
977
978 fn into_channel(self) -> fidl::Channel {
979 self.client.into_channel()
980 }
981
982 fn as_channel(&self) -> &fidl::Channel {
983 self.client.as_channel()
984 }
985}
986
987#[cfg(target_os = "fuchsia")]
988impl ComponentRunnerSynchronousProxy {
989 pub fn new(channel: fidl::Channel) -> Self {
990 Self { client: fidl::client::sync::Client::new(channel) }
991 }
992
993 pub fn into_channel(self) -> fidl::Channel {
994 self.client.into_channel()
995 }
996
997 pub fn wait_for_event(
1000 &self,
1001 deadline: zx::MonotonicInstant,
1002 ) -> Result<ComponentRunnerEvent, fidl::Error> {
1003 ComponentRunnerEvent::decode(self.client.wait_for_event::<ComponentRunnerMarker>(deadline)?)
1004 }
1005
1006 pub fn r#start(
1015 &self,
1016 mut start_info: ComponentStartInfo,
1017 mut controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1018 ) -> Result<(), fidl::Error> {
1019 self.client.send::<ComponentRunnerStartRequest>(
1020 (&mut start_info, controller),
1021 0xad5a8c19f25ee09,
1022 fidl::encoding::DynamicFlags::empty(),
1023 )
1024 }
1025}
1026
1027#[cfg(target_os = "fuchsia")]
1028impl From<ComponentRunnerSynchronousProxy> for zx::NullableHandle {
1029 fn from(value: ComponentRunnerSynchronousProxy) -> Self {
1030 value.into_channel().into()
1031 }
1032}
1033
1034#[cfg(target_os = "fuchsia")]
1035impl From<fidl::Channel> for ComponentRunnerSynchronousProxy {
1036 fn from(value: fidl::Channel) -> Self {
1037 Self::new(value)
1038 }
1039}
1040
1041#[cfg(target_os = "fuchsia")]
1042impl fidl::endpoints::FromClient for ComponentRunnerSynchronousProxy {
1043 type Protocol = ComponentRunnerMarker;
1044
1045 fn from_client(value: fidl::endpoints::ClientEnd<ComponentRunnerMarker>) -> Self {
1046 Self::new(value.into_channel())
1047 }
1048}
1049
1050#[derive(Debug, Clone)]
1051pub struct ComponentRunnerProxy {
1052 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1053}
1054
1055impl fidl::endpoints::Proxy for ComponentRunnerProxy {
1056 type Protocol = ComponentRunnerMarker;
1057
1058 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1059 Self::new(inner)
1060 }
1061
1062 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1063 self.client.into_channel().map_err(|client| Self { client })
1064 }
1065
1066 fn as_channel(&self) -> &::fidl::AsyncChannel {
1067 self.client.as_channel()
1068 }
1069}
1070
1071impl ComponentRunnerProxy {
1072 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1074 let protocol_name = <ComponentRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1075 Self { client: fidl::client::Client::new(channel, protocol_name) }
1076 }
1077
1078 pub fn take_event_stream(&self) -> ComponentRunnerEventStream {
1084 ComponentRunnerEventStream { event_receiver: self.client.take_event_receiver() }
1085 }
1086
1087 pub fn r#start(
1096 &self,
1097 mut start_info: ComponentStartInfo,
1098 mut controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1099 ) -> Result<(), fidl::Error> {
1100 ComponentRunnerProxyInterface::r#start(self, start_info, controller)
1101 }
1102}
1103
1104impl ComponentRunnerProxyInterface for ComponentRunnerProxy {
1105 fn r#start(
1106 &self,
1107 mut start_info: ComponentStartInfo,
1108 mut controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1109 ) -> Result<(), fidl::Error> {
1110 self.client.send::<ComponentRunnerStartRequest>(
1111 (&mut start_info, controller),
1112 0xad5a8c19f25ee09,
1113 fidl::encoding::DynamicFlags::empty(),
1114 )
1115 }
1116}
1117
1118pub struct ComponentRunnerEventStream {
1119 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1120}
1121
1122impl std::marker::Unpin for ComponentRunnerEventStream {}
1123
1124impl futures::stream::FusedStream for ComponentRunnerEventStream {
1125 fn is_terminated(&self) -> bool {
1126 self.event_receiver.is_terminated()
1127 }
1128}
1129
1130impl futures::Stream for ComponentRunnerEventStream {
1131 type Item = Result<ComponentRunnerEvent, fidl::Error>;
1132
1133 fn poll_next(
1134 mut self: std::pin::Pin<&mut Self>,
1135 cx: &mut std::task::Context<'_>,
1136 ) -> std::task::Poll<Option<Self::Item>> {
1137 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1138 &mut self.event_receiver,
1139 cx
1140 )?) {
1141 Some(buf) => std::task::Poll::Ready(Some(ComponentRunnerEvent::decode(buf))),
1142 None => std::task::Poll::Ready(None),
1143 }
1144 }
1145}
1146
1147#[derive(Debug)]
1148pub enum ComponentRunnerEvent {
1149 #[non_exhaustive]
1150 _UnknownEvent {
1151 ordinal: u64,
1153 },
1154}
1155
1156impl ComponentRunnerEvent {
1157 fn decode(
1159 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1160 ) -> Result<ComponentRunnerEvent, fidl::Error> {
1161 let (bytes, _handles) = buf.split_mut();
1162 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1163 debug_assert_eq!(tx_header.tx_id, 0);
1164 match tx_header.ordinal {
1165 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1166 Ok(ComponentRunnerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1167 }
1168 _ => Err(fidl::Error::UnknownOrdinal {
1169 ordinal: tx_header.ordinal,
1170 protocol_name:
1171 <ComponentRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1172 }),
1173 }
1174 }
1175}
1176
1177pub struct ComponentRunnerRequestStream {
1179 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1180 is_terminated: bool,
1181}
1182
1183impl std::marker::Unpin for ComponentRunnerRequestStream {}
1184
1185impl futures::stream::FusedStream for ComponentRunnerRequestStream {
1186 fn is_terminated(&self) -> bool {
1187 self.is_terminated
1188 }
1189}
1190
1191impl fidl::endpoints::RequestStream for ComponentRunnerRequestStream {
1192 type Protocol = ComponentRunnerMarker;
1193 type ControlHandle = ComponentRunnerControlHandle;
1194
1195 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1196 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1197 }
1198
1199 fn control_handle(&self) -> Self::ControlHandle {
1200 ComponentRunnerControlHandle { inner: self.inner.clone() }
1201 }
1202
1203 fn into_inner(
1204 self,
1205 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1206 {
1207 (self.inner, self.is_terminated)
1208 }
1209
1210 fn from_inner(
1211 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1212 is_terminated: bool,
1213 ) -> Self {
1214 Self { inner, is_terminated }
1215 }
1216}
1217
1218impl futures::Stream for ComponentRunnerRequestStream {
1219 type Item = Result<ComponentRunnerRequest, fidl::Error>;
1220
1221 fn poll_next(
1222 mut self: std::pin::Pin<&mut Self>,
1223 cx: &mut std::task::Context<'_>,
1224 ) -> std::task::Poll<Option<Self::Item>> {
1225 let this = &mut *self;
1226 if this.inner.check_shutdown(cx) {
1227 this.is_terminated = true;
1228 return std::task::Poll::Ready(None);
1229 }
1230 if this.is_terminated {
1231 panic!("polled ComponentRunnerRequestStream after completion");
1232 }
1233 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1234 |bytes, handles| {
1235 match this.inner.channel().read_etc(cx, bytes, handles) {
1236 std::task::Poll::Ready(Ok(())) => {}
1237 std::task::Poll::Pending => return std::task::Poll::Pending,
1238 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1239 this.is_terminated = true;
1240 return std::task::Poll::Ready(None);
1241 }
1242 std::task::Poll::Ready(Err(e)) => {
1243 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1244 e.into(),
1245 ))));
1246 }
1247 }
1248
1249 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1251
1252 std::task::Poll::Ready(Some(match header.ordinal {
1253 0xad5a8c19f25ee09 => {
1254 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1255 let mut req = fidl::new_empty!(
1256 ComponentRunnerStartRequest,
1257 fidl::encoding::DefaultFuchsiaResourceDialect
1258 );
1259 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ComponentRunnerStartRequest>(&header, _body_bytes, handles, &mut req)?;
1260 let control_handle =
1261 ComponentRunnerControlHandle { inner: this.inner.clone() };
1262 Ok(ComponentRunnerRequest::Start {
1263 start_info: req.start_info,
1264 controller: req.controller,
1265
1266 control_handle,
1267 })
1268 }
1269 _ if header.tx_id == 0
1270 && header
1271 .dynamic_flags()
1272 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1273 {
1274 Ok(ComponentRunnerRequest::_UnknownMethod {
1275 ordinal: header.ordinal,
1276 control_handle: ComponentRunnerControlHandle {
1277 inner: this.inner.clone(),
1278 },
1279 method_type: fidl::MethodType::OneWay,
1280 })
1281 }
1282 _ if header
1283 .dynamic_flags()
1284 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1285 {
1286 this.inner.send_framework_err(
1287 fidl::encoding::FrameworkErr::UnknownMethod,
1288 header.tx_id,
1289 header.ordinal,
1290 header.dynamic_flags(),
1291 (bytes, handles),
1292 )?;
1293 Ok(ComponentRunnerRequest::_UnknownMethod {
1294 ordinal: header.ordinal,
1295 control_handle: ComponentRunnerControlHandle {
1296 inner: this.inner.clone(),
1297 },
1298 method_type: fidl::MethodType::TwoWay,
1299 })
1300 }
1301 _ => Err(fidl::Error::UnknownOrdinal {
1302 ordinal: header.ordinal,
1303 protocol_name:
1304 <ComponentRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1305 }),
1306 }))
1307 },
1308 )
1309 }
1310}
1311
1312#[derive(Debug)]
1320pub enum ComponentRunnerRequest {
1321 Start {
1330 start_info: ComponentStartInfo,
1331 controller: fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1332 control_handle: ComponentRunnerControlHandle,
1333 },
1334 #[non_exhaustive]
1336 _UnknownMethod {
1337 ordinal: u64,
1339 control_handle: ComponentRunnerControlHandle,
1340 method_type: fidl::MethodType,
1341 },
1342}
1343
1344impl ComponentRunnerRequest {
1345 #[allow(irrefutable_let_patterns)]
1346 pub fn into_start(
1347 self,
1348 ) -> Option<(
1349 ComponentStartInfo,
1350 fidl::endpoints::ServerEnd<ComponentControllerMarker>,
1351 ComponentRunnerControlHandle,
1352 )> {
1353 if let ComponentRunnerRequest::Start { start_info, controller, control_handle } = self {
1354 Some((start_info, controller, control_handle))
1355 } else {
1356 None
1357 }
1358 }
1359
1360 pub fn method_name(&self) -> &'static str {
1362 match *self {
1363 ComponentRunnerRequest::Start { .. } => "start",
1364 ComponentRunnerRequest::_UnknownMethod {
1365 method_type: fidl::MethodType::OneWay,
1366 ..
1367 } => "unknown one-way method",
1368 ComponentRunnerRequest::_UnknownMethod {
1369 method_type: fidl::MethodType::TwoWay,
1370 ..
1371 } => "unknown two-way method",
1372 }
1373 }
1374}
1375
1376#[derive(Debug, Clone)]
1377pub struct ComponentRunnerControlHandle {
1378 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1379}
1380
1381impl ComponentRunnerControlHandle {
1382 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1383 self.inner.shutdown_with_epitaph(status.into())
1384 }
1385}
1386
1387impl fidl::endpoints::ControlHandle for ComponentRunnerControlHandle {
1388 fn shutdown(&self) {
1389 self.inner.shutdown()
1390 }
1391
1392 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1393 self.inner.shutdown_with_epitaph(status)
1394 }
1395
1396 fn is_closed(&self) -> bool {
1397 self.inner.channel().is_closed()
1398 }
1399 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1400 self.inner.channel().on_closed()
1401 }
1402
1403 #[cfg(target_os = "fuchsia")]
1404 fn signal_peer(
1405 &self,
1406 clear_mask: zx::Signals,
1407 set_mask: zx::Signals,
1408 ) -> Result<(), zx_status::Status> {
1409 use fidl::Peered;
1410 self.inner.channel().signal_peer(clear_mask, set_mask)
1411 }
1412}
1413
1414impl ComponentRunnerControlHandle {}
1415
1416#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1417pub struct TaskProviderMarker;
1418
1419impl fidl::endpoints::ProtocolMarker for TaskProviderMarker {
1420 type Proxy = TaskProviderProxy;
1421 type RequestStream = TaskProviderRequestStream;
1422 #[cfg(target_os = "fuchsia")]
1423 type SynchronousProxy = TaskProviderSynchronousProxy;
1424
1425 const DEBUG_NAME: &'static str = "fuchsia.component.runner.TaskProvider";
1426}
1427impl fidl::endpoints::DiscoverableProtocolMarker for TaskProviderMarker {}
1428pub type TaskProviderGetJobResult = Result<fidl::Job, i32>;
1429
1430pub trait TaskProviderProxyInterface: Send + Sync {
1431 type GetJobResponseFut: std::future::Future<Output = Result<TaskProviderGetJobResult, fidl::Error>>
1432 + Send;
1433 fn r#get_job(&self) -> Self::GetJobResponseFut;
1434}
1435#[derive(Debug)]
1436#[cfg(target_os = "fuchsia")]
1437pub struct TaskProviderSynchronousProxy {
1438 client: fidl::client::sync::Client,
1439}
1440
1441#[cfg(target_os = "fuchsia")]
1442impl fidl::endpoints::SynchronousProxy for TaskProviderSynchronousProxy {
1443 type Proxy = TaskProviderProxy;
1444 type Protocol = TaskProviderMarker;
1445
1446 fn from_channel(inner: fidl::Channel) -> Self {
1447 Self::new(inner)
1448 }
1449
1450 fn into_channel(self) -> fidl::Channel {
1451 self.client.into_channel()
1452 }
1453
1454 fn as_channel(&self) -> &fidl::Channel {
1455 self.client.as_channel()
1456 }
1457}
1458
1459#[cfg(target_os = "fuchsia")]
1460impl TaskProviderSynchronousProxy {
1461 pub fn new(channel: fidl::Channel) -> Self {
1462 Self { client: fidl::client::sync::Client::new(channel) }
1463 }
1464
1465 pub fn into_channel(self) -> fidl::Channel {
1466 self.client.into_channel()
1467 }
1468
1469 pub fn wait_for_event(
1472 &self,
1473 deadline: zx::MonotonicInstant,
1474 ) -> Result<TaskProviderEvent, fidl::Error> {
1475 TaskProviderEvent::decode(self.client.wait_for_event::<TaskProviderMarker>(deadline)?)
1476 }
1477
1478 pub fn r#get_job(
1482 &self,
1483 ___deadline: zx::MonotonicInstant,
1484 ) -> Result<TaskProviderGetJobResult, fidl::Error> {
1485 let _response = self.client.send_query::<
1486 fidl::encoding::EmptyPayload,
1487 fidl::encoding::ResultType<TaskProviderGetJobResponse, i32>,
1488 TaskProviderMarker,
1489 >(
1490 (),
1491 0x4c9ca4f4fdece3ad,
1492 fidl::encoding::DynamicFlags::empty(),
1493 ___deadline,
1494 )?;
1495 Ok(_response.map(|x| x.job))
1496 }
1497}
1498
1499#[cfg(target_os = "fuchsia")]
1500impl From<TaskProviderSynchronousProxy> for zx::NullableHandle {
1501 fn from(value: TaskProviderSynchronousProxy) -> Self {
1502 value.into_channel().into()
1503 }
1504}
1505
1506#[cfg(target_os = "fuchsia")]
1507impl From<fidl::Channel> for TaskProviderSynchronousProxy {
1508 fn from(value: fidl::Channel) -> Self {
1509 Self::new(value)
1510 }
1511}
1512
1513#[cfg(target_os = "fuchsia")]
1514impl fidl::endpoints::FromClient for TaskProviderSynchronousProxy {
1515 type Protocol = TaskProviderMarker;
1516
1517 fn from_client(value: fidl::endpoints::ClientEnd<TaskProviderMarker>) -> Self {
1518 Self::new(value.into_channel())
1519 }
1520}
1521
1522#[derive(Debug, Clone)]
1523pub struct TaskProviderProxy {
1524 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1525}
1526
1527impl fidl::endpoints::Proxy for TaskProviderProxy {
1528 type Protocol = TaskProviderMarker;
1529
1530 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1531 Self::new(inner)
1532 }
1533
1534 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1535 self.client.into_channel().map_err(|client| Self { client })
1536 }
1537
1538 fn as_channel(&self) -> &::fidl::AsyncChannel {
1539 self.client.as_channel()
1540 }
1541}
1542
1543impl TaskProviderProxy {
1544 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1546 let protocol_name = <TaskProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1547 Self { client: fidl::client::Client::new(channel, protocol_name) }
1548 }
1549
1550 pub fn take_event_stream(&self) -> TaskProviderEventStream {
1556 TaskProviderEventStream { event_receiver: self.client.take_event_receiver() }
1557 }
1558
1559 pub fn r#get_job(
1563 &self,
1564 ) -> fidl::client::QueryResponseFut<
1565 TaskProviderGetJobResult,
1566 fidl::encoding::DefaultFuchsiaResourceDialect,
1567 > {
1568 TaskProviderProxyInterface::r#get_job(self)
1569 }
1570}
1571
1572impl TaskProviderProxyInterface for TaskProviderProxy {
1573 type GetJobResponseFut = fidl::client::QueryResponseFut<
1574 TaskProviderGetJobResult,
1575 fidl::encoding::DefaultFuchsiaResourceDialect,
1576 >;
1577 fn r#get_job(&self) -> Self::GetJobResponseFut {
1578 fn _decode(
1579 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1580 ) -> Result<TaskProviderGetJobResult, fidl::Error> {
1581 let _response = fidl::client::decode_transaction_body::<
1582 fidl::encoding::ResultType<TaskProviderGetJobResponse, i32>,
1583 fidl::encoding::DefaultFuchsiaResourceDialect,
1584 0x4c9ca4f4fdece3ad,
1585 >(_buf?)?;
1586 Ok(_response.map(|x| x.job))
1587 }
1588 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, TaskProviderGetJobResult>(
1589 (),
1590 0x4c9ca4f4fdece3ad,
1591 fidl::encoding::DynamicFlags::empty(),
1592 _decode,
1593 )
1594 }
1595}
1596
1597pub struct TaskProviderEventStream {
1598 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1599}
1600
1601impl std::marker::Unpin for TaskProviderEventStream {}
1602
1603impl futures::stream::FusedStream for TaskProviderEventStream {
1604 fn is_terminated(&self) -> bool {
1605 self.event_receiver.is_terminated()
1606 }
1607}
1608
1609impl futures::Stream for TaskProviderEventStream {
1610 type Item = Result<TaskProviderEvent, fidl::Error>;
1611
1612 fn poll_next(
1613 mut self: std::pin::Pin<&mut Self>,
1614 cx: &mut std::task::Context<'_>,
1615 ) -> std::task::Poll<Option<Self::Item>> {
1616 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1617 &mut self.event_receiver,
1618 cx
1619 )?) {
1620 Some(buf) => std::task::Poll::Ready(Some(TaskProviderEvent::decode(buf))),
1621 None => std::task::Poll::Ready(None),
1622 }
1623 }
1624}
1625
1626#[derive(Debug)]
1627pub enum TaskProviderEvent {
1628 #[non_exhaustive]
1629 _UnknownEvent {
1630 ordinal: u64,
1632 },
1633}
1634
1635impl TaskProviderEvent {
1636 fn decode(
1638 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1639 ) -> Result<TaskProviderEvent, fidl::Error> {
1640 let (bytes, _handles) = buf.split_mut();
1641 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1642 debug_assert_eq!(tx_header.tx_id, 0);
1643 match tx_header.ordinal {
1644 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1645 Ok(TaskProviderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1646 }
1647 _ => Err(fidl::Error::UnknownOrdinal {
1648 ordinal: tx_header.ordinal,
1649 protocol_name: <TaskProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1650 }),
1651 }
1652 }
1653}
1654
1655pub struct TaskProviderRequestStream {
1657 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1658 is_terminated: bool,
1659}
1660
1661impl std::marker::Unpin for TaskProviderRequestStream {}
1662
1663impl futures::stream::FusedStream for TaskProviderRequestStream {
1664 fn is_terminated(&self) -> bool {
1665 self.is_terminated
1666 }
1667}
1668
1669impl fidl::endpoints::RequestStream for TaskProviderRequestStream {
1670 type Protocol = TaskProviderMarker;
1671 type ControlHandle = TaskProviderControlHandle;
1672
1673 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1674 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1675 }
1676
1677 fn control_handle(&self) -> Self::ControlHandle {
1678 TaskProviderControlHandle { inner: self.inner.clone() }
1679 }
1680
1681 fn into_inner(
1682 self,
1683 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1684 {
1685 (self.inner, self.is_terminated)
1686 }
1687
1688 fn from_inner(
1689 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1690 is_terminated: bool,
1691 ) -> Self {
1692 Self { inner, is_terminated }
1693 }
1694}
1695
1696impl futures::Stream for TaskProviderRequestStream {
1697 type Item = Result<TaskProviderRequest, fidl::Error>;
1698
1699 fn poll_next(
1700 mut self: std::pin::Pin<&mut Self>,
1701 cx: &mut std::task::Context<'_>,
1702 ) -> std::task::Poll<Option<Self::Item>> {
1703 let this = &mut *self;
1704 if this.inner.check_shutdown(cx) {
1705 this.is_terminated = true;
1706 return std::task::Poll::Ready(None);
1707 }
1708 if this.is_terminated {
1709 panic!("polled TaskProviderRequestStream after completion");
1710 }
1711 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1712 |bytes, handles| {
1713 match this.inner.channel().read_etc(cx, bytes, handles) {
1714 std::task::Poll::Ready(Ok(())) => {}
1715 std::task::Poll::Pending => return std::task::Poll::Pending,
1716 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1717 this.is_terminated = true;
1718 return std::task::Poll::Ready(None);
1719 }
1720 std::task::Poll::Ready(Err(e)) => {
1721 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1722 e.into(),
1723 ))));
1724 }
1725 }
1726
1727 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1729
1730 std::task::Poll::Ready(Some(match header.ordinal {
1731 0x4c9ca4f4fdece3ad => {
1732 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1733 let mut req = fidl::new_empty!(
1734 fidl::encoding::EmptyPayload,
1735 fidl::encoding::DefaultFuchsiaResourceDialect
1736 );
1737 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1738 let control_handle =
1739 TaskProviderControlHandle { inner: this.inner.clone() };
1740 Ok(TaskProviderRequest::GetJob {
1741 responder: TaskProviderGetJobResponder {
1742 control_handle: std::mem::ManuallyDrop::new(control_handle),
1743 tx_id: header.tx_id,
1744 },
1745 })
1746 }
1747 _ if header.tx_id == 0
1748 && header
1749 .dynamic_flags()
1750 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1751 {
1752 Ok(TaskProviderRequest::_UnknownMethod {
1753 ordinal: header.ordinal,
1754 control_handle: TaskProviderControlHandle { inner: this.inner.clone() },
1755 method_type: fidl::MethodType::OneWay,
1756 })
1757 }
1758 _ if header
1759 .dynamic_flags()
1760 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1761 {
1762 this.inner.send_framework_err(
1763 fidl::encoding::FrameworkErr::UnknownMethod,
1764 header.tx_id,
1765 header.ordinal,
1766 header.dynamic_flags(),
1767 (bytes, handles),
1768 )?;
1769 Ok(TaskProviderRequest::_UnknownMethod {
1770 ordinal: header.ordinal,
1771 control_handle: TaskProviderControlHandle { inner: this.inner.clone() },
1772 method_type: fidl::MethodType::TwoWay,
1773 })
1774 }
1775 _ => Err(fidl::Error::UnknownOrdinal {
1776 ordinal: header.ordinal,
1777 protocol_name:
1778 <TaskProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1779 }),
1780 }))
1781 },
1782 )
1783 }
1784}
1785
1786#[derive(Debug)]
1788pub enum TaskProviderRequest {
1789 GetJob { responder: TaskProviderGetJobResponder },
1793 #[non_exhaustive]
1795 _UnknownMethod {
1796 ordinal: u64,
1798 control_handle: TaskProviderControlHandle,
1799 method_type: fidl::MethodType,
1800 },
1801}
1802
1803impl TaskProviderRequest {
1804 #[allow(irrefutable_let_patterns)]
1805 pub fn into_get_job(self) -> Option<(TaskProviderGetJobResponder)> {
1806 if let TaskProviderRequest::GetJob { responder } = self { Some((responder)) } else { None }
1807 }
1808
1809 pub fn method_name(&self) -> &'static str {
1811 match *self {
1812 TaskProviderRequest::GetJob { .. } => "get_job",
1813 TaskProviderRequest::_UnknownMethod {
1814 method_type: fidl::MethodType::OneWay, ..
1815 } => "unknown one-way method",
1816 TaskProviderRequest::_UnknownMethod {
1817 method_type: fidl::MethodType::TwoWay, ..
1818 } => "unknown two-way method",
1819 }
1820 }
1821}
1822
1823#[derive(Debug, Clone)]
1824pub struct TaskProviderControlHandle {
1825 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1826}
1827
1828impl TaskProviderControlHandle {
1829 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1830 self.inner.shutdown_with_epitaph(status.into())
1831 }
1832}
1833
1834impl fidl::endpoints::ControlHandle for TaskProviderControlHandle {
1835 fn shutdown(&self) {
1836 self.inner.shutdown()
1837 }
1838
1839 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1840 self.inner.shutdown_with_epitaph(status)
1841 }
1842
1843 fn is_closed(&self) -> bool {
1844 self.inner.channel().is_closed()
1845 }
1846 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1847 self.inner.channel().on_closed()
1848 }
1849
1850 #[cfg(target_os = "fuchsia")]
1851 fn signal_peer(
1852 &self,
1853 clear_mask: zx::Signals,
1854 set_mask: zx::Signals,
1855 ) -> Result<(), zx_status::Status> {
1856 use fidl::Peered;
1857 self.inner.channel().signal_peer(clear_mask, set_mask)
1858 }
1859}
1860
1861impl TaskProviderControlHandle {}
1862
1863#[must_use = "FIDL methods require a response to be sent"]
1864#[derive(Debug)]
1865pub struct TaskProviderGetJobResponder {
1866 control_handle: std::mem::ManuallyDrop<TaskProviderControlHandle>,
1867 tx_id: u32,
1868}
1869
1870impl std::ops::Drop for TaskProviderGetJobResponder {
1874 fn drop(&mut self) {
1875 self.control_handle.shutdown();
1876 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1878 }
1879}
1880
1881impl fidl::endpoints::Responder for TaskProviderGetJobResponder {
1882 type ControlHandle = TaskProviderControlHandle;
1883
1884 fn control_handle(&self) -> &TaskProviderControlHandle {
1885 &self.control_handle
1886 }
1887
1888 fn drop_without_shutdown(mut self) {
1889 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1891 std::mem::forget(self);
1893 }
1894}
1895
1896impl TaskProviderGetJobResponder {
1897 pub fn send(self, mut result: Result<fidl::Job, i32>) -> Result<(), fidl::Error> {
1901 let _result = self.send_raw(result);
1902 if _result.is_err() {
1903 self.control_handle.shutdown();
1904 }
1905 self.drop_without_shutdown();
1906 _result
1907 }
1908
1909 pub fn send_no_shutdown_on_err(
1911 self,
1912 mut result: Result<fidl::Job, i32>,
1913 ) -> Result<(), fidl::Error> {
1914 let _result = self.send_raw(result);
1915 self.drop_without_shutdown();
1916 _result
1917 }
1918
1919 fn send_raw(&self, mut result: Result<fidl::Job, i32>) -> Result<(), fidl::Error> {
1920 self.control_handle
1921 .inner
1922 .send::<fidl::encoding::ResultType<TaskProviderGetJobResponse, i32>>(
1923 result.map(|job| (job,)),
1924 self.tx_id,
1925 0x4c9ca4f4fdece3ad,
1926 fidl::encoding::DynamicFlags::empty(),
1927 )
1928 }
1929}
1930
1931mod internal {
1932 use super::*;
1933
1934 impl fidl::encoding::ResourceTypeMarker for ComponentControllerOnPublishDiagnosticsRequest {
1935 type Borrowed<'a> = &'a mut Self;
1936 fn take_or_borrow<'a>(
1937 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1938 ) -> Self::Borrowed<'a> {
1939 value
1940 }
1941 }
1942
1943 unsafe impl fidl::encoding::TypeMarker for ComponentControllerOnPublishDiagnosticsRequest {
1944 type Owned = Self;
1945
1946 #[inline(always)]
1947 fn inline_align(_context: fidl::encoding::Context) -> usize {
1948 8
1949 }
1950
1951 #[inline(always)]
1952 fn inline_size(_context: fidl::encoding::Context) -> usize {
1953 16
1954 }
1955 }
1956
1957 unsafe impl
1958 fidl::encoding::Encode<
1959 ComponentControllerOnPublishDiagnosticsRequest,
1960 fidl::encoding::DefaultFuchsiaResourceDialect,
1961 > for &mut ComponentControllerOnPublishDiagnosticsRequest
1962 {
1963 #[inline]
1964 unsafe fn encode(
1965 self,
1966 encoder: &mut fidl::encoding::Encoder<
1967 '_,
1968 fidl::encoding::DefaultFuchsiaResourceDialect,
1969 >,
1970 offset: usize,
1971 _depth: fidl::encoding::Depth,
1972 ) -> fidl::Result<()> {
1973 encoder.debug_check_bounds::<ComponentControllerOnPublishDiagnosticsRequest>(offset);
1974 fidl::encoding::Encode::<
1976 ComponentControllerOnPublishDiagnosticsRequest,
1977 fidl::encoding::DefaultFuchsiaResourceDialect,
1978 >::encode(
1979 (<ComponentDiagnostics as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1980 &mut self.payload,
1981 ),),
1982 encoder,
1983 offset,
1984 _depth,
1985 )
1986 }
1987 }
1988 unsafe impl<
1989 T0: fidl::encoding::Encode<ComponentDiagnostics, fidl::encoding::DefaultFuchsiaResourceDialect>,
1990 >
1991 fidl::encoding::Encode<
1992 ComponentControllerOnPublishDiagnosticsRequest,
1993 fidl::encoding::DefaultFuchsiaResourceDialect,
1994 > for (T0,)
1995 {
1996 #[inline]
1997 unsafe fn encode(
1998 self,
1999 encoder: &mut fidl::encoding::Encoder<
2000 '_,
2001 fidl::encoding::DefaultFuchsiaResourceDialect,
2002 >,
2003 offset: usize,
2004 depth: fidl::encoding::Depth,
2005 ) -> fidl::Result<()> {
2006 encoder.debug_check_bounds::<ComponentControllerOnPublishDiagnosticsRequest>(offset);
2007 self.0.encode(encoder, offset + 0, depth)?;
2011 Ok(())
2012 }
2013 }
2014
2015 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2016 for ComponentControllerOnPublishDiagnosticsRequest
2017 {
2018 #[inline(always)]
2019 fn new_empty() -> Self {
2020 Self {
2021 payload: fidl::new_empty!(
2022 ComponentDiagnostics,
2023 fidl::encoding::DefaultFuchsiaResourceDialect
2024 ),
2025 }
2026 }
2027
2028 #[inline]
2029 unsafe fn decode(
2030 &mut self,
2031 decoder: &mut fidl::encoding::Decoder<
2032 '_,
2033 fidl::encoding::DefaultFuchsiaResourceDialect,
2034 >,
2035 offset: usize,
2036 _depth: fidl::encoding::Depth,
2037 ) -> fidl::Result<()> {
2038 decoder.debug_check_bounds::<Self>(offset);
2039 fidl::decode!(
2041 ComponentDiagnostics,
2042 fidl::encoding::DefaultFuchsiaResourceDialect,
2043 &mut self.payload,
2044 decoder,
2045 offset + 0,
2046 _depth
2047 )?;
2048 Ok(())
2049 }
2050 }
2051
2052 impl fidl::encoding::ResourceTypeMarker for ComponentRunnerStartRequest {
2053 type Borrowed<'a> = &'a mut Self;
2054 fn take_or_borrow<'a>(
2055 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2056 ) -> Self::Borrowed<'a> {
2057 value
2058 }
2059 }
2060
2061 unsafe impl fidl::encoding::TypeMarker for ComponentRunnerStartRequest {
2062 type Owned = Self;
2063
2064 #[inline(always)]
2065 fn inline_align(_context: fidl::encoding::Context) -> usize {
2066 8
2067 }
2068
2069 #[inline(always)]
2070 fn inline_size(_context: fidl::encoding::Context) -> usize {
2071 24
2072 }
2073 }
2074
2075 unsafe impl
2076 fidl::encoding::Encode<
2077 ComponentRunnerStartRequest,
2078 fidl::encoding::DefaultFuchsiaResourceDialect,
2079 > for &mut ComponentRunnerStartRequest
2080 {
2081 #[inline]
2082 unsafe fn encode(
2083 self,
2084 encoder: &mut fidl::encoding::Encoder<
2085 '_,
2086 fidl::encoding::DefaultFuchsiaResourceDialect,
2087 >,
2088 offset: usize,
2089 _depth: fidl::encoding::Depth,
2090 ) -> fidl::Result<()> {
2091 encoder.debug_check_bounds::<ComponentRunnerStartRequest>(offset);
2092 fidl::encoding::Encode::<ComponentRunnerStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2094 (
2095 <ComponentStartInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.start_info),
2096 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
2097 ),
2098 encoder, offset, _depth
2099 )
2100 }
2101 }
2102 unsafe impl<
2103 T0: fidl::encoding::Encode<ComponentStartInfo, fidl::encoding::DefaultFuchsiaResourceDialect>,
2104 T1: fidl::encoding::Encode<
2105 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
2106 fidl::encoding::DefaultFuchsiaResourceDialect,
2107 >,
2108 >
2109 fidl::encoding::Encode<
2110 ComponentRunnerStartRequest,
2111 fidl::encoding::DefaultFuchsiaResourceDialect,
2112 > for (T0, T1)
2113 {
2114 #[inline]
2115 unsafe fn encode(
2116 self,
2117 encoder: &mut fidl::encoding::Encoder<
2118 '_,
2119 fidl::encoding::DefaultFuchsiaResourceDialect,
2120 >,
2121 offset: usize,
2122 depth: fidl::encoding::Depth,
2123 ) -> fidl::Result<()> {
2124 encoder.debug_check_bounds::<ComponentRunnerStartRequest>(offset);
2125 unsafe {
2128 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2129 (ptr as *mut u64).write_unaligned(0);
2130 }
2131 self.0.encode(encoder, offset + 0, depth)?;
2133 self.1.encode(encoder, offset + 16, depth)?;
2134 Ok(())
2135 }
2136 }
2137
2138 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2139 for ComponentRunnerStartRequest
2140 {
2141 #[inline(always)]
2142 fn new_empty() -> Self {
2143 Self {
2144 start_info: fidl::new_empty!(
2145 ComponentStartInfo,
2146 fidl::encoding::DefaultFuchsiaResourceDialect
2147 ),
2148 controller: fidl::new_empty!(
2149 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
2150 fidl::encoding::DefaultFuchsiaResourceDialect
2151 ),
2152 }
2153 }
2154
2155 #[inline]
2156 unsafe fn decode(
2157 &mut self,
2158 decoder: &mut fidl::encoding::Decoder<
2159 '_,
2160 fidl::encoding::DefaultFuchsiaResourceDialect,
2161 >,
2162 offset: usize,
2163 _depth: fidl::encoding::Depth,
2164 ) -> fidl::Result<()> {
2165 decoder.debug_check_bounds::<Self>(offset);
2166 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2168 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2169 let mask = 0xffffffff00000000u64;
2170 let maskedval = padval & mask;
2171 if maskedval != 0 {
2172 return Err(fidl::Error::NonZeroPadding {
2173 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2174 });
2175 }
2176 fidl::decode!(
2177 ComponentStartInfo,
2178 fidl::encoding::DefaultFuchsiaResourceDialect,
2179 &mut self.start_info,
2180 decoder,
2181 offset + 0,
2182 _depth
2183 )?;
2184 fidl::decode!(
2185 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
2186 fidl::encoding::DefaultFuchsiaResourceDialect,
2187 &mut self.controller,
2188 decoder,
2189 offset + 16,
2190 _depth
2191 )?;
2192 Ok(())
2193 }
2194 }
2195
2196 impl fidl::encoding::ResourceTypeMarker for TaskProviderGetJobResponse {
2197 type Borrowed<'a> = &'a mut Self;
2198 fn take_or_borrow<'a>(
2199 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2200 ) -> Self::Borrowed<'a> {
2201 value
2202 }
2203 }
2204
2205 unsafe impl fidl::encoding::TypeMarker for TaskProviderGetJobResponse {
2206 type Owned = Self;
2207
2208 #[inline(always)]
2209 fn inline_align(_context: fidl::encoding::Context) -> usize {
2210 4
2211 }
2212
2213 #[inline(always)]
2214 fn inline_size(_context: fidl::encoding::Context) -> usize {
2215 4
2216 }
2217 }
2218
2219 unsafe impl
2220 fidl::encoding::Encode<
2221 TaskProviderGetJobResponse,
2222 fidl::encoding::DefaultFuchsiaResourceDialect,
2223 > for &mut TaskProviderGetJobResponse
2224 {
2225 #[inline]
2226 unsafe fn encode(
2227 self,
2228 encoder: &mut fidl::encoding::Encoder<
2229 '_,
2230 fidl::encoding::DefaultFuchsiaResourceDialect,
2231 >,
2232 offset: usize,
2233 _depth: fidl::encoding::Depth,
2234 ) -> fidl::Result<()> {
2235 encoder.debug_check_bounds::<TaskProviderGetJobResponse>(offset);
2236 fidl::encoding::Encode::<
2238 TaskProviderGetJobResponse,
2239 fidl::encoding::DefaultFuchsiaResourceDialect,
2240 >::encode(
2241 (<fidl::encoding::HandleType<
2242 fidl::Job,
2243 { fidl::ObjectType::JOB.into_raw() },
2244 2147483648,
2245 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2246 &mut self.job
2247 ),),
2248 encoder,
2249 offset,
2250 _depth,
2251 )
2252 }
2253 }
2254 unsafe impl<
2255 T0: fidl::encoding::Encode<
2256 fidl::encoding::HandleType<
2257 fidl::Job,
2258 { fidl::ObjectType::JOB.into_raw() },
2259 2147483648,
2260 >,
2261 fidl::encoding::DefaultFuchsiaResourceDialect,
2262 >,
2263 >
2264 fidl::encoding::Encode<
2265 TaskProviderGetJobResponse,
2266 fidl::encoding::DefaultFuchsiaResourceDialect,
2267 > for (T0,)
2268 {
2269 #[inline]
2270 unsafe fn encode(
2271 self,
2272 encoder: &mut fidl::encoding::Encoder<
2273 '_,
2274 fidl::encoding::DefaultFuchsiaResourceDialect,
2275 >,
2276 offset: usize,
2277 depth: fidl::encoding::Depth,
2278 ) -> fidl::Result<()> {
2279 encoder.debug_check_bounds::<TaskProviderGetJobResponse>(offset);
2280 self.0.encode(encoder, offset + 0, depth)?;
2284 Ok(())
2285 }
2286 }
2287
2288 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2289 for TaskProviderGetJobResponse
2290 {
2291 #[inline(always)]
2292 fn new_empty() -> Self {
2293 Self {
2294 job: fidl::new_empty!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2295 }
2296 }
2297
2298 #[inline]
2299 unsafe fn decode(
2300 &mut self,
2301 decoder: &mut fidl::encoding::Decoder<
2302 '_,
2303 fidl::encoding::DefaultFuchsiaResourceDialect,
2304 >,
2305 offset: usize,
2306 _depth: fidl::encoding::Depth,
2307 ) -> fidl::Result<()> {
2308 decoder.debug_check_bounds::<Self>(offset);
2309 fidl::decode!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.job, decoder, offset + 0, _depth)?;
2311 Ok(())
2312 }
2313 }
2314
2315 impl ComponentControllerOnEscrowRequest {
2316 #[inline(always)]
2317 fn max_ordinal_present(&self) -> u64 {
2318 if let Some(_) = self.recoverable_bytes {
2319 return 4;
2320 }
2321 if let Some(_) = self.escrowed_dictionary_handle {
2322 return 3;
2323 }
2324 if let Some(_) = self.escrowed_dictionary {
2325 return 2;
2326 }
2327 if let Some(_) = self.outgoing_dir {
2328 return 1;
2329 }
2330 0
2331 }
2332 }
2333
2334 impl fidl::encoding::ResourceTypeMarker for ComponentControllerOnEscrowRequest {
2335 type Borrowed<'a> = &'a mut Self;
2336 fn take_or_borrow<'a>(
2337 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2338 ) -> Self::Borrowed<'a> {
2339 value
2340 }
2341 }
2342
2343 unsafe impl fidl::encoding::TypeMarker for ComponentControllerOnEscrowRequest {
2344 type Owned = Self;
2345
2346 #[inline(always)]
2347 fn inline_align(_context: fidl::encoding::Context) -> usize {
2348 8
2349 }
2350
2351 #[inline(always)]
2352 fn inline_size(_context: fidl::encoding::Context) -> usize {
2353 16
2354 }
2355 }
2356
2357 unsafe impl
2358 fidl::encoding::Encode<
2359 ComponentControllerOnEscrowRequest,
2360 fidl::encoding::DefaultFuchsiaResourceDialect,
2361 > for &mut ComponentControllerOnEscrowRequest
2362 {
2363 unsafe fn encode(
2364 self,
2365 encoder: &mut fidl::encoding::Encoder<
2366 '_,
2367 fidl::encoding::DefaultFuchsiaResourceDialect,
2368 >,
2369 offset: usize,
2370 mut depth: fidl::encoding::Depth,
2371 ) -> fidl::Result<()> {
2372 encoder.debug_check_bounds::<ComponentControllerOnEscrowRequest>(offset);
2373 let max_ordinal: u64 = self.max_ordinal_present();
2375 encoder.write_num(max_ordinal, offset);
2376 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2377 if max_ordinal == 0 {
2379 return Ok(());
2380 }
2381 depth.increment()?;
2382 let envelope_size = 8;
2383 let bytes_len = max_ordinal as usize * envelope_size;
2384 #[allow(unused_variables)]
2385 let offset = encoder.out_of_line_offset(bytes_len);
2386 let mut _prev_end_offset: usize = 0;
2387 if 1 > max_ordinal {
2388 return Ok(());
2389 }
2390
2391 let cur_offset: usize = (1 - 1) * envelope_size;
2394
2395 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2397
2398 fidl::encoding::encode_in_envelope_optional::<
2403 fidl::encoding::Endpoint<
2404 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2405 >,
2406 fidl::encoding::DefaultFuchsiaResourceDialect,
2407 >(
2408 self.outgoing_dir.as_mut().map(
2409 <fidl::encoding::Endpoint<
2410 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2411 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2412 ),
2413 encoder,
2414 offset + cur_offset,
2415 depth,
2416 )?;
2417
2418 _prev_end_offset = cur_offset + envelope_size;
2419 if 2 > max_ordinal {
2420 return Ok(());
2421 }
2422
2423 let cur_offset: usize = (2 - 1) * envelope_size;
2426
2427 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2429
2430 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
2435 self.escrowed_dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
2436 encoder, offset + cur_offset, depth
2437 )?;
2438
2439 _prev_end_offset = cur_offset + envelope_size;
2440 if 3 > max_ordinal {
2441 return Ok(());
2442 }
2443
2444 let cur_offset: usize = (3 - 1) * envelope_size;
2447
2448 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2450
2451 fidl::encoding::encode_in_envelope_optional::<
2456 fidl::encoding::HandleType<
2457 fidl::EventPair,
2458 { fidl::ObjectType::EVENTPAIR.into_raw() },
2459 2147483648,
2460 >,
2461 fidl::encoding::DefaultFuchsiaResourceDialect,
2462 >(
2463 self.escrowed_dictionary_handle.as_mut().map(
2464 <fidl::encoding::HandleType<
2465 fidl::EventPair,
2466 { fidl::ObjectType::EVENTPAIR.into_raw() },
2467 2147483648,
2468 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
2469 ),
2470 encoder,
2471 offset + cur_offset,
2472 depth,
2473 )?;
2474
2475 _prev_end_offset = cur_offset + envelope_size;
2476 if 4 > max_ordinal {
2477 return Ok(());
2478 }
2479
2480 let cur_offset: usize = (4 - 1) * envelope_size;
2483
2484 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2486
2487 fidl::encoding::encode_in_envelope_optional::<
2492 u64,
2493 fidl::encoding::DefaultFuchsiaResourceDialect,
2494 >(
2495 self.recoverable_bytes
2496 .as_ref()
2497 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2498 encoder,
2499 offset + cur_offset,
2500 depth,
2501 )?;
2502
2503 _prev_end_offset = cur_offset + envelope_size;
2504
2505 Ok(())
2506 }
2507 }
2508
2509 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2510 for ComponentControllerOnEscrowRequest
2511 {
2512 #[inline(always)]
2513 fn new_empty() -> Self {
2514 Self::default()
2515 }
2516
2517 unsafe fn decode(
2518 &mut self,
2519 decoder: &mut fidl::encoding::Decoder<
2520 '_,
2521 fidl::encoding::DefaultFuchsiaResourceDialect,
2522 >,
2523 offset: usize,
2524 mut depth: fidl::encoding::Depth,
2525 ) -> fidl::Result<()> {
2526 decoder.debug_check_bounds::<Self>(offset);
2527 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2528 None => return Err(fidl::Error::NotNullable),
2529 Some(len) => len,
2530 };
2531 if len == 0 {
2533 return Ok(());
2534 };
2535 depth.increment()?;
2536 let envelope_size = 8;
2537 let bytes_len = len * envelope_size;
2538 let offset = decoder.out_of_line_offset(bytes_len)?;
2539 let mut _next_ordinal_to_read = 0;
2541 let mut next_offset = offset;
2542 let end_offset = offset + bytes_len;
2543 _next_ordinal_to_read += 1;
2544 if next_offset >= end_offset {
2545 return Ok(());
2546 }
2547
2548 while _next_ordinal_to_read < 1 {
2550 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2551 _next_ordinal_to_read += 1;
2552 next_offset += envelope_size;
2553 }
2554
2555 let next_out_of_line = decoder.next_out_of_line();
2556 let handles_before = decoder.remaining_handles();
2557 if let Some((inlined, num_bytes, num_handles)) =
2558 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2559 {
2560 let member_inline_size = <fidl::encoding::Endpoint<
2561 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2562 > as fidl::encoding::TypeMarker>::inline_size(
2563 decoder.context
2564 );
2565 if inlined != (member_inline_size <= 4) {
2566 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2567 }
2568 let inner_offset;
2569 let mut inner_depth = depth.clone();
2570 if inlined {
2571 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2572 inner_offset = next_offset;
2573 } else {
2574 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2575 inner_depth.increment()?;
2576 }
2577 let val_ref = self.outgoing_dir.get_or_insert_with(|| {
2578 fidl::new_empty!(
2579 fidl::encoding::Endpoint<
2580 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2581 >,
2582 fidl::encoding::DefaultFuchsiaResourceDialect
2583 )
2584 });
2585 fidl::decode!(
2586 fidl::encoding::Endpoint<
2587 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2588 >,
2589 fidl::encoding::DefaultFuchsiaResourceDialect,
2590 val_ref,
2591 decoder,
2592 inner_offset,
2593 inner_depth
2594 )?;
2595 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2596 {
2597 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2598 }
2599 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2600 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2601 }
2602 }
2603
2604 next_offset += envelope_size;
2605 _next_ordinal_to_read += 1;
2606 if next_offset >= end_offset {
2607 return Ok(());
2608 }
2609
2610 while _next_ordinal_to_read < 2 {
2612 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2613 _next_ordinal_to_read += 1;
2614 next_offset += envelope_size;
2615 }
2616
2617 let next_out_of_line = decoder.next_out_of_line();
2618 let handles_before = decoder.remaining_handles();
2619 if let Some((inlined, num_bytes, num_handles)) =
2620 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2621 {
2622 let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2623 if inlined != (member_inline_size <= 4) {
2624 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2625 }
2626 let inner_offset;
2627 let mut inner_depth = depth.clone();
2628 if inlined {
2629 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2630 inner_offset = next_offset;
2631 } else {
2632 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2633 inner_depth.increment()?;
2634 }
2635 let val_ref = self.escrowed_dictionary.get_or_insert_with(|| {
2636 fidl::new_empty!(
2637 fidl_fuchsia_component_sandbox::DictionaryRef,
2638 fidl::encoding::DefaultFuchsiaResourceDialect
2639 )
2640 });
2641 fidl::decode!(
2642 fidl_fuchsia_component_sandbox::DictionaryRef,
2643 fidl::encoding::DefaultFuchsiaResourceDialect,
2644 val_ref,
2645 decoder,
2646 inner_offset,
2647 inner_depth
2648 )?;
2649 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2650 {
2651 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2652 }
2653 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2654 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2655 }
2656 }
2657
2658 next_offset += envelope_size;
2659 _next_ordinal_to_read += 1;
2660 if next_offset >= end_offset {
2661 return Ok(());
2662 }
2663
2664 while _next_ordinal_to_read < 3 {
2666 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2667 _next_ordinal_to_read += 1;
2668 next_offset += envelope_size;
2669 }
2670
2671 let next_out_of_line = decoder.next_out_of_line();
2672 let handles_before = decoder.remaining_handles();
2673 if let Some((inlined, num_bytes, num_handles)) =
2674 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2675 {
2676 let member_inline_size = <fidl::encoding::HandleType<
2677 fidl::EventPair,
2678 { fidl::ObjectType::EVENTPAIR.into_raw() },
2679 2147483648,
2680 > as fidl::encoding::TypeMarker>::inline_size(
2681 decoder.context
2682 );
2683 if inlined != (member_inline_size <= 4) {
2684 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2685 }
2686 let inner_offset;
2687 let mut inner_depth = depth.clone();
2688 if inlined {
2689 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2690 inner_offset = next_offset;
2691 } else {
2692 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2693 inner_depth.increment()?;
2694 }
2695 let val_ref =
2696 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));
2697 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
2698 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2699 {
2700 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2701 }
2702 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2703 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2704 }
2705 }
2706
2707 next_offset += envelope_size;
2708 _next_ordinal_to_read += 1;
2709 if next_offset >= end_offset {
2710 return Ok(());
2711 }
2712
2713 while _next_ordinal_to_read < 4 {
2715 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2716 _next_ordinal_to_read += 1;
2717 next_offset += envelope_size;
2718 }
2719
2720 let next_out_of_line = decoder.next_out_of_line();
2721 let handles_before = decoder.remaining_handles();
2722 if let Some((inlined, num_bytes, num_handles)) =
2723 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2724 {
2725 let member_inline_size =
2726 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2727 if inlined != (member_inline_size <= 4) {
2728 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2729 }
2730 let inner_offset;
2731 let mut inner_depth = depth.clone();
2732 if inlined {
2733 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2734 inner_offset = next_offset;
2735 } else {
2736 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2737 inner_depth.increment()?;
2738 }
2739 let val_ref = self.recoverable_bytes.get_or_insert_with(|| {
2740 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
2741 });
2742 fidl::decode!(
2743 u64,
2744 fidl::encoding::DefaultFuchsiaResourceDialect,
2745 val_ref,
2746 decoder,
2747 inner_offset,
2748 inner_depth
2749 )?;
2750 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2751 {
2752 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2753 }
2754 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2755 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2756 }
2757 }
2758
2759 next_offset += envelope_size;
2760
2761 while next_offset < end_offset {
2763 _next_ordinal_to_read += 1;
2764 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2765 next_offset += envelope_size;
2766 }
2767
2768 Ok(())
2769 }
2770 }
2771
2772 impl ComponentDiagnostics {
2773 #[inline(always)]
2774 fn max_ordinal_present(&self) -> u64 {
2775 if let Some(_) = self.tasks {
2776 return 1;
2777 }
2778 0
2779 }
2780 }
2781
2782 impl fidl::encoding::ResourceTypeMarker for ComponentDiagnostics {
2783 type Borrowed<'a> = &'a mut Self;
2784 fn take_or_borrow<'a>(
2785 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2786 ) -> Self::Borrowed<'a> {
2787 value
2788 }
2789 }
2790
2791 unsafe impl fidl::encoding::TypeMarker for ComponentDiagnostics {
2792 type Owned = Self;
2793
2794 #[inline(always)]
2795 fn inline_align(_context: fidl::encoding::Context) -> usize {
2796 8
2797 }
2798
2799 #[inline(always)]
2800 fn inline_size(_context: fidl::encoding::Context) -> usize {
2801 16
2802 }
2803 }
2804
2805 unsafe impl
2806 fidl::encoding::Encode<ComponentDiagnostics, fidl::encoding::DefaultFuchsiaResourceDialect>
2807 for &mut ComponentDiagnostics
2808 {
2809 unsafe fn encode(
2810 self,
2811 encoder: &mut fidl::encoding::Encoder<
2812 '_,
2813 fidl::encoding::DefaultFuchsiaResourceDialect,
2814 >,
2815 offset: usize,
2816 mut depth: fidl::encoding::Depth,
2817 ) -> fidl::Result<()> {
2818 encoder.debug_check_bounds::<ComponentDiagnostics>(offset);
2819 let max_ordinal: u64 = self.max_ordinal_present();
2821 encoder.write_num(max_ordinal, offset);
2822 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2823 if max_ordinal == 0 {
2825 return Ok(());
2826 }
2827 depth.increment()?;
2828 let envelope_size = 8;
2829 let bytes_len = max_ordinal as usize * envelope_size;
2830 #[allow(unused_variables)]
2831 let offset = encoder.out_of_line_offset(bytes_len);
2832 let mut _prev_end_offset: usize = 0;
2833 if 1 > max_ordinal {
2834 return Ok(());
2835 }
2836
2837 let cur_offset: usize = (1 - 1) * envelope_size;
2840
2841 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2843
2844 fidl::encoding::encode_in_envelope_optional::<
2849 ComponentTasks,
2850 fidl::encoding::DefaultFuchsiaResourceDialect,
2851 >(
2852 self.tasks
2853 .as_mut()
2854 .map(<ComponentTasks as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
2855 encoder,
2856 offset + cur_offset,
2857 depth,
2858 )?;
2859
2860 _prev_end_offset = cur_offset + envelope_size;
2861
2862 Ok(())
2863 }
2864 }
2865
2866 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2867 for ComponentDiagnostics
2868 {
2869 #[inline(always)]
2870 fn new_empty() -> Self {
2871 Self::default()
2872 }
2873
2874 unsafe fn decode(
2875 &mut self,
2876 decoder: &mut fidl::encoding::Decoder<
2877 '_,
2878 fidl::encoding::DefaultFuchsiaResourceDialect,
2879 >,
2880 offset: usize,
2881 mut depth: fidl::encoding::Depth,
2882 ) -> fidl::Result<()> {
2883 decoder.debug_check_bounds::<Self>(offset);
2884 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2885 None => return Err(fidl::Error::NotNullable),
2886 Some(len) => len,
2887 };
2888 if len == 0 {
2890 return Ok(());
2891 };
2892 depth.increment()?;
2893 let envelope_size = 8;
2894 let bytes_len = len * envelope_size;
2895 let offset = decoder.out_of_line_offset(bytes_len)?;
2896 let mut _next_ordinal_to_read = 0;
2898 let mut next_offset = offset;
2899 let end_offset = offset + bytes_len;
2900 _next_ordinal_to_read += 1;
2901 if next_offset >= end_offset {
2902 return Ok(());
2903 }
2904
2905 while _next_ordinal_to_read < 1 {
2907 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2908 _next_ordinal_to_read += 1;
2909 next_offset += envelope_size;
2910 }
2911
2912 let next_out_of_line = decoder.next_out_of_line();
2913 let handles_before = decoder.remaining_handles();
2914 if let Some((inlined, num_bytes, num_handles)) =
2915 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2916 {
2917 let member_inline_size =
2918 <ComponentTasks as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2919 if inlined != (member_inline_size <= 4) {
2920 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2921 }
2922 let inner_offset;
2923 let mut inner_depth = depth.clone();
2924 if inlined {
2925 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2926 inner_offset = next_offset;
2927 } else {
2928 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2929 inner_depth.increment()?;
2930 }
2931 let val_ref = self.tasks.get_or_insert_with(|| {
2932 fidl::new_empty!(ComponentTasks, fidl::encoding::DefaultFuchsiaResourceDialect)
2933 });
2934 fidl::decode!(
2935 ComponentTasks,
2936 fidl::encoding::DefaultFuchsiaResourceDialect,
2937 val_ref,
2938 decoder,
2939 inner_offset,
2940 inner_depth
2941 )?;
2942 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2943 {
2944 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2945 }
2946 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2947 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2948 }
2949 }
2950
2951 next_offset += envelope_size;
2952
2953 while next_offset < end_offset {
2955 _next_ordinal_to_read += 1;
2956 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2957 next_offset += envelope_size;
2958 }
2959
2960 Ok(())
2961 }
2962 }
2963
2964 impl ComponentNamespaceEntry {
2965 #[inline(always)]
2966 fn max_ordinal_present(&self) -> u64 {
2967 if let Some(_) = self.directory {
2968 return 2;
2969 }
2970 if let Some(_) = self.path {
2971 return 1;
2972 }
2973 0
2974 }
2975 }
2976
2977 impl fidl::encoding::ResourceTypeMarker for ComponentNamespaceEntry {
2978 type Borrowed<'a> = &'a mut Self;
2979 fn take_or_borrow<'a>(
2980 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2981 ) -> Self::Borrowed<'a> {
2982 value
2983 }
2984 }
2985
2986 unsafe impl fidl::encoding::TypeMarker for ComponentNamespaceEntry {
2987 type Owned = Self;
2988
2989 #[inline(always)]
2990 fn inline_align(_context: fidl::encoding::Context) -> usize {
2991 8
2992 }
2993
2994 #[inline(always)]
2995 fn inline_size(_context: fidl::encoding::Context) -> usize {
2996 16
2997 }
2998 }
2999
3000 unsafe impl
3001 fidl::encoding::Encode<
3002 ComponentNamespaceEntry,
3003 fidl::encoding::DefaultFuchsiaResourceDialect,
3004 > for &mut ComponentNamespaceEntry
3005 {
3006 unsafe fn encode(
3007 self,
3008 encoder: &mut fidl::encoding::Encoder<
3009 '_,
3010 fidl::encoding::DefaultFuchsiaResourceDialect,
3011 >,
3012 offset: usize,
3013 mut depth: fidl::encoding::Depth,
3014 ) -> fidl::Result<()> {
3015 encoder.debug_check_bounds::<ComponentNamespaceEntry>(offset);
3016 let max_ordinal: u64 = self.max_ordinal_present();
3018 encoder.write_num(max_ordinal, offset);
3019 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3020 if max_ordinal == 0 {
3022 return Ok(());
3023 }
3024 depth.increment()?;
3025 let envelope_size = 8;
3026 let bytes_len = max_ordinal as usize * envelope_size;
3027 #[allow(unused_variables)]
3028 let offset = encoder.out_of_line_offset(bytes_len);
3029 let mut _prev_end_offset: usize = 0;
3030 if 1 > max_ordinal {
3031 return Ok(());
3032 }
3033
3034 let cur_offset: usize = (1 - 1) * envelope_size;
3037
3038 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3040
3041 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3046 self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
3047 encoder, offset + cur_offset, depth
3048 )?;
3049
3050 _prev_end_offset = cur_offset + envelope_size;
3051 if 2 > max_ordinal {
3052 return Ok(());
3053 }
3054
3055 let cur_offset: usize = (2 - 1) * envelope_size;
3058
3059 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3061
3062 fidl::encoding::encode_in_envelope_optional::<
3067 fidl::encoding::Endpoint<
3068 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3069 >,
3070 fidl::encoding::DefaultFuchsiaResourceDialect,
3071 >(
3072 self.directory.as_mut().map(
3073 <fidl::encoding::Endpoint<
3074 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3075 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3076 ),
3077 encoder,
3078 offset + cur_offset,
3079 depth,
3080 )?;
3081
3082 _prev_end_offset = cur_offset + envelope_size;
3083
3084 Ok(())
3085 }
3086 }
3087
3088 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3089 for ComponentNamespaceEntry
3090 {
3091 #[inline(always)]
3092 fn new_empty() -> Self {
3093 Self::default()
3094 }
3095
3096 unsafe fn decode(
3097 &mut self,
3098 decoder: &mut fidl::encoding::Decoder<
3099 '_,
3100 fidl::encoding::DefaultFuchsiaResourceDialect,
3101 >,
3102 offset: usize,
3103 mut depth: fidl::encoding::Depth,
3104 ) -> fidl::Result<()> {
3105 decoder.debug_check_bounds::<Self>(offset);
3106 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3107 None => return Err(fidl::Error::NotNullable),
3108 Some(len) => len,
3109 };
3110 if len == 0 {
3112 return Ok(());
3113 };
3114 depth.increment()?;
3115 let envelope_size = 8;
3116 let bytes_len = len * envelope_size;
3117 let offset = decoder.out_of_line_offset(bytes_len)?;
3118 let mut _next_ordinal_to_read = 0;
3120 let mut next_offset = offset;
3121 let end_offset = offset + bytes_len;
3122 _next_ordinal_to_read += 1;
3123 if next_offset >= end_offset {
3124 return Ok(());
3125 }
3126
3127 while _next_ordinal_to_read < 1 {
3129 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3130 _next_ordinal_to_read += 1;
3131 next_offset += envelope_size;
3132 }
3133
3134 let next_out_of_line = decoder.next_out_of_line();
3135 let handles_before = decoder.remaining_handles();
3136 if let Some((inlined, num_bytes, num_handles)) =
3137 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3138 {
3139 let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3140 if inlined != (member_inline_size <= 4) {
3141 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3142 }
3143 let inner_offset;
3144 let mut inner_depth = depth.clone();
3145 if inlined {
3146 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3147 inner_offset = next_offset;
3148 } else {
3149 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3150 inner_depth.increment()?;
3151 }
3152 let val_ref = self.path.get_or_insert_with(|| {
3153 fidl::new_empty!(
3154 fidl::encoding::BoundedString<4095>,
3155 fidl::encoding::DefaultFuchsiaResourceDialect
3156 )
3157 });
3158 fidl::decode!(
3159 fidl::encoding::BoundedString<4095>,
3160 fidl::encoding::DefaultFuchsiaResourceDialect,
3161 val_ref,
3162 decoder,
3163 inner_offset,
3164 inner_depth
3165 )?;
3166 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3167 {
3168 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3169 }
3170 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3171 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3172 }
3173 }
3174
3175 next_offset += envelope_size;
3176 _next_ordinal_to_read += 1;
3177 if next_offset >= end_offset {
3178 return Ok(());
3179 }
3180
3181 while _next_ordinal_to_read < 2 {
3183 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3184 _next_ordinal_to_read += 1;
3185 next_offset += envelope_size;
3186 }
3187
3188 let next_out_of_line = decoder.next_out_of_line();
3189 let handles_before = decoder.remaining_handles();
3190 if let Some((inlined, num_bytes, num_handles)) =
3191 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3192 {
3193 let member_inline_size = <fidl::encoding::Endpoint<
3194 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3195 > as fidl::encoding::TypeMarker>::inline_size(
3196 decoder.context
3197 );
3198 if inlined != (member_inline_size <= 4) {
3199 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3200 }
3201 let inner_offset;
3202 let mut inner_depth = depth.clone();
3203 if inlined {
3204 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3205 inner_offset = next_offset;
3206 } else {
3207 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3208 inner_depth.increment()?;
3209 }
3210 let val_ref = self.directory.get_or_insert_with(|| {
3211 fidl::new_empty!(
3212 fidl::encoding::Endpoint<
3213 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3214 >,
3215 fidl::encoding::DefaultFuchsiaResourceDialect
3216 )
3217 });
3218 fidl::decode!(
3219 fidl::encoding::Endpoint<
3220 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3221 >,
3222 fidl::encoding::DefaultFuchsiaResourceDialect,
3223 val_ref,
3224 decoder,
3225 inner_offset,
3226 inner_depth
3227 )?;
3228 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3229 {
3230 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3231 }
3232 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3233 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3234 }
3235 }
3236
3237 next_offset += envelope_size;
3238
3239 while next_offset < end_offset {
3241 _next_ordinal_to_read += 1;
3242 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3243 next_offset += envelope_size;
3244 }
3245
3246 Ok(())
3247 }
3248 }
3249
3250 impl ComponentStartInfo {
3251 #[inline(always)]
3252 fn max_ordinal_present(&self) -> u64 {
3253 if let Some(_) = self.escrowed_dictionary_handle {
3254 return 11;
3255 }
3256 if let Some(_) = self.escrowed_dictionary {
3257 return 10;
3258 }
3259 if let Some(_) = self.component_instance {
3260 return 9;
3261 }
3262 if let Some(_) = self.break_on_start {
3263 return 8;
3264 }
3265 if let Some(_) = self.encoded_config {
3266 return 7;
3267 }
3268 if let Some(_) = self.numbered_handles {
3269 return 6;
3270 }
3271 if let Some(_) = self.runtime_dir {
3272 return 5;
3273 }
3274 if let Some(_) = self.outgoing_dir {
3275 return 4;
3276 }
3277 if let Some(_) = self.ns {
3278 return 3;
3279 }
3280 if let Some(_) = self.program {
3281 return 2;
3282 }
3283 if let Some(_) = self.resolved_url {
3284 return 1;
3285 }
3286 0
3287 }
3288 }
3289
3290 impl fidl::encoding::ResourceTypeMarker for ComponentStartInfo {
3291 type Borrowed<'a> = &'a mut Self;
3292 fn take_or_borrow<'a>(
3293 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3294 ) -> Self::Borrowed<'a> {
3295 value
3296 }
3297 }
3298
3299 unsafe impl fidl::encoding::TypeMarker for ComponentStartInfo {
3300 type Owned = Self;
3301
3302 #[inline(always)]
3303 fn inline_align(_context: fidl::encoding::Context) -> usize {
3304 8
3305 }
3306
3307 #[inline(always)]
3308 fn inline_size(_context: fidl::encoding::Context) -> usize {
3309 16
3310 }
3311 }
3312
3313 unsafe impl
3314 fidl::encoding::Encode<ComponentStartInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
3315 for &mut ComponentStartInfo
3316 {
3317 unsafe fn encode(
3318 self,
3319 encoder: &mut fidl::encoding::Encoder<
3320 '_,
3321 fidl::encoding::DefaultFuchsiaResourceDialect,
3322 >,
3323 offset: usize,
3324 mut depth: fidl::encoding::Depth,
3325 ) -> fidl::Result<()> {
3326 encoder.debug_check_bounds::<ComponentStartInfo>(offset);
3327 let max_ordinal: u64 = self.max_ordinal_present();
3329 encoder.write_num(max_ordinal, offset);
3330 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3331 if max_ordinal == 0 {
3333 return Ok(());
3334 }
3335 depth.increment()?;
3336 let envelope_size = 8;
3337 let bytes_len = max_ordinal as usize * envelope_size;
3338 #[allow(unused_variables)]
3339 let offset = encoder.out_of_line_offset(bytes_len);
3340 let mut _prev_end_offset: usize = 0;
3341 if 1 > max_ordinal {
3342 return Ok(());
3343 }
3344
3345 let cur_offset: usize = (1 - 1) * envelope_size;
3348
3349 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3351
3352 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3357 self.resolved_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
3358 encoder, offset + cur_offset, depth
3359 )?;
3360
3361 _prev_end_offset = cur_offset + envelope_size;
3362 if 2 > max_ordinal {
3363 return Ok(());
3364 }
3365
3366 let cur_offset: usize = (2 - 1) * envelope_size;
3369
3370 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3372
3373 fidl::encoding::encode_in_envelope_optional::<
3378 fidl_fuchsia_data::Dictionary,
3379 fidl::encoding::DefaultFuchsiaResourceDialect,
3380 >(
3381 self.program.as_ref().map(
3382 <fidl_fuchsia_data::Dictionary as fidl::encoding::ValueTypeMarker>::borrow,
3383 ),
3384 encoder,
3385 offset + cur_offset,
3386 depth,
3387 )?;
3388
3389 _prev_end_offset = cur_offset + envelope_size;
3390 if 3 > max_ordinal {
3391 return Ok(());
3392 }
3393
3394 let cur_offset: usize = (3 - 1) * envelope_size;
3397
3398 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3400
3401 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ComponentNamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3406 self.ns.as_mut().map(<fidl::encoding::Vector<ComponentNamespaceEntry, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
3407 encoder, offset + cur_offset, depth
3408 )?;
3409
3410 _prev_end_offset = cur_offset + envelope_size;
3411 if 4 > max_ordinal {
3412 return Ok(());
3413 }
3414
3415 let cur_offset: usize = (4 - 1) * envelope_size;
3418
3419 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3421
3422 fidl::encoding::encode_in_envelope_optional::<
3427 fidl::encoding::Endpoint<
3428 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3429 >,
3430 fidl::encoding::DefaultFuchsiaResourceDialect,
3431 >(
3432 self.outgoing_dir.as_mut().map(
3433 <fidl::encoding::Endpoint<
3434 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3435 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3436 ),
3437 encoder,
3438 offset + cur_offset,
3439 depth,
3440 )?;
3441
3442 _prev_end_offset = cur_offset + envelope_size;
3443 if 5 > max_ordinal {
3444 return Ok(());
3445 }
3446
3447 let cur_offset: usize = (5 - 1) * envelope_size;
3450
3451 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3453
3454 fidl::encoding::encode_in_envelope_optional::<
3459 fidl::encoding::Endpoint<
3460 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3461 >,
3462 fidl::encoding::DefaultFuchsiaResourceDialect,
3463 >(
3464 self.runtime_dir.as_mut().map(
3465 <fidl::encoding::Endpoint<
3466 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3467 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3468 ),
3469 encoder,
3470 offset + cur_offset,
3471 depth,
3472 )?;
3473
3474 _prev_end_offset = cur_offset + envelope_size;
3475 if 6 > max_ordinal {
3476 return Ok(());
3477 }
3478
3479 let cur_offset: usize = (6 - 1) * envelope_size;
3482
3483 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3485
3486 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3491 self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
3492 encoder, offset + cur_offset, depth
3493 )?;
3494
3495 _prev_end_offset = cur_offset + envelope_size;
3496 if 7 > max_ordinal {
3497 return Ok(());
3498 }
3499
3500 let cur_offset: usize = (7 - 1) * envelope_size;
3503
3504 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3506
3507 fidl::encoding::encode_in_envelope_optional::<
3512 fidl_fuchsia_mem::Data,
3513 fidl::encoding::DefaultFuchsiaResourceDialect,
3514 >(
3515 self.encoded_config.as_mut().map(
3516 <fidl_fuchsia_mem::Data as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3517 ),
3518 encoder,
3519 offset + cur_offset,
3520 depth,
3521 )?;
3522
3523 _prev_end_offset = cur_offset + envelope_size;
3524 if 8 > max_ordinal {
3525 return Ok(());
3526 }
3527
3528 let cur_offset: usize = (8 - 1) * envelope_size;
3531
3532 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3534
3535 fidl::encoding::encode_in_envelope_optional::<
3540 fidl::encoding::HandleType<
3541 fidl::EventPair,
3542 { fidl::ObjectType::EVENTPAIR.into_raw() },
3543 2147483648,
3544 >,
3545 fidl::encoding::DefaultFuchsiaResourceDialect,
3546 >(
3547 self.break_on_start.as_mut().map(
3548 <fidl::encoding::HandleType<
3549 fidl::EventPair,
3550 { fidl::ObjectType::EVENTPAIR.into_raw() },
3551 2147483648,
3552 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3553 ),
3554 encoder,
3555 offset + cur_offset,
3556 depth,
3557 )?;
3558
3559 _prev_end_offset = cur_offset + envelope_size;
3560 if 9 > max_ordinal {
3561 return Ok(());
3562 }
3563
3564 let cur_offset: usize = (9 - 1) * envelope_size;
3567
3568 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3570
3571 fidl::encoding::encode_in_envelope_optional::<
3576 fidl::encoding::HandleType<
3577 fidl::Event,
3578 { fidl::ObjectType::EVENT.into_raw() },
3579 2147483648,
3580 >,
3581 fidl::encoding::DefaultFuchsiaResourceDialect,
3582 >(
3583 self.component_instance.as_mut().map(
3584 <fidl::encoding::HandleType<
3585 fidl::Event,
3586 { fidl::ObjectType::EVENT.into_raw() },
3587 2147483648,
3588 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3589 ),
3590 encoder,
3591 offset + cur_offset,
3592 depth,
3593 )?;
3594
3595 _prev_end_offset = cur_offset + envelope_size;
3596 if 10 > max_ordinal {
3597 return Ok(());
3598 }
3599
3600 let cur_offset: usize = (10 - 1) * envelope_size;
3603
3604 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3606
3607 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
3612 self.escrowed_dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
3613 encoder, offset + cur_offset, depth
3614 )?;
3615
3616 _prev_end_offset = cur_offset + envelope_size;
3617 if 11 > max_ordinal {
3618 return Ok(());
3619 }
3620
3621 let cur_offset: usize = (11 - 1) * envelope_size;
3624
3625 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3627
3628 fidl::encoding::encode_in_envelope_optional::<
3633 fidl::encoding::HandleType<
3634 fidl::EventPair,
3635 { fidl::ObjectType::EVENTPAIR.into_raw() },
3636 2147483648,
3637 >,
3638 fidl::encoding::DefaultFuchsiaResourceDialect,
3639 >(
3640 self.escrowed_dictionary_handle.as_mut().map(
3641 <fidl::encoding::HandleType<
3642 fidl::EventPair,
3643 { fidl::ObjectType::EVENTPAIR.into_raw() },
3644 2147483648,
3645 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3646 ),
3647 encoder,
3648 offset + cur_offset,
3649 depth,
3650 )?;
3651
3652 _prev_end_offset = cur_offset + envelope_size;
3653
3654 Ok(())
3655 }
3656 }
3657
3658 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3659 for ComponentStartInfo
3660 {
3661 #[inline(always)]
3662 fn new_empty() -> Self {
3663 Self::default()
3664 }
3665
3666 unsafe fn decode(
3667 &mut self,
3668 decoder: &mut fidl::encoding::Decoder<
3669 '_,
3670 fidl::encoding::DefaultFuchsiaResourceDialect,
3671 >,
3672 offset: usize,
3673 mut depth: fidl::encoding::Depth,
3674 ) -> fidl::Result<()> {
3675 decoder.debug_check_bounds::<Self>(offset);
3676 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3677 None => return Err(fidl::Error::NotNullable),
3678 Some(len) => len,
3679 };
3680 if len == 0 {
3682 return Ok(());
3683 };
3684 depth.increment()?;
3685 let envelope_size = 8;
3686 let bytes_len = len * envelope_size;
3687 let offset = decoder.out_of_line_offset(bytes_len)?;
3688 let mut _next_ordinal_to_read = 0;
3690 let mut next_offset = offset;
3691 let end_offset = offset + bytes_len;
3692 _next_ordinal_to_read += 1;
3693 if next_offset >= end_offset {
3694 return Ok(());
3695 }
3696
3697 while _next_ordinal_to_read < 1 {
3699 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3700 _next_ordinal_to_read += 1;
3701 next_offset += envelope_size;
3702 }
3703
3704 let next_out_of_line = decoder.next_out_of_line();
3705 let handles_before = decoder.remaining_handles();
3706 if let Some((inlined, num_bytes, num_handles)) =
3707 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3708 {
3709 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3710 if inlined != (member_inline_size <= 4) {
3711 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3712 }
3713 let inner_offset;
3714 let mut inner_depth = depth.clone();
3715 if inlined {
3716 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3717 inner_offset = next_offset;
3718 } else {
3719 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3720 inner_depth.increment()?;
3721 }
3722 let val_ref = self.resolved_url.get_or_insert_with(|| {
3723 fidl::new_empty!(
3724 fidl::encoding::BoundedString<4096>,
3725 fidl::encoding::DefaultFuchsiaResourceDialect
3726 )
3727 });
3728 fidl::decode!(
3729 fidl::encoding::BoundedString<4096>,
3730 fidl::encoding::DefaultFuchsiaResourceDialect,
3731 val_ref,
3732 decoder,
3733 inner_offset,
3734 inner_depth
3735 )?;
3736 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3737 {
3738 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3739 }
3740 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3741 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3742 }
3743 }
3744
3745 next_offset += envelope_size;
3746 _next_ordinal_to_read += 1;
3747 if next_offset >= end_offset {
3748 return Ok(());
3749 }
3750
3751 while _next_ordinal_to_read < 2 {
3753 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3754 _next_ordinal_to_read += 1;
3755 next_offset += envelope_size;
3756 }
3757
3758 let next_out_of_line = decoder.next_out_of_line();
3759 let handles_before = decoder.remaining_handles();
3760 if let Some((inlined, num_bytes, num_handles)) =
3761 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3762 {
3763 let member_inline_size =
3764 <fidl_fuchsia_data::Dictionary as fidl::encoding::TypeMarker>::inline_size(
3765 decoder.context,
3766 );
3767 if inlined != (member_inline_size <= 4) {
3768 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3769 }
3770 let inner_offset;
3771 let mut inner_depth = depth.clone();
3772 if inlined {
3773 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3774 inner_offset = next_offset;
3775 } else {
3776 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3777 inner_depth.increment()?;
3778 }
3779 let val_ref = self.program.get_or_insert_with(|| {
3780 fidl::new_empty!(
3781 fidl_fuchsia_data::Dictionary,
3782 fidl::encoding::DefaultFuchsiaResourceDialect
3783 )
3784 });
3785 fidl::decode!(
3786 fidl_fuchsia_data::Dictionary,
3787 fidl::encoding::DefaultFuchsiaResourceDialect,
3788 val_ref,
3789 decoder,
3790 inner_offset,
3791 inner_depth
3792 )?;
3793 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3794 {
3795 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3796 }
3797 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3798 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3799 }
3800 }
3801
3802 next_offset += envelope_size;
3803 _next_ordinal_to_read += 1;
3804 if next_offset >= end_offset {
3805 return Ok(());
3806 }
3807
3808 while _next_ordinal_to_read < 3 {
3810 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3811 _next_ordinal_to_read += 1;
3812 next_offset += envelope_size;
3813 }
3814
3815 let next_out_of_line = decoder.next_out_of_line();
3816 let handles_before = decoder.remaining_handles();
3817 if let Some((inlined, num_bytes, num_handles)) =
3818 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3819 {
3820 let member_inline_size = <fidl::encoding::Vector<ComponentNamespaceEntry, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3821 if inlined != (member_inline_size <= 4) {
3822 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3823 }
3824 let inner_offset;
3825 let mut inner_depth = depth.clone();
3826 if inlined {
3827 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3828 inner_offset = next_offset;
3829 } else {
3830 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3831 inner_depth.increment()?;
3832 }
3833 let val_ref =
3834 self.ns.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<ComponentNamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
3835 fidl::decode!(fidl::encoding::Vector<ComponentNamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
3836 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3837 {
3838 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3839 }
3840 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3841 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3842 }
3843 }
3844
3845 next_offset += envelope_size;
3846 _next_ordinal_to_read += 1;
3847 if next_offset >= end_offset {
3848 return Ok(());
3849 }
3850
3851 while _next_ordinal_to_read < 4 {
3853 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3854 _next_ordinal_to_read += 1;
3855 next_offset += envelope_size;
3856 }
3857
3858 let next_out_of_line = decoder.next_out_of_line();
3859 let handles_before = decoder.remaining_handles();
3860 if let Some((inlined, num_bytes, num_handles)) =
3861 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3862 {
3863 let member_inline_size = <fidl::encoding::Endpoint<
3864 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3865 > as fidl::encoding::TypeMarker>::inline_size(
3866 decoder.context
3867 );
3868 if inlined != (member_inline_size <= 4) {
3869 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3870 }
3871 let inner_offset;
3872 let mut inner_depth = depth.clone();
3873 if inlined {
3874 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3875 inner_offset = next_offset;
3876 } else {
3877 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3878 inner_depth.increment()?;
3879 }
3880 let val_ref = self.outgoing_dir.get_or_insert_with(|| {
3881 fidl::new_empty!(
3882 fidl::encoding::Endpoint<
3883 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3884 >,
3885 fidl::encoding::DefaultFuchsiaResourceDialect
3886 )
3887 });
3888 fidl::decode!(
3889 fidl::encoding::Endpoint<
3890 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3891 >,
3892 fidl::encoding::DefaultFuchsiaResourceDialect,
3893 val_ref,
3894 decoder,
3895 inner_offset,
3896 inner_depth
3897 )?;
3898 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3899 {
3900 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3901 }
3902 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3903 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3904 }
3905 }
3906
3907 next_offset += envelope_size;
3908 _next_ordinal_to_read += 1;
3909 if next_offset >= end_offset {
3910 return Ok(());
3911 }
3912
3913 while _next_ordinal_to_read < 5 {
3915 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3916 _next_ordinal_to_read += 1;
3917 next_offset += envelope_size;
3918 }
3919
3920 let next_out_of_line = decoder.next_out_of_line();
3921 let handles_before = decoder.remaining_handles();
3922 if let Some((inlined, num_bytes, num_handles)) =
3923 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3924 {
3925 let member_inline_size = <fidl::encoding::Endpoint<
3926 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3927 > as fidl::encoding::TypeMarker>::inline_size(
3928 decoder.context
3929 );
3930 if inlined != (member_inline_size <= 4) {
3931 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3932 }
3933 let inner_offset;
3934 let mut inner_depth = depth.clone();
3935 if inlined {
3936 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3937 inner_offset = next_offset;
3938 } else {
3939 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3940 inner_depth.increment()?;
3941 }
3942 let val_ref = self.runtime_dir.get_or_insert_with(|| {
3943 fidl::new_empty!(
3944 fidl::encoding::Endpoint<
3945 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3946 >,
3947 fidl::encoding::DefaultFuchsiaResourceDialect
3948 )
3949 });
3950 fidl::decode!(
3951 fidl::encoding::Endpoint<
3952 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3953 >,
3954 fidl::encoding::DefaultFuchsiaResourceDialect,
3955 val_ref,
3956 decoder,
3957 inner_offset,
3958 inner_depth
3959 )?;
3960 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3961 {
3962 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3963 }
3964 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3965 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3966 }
3967 }
3968
3969 next_offset += envelope_size;
3970 _next_ordinal_to_read += 1;
3971 if next_offset >= end_offset {
3972 return Ok(());
3973 }
3974
3975 while _next_ordinal_to_read < 6 {
3977 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3978 _next_ordinal_to_read += 1;
3979 next_offset += envelope_size;
3980 }
3981
3982 let next_out_of_line = decoder.next_out_of_line();
3983 let handles_before = decoder.remaining_handles();
3984 if let Some((inlined, num_bytes, num_handles)) =
3985 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3986 {
3987 let member_inline_size = <fidl::encoding::Vector<
3988 fidl_fuchsia_process::HandleInfo,
3989 128,
3990 > as fidl::encoding::TypeMarker>::inline_size(
3991 decoder.context
3992 );
3993 if inlined != (member_inline_size <= 4) {
3994 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3995 }
3996 let inner_offset;
3997 let mut inner_depth = depth.clone();
3998 if inlined {
3999 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4000 inner_offset = next_offset;
4001 } else {
4002 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4003 inner_depth.increment()?;
4004 }
4005 let val_ref =
4006 self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
4007 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4008 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4009 {
4010 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4011 }
4012 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4013 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4014 }
4015 }
4016
4017 next_offset += envelope_size;
4018 _next_ordinal_to_read += 1;
4019 if next_offset >= end_offset {
4020 return Ok(());
4021 }
4022
4023 while _next_ordinal_to_read < 7 {
4025 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4026 _next_ordinal_to_read += 1;
4027 next_offset += envelope_size;
4028 }
4029
4030 let next_out_of_line = decoder.next_out_of_line();
4031 let handles_before = decoder.remaining_handles();
4032 if let Some((inlined, num_bytes, num_handles)) =
4033 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4034 {
4035 let member_inline_size =
4036 <fidl_fuchsia_mem::Data as fidl::encoding::TypeMarker>::inline_size(
4037 decoder.context,
4038 );
4039 if inlined != (member_inline_size <= 4) {
4040 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4041 }
4042 let inner_offset;
4043 let mut inner_depth = depth.clone();
4044 if inlined {
4045 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4046 inner_offset = next_offset;
4047 } else {
4048 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4049 inner_depth.increment()?;
4050 }
4051 let val_ref = self.encoded_config.get_or_insert_with(|| {
4052 fidl::new_empty!(
4053 fidl_fuchsia_mem::Data,
4054 fidl::encoding::DefaultFuchsiaResourceDialect
4055 )
4056 });
4057 fidl::decode!(
4058 fidl_fuchsia_mem::Data,
4059 fidl::encoding::DefaultFuchsiaResourceDialect,
4060 val_ref,
4061 decoder,
4062 inner_offset,
4063 inner_depth
4064 )?;
4065 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4066 {
4067 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4068 }
4069 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4070 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4071 }
4072 }
4073
4074 next_offset += envelope_size;
4075 _next_ordinal_to_read += 1;
4076 if next_offset >= end_offset {
4077 return Ok(());
4078 }
4079
4080 while _next_ordinal_to_read < 8 {
4082 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4083 _next_ordinal_to_read += 1;
4084 next_offset += envelope_size;
4085 }
4086
4087 let next_out_of_line = decoder.next_out_of_line();
4088 let handles_before = decoder.remaining_handles();
4089 if let Some((inlined, num_bytes, num_handles)) =
4090 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4091 {
4092 let member_inline_size = <fidl::encoding::HandleType<
4093 fidl::EventPair,
4094 { fidl::ObjectType::EVENTPAIR.into_raw() },
4095 2147483648,
4096 > as fidl::encoding::TypeMarker>::inline_size(
4097 decoder.context
4098 );
4099 if inlined != (member_inline_size <= 4) {
4100 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4101 }
4102 let inner_offset;
4103 let mut inner_depth = depth.clone();
4104 if inlined {
4105 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4106 inner_offset = next_offset;
4107 } else {
4108 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4109 inner_depth.increment()?;
4110 }
4111 let val_ref =
4112 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));
4113 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4114 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4115 {
4116 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4117 }
4118 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4119 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4120 }
4121 }
4122
4123 next_offset += envelope_size;
4124 _next_ordinal_to_read += 1;
4125 if next_offset >= end_offset {
4126 return Ok(());
4127 }
4128
4129 while _next_ordinal_to_read < 9 {
4131 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4132 _next_ordinal_to_read += 1;
4133 next_offset += envelope_size;
4134 }
4135
4136 let next_out_of_line = decoder.next_out_of_line();
4137 let handles_before = decoder.remaining_handles();
4138 if let Some((inlined, num_bytes, num_handles)) =
4139 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4140 {
4141 let member_inline_size = <fidl::encoding::HandleType<
4142 fidl::Event,
4143 { fidl::ObjectType::EVENT.into_raw() },
4144 2147483648,
4145 > as fidl::encoding::TypeMarker>::inline_size(
4146 decoder.context
4147 );
4148 if inlined != (member_inline_size <= 4) {
4149 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4150 }
4151 let inner_offset;
4152 let mut inner_depth = depth.clone();
4153 if inlined {
4154 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4155 inner_offset = next_offset;
4156 } else {
4157 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4158 inner_depth.increment()?;
4159 }
4160 let val_ref =
4161 self.component_instance.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
4162 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4163 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4164 {
4165 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4166 }
4167 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4168 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4169 }
4170 }
4171
4172 next_offset += envelope_size;
4173 _next_ordinal_to_read += 1;
4174 if next_offset >= end_offset {
4175 return Ok(());
4176 }
4177
4178 while _next_ordinal_to_read < 10 {
4180 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4181 _next_ordinal_to_read += 1;
4182 next_offset += envelope_size;
4183 }
4184
4185 let next_out_of_line = decoder.next_out_of_line();
4186 let handles_before = decoder.remaining_handles();
4187 if let Some((inlined, num_bytes, num_handles)) =
4188 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4189 {
4190 let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4191 if inlined != (member_inline_size <= 4) {
4192 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4193 }
4194 let inner_offset;
4195 let mut inner_depth = depth.clone();
4196 if inlined {
4197 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4198 inner_offset = next_offset;
4199 } else {
4200 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4201 inner_depth.increment()?;
4202 }
4203 let val_ref = self.escrowed_dictionary.get_or_insert_with(|| {
4204 fidl::new_empty!(
4205 fidl_fuchsia_component_sandbox::DictionaryRef,
4206 fidl::encoding::DefaultFuchsiaResourceDialect
4207 )
4208 });
4209 fidl::decode!(
4210 fidl_fuchsia_component_sandbox::DictionaryRef,
4211 fidl::encoding::DefaultFuchsiaResourceDialect,
4212 val_ref,
4213 decoder,
4214 inner_offset,
4215 inner_depth
4216 )?;
4217 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4218 {
4219 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4220 }
4221 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4222 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4223 }
4224 }
4225
4226 next_offset += envelope_size;
4227 _next_ordinal_to_read += 1;
4228 if next_offset >= end_offset {
4229 return Ok(());
4230 }
4231
4232 while _next_ordinal_to_read < 11 {
4234 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4235 _next_ordinal_to_read += 1;
4236 next_offset += envelope_size;
4237 }
4238
4239 let next_out_of_line = decoder.next_out_of_line();
4240 let handles_before = decoder.remaining_handles();
4241 if let Some((inlined, num_bytes, num_handles)) =
4242 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4243 {
4244 let member_inline_size = <fidl::encoding::HandleType<
4245 fidl::EventPair,
4246 { fidl::ObjectType::EVENTPAIR.into_raw() },
4247 2147483648,
4248 > as fidl::encoding::TypeMarker>::inline_size(
4249 decoder.context
4250 );
4251 if inlined != (member_inline_size <= 4) {
4252 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4253 }
4254 let inner_offset;
4255 let mut inner_depth = depth.clone();
4256 if inlined {
4257 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4258 inner_offset = next_offset;
4259 } else {
4260 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4261 inner_depth.increment()?;
4262 }
4263 let val_ref =
4264 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));
4265 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4266 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4267 {
4268 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4269 }
4270 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4271 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4272 }
4273 }
4274
4275 next_offset += envelope_size;
4276
4277 while next_offset < end_offset {
4279 _next_ordinal_to_read += 1;
4280 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4281 next_offset += envelope_size;
4282 }
4283
4284 Ok(())
4285 }
4286 }
4287
4288 impl ComponentStopInfo {
4289 #[inline(always)]
4290 fn max_ordinal_present(&self) -> u64 {
4291 if let Some(_) = self.exit_code {
4292 return 2;
4293 }
4294 if let Some(_) = self.termination_status {
4295 return 1;
4296 }
4297 0
4298 }
4299 }
4300
4301 impl fidl::encoding::ResourceTypeMarker for ComponentStopInfo {
4302 type Borrowed<'a> = &'a mut Self;
4303 fn take_or_borrow<'a>(
4304 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4305 ) -> Self::Borrowed<'a> {
4306 value
4307 }
4308 }
4309
4310 unsafe impl fidl::encoding::TypeMarker for ComponentStopInfo {
4311 type Owned = Self;
4312
4313 #[inline(always)]
4314 fn inline_align(_context: fidl::encoding::Context) -> usize {
4315 8
4316 }
4317
4318 #[inline(always)]
4319 fn inline_size(_context: fidl::encoding::Context) -> usize {
4320 16
4321 }
4322 }
4323
4324 unsafe impl
4325 fidl::encoding::Encode<ComponentStopInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
4326 for &mut ComponentStopInfo
4327 {
4328 unsafe fn encode(
4329 self,
4330 encoder: &mut fidl::encoding::Encoder<
4331 '_,
4332 fidl::encoding::DefaultFuchsiaResourceDialect,
4333 >,
4334 offset: usize,
4335 mut depth: fidl::encoding::Depth,
4336 ) -> fidl::Result<()> {
4337 encoder.debug_check_bounds::<ComponentStopInfo>(offset);
4338 let max_ordinal: u64 = self.max_ordinal_present();
4340 encoder.write_num(max_ordinal, offset);
4341 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4342 if max_ordinal == 0 {
4344 return Ok(());
4345 }
4346 depth.increment()?;
4347 let envelope_size = 8;
4348 let bytes_len = max_ordinal as usize * envelope_size;
4349 #[allow(unused_variables)]
4350 let offset = encoder.out_of_line_offset(bytes_len);
4351 let mut _prev_end_offset: usize = 0;
4352 if 1 > max_ordinal {
4353 return Ok(());
4354 }
4355
4356 let cur_offset: usize = (1 - 1) * envelope_size;
4359
4360 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4362
4363 fidl::encoding::encode_in_envelope_optional::<
4368 i32,
4369 fidl::encoding::DefaultFuchsiaResourceDialect,
4370 >(
4371 self.termination_status
4372 .as_ref()
4373 .map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
4374 encoder,
4375 offset + cur_offset,
4376 depth,
4377 )?;
4378
4379 _prev_end_offset = cur_offset + envelope_size;
4380 if 2 > max_ordinal {
4381 return Ok(());
4382 }
4383
4384 let cur_offset: usize = (2 - 1) * envelope_size;
4387
4388 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4390
4391 fidl::encoding::encode_in_envelope_optional::<
4396 i64,
4397 fidl::encoding::DefaultFuchsiaResourceDialect,
4398 >(
4399 self.exit_code.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
4400 encoder,
4401 offset + cur_offset,
4402 depth,
4403 )?;
4404
4405 _prev_end_offset = cur_offset + envelope_size;
4406
4407 Ok(())
4408 }
4409 }
4410
4411 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4412 for ComponentStopInfo
4413 {
4414 #[inline(always)]
4415 fn new_empty() -> Self {
4416 Self::default()
4417 }
4418
4419 unsafe fn decode(
4420 &mut self,
4421 decoder: &mut fidl::encoding::Decoder<
4422 '_,
4423 fidl::encoding::DefaultFuchsiaResourceDialect,
4424 >,
4425 offset: usize,
4426 mut depth: fidl::encoding::Depth,
4427 ) -> fidl::Result<()> {
4428 decoder.debug_check_bounds::<Self>(offset);
4429 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4430 None => return Err(fidl::Error::NotNullable),
4431 Some(len) => len,
4432 };
4433 if len == 0 {
4435 return Ok(());
4436 };
4437 depth.increment()?;
4438 let envelope_size = 8;
4439 let bytes_len = len * envelope_size;
4440 let offset = decoder.out_of_line_offset(bytes_len)?;
4441 let mut _next_ordinal_to_read = 0;
4443 let mut next_offset = offset;
4444 let end_offset = offset + bytes_len;
4445 _next_ordinal_to_read += 1;
4446 if next_offset >= end_offset {
4447 return Ok(());
4448 }
4449
4450 while _next_ordinal_to_read < 1 {
4452 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4453 _next_ordinal_to_read += 1;
4454 next_offset += envelope_size;
4455 }
4456
4457 let next_out_of_line = decoder.next_out_of_line();
4458 let handles_before = decoder.remaining_handles();
4459 if let Some((inlined, num_bytes, num_handles)) =
4460 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4461 {
4462 let member_inline_size =
4463 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4464 if inlined != (member_inline_size <= 4) {
4465 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4466 }
4467 let inner_offset;
4468 let mut inner_depth = depth.clone();
4469 if inlined {
4470 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4471 inner_offset = next_offset;
4472 } else {
4473 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4474 inner_depth.increment()?;
4475 }
4476 let val_ref = self.termination_status.get_or_insert_with(|| {
4477 fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
4478 });
4479 fidl::decode!(
4480 i32,
4481 fidl::encoding::DefaultFuchsiaResourceDialect,
4482 val_ref,
4483 decoder,
4484 inner_offset,
4485 inner_depth
4486 )?;
4487 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4488 {
4489 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4490 }
4491 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4492 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4493 }
4494 }
4495
4496 next_offset += envelope_size;
4497 _next_ordinal_to_read += 1;
4498 if next_offset >= end_offset {
4499 return Ok(());
4500 }
4501
4502 while _next_ordinal_to_read < 2 {
4504 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4505 _next_ordinal_to_read += 1;
4506 next_offset += envelope_size;
4507 }
4508
4509 let next_out_of_line = decoder.next_out_of_line();
4510 let handles_before = decoder.remaining_handles();
4511 if let Some((inlined, num_bytes, num_handles)) =
4512 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4513 {
4514 let member_inline_size =
4515 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4516 if inlined != (member_inline_size <= 4) {
4517 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4518 }
4519 let inner_offset;
4520 let mut inner_depth = depth.clone();
4521 if inlined {
4522 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4523 inner_offset = next_offset;
4524 } else {
4525 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4526 inner_depth.increment()?;
4527 }
4528 let val_ref = self.exit_code.get_or_insert_with(|| {
4529 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
4530 });
4531 fidl::decode!(
4532 i64,
4533 fidl::encoding::DefaultFuchsiaResourceDialect,
4534 val_ref,
4535 decoder,
4536 inner_offset,
4537 inner_depth
4538 )?;
4539 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4540 {
4541 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4542 }
4543 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4544 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4545 }
4546 }
4547
4548 next_offset += envelope_size;
4549
4550 while next_offset < end_offset {
4552 _next_ordinal_to_read += 1;
4553 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4554 next_offset += envelope_size;
4555 }
4556
4557 Ok(())
4558 }
4559 }
4560
4561 impl ComponentTasks {
4562 #[inline(always)]
4563 fn max_ordinal_present(&self) -> u64 {
4564 if let Some(_) = self.parent_task {
4565 return 2;
4566 }
4567 if let Some(_) = self.component_task {
4568 return 1;
4569 }
4570 0
4571 }
4572 }
4573
4574 impl fidl::encoding::ResourceTypeMarker for ComponentTasks {
4575 type Borrowed<'a> = &'a mut Self;
4576 fn take_or_borrow<'a>(
4577 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4578 ) -> Self::Borrowed<'a> {
4579 value
4580 }
4581 }
4582
4583 unsafe impl fidl::encoding::TypeMarker for ComponentTasks {
4584 type Owned = Self;
4585
4586 #[inline(always)]
4587 fn inline_align(_context: fidl::encoding::Context) -> usize {
4588 8
4589 }
4590
4591 #[inline(always)]
4592 fn inline_size(_context: fidl::encoding::Context) -> usize {
4593 16
4594 }
4595 }
4596
4597 unsafe impl
4598 fidl::encoding::Encode<ComponentTasks, fidl::encoding::DefaultFuchsiaResourceDialect>
4599 for &mut ComponentTasks
4600 {
4601 unsafe fn encode(
4602 self,
4603 encoder: &mut fidl::encoding::Encoder<
4604 '_,
4605 fidl::encoding::DefaultFuchsiaResourceDialect,
4606 >,
4607 offset: usize,
4608 mut depth: fidl::encoding::Depth,
4609 ) -> fidl::Result<()> {
4610 encoder.debug_check_bounds::<ComponentTasks>(offset);
4611 let max_ordinal: u64 = self.max_ordinal_present();
4613 encoder.write_num(max_ordinal, offset);
4614 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4615 if max_ordinal == 0 {
4617 return Ok(());
4618 }
4619 depth.increment()?;
4620 let envelope_size = 8;
4621 let bytes_len = max_ordinal as usize * envelope_size;
4622 #[allow(unused_variables)]
4623 let offset = encoder.out_of_line_offset(bytes_len);
4624 let mut _prev_end_offset: usize = 0;
4625 if 1 > max_ordinal {
4626 return Ok(());
4627 }
4628
4629 let cur_offset: usize = (1 - 1) * envelope_size;
4632
4633 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4635
4636 fidl::encoding::encode_in_envelope_optional::<
4641 Task,
4642 fidl::encoding::DefaultFuchsiaResourceDialect,
4643 >(
4644 self.component_task
4645 .as_mut()
4646 .map(<Task as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4647 encoder,
4648 offset + cur_offset,
4649 depth,
4650 )?;
4651
4652 _prev_end_offset = cur_offset + envelope_size;
4653 if 2 > max_ordinal {
4654 return Ok(());
4655 }
4656
4657 let cur_offset: usize = (2 - 1) * envelope_size;
4660
4661 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4663
4664 fidl::encoding::encode_in_envelope_optional::<
4669 Task,
4670 fidl::encoding::DefaultFuchsiaResourceDialect,
4671 >(
4672 self.parent_task
4673 .as_mut()
4674 .map(<Task as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4675 encoder,
4676 offset + cur_offset,
4677 depth,
4678 )?;
4679
4680 _prev_end_offset = cur_offset + envelope_size;
4681
4682 Ok(())
4683 }
4684 }
4685
4686 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4687 for ComponentTasks
4688 {
4689 #[inline(always)]
4690 fn new_empty() -> Self {
4691 Self::default()
4692 }
4693
4694 unsafe fn decode(
4695 &mut self,
4696 decoder: &mut fidl::encoding::Decoder<
4697 '_,
4698 fidl::encoding::DefaultFuchsiaResourceDialect,
4699 >,
4700 offset: usize,
4701 mut depth: fidl::encoding::Depth,
4702 ) -> fidl::Result<()> {
4703 decoder.debug_check_bounds::<Self>(offset);
4704 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4705 None => return Err(fidl::Error::NotNullable),
4706 Some(len) => len,
4707 };
4708 if len == 0 {
4710 return Ok(());
4711 };
4712 depth.increment()?;
4713 let envelope_size = 8;
4714 let bytes_len = len * envelope_size;
4715 let offset = decoder.out_of_line_offset(bytes_len)?;
4716 let mut _next_ordinal_to_read = 0;
4718 let mut next_offset = offset;
4719 let end_offset = offset + bytes_len;
4720 _next_ordinal_to_read += 1;
4721 if next_offset >= end_offset {
4722 return Ok(());
4723 }
4724
4725 while _next_ordinal_to_read < 1 {
4727 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4728 _next_ordinal_to_read += 1;
4729 next_offset += envelope_size;
4730 }
4731
4732 let next_out_of_line = decoder.next_out_of_line();
4733 let handles_before = decoder.remaining_handles();
4734 if let Some((inlined, num_bytes, num_handles)) =
4735 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4736 {
4737 let member_inline_size =
4738 <Task as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4739 if inlined != (member_inline_size <= 4) {
4740 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4741 }
4742 let inner_offset;
4743 let mut inner_depth = depth.clone();
4744 if inlined {
4745 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4746 inner_offset = next_offset;
4747 } else {
4748 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4749 inner_depth.increment()?;
4750 }
4751 let val_ref = self.component_task.get_or_insert_with(|| {
4752 fidl::new_empty!(Task, fidl::encoding::DefaultFuchsiaResourceDialect)
4753 });
4754 fidl::decode!(
4755 Task,
4756 fidl::encoding::DefaultFuchsiaResourceDialect,
4757 val_ref,
4758 decoder,
4759 inner_offset,
4760 inner_depth
4761 )?;
4762 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4763 {
4764 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4765 }
4766 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4767 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4768 }
4769 }
4770
4771 next_offset += envelope_size;
4772 _next_ordinal_to_read += 1;
4773 if next_offset >= end_offset {
4774 return Ok(());
4775 }
4776
4777 while _next_ordinal_to_read < 2 {
4779 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4780 _next_ordinal_to_read += 1;
4781 next_offset += envelope_size;
4782 }
4783
4784 let next_out_of_line = decoder.next_out_of_line();
4785 let handles_before = decoder.remaining_handles();
4786 if let Some((inlined, num_bytes, num_handles)) =
4787 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4788 {
4789 let member_inline_size =
4790 <Task as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4791 if inlined != (member_inline_size <= 4) {
4792 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4793 }
4794 let inner_offset;
4795 let mut inner_depth = depth.clone();
4796 if inlined {
4797 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4798 inner_offset = next_offset;
4799 } else {
4800 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4801 inner_depth.increment()?;
4802 }
4803 let val_ref = self.parent_task.get_or_insert_with(|| {
4804 fidl::new_empty!(Task, fidl::encoding::DefaultFuchsiaResourceDialect)
4805 });
4806 fidl::decode!(
4807 Task,
4808 fidl::encoding::DefaultFuchsiaResourceDialect,
4809 val_ref,
4810 decoder,
4811 inner_offset,
4812 inner_depth
4813 )?;
4814 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4815 {
4816 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4817 }
4818 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4819 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4820 }
4821 }
4822
4823 next_offset += envelope_size;
4824
4825 while next_offset < end_offset {
4827 _next_ordinal_to_read += 1;
4828 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4829 next_offset += envelope_size;
4830 }
4831
4832 Ok(())
4833 }
4834 }
4835
4836 impl fidl::encoding::ResourceTypeMarker for Task {
4837 type Borrowed<'a> = &'a mut Self;
4838 fn take_or_borrow<'a>(
4839 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4840 ) -> Self::Borrowed<'a> {
4841 value
4842 }
4843 }
4844
4845 unsafe impl fidl::encoding::TypeMarker for Task {
4846 type Owned = Self;
4847
4848 #[inline(always)]
4849 fn inline_align(_context: fidl::encoding::Context) -> usize {
4850 8
4851 }
4852
4853 #[inline(always)]
4854 fn inline_size(_context: fidl::encoding::Context) -> usize {
4855 16
4856 }
4857 }
4858
4859 unsafe impl fidl::encoding::Encode<Task, fidl::encoding::DefaultFuchsiaResourceDialect>
4860 for &mut Task
4861 {
4862 #[inline]
4863 unsafe fn encode(
4864 self,
4865 encoder: &mut fidl::encoding::Encoder<
4866 '_,
4867 fidl::encoding::DefaultFuchsiaResourceDialect,
4868 >,
4869 offset: usize,
4870 _depth: fidl::encoding::Depth,
4871 ) -> fidl::Result<()> {
4872 encoder.debug_check_bounds::<Task>(offset);
4873 encoder.write_num::<u64>(self.ordinal(), offset);
4874 match self {
4875 Task::Job(ref mut val) => fidl::encoding::encode_in_envelope::<
4876 fidl::encoding::HandleType<
4877 fidl::Job,
4878 { fidl::ObjectType::JOB.into_raw() },
4879 2147483648,
4880 >,
4881 fidl::encoding::DefaultFuchsiaResourceDialect,
4882 >(
4883 <fidl::encoding::HandleType<
4884 fidl::Job,
4885 { fidl::ObjectType::JOB.into_raw() },
4886 2147483648,
4887 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4888 val
4889 ),
4890 encoder,
4891 offset + 8,
4892 _depth,
4893 ),
4894 Task::Process(ref mut val) => fidl::encoding::encode_in_envelope::<
4895 fidl::encoding::HandleType<
4896 fidl::Process,
4897 { fidl::ObjectType::PROCESS.into_raw() },
4898 2147483648,
4899 >,
4900 fidl::encoding::DefaultFuchsiaResourceDialect,
4901 >(
4902 <fidl::encoding::HandleType<
4903 fidl::Process,
4904 { fidl::ObjectType::PROCESS.into_raw() },
4905 2147483648,
4906 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4907 val
4908 ),
4909 encoder,
4910 offset + 8,
4911 _depth,
4912 ),
4913 Task::Thread(ref mut val) => fidl::encoding::encode_in_envelope::<
4914 fidl::encoding::HandleType<
4915 fidl::Thread,
4916 { fidl::ObjectType::THREAD.into_raw() },
4917 2147483648,
4918 >,
4919 fidl::encoding::DefaultFuchsiaResourceDialect,
4920 >(
4921 <fidl::encoding::HandleType<
4922 fidl::Thread,
4923 { fidl::ObjectType::THREAD.into_raw() },
4924 2147483648,
4925 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4926 val
4927 ),
4928 encoder,
4929 offset + 8,
4930 _depth,
4931 ),
4932 Task::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
4933 }
4934 }
4935 }
4936
4937 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Task {
4938 #[inline(always)]
4939 fn new_empty() -> Self {
4940 Self::__SourceBreaking { unknown_ordinal: 0 }
4941 }
4942
4943 #[inline]
4944 unsafe fn decode(
4945 &mut self,
4946 decoder: &mut fidl::encoding::Decoder<
4947 '_,
4948 fidl::encoding::DefaultFuchsiaResourceDialect,
4949 >,
4950 offset: usize,
4951 mut depth: fidl::encoding::Depth,
4952 ) -> fidl::Result<()> {
4953 decoder.debug_check_bounds::<Self>(offset);
4954 #[allow(unused_variables)]
4955 let next_out_of_line = decoder.next_out_of_line();
4956 let handles_before = decoder.remaining_handles();
4957 let (ordinal, inlined, num_bytes, num_handles) =
4958 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4959
4960 let member_inline_size = match ordinal {
4961 1 => <fidl::encoding::HandleType<
4962 fidl::Job,
4963 { fidl::ObjectType::JOB.into_raw() },
4964 2147483648,
4965 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4966 2 => <fidl::encoding::HandleType<
4967 fidl::Process,
4968 { fidl::ObjectType::PROCESS.into_raw() },
4969 2147483648,
4970 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4971 3 => <fidl::encoding::HandleType<
4972 fidl::Thread,
4973 { fidl::ObjectType::THREAD.into_raw() },
4974 2147483648,
4975 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4976 0 => return Err(fidl::Error::UnknownUnionTag),
4977 _ => num_bytes as usize,
4978 };
4979
4980 if inlined != (member_inline_size <= 4) {
4981 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4982 }
4983 let _inner_offset;
4984 if inlined {
4985 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4986 _inner_offset = offset + 8;
4987 } else {
4988 depth.increment()?;
4989 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4990 }
4991 match ordinal {
4992 1 => {
4993 #[allow(irrefutable_let_patterns)]
4994 if let Task::Job(_) = self {
4995 } else {
4997 *self = Task::Job(
4999 fidl::new_empty!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5000 );
5001 }
5002 #[allow(irrefutable_let_patterns)]
5003 if let Task::Job(ref mut val) = self {
5004 fidl::decode!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
5005 } else {
5006 unreachable!()
5007 }
5008 }
5009 2 => {
5010 #[allow(irrefutable_let_patterns)]
5011 if let Task::Process(_) = self {
5012 } else {
5014 *self = Task::Process(
5016 fidl::new_empty!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5017 );
5018 }
5019 #[allow(irrefutable_let_patterns)]
5020 if let Task::Process(ref mut val) = self {
5021 fidl::decode!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
5022 } else {
5023 unreachable!()
5024 }
5025 }
5026 3 => {
5027 #[allow(irrefutable_let_patterns)]
5028 if let Task::Thread(_) = self {
5029 } else {
5031 *self = Task::Thread(
5033 fidl::new_empty!(fidl::encoding::HandleType<fidl::Thread, { fidl::ObjectType::THREAD.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5034 );
5035 }
5036 #[allow(irrefutable_let_patterns)]
5037 if let Task::Thread(ref mut val) = self {
5038 fidl::decode!(fidl::encoding::HandleType<fidl::Thread, { fidl::ObjectType::THREAD.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
5039 } else {
5040 unreachable!()
5041 }
5042 }
5043 #[allow(deprecated)]
5044 ordinal => {
5045 for _ in 0..num_handles {
5046 decoder.drop_next_handle()?;
5047 }
5048 *self = Task::__SourceBreaking { unknown_ordinal: ordinal };
5049 }
5050 }
5051 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5052 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5053 }
5054 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5055 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5056 }
5057 Ok(())
5058 }
5059 }
5060}