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_dash_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct LauncherExploreComponentOverPtyRequest {
16 pub moniker: String,
18 pub pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
20 pub tool_urls: Vec<String>,
23 pub command: Option<String>,
25 pub ns_layout: DashNamespaceLayout,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for LauncherExploreComponentOverPtyRequest
31{
32}
33
34#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35pub struct LauncherExploreComponentOverSocketRequest {
36 pub moniker: String,
38 pub socket: fidl::Socket,
40 pub tool_urls: Vec<String>,
43 pub command: Option<String>,
45 pub ns_layout: DashNamespaceLayout,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
50 for LauncherExploreComponentOverSocketRequest
51{
52}
53
54#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
55pub struct LauncherExplorePackageOverSocket2Request {
56 pub fuchsia_pkg_resolver: FuchsiaPkgResolver,
59 pub url: String,
65 pub subpackages: Vec<String>,
69 pub socket: fidl::Socket,
71 pub tool_urls: Vec<String>,
74 pub command: Option<String>,
76}
77
78impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
79 for LauncherExplorePackageOverSocket2Request
80{
81}
82
83#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
84pub struct LauncherExplorePackageOverSocketRequest {
85 pub url: String,
91 pub subpackages: Vec<String>,
95 pub socket: fidl::Socket,
97 pub tool_urls: Vec<String>,
100 pub command: Option<String>,
102}
103
104impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
105 for LauncherExplorePackageOverSocketRequest
106{
107}
108
109#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
110pub struct LauncherMarker;
111
112impl fidl::endpoints::ProtocolMarker for LauncherMarker {
113 type Proxy = LauncherProxy;
114 type RequestStream = LauncherRequestStream;
115 #[cfg(target_os = "fuchsia")]
116 type SynchronousProxy = LauncherSynchronousProxy;
117
118 const DEBUG_NAME: &'static str = "fuchsia.dash.Launcher";
119}
120impl fidl::endpoints::DiscoverableProtocolMarker for LauncherMarker {}
121pub type LauncherExploreComponentOverPtyResult = Result<(), LauncherError>;
122pub type LauncherExploreComponentOverSocketResult = Result<(), LauncherError>;
123pub type LauncherExplorePackageOverSocketResult = Result<(), LauncherError>;
124pub type LauncherExplorePackageOverSocket2Result = Result<(), LauncherError>;
125
126pub trait LauncherProxyInterface: Send + Sync {
127 type ExploreComponentOverPtyResponseFut: std::future::Future<Output = Result<LauncherExploreComponentOverPtyResult, fidl::Error>>
128 + Send;
129 fn r#explore_component_over_pty(
130 &self,
131 moniker: &str,
132 pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
133 tool_urls: &[String],
134 command: Option<&str>,
135 ns_layout: DashNamespaceLayout,
136 ) -> Self::ExploreComponentOverPtyResponseFut;
137 type ExploreComponentOverSocketResponseFut: std::future::Future<Output = Result<LauncherExploreComponentOverSocketResult, fidl::Error>>
138 + Send;
139 fn r#explore_component_over_socket(
140 &self,
141 moniker: &str,
142 socket: fidl::Socket,
143 tool_urls: &[String],
144 command: Option<&str>,
145 ns_layout: DashNamespaceLayout,
146 ) -> Self::ExploreComponentOverSocketResponseFut;
147 type ExplorePackageOverSocketResponseFut: std::future::Future<Output = Result<LauncherExplorePackageOverSocketResult, fidl::Error>>
148 + Send;
149 fn r#explore_package_over_socket(
150 &self,
151 url: &str,
152 subpackages: &[String],
153 socket: fidl::Socket,
154 tool_urls: &[String],
155 command: Option<&str>,
156 ) -> Self::ExplorePackageOverSocketResponseFut;
157 type ExplorePackageOverSocket2ResponseFut: std::future::Future<Output = Result<LauncherExplorePackageOverSocket2Result, fidl::Error>>
158 + Send;
159 fn r#explore_package_over_socket2(
160 &self,
161 fuchsia_pkg_resolver: FuchsiaPkgResolver,
162 url: &str,
163 subpackages: &[String],
164 socket: fidl::Socket,
165 tool_urls: &[String],
166 command: Option<&str>,
167 ) -> Self::ExplorePackageOverSocket2ResponseFut;
168}
169#[derive(Debug)]
170#[cfg(target_os = "fuchsia")]
171pub struct LauncherSynchronousProxy {
172 client: fidl::client::sync::Client,
173}
174
175#[cfg(target_os = "fuchsia")]
176impl fidl::endpoints::SynchronousProxy for LauncherSynchronousProxy {
177 type Proxy = LauncherProxy;
178 type Protocol = LauncherMarker;
179
180 fn from_channel(inner: fidl::Channel) -> Self {
181 Self::new(inner)
182 }
183
184 fn into_channel(self) -> fidl::Channel {
185 self.client.into_channel()
186 }
187
188 fn as_channel(&self) -> &fidl::Channel {
189 self.client.as_channel()
190 }
191}
192
193#[cfg(target_os = "fuchsia")]
194impl LauncherSynchronousProxy {
195 pub fn new(channel: fidl::Channel) -> Self {
196 let protocol_name = <LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
197 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
198 }
199
200 pub fn into_channel(self) -> fidl::Channel {
201 self.client.into_channel()
202 }
203
204 pub fn wait_for_event(
207 &self,
208 deadline: zx::MonotonicInstant,
209 ) -> Result<LauncherEvent, fidl::Error> {
210 LauncherEvent::decode(self.client.wait_for_event(deadline)?)
211 }
212
213 pub fn r#explore_component_over_pty(
216 &self,
217 mut moniker: &str,
218 mut pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
219 mut tool_urls: &[String],
220 mut command: Option<&str>,
221 mut ns_layout: DashNamespaceLayout,
222 ___deadline: zx::MonotonicInstant,
223 ) -> Result<LauncherExploreComponentOverPtyResult, fidl::Error> {
224 let _response = self.client.send_query::<
225 LauncherExploreComponentOverPtyRequest,
226 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
227 >(
228 (moniker, pty, tool_urls, command, ns_layout,),
229 0x22efaa9c12b8779f,
230 fidl::encoding::DynamicFlags::empty(),
231 ___deadline,
232 )?;
233 Ok(_response.map(|x| x))
234 }
235
236 pub fn r#explore_component_over_socket(
242 &self,
243 mut moniker: &str,
244 mut socket: fidl::Socket,
245 mut tool_urls: &[String],
246 mut command: Option<&str>,
247 mut ns_layout: DashNamespaceLayout,
248 ___deadline: zx::MonotonicInstant,
249 ) -> Result<LauncherExploreComponentOverSocketResult, fidl::Error> {
250 let _response = self.client.send_query::<
251 LauncherExploreComponentOverSocketRequest,
252 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
253 >(
254 (moniker, socket, tool_urls, command, ns_layout,),
255 0x233557fb2b70eb68,
256 fidl::encoding::DynamicFlags::empty(),
257 ___deadline,
258 )?;
259 Ok(_response.map(|x| x))
260 }
261
262 pub fn r#explore_package_over_socket(
273 &self,
274 mut url: &str,
275 mut subpackages: &[String],
276 mut socket: fidl::Socket,
277 mut tool_urls: &[String],
278 mut command: Option<&str>,
279 ___deadline: zx::MonotonicInstant,
280 ) -> Result<LauncherExplorePackageOverSocketResult, fidl::Error> {
281 let _response = self.client.send_query::<
282 LauncherExplorePackageOverSocketRequest,
283 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
284 >(
285 (url, subpackages, socket, tool_urls, command,),
286 0x8e536067655b5a2,
287 fidl::encoding::DynamicFlags::empty(),
288 ___deadline,
289 )?;
290 Ok(_response.map(|x| x))
291 }
292
293 pub fn r#explore_package_over_socket2(
299 &self,
300 mut fuchsia_pkg_resolver: FuchsiaPkgResolver,
301 mut url: &str,
302 mut subpackages: &[String],
303 mut socket: fidl::Socket,
304 mut tool_urls: &[String],
305 mut command: Option<&str>,
306 ___deadline: zx::MonotonicInstant,
307 ) -> Result<LauncherExplorePackageOverSocket2Result, fidl::Error> {
308 let _response = self.client.send_query::<
309 LauncherExplorePackageOverSocket2Request,
310 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
311 >(
312 (fuchsia_pkg_resolver, url, subpackages, socket, tool_urls, command,),
313 0x3884e07c1fa8d20b,
314 fidl::encoding::DynamicFlags::empty(),
315 ___deadline,
316 )?;
317 Ok(_response.map(|x| x))
318 }
319}
320
321#[cfg(target_os = "fuchsia")]
322impl From<LauncherSynchronousProxy> for zx::Handle {
323 fn from(value: LauncherSynchronousProxy) -> Self {
324 value.into_channel().into()
325 }
326}
327
328#[cfg(target_os = "fuchsia")]
329impl From<fidl::Channel> for LauncherSynchronousProxy {
330 fn from(value: fidl::Channel) -> Self {
331 Self::new(value)
332 }
333}
334
335#[derive(Debug, Clone)]
336pub struct LauncherProxy {
337 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
338}
339
340impl fidl::endpoints::Proxy for LauncherProxy {
341 type Protocol = LauncherMarker;
342
343 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
344 Self::new(inner)
345 }
346
347 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
348 self.client.into_channel().map_err(|client| Self { client })
349 }
350
351 fn as_channel(&self) -> &::fidl::AsyncChannel {
352 self.client.as_channel()
353 }
354}
355
356impl LauncherProxy {
357 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
359 let protocol_name = <LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
360 Self { client: fidl::client::Client::new(channel, protocol_name) }
361 }
362
363 pub fn take_event_stream(&self) -> LauncherEventStream {
369 LauncherEventStream { event_receiver: self.client.take_event_receiver() }
370 }
371
372 pub fn r#explore_component_over_pty(
375 &self,
376 mut moniker: &str,
377 mut pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
378 mut tool_urls: &[String],
379 mut command: Option<&str>,
380 mut ns_layout: DashNamespaceLayout,
381 ) -> fidl::client::QueryResponseFut<
382 LauncherExploreComponentOverPtyResult,
383 fidl::encoding::DefaultFuchsiaResourceDialect,
384 > {
385 LauncherProxyInterface::r#explore_component_over_pty(
386 self, moniker, pty, tool_urls, command, ns_layout,
387 )
388 }
389
390 pub fn r#explore_component_over_socket(
396 &self,
397 mut moniker: &str,
398 mut socket: fidl::Socket,
399 mut tool_urls: &[String],
400 mut command: Option<&str>,
401 mut ns_layout: DashNamespaceLayout,
402 ) -> fidl::client::QueryResponseFut<
403 LauncherExploreComponentOverSocketResult,
404 fidl::encoding::DefaultFuchsiaResourceDialect,
405 > {
406 LauncherProxyInterface::r#explore_component_over_socket(
407 self, moniker, socket, tool_urls, command, ns_layout,
408 )
409 }
410
411 pub fn r#explore_package_over_socket(
422 &self,
423 mut url: &str,
424 mut subpackages: &[String],
425 mut socket: fidl::Socket,
426 mut tool_urls: &[String],
427 mut command: Option<&str>,
428 ) -> fidl::client::QueryResponseFut<
429 LauncherExplorePackageOverSocketResult,
430 fidl::encoding::DefaultFuchsiaResourceDialect,
431 > {
432 LauncherProxyInterface::r#explore_package_over_socket(
433 self,
434 url,
435 subpackages,
436 socket,
437 tool_urls,
438 command,
439 )
440 }
441
442 pub fn r#explore_package_over_socket2(
448 &self,
449 mut fuchsia_pkg_resolver: FuchsiaPkgResolver,
450 mut url: &str,
451 mut subpackages: &[String],
452 mut socket: fidl::Socket,
453 mut tool_urls: &[String],
454 mut command: Option<&str>,
455 ) -> fidl::client::QueryResponseFut<
456 LauncherExplorePackageOverSocket2Result,
457 fidl::encoding::DefaultFuchsiaResourceDialect,
458 > {
459 LauncherProxyInterface::r#explore_package_over_socket2(
460 self,
461 fuchsia_pkg_resolver,
462 url,
463 subpackages,
464 socket,
465 tool_urls,
466 command,
467 )
468 }
469}
470
471impl LauncherProxyInterface for LauncherProxy {
472 type ExploreComponentOverPtyResponseFut = fidl::client::QueryResponseFut<
473 LauncherExploreComponentOverPtyResult,
474 fidl::encoding::DefaultFuchsiaResourceDialect,
475 >;
476 fn r#explore_component_over_pty(
477 &self,
478 mut moniker: &str,
479 mut pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
480 mut tool_urls: &[String],
481 mut command: Option<&str>,
482 mut ns_layout: DashNamespaceLayout,
483 ) -> Self::ExploreComponentOverPtyResponseFut {
484 fn _decode(
485 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
486 ) -> Result<LauncherExploreComponentOverPtyResult, fidl::Error> {
487 let _response = fidl::client::decode_transaction_body::<
488 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
489 fidl::encoding::DefaultFuchsiaResourceDialect,
490 0x22efaa9c12b8779f,
491 >(_buf?)?;
492 Ok(_response.map(|x| x))
493 }
494 self.client.send_query_and_decode::<
495 LauncherExploreComponentOverPtyRequest,
496 LauncherExploreComponentOverPtyResult,
497 >(
498 (moniker, pty, tool_urls, command, ns_layout,),
499 0x22efaa9c12b8779f,
500 fidl::encoding::DynamicFlags::empty(),
501 _decode,
502 )
503 }
504
505 type ExploreComponentOverSocketResponseFut = fidl::client::QueryResponseFut<
506 LauncherExploreComponentOverSocketResult,
507 fidl::encoding::DefaultFuchsiaResourceDialect,
508 >;
509 fn r#explore_component_over_socket(
510 &self,
511 mut moniker: &str,
512 mut socket: fidl::Socket,
513 mut tool_urls: &[String],
514 mut command: Option<&str>,
515 mut ns_layout: DashNamespaceLayout,
516 ) -> Self::ExploreComponentOverSocketResponseFut {
517 fn _decode(
518 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
519 ) -> Result<LauncherExploreComponentOverSocketResult, fidl::Error> {
520 let _response = fidl::client::decode_transaction_body::<
521 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
522 fidl::encoding::DefaultFuchsiaResourceDialect,
523 0x233557fb2b70eb68,
524 >(_buf?)?;
525 Ok(_response.map(|x| x))
526 }
527 self.client.send_query_and_decode::<
528 LauncherExploreComponentOverSocketRequest,
529 LauncherExploreComponentOverSocketResult,
530 >(
531 (moniker, socket, tool_urls, command, ns_layout,),
532 0x233557fb2b70eb68,
533 fidl::encoding::DynamicFlags::empty(),
534 _decode,
535 )
536 }
537
538 type ExplorePackageOverSocketResponseFut = fidl::client::QueryResponseFut<
539 LauncherExplorePackageOverSocketResult,
540 fidl::encoding::DefaultFuchsiaResourceDialect,
541 >;
542 fn r#explore_package_over_socket(
543 &self,
544 mut url: &str,
545 mut subpackages: &[String],
546 mut socket: fidl::Socket,
547 mut tool_urls: &[String],
548 mut command: Option<&str>,
549 ) -> Self::ExplorePackageOverSocketResponseFut {
550 fn _decode(
551 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
552 ) -> Result<LauncherExplorePackageOverSocketResult, fidl::Error> {
553 let _response = fidl::client::decode_transaction_body::<
554 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
555 fidl::encoding::DefaultFuchsiaResourceDialect,
556 0x8e536067655b5a2,
557 >(_buf?)?;
558 Ok(_response.map(|x| x))
559 }
560 self.client.send_query_and_decode::<
561 LauncherExplorePackageOverSocketRequest,
562 LauncherExplorePackageOverSocketResult,
563 >(
564 (url, subpackages, socket, tool_urls, command,),
565 0x8e536067655b5a2,
566 fidl::encoding::DynamicFlags::empty(),
567 _decode,
568 )
569 }
570
571 type ExplorePackageOverSocket2ResponseFut = fidl::client::QueryResponseFut<
572 LauncherExplorePackageOverSocket2Result,
573 fidl::encoding::DefaultFuchsiaResourceDialect,
574 >;
575 fn r#explore_package_over_socket2(
576 &self,
577 mut fuchsia_pkg_resolver: FuchsiaPkgResolver,
578 mut url: &str,
579 mut subpackages: &[String],
580 mut socket: fidl::Socket,
581 mut tool_urls: &[String],
582 mut command: Option<&str>,
583 ) -> Self::ExplorePackageOverSocket2ResponseFut {
584 fn _decode(
585 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
586 ) -> Result<LauncherExplorePackageOverSocket2Result, fidl::Error> {
587 let _response = fidl::client::decode_transaction_body::<
588 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LauncherError>,
589 fidl::encoding::DefaultFuchsiaResourceDialect,
590 0x3884e07c1fa8d20b,
591 >(_buf?)?;
592 Ok(_response.map(|x| x))
593 }
594 self.client.send_query_and_decode::<
595 LauncherExplorePackageOverSocket2Request,
596 LauncherExplorePackageOverSocket2Result,
597 >(
598 (fuchsia_pkg_resolver, url, subpackages, socket, tool_urls, command,),
599 0x3884e07c1fa8d20b,
600 fidl::encoding::DynamicFlags::empty(),
601 _decode,
602 )
603 }
604}
605
606pub struct LauncherEventStream {
607 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
608}
609
610impl std::marker::Unpin for LauncherEventStream {}
611
612impl futures::stream::FusedStream for LauncherEventStream {
613 fn is_terminated(&self) -> bool {
614 self.event_receiver.is_terminated()
615 }
616}
617
618impl futures::Stream for LauncherEventStream {
619 type Item = Result<LauncherEvent, fidl::Error>;
620
621 fn poll_next(
622 mut self: std::pin::Pin<&mut Self>,
623 cx: &mut std::task::Context<'_>,
624 ) -> std::task::Poll<Option<Self::Item>> {
625 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
626 &mut self.event_receiver,
627 cx
628 )?) {
629 Some(buf) => std::task::Poll::Ready(Some(LauncherEvent::decode(buf))),
630 None => std::task::Poll::Ready(None),
631 }
632 }
633}
634
635#[derive(Debug)]
636pub enum LauncherEvent {
637 OnTerminated { return_code: i32 },
638}
639
640impl LauncherEvent {
641 #[allow(irrefutable_let_patterns)]
642 pub fn into_on_terminated(self) -> Option<i32> {
643 if let LauncherEvent::OnTerminated { return_code } = self {
644 Some((return_code))
645 } else {
646 None
647 }
648 }
649
650 fn decode(
652 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
653 ) -> Result<LauncherEvent, fidl::Error> {
654 let (bytes, _handles) = buf.split_mut();
655 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
656 debug_assert_eq!(tx_header.tx_id, 0);
657 match tx_header.ordinal {
658 0x6e5422dc5fe6b3f2 => {
659 let mut out = fidl::new_empty!(
660 LauncherOnTerminatedRequest,
661 fidl::encoding::DefaultFuchsiaResourceDialect
662 );
663 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherOnTerminatedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
664 Ok((LauncherEvent::OnTerminated { return_code: out.return_code }))
665 }
666 _ => Err(fidl::Error::UnknownOrdinal {
667 ordinal: tx_header.ordinal,
668 protocol_name: <LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
669 }),
670 }
671 }
672}
673
674pub struct LauncherRequestStream {
676 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
677 is_terminated: bool,
678}
679
680impl std::marker::Unpin for LauncherRequestStream {}
681
682impl futures::stream::FusedStream for LauncherRequestStream {
683 fn is_terminated(&self) -> bool {
684 self.is_terminated
685 }
686}
687
688impl fidl::endpoints::RequestStream for LauncherRequestStream {
689 type Protocol = LauncherMarker;
690 type ControlHandle = LauncherControlHandle;
691
692 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
693 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
694 }
695
696 fn control_handle(&self) -> Self::ControlHandle {
697 LauncherControlHandle { inner: self.inner.clone() }
698 }
699
700 fn into_inner(
701 self,
702 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
703 {
704 (self.inner, self.is_terminated)
705 }
706
707 fn from_inner(
708 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
709 is_terminated: bool,
710 ) -> Self {
711 Self { inner, is_terminated }
712 }
713}
714
715impl futures::Stream for LauncherRequestStream {
716 type Item = Result<LauncherRequest, fidl::Error>;
717
718 fn poll_next(
719 mut self: std::pin::Pin<&mut Self>,
720 cx: &mut std::task::Context<'_>,
721 ) -> std::task::Poll<Option<Self::Item>> {
722 let this = &mut *self;
723 if this.inner.check_shutdown(cx) {
724 this.is_terminated = true;
725 return std::task::Poll::Ready(None);
726 }
727 if this.is_terminated {
728 panic!("polled LauncherRequestStream after completion");
729 }
730 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
731 |bytes, handles| {
732 match this.inner.channel().read_etc(cx, bytes, handles) {
733 std::task::Poll::Ready(Ok(())) => {}
734 std::task::Poll::Pending => return std::task::Poll::Pending,
735 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
736 this.is_terminated = true;
737 return std::task::Poll::Ready(None);
738 }
739 std::task::Poll::Ready(Err(e)) => {
740 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
741 e.into(),
742 ))))
743 }
744 }
745
746 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
748
749 std::task::Poll::Ready(Some(match header.ordinal {
750 0x22efaa9c12b8779f => {
751 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
752 let mut req = fidl::new_empty!(
753 LauncherExploreComponentOverPtyRequest,
754 fidl::encoding::DefaultFuchsiaResourceDialect
755 );
756 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherExploreComponentOverPtyRequest>(&header, _body_bytes, handles, &mut req)?;
757 let control_handle = LauncherControlHandle { inner: this.inner.clone() };
758 Ok(LauncherRequest::ExploreComponentOverPty {
759 moniker: req.moniker,
760 pty: req.pty,
761 tool_urls: req.tool_urls,
762 command: req.command,
763 ns_layout: req.ns_layout,
764
765 responder: LauncherExploreComponentOverPtyResponder {
766 control_handle: std::mem::ManuallyDrop::new(control_handle),
767 tx_id: header.tx_id,
768 },
769 })
770 }
771 0x233557fb2b70eb68 => {
772 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
773 let mut req = fidl::new_empty!(
774 LauncherExploreComponentOverSocketRequest,
775 fidl::encoding::DefaultFuchsiaResourceDialect
776 );
777 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherExploreComponentOverSocketRequest>(&header, _body_bytes, handles, &mut req)?;
778 let control_handle = LauncherControlHandle { inner: this.inner.clone() };
779 Ok(LauncherRequest::ExploreComponentOverSocket {
780 moniker: req.moniker,
781 socket: req.socket,
782 tool_urls: req.tool_urls,
783 command: req.command,
784 ns_layout: req.ns_layout,
785
786 responder: LauncherExploreComponentOverSocketResponder {
787 control_handle: std::mem::ManuallyDrop::new(control_handle),
788 tx_id: header.tx_id,
789 },
790 })
791 }
792 0x8e536067655b5a2 => {
793 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
794 let mut req = fidl::new_empty!(
795 LauncherExplorePackageOverSocketRequest,
796 fidl::encoding::DefaultFuchsiaResourceDialect
797 );
798 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherExplorePackageOverSocketRequest>(&header, _body_bytes, handles, &mut req)?;
799 let control_handle = LauncherControlHandle { inner: this.inner.clone() };
800 Ok(LauncherRequest::ExplorePackageOverSocket {
801 url: req.url,
802 subpackages: req.subpackages,
803 socket: req.socket,
804 tool_urls: req.tool_urls,
805 command: req.command,
806
807 responder: LauncherExplorePackageOverSocketResponder {
808 control_handle: std::mem::ManuallyDrop::new(control_handle),
809 tx_id: header.tx_id,
810 },
811 })
812 }
813 0x3884e07c1fa8d20b => {
814 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
815 let mut req = fidl::new_empty!(
816 LauncherExplorePackageOverSocket2Request,
817 fidl::encoding::DefaultFuchsiaResourceDialect
818 );
819 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherExplorePackageOverSocket2Request>(&header, _body_bytes, handles, &mut req)?;
820 let control_handle = LauncherControlHandle { inner: this.inner.clone() };
821 Ok(LauncherRequest::ExplorePackageOverSocket2 {
822 fuchsia_pkg_resolver: req.fuchsia_pkg_resolver,
823 url: req.url,
824 subpackages: req.subpackages,
825 socket: req.socket,
826 tool_urls: req.tool_urls,
827 command: req.command,
828
829 responder: LauncherExplorePackageOverSocket2Responder {
830 control_handle: std::mem::ManuallyDrop::new(control_handle),
831 tx_id: header.tx_id,
832 },
833 })
834 }
835 _ => Err(fidl::Error::UnknownOrdinal {
836 ordinal: header.ordinal,
837 protocol_name:
838 <LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
839 }),
840 }))
841 },
842 )
843 }
844}
845
846#[derive(Debug)]
847pub enum LauncherRequest {
848 ExploreComponentOverPty {
851 moniker: String,
852 pty: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
853 tool_urls: Vec<String>,
854 command: Option<String>,
855 ns_layout: DashNamespaceLayout,
856 responder: LauncherExploreComponentOverPtyResponder,
857 },
858 ExploreComponentOverSocket {
864 moniker: String,
865 socket: fidl::Socket,
866 tool_urls: Vec<String>,
867 command: Option<String>,
868 ns_layout: DashNamespaceLayout,
869 responder: LauncherExploreComponentOverSocketResponder,
870 },
871 ExplorePackageOverSocket {
882 url: String,
883 subpackages: Vec<String>,
884 socket: fidl::Socket,
885 tool_urls: Vec<String>,
886 command: Option<String>,
887 responder: LauncherExplorePackageOverSocketResponder,
888 },
889 ExplorePackageOverSocket2 {
895 fuchsia_pkg_resolver: FuchsiaPkgResolver,
896 url: String,
897 subpackages: Vec<String>,
898 socket: fidl::Socket,
899 tool_urls: Vec<String>,
900 command: Option<String>,
901 responder: LauncherExplorePackageOverSocket2Responder,
902 },
903}
904
905impl LauncherRequest {
906 #[allow(irrefutable_let_patterns)]
907 pub fn into_explore_component_over_pty(
908 self,
909 ) -> Option<(
910 String,
911 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
912 Vec<String>,
913 Option<String>,
914 DashNamespaceLayout,
915 LauncherExploreComponentOverPtyResponder,
916 )> {
917 if let LauncherRequest::ExploreComponentOverPty {
918 moniker,
919 pty,
920 tool_urls,
921 command,
922 ns_layout,
923 responder,
924 } = self
925 {
926 Some((moniker, pty, tool_urls, command, ns_layout, responder))
927 } else {
928 None
929 }
930 }
931
932 #[allow(irrefutable_let_patterns)]
933 pub fn into_explore_component_over_socket(
934 self,
935 ) -> Option<(
936 String,
937 fidl::Socket,
938 Vec<String>,
939 Option<String>,
940 DashNamespaceLayout,
941 LauncherExploreComponentOverSocketResponder,
942 )> {
943 if let LauncherRequest::ExploreComponentOverSocket {
944 moniker,
945 socket,
946 tool_urls,
947 command,
948 ns_layout,
949 responder,
950 } = self
951 {
952 Some((moniker, socket, tool_urls, command, ns_layout, responder))
953 } else {
954 None
955 }
956 }
957
958 #[allow(irrefutable_let_patterns)]
959 pub fn into_explore_package_over_socket(
960 self,
961 ) -> Option<(
962 String,
963 Vec<String>,
964 fidl::Socket,
965 Vec<String>,
966 Option<String>,
967 LauncherExplorePackageOverSocketResponder,
968 )> {
969 if let LauncherRequest::ExplorePackageOverSocket {
970 url,
971 subpackages,
972 socket,
973 tool_urls,
974 command,
975 responder,
976 } = self
977 {
978 Some((url, subpackages, socket, tool_urls, command, responder))
979 } else {
980 None
981 }
982 }
983
984 #[allow(irrefutable_let_patterns)]
985 pub fn into_explore_package_over_socket2(
986 self,
987 ) -> Option<(
988 FuchsiaPkgResolver,
989 String,
990 Vec<String>,
991 fidl::Socket,
992 Vec<String>,
993 Option<String>,
994 LauncherExplorePackageOverSocket2Responder,
995 )> {
996 if let LauncherRequest::ExplorePackageOverSocket2 {
997 fuchsia_pkg_resolver,
998 url,
999 subpackages,
1000 socket,
1001 tool_urls,
1002 command,
1003 responder,
1004 } = self
1005 {
1006 Some((fuchsia_pkg_resolver, url, subpackages, socket, tool_urls, command, responder))
1007 } else {
1008 None
1009 }
1010 }
1011
1012 pub fn method_name(&self) -> &'static str {
1014 match *self {
1015 LauncherRequest::ExploreComponentOverPty { .. } => "explore_component_over_pty",
1016 LauncherRequest::ExploreComponentOverSocket { .. } => "explore_component_over_socket",
1017 LauncherRequest::ExplorePackageOverSocket { .. } => "explore_package_over_socket",
1018 LauncherRequest::ExplorePackageOverSocket2 { .. } => "explore_package_over_socket2",
1019 }
1020 }
1021}
1022
1023#[derive(Debug, Clone)]
1024pub struct LauncherControlHandle {
1025 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1026}
1027
1028impl fidl::endpoints::ControlHandle for LauncherControlHandle {
1029 fn shutdown(&self) {
1030 self.inner.shutdown()
1031 }
1032 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1033 self.inner.shutdown_with_epitaph(status)
1034 }
1035
1036 fn is_closed(&self) -> bool {
1037 self.inner.channel().is_closed()
1038 }
1039 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1040 self.inner.channel().on_closed()
1041 }
1042
1043 #[cfg(target_os = "fuchsia")]
1044 fn signal_peer(
1045 &self,
1046 clear_mask: zx::Signals,
1047 set_mask: zx::Signals,
1048 ) -> Result<(), zx_status::Status> {
1049 use fidl::Peered;
1050 self.inner.channel().signal_peer(clear_mask, set_mask)
1051 }
1052}
1053
1054impl LauncherControlHandle {
1055 pub fn send_on_terminated(&self, mut return_code: i32) -> Result<(), fidl::Error> {
1056 self.inner.send::<LauncherOnTerminatedRequest>(
1057 (return_code,),
1058 0,
1059 0x6e5422dc5fe6b3f2,
1060 fidl::encoding::DynamicFlags::empty(),
1061 )
1062 }
1063}
1064
1065#[must_use = "FIDL methods require a response to be sent"]
1066#[derive(Debug)]
1067pub struct LauncherExploreComponentOverPtyResponder {
1068 control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
1069 tx_id: u32,
1070}
1071
1072impl std::ops::Drop for LauncherExploreComponentOverPtyResponder {
1076 fn drop(&mut self) {
1077 self.control_handle.shutdown();
1078 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1080 }
1081}
1082
1083impl fidl::endpoints::Responder for LauncherExploreComponentOverPtyResponder {
1084 type ControlHandle = LauncherControlHandle;
1085
1086 fn control_handle(&self) -> &LauncherControlHandle {
1087 &self.control_handle
1088 }
1089
1090 fn drop_without_shutdown(mut self) {
1091 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1093 std::mem::forget(self);
1095 }
1096}
1097
1098impl LauncherExploreComponentOverPtyResponder {
1099 pub fn send(self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
1103 let _result = self.send_raw(result);
1104 if _result.is_err() {
1105 self.control_handle.shutdown();
1106 }
1107 self.drop_without_shutdown();
1108 _result
1109 }
1110
1111 pub fn send_no_shutdown_on_err(
1113 self,
1114 mut result: Result<(), LauncherError>,
1115 ) -> Result<(), fidl::Error> {
1116 let _result = self.send_raw(result);
1117 self.drop_without_shutdown();
1118 _result
1119 }
1120
1121 fn send_raw(&self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
1122 self.control_handle.inner.send::<fidl::encoding::ResultType<
1123 fidl::encoding::EmptyStruct,
1124 LauncherError,
1125 >>(
1126 result,
1127 self.tx_id,
1128 0x22efaa9c12b8779f,
1129 fidl::encoding::DynamicFlags::empty(),
1130 )
1131 }
1132}
1133
1134#[must_use = "FIDL methods require a response to be sent"]
1135#[derive(Debug)]
1136pub struct LauncherExploreComponentOverSocketResponder {
1137 control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
1138 tx_id: u32,
1139}
1140
1141impl std::ops::Drop for LauncherExploreComponentOverSocketResponder {
1145 fn drop(&mut self) {
1146 self.control_handle.shutdown();
1147 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1149 }
1150}
1151
1152impl fidl::endpoints::Responder for LauncherExploreComponentOverSocketResponder {
1153 type ControlHandle = LauncherControlHandle;
1154
1155 fn control_handle(&self) -> &LauncherControlHandle {
1156 &self.control_handle
1157 }
1158
1159 fn drop_without_shutdown(mut self) {
1160 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1162 std::mem::forget(self);
1164 }
1165}
1166
1167impl LauncherExploreComponentOverSocketResponder {
1168 pub fn send(self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
1172 let _result = self.send_raw(result);
1173 if _result.is_err() {
1174 self.control_handle.shutdown();
1175 }
1176 self.drop_without_shutdown();
1177 _result
1178 }
1179
1180 pub fn send_no_shutdown_on_err(
1182 self,
1183 mut result: Result<(), LauncherError>,
1184 ) -> Result<(), fidl::Error> {
1185 let _result = self.send_raw(result);
1186 self.drop_without_shutdown();
1187 _result
1188 }
1189
1190 fn send_raw(&self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
1191 self.control_handle.inner.send::<fidl::encoding::ResultType<
1192 fidl::encoding::EmptyStruct,
1193 LauncherError,
1194 >>(
1195 result,
1196 self.tx_id,
1197 0x233557fb2b70eb68,
1198 fidl::encoding::DynamicFlags::empty(),
1199 )
1200 }
1201}
1202
1203#[must_use = "FIDL methods require a response to be sent"]
1204#[derive(Debug)]
1205pub struct LauncherExplorePackageOverSocketResponder {
1206 control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
1207 tx_id: u32,
1208}
1209
1210impl std::ops::Drop for LauncherExplorePackageOverSocketResponder {
1214 fn drop(&mut self) {
1215 self.control_handle.shutdown();
1216 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1218 }
1219}
1220
1221impl fidl::endpoints::Responder for LauncherExplorePackageOverSocketResponder {
1222 type ControlHandle = LauncherControlHandle;
1223
1224 fn control_handle(&self) -> &LauncherControlHandle {
1225 &self.control_handle
1226 }
1227
1228 fn drop_without_shutdown(mut self) {
1229 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1231 std::mem::forget(self);
1233 }
1234}
1235
1236impl LauncherExplorePackageOverSocketResponder {
1237 pub fn send(self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
1241 let _result = self.send_raw(result);
1242 if _result.is_err() {
1243 self.control_handle.shutdown();
1244 }
1245 self.drop_without_shutdown();
1246 _result
1247 }
1248
1249 pub fn send_no_shutdown_on_err(
1251 self,
1252 mut result: Result<(), LauncherError>,
1253 ) -> Result<(), fidl::Error> {
1254 let _result = self.send_raw(result);
1255 self.drop_without_shutdown();
1256 _result
1257 }
1258
1259 fn send_raw(&self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
1260 self.control_handle.inner.send::<fidl::encoding::ResultType<
1261 fidl::encoding::EmptyStruct,
1262 LauncherError,
1263 >>(
1264 result,
1265 self.tx_id,
1266 0x8e536067655b5a2,
1267 fidl::encoding::DynamicFlags::empty(),
1268 )
1269 }
1270}
1271
1272#[must_use = "FIDL methods require a response to be sent"]
1273#[derive(Debug)]
1274pub struct LauncherExplorePackageOverSocket2Responder {
1275 control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
1276 tx_id: u32,
1277}
1278
1279impl std::ops::Drop for LauncherExplorePackageOverSocket2Responder {
1283 fn drop(&mut self) {
1284 self.control_handle.shutdown();
1285 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1287 }
1288}
1289
1290impl fidl::endpoints::Responder for LauncherExplorePackageOverSocket2Responder {
1291 type ControlHandle = LauncherControlHandle;
1292
1293 fn control_handle(&self) -> &LauncherControlHandle {
1294 &self.control_handle
1295 }
1296
1297 fn drop_without_shutdown(mut self) {
1298 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1300 std::mem::forget(self);
1302 }
1303}
1304
1305impl LauncherExplorePackageOverSocket2Responder {
1306 pub fn send(self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
1310 let _result = self.send_raw(result);
1311 if _result.is_err() {
1312 self.control_handle.shutdown();
1313 }
1314 self.drop_without_shutdown();
1315 _result
1316 }
1317
1318 pub fn send_no_shutdown_on_err(
1320 self,
1321 mut result: Result<(), LauncherError>,
1322 ) -> Result<(), fidl::Error> {
1323 let _result = self.send_raw(result);
1324 self.drop_without_shutdown();
1325 _result
1326 }
1327
1328 fn send_raw(&self, mut result: Result<(), LauncherError>) -> Result<(), fidl::Error> {
1329 self.control_handle.inner.send::<fidl::encoding::ResultType<
1330 fidl::encoding::EmptyStruct,
1331 LauncherError,
1332 >>(
1333 result,
1334 self.tx_id,
1335 0x3884e07c1fa8d20b,
1336 fidl::encoding::DynamicFlags::empty(),
1337 )
1338 }
1339}
1340
1341mod internal {
1342 use super::*;
1343
1344 impl fidl::encoding::ResourceTypeMarker for LauncherExploreComponentOverPtyRequest {
1345 type Borrowed<'a> = &'a mut Self;
1346 fn take_or_borrow<'a>(
1347 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1348 ) -> Self::Borrowed<'a> {
1349 value
1350 }
1351 }
1352
1353 unsafe impl fidl::encoding::TypeMarker for LauncherExploreComponentOverPtyRequest {
1354 type Owned = Self;
1355
1356 #[inline(always)]
1357 fn inline_align(_context: fidl::encoding::Context) -> usize {
1358 8
1359 }
1360
1361 #[inline(always)]
1362 fn inline_size(_context: fidl::encoding::Context) -> usize {
1363 64
1364 }
1365 }
1366
1367 unsafe impl
1368 fidl::encoding::Encode<
1369 LauncherExploreComponentOverPtyRequest,
1370 fidl::encoding::DefaultFuchsiaResourceDialect,
1371 > for &mut LauncherExploreComponentOverPtyRequest
1372 {
1373 #[inline]
1374 unsafe fn encode(
1375 self,
1376 encoder: &mut fidl::encoding::Encoder<
1377 '_,
1378 fidl::encoding::DefaultFuchsiaResourceDialect,
1379 >,
1380 offset: usize,
1381 _depth: fidl::encoding::Depth,
1382 ) -> fidl::Result<()> {
1383 encoder.debug_check_bounds::<LauncherExploreComponentOverPtyRequest>(offset);
1384 fidl::encoding::Encode::<LauncherExploreComponentOverPtyRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1386 (
1387 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1388 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.pty),
1389 <fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool_urls),
1390 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
1391 <DashNamespaceLayout as fidl::encoding::ValueTypeMarker>::borrow(&self.ns_layout),
1392 ),
1393 encoder, offset, _depth
1394 )
1395 }
1396 }
1397 unsafe impl<
1398 T0: fidl::encoding::Encode<
1399 fidl::encoding::UnboundedString,
1400 fidl::encoding::DefaultFuchsiaResourceDialect,
1401 >,
1402 T1: fidl::encoding::Encode<
1403 fidl::encoding::Endpoint<
1404 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
1405 >,
1406 fidl::encoding::DefaultFuchsiaResourceDialect,
1407 >,
1408 T2: fidl::encoding::Encode<
1409 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1410 fidl::encoding::DefaultFuchsiaResourceDialect,
1411 >,
1412 T3: fidl::encoding::Encode<
1413 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1414 fidl::encoding::DefaultFuchsiaResourceDialect,
1415 >,
1416 T4: fidl::encoding::Encode<
1417 DashNamespaceLayout,
1418 fidl::encoding::DefaultFuchsiaResourceDialect,
1419 >,
1420 >
1421 fidl::encoding::Encode<
1422 LauncherExploreComponentOverPtyRequest,
1423 fidl::encoding::DefaultFuchsiaResourceDialect,
1424 > for (T0, T1, T2, T3, T4)
1425 {
1426 #[inline]
1427 unsafe fn encode(
1428 self,
1429 encoder: &mut fidl::encoding::Encoder<
1430 '_,
1431 fidl::encoding::DefaultFuchsiaResourceDialect,
1432 >,
1433 offset: usize,
1434 depth: fidl::encoding::Depth,
1435 ) -> fidl::Result<()> {
1436 encoder.debug_check_bounds::<LauncherExploreComponentOverPtyRequest>(offset);
1437 unsafe {
1440 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1441 (ptr as *mut u64).write_unaligned(0);
1442 }
1443 unsafe {
1444 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
1445 (ptr as *mut u64).write_unaligned(0);
1446 }
1447 self.0.encode(encoder, offset + 0, depth)?;
1449 self.1.encode(encoder, offset + 16, depth)?;
1450 self.2.encode(encoder, offset + 24, depth)?;
1451 self.3.encode(encoder, offset + 40, depth)?;
1452 self.4.encode(encoder, offset + 56, depth)?;
1453 Ok(())
1454 }
1455 }
1456
1457 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1458 for LauncherExploreComponentOverPtyRequest
1459 {
1460 #[inline(always)]
1461 fn new_empty() -> Self {
1462 Self {
1463 moniker: fidl::new_empty!(
1464 fidl::encoding::UnboundedString,
1465 fidl::encoding::DefaultFuchsiaResourceDialect
1466 ),
1467 pty: fidl::new_empty!(
1468 fidl::encoding::Endpoint<
1469 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
1470 >,
1471 fidl::encoding::DefaultFuchsiaResourceDialect
1472 ),
1473 tool_urls: fidl::new_empty!(
1474 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1475 fidl::encoding::DefaultFuchsiaResourceDialect
1476 ),
1477 command: fidl::new_empty!(
1478 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1479 fidl::encoding::DefaultFuchsiaResourceDialect
1480 ),
1481 ns_layout: fidl::new_empty!(
1482 DashNamespaceLayout,
1483 fidl::encoding::DefaultFuchsiaResourceDialect
1484 ),
1485 }
1486 }
1487
1488 #[inline]
1489 unsafe fn decode(
1490 &mut self,
1491 decoder: &mut fidl::encoding::Decoder<
1492 '_,
1493 fidl::encoding::DefaultFuchsiaResourceDialect,
1494 >,
1495 offset: usize,
1496 _depth: fidl::encoding::Depth,
1497 ) -> fidl::Result<()> {
1498 decoder.debug_check_bounds::<Self>(offset);
1499 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1501 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1502 let mask = 0xffffffff00000000u64;
1503 let maskedval = padval & mask;
1504 if maskedval != 0 {
1505 return Err(fidl::Error::NonZeroPadding {
1506 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1507 });
1508 }
1509 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
1510 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1511 let mask = 0xffffffff00000000u64;
1512 let maskedval = padval & mask;
1513 if maskedval != 0 {
1514 return Err(fidl::Error::NonZeroPadding {
1515 padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
1516 });
1517 }
1518 fidl::decode!(
1519 fidl::encoding::UnboundedString,
1520 fidl::encoding::DefaultFuchsiaResourceDialect,
1521 &mut self.moniker,
1522 decoder,
1523 offset + 0,
1524 _depth
1525 )?;
1526 fidl::decode!(
1527 fidl::encoding::Endpoint<
1528 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_pty::DeviceMarker>,
1529 >,
1530 fidl::encoding::DefaultFuchsiaResourceDialect,
1531 &mut self.pty,
1532 decoder,
1533 offset + 16,
1534 _depth
1535 )?;
1536 fidl::decode!(
1537 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1538 fidl::encoding::DefaultFuchsiaResourceDialect,
1539 &mut self.tool_urls,
1540 decoder,
1541 offset + 24,
1542 _depth
1543 )?;
1544 fidl::decode!(
1545 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1546 fidl::encoding::DefaultFuchsiaResourceDialect,
1547 &mut self.command,
1548 decoder,
1549 offset + 40,
1550 _depth
1551 )?;
1552 fidl::decode!(
1553 DashNamespaceLayout,
1554 fidl::encoding::DefaultFuchsiaResourceDialect,
1555 &mut self.ns_layout,
1556 decoder,
1557 offset + 56,
1558 _depth
1559 )?;
1560 Ok(())
1561 }
1562 }
1563
1564 impl fidl::encoding::ResourceTypeMarker for LauncherExploreComponentOverSocketRequest {
1565 type Borrowed<'a> = &'a mut Self;
1566 fn take_or_borrow<'a>(
1567 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1568 ) -> Self::Borrowed<'a> {
1569 value
1570 }
1571 }
1572
1573 unsafe impl fidl::encoding::TypeMarker for LauncherExploreComponentOverSocketRequest {
1574 type Owned = Self;
1575
1576 #[inline(always)]
1577 fn inline_align(_context: fidl::encoding::Context) -> usize {
1578 8
1579 }
1580
1581 #[inline(always)]
1582 fn inline_size(_context: fidl::encoding::Context) -> usize {
1583 64
1584 }
1585 }
1586
1587 unsafe impl
1588 fidl::encoding::Encode<
1589 LauncherExploreComponentOverSocketRequest,
1590 fidl::encoding::DefaultFuchsiaResourceDialect,
1591 > for &mut LauncherExploreComponentOverSocketRequest
1592 {
1593 #[inline]
1594 unsafe fn encode(
1595 self,
1596 encoder: &mut fidl::encoding::Encoder<
1597 '_,
1598 fidl::encoding::DefaultFuchsiaResourceDialect,
1599 >,
1600 offset: usize,
1601 _depth: fidl::encoding::Depth,
1602 ) -> fidl::Result<()> {
1603 encoder.debug_check_bounds::<LauncherExploreComponentOverSocketRequest>(offset);
1604 fidl::encoding::Encode::<LauncherExploreComponentOverSocketRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1606 (
1607 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1608 <fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
1609 <fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool_urls),
1610 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
1611 <DashNamespaceLayout as fidl::encoding::ValueTypeMarker>::borrow(&self.ns_layout),
1612 ),
1613 encoder, offset, _depth
1614 )
1615 }
1616 }
1617 unsafe impl<
1618 T0: fidl::encoding::Encode<
1619 fidl::encoding::UnboundedString,
1620 fidl::encoding::DefaultFuchsiaResourceDialect,
1621 >,
1622 T1: fidl::encoding::Encode<
1623 fidl::encoding::HandleType<
1624 fidl::Socket,
1625 { fidl::ObjectType::SOCKET.into_raw() },
1626 2147483648,
1627 >,
1628 fidl::encoding::DefaultFuchsiaResourceDialect,
1629 >,
1630 T2: fidl::encoding::Encode<
1631 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1632 fidl::encoding::DefaultFuchsiaResourceDialect,
1633 >,
1634 T3: fidl::encoding::Encode<
1635 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1636 fidl::encoding::DefaultFuchsiaResourceDialect,
1637 >,
1638 T4: fidl::encoding::Encode<
1639 DashNamespaceLayout,
1640 fidl::encoding::DefaultFuchsiaResourceDialect,
1641 >,
1642 >
1643 fidl::encoding::Encode<
1644 LauncherExploreComponentOverSocketRequest,
1645 fidl::encoding::DefaultFuchsiaResourceDialect,
1646 > for (T0, T1, T2, T3, T4)
1647 {
1648 #[inline]
1649 unsafe fn encode(
1650 self,
1651 encoder: &mut fidl::encoding::Encoder<
1652 '_,
1653 fidl::encoding::DefaultFuchsiaResourceDialect,
1654 >,
1655 offset: usize,
1656 depth: fidl::encoding::Depth,
1657 ) -> fidl::Result<()> {
1658 encoder.debug_check_bounds::<LauncherExploreComponentOverSocketRequest>(offset);
1659 unsafe {
1662 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1663 (ptr as *mut u64).write_unaligned(0);
1664 }
1665 unsafe {
1666 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
1667 (ptr as *mut u64).write_unaligned(0);
1668 }
1669 self.0.encode(encoder, offset + 0, depth)?;
1671 self.1.encode(encoder, offset + 16, depth)?;
1672 self.2.encode(encoder, offset + 24, depth)?;
1673 self.3.encode(encoder, offset + 40, depth)?;
1674 self.4.encode(encoder, offset + 56, depth)?;
1675 Ok(())
1676 }
1677 }
1678
1679 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1680 for LauncherExploreComponentOverSocketRequest
1681 {
1682 #[inline(always)]
1683 fn new_empty() -> Self {
1684 Self {
1685 moniker: fidl::new_empty!(
1686 fidl::encoding::UnboundedString,
1687 fidl::encoding::DefaultFuchsiaResourceDialect
1688 ),
1689 socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1690 tool_urls: fidl::new_empty!(
1691 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1692 fidl::encoding::DefaultFuchsiaResourceDialect
1693 ),
1694 command: fidl::new_empty!(
1695 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1696 fidl::encoding::DefaultFuchsiaResourceDialect
1697 ),
1698 ns_layout: fidl::new_empty!(
1699 DashNamespaceLayout,
1700 fidl::encoding::DefaultFuchsiaResourceDialect
1701 ),
1702 }
1703 }
1704
1705 #[inline]
1706 unsafe fn decode(
1707 &mut self,
1708 decoder: &mut fidl::encoding::Decoder<
1709 '_,
1710 fidl::encoding::DefaultFuchsiaResourceDialect,
1711 >,
1712 offset: usize,
1713 _depth: fidl::encoding::Depth,
1714 ) -> fidl::Result<()> {
1715 decoder.debug_check_bounds::<Self>(offset);
1716 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1718 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1719 let mask = 0xffffffff00000000u64;
1720 let maskedval = padval & mask;
1721 if maskedval != 0 {
1722 return Err(fidl::Error::NonZeroPadding {
1723 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1724 });
1725 }
1726 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
1727 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1728 let mask = 0xffffffff00000000u64;
1729 let maskedval = padval & mask;
1730 if maskedval != 0 {
1731 return Err(fidl::Error::NonZeroPadding {
1732 padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
1733 });
1734 }
1735 fidl::decode!(
1736 fidl::encoding::UnboundedString,
1737 fidl::encoding::DefaultFuchsiaResourceDialect,
1738 &mut self.moniker,
1739 decoder,
1740 offset + 0,
1741 _depth
1742 )?;
1743 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 16, _depth)?;
1744 fidl::decode!(
1745 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1746 fidl::encoding::DefaultFuchsiaResourceDialect,
1747 &mut self.tool_urls,
1748 decoder,
1749 offset + 24,
1750 _depth
1751 )?;
1752 fidl::decode!(
1753 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1754 fidl::encoding::DefaultFuchsiaResourceDialect,
1755 &mut self.command,
1756 decoder,
1757 offset + 40,
1758 _depth
1759 )?;
1760 fidl::decode!(
1761 DashNamespaceLayout,
1762 fidl::encoding::DefaultFuchsiaResourceDialect,
1763 &mut self.ns_layout,
1764 decoder,
1765 offset + 56,
1766 _depth
1767 )?;
1768 Ok(())
1769 }
1770 }
1771
1772 impl fidl::encoding::ResourceTypeMarker for LauncherExplorePackageOverSocket2Request {
1773 type Borrowed<'a> = &'a mut Self;
1774 fn take_or_borrow<'a>(
1775 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1776 ) -> Self::Borrowed<'a> {
1777 value
1778 }
1779 }
1780
1781 unsafe impl fidl::encoding::TypeMarker for LauncherExplorePackageOverSocket2Request {
1782 type Owned = Self;
1783
1784 #[inline(always)]
1785 fn inline_align(_context: fidl::encoding::Context) -> usize {
1786 8
1787 }
1788
1789 #[inline(always)]
1790 fn inline_size(_context: fidl::encoding::Context) -> usize {
1791 80
1792 }
1793 }
1794
1795 unsafe impl
1796 fidl::encoding::Encode<
1797 LauncherExplorePackageOverSocket2Request,
1798 fidl::encoding::DefaultFuchsiaResourceDialect,
1799 > for &mut LauncherExplorePackageOverSocket2Request
1800 {
1801 #[inline]
1802 unsafe fn encode(
1803 self,
1804 encoder: &mut fidl::encoding::Encoder<
1805 '_,
1806 fidl::encoding::DefaultFuchsiaResourceDialect,
1807 >,
1808 offset: usize,
1809 _depth: fidl::encoding::Depth,
1810 ) -> fidl::Result<()> {
1811 encoder.debug_check_bounds::<LauncherExplorePackageOverSocket2Request>(offset);
1812 fidl::encoding::Encode::<LauncherExplorePackageOverSocket2Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1814 (
1815 <FuchsiaPkgResolver as fidl::encoding::ValueTypeMarker>::borrow(&self.fuchsia_pkg_resolver),
1816 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
1817 <fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.subpackages),
1818 <fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
1819 <fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool_urls),
1820 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
1821 ),
1822 encoder, offset, _depth
1823 )
1824 }
1825 }
1826 unsafe impl<
1827 T0: fidl::encoding::Encode<
1828 FuchsiaPkgResolver,
1829 fidl::encoding::DefaultFuchsiaResourceDialect,
1830 >,
1831 T1: fidl::encoding::Encode<
1832 fidl::encoding::UnboundedString,
1833 fidl::encoding::DefaultFuchsiaResourceDialect,
1834 >,
1835 T2: fidl::encoding::Encode<
1836 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
1837 fidl::encoding::DefaultFuchsiaResourceDialect,
1838 >,
1839 T3: fidl::encoding::Encode<
1840 fidl::encoding::HandleType<
1841 fidl::Socket,
1842 { fidl::ObjectType::SOCKET.into_raw() },
1843 2147483648,
1844 >,
1845 fidl::encoding::DefaultFuchsiaResourceDialect,
1846 >,
1847 T4: fidl::encoding::Encode<
1848 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1849 fidl::encoding::DefaultFuchsiaResourceDialect,
1850 >,
1851 T5: fidl::encoding::Encode<
1852 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1853 fidl::encoding::DefaultFuchsiaResourceDialect,
1854 >,
1855 >
1856 fidl::encoding::Encode<
1857 LauncherExplorePackageOverSocket2Request,
1858 fidl::encoding::DefaultFuchsiaResourceDialect,
1859 > for (T0, T1, T2, T3, T4, T5)
1860 {
1861 #[inline]
1862 unsafe fn encode(
1863 self,
1864 encoder: &mut fidl::encoding::Encoder<
1865 '_,
1866 fidl::encoding::DefaultFuchsiaResourceDialect,
1867 >,
1868 offset: usize,
1869 depth: fidl::encoding::Depth,
1870 ) -> fidl::Result<()> {
1871 encoder.debug_check_bounds::<LauncherExplorePackageOverSocket2Request>(offset);
1872 unsafe {
1875 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1876 (ptr as *mut u64).write_unaligned(0);
1877 }
1878 unsafe {
1879 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
1880 (ptr as *mut u64).write_unaligned(0);
1881 }
1882 self.0.encode(encoder, offset + 0, depth)?;
1884 self.1.encode(encoder, offset + 8, depth)?;
1885 self.2.encode(encoder, offset + 24, depth)?;
1886 self.3.encode(encoder, offset + 40, depth)?;
1887 self.4.encode(encoder, offset + 48, depth)?;
1888 self.5.encode(encoder, offset + 64, depth)?;
1889 Ok(())
1890 }
1891 }
1892
1893 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1894 for LauncherExplorePackageOverSocket2Request
1895 {
1896 #[inline(always)]
1897 fn new_empty() -> Self {
1898 Self {
1899 fuchsia_pkg_resolver: fidl::new_empty!(
1900 FuchsiaPkgResolver,
1901 fidl::encoding::DefaultFuchsiaResourceDialect
1902 ),
1903 url: fidl::new_empty!(
1904 fidl::encoding::UnboundedString,
1905 fidl::encoding::DefaultFuchsiaResourceDialect
1906 ),
1907 subpackages: fidl::new_empty!(
1908 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
1909 fidl::encoding::DefaultFuchsiaResourceDialect
1910 ),
1911 socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1912 tool_urls: fidl::new_empty!(
1913 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1914 fidl::encoding::DefaultFuchsiaResourceDialect
1915 ),
1916 command: fidl::new_empty!(
1917 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1918 fidl::encoding::DefaultFuchsiaResourceDialect
1919 ),
1920 }
1921 }
1922
1923 #[inline]
1924 unsafe fn decode(
1925 &mut self,
1926 decoder: &mut fidl::encoding::Decoder<
1927 '_,
1928 fidl::encoding::DefaultFuchsiaResourceDialect,
1929 >,
1930 offset: usize,
1931 _depth: fidl::encoding::Depth,
1932 ) -> fidl::Result<()> {
1933 decoder.debug_check_bounds::<Self>(offset);
1934 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1936 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1937 let mask = 0xffffffff00000000u64;
1938 let maskedval = padval & mask;
1939 if maskedval != 0 {
1940 return Err(fidl::Error::NonZeroPadding {
1941 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1942 });
1943 }
1944 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
1945 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1946 let mask = 0xffffffff00000000u64;
1947 let maskedval = padval & mask;
1948 if maskedval != 0 {
1949 return Err(fidl::Error::NonZeroPadding {
1950 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
1951 });
1952 }
1953 fidl::decode!(
1954 FuchsiaPkgResolver,
1955 fidl::encoding::DefaultFuchsiaResourceDialect,
1956 &mut self.fuchsia_pkg_resolver,
1957 decoder,
1958 offset + 0,
1959 _depth
1960 )?;
1961 fidl::decode!(
1962 fidl::encoding::UnboundedString,
1963 fidl::encoding::DefaultFuchsiaResourceDialect,
1964 &mut self.url,
1965 decoder,
1966 offset + 8,
1967 _depth
1968 )?;
1969 fidl::decode!(
1970 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
1971 fidl::encoding::DefaultFuchsiaResourceDialect,
1972 &mut self.subpackages,
1973 decoder,
1974 offset + 24,
1975 _depth
1976 )?;
1977 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 40, _depth)?;
1978 fidl::decode!(
1979 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
1980 fidl::encoding::DefaultFuchsiaResourceDialect,
1981 &mut self.tool_urls,
1982 decoder,
1983 offset + 48,
1984 _depth
1985 )?;
1986 fidl::decode!(
1987 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
1988 fidl::encoding::DefaultFuchsiaResourceDialect,
1989 &mut self.command,
1990 decoder,
1991 offset + 64,
1992 _depth
1993 )?;
1994 Ok(())
1995 }
1996 }
1997
1998 impl fidl::encoding::ResourceTypeMarker for LauncherExplorePackageOverSocketRequest {
1999 type Borrowed<'a> = &'a mut Self;
2000 fn take_or_borrow<'a>(
2001 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2002 ) -> Self::Borrowed<'a> {
2003 value
2004 }
2005 }
2006
2007 unsafe impl fidl::encoding::TypeMarker for LauncherExplorePackageOverSocketRequest {
2008 type Owned = Self;
2009
2010 #[inline(always)]
2011 fn inline_align(_context: fidl::encoding::Context) -> usize {
2012 8
2013 }
2014
2015 #[inline(always)]
2016 fn inline_size(_context: fidl::encoding::Context) -> usize {
2017 72
2018 }
2019 }
2020
2021 unsafe impl
2022 fidl::encoding::Encode<
2023 LauncherExplorePackageOverSocketRequest,
2024 fidl::encoding::DefaultFuchsiaResourceDialect,
2025 > for &mut LauncherExplorePackageOverSocketRequest
2026 {
2027 #[inline]
2028 unsafe fn encode(
2029 self,
2030 encoder: &mut fidl::encoding::Encoder<
2031 '_,
2032 fidl::encoding::DefaultFuchsiaResourceDialect,
2033 >,
2034 offset: usize,
2035 _depth: fidl::encoding::Depth,
2036 ) -> fidl::Result<()> {
2037 encoder.debug_check_bounds::<LauncherExplorePackageOverSocketRequest>(offset);
2038 fidl::encoding::Encode::<LauncherExplorePackageOverSocketRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2040 (
2041 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
2042 <fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.subpackages),
2043 <fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
2044 <fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20> as fidl::encoding::ValueTypeMarker>::borrow(&self.tool_urls),
2045 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
2046 ),
2047 encoder, offset, _depth
2048 )
2049 }
2050 }
2051 unsafe impl<
2052 T0: fidl::encoding::Encode<
2053 fidl::encoding::UnboundedString,
2054 fidl::encoding::DefaultFuchsiaResourceDialect,
2055 >,
2056 T1: fidl::encoding::Encode<
2057 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
2058 fidl::encoding::DefaultFuchsiaResourceDialect,
2059 >,
2060 T2: fidl::encoding::Encode<
2061 fidl::encoding::HandleType<
2062 fidl::Socket,
2063 { fidl::ObjectType::SOCKET.into_raw() },
2064 2147483648,
2065 >,
2066 fidl::encoding::DefaultFuchsiaResourceDialect,
2067 >,
2068 T3: fidl::encoding::Encode<
2069 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
2070 fidl::encoding::DefaultFuchsiaResourceDialect,
2071 >,
2072 T4: fidl::encoding::Encode<
2073 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
2074 fidl::encoding::DefaultFuchsiaResourceDialect,
2075 >,
2076 >
2077 fidl::encoding::Encode<
2078 LauncherExplorePackageOverSocketRequest,
2079 fidl::encoding::DefaultFuchsiaResourceDialect,
2080 > for (T0, T1, T2, T3, T4)
2081 {
2082 #[inline]
2083 unsafe fn encode(
2084 self,
2085 encoder: &mut fidl::encoding::Encoder<
2086 '_,
2087 fidl::encoding::DefaultFuchsiaResourceDialect,
2088 >,
2089 offset: usize,
2090 depth: fidl::encoding::Depth,
2091 ) -> fidl::Result<()> {
2092 encoder.debug_check_bounds::<LauncherExplorePackageOverSocketRequest>(offset);
2093 unsafe {
2096 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
2097 (ptr as *mut u64).write_unaligned(0);
2098 }
2099 self.0.encode(encoder, offset + 0, depth)?;
2101 self.1.encode(encoder, offset + 16, depth)?;
2102 self.2.encode(encoder, offset + 32, depth)?;
2103 self.3.encode(encoder, offset + 40, depth)?;
2104 self.4.encode(encoder, offset + 56, depth)?;
2105 Ok(())
2106 }
2107 }
2108
2109 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2110 for LauncherExplorePackageOverSocketRequest
2111 {
2112 #[inline(always)]
2113 fn new_empty() -> Self {
2114 Self {
2115 url: fidl::new_empty!(
2116 fidl::encoding::UnboundedString,
2117 fidl::encoding::DefaultFuchsiaResourceDialect
2118 ),
2119 subpackages: fidl::new_empty!(
2120 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
2121 fidl::encoding::DefaultFuchsiaResourceDialect
2122 ),
2123 socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2124 tool_urls: fidl::new_empty!(
2125 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
2126 fidl::encoding::DefaultFuchsiaResourceDialect
2127 ),
2128 command: fidl::new_empty!(
2129 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
2130 fidl::encoding::DefaultFuchsiaResourceDialect
2131 ),
2132 }
2133 }
2134
2135 #[inline]
2136 unsafe fn decode(
2137 &mut self,
2138 decoder: &mut fidl::encoding::Decoder<
2139 '_,
2140 fidl::encoding::DefaultFuchsiaResourceDialect,
2141 >,
2142 offset: usize,
2143 _depth: fidl::encoding::Depth,
2144 ) -> fidl::Result<()> {
2145 decoder.debug_check_bounds::<Self>(offset);
2146 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
2148 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2149 let mask = 0xffffffff00000000u64;
2150 let maskedval = padval & mask;
2151 if maskedval != 0 {
2152 return Err(fidl::Error::NonZeroPadding {
2153 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
2154 });
2155 }
2156 fidl::decode!(
2157 fidl::encoding::UnboundedString,
2158 fidl::encoding::DefaultFuchsiaResourceDialect,
2159 &mut self.url,
2160 decoder,
2161 offset + 0,
2162 _depth
2163 )?;
2164 fidl::decode!(
2165 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
2166 fidl::encoding::DefaultFuchsiaResourceDialect,
2167 &mut self.subpackages,
2168 decoder,
2169 offset + 16,
2170 _depth
2171 )?;
2172 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 32, _depth)?;
2173 fidl::decode!(
2174 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 20>,
2175 fidl::encoding::DefaultFuchsiaResourceDialect,
2176 &mut self.tool_urls,
2177 decoder,
2178 offset + 40,
2179 _depth
2180 )?;
2181 fidl::decode!(
2182 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
2183 fidl::encoding::DefaultFuchsiaResourceDialect,
2184 &mut self.command,
2185 decoder,
2186 offset + 56,
2187 _depth
2188 )?;
2189 Ok(())
2190 }
2191 }
2192}