1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(Clone, Debug)]
6pub struct LoaderLoadObjectRequest {
7 pub object_name: String,
8}
9
10impl ::fidl_next::Encodable for LoaderLoadObjectRequest {
11 type Encoded = WireLoaderLoadObjectRequest;
12}
13
14unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderLoadObjectRequest
15where
16 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17
18 ___E: ::fidl_next::Encoder,
19{
20 #[inline]
21 fn encode(
22 self,
23 encoder: &mut ___E,
24 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25 ) -> Result<(), ::fidl_next::EncodeError> {
26 ::fidl_next::munge! {
27 let Self::Encoded {
28 object_name,
29
30 } = out;
31 }
32
33 ::fidl_next::Encode::encode(self.object_name, encoder, object_name)?;
34
35 Ok(())
36 }
37}
38
39unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderLoadObjectRequest
40where
41 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
42
43 ___E: ::fidl_next::Encoder,
44{
45 #[inline]
46 fn encode_ref(
47 &self,
48 encoder: &mut ___E,
49 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
50 ) -> Result<(), ::fidl_next::EncodeError> {
51 ::fidl_next::munge! {
52 let Self::Encoded {
53 object_name,
54
55 } = out;
56 }
57
58 ::fidl_next::EncodeRef::encode_ref(&self.object_name, encoder, object_name)?;
59
60 Ok(())
61 }
62}
63
64impl ::fidl_next::EncodableOption for Box<LoaderLoadObjectRequest> {
65 type EncodedOption = ::fidl_next::WireBox<WireLoaderLoadObjectRequest>;
66}
67
68unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LoaderLoadObjectRequest>
69where
70 ___E: ::fidl_next::Encoder + ?Sized,
71 LoaderLoadObjectRequest: ::fidl_next::Encode<___E>,
72{
73 #[inline]
74 fn encode_option(
75 this: Option<Self>,
76 encoder: &mut ___E,
77 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
78 ) -> Result<(), ::fidl_next::EncodeError> {
79 if let Some(inner) = this {
80 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
81 ::fidl_next::WireBox::encode_present(out);
82 } else {
83 ::fidl_next::WireBox::encode_absent(out);
84 }
85
86 Ok(())
87 }
88}
89
90unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<LoaderLoadObjectRequest>
91where
92 ___E: ::fidl_next::Encoder + ?Sized,
93 LoaderLoadObjectRequest: ::fidl_next::EncodeRef<___E>,
94{
95 #[inline]
96 fn encode_option_ref(
97 this: Option<&Self>,
98 encoder: &mut ___E,
99 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
100 ) -> Result<(), ::fidl_next::EncodeError> {
101 if let Some(inner) = this {
102 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
103 ::fidl_next::WireBox::encode_present(out);
104 } else {
105 ::fidl_next::WireBox::encode_absent(out);
106 }
107
108 Ok(())
109 }
110}
111
112impl ::fidl_next::TakeFrom<WireLoaderLoadObjectRequest> for LoaderLoadObjectRequest {
113 #[inline]
114 fn take_from(from: &WireLoaderLoadObjectRequest) -> Self {
115 Self { object_name: ::fidl_next::TakeFrom::take_from(&from.object_name) }
116 }
117}
118
119#[derive(Debug)]
121#[repr(C)]
122pub struct WireLoaderLoadObjectRequest {
123 pub object_name: ::fidl_next::WireString,
124}
125
126unsafe impl ::fidl_next::ZeroPadding for WireLoaderLoadObjectRequest {
127 #[inline]
128 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
129}
130
131unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderLoadObjectRequest
132where
133 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
134
135 ___D: ::fidl_next::Decoder,
136{
137 fn decode(
138 slot: ::fidl_next::Slot<'_, Self>,
139 decoder: &mut ___D,
140 ) -> Result<(), ::fidl_next::DecodeError> {
141 ::fidl_next::munge! {
142 let Self {
143 mut object_name,
144
145 } = slot;
146 }
147
148 ::fidl_next::Decode::decode(object_name.as_mut(), decoder)?;
149
150 let object_name = unsafe { object_name.deref_unchecked() };
151
152 if object_name.len() > 1024 {
153 return Err(::fidl_next::DecodeError::VectorTooLong {
154 size: object_name.len() as u64,
155 limit: 1024,
156 });
157 }
158
159 Ok(())
160 }
161}
162
163#[derive(Debug)]
164#[repr(C)]
165pub struct LoaderLoadObjectResponse {
166 pub rv: i32,
167
168 pub object: Option<::fidl_next::fuchsia::zx::Handle>,
169}
170
171impl ::fidl_next::Encodable for LoaderLoadObjectResponse {
172 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
173 ::fidl_next::CopyOptimization::enable_if(
174 true
175
176 && <
177 i32 as ::fidl_next::Encodable
178 >::COPY_OPTIMIZATION.is_enabled()
179
180 && <
181 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
182 >::COPY_OPTIMIZATION.is_enabled()
183
184 )
185 };
186
187 type Encoded = WireLoaderLoadObjectResponse;
188}
189
190unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderLoadObjectResponse
191where
192 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
193
194 ___E: ::fidl_next::fuchsia::HandleEncoder,
195{
196 #[inline]
197 fn encode(
198 self,
199 encoder: &mut ___E,
200 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
201 ) -> Result<(), ::fidl_next::EncodeError> {
202 ::fidl_next::munge! {
203 let Self::Encoded {
204 rv,
205 object,
206
207 } = out;
208 }
209
210 ::fidl_next::Encode::encode(self.rv, encoder, rv)?;
211
212 ::fidl_next::Encode::encode(self.object, encoder, object)?;
213
214 Ok(())
215 }
216}
217
218impl ::fidl_next::EncodableOption for Box<LoaderLoadObjectResponse> {
219 type EncodedOption = ::fidl_next::WireBox<WireLoaderLoadObjectResponse>;
220}
221
222unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LoaderLoadObjectResponse>
223where
224 ___E: ::fidl_next::Encoder + ?Sized,
225 LoaderLoadObjectResponse: ::fidl_next::Encode<___E>,
226{
227 #[inline]
228 fn encode_option(
229 this: Option<Self>,
230 encoder: &mut ___E,
231 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
232 ) -> Result<(), ::fidl_next::EncodeError> {
233 if let Some(inner) = this {
234 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
235 ::fidl_next::WireBox::encode_present(out);
236 } else {
237 ::fidl_next::WireBox::encode_absent(out);
238 }
239
240 Ok(())
241 }
242}
243
244impl ::fidl_next::TakeFrom<WireLoaderLoadObjectResponse> for LoaderLoadObjectResponse {
245 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
246 ::fidl_next::CopyOptimization::enable_if(
247 true
248
249 && <
250 i32 as ::fidl_next::Encodable
251 >::COPY_OPTIMIZATION.is_enabled()
252
253 && <
254 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
255 >::COPY_OPTIMIZATION.is_enabled()
256
257 )
258 };
259
260 #[inline]
261 fn take_from(from: &WireLoaderLoadObjectResponse) -> Self {
262 Self {
263 rv: ::fidl_next::TakeFrom::take_from(&from.rv),
264
265 object: ::fidl_next::TakeFrom::take_from(&from.object),
266 }
267 }
268}
269
270#[derive(Debug)]
272#[repr(C)]
273pub struct WireLoaderLoadObjectResponse {
274 pub rv: ::fidl_next::WireI32,
275
276 pub object: ::fidl_next::fuchsia::WireOptionalHandle,
277}
278
279unsafe impl ::fidl_next::ZeroPadding for WireLoaderLoadObjectResponse {
280 #[inline]
281 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
282}
283
284unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderLoadObjectResponse
285where
286 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
287
288 ___D: ::fidl_next::fuchsia::HandleDecoder,
289{
290 fn decode(
291 slot: ::fidl_next::Slot<'_, Self>,
292 decoder: &mut ___D,
293 ) -> Result<(), ::fidl_next::DecodeError> {
294 ::fidl_next::munge! {
295 let Self {
296 mut rv,
297 mut object,
298
299 } = slot;
300 }
301
302 ::fidl_next::Decode::decode(rv.as_mut(), decoder)?;
303
304 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
305
306 Ok(())
307 }
308}
309
310#[derive(Clone, Debug)]
311pub struct LoaderConfigRequest {
312 pub config: String,
313}
314
315impl ::fidl_next::Encodable for LoaderConfigRequest {
316 type Encoded = WireLoaderConfigRequest;
317}
318
319unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderConfigRequest
320where
321 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
322
323 ___E: ::fidl_next::Encoder,
324{
325 #[inline]
326 fn encode(
327 self,
328 encoder: &mut ___E,
329 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
330 ) -> Result<(), ::fidl_next::EncodeError> {
331 ::fidl_next::munge! {
332 let Self::Encoded {
333 config,
334
335 } = out;
336 }
337
338 ::fidl_next::Encode::encode(self.config, encoder, config)?;
339
340 Ok(())
341 }
342}
343
344unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderConfigRequest
345where
346 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
347
348 ___E: ::fidl_next::Encoder,
349{
350 #[inline]
351 fn encode_ref(
352 &self,
353 encoder: &mut ___E,
354 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
355 ) -> Result<(), ::fidl_next::EncodeError> {
356 ::fidl_next::munge! {
357 let Self::Encoded {
358 config,
359
360 } = out;
361 }
362
363 ::fidl_next::EncodeRef::encode_ref(&self.config, encoder, config)?;
364
365 Ok(())
366 }
367}
368
369impl ::fidl_next::EncodableOption for Box<LoaderConfigRequest> {
370 type EncodedOption = ::fidl_next::WireBox<WireLoaderConfigRequest>;
371}
372
373unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LoaderConfigRequest>
374where
375 ___E: ::fidl_next::Encoder + ?Sized,
376 LoaderConfigRequest: ::fidl_next::Encode<___E>,
377{
378 #[inline]
379 fn encode_option(
380 this: Option<Self>,
381 encoder: &mut ___E,
382 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
383 ) -> Result<(), ::fidl_next::EncodeError> {
384 if let Some(inner) = this {
385 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
386 ::fidl_next::WireBox::encode_present(out);
387 } else {
388 ::fidl_next::WireBox::encode_absent(out);
389 }
390
391 Ok(())
392 }
393}
394
395unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<LoaderConfigRequest>
396where
397 ___E: ::fidl_next::Encoder + ?Sized,
398 LoaderConfigRequest: ::fidl_next::EncodeRef<___E>,
399{
400 #[inline]
401 fn encode_option_ref(
402 this: Option<&Self>,
403 encoder: &mut ___E,
404 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
405 ) -> Result<(), ::fidl_next::EncodeError> {
406 if let Some(inner) = this {
407 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
408 ::fidl_next::WireBox::encode_present(out);
409 } else {
410 ::fidl_next::WireBox::encode_absent(out);
411 }
412
413 Ok(())
414 }
415}
416
417impl ::fidl_next::TakeFrom<WireLoaderConfigRequest> for LoaderConfigRequest {
418 #[inline]
419 fn take_from(from: &WireLoaderConfigRequest) -> Self {
420 Self { config: ::fidl_next::TakeFrom::take_from(&from.config) }
421 }
422}
423
424#[derive(Debug)]
426#[repr(C)]
427pub struct WireLoaderConfigRequest {
428 pub config: ::fidl_next::WireString,
429}
430
431unsafe impl ::fidl_next::ZeroPadding for WireLoaderConfigRequest {
432 #[inline]
433 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
434}
435
436unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderConfigRequest
437where
438 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
439
440 ___D: ::fidl_next::Decoder,
441{
442 fn decode(
443 slot: ::fidl_next::Slot<'_, Self>,
444 decoder: &mut ___D,
445 ) -> Result<(), ::fidl_next::DecodeError> {
446 ::fidl_next::munge! {
447 let Self {
448 mut config,
449
450 } = slot;
451 }
452
453 ::fidl_next::Decode::decode(config.as_mut(), decoder)?;
454
455 let config = unsafe { config.deref_unchecked() };
456
457 if config.len() > 1024 {
458 return Err(::fidl_next::DecodeError::VectorTooLong {
459 size: config.len() as u64,
460 limit: 1024,
461 });
462 }
463
464 Ok(())
465 }
466}
467
468#[derive(Clone, Debug)]
469#[repr(C)]
470pub struct LoaderConfigResponse {
471 pub rv: i32,
472}
473
474impl ::fidl_next::Encodable for LoaderConfigResponse {
475 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
476 ::fidl_next::CopyOptimization::enable_if(
477 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
478 )
479 };
480
481 type Encoded = WireLoaderConfigResponse;
482}
483
484unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderConfigResponse
485where
486 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
487{
488 #[inline]
489 fn encode(
490 self,
491 encoder: &mut ___E,
492 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
493 ) -> Result<(), ::fidl_next::EncodeError> {
494 ::fidl_next::munge! {
495 let Self::Encoded {
496 rv,
497
498 } = out;
499 }
500
501 ::fidl_next::Encode::encode(self.rv, encoder, rv)?;
502
503 Ok(())
504 }
505}
506
507unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderConfigResponse
508where
509 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
510{
511 #[inline]
512 fn encode_ref(
513 &self,
514 encoder: &mut ___E,
515 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
516 ) -> Result<(), ::fidl_next::EncodeError> {
517 ::fidl_next::munge! {
518 let Self::Encoded {
519 rv,
520
521 } = out;
522 }
523
524 ::fidl_next::EncodeRef::encode_ref(&self.rv, encoder, rv)?;
525
526 Ok(())
527 }
528}
529
530impl ::fidl_next::EncodableOption for Box<LoaderConfigResponse> {
531 type EncodedOption = ::fidl_next::WireBox<WireLoaderConfigResponse>;
532}
533
534unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LoaderConfigResponse>
535where
536 ___E: ::fidl_next::Encoder + ?Sized,
537 LoaderConfigResponse: ::fidl_next::Encode<___E>,
538{
539 #[inline]
540 fn encode_option(
541 this: Option<Self>,
542 encoder: &mut ___E,
543 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
544 ) -> Result<(), ::fidl_next::EncodeError> {
545 if let Some(inner) = this {
546 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
547 ::fidl_next::WireBox::encode_present(out);
548 } else {
549 ::fidl_next::WireBox::encode_absent(out);
550 }
551
552 Ok(())
553 }
554}
555
556unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<LoaderConfigResponse>
557where
558 ___E: ::fidl_next::Encoder + ?Sized,
559 LoaderConfigResponse: ::fidl_next::EncodeRef<___E>,
560{
561 #[inline]
562 fn encode_option_ref(
563 this: Option<&Self>,
564 encoder: &mut ___E,
565 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
566 ) -> Result<(), ::fidl_next::EncodeError> {
567 if let Some(inner) = this {
568 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
569 ::fidl_next::WireBox::encode_present(out);
570 } else {
571 ::fidl_next::WireBox::encode_absent(out);
572 }
573
574 Ok(())
575 }
576}
577
578impl ::fidl_next::TakeFrom<WireLoaderConfigResponse> for LoaderConfigResponse {
579 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
580 ::fidl_next::CopyOptimization::enable_if(
581 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
582 )
583 };
584
585 #[inline]
586 fn take_from(from: &WireLoaderConfigResponse) -> Self {
587 Self { rv: ::fidl_next::TakeFrom::take_from(&from.rv) }
588 }
589}
590
591#[derive(Clone, Debug)]
593#[repr(C)]
594pub struct WireLoaderConfigResponse {
595 pub rv: ::fidl_next::WireI32,
596}
597
598unsafe impl ::fidl_next::ZeroPadding for WireLoaderConfigResponse {
599 #[inline]
600 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
601}
602
603unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderConfigResponse
604where
605 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
606{
607 fn decode(
608 slot: ::fidl_next::Slot<'_, Self>,
609 decoder: &mut ___D,
610 ) -> Result<(), ::fidl_next::DecodeError> {
611 ::fidl_next::munge! {
612 let Self {
613 mut rv,
614
615 } = slot;
616 }
617
618 ::fidl_next::Decode::decode(rv.as_mut(), decoder)?;
619
620 Ok(())
621 }
622}
623
624#[derive(Debug)]
625#[repr(C)]
626pub struct LoaderCloneRequest {
627 pub loader: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Loader>,
628}
629
630impl ::fidl_next::Encodable for LoaderCloneRequest {
631 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
632 ::fidl_next::CopyOptimization::enable_if(
633 true
634
635 && <
636 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel,crate::Loader,
637 > as ::fidl_next::Encodable
638 >::COPY_OPTIMIZATION.is_enabled()
639
640 )
641 };
642
643 type Encoded = WireLoaderCloneRequest;
644}
645
646unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderCloneRequest
647where
648 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
649
650 ___E: ::fidl_next::fuchsia::HandleEncoder,
651{
652 #[inline]
653 fn encode(
654 self,
655 encoder: &mut ___E,
656 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
657 ) -> Result<(), ::fidl_next::EncodeError> {
658 ::fidl_next::munge! {
659 let Self::Encoded {
660 loader,
661
662 } = out;
663 }
664
665 ::fidl_next::Encode::encode(self.loader, encoder, loader)?;
666
667 Ok(())
668 }
669}
670
671impl ::fidl_next::EncodableOption for Box<LoaderCloneRequest> {
672 type EncodedOption = ::fidl_next::WireBox<WireLoaderCloneRequest>;
673}
674
675unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LoaderCloneRequest>
676where
677 ___E: ::fidl_next::Encoder + ?Sized,
678 LoaderCloneRequest: ::fidl_next::Encode<___E>,
679{
680 #[inline]
681 fn encode_option(
682 this: Option<Self>,
683 encoder: &mut ___E,
684 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
685 ) -> Result<(), ::fidl_next::EncodeError> {
686 if let Some(inner) = this {
687 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
688 ::fidl_next::WireBox::encode_present(out);
689 } else {
690 ::fidl_next::WireBox::encode_absent(out);
691 }
692
693 Ok(())
694 }
695}
696
697impl ::fidl_next::TakeFrom<WireLoaderCloneRequest> for LoaderCloneRequest {
698 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
699 ::fidl_next::CopyOptimization::enable_if(
700 true
701
702 && <
703 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel,crate::Loader,
704 > as ::fidl_next::Encodable
705 >::COPY_OPTIMIZATION.is_enabled()
706
707 )
708 };
709
710 #[inline]
711 fn take_from(from: &WireLoaderCloneRequest) -> Self {
712 Self { loader: ::fidl_next::TakeFrom::take_from(&from.loader) }
713 }
714}
715
716#[derive(Debug)]
718#[repr(C)]
719pub struct WireLoaderCloneRequest {
720 pub loader: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Loader>,
721}
722
723unsafe impl ::fidl_next::ZeroPadding for WireLoaderCloneRequest {
724 #[inline]
725 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
726}
727
728unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderCloneRequest
729where
730 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
731
732 ___D: ::fidl_next::fuchsia::HandleDecoder,
733{
734 fn decode(
735 slot: ::fidl_next::Slot<'_, Self>,
736 decoder: &mut ___D,
737 ) -> Result<(), ::fidl_next::DecodeError> {
738 ::fidl_next::munge! {
739 let Self {
740 mut loader,
741
742 } = slot;
743 }
744
745 ::fidl_next::Decode::decode(loader.as_mut(), decoder)?;
746
747 Ok(())
748 }
749}
750
751#[derive(Clone, Debug)]
752#[repr(C)]
753pub struct LoaderCloneResponse {
754 pub rv: i32,
755}
756
757impl ::fidl_next::Encodable for LoaderCloneResponse {
758 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
759 ::fidl_next::CopyOptimization::enable_if(
760 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
761 )
762 };
763
764 type Encoded = WireLoaderCloneResponse;
765}
766
767unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderCloneResponse
768where
769 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
770{
771 #[inline]
772 fn encode(
773 self,
774 encoder: &mut ___E,
775 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
776 ) -> Result<(), ::fidl_next::EncodeError> {
777 ::fidl_next::munge! {
778 let Self::Encoded {
779 rv,
780
781 } = out;
782 }
783
784 ::fidl_next::Encode::encode(self.rv, encoder, rv)?;
785
786 Ok(())
787 }
788}
789
790unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderCloneResponse
791where
792 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
793{
794 #[inline]
795 fn encode_ref(
796 &self,
797 encoder: &mut ___E,
798 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
799 ) -> Result<(), ::fidl_next::EncodeError> {
800 ::fidl_next::munge! {
801 let Self::Encoded {
802 rv,
803
804 } = out;
805 }
806
807 ::fidl_next::EncodeRef::encode_ref(&self.rv, encoder, rv)?;
808
809 Ok(())
810 }
811}
812
813impl ::fidl_next::EncodableOption for Box<LoaderCloneResponse> {
814 type EncodedOption = ::fidl_next::WireBox<WireLoaderCloneResponse>;
815}
816
817unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LoaderCloneResponse>
818where
819 ___E: ::fidl_next::Encoder + ?Sized,
820 LoaderCloneResponse: ::fidl_next::Encode<___E>,
821{
822 #[inline]
823 fn encode_option(
824 this: Option<Self>,
825 encoder: &mut ___E,
826 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
827 ) -> Result<(), ::fidl_next::EncodeError> {
828 if let Some(inner) = this {
829 ::fidl_next::EncoderExt::encode_next(encoder, *inner)?;
830 ::fidl_next::WireBox::encode_present(out);
831 } else {
832 ::fidl_next::WireBox::encode_absent(out);
833 }
834
835 Ok(())
836 }
837}
838
839unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Box<LoaderCloneResponse>
840where
841 ___E: ::fidl_next::Encoder + ?Sized,
842 LoaderCloneResponse: ::fidl_next::EncodeRef<___E>,
843{
844 #[inline]
845 fn encode_option_ref(
846 this: Option<&Self>,
847 encoder: &mut ___E,
848 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
849 ) -> Result<(), ::fidl_next::EncodeError> {
850 if let Some(inner) = this {
851 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
852 ::fidl_next::WireBox::encode_present(out);
853 } else {
854 ::fidl_next::WireBox::encode_absent(out);
855 }
856
857 Ok(())
858 }
859}
860
861impl ::fidl_next::TakeFrom<WireLoaderCloneResponse> for LoaderCloneResponse {
862 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
863 ::fidl_next::CopyOptimization::enable_if(
864 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
865 )
866 };
867
868 #[inline]
869 fn take_from(from: &WireLoaderCloneResponse) -> Self {
870 Self { rv: ::fidl_next::TakeFrom::take_from(&from.rv) }
871 }
872}
873
874#[derive(Clone, Debug)]
876#[repr(C)]
877pub struct WireLoaderCloneResponse {
878 pub rv: ::fidl_next::WireI32,
879}
880
881unsafe impl ::fidl_next::ZeroPadding for WireLoaderCloneResponse {
882 #[inline]
883 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
884}
885
886unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderCloneResponse
887where
888 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
889{
890 fn decode(
891 slot: ::fidl_next::Slot<'_, Self>,
892 decoder: &mut ___D,
893 ) -> Result<(), ::fidl_next::DecodeError> {
894 ::fidl_next::munge! {
895 let Self {
896 mut rv,
897
898 } = slot;
899 }
900
901 ::fidl_next::Decode::decode(rv.as_mut(), decoder)?;
902
903 Ok(())
904 }
905}
906
907#[doc = " See //docs/concepts/process/program_loading.md for a more complete\n description of this and related process bootstrapping protocols, and\n for specifics about the default global loader service\'s\n interpretation of names, paths, and configurations.\n"]
909#[derive(Debug)]
910pub struct Loader;
911
912pub mod loader {
913 pub mod prelude {
914 pub use crate::{
915 loader, Loader, LoaderClientHandler, LoaderClientSender, LoaderServerHandler,
916 LoaderServerSender,
917 };
918
919 pub use crate::LoaderCloneRequest;
920
921 pub use crate::LoaderCloneResponse;
922
923 pub use crate::LoaderConfigRequest;
924
925 pub use crate::LoaderConfigResponse;
926
927 pub use crate::LoaderLoadObjectRequest;
928
929 pub use crate::LoaderLoadObjectResponse;
930 }
931
932 pub struct Done;
933
934 impl ::fidl_next::Method for Done {
935 const ORDINAL: u64 = 7186174313520107521;
936
937 type Protocol = crate::Loader;
938
939 type Request = ();
940
941 type Response = ::fidl_next::Never;
942 }
943
944 pub struct LoadObject;
945
946 impl ::fidl_next::Method for LoadObject {
947 const ORDINAL: u64 = 5243774714012182611;
948
949 type Protocol = crate::Loader;
950
951 type Request = crate::WireLoaderLoadObjectRequest;
952
953 type Response = crate::WireLoaderLoadObjectResponse;
954 }
955
956 pub struct Config;
957
958 impl ::fidl_next::Method for Config {
959 const ORDINAL: u64 = 7676977189692319809;
960
961 type Protocol = crate::Loader;
962
963 type Request = crate::WireLoaderConfigRequest;
964
965 type Response = crate::WireLoaderConfigResponse;
966 }
967
968 pub struct Clone;
969
970 impl ::fidl_next::Method for Clone {
971 const ORDINAL: u64 = 6333824321947847721;
972
973 type Protocol = crate::Loader;
974
975 type Request = crate::WireLoaderCloneRequest;
976
977 type Response = crate::WireLoaderCloneResponse;
978 }
979}
980
981pub trait LoaderClientSender {
983 type Transport: ::fidl_next::Transport;
984
985 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
986 fn done(
987 &self,
988 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
989
990 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
991 fn load_object<___R>(
992 &self,
993 request: ___R,
994 ) -> Result<
995 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::LoadObject>,
996 ::fidl_next::EncodeError,
997 >
998 where
999 ___R: ::fidl_next::Encode<
1000 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1001 Encoded = crate::WireLoaderLoadObjectRequest,
1002 >;
1003
1004 #[doc = " The dynamic linker sends a `config` identifying its load\n configuration. This is intended to affect how later\n `LoadObject` requests decide what particular implementation\n file to supply for a given name.\n"]
1005 fn config<___R>(
1006 &self,
1007 request: ___R,
1008 ) -> Result<
1009 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::Config>,
1010 ::fidl_next::EncodeError,
1011 >
1012 where
1013 ___R: ::fidl_next::Encode<
1014 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1015 Encoded = crate::WireLoaderConfigRequest,
1016 >;
1017
1018 #[doc = " Obtain a new loader service connection.\n"]
1019 fn clone<___R>(
1020 &self,
1021 request: ___R,
1022 ) -> Result<
1023 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::Clone>,
1024 ::fidl_next::EncodeError,
1025 >
1026 where
1027 ___R: ::fidl_next::Encode<
1028 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1029 Encoded = crate::WireLoaderCloneRequest,
1030 >;
1031}
1032
1033impl<___T> LoaderClientSender for ::fidl_next::ClientSender<___T, Loader>
1034where
1035 ___T: ::fidl_next::Transport,
1036{
1037 type Transport = ___T;
1038
1039 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
1040 fn done(
1041 &self,
1042 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
1043 self.as_untyped().send_one_way(7186174313520107521, ())
1044 }
1045
1046 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
1047 fn load_object<___R>(
1048 &self,
1049 request: ___R,
1050 ) -> Result<
1051 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::LoadObject>,
1052 ::fidl_next::EncodeError,
1053 >
1054 where
1055 ___R: ::fidl_next::Encode<
1056 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1057 Encoded = crate::WireLoaderLoadObjectRequest,
1058 >,
1059 {
1060 self.as_untyped()
1061 .send_two_way(5243774714012182611, request)
1062 .map(::fidl_next::ResponseFuture::from_untyped)
1063 }
1064
1065 #[doc = " The dynamic linker sends a `config` identifying its load\n configuration. This is intended to affect how later\n `LoadObject` requests decide what particular implementation\n file to supply for a given name.\n"]
1066 fn config<___R>(
1067 &self,
1068 request: ___R,
1069 ) -> Result<
1070 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::Config>,
1071 ::fidl_next::EncodeError,
1072 >
1073 where
1074 ___R: ::fidl_next::Encode<
1075 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1076 Encoded = crate::WireLoaderConfigRequest,
1077 >,
1078 {
1079 self.as_untyped()
1080 .send_two_way(7676977189692319809, request)
1081 .map(::fidl_next::ResponseFuture::from_untyped)
1082 }
1083
1084 #[doc = " Obtain a new loader service connection.\n"]
1085 fn clone<___R>(
1086 &self,
1087 request: ___R,
1088 ) -> Result<
1089 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::Clone>,
1090 ::fidl_next::EncodeError,
1091 >
1092 where
1093 ___R: ::fidl_next::Encode<
1094 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1095 Encoded = crate::WireLoaderCloneRequest,
1096 >,
1097 {
1098 self.as_untyped()
1099 .send_two_way(6333824321947847721, request)
1100 .map(::fidl_next::ResponseFuture::from_untyped)
1101 }
1102}
1103
1104pub trait LoaderClientHandler<___T: ::fidl_next::Transport> {}
1108
1109impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Loader
1110where
1111 ___T: ::fidl_next::Transport,
1112 ___H: LoaderClientHandler<___T>,
1113
1114 <loader::LoadObject as ::fidl_next::Method>::Response:
1115 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1116
1117 <loader::Config as ::fidl_next::Method>::Response:
1118 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1119
1120 <loader::Clone as ::fidl_next::Method>::Response:
1121 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1122{
1123 fn on_event(
1124 handler: &mut ___H,
1125 sender: &::fidl_next::ClientSender<___T, Self>,
1126 ordinal: u64,
1127 buffer: ___T::RecvBuffer,
1128 ) {
1129 match ordinal {
1130 ordinal => {
1131 sender.close();
1132 }
1133 }
1134 }
1135}
1136
1137pub trait LoaderServerSender {
1139 type Transport: ::fidl_next::Transport;
1140}
1141
1142impl<___T> LoaderServerSender for ::fidl_next::ServerSender<___T, Loader>
1143where
1144 ___T: ::fidl_next::Transport,
1145{
1146 type Transport = ___T;
1147}
1148
1149pub trait LoaderServerHandler<___T: ::fidl_next::Transport> {
1153 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
1154 fn done(&mut self, sender: &::fidl_next::ServerSender<___T, Loader>);
1155
1156 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
1157 fn load_object(
1158 &mut self,
1159 sender: &::fidl_next::ServerSender<___T, Loader>,
1160
1161 request: ::fidl_next::Request<___T, loader::LoadObject>,
1162
1163 responder: ::fidl_next::Responder<loader::LoadObject>,
1164 );
1165
1166 #[doc = " The dynamic linker sends a `config` identifying its load\n configuration. This is intended to affect how later\n `LoadObject` requests decide what particular implementation\n file to supply for a given name.\n"]
1167 fn config(
1168 &mut self,
1169 sender: &::fidl_next::ServerSender<___T, Loader>,
1170
1171 request: ::fidl_next::Request<___T, loader::Config>,
1172
1173 responder: ::fidl_next::Responder<loader::Config>,
1174 );
1175
1176 #[doc = " Obtain a new loader service connection.\n"]
1177 fn clone(
1178 &mut self,
1179 sender: &::fidl_next::ServerSender<___T, Loader>,
1180
1181 request: ::fidl_next::Request<___T, loader::Clone>,
1182
1183 responder: ::fidl_next::Responder<loader::Clone>,
1184 );
1185}
1186
1187impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Loader
1188where
1189 ___T: ::fidl_next::Transport,
1190 ___H: LoaderServerHandler<___T>,
1191
1192 crate::WireLoaderLoadObjectRequest:
1193 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1194
1195 crate::WireLoaderConfigRequest:
1196 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1197
1198 crate::WireLoaderCloneRequest:
1199 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1200{
1201 fn on_one_way(
1202 handler: &mut ___H,
1203 sender: &::fidl_next::ServerSender<___T, Self>,
1204 ordinal: u64,
1205 buffer: ___T::RecvBuffer,
1206 ) {
1207 match ordinal {
1208 7186174313520107521 => {
1209 handler.done(sender);
1210 }
1211
1212 ordinal => {
1213 sender.close();
1214 }
1215 }
1216 }
1217
1218 fn on_two_way(
1219 handler: &mut ___H,
1220 sender: &::fidl_next::ServerSender<___T, Self>,
1221 ordinal: u64,
1222 buffer: ___T::RecvBuffer,
1223 responder: ::fidl_next::protocol::Responder,
1224 ) {
1225 match ordinal {
1226 5243774714012182611 => {
1227 let responder = ::fidl_next::Responder::from_untyped(responder);
1228
1229 match ::fidl_next::DecoderExt::decode(buffer) {
1230 Ok(decoded) => handler.load_object(sender, decoded, responder),
1231 Err(e) => {
1232 sender.close();
1233 }
1234 }
1235 }
1236
1237 7676977189692319809 => {
1238 let responder = ::fidl_next::Responder::from_untyped(responder);
1239
1240 match ::fidl_next::DecoderExt::decode(buffer) {
1241 Ok(decoded) => handler.config(sender, decoded, responder),
1242 Err(e) => {
1243 sender.close();
1244 }
1245 }
1246 }
1247
1248 6333824321947847721 => {
1249 let responder = ::fidl_next::Responder::from_untyped(responder);
1250
1251 match ::fidl_next::DecoderExt::decode(buffer) {
1252 Ok(decoded) => handler.clone(sender, decoded, responder),
1253 Err(e) => {
1254 sender.close();
1255 }
1256 }
1257 }
1258
1259 ordinal => {
1260 sender.close();
1261 }
1262 }
1263 }
1264}
1265
1266pub mod compat {
1268
1269 impl ::fidl_next::TakeFrom<crate::WireLoaderLoadObjectRequest>
1270 for ::fidl_fuchsia_ldsvc::LoaderLoadObjectRequest
1271 {
1272 #[inline]
1273 fn take_from(from: &crate::WireLoaderLoadObjectRequest) -> Self {
1274 Self { object_name: ::fidl_next::TakeFrom::take_from(&from.object_name) }
1275 }
1276 }
1277
1278 impl ::fidl_next::TakeFrom<crate::WireLoaderLoadObjectResponse>
1279 for ::fidl_fuchsia_ldsvc::LoaderLoadObjectResponse
1280 {
1281 #[inline]
1282 fn take_from(from: &crate::WireLoaderLoadObjectResponse) -> Self {
1283 Self {
1284 rv: ::fidl_next::TakeFrom::take_from(&from.rv),
1285
1286 object: ::fidl_next::TakeFrom::take_from(&from.object),
1287 }
1288 }
1289 }
1290
1291 impl ::fidl_next::TakeFrom<crate::WireLoaderConfigRequest>
1292 for ::fidl_fuchsia_ldsvc::LoaderConfigRequest
1293 {
1294 #[inline]
1295 fn take_from(from: &crate::WireLoaderConfigRequest) -> Self {
1296 Self { config: ::fidl_next::TakeFrom::take_from(&from.config) }
1297 }
1298 }
1299
1300 impl ::fidl_next::TakeFrom<crate::WireLoaderConfigResponse>
1301 for ::fidl_fuchsia_ldsvc::LoaderConfigResponse
1302 {
1303 #[inline]
1304 fn take_from(from: &crate::WireLoaderConfigResponse) -> Self {
1305 Self { rv: ::fidl_next::TakeFrom::take_from(&from.rv) }
1306 }
1307 }
1308
1309 impl ::fidl_next::TakeFrom<crate::WireLoaderCloneRequest>
1310 for ::fidl_fuchsia_ldsvc::LoaderCloneRequest
1311 {
1312 #[inline]
1313 fn take_from(from: &crate::WireLoaderCloneRequest) -> Self {
1314 Self { loader: ::fidl_next::TakeFrom::take_from(&from.loader) }
1315 }
1316 }
1317
1318 impl ::fidl_next::TakeFrom<crate::WireLoaderCloneResponse>
1319 for ::fidl_fuchsia_ldsvc::LoaderCloneResponse
1320 {
1321 #[inline]
1322 fn take_from(from: &crate::WireLoaderCloneResponse) -> Self {
1323 Self { rv: ::fidl_next::TakeFrom::take_from(&from.rv) }
1324 }
1325 }
1326
1327 #[cfg(target_os = "fuchsia")]
1328 pub type LoaderProxy =
1331 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Loader>;
1332
1333 impl ::fidl_next::TakeFrom<crate::Loader> for ::fidl_fuchsia_ldsvc::LoaderMarker {
1334 #[inline]
1335 fn take_from(from: &crate::Loader) -> Self {
1336 Self
1337 }
1338 }
1339}