1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[doc = " Information about a handle provided to a process at startup.\n\n Processes are given a set of initial handles as part of the bootstrapping\n sequence. Some of these handles are associated with process argument\n identifiers that designate their intended use by the new process.\n\n This structure represents one such handle and its associated identifier.\n"]
6#[derive(Debug)]
7#[repr(C)]
8pub struct HandleInfo {
9 pub handle: ::fidl_next::fuchsia::zx::Handle,
10
11 pub id: u32,
12}
13
14impl ::fidl_next::Encodable for HandleInfo {
15 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireHandleInfo> = unsafe {
16 ::fidl_next::CopyOptimization::enable_if(
17 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
18 .is_enabled()
19 && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
20 )
21 };
22
23 type Encoded = WireHandleInfo;
24}
25
26unsafe impl<___E> ::fidl_next::Encode<___E> for HandleInfo
27where
28 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
29
30 ___E: ::fidl_next::fuchsia::HandleEncoder,
31{
32 #[inline]
33 fn encode(
34 self,
35 encoder: &mut ___E,
36 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
37 ) -> Result<(), ::fidl_next::EncodeError> {
38 ::fidl_next::munge! {
39 let Self::Encoded {
40 handle,
41 id,
42
43 } = out;
44 }
45
46 ::fidl_next::Encode::encode(self.handle, encoder, handle)?;
47
48 ::fidl_next::Encode::encode(self.id, encoder, id)?;
49
50 Ok(())
51 }
52}
53
54impl ::fidl_next::EncodableOption for HandleInfo {
55 type EncodedOption = ::fidl_next::WireBox<'static, WireHandleInfo>;
56}
57
58unsafe impl<___E> ::fidl_next::EncodeOption<___E> for HandleInfo
59where
60 ___E: ::fidl_next::Encoder + ?Sized,
61 HandleInfo: ::fidl_next::Encode<___E>,
62{
63 #[inline]
64 fn encode_option(
65 this: Option<Self>,
66 encoder: &mut ___E,
67 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
68 ) -> Result<(), ::fidl_next::EncodeError> {
69 if let Some(inner) = this {
70 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
71 ::fidl_next::WireBox::encode_present(out);
72 } else {
73 ::fidl_next::WireBox::encode_absent(out);
74 }
75
76 Ok(())
77 }
78}
79
80impl ::fidl_next::FromWire<WireHandleInfo> for HandleInfo {
81 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireHandleInfo, Self> = unsafe {
82 ::fidl_next::CopyOptimization::enable_if(
83 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
84 ::fidl_next::fuchsia::WireHandle,
85 >>::COPY_OPTIMIZATION
86 .is_enabled()
87 && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
88 .is_enabled(),
89 )
90 };
91
92 #[inline]
93 fn from_wire(wire: WireHandleInfo) -> Self {
94 Self {
95 handle: ::fidl_next::FromWire::from_wire(wire.handle),
96
97 id: ::fidl_next::FromWire::from_wire(wire.id),
98 }
99 }
100}
101
102#[derive(Debug)]
104#[repr(C)]
105pub struct WireHandleInfo {
106 pub handle: ::fidl_next::fuchsia::WireHandle,
107
108 pub id: ::fidl_next::WireU32,
109}
110
111unsafe impl ::fidl_next::Wire for WireHandleInfo {
112 type Decoded<'de> = WireHandleInfo;
113
114 #[inline]
115 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
116}
117
118unsafe impl<___D> ::fidl_next::Decode<___D> for WireHandleInfo
119where
120 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
121
122 ___D: ::fidl_next::fuchsia::HandleDecoder,
123{
124 fn decode(
125 slot: ::fidl_next::Slot<'_, Self>,
126 decoder: &mut ___D,
127 ) -> Result<(), ::fidl_next::DecodeError> {
128 ::fidl_next::munge! {
129 let Self {
130 mut handle,
131 mut id,
132
133 } = slot;
134 }
135
136 ::fidl_next::Decode::decode(handle.as_mut(), decoder)?;
137
138 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
139
140 Ok(())
141 }
142}
143
144#[doc = " The information needed to launch a process.\n"]
145#[derive(Debug)]
146pub struct LaunchInfo {
147 pub executable: ::fidl_next::fuchsia::zx::Handle,
148
149 pub job: ::fidl_next::fuchsia::zx::Handle,
150
151 pub name: String,
152}
153
154impl ::fidl_next::Encodable for LaunchInfo {
155 type Encoded = WireLaunchInfo<'static>;
156}
157
158unsafe impl<___E> ::fidl_next::Encode<___E> for LaunchInfo
159where
160 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
161
162 ___E: ::fidl_next::Encoder,
163
164 ___E: ::fidl_next::fuchsia::HandleEncoder,
165{
166 #[inline]
167 fn encode(
168 self,
169 encoder: &mut ___E,
170 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
171 ) -> Result<(), ::fidl_next::EncodeError> {
172 ::fidl_next::munge! {
173 let Self::Encoded {
174 executable,
175 job,
176 name,
177
178 } = out;
179 }
180
181 ::fidl_next::Encode::encode(self.executable, encoder, executable)?;
182
183 ::fidl_next::Encode::encode(self.job, encoder, job)?;
184
185 ::fidl_next::Encode::encode(self.name, encoder, name)?;
186
187 Ok(())
188 }
189}
190
191impl ::fidl_next::EncodableOption for LaunchInfo {
192 type EncodedOption = ::fidl_next::WireBox<'static, WireLaunchInfo<'static>>;
193}
194
195unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LaunchInfo
196where
197 ___E: ::fidl_next::Encoder + ?Sized,
198 LaunchInfo: ::fidl_next::Encode<___E>,
199{
200 #[inline]
201 fn encode_option(
202 this: Option<Self>,
203 encoder: &mut ___E,
204 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
205 ) -> Result<(), ::fidl_next::EncodeError> {
206 if let Some(inner) = this {
207 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
208 ::fidl_next::WireBox::encode_present(out);
209 } else {
210 ::fidl_next::WireBox::encode_absent(out);
211 }
212
213 Ok(())
214 }
215}
216
217impl<'de> ::fidl_next::FromWire<WireLaunchInfo<'de>> for LaunchInfo {
218 #[inline]
219 fn from_wire(wire: WireLaunchInfo<'de>) -> Self {
220 Self {
221 executable: ::fidl_next::FromWire::from_wire(wire.executable),
222
223 job: ::fidl_next::FromWire::from_wire(wire.job),
224
225 name: ::fidl_next::FromWire::from_wire(wire.name),
226 }
227 }
228}
229
230#[derive(Debug)]
232#[repr(C)]
233pub struct WireLaunchInfo<'de> {
234 pub executable: ::fidl_next::fuchsia::WireHandle,
235
236 pub job: ::fidl_next::fuchsia::WireHandle,
237
238 pub name: ::fidl_next::WireString<'de>,
239}
240
241unsafe impl ::fidl_next::Wire for WireLaunchInfo<'static> {
242 type Decoded<'de> = WireLaunchInfo<'de>;
243
244 #[inline]
245 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
246}
247
248unsafe impl<___D> ::fidl_next::Decode<___D> for WireLaunchInfo<'static>
249where
250 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
251
252 ___D: ::fidl_next::Decoder,
253
254 ___D: ::fidl_next::fuchsia::HandleDecoder,
255{
256 fn decode(
257 slot: ::fidl_next::Slot<'_, Self>,
258 decoder: &mut ___D,
259 ) -> Result<(), ::fidl_next::DecodeError> {
260 ::fidl_next::munge! {
261 let Self {
262 mut executable,
263 mut job,
264 mut name,
265
266 } = slot;
267 }
268
269 ::fidl_next::Decode::decode(executable.as_mut(), decoder)?;
270
271 ::fidl_next::Decode::decode(job.as_mut(), decoder)?;
272
273 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
274
275 let name = unsafe { name.deref_unchecked() };
276
277 if name.len() > 32 {
278 return Err(::fidl_next::DecodeError::VectorTooLong {
279 size: name.len() as u64,
280 limit: 32,
281 });
282 }
283
284 Ok(())
285 }
286}
287
288#[derive(Debug)]
289pub struct LauncherLaunchRequest {
290 pub info: crate::LaunchInfo,
291}
292
293impl ::fidl_next::Encodable for LauncherLaunchRequest {
294 type Encoded = WireLauncherLaunchRequest<'static>;
295}
296
297unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherLaunchRequest
298where
299 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
300
301 ___E: ::fidl_next::Encoder,
302
303 ___E: ::fidl_next::fuchsia::HandleEncoder,
304{
305 #[inline]
306 fn encode(
307 self,
308 encoder: &mut ___E,
309 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
310 ) -> Result<(), ::fidl_next::EncodeError> {
311 ::fidl_next::munge! {
312 let Self::Encoded {
313 info,
314
315 } = out;
316 }
317
318 ::fidl_next::Encode::encode(self.info, encoder, info)?;
319
320 Ok(())
321 }
322}
323
324impl ::fidl_next::EncodableOption for LauncherLaunchRequest {
325 type EncodedOption = ::fidl_next::WireBox<'static, WireLauncherLaunchRequest<'static>>;
326}
327
328unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherLaunchRequest
329where
330 ___E: ::fidl_next::Encoder + ?Sized,
331 LauncherLaunchRequest: ::fidl_next::Encode<___E>,
332{
333 #[inline]
334 fn encode_option(
335 this: Option<Self>,
336 encoder: &mut ___E,
337 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
338 ) -> Result<(), ::fidl_next::EncodeError> {
339 if let Some(inner) = this {
340 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
341 ::fidl_next::WireBox::encode_present(out);
342 } else {
343 ::fidl_next::WireBox::encode_absent(out);
344 }
345
346 Ok(())
347 }
348}
349
350impl<'de> ::fidl_next::FromWire<WireLauncherLaunchRequest<'de>> for LauncherLaunchRequest {
351 #[inline]
352 fn from_wire(wire: WireLauncherLaunchRequest<'de>) -> Self {
353 Self { info: ::fidl_next::FromWire::from_wire(wire.info) }
354 }
355}
356
357#[derive(Debug)]
359#[repr(C)]
360pub struct WireLauncherLaunchRequest<'de> {
361 pub info: crate::WireLaunchInfo<'de>,
362}
363
364unsafe impl ::fidl_next::Wire for WireLauncherLaunchRequest<'static> {
365 type Decoded<'de> = WireLauncherLaunchRequest<'de>;
366
367 #[inline]
368 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
369}
370
371unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherLaunchRequest<'static>
372where
373 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
374
375 ___D: ::fidl_next::Decoder,
376
377 ___D: ::fidl_next::fuchsia::HandleDecoder,
378{
379 fn decode(
380 slot: ::fidl_next::Slot<'_, Self>,
381 decoder: &mut ___D,
382 ) -> Result<(), ::fidl_next::DecodeError> {
383 ::fidl_next::munge! {
384 let Self {
385 mut info,
386
387 } = slot;
388 }
389
390 ::fidl_next::Decode::decode(info.as_mut(), decoder)?;
391
392 Ok(())
393 }
394}
395
396#[derive(Debug)]
397#[repr(C)]
398pub struct LauncherLaunchResponse {
399 pub status: i32,
400
401 pub process: Option<::fidl_next::fuchsia::zx::Handle>,
402}
403
404impl ::fidl_next::Encodable for LauncherLaunchResponse {
405 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLauncherLaunchResponse> = unsafe {
406 ::fidl_next::CopyOptimization::enable_if(
407 true
408
409 && <
410 i32 as ::fidl_next::Encodable
411 >::COPY_OPTIMIZATION.is_enabled()
412
413 && <
414 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
415 >::COPY_OPTIMIZATION.is_enabled()
416
417 )
418 };
419
420 type Encoded = WireLauncherLaunchResponse;
421}
422
423unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherLaunchResponse
424where
425 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
426
427 ___E: ::fidl_next::fuchsia::HandleEncoder,
428{
429 #[inline]
430 fn encode(
431 self,
432 encoder: &mut ___E,
433 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
434 ) -> Result<(), ::fidl_next::EncodeError> {
435 ::fidl_next::munge! {
436 let Self::Encoded {
437 status,
438 process,
439
440 } = out;
441 }
442
443 ::fidl_next::Encode::encode(self.status, encoder, status)?;
444
445 ::fidl_next::Encode::encode(self.process, encoder, process)?;
446
447 Ok(())
448 }
449}
450
451impl ::fidl_next::EncodableOption for LauncherLaunchResponse {
452 type EncodedOption = ::fidl_next::WireBox<'static, WireLauncherLaunchResponse>;
453}
454
455unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherLaunchResponse
456where
457 ___E: ::fidl_next::Encoder + ?Sized,
458 LauncherLaunchResponse: ::fidl_next::Encode<___E>,
459{
460 #[inline]
461 fn encode_option(
462 this: Option<Self>,
463 encoder: &mut ___E,
464 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
465 ) -> Result<(), ::fidl_next::EncodeError> {
466 if let Some(inner) = this {
467 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
468 ::fidl_next::WireBox::encode_present(out);
469 } else {
470 ::fidl_next::WireBox::encode_absent(out);
471 }
472
473 Ok(())
474 }
475}
476
477impl ::fidl_next::FromWire<WireLauncherLaunchResponse> for LauncherLaunchResponse {
478 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLauncherLaunchResponse, Self> = unsafe {
479 ::fidl_next::CopyOptimization::enable_if(
480 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
481 .is_enabled()
482 && <Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::FromWire<
483 ::fidl_next::fuchsia::WireOptionalHandle,
484 >>::COPY_OPTIMIZATION
485 .is_enabled(),
486 )
487 };
488
489 #[inline]
490 fn from_wire(wire: WireLauncherLaunchResponse) -> Self {
491 Self {
492 status: ::fidl_next::FromWire::from_wire(wire.status),
493
494 process: ::fidl_next::FromWire::from_wire(wire.process),
495 }
496 }
497}
498
499#[derive(Debug)]
501#[repr(C)]
502pub struct WireLauncherLaunchResponse {
503 pub status: ::fidl_next::WireI32,
504
505 pub process: ::fidl_next::fuchsia::WireOptionalHandle,
506}
507
508unsafe impl ::fidl_next::Wire for WireLauncherLaunchResponse {
509 type Decoded<'de> = WireLauncherLaunchResponse;
510
511 #[inline]
512 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
513}
514
515unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherLaunchResponse
516where
517 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
518
519 ___D: ::fidl_next::fuchsia::HandleDecoder,
520{
521 fn decode(
522 slot: ::fidl_next::Slot<'_, Self>,
523 decoder: &mut ___D,
524 ) -> Result<(), ::fidl_next::DecodeError> {
525 ::fidl_next::munge! {
526 let Self {
527 mut status,
528 mut process,
529
530 } = slot;
531 }
532
533 ::fidl_next::Decode::decode(status.as_mut(), decoder)?;
534
535 ::fidl_next::Decode::decode(process.as_mut(), decoder)?;
536
537 Ok(())
538 }
539}
540
541#[derive(Debug)]
542pub struct LauncherCreateWithoutStartingRequest {
543 pub info: crate::LaunchInfo,
544}
545
546impl ::fidl_next::Encodable for LauncherCreateWithoutStartingRequest {
547 type Encoded = WireLauncherCreateWithoutStartingRequest<'static>;
548}
549
550unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherCreateWithoutStartingRequest
551where
552 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
553
554 ___E: ::fidl_next::Encoder,
555
556 ___E: ::fidl_next::fuchsia::HandleEncoder,
557{
558 #[inline]
559 fn encode(
560 self,
561 encoder: &mut ___E,
562 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
563 ) -> Result<(), ::fidl_next::EncodeError> {
564 ::fidl_next::munge! {
565 let Self::Encoded {
566 info,
567
568 } = out;
569 }
570
571 ::fidl_next::Encode::encode(self.info, encoder, info)?;
572
573 Ok(())
574 }
575}
576
577impl ::fidl_next::EncodableOption for LauncherCreateWithoutStartingRequest {
578 type EncodedOption =
579 ::fidl_next::WireBox<'static, WireLauncherCreateWithoutStartingRequest<'static>>;
580}
581
582unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherCreateWithoutStartingRequest
583where
584 ___E: ::fidl_next::Encoder + ?Sized,
585 LauncherCreateWithoutStartingRequest: ::fidl_next::Encode<___E>,
586{
587 #[inline]
588 fn encode_option(
589 this: Option<Self>,
590 encoder: &mut ___E,
591 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
592 ) -> Result<(), ::fidl_next::EncodeError> {
593 if let Some(inner) = this {
594 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
595 ::fidl_next::WireBox::encode_present(out);
596 } else {
597 ::fidl_next::WireBox::encode_absent(out);
598 }
599
600 Ok(())
601 }
602}
603
604impl<'de> ::fidl_next::FromWire<WireLauncherCreateWithoutStartingRequest<'de>>
605 for LauncherCreateWithoutStartingRequest
606{
607 #[inline]
608 fn from_wire(wire: WireLauncherCreateWithoutStartingRequest<'de>) -> Self {
609 Self { info: ::fidl_next::FromWire::from_wire(wire.info) }
610 }
611}
612
613#[derive(Debug)]
615#[repr(C)]
616pub struct WireLauncherCreateWithoutStartingRequest<'de> {
617 pub info: crate::WireLaunchInfo<'de>,
618}
619
620unsafe impl ::fidl_next::Wire for WireLauncherCreateWithoutStartingRequest<'static> {
621 type Decoded<'de> = WireLauncherCreateWithoutStartingRequest<'de>;
622
623 #[inline]
624 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
625}
626
627unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherCreateWithoutStartingRequest<'static>
628where
629 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
630
631 ___D: ::fidl_next::Decoder,
632
633 ___D: ::fidl_next::fuchsia::HandleDecoder,
634{
635 fn decode(
636 slot: ::fidl_next::Slot<'_, Self>,
637 decoder: &mut ___D,
638 ) -> Result<(), ::fidl_next::DecodeError> {
639 ::fidl_next::munge! {
640 let Self {
641 mut info,
642
643 } = slot;
644 }
645
646 ::fidl_next::Decode::decode(info.as_mut(), decoder)?;
647
648 Ok(())
649 }
650}
651
652#[derive(Debug)]
653pub struct LauncherCreateWithoutStartingResponse {
654 pub status: i32,
655
656 pub data: Option<Box<crate::ProcessStartData>>,
657}
658
659impl ::fidl_next::Encodable for LauncherCreateWithoutStartingResponse {
660 type Encoded = WireLauncherCreateWithoutStartingResponse<'static>;
661}
662
663unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherCreateWithoutStartingResponse
664where
665 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
666
667 ___E: ::fidl_next::Encoder,
668
669 ___E: ::fidl_next::fuchsia::HandleEncoder,
670{
671 #[inline]
672 fn encode(
673 self,
674 encoder: &mut ___E,
675 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
676 ) -> Result<(), ::fidl_next::EncodeError> {
677 ::fidl_next::munge! {
678 let Self::Encoded {
679 status,
680 data,
681
682 } = out;
683 }
684
685 ::fidl_next::Encode::encode(self.status, encoder, status)?;
686
687 ::fidl_next::Encode::encode(self.data, encoder, data)?;
688
689 Ok(())
690 }
691}
692
693impl ::fidl_next::EncodableOption for LauncherCreateWithoutStartingResponse {
694 type EncodedOption =
695 ::fidl_next::WireBox<'static, WireLauncherCreateWithoutStartingResponse<'static>>;
696}
697
698unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherCreateWithoutStartingResponse
699where
700 ___E: ::fidl_next::Encoder + ?Sized,
701 LauncherCreateWithoutStartingResponse: ::fidl_next::Encode<___E>,
702{
703 #[inline]
704 fn encode_option(
705 this: Option<Self>,
706 encoder: &mut ___E,
707 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
708 ) -> Result<(), ::fidl_next::EncodeError> {
709 if let Some(inner) = this {
710 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
711 ::fidl_next::WireBox::encode_present(out);
712 } else {
713 ::fidl_next::WireBox::encode_absent(out);
714 }
715
716 Ok(())
717 }
718}
719
720impl<'de> ::fidl_next::FromWire<WireLauncherCreateWithoutStartingResponse<'de>>
721 for LauncherCreateWithoutStartingResponse
722{
723 #[inline]
724 fn from_wire(wire: WireLauncherCreateWithoutStartingResponse<'de>) -> Self {
725 Self {
726 status: ::fidl_next::FromWire::from_wire(wire.status),
727
728 data: ::fidl_next::FromWire::from_wire(wire.data),
729 }
730 }
731}
732
733#[derive(Debug)]
735#[repr(C)]
736pub struct WireLauncherCreateWithoutStartingResponse<'de> {
737 pub status: ::fidl_next::WireI32,
738
739 pub data: ::fidl_next::WireBox<'de, crate::WireProcessStartData>,
740}
741
742unsafe impl ::fidl_next::Wire for WireLauncherCreateWithoutStartingResponse<'static> {
743 type Decoded<'de> = WireLauncherCreateWithoutStartingResponse<'de>;
744
745 #[inline]
746 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
747 unsafe {
748 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
749 }
750 }
751}
752
753unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherCreateWithoutStartingResponse<'static>
754where
755 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
756
757 ___D: ::fidl_next::Decoder,
758
759 ___D: ::fidl_next::fuchsia::HandleDecoder,
760{
761 fn decode(
762 slot: ::fidl_next::Slot<'_, Self>,
763 decoder: &mut ___D,
764 ) -> Result<(), ::fidl_next::DecodeError> {
765 ::fidl_next::munge! {
766 let Self {
767 mut status,
768 mut data,
769
770 } = slot;
771 }
772
773 ::fidl_next::Decode::decode(status.as_mut(), decoder)?;
774
775 ::fidl_next::Decode::decode(data.as_mut(), decoder)?;
776
777 Ok(())
778 }
779}
780
781#[derive(Clone, Debug)]
782pub struct LauncherAddArgsRequest {
783 pub args: Vec<Vec<u8>>,
784}
785
786impl ::fidl_next::Encodable for LauncherAddArgsRequest {
787 type Encoded = WireLauncherAddArgsRequest<'static>;
788}
789
790unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherAddArgsRequest
791where
792 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
793
794 ___E: ::fidl_next::Encoder,
795{
796 #[inline]
797 fn encode(
798 self,
799 encoder: &mut ___E,
800 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
801 ) -> Result<(), ::fidl_next::EncodeError> {
802 ::fidl_next::munge! {
803 let Self::Encoded {
804 args,
805
806 } = out;
807 }
808
809 ::fidl_next::Encode::encode(self.args, encoder, args)?;
810
811 Ok(())
812 }
813}
814
815unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LauncherAddArgsRequest
816where
817 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
818
819 ___E: ::fidl_next::Encoder,
820{
821 #[inline]
822 fn encode_ref(
823 &self,
824 encoder: &mut ___E,
825 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
826 ) -> Result<(), ::fidl_next::EncodeError> {
827 ::fidl_next::munge! {
828 let Self::Encoded {
829 args,
830
831 } = out;
832 }
833
834 ::fidl_next::EncodeRef::encode_ref(&self.args, encoder, args)?;
835
836 Ok(())
837 }
838}
839
840impl ::fidl_next::EncodableOption for LauncherAddArgsRequest {
841 type EncodedOption = ::fidl_next::WireBox<'static, WireLauncherAddArgsRequest<'static>>;
842}
843
844unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherAddArgsRequest
845where
846 ___E: ::fidl_next::Encoder + ?Sized,
847 LauncherAddArgsRequest: ::fidl_next::Encode<___E>,
848{
849 #[inline]
850 fn encode_option(
851 this: Option<Self>,
852 encoder: &mut ___E,
853 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
854 ) -> Result<(), ::fidl_next::EncodeError> {
855 if let Some(inner) = this {
856 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
857 ::fidl_next::WireBox::encode_present(out);
858 } else {
859 ::fidl_next::WireBox::encode_absent(out);
860 }
861
862 Ok(())
863 }
864}
865
866unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LauncherAddArgsRequest
867where
868 ___E: ::fidl_next::Encoder + ?Sized,
869 LauncherAddArgsRequest: ::fidl_next::EncodeRef<___E>,
870{
871 #[inline]
872 fn encode_option_ref(
873 this: Option<&Self>,
874 encoder: &mut ___E,
875 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
876 ) -> Result<(), ::fidl_next::EncodeError> {
877 if let Some(inner) = this {
878 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
879 ::fidl_next::WireBox::encode_present(out);
880 } else {
881 ::fidl_next::WireBox::encode_absent(out);
882 }
883
884 Ok(())
885 }
886}
887
888impl<'de> ::fidl_next::FromWire<WireLauncherAddArgsRequest<'de>> for LauncherAddArgsRequest {
889 #[inline]
890 fn from_wire(wire: WireLauncherAddArgsRequest<'de>) -> Self {
891 Self { args: ::fidl_next::FromWire::from_wire(wire.args) }
892 }
893}
894
895impl<'de> ::fidl_next::FromWireRef<WireLauncherAddArgsRequest<'de>> for LauncherAddArgsRequest {
896 #[inline]
897 fn from_wire_ref(wire: &WireLauncherAddArgsRequest<'de>) -> Self {
898 Self { args: ::fidl_next::FromWireRef::from_wire_ref(&wire.args) }
899 }
900}
901
902#[derive(Debug)]
904#[repr(C)]
905pub struct WireLauncherAddArgsRequest<'de> {
906 pub args: ::fidl_next::WireVector<'de, ::fidl_next::WireVector<'de, u8>>,
907}
908
909unsafe impl ::fidl_next::Wire for WireLauncherAddArgsRequest<'static> {
910 type Decoded<'de> = WireLauncherAddArgsRequest<'de>;
911
912 #[inline]
913 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
914}
915
916unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherAddArgsRequest<'static>
917where
918 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
919
920 ___D: ::fidl_next::Decoder,
921{
922 fn decode(
923 slot: ::fidl_next::Slot<'_, Self>,
924 decoder: &mut ___D,
925 ) -> Result<(), ::fidl_next::DecodeError> {
926 ::fidl_next::munge! {
927 let Self {
928 mut args,
929
930 } = slot;
931 }
932
933 ::fidl_next::Decode::decode(args.as_mut(), decoder)?;
934
935 Ok(())
936 }
937}
938
939#[derive(Clone, Debug)]
940pub struct LauncherAddEnvironsRequest {
941 pub environ: Vec<Vec<u8>>,
942}
943
944impl ::fidl_next::Encodable for LauncherAddEnvironsRequest {
945 type Encoded = WireLauncherAddEnvironsRequest<'static>;
946}
947
948unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherAddEnvironsRequest
949where
950 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
951
952 ___E: ::fidl_next::Encoder,
953{
954 #[inline]
955 fn encode(
956 self,
957 encoder: &mut ___E,
958 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
959 ) -> Result<(), ::fidl_next::EncodeError> {
960 ::fidl_next::munge! {
961 let Self::Encoded {
962 environ,
963
964 } = out;
965 }
966
967 ::fidl_next::Encode::encode(self.environ, encoder, environ)?;
968
969 Ok(())
970 }
971}
972
973unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LauncherAddEnvironsRequest
974where
975 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
976
977 ___E: ::fidl_next::Encoder,
978{
979 #[inline]
980 fn encode_ref(
981 &self,
982 encoder: &mut ___E,
983 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
984 ) -> Result<(), ::fidl_next::EncodeError> {
985 ::fidl_next::munge! {
986 let Self::Encoded {
987 environ,
988
989 } = out;
990 }
991
992 ::fidl_next::EncodeRef::encode_ref(&self.environ, encoder, environ)?;
993
994 Ok(())
995 }
996}
997
998impl ::fidl_next::EncodableOption for LauncherAddEnvironsRequest {
999 type EncodedOption = ::fidl_next::WireBox<'static, WireLauncherAddEnvironsRequest<'static>>;
1000}
1001
1002unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherAddEnvironsRequest
1003where
1004 ___E: ::fidl_next::Encoder + ?Sized,
1005 LauncherAddEnvironsRequest: ::fidl_next::Encode<___E>,
1006{
1007 #[inline]
1008 fn encode_option(
1009 this: Option<Self>,
1010 encoder: &mut ___E,
1011 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1012 ) -> Result<(), ::fidl_next::EncodeError> {
1013 if let Some(inner) = this {
1014 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1015 ::fidl_next::WireBox::encode_present(out);
1016 } else {
1017 ::fidl_next::WireBox::encode_absent(out);
1018 }
1019
1020 Ok(())
1021 }
1022}
1023
1024unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LauncherAddEnvironsRequest
1025where
1026 ___E: ::fidl_next::Encoder + ?Sized,
1027 LauncherAddEnvironsRequest: ::fidl_next::EncodeRef<___E>,
1028{
1029 #[inline]
1030 fn encode_option_ref(
1031 this: Option<&Self>,
1032 encoder: &mut ___E,
1033 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1034 ) -> Result<(), ::fidl_next::EncodeError> {
1035 if let Some(inner) = this {
1036 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1037 ::fidl_next::WireBox::encode_present(out);
1038 } else {
1039 ::fidl_next::WireBox::encode_absent(out);
1040 }
1041
1042 Ok(())
1043 }
1044}
1045
1046impl<'de> ::fidl_next::FromWire<WireLauncherAddEnvironsRequest<'de>>
1047 for LauncherAddEnvironsRequest
1048{
1049 #[inline]
1050 fn from_wire(wire: WireLauncherAddEnvironsRequest<'de>) -> Self {
1051 Self { environ: ::fidl_next::FromWire::from_wire(wire.environ) }
1052 }
1053}
1054
1055impl<'de> ::fidl_next::FromWireRef<WireLauncherAddEnvironsRequest<'de>>
1056 for LauncherAddEnvironsRequest
1057{
1058 #[inline]
1059 fn from_wire_ref(wire: &WireLauncherAddEnvironsRequest<'de>) -> Self {
1060 Self { environ: ::fidl_next::FromWireRef::from_wire_ref(&wire.environ) }
1061 }
1062}
1063
1064#[derive(Debug)]
1066#[repr(C)]
1067pub struct WireLauncherAddEnvironsRequest<'de> {
1068 pub environ: ::fidl_next::WireVector<'de, ::fidl_next::WireVector<'de, u8>>,
1069}
1070
1071unsafe impl ::fidl_next::Wire for WireLauncherAddEnvironsRequest<'static> {
1072 type Decoded<'de> = WireLauncherAddEnvironsRequest<'de>;
1073
1074 #[inline]
1075 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1076}
1077
1078unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherAddEnvironsRequest<'static>
1079where
1080 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1081
1082 ___D: ::fidl_next::Decoder,
1083{
1084 fn decode(
1085 slot: ::fidl_next::Slot<'_, Self>,
1086 decoder: &mut ___D,
1087 ) -> Result<(), ::fidl_next::DecodeError> {
1088 ::fidl_next::munge! {
1089 let Self {
1090 mut environ,
1091
1092 } = slot;
1093 }
1094
1095 ::fidl_next::Decode::decode(environ.as_mut(), decoder)?;
1096
1097 Ok(())
1098 }
1099}
1100
1101#[derive(Debug)]
1102pub struct LauncherAddHandlesRequest {
1103 pub handles: Vec<crate::HandleInfo>,
1104}
1105
1106impl ::fidl_next::Encodable for LauncherAddHandlesRequest {
1107 type Encoded = WireLauncherAddHandlesRequest<'static>;
1108}
1109
1110unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherAddHandlesRequest
1111where
1112 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1113
1114 ___E: ::fidl_next::Encoder,
1115
1116 ___E: ::fidl_next::fuchsia::HandleEncoder,
1117{
1118 #[inline]
1119 fn encode(
1120 self,
1121 encoder: &mut ___E,
1122 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1123 ) -> Result<(), ::fidl_next::EncodeError> {
1124 ::fidl_next::munge! {
1125 let Self::Encoded {
1126 handles,
1127
1128 } = out;
1129 }
1130
1131 ::fidl_next::Encode::encode(self.handles, encoder, handles)?;
1132
1133 Ok(())
1134 }
1135}
1136
1137impl ::fidl_next::EncodableOption for LauncherAddHandlesRequest {
1138 type EncodedOption = ::fidl_next::WireBox<'static, WireLauncherAddHandlesRequest<'static>>;
1139}
1140
1141unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherAddHandlesRequest
1142where
1143 ___E: ::fidl_next::Encoder + ?Sized,
1144 LauncherAddHandlesRequest: ::fidl_next::Encode<___E>,
1145{
1146 #[inline]
1147 fn encode_option(
1148 this: Option<Self>,
1149 encoder: &mut ___E,
1150 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1151 ) -> Result<(), ::fidl_next::EncodeError> {
1152 if let Some(inner) = this {
1153 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1154 ::fidl_next::WireBox::encode_present(out);
1155 } else {
1156 ::fidl_next::WireBox::encode_absent(out);
1157 }
1158
1159 Ok(())
1160 }
1161}
1162
1163impl<'de> ::fidl_next::FromWire<WireLauncherAddHandlesRequest<'de>> for LauncherAddHandlesRequest {
1164 #[inline]
1165 fn from_wire(wire: WireLauncherAddHandlesRequest<'de>) -> Self {
1166 Self { handles: ::fidl_next::FromWire::from_wire(wire.handles) }
1167 }
1168}
1169
1170#[derive(Debug)]
1172#[repr(C)]
1173pub struct WireLauncherAddHandlesRequest<'de> {
1174 pub handles: ::fidl_next::WireVector<'de, crate::WireHandleInfo>,
1175}
1176
1177unsafe impl ::fidl_next::Wire for WireLauncherAddHandlesRequest<'static> {
1178 type Decoded<'de> = WireLauncherAddHandlesRequest<'de>;
1179
1180 #[inline]
1181 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1182}
1183
1184unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherAddHandlesRequest<'static>
1185where
1186 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1187
1188 ___D: ::fidl_next::Decoder,
1189
1190 ___D: ::fidl_next::fuchsia::HandleDecoder,
1191{
1192 fn decode(
1193 slot: ::fidl_next::Slot<'_, Self>,
1194 decoder: &mut ___D,
1195 ) -> Result<(), ::fidl_next::DecodeError> {
1196 ::fidl_next::munge! {
1197 let Self {
1198 mut handles,
1199
1200 } = slot;
1201 }
1202
1203 ::fidl_next::Decode::decode(handles.as_mut(), decoder)?;
1204
1205 Ok(())
1206 }
1207}
1208
1209#[derive(Clone, Debug)]
1210#[repr(C)]
1211pub struct LauncherSetOptionsRequest {
1212 pub options: u32,
1213}
1214
1215impl ::fidl_next::Encodable for LauncherSetOptionsRequest {
1216 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLauncherSetOptionsRequest> = unsafe {
1217 ::fidl_next::CopyOptimization::enable_if(
1218 true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
1219 )
1220 };
1221
1222 type Encoded = WireLauncherSetOptionsRequest;
1223}
1224
1225unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherSetOptionsRequest
1226where
1227 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1228{
1229 #[inline]
1230 fn encode(
1231 self,
1232 encoder: &mut ___E,
1233 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1234 ) -> Result<(), ::fidl_next::EncodeError> {
1235 ::fidl_next::munge! {
1236 let Self::Encoded {
1237 options,
1238
1239 } = out;
1240 }
1241
1242 ::fidl_next::Encode::encode(self.options, encoder, options)?;
1243
1244 Ok(())
1245 }
1246}
1247
1248unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LauncherSetOptionsRequest
1249where
1250 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1251{
1252 #[inline]
1253 fn encode_ref(
1254 &self,
1255 encoder: &mut ___E,
1256 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1257 ) -> Result<(), ::fidl_next::EncodeError> {
1258 ::fidl_next::munge! {
1259 let Self::Encoded {
1260 options,
1261
1262 } = out;
1263 }
1264
1265 ::fidl_next::EncodeRef::encode_ref(&self.options, encoder, options)?;
1266
1267 Ok(())
1268 }
1269}
1270
1271impl ::fidl_next::EncodableOption for LauncherSetOptionsRequest {
1272 type EncodedOption = ::fidl_next::WireBox<'static, WireLauncherSetOptionsRequest>;
1273}
1274
1275unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherSetOptionsRequest
1276where
1277 ___E: ::fidl_next::Encoder + ?Sized,
1278 LauncherSetOptionsRequest: ::fidl_next::Encode<___E>,
1279{
1280 #[inline]
1281 fn encode_option(
1282 this: Option<Self>,
1283 encoder: &mut ___E,
1284 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1285 ) -> Result<(), ::fidl_next::EncodeError> {
1286 if let Some(inner) = this {
1287 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1288 ::fidl_next::WireBox::encode_present(out);
1289 } else {
1290 ::fidl_next::WireBox::encode_absent(out);
1291 }
1292
1293 Ok(())
1294 }
1295}
1296
1297unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LauncherSetOptionsRequest
1298where
1299 ___E: ::fidl_next::Encoder + ?Sized,
1300 LauncherSetOptionsRequest: ::fidl_next::EncodeRef<___E>,
1301{
1302 #[inline]
1303 fn encode_option_ref(
1304 this: Option<&Self>,
1305 encoder: &mut ___E,
1306 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1307 ) -> Result<(), ::fidl_next::EncodeError> {
1308 if let Some(inner) = this {
1309 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1310 ::fidl_next::WireBox::encode_present(out);
1311 } else {
1312 ::fidl_next::WireBox::encode_absent(out);
1313 }
1314
1315 Ok(())
1316 }
1317}
1318
1319impl ::fidl_next::FromWire<WireLauncherSetOptionsRequest> for LauncherSetOptionsRequest {
1320 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLauncherSetOptionsRequest, Self> = unsafe {
1321 ::fidl_next::CopyOptimization::enable_if(
1322 true && <u32 as ::fidl_next::FromWire<::fidl_next::WireU32>>::COPY_OPTIMIZATION
1323 .is_enabled(),
1324 )
1325 };
1326
1327 #[inline]
1328 fn from_wire(wire: WireLauncherSetOptionsRequest) -> Self {
1329 Self { options: ::fidl_next::FromWire::from_wire(wire.options) }
1330 }
1331}
1332
1333impl ::fidl_next::FromWireRef<WireLauncherSetOptionsRequest> for LauncherSetOptionsRequest {
1334 #[inline]
1335 fn from_wire_ref(wire: &WireLauncherSetOptionsRequest) -> Self {
1336 Self { options: ::fidl_next::FromWireRef::from_wire_ref(&wire.options) }
1337 }
1338}
1339
1340#[derive(Clone, Debug)]
1342#[repr(C)]
1343pub struct WireLauncherSetOptionsRequest {
1344 pub options: ::fidl_next::WireU32,
1345}
1346
1347unsafe impl ::fidl_next::Wire for WireLauncherSetOptionsRequest {
1348 type Decoded<'de> = WireLauncherSetOptionsRequest;
1349
1350 #[inline]
1351 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1352}
1353
1354unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherSetOptionsRequest
1355where
1356 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1357{
1358 fn decode(
1359 slot: ::fidl_next::Slot<'_, Self>,
1360 decoder: &mut ___D,
1361 ) -> Result<(), ::fidl_next::DecodeError> {
1362 ::fidl_next::munge! {
1363 let Self {
1364 mut options,
1365
1366 } = slot;
1367 }
1368
1369 ::fidl_next::Decode::decode(options.as_mut(), decoder)?;
1370
1371 Ok(())
1372 }
1373}
1374
1375#[doc = " A namespace entry provided to a process at startup.\n\n Processes are given a set of initial handles as part of the bootstrapping\n sequence. Some of these handles are associated with paths that designate\n their intended use by the new process as namespace entries.\n\n This structure represents one such handle and its associated namespace path.\n"]
1376#[derive(Debug)]
1377pub struct NameInfo {
1378 pub path: String,
1379
1380 pub directory: ::fidl_next::ClientEnd<
1381 ::fidl_next_fuchsia_io::Directory,
1382 ::fidl_next::fuchsia::zx::Channel,
1383 >,
1384}
1385
1386impl ::fidl_next::Encodable for NameInfo {
1387 type Encoded = WireNameInfo<'static>;
1388}
1389
1390unsafe impl<___E> ::fidl_next::Encode<___E> for NameInfo
1391where
1392 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1393
1394 ___E: ::fidl_next::Encoder,
1395
1396 ___E: ::fidl_next::fuchsia::HandleEncoder,
1397{
1398 #[inline]
1399 fn encode(
1400 self,
1401 encoder: &mut ___E,
1402 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1403 ) -> Result<(), ::fidl_next::EncodeError> {
1404 ::fidl_next::munge! {
1405 let Self::Encoded {
1406 path,
1407 directory,
1408
1409 } = out;
1410 }
1411
1412 ::fidl_next::Encode::encode(self.path, encoder, path)?;
1413
1414 ::fidl_next::Encode::encode(self.directory, encoder, directory)?;
1415
1416 Ok(())
1417 }
1418}
1419
1420impl ::fidl_next::EncodableOption for NameInfo {
1421 type EncodedOption = ::fidl_next::WireBox<'static, WireNameInfo<'static>>;
1422}
1423
1424unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NameInfo
1425where
1426 ___E: ::fidl_next::Encoder + ?Sized,
1427 NameInfo: ::fidl_next::Encode<___E>,
1428{
1429 #[inline]
1430 fn encode_option(
1431 this: Option<Self>,
1432 encoder: &mut ___E,
1433 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1434 ) -> Result<(), ::fidl_next::EncodeError> {
1435 if let Some(inner) = this {
1436 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1437 ::fidl_next::WireBox::encode_present(out);
1438 } else {
1439 ::fidl_next::WireBox::encode_absent(out);
1440 }
1441
1442 Ok(())
1443 }
1444}
1445
1446impl<'de> ::fidl_next::FromWire<WireNameInfo<'de>> for NameInfo {
1447 #[inline]
1448 fn from_wire(wire: WireNameInfo<'de>) -> Self {
1449 Self {
1450 path: ::fidl_next::FromWire::from_wire(wire.path),
1451
1452 directory: ::fidl_next::FromWire::from_wire(wire.directory),
1453 }
1454 }
1455}
1456
1457#[derive(Debug)]
1459#[repr(C)]
1460pub struct WireNameInfo<'de> {
1461 pub path: ::fidl_next::WireString<'de>,
1462
1463 pub directory: ::fidl_next::ClientEnd<
1464 ::fidl_next_fuchsia_io::Directory,
1465 ::fidl_next::fuchsia::WireChannel,
1466 >,
1467}
1468
1469unsafe impl ::fidl_next::Wire for WireNameInfo<'static> {
1470 type Decoded<'de> = WireNameInfo<'de>;
1471
1472 #[inline]
1473 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1474 unsafe {
1475 out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
1476 }
1477 }
1478}
1479
1480unsafe impl<___D> ::fidl_next::Decode<___D> for WireNameInfo<'static>
1481where
1482 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1483
1484 ___D: ::fidl_next::Decoder,
1485
1486 ___D: ::fidl_next::fuchsia::HandleDecoder,
1487{
1488 fn decode(
1489 slot: ::fidl_next::Slot<'_, Self>,
1490 decoder: &mut ___D,
1491 ) -> Result<(), ::fidl_next::DecodeError> {
1492 ::fidl_next::munge! {
1493 let Self {
1494 mut path,
1495 mut directory,
1496
1497 } = slot;
1498 }
1499
1500 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
1501
1502 let path = unsafe { path.deref_unchecked() };
1503
1504 if path.len() > 4095 {
1505 return Err(::fidl_next::DecodeError::VectorTooLong {
1506 size: path.len() as u64,
1507 limit: 4095,
1508 });
1509 }
1510
1511 ::fidl_next::Decode::decode(directory.as_mut(), decoder)?;
1512
1513 Ok(())
1514 }
1515}
1516
1517#[derive(Debug)]
1518pub struct LauncherAddNamesRequest {
1519 pub names: Vec<crate::NameInfo>,
1520}
1521
1522impl ::fidl_next::Encodable for LauncherAddNamesRequest {
1523 type Encoded = WireLauncherAddNamesRequest<'static>;
1524}
1525
1526unsafe impl<___E> ::fidl_next::Encode<___E> for LauncherAddNamesRequest
1527where
1528 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1529
1530 ___E: ::fidl_next::Encoder,
1531
1532 ___E: ::fidl_next::fuchsia::HandleEncoder,
1533{
1534 #[inline]
1535 fn encode(
1536 self,
1537 encoder: &mut ___E,
1538 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1539 ) -> Result<(), ::fidl_next::EncodeError> {
1540 ::fidl_next::munge! {
1541 let Self::Encoded {
1542 names,
1543
1544 } = out;
1545 }
1546
1547 ::fidl_next::Encode::encode(self.names, encoder, names)?;
1548
1549 Ok(())
1550 }
1551}
1552
1553impl ::fidl_next::EncodableOption for LauncherAddNamesRequest {
1554 type EncodedOption = ::fidl_next::WireBox<'static, WireLauncherAddNamesRequest<'static>>;
1555}
1556
1557unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LauncherAddNamesRequest
1558where
1559 ___E: ::fidl_next::Encoder + ?Sized,
1560 LauncherAddNamesRequest: ::fidl_next::Encode<___E>,
1561{
1562 #[inline]
1563 fn encode_option(
1564 this: Option<Self>,
1565 encoder: &mut ___E,
1566 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1567 ) -> Result<(), ::fidl_next::EncodeError> {
1568 if let Some(inner) = this {
1569 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1570 ::fidl_next::WireBox::encode_present(out);
1571 } else {
1572 ::fidl_next::WireBox::encode_absent(out);
1573 }
1574
1575 Ok(())
1576 }
1577}
1578
1579impl<'de> ::fidl_next::FromWire<WireLauncherAddNamesRequest<'de>> for LauncherAddNamesRequest {
1580 #[inline]
1581 fn from_wire(wire: WireLauncherAddNamesRequest<'de>) -> Self {
1582 Self { names: ::fidl_next::FromWire::from_wire(wire.names) }
1583 }
1584}
1585
1586#[derive(Debug)]
1588#[repr(C)]
1589pub struct WireLauncherAddNamesRequest<'de> {
1590 pub names: ::fidl_next::WireVector<'de, crate::WireNameInfo<'de>>,
1591}
1592
1593unsafe impl ::fidl_next::Wire for WireLauncherAddNamesRequest<'static> {
1594 type Decoded<'de> = WireLauncherAddNamesRequest<'de>;
1595
1596 #[inline]
1597 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1598}
1599
1600unsafe impl<___D> ::fidl_next::Decode<___D> for WireLauncherAddNamesRequest<'static>
1601where
1602 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1603
1604 ___D: ::fidl_next::Decoder,
1605
1606 ___D: ::fidl_next::fuchsia::HandleDecoder,
1607{
1608 fn decode(
1609 slot: ::fidl_next::Slot<'_, Self>,
1610 decoder: &mut ___D,
1611 ) -> Result<(), ::fidl_next::DecodeError> {
1612 ::fidl_next::munge! {
1613 let Self {
1614 mut names,
1615
1616 } = slot;
1617 }
1618
1619 ::fidl_next::Decode::decode(names.as_mut(), decoder)?;
1620
1621 Ok(())
1622 }
1623}
1624
1625#[doc = " A low-level interface for launching processes.\n\n This interface is used for manually assembling a process. The caller supplies\n all the capabilities for the newly created process.\n\n That create processes typically use `fdio_spawn` or `fdio_spawn_etc` rather\n than using this interface directly. The `fdio_spawn` and `fdio_spawn_etc`\n functions are implemented using this interface.\n\n Debuggers and other clients that need to create processes in a suspended\n state often use this interface directly. These clients use the\n `CreateWithoutStarting` method to create the process without actually\n starting it.\n"]
1627#[derive(Debug)]
1628pub struct Launcher;
1629
1630impl ::fidl_next::Discoverable for Launcher {
1631 const PROTOCOL_NAME: &'static str = "fuchsia.process.Launcher";
1632}
1633
1634pub mod launcher {
1635 pub mod prelude {
1636 pub use crate::{launcher, Launcher, LauncherClientHandler, LauncherServerHandler};
1637
1638 pub use crate::LauncherAddArgsRequest;
1639
1640 pub use crate::LauncherAddEnvironsRequest;
1641
1642 pub use crate::LauncherAddHandlesRequest;
1643
1644 pub use crate::LauncherAddNamesRequest;
1645
1646 pub use crate::LauncherCreateWithoutStartingRequest;
1647
1648 pub use crate::LauncherCreateWithoutStartingResponse;
1649
1650 pub use crate::LauncherLaunchRequest;
1651
1652 pub use crate::LauncherLaunchResponse;
1653
1654 pub use crate::LauncherSetOptionsRequest;
1655 }
1656
1657 pub struct Launch;
1658
1659 impl ::fidl_next::Method for Launch {
1660 const ORDINAL: u64 = 1239433936316120996;
1661
1662 type Protocol = crate::Launcher;
1663
1664 type Request = crate::WireLauncherLaunchRequest<'static>;
1665
1666 type Response = crate::WireLauncherLaunchResponse;
1667 }
1668
1669 pub struct CreateWithoutStarting;
1670
1671 impl ::fidl_next::Method for CreateWithoutStarting {
1672 const ORDINAL: u64 = 8457621991205227361;
1673
1674 type Protocol = crate::Launcher;
1675
1676 type Request = crate::WireLauncherCreateWithoutStartingRequest<'static>;
1677
1678 type Response = crate::WireLauncherCreateWithoutStartingResponse<'static>;
1679 }
1680
1681 pub struct AddArgs;
1682
1683 impl ::fidl_next::Method for AddArgs {
1684 const ORDINAL: u64 = 4315651119310005522;
1685
1686 type Protocol = crate::Launcher;
1687
1688 type Request = crate::WireLauncherAddArgsRequest<'static>;
1689
1690 type Response = ::fidl_next::Never;
1691 }
1692
1693 pub struct AddEnvirons;
1694
1695 impl ::fidl_next::Method for AddEnvirons {
1696 const ORDINAL: u64 = 8332725285682026361;
1697
1698 type Protocol = crate::Launcher;
1699
1700 type Request = crate::WireLauncherAddEnvironsRequest<'static>;
1701
1702 type Response = ::fidl_next::Never;
1703 }
1704
1705 pub struct AddNames;
1706
1707 impl ::fidl_next::Method for AddNames {
1708 const ORDINAL: u64 = 2700451326409737826;
1709
1710 type Protocol = crate::Launcher;
1711
1712 type Request = crate::WireLauncherAddNamesRequest<'static>;
1713
1714 type Response = ::fidl_next::Never;
1715 }
1716
1717 pub struct AddHandles;
1718
1719 impl ::fidl_next::Method for AddHandles {
1720 const ORDINAL: u64 = 5837318672132580885;
1721
1722 type Protocol = crate::Launcher;
1723
1724 type Request = crate::WireLauncherAddHandlesRequest<'static>;
1725
1726 type Response = ::fidl_next::Never;
1727 }
1728
1729 pub struct SetOptions;
1730
1731 impl ::fidl_next::Method for SetOptions {
1732 const ORDINAL: u64 = 6598432479381290375;
1733
1734 type Protocol = crate::Launcher;
1735
1736 type Request = crate::WireLauncherSetOptionsRequest;
1737
1738 type Response = ::fidl_next::Never;
1739 }
1740
1741 mod ___detail {
1742
1743 pub struct Launch<T0> {
1744 info: T0,
1745 }
1746
1747 impl<T0> ::fidl_next::Encodable for Launch<T0>
1748 where
1749 T0: ::fidl_next::Encodable<Encoded = crate::WireLaunchInfo<'static>>,
1750 {
1751 type Encoded = crate::WireLauncherLaunchRequest<'static>;
1752 }
1753
1754 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Launch<T0>
1755 where
1756 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1757
1758 ___E: ::fidl_next::Encoder,
1759
1760 ___E: ::fidl_next::fuchsia::HandleEncoder,
1761
1762 T0: ::fidl_next::Encode<___E, Encoded = crate::WireLaunchInfo<'static>>,
1763 {
1764 #[inline]
1765 fn encode(
1766 self,
1767 encoder: &mut ___E,
1768 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1769 ) -> Result<(), ::fidl_next::EncodeError> {
1770 ::fidl_next::munge! {
1771 let Self::Encoded {
1772 info,
1773
1774 } = out;
1775 }
1776
1777 ::fidl_next::Encode::encode(self.info, encoder, info)?;
1778
1779 Ok(())
1780 }
1781 }
1782
1783 pub struct CreateWithoutStarting<T0> {
1784 info: T0,
1785 }
1786
1787 impl<T0> ::fidl_next::Encodable for CreateWithoutStarting<T0>
1788 where
1789 T0: ::fidl_next::Encodable<Encoded = crate::WireLaunchInfo<'static>>,
1790 {
1791 type Encoded = crate::WireLauncherCreateWithoutStartingRequest<'static>;
1792 }
1793
1794 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for CreateWithoutStarting<T0>
1795 where
1796 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1797
1798 ___E: ::fidl_next::Encoder,
1799
1800 ___E: ::fidl_next::fuchsia::HandleEncoder,
1801
1802 T0: ::fidl_next::Encode<___E, Encoded = crate::WireLaunchInfo<'static>>,
1803 {
1804 #[inline]
1805 fn encode(
1806 self,
1807 encoder: &mut ___E,
1808 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1809 ) -> Result<(), ::fidl_next::EncodeError> {
1810 ::fidl_next::munge! {
1811 let Self::Encoded {
1812 info,
1813
1814 } = out;
1815 }
1816
1817 ::fidl_next::Encode::encode(self.info, encoder, info)?;
1818
1819 Ok(())
1820 }
1821 }
1822
1823 pub struct AddArgs<T0> {
1824 args: T0,
1825 }
1826
1827 impl<T0> ::fidl_next::Encodable for AddArgs<T0>
1828 where
1829 T0: ::fidl_next::Encodable<
1830 Encoded = ::fidl_next::WireVector<'static, ::fidl_next::WireVector<'static, u8>>,
1831 >,
1832 {
1833 type Encoded = crate::WireLauncherAddArgsRequest<'static>;
1834 }
1835
1836 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AddArgs<T0>
1837 where
1838 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1839
1840 ___E: ::fidl_next::Encoder,
1841
1842 T0: ::fidl_next::Encode<
1843 ___E,
1844 Encoded = ::fidl_next::WireVector<'static, ::fidl_next::WireVector<'static, u8>>,
1845 >,
1846 {
1847 #[inline]
1848 fn encode(
1849 self,
1850 encoder: &mut ___E,
1851 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1852 ) -> Result<(), ::fidl_next::EncodeError> {
1853 ::fidl_next::munge! {
1854 let Self::Encoded {
1855 args,
1856
1857 } = out;
1858 }
1859
1860 ::fidl_next::Encode::encode(self.args, encoder, args)?;
1861
1862 Ok(())
1863 }
1864 }
1865
1866 pub struct AddEnvirons<T0> {
1867 environ: T0,
1868 }
1869
1870 impl<T0> ::fidl_next::Encodable for AddEnvirons<T0>
1871 where
1872 T0: ::fidl_next::Encodable<
1873 Encoded = ::fidl_next::WireVector<'static, ::fidl_next::WireVector<'static, u8>>,
1874 >,
1875 {
1876 type Encoded = crate::WireLauncherAddEnvironsRequest<'static>;
1877 }
1878
1879 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AddEnvirons<T0>
1880 where
1881 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1882
1883 ___E: ::fidl_next::Encoder,
1884
1885 T0: ::fidl_next::Encode<
1886 ___E,
1887 Encoded = ::fidl_next::WireVector<'static, ::fidl_next::WireVector<'static, u8>>,
1888 >,
1889 {
1890 #[inline]
1891 fn encode(
1892 self,
1893 encoder: &mut ___E,
1894 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1895 ) -> Result<(), ::fidl_next::EncodeError> {
1896 ::fidl_next::munge! {
1897 let Self::Encoded {
1898 environ,
1899
1900 } = out;
1901 }
1902
1903 ::fidl_next::Encode::encode(self.environ, encoder, environ)?;
1904
1905 Ok(())
1906 }
1907 }
1908
1909 pub struct AddNames<T0> {
1910 names: T0,
1911 }
1912
1913 impl<T0> ::fidl_next::Encodable for AddNames<T0>
1914 where
1915 T0: ::fidl_next::Encodable<
1916 Encoded = ::fidl_next::WireVector<'static, crate::WireNameInfo<'static>>,
1917 >,
1918 {
1919 type Encoded = crate::WireLauncherAddNamesRequest<'static>;
1920 }
1921
1922 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AddNames<T0>
1923 where
1924 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1925
1926 ___E: ::fidl_next::Encoder,
1927
1928 ___E: ::fidl_next::fuchsia::HandleEncoder,
1929
1930 T0: ::fidl_next::Encode<
1931 ___E,
1932 Encoded = ::fidl_next::WireVector<'static, crate::WireNameInfo<'static>>,
1933 >,
1934 {
1935 #[inline]
1936 fn encode(
1937 self,
1938 encoder: &mut ___E,
1939 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1940 ) -> Result<(), ::fidl_next::EncodeError> {
1941 ::fidl_next::munge! {
1942 let Self::Encoded {
1943 names,
1944
1945 } = out;
1946 }
1947
1948 ::fidl_next::Encode::encode(self.names, encoder, names)?;
1949
1950 Ok(())
1951 }
1952 }
1953
1954 pub struct AddHandles<T0> {
1955 handles: T0,
1956 }
1957
1958 impl<T0> ::fidl_next::Encodable for AddHandles<T0>
1959 where
1960 T0: ::fidl_next::Encodable<
1961 Encoded = ::fidl_next::WireVector<'static, crate::WireHandleInfo>,
1962 >,
1963 {
1964 type Encoded = crate::WireLauncherAddHandlesRequest<'static>;
1965 }
1966
1967 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for AddHandles<T0>
1968 where
1969 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1970
1971 ___E: ::fidl_next::Encoder,
1972
1973 ___E: ::fidl_next::fuchsia::HandleEncoder,
1974
1975 T0: ::fidl_next::Encode<
1976 ___E,
1977 Encoded = ::fidl_next::WireVector<'static, crate::WireHandleInfo>,
1978 >,
1979 {
1980 #[inline]
1981 fn encode(
1982 self,
1983 encoder: &mut ___E,
1984 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1985 ) -> Result<(), ::fidl_next::EncodeError> {
1986 ::fidl_next::munge! {
1987 let Self::Encoded {
1988 handles,
1989
1990 } = out;
1991 }
1992
1993 ::fidl_next::Encode::encode(self.handles, encoder, handles)?;
1994
1995 Ok(())
1996 }
1997 }
1998
1999 pub struct SetOptions<T0> {
2000 options: T0,
2001 }
2002
2003 impl<T0> ::fidl_next::Encodable for SetOptions<T0>
2004 where
2005 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU32>,
2006 {
2007 type Encoded = crate::WireLauncherSetOptionsRequest;
2008 }
2009
2010 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for SetOptions<T0>
2011 where
2012 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2013
2014 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU32>,
2015 {
2016 #[inline]
2017 fn encode(
2018 self,
2019 encoder: &mut ___E,
2020 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2021 ) -> Result<(), ::fidl_next::EncodeError> {
2022 ::fidl_next::munge! {
2023 let Self::Encoded {
2024 options,
2025
2026 } = out;
2027 }
2028
2029 ::fidl_next::Encode::encode(self.options, encoder, options)?;
2030
2031 Ok(())
2032 }
2033 }
2034
2035 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Launcher
2036 where
2037 ___T: ::fidl_next::Transport,
2038 {
2039 type ClientSender = LauncherClientSender<___T>;
2040 type ServerSender = LauncherServerSender<___T>;
2041 }
2042
2043 pub struct LauncherClientSender<___T: ::fidl_next::Transport> {
2045 #[allow(dead_code)]
2046 sender: ::fidl_next::protocol::ClientSender<___T>,
2047 }
2048
2049 impl<___T> LauncherClientSender<___T>
2050 where
2051 ___T: ::fidl_next::Transport,
2052 {
2053 #[doc = " Creates and starts the process described by `info`.\n\n After processing this message, the `Launcher` is reset to its initial\n state and is ready to launch another process.\n\n `process` is present if, and only if, `status` is `ZX_OK`.\n"]
2054 pub fn launch(
2055 &self,
2056
2057 info: impl ::fidl_next::Encode<
2058 <___T as ::fidl_next::Transport>::SendBuffer,
2059 Encoded = crate::WireLaunchInfo<'static>,
2060 >,
2061 ) -> Result<
2062 ::fidl_next::ResponseFuture<'_, super::Launch, ___T>,
2063 ::fidl_next::EncodeError,
2064 >
2065 where
2066 <___T as ::fidl_next::Transport>::SendBuffer:
2067 ::fidl_next::encoder::InternalHandleEncoder,
2068
2069 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2070
2071 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2072 {
2073 self.launch_with(Launch { info })
2074 }
2075
2076 #[doc = " Creates and starts the process described by `info`.\n\n After processing this message, the `Launcher` is reset to its initial\n state and is ready to launch another process.\n\n `process` is present if, and only if, `status` is `ZX_OK`.\n"]
2077 pub fn launch_with<___R>(
2078 &self,
2079 request: ___R,
2080 ) -> Result<
2081 ::fidl_next::ResponseFuture<'_, super::Launch, ___T>,
2082 ::fidl_next::EncodeError,
2083 >
2084 where
2085 ___R: ::fidl_next::Encode<
2086 <___T as ::fidl_next::Transport>::SendBuffer,
2087 Encoded = crate::WireLauncherLaunchRequest<'static>,
2088 >,
2089 {
2090 self.sender
2091 .send_two_way(1239433936316120996, request)
2092 .map(::fidl_next::ResponseFuture::from_untyped)
2093 }
2094
2095 #[doc = " Creates the process described by `info` but does not start it.\n\n After processing this message, the `Launcher` is reset to its initial\n state and is ready to launch another process.\n\n The caller is responsible for calling `zx_process_start` using the data\n in `ProcessStartData` to actually start the process.\n\n `data` is present if, and only if, `status` is `ZX_OK`.\n"]
2096 pub fn create_without_starting(
2097 &self,
2098
2099 info: impl ::fidl_next::Encode<
2100 <___T as ::fidl_next::Transport>::SendBuffer,
2101 Encoded = crate::WireLaunchInfo<'static>,
2102 >,
2103 ) -> Result<
2104 ::fidl_next::ResponseFuture<'_, super::CreateWithoutStarting, ___T>,
2105 ::fidl_next::EncodeError,
2106 >
2107 where
2108 <___T as ::fidl_next::Transport>::SendBuffer:
2109 ::fidl_next::encoder::InternalHandleEncoder,
2110
2111 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2112
2113 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2114 {
2115 self.create_without_starting_with(CreateWithoutStarting { info })
2116 }
2117
2118 #[doc = " Creates the process described by `info` but does not start it.\n\n After processing this message, the `Launcher` is reset to its initial\n state and is ready to launch another process.\n\n The caller is responsible for calling `zx_process_start` using the data\n in `ProcessStartData` to actually start the process.\n\n `data` is present if, and only if, `status` is `ZX_OK`.\n"]
2119 pub fn create_without_starting_with<___R>(
2120 &self,
2121 request: ___R,
2122 ) -> Result<
2123 ::fidl_next::ResponseFuture<'_, super::CreateWithoutStarting, ___T>,
2124 ::fidl_next::EncodeError,
2125 >
2126 where
2127 ___R: ::fidl_next::Encode<
2128 <___T as ::fidl_next::Transport>::SendBuffer,
2129 Encoded = crate::WireLauncherCreateWithoutStartingRequest<'static>,
2130 >,
2131 {
2132 self.sender
2133 .send_two_way(8457621991205227361, request)
2134 .map(::fidl_next::ResponseFuture::from_untyped)
2135 }
2136
2137 #[doc = " Adds the given arguments to the command-line for the process.\n\n Calling this method multiple times concatenates the arguments.\n"]
2138 pub fn add_args(
2139 &self,
2140
2141 args: impl ::fidl_next::Encode<
2142 <___T as ::fidl_next::Transport>::SendBuffer,
2143 Encoded = ::fidl_next::WireVector<
2144 'static,
2145 ::fidl_next::WireVector<'static, u8>,
2146 >,
2147 >,
2148 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2149 where
2150 <___T as ::fidl_next::Transport>::SendBuffer:
2151 ::fidl_next::encoder::InternalHandleEncoder,
2152
2153 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2154 {
2155 self.add_args_with(AddArgs { args })
2156 }
2157
2158 #[doc = " Adds the given arguments to the command-line for the process.\n\n Calling this method multiple times concatenates the arguments.\n"]
2159 pub fn add_args_with<___R>(
2160 &self,
2161 request: ___R,
2162 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2163 where
2164 ___R: ::fidl_next::Encode<
2165 <___T as ::fidl_next::Transport>::SendBuffer,
2166 Encoded = crate::WireLauncherAddArgsRequest<'static>,
2167 >,
2168 {
2169 self.sender.send_one_way(4315651119310005522, request)
2170 }
2171
2172 #[doc = " Adds the given variables to the environment variables for the process.\n\n Calling this method multiple times concatenates the variables.\n"]
2173 pub fn add_environs(
2174 &self,
2175
2176 environ: impl ::fidl_next::Encode<
2177 <___T as ::fidl_next::Transport>::SendBuffer,
2178 Encoded = ::fidl_next::WireVector<
2179 'static,
2180 ::fidl_next::WireVector<'static, u8>,
2181 >,
2182 >,
2183 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2184 where
2185 <___T as ::fidl_next::Transport>::SendBuffer:
2186 ::fidl_next::encoder::InternalHandleEncoder,
2187
2188 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2189 {
2190 self.add_environs_with(AddEnvirons { environ })
2191 }
2192
2193 #[doc = " Adds the given variables to the environment variables for the process.\n\n Calling this method multiple times concatenates the variables.\n"]
2194 pub fn add_environs_with<___R>(
2195 &self,
2196 request: ___R,
2197 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2198 where
2199 ___R: ::fidl_next::Encode<
2200 <___T as ::fidl_next::Transport>::SendBuffer,
2201 Encoded = crate::WireLauncherAddEnvironsRequest<'static>,
2202 >,
2203 {
2204 self.sender.send_one_way(8332725285682026361, request)
2205 }
2206
2207 #[doc = " Adds the given names to the namespace for the process.\n\n The paths in the namespace must be non-overlapping. See\n <https://fuchsia.dev/fuchsia-src/concepts/process/namespaces> for details.\n\n Calling this method multiple times concatenates the names.\n"]
2208 pub fn add_names(
2209 &self,
2210
2211 names: impl ::fidl_next::Encode<
2212 <___T as ::fidl_next::Transport>::SendBuffer,
2213 Encoded = ::fidl_next::WireVector<'static, crate::WireNameInfo<'static>>,
2214 >,
2215 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2216 where
2217 <___T as ::fidl_next::Transport>::SendBuffer:
2218 ::fidl_next::encoder::InternalHandleEncoder,
2219
2220 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2221
2222 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2223 {
2224 self.add_names_with(AddNames { names })
2225 }
2226
2227 #[doc = " Adds the given names to the namespace for the process.\n\n The paths in the namespace must be non-overlapping. See\n <https://fuchsia.dev/fuchsia-src/concepts/process/namespaces> for details.\n\n Calling this method multiple times concatenates the names.\n"]
2228 pub fn add_names_with<___R>(
2229 &self,
2230 request: ___R,
2231 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2232 where
2233 ___R: ::fidl_next::Encode<
2234 <___T as ::fidl_next::Transport>::SendBuffer,
2235 Encoded = crate::WireLauncherAddNamesRequest<'static>,
2236 >,
2237 {
2238 self.sender.send_one_way(2700451326409737826, request)
2239 }
2240
2241 #[doc = " Adds the given handles to the startup handles for the process.\n\n Calling this method multiple times concatenates the handles.\n"]
2242 pub fn add_handles(
2243 &self,
2244
2245 handles: impl ::fidl_next::Encode<
2246 <___T as ::fidl_next::Transport>::SendBuffer,
2247 Encoded = ::fidl_next::WireVector<'static, crate::WireHandleInfo>,
2248 >,
2249 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2250 where
2251 <___T as ::fidl_next::Transport>::SendBuffer:
2252 ::fidl_next::encoder::InternalHandleEncoder,
2253
2254 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2255
2256 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2257 {
2258 self.add_handles_with(AddHandles { handles })
2259 }
2260
2261 #[doc = " Adds the given handles to the startup handles for the process.\n\n Calling this method multiple times concatenates the handles.\n"]
2262 pub fn add_handles_with<___R>(
2263 &self,
2264 request: ___R,
2265 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2266 where
2267 ___R: ::fidl_next::Encode<
2268 <___T as ::fidl_next::Transport>::SendBuffer,
2269 Encoded = crate::WireLauncherAddHandlesRequest<'static>,
2270 >,
2271 {
2272 self.sender.send_one_way(5837318672132580885, request)
2273 }
2274
2275 #[doc = " Sets the options with which the process is created.\n\n Calling this method multiple times will overwrite the current options.\n"]
2276 pub fn set_options(
2277 &self,
2278
2279 options: impl ::fidl_next::Encode<
2280 <___T as ::fidl_next::Transport>::SendBuffer,
2281 Encoded = ::fidl_next::WireU32,
2282 >,
2283 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2284 where
2285 <___T as ::fidl_next::Transport>::SendBuffer:
2286 ::fidl_next::encoder::InternalHandleEncoder,
2287 {
2288 self.set_options_with(SetOptions { options })
2289 }
2290
2291 #[doc = " Sets the options with which the process is created.\n\n Calling this method multiple times will overwrite the current options.\n"]
2292 pub fn set_options_with<___R>(
2293 &self,
2294 request: ___R,
2295 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
2296 where
2297 ___R: ::fidl_next::Encode<
2298 <___T as ::fidl_next::Transport>::SendBuffer,
2299 Encoded = crate::WireLauncherSetOptionsRequest,
2300 >,
2301 {
2302 self.sender.send_one_way(6598432479381290375, request)
2303 }
2304 }
2305
2306 #[repr(transparent)]
2308 pub struct LauncherServerSender<___T: ::fidl_next::Transport> {
2309 sender: ::fidl_next::protocol::ServerSender<___T>,
2310 }
2311
2312 impl<___T> LauncherServerSender<___T> where ___T: ::fidl_next::Transport {}
2313 }
2314}
2315
2316pub trait LauncherClientHandler<___T: ::fidl_next::Transport> {}
2320
2321impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Launcher
2322where
2323 ___H: LauncherClientHandler<___T> + Send,
2324 ___T: ::fidl_next::Transport,
2325
2326 <launcher::Launch as ::fidl_next::Method>::Response:
2327 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2328
2329 <launcher::CreateWithoutStarting as ::fidl_next::Method>::Response:
2330 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2331{
2332 async fn on_event(
2333 handler: &mut ___H,
2334 sender: &::fidl_next::ClientSender<Self, ___T>,
2335 ordinal: u64,
2336 buffer: ___T::RecvBuffer,
2337 ) {
2338 match ordinal {
2339 ordinal => {
2340 sender.close();
2341 }
2342 }
2343 }
2344}
2345
2346pub trait LauncherServerHandler<___T: ::fidl_next::Transport> {
2350 #[doc = " Creates and starts the process described by `info`.\n\n After processing this message, the `Launcher` is reset to its initial\n state and is ready to launch another process.\n\n `process` is present if, and only if, `status` is `ZX_OK`.\n"]
2351 fn launch(
2352 &mut self,
2353 sender: &::fidl_next::ServerSender<Launcher, ___T>,
2354
2355 request: ::fidl_next::Request<launcher::Launch, ___T>,
2356
2357 responder: ::fidl_next::Responder<launcher::Launch>,
2358 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2359
2360 #[doc = " Creates the process described by `info` but does not start it.\n\n After processing this message, the `Launcher` is reset to its initial\n state and is ready to launch another process.\n\n The caller is responsible for calling `zx_process_start` using the data\n in `ProcessStartData` to actually start the process.\n\n `data` is present if, and only if, `status` is `ZX_OK`.\n"]
2361 fn create_without_starting(
2362 &mut self,
2363 sender: &::fidl_next::ServerSender<Launcher, ___T>,
2364
2365 request: ::fidl_next::Request<launcher::CreateWithoutStarting, ___T>,
2366
2367 responder: ::fidl_next::Responder<launcher::CreateWithoutStarting>,
2368 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2369
2370 #[doc = " Adds the given arguments to the command-line for the process.\n\n Calling this method multiple times concatenates the arguments.\n"]
2371 fn add_args(
2372 &mut self,
2373 sender: &::fidl_next::ServerSender<Launcher, ___T>,
2374
2375 request: ::fidl_next::Request<launcher::AddArgs, ___T>,
2376 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2377
2378 #[doc = " Adds the given variables to the environment variables for the process.\n\n Calling this method multiple times concatenates the variables.\n"]
2379 fn add_environs(
2380 &mut self,
2381 sender: &::fidl_next::ServerSender<Launcher, ___T>,
2382
2383 request: ::fidl_next::Request<launcher::AddEnvirons, ___T>,
2384 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2385
2386 #[doc = " Adds the given names to the namespace for the process.\n\n The paths in the namespace must be non-overlapping. See\n <https://fuchsia.dev/fuchsia-src/concepts/process/namespaces> for details.\n\n Calling this method multiple times concatenates the names.\n"]
2387 fn add_names(
2388 &mut self,
2389 sender: &::fidl_next::ServerSender<Launcher, ___T>,
2390
2391 request: ::fidl_next::Request<launcher::AddNames, ___T>,
2392 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2393
2394 #[doc = " Adds the given handles to the startup handles for the process.\n\n Calling this method multiple times concatenates the handles.\n"]
2395 fn add_handles(
2396 &mut self,
2397 sender: &::fidl_next::ServerSender<Launcher, ___T>,
2398
2399 request: ::fidl_next::Request<launcher::AddHandles, ___T>,
2400 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2401
2402 #[doc = " Sets the options with which the process is created.\n\n Calling this method multiple times will overwrite the current options.\n"]
2403 fn set_options(
2404 &mut self,
2405 sender: &::fidl_next::ServerSender<Launcher, ___T>,
2406
2407 request: ::fidl_next::Request<launcher::SetOptions, ___T>,
2408 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2409}
2410
2411impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Launcher
2412where
2413 ___H: LauncherServerHandler<___T> + Send,
2414 ___T: ::fidl_next::Transport,
2415
2416 <launcher::Launch as ::fidl_next::Method>::Request:
2417 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2418
2419 <launcher::CreateWithoutStarting as ::fidl_next::Method>::Request:
2420 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2421
2422 <launcher::AddArgs as ::fidl_next::Method>::Request:
2423 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2424
2425 <launcher::AddEnvirons as ::fidl_next::Method>::Request:
2426 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2427
2428 <launcher::AddNames as ::fidl_next::Method>::Request:
2429 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2430
2431 <launcher::AddHandles as ::fidl_next::Method>::Request:
2432 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2433
2434 <launcher::SetOptions as ::fidl_next::Method>::Request:
2435 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2436{
2437 async fn on_one_way(
2438 handler: &mut ___H,
2439 sender: &::fidl_next::ServerSender<Self, ___T>,
2440 ordinal: u64,
2441 buffer: ___T::RecvBuffer,
2442 ) {
2443 match ordinal {
2444 4315651119310005522 => match ::fidl_next::DecoderExt::decode(buffer) {
2445 Ok(decoded) => handler.add_args(sender, decoded).await,
2446 Err(e) => {
2447 sender.close();
2448 }
2449 },
2450
2451 8332725285682026361 => match ::fidl_next::DecoderExt::decode(buffer) {
2452 Ok(decoded) => handler.add_environs(sender, decoded).await,
2453 Err(e) => {
2454 sender.close();
2455 }
2456 },
2457
2458 2700451326409737826 => match ::fidl_next::DecoderExt::decode(buffer) {
2459 Ok(decoded) => handler.add_names(sender, decoded).await,
2460 Err(e) => {
2461 sender.close();
2462 }
2463 },
2464
2465 5837318672132580885 => match ::fidl_next::DecoderExt::decode(buffer) {
2466 Ok(decoded) => handler.add_handles(sender, decoded).await,
2467 Err(e) => {
2468 sender.close();
2469 }
2470 },
2471
2472 6598432479381290375 => match ::fidl_next::DecoderExt::decode(buffer) {
2473 Ok(decoded) => handler.set_options(sender, decoded).await,
2474 Err(e) => {
2475 sender.close();
2476 }
2477 },
2478
2479 ordinal => {
2480 sender.close();
2481 }
2482 }
2483 }
2484
2485 async fn on_two_way(
2486 handler: &mut ___H,
2487 sender: &::fidl_next::ServerSender<Self, ___T>,
2488 ordinal: u64,
2489 buffer: ___T::RecvBuffer,
2490 responder: ::fidl_next::protocol::Responder,
2491 ) {
2492 match ordinal {
2493 1239433936316120996 => {
2494 let responder = ::fidl_next::Responder::from_untyped(responder);
2495
2496 match ::fidl_next::DecoderExt::decode(buffer) {
2497 Ok(decoded) => handler.launch(sender, decoded, responder).await,
2498 Err(e) => {
2499 sender.close();
2500 }
2501 }
2502 }
2503
2504 8457621991205227361 => {
2505 let responder = ::fidl_next::Responder::from_untyped(responder);
2506
2507 match ::fidl_next::DecoderExt::decode(buffer) {
2508 Ok(decoded) => {
2509 handler.create_without_starting(sender, decoded, responder).await
2510 }
2511 Err(e) => {
2512 sender.close();
2513 }
2514 }
2515 }
2516
2517 ordinal => {
2518 sender.close();
2519 }
2520 }
2521 }
2522}
2523
2524#[doc = " The maximum size for a name used by `Resolver`.\n"]
2525pub const MAX_RESOLVE_NAME_SIZE: u32 = 2048;
2526
2527#[doc = " The information required to start a process.\n\n To start the process, call `zx_process_start` with the arguments provided.\n"]
2528#[derive(Debug)]
2529pub struct ProcessStartData {
2530 pub process: ::fidl_next::fuchsia::zx::Handle,
2531
2532 pub root_vmar: ::fidl_next::fuchsia::zx::Handle,
2533
2534 pub thread: ::fidl_next::fuchsia::zx::Handle,
2535
2536 pub entry: u64,
2537
2538 pub stack: u64,
2539
2540 pub bootstrap: ::fidl_next::fuchsia::zx::Handle,
2541
2542 pub vdso_base: u64,
2543
2544 pub base: u64,
2545}
2546
2547impl ::fidl_next::Encodable for ProcessStartData {
2548 type Encoded = WireProcessStartData;
2549}
2550
2551unsafe impl<___E> ::fidl_next::Encode<___E> for ProcessStartData
2552where
2553 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2554
2555 ___E: ::fidl_next::fuchsia::HandleEncoder,
2556{
2557 #[inline]
2558 fn encode(
2559 self,
2560 encoder: &mut ___E,
2561 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2562 ) -> Result<(), ::fidl_next::EncodeError> {
2563 ::fidl_next::munge! {
2564 let Self::Encoded {
2565 process,
2566 root_vmar,
2567 thread,
2568 entry,
2569 stack,
2570 bootstrap,
2571 vdso_base,
2572 base,
2573
2574 } = out;
2575 }
2576
2577 ::fidl_next::Encode::encode(self.process, encoder, process)?;
2578
2579 ::fidl_next::Encode::encode(self.root_vmar, encoder, root_vmar)?;
2580
2581 ::fidl_next::Encode::encode(self.thread, encoder, thread)?;
2582
2583 ::fidl_next::Encode::encode(self.entry, encoder, entry)?;
2584
2585 ::fidl_next::Encode::encode(self.stack, encoder, stack)?;
2586
2587 ::fidl_next::Encode::encode(self.bootstrap, encoder, bootstrap)?;
2588
2589 ::fidl_next::Encode::encode(self.vdso_base, encoder, vdso_base)?;
2590
2591 ::fidl_next::Encode::encode(self.base, encoder, base)?;
2592
2593 Ok(())
2594 }
2595}
2596
2597impl ::fidl_next::EncodableOption for ProcessStartData {
2598 type EncodedOption = ::fidl_next::WireBox<'static, WireProcessStartData>;
2599}
2600
2601unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ProcessStartData
2602where
2603 ___E: ::fidl_next::Encoder + ?Sized,
2604 ProcessStartData: ::fidl_next::Encode<___E>,
2605{
2606 #[inline]
2607 fn encode_option(
2608 this: Option<Self>,
2609 encoder: &mut ___E,
2610 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2611 ) -> Result<(), ::fidl_next::EncodeError> {
2612 if let Some(inner) = this {
2613 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2614 ::fidl_next::WireBox::encode_present(out);
2615 } else {
2616 ::fidl_next::WireBox::encode_absent(out);
2617 }
2618
2619 Ok(())
2620 }
2621}
2622
2623impl ::fidl_next::FromWire<WireProcessStartData> for ProcessStartData {
2624 #[inline]
2625 fn from_wire(wire: WireProcessStartData) -> Self {
2626 Self {
2627 process: ::fidl_next::FromWire::from_wire(wire.process),
2628
2629 root_vmar: ::fidl_next::FromWire::from_wire(wire.root_vmar),
2630
2631 thread: ::fidl_next::FromWire::from_wire(wire.thread),
2632
2633 entry: ::fidl_next::FromWire::from_wire(wire.entry),
2634
2635 stack: ::fidl_next::FromWire::from_wire(wire.stack),
2636
2637 bootstrap: ::fidl_next::FromWire::from_wire(wire.bootstrap),
2638
2639 vdso_base: ::fidl_next::FromWire::from_wire(wire.vdso_base),
2640
2641 base: ::fidl_next::FromWire::from_wire(wire.base),
2642 }
2643 }
2644}
2645
2646#[derive(Debug)]
2648#[repr(C)]
2649pub struct WireProcessStartData {
2650 pub process: ::fidl_next::fuchsia::WireHandle,
2651
2652 pub root_vmar: ::fidl_next::fuchsia::WireHandle,
2653
2654 pub thread: ::fidl_next::fuchsia::WireHandle,
2655
2656 pub entry: ::fidl_next::WireU64,
2657
2658 pub stack: ::fidl_next::WireU64,
2659
2660 pub bootstrap: ::fidl_next::fuchsia::WireHandle,
2661
2662 pub vdso_base: ::fidl_next::WireU64,
2663
2664 pub base: ::fidl_next::WireU64,
2665}
2666
2667unsafe impl ::fidl_next::Wire for WireProcessStartData {
2668 type Decoded<'de> = WireProcessStartData;
2669
2670 #[inline]
2671 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2672 unsafe {
2673 out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
2674 }
2675
2676 unsafe {
2677 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
2678 }
2679 }
2680}
2681
2682unsafe impl<___D> ::fidl_next::Decode<___D> for WireProcessStartData
2683where
2684 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2685
2686 ___D: ::fidl_next::fuchsia::HandleDecoder,
2687{
2688 fn decode(
2689 slot: ::fidl_next::Slot<'_, Self>,
2690 decoder: &mut ___D,
2691 ) -> Result<(), ::fidl_next::DecodeError> {
2692 ::fidl_next::munge! {
2693 let Self {
2694 mut process,
2695 mut root_vmar,
2696 mut thread,
2697 mut entry,
2698 mut stack,
2699 mut bootstrap,
2700 mut vdso_base,
2701 mut base,
2702
2703 } = slot;
2704 }
2705
2706 ::fidl_next::Decode::decode(process.as_mut(), decoder)?;
2707
2708 ::fidl_next::Decode::decode(root_vmar.as_mut(), decoder)?;
2709
2710 ::fidl_next::Decode::decode(thread.as_mut(), decoder)?;
2711
2712 ::fidl_next::Decode::decode(entry.as_mut(), decoder)?;
2713
2714 ::fidl_next::Decode::decode(stack.as_mut(), decoder)?;
2715
2716 ::fidl_next::Decode::decode(bootstrap.as_mut(), decoder)?;
2717
2718 ::fidl_next::Decode::decode(vdso_base.as_mut(), decoder)?;
2719
2720 ::fidl_next::Decode::decode(base.as_mut(), decoder)?;
2721
2722 Ok(())
2723 }
2724}
2725
2726#[derive(Clone, Debug)]
2727pub struct ResolverResolveRequest {
2728 pub name: String,
2729}
2730
2731impl ::fidl_next::Encodable for ResolverResolveRequest {
2732 type Encoded = WireResolverResolveRequest<'static>;
2733}
2734
2735unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverResolveRequest
2736where
2737 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2738
2739 ___E: ::fidl_next::Encoder,
2740{
2741 #[inline]
2742 fn encode(
2743 self,
2744 encoder: &mut ___E,
2745 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2746 ) -> Result<(), ::fidl_next::EncodeError> {
2747 ::fidl_next::munge! {
2748 let Self::Encoded {
2749 name,
2750
2751 } = out;
2752 }
2753
2754 ::fidl_next::Encode::encode(self.name, encoder, name)?;
2755
2756 Ok(())
2757 }
2758}
2759
2760unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolverResolveRequest
2761where
2762 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2763
2764 ___E: ::fidl_next::Encoder,
2765{
2766 #[inline]
2767 fn encode_ref(
2768 &self,
2769 encoder: &mut ___E,
2770 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2771 ) -> Result<(), ::fidl_next::EncodeError> {
2772 ::fidl_next::munge! {
2773 let Self::Encoded {
2774 name,
2775
2776 } = out;
2777 }
2778
2779 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
2780
2781 Ok(())
2782 }
2783}
2784
2785impl ::fidl_next::EncodableOption for ResolverResolveRequest {
2786 type EncodedOption = ::fidl_next::WireBox<'static, WireResolverResolveRequest<'static>>;
2787}
2788
2789unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolverResolveRequest
2790where
2791 ___E: ::fidl_next::Encoder + ?Sized,
2792 ResolverResolveRequest: ::fidl_next::Encode<___E>,
2793{
2794 #[inline]
2795 fn encode_option(
2796 this: Option<Self>,
2797 encoder: &mut ___E,
2798 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2799 ) -> Result<(), ::fidl_next::EncodeError> {
2800 if let Some(inner) = this {
2801 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2802 ::fidl_next::WireBox::encode_present(out);
2803 } else {
2804 ::fidl_next::WireBox::encode_absent(out);
2805 }
2806
2807 Ok(())
2808 }
2809}
2810
2811unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ResolverResolveRequest
2812where
2813 ___E: ::fidl_next::Encoder + ?Sized,
2814 ResolverResolveRequest: ::fidl_next::EncodeRef<___E>,
2815{
2816 #[inline]
2817 fn encode_option_ref(
2818 this: Option<&Self>,
2819 encoder: &mut ___E,
2820 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2821 ) -> Result<(), ::fidl_next::EncodeError> {
2822 if let Some(inner) = this {
2823 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2824 ::fidl_next::WireBox::encode_present(out);
2825 } else {
2826 ::fidl_next::WireBox::encode_absent(out);
2827 }
2828
2829 Ok(())
2830 }
2831}
2832
2833impl<'de> ::fidl_next::FromWire<WireResolverResolveRequest<'de>> for ResolverResolveRequest {
2834 #[inline]
2835 fn from_wire(wire: WireResolverResolveRequest<'de>) -> Self {
2836 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
2837 }
2838}
2839
2840impl<'de> ::fidl_next::FromWireRef<WireResolverResolveRequest<'de>> for ResolverResolveRequest {
2841 #[inline]
2842 fn from_wire_ref(wire: &WireResolverResolveRequest<'de>) -> Self {
2843 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
2844 }
2845}
2846
2847#[derive(Debug)]
2849#[repr(C)]
2850pub struct WireResolverResolveRequest<'de> {
2851 pub name: ::fidl_next::WireString<'de>,
2852}
2853
2854unsafe impl ::fidl_next::Wire for WireResolverResolveRequest<'static> {
2855 type Decoded<'de> = WireResolverResolveRequest<'de>;
2856
2857 #[inline]
2858 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2859}
2860
2861unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolverResolveRequest<'static>
2862where
2863 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2864
2865 ___D: ::fidl_next::Decoder,
2866{
2867 fn decode(
2868 slot: ::fidl_next::Slot<'_, Self>,
2869 decoder: &mut ___D,
2870 ) -> Result<(), ::fidl_next::DecodeError> {
2871 ::fidl_next::munge! {
2872 let Self {
2873 mut name,
2874
2875 } = slot;
2876 }
2877
2878 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
2879
2880 let name = unsafe { name.deref_unchecked() };
2881
2882 if name.len() > 2048 {
2883 return Err(::fidl_next::DecodeError::VectorTooLong {
2884 size: name.len() as u64,
2885 limit: 2048,
2886 });
2887 }
2888
2889 Ok(())
2890 }
2891}
2892
2893#[derive(Debug)]
2894#[repr(C)]
2895pub struct ResolverResolveResponse {
2896 pub status: i32,
2897
2898 pub executable: Option<::fidl_next::fuchsia::zx::Handle>,
2899
2900 pub ldsvc: Option<
2901 ::fidl_next::ClientEnd<
2902 ::fidl_next_fuchsia_ldsvc::Loader,
2903 ::fidl_next::fuchsia::zx::Channel,
2904 >,
2905 >,
2906}
2907
2908impl ::fidl_next::Encodable for ResolverResolveResponse {
2909 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireResolverResolveResponse> = unsafe {
2910 ::fidl_next::CopyOptimization::enable_if(
2911 true
2912
2913 && <
2914 i32 as ::fidl_next::Encodable
2915 >::COPY_OPTIMIZATION.is_enabled()
2916
2917 && <
2918 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
2919 >::COPY_OPTIMIZATION.is_enabled()
2920
2921 && <
2922 Option<::fidl_next::ClientEnd<::fidl_next_fuchsia_ldsvc::Loader, ::fidl_next::fuchsia::zx::Channel>> as ::fidl_next::Encodable
2923 >::COPY_OPTIMIZATION.is_enabled()
2924
2925 )
2926 };
2927
2928 type Encoded = WireResolverResolveResponse;
2929}
2930
2931unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverResolveResponse
2932where
2933 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2934
2935 ___E: ::fidl_next::fuchsia::HandleEncoder,
2936{
2937 #[inline]
2938 fn encode(
2939 self,
2940 encoder: &mut ___E,
2941 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2942 ) -> Result<(), ::fidl_next::EncodeError> {
2943 ::fidl_next::munge! {
2944 let Self::Encoded {
2945 status,
2946 executable,
2947 ldsvc,
2948
2949 } = out;
2950 }
2951
2952 ::fidl_next::Encode::encode(self.status, encoder, status)?;
2953
2954 ::fidl_next::Encode::encode(self.executable, encoder, executable)?;
2955
2956 ::fidl_next::Encode::encode(self.ldsvc, encoder, ldsvc)?;
2957
2958 Ok(())
2959 }
2960}
2961
2962impl ::fidl_next::EncodableOption for ResolverResolveResponse {
2963 type EncodedOption = ::fidl_next::WireBox<'static, WireResolverResolveResponse>;
2964}
2965
2966unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolverResolveResponse
2967where
2968 ___E: ::fidl_next::Encoder + ?Sized,
2969 ResolverResolveResponse: ::fidl_next::Encode<___E>,
2970{
2971 #[inline]
2972 fn encode_option(
2973 this: Option<Self>,
2974 encoder: &mut ___E,
2975 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2976 ) -> Result<(), ::fidl_next::EncodeError> {
2977 if let Some(inner) = this {
2978 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2979 ::fidl_next::WireBox::encode_present(out);
2980 } else {
2981 ::fidl_next::WireBox::encode_absent(out);
2982 }
2983
2984 Ok(())
2985 }
2986}
2987
2988impl ::fidl_next::FromWire<WireResolverResolveResponse> for ResolverResolveResponse {
2989 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireResolverResolveResponse, Self> = unsafe {
2990 ::fidl_next::CopyOptimization::enable_if(
2991 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
2992 .is_enabled()
2993 && <Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::FromWire<
2994 ::fidl_next::fuchsia::WireOptionalHandle,
2995 >>::COPY_OPTIMIZATION
2996 .is_enabled()
2997 && <Option<
2998 ::fidl_next::ClientEnd<
2999 ::fidl_next_fuchsia_ldsvc::Loader,
3000 ::fidl_next::fuchsia::zx::Channel,
3001 >,
3002 > as ::fidl_next::FromWire<
3003 ::fidl_next::ClientEnd<
3004 ::fidl_next_fuchsia_ldsvc::Loader,
3005 ::fidl_next::fuchsia::WireOptionalChannel,
3006 >,
3007 >>::COPY_OPTIMIZATION
3008 .is_enabled(),
3009 )
3010 };
3011
3012 #[inline]
3013 fn from_wire(wire: WireResolverResolveResponse) -> Self {
3014 Self {
3015 status: ::fidl_next::FromWire::from_wire(wire.status),
3016
3017 executable: ::fidl_next::FromWire::from_wire(wire.executable),
3018
3019 ldsvc: ::fidl_next::FromWire::from_wire(wire.ldsvc),
3020 }
3021 }
3022}
3023
3024#[derive(Debug)]
3026#[repr(C)]
3027pub struct WireResolverResolveResponse {
3028 pub status: ::fidl_next::WireI32,
3029
3030 pub executable: ::fidl_next::fuchsia::WireOptionalHandle,
3031
3032 pub ldsvc: ::fidl_next::ClientEnd<
3033 ::fidl_next_fuchsia_ldsvc::Loader,
3034 ::fidl_next::fuchsia::WireOptionalChannel,
3035 >,
3036}
3037
3038unsafe impl ::fidl_next::Wire for WireResolverResolveResponse {
3039 type Decoded<'de> = WireResolverResolveResponse;
3040
3041 #[inline]
3042 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3043}
3044
3045unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolverResolveResponse
3046where
3047 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3048
3049 ___D: ::fidl_next::fuchsia::HandleDecoder,
3050{
3051 fn decode(
3052 slot: ::fidl_next::Slot<'_, Self>,
3053 decoder: &mut ___D,
3054 ) -> Result<(), ::fidl_next::DecodeError> {
3055 ::fidl_next::munge! {
3056 let Self {
3057 mut status,
3058 mut executable,
3059 mut ldsvc,
3060
3061 } = slot;
3062 }
3063
3064 ::fidl_next::Decode::decode(status.as_mut(), decoder)?;
3065
3066 ::fidl_next::Decode::decode(executable.as_mut(), decoder)?;
3067
3068 ::fidl_next::Decode::decode(ldsvc.as_mut(), decoder)?;
3069
3070 Ok(())
3071 }
3072}
3073
3074#[doc = " An interface for resolving names to executables and library loaders.\n\n An executable itself is often not sufficient to create a working process\n because many executables also load shared libraries. On Fuchsia, there is no\n global pool of shared libraries. Instead, every process has an associated\n `fuchsia.ldsvc.Loader`, which provides access to a private pool of shared\n libraries appropriate for that process.\n\n This interface provides a protocol for resolving a name into both the\n `zx.Handle:VMO` for the executable and the `fuchsia.ldsvc.Loader` for its\n associated shared libraries.\n\n This interface is rarely used directly. Instead, `fdio_spawn` and\n `fdio_spawn_etc` use this interface internally when they try to run a file\n with a `#!resolve` directive.\n"]
3076#[derive(Debug)]
3077pub struct Resolver;
3078
3079impl ::fidl_next::Discoverable for Resolver {
3080 const PROTOCOL_NAME: &'static str = "fuchsia.process.Resolver";
3081}
3082
3083pub mod resolver {
3084 pub mod prelude {
3085 pub use crate::{resolver, Resolver, ResolverClientHandler, ResolverServerHandler};
3086
3087 pub use crate::ResolverResolveRequest;
3088
3089 pub use crate::ResolverResolveResponse;
3090 }
3091
3092 pub struct Resolve;
3093
3094 impl ::fidl_next::Method for Resolve {
3095 const ORDINAL: u64 = 4329530577128037520;
3096
3097 type Protocol = crate::Resolver;
3098
3099 type Request = crate::WireResolverResolveRequest<'static>;
3100
3101 type Response = crate::WireResolverResolveResponse;
3102 }
3103
3104 mod ___detail {
3105
3106 pub struct Resolve<T0> {
3107 name: T0,
3108 }
3109
3110 impl<T0> ::fidl_next::Encodable for Resolve<T0>
3111 where
3112 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
3113 {
3114 type Encoded = crate::WireResolverResolveRequest<'static>;
3115 }
3116
3117 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Resolve<T0>
3118 where
3119 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3120
3121 ___E: ::fidl_next::Encoder,
3122
3123 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
3124 {
3125 #[inline]
3126 fn encode(
3127 self,
3128 encoder: &mut ___E,
3129 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3130 ) -> Result<(), ::fidl_next::EncodeError> {
3131 ::fidl_next::munge! {
3132 let Self::Encoded {
3133 name,
3134
3135 } = out;
3136 }
3137
3138 ::fidl_next::Encode::encode(self.name, encoder, name)?;
3139
3140 Ok(())
3141 }
3142 }
3143
3144 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Resolver
3145 where
3146 ___T: ::fidl_next::Transport,
3147 {
3148 type ClientSender = ResolverClientSender<___T>;
3149 type ServerSender = ResolverServerSender<___T>;
3150 }
3151
3152 pub struct ResolverClientSender<___T: ::fidl_next::Transport> {
3154 #[allow(dead_code)]
3155 sender: ::fidl_next::protocol::ClientSender<___T>,
3156 }
3157
3158 impl<___T> ResolverClientSender<___T>
3159 where
3160 ___T: ::fidl_next::Transport,
3161 {
3162 #[doc = " Resolves the given `name` to an `executable` and an shared library\n loader.\n\n If present, the `executable` is suitable for use as the `executable`\n property of `LaunchInfo` -- in particular, it will have `ZX_RIGHT_EXECUTE`.\n If present, the `ldsvc` is suitable for use as the `PA_LDSVC_LOADER`\n handle when launching the process.\n\n For example, the resolver might locate the given `name` inside a package\n and return the executable binary from the package as well as a shared\n library loader scoped to that package.\n"]
3163 pub fn resolve(
3164 &self,
3165
3166 name: impl ::fidl_next::Encode<
3167 <___T as ::fidl_next::Transport>::SendBuffer,
3168 Encoded = ::fidl_next::WireString<'static>,
3169 >,
3170 ) -> Result<
3171 ::fidl_next::ResponseFuture<'_, super::Resolve, ___T>,
3172 ::fidl_next::EncodeError,
3173 >
3174 where
3175 <___T as ::fidl_next::Transport>::SendBuffer:
3176 ::fidl_next::encoder::InternalHandleEncoder,
3177
3178 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3179 {
3180 self.resolve_with(Resolve { name })
3181 }
3182
3183 #[doc = " Resolves the given `name` to an `executable` and an shared library\n loader.\n\n If present, the `executable` is suitable for use as the `executable`\n property of `LaunchInfo` -- in particular, it will have `ZX_RIGHT_EXECUTE`.\n If present, the `ldsvc` is suitable for use as the `PA_LDSVC_LOADER`\n handle when launching the process.\n\n For example, the resolver might locate the given `name` inside a package\n and return the executable binary from the package as well as a shared\n library loader scoped to that package.\n"]
3184 pub fn resolve_with<___R>(
3185 &self,
3186 request: ___R,
3187 ) -> Result<
3188 ::fidl_next::ResponseFuture<'_, super::Resolve, ___T>,
3189 ::fidl_next::EncodeError,
3190 >
3191 where
3192 ___R: ::fidl_next::Encode<
3193 <___T as ::fidl_next::Transport>::SendBuffer,
3194 Encoded = crate::WireResolverResolveRequest<'static>,
3195 >,
3196 {
3197 self.sender
3198 .send_two_way(4329530577128037520, request)
3199 .map(::fidl_next::ResponseFuture::from_untyped)
3200 }
3201 }
3202
3203 #[repr(transparent)]
3205 pub struct ResolverServerSender<___T: ::fidl_next::Transport> {
3206 sender: ::fidl_next::protocol::ServerSender<___T>,
3207 }
3208
3209 impl<___T> ResolverServerSender<___T> where ___T: ::fidl_next::Transport {}
3210 }
3211}
3212
3213pub trait ResolverClientHandler<___T: ::fidl_next::Transport> {}
3217
3218impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Resolver
3219where
3220 ___H: ResolverClientHandler<___T> + Send,
3221 ___T: ::fidl_next::Transport,
3222
3223 <resolver::Resolve as ::fidl_next::Method>::Response:
3224 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
3225{
3226 async fn on_event(
3227 handler: &mut ___H,
3228 sender: &::fidl_next::ClientSender<Self, ___T>,
3229 ordinal: u64,
3230 buffer: ___T::RecvBuffer,
3231 ) {
3232 match ordinal {
3233 ordinal => {
3234 sender.close();
3235 }
3236 }
3237 }
3238}
3239
3240pub trait ResolverServerHandler<___T: ::fidl_next::Transport> {
3244 #[doc = " Resolves the given `name` to an `executable` and an shared library\n loader.\n\n If present, the `executable` is suitable for use as the `executable`\n property of `LaunchInfo` -- in particular, it will have `ZX_RIGHT_EXECUTE`.\n If present, the `ldsvc` is suitable for use as the `PA_LDSVC_LOADER`\n handle when launching the process.\n\n For example, the resolver might locate the given `name` inside a package\n and return the executable binary from the package as well as a shared\n library loader scoped to that package.\n"]
3245 fn resolve(
3246 &mut self,
3247 sender: &::fidl_next::ServerSender<Resolver, ___T>,
3248
3249 request: ::fidl_next::Request<resolver::Resolve, ___T>,
3250
3251 responder: ::fidl_next::Responder<resolver::Resolve>,
3252 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3253}
3254
3255impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Resolver
3256where
3257 ___H: ResolverServerHandler<___T> + Send,
3258 ___T: ::fidl_next::Transport,
3259
3260 <resolver::Resolve as ::fidl_next::Method>::Request:
3261 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
3262{
3263 async fn on_one_way(
3264 handler: &mut ___H,
3265 sender: &::fidl_next::ServerSender<Self, ___T>,
3266 ordinal: u64,
3267 buffer: ___T::RecvBuffer,
3268 ) {
3269 match ordinal {
3270 ordinal => {
3271 sender.close();
3272 }
3273 }
3274 }
3275
3276 async fn on_two_way(
3277 handler: &mut ___H,
3278 sender: &::fidl_next::ServerSender<Self, ___T>,
3279 ordinal: u64,
3280 buffer: ___T::RecvBuffer,
3281 responder: ::fidl_next::protocol::Responder,
3282 ) {
3283 match ordinal {
3284 4329530577128037520 => {
3285 let responder = ::fidl_next::Responder::from_untyped(responder);
3286
3287 match ::fidl_next::DecoderExt::decode(buffer) {
3288 Ok(decoded) => handler.resolve(sender, decoded, responder).await,
3289 Err(e) => {
3290 sender.close();
3291 }
3292 }
3293 }
3294
3295 ordinal => {
3296 sender.close();
3297 }
3298 }
3299 }
3300}
3301
3302pub mod compat {
3304
3305 #[cfg(target_os = "fuchsia")]
3306 pub type LauncherProxy =
3309 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Launcher>;
3310
3311 impl ::core::convert::From<crate::Launcher> for ::fidl_fuchsia_process::LauncherMarker {
3312 #[inline]
3313 fn from(_: crate::Launcher) -> Self {
3314 Self
3315 }
3316 }
3317
3318 #[cfg(target_os = "fuchsia")]
3319 pub type ResolverProxy =
3322 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Resolver>;
3323
3324 impl ::core::convert::From<crate::Resolver> for ::fidl_fuchsia_process::ResolverMarker {
3325 #[inline]
3326 fn from(_: crate::Resolver) -> Self {
3327 Self
3328 }
3329 }
3330}