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