fidl_next_fuchsia_ldsvc/
fidl_next_fuchsia_ldsvc.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(PartialEq, Clone, Debug)]
6pub struct LoaderLoadObjectRequest {
7    pub object_name: ::std::string::String,
8}
9
10impl ::fidl_next::Encodable for LoaderLoadObjectRequest {
11    type Encoded = WireLoaderLoadObjectRequest<'static>;
12}
13
14unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderLoadObjectRequest
15where
16    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17    ___E: ::fidl_next::Encoder,
18{
19    #[inline]
20    fn encode(
21        self,
22        encoder_: &mut ___E,
23        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
25        ::fidl_next::munge! {
26            let Self::Encoded {
27                object_name,
28
29            } = out_;
30        }
31
32        ::fidl_next::Encode::encode(self.object_name, encoder_, object_name)?;
33
34        Ok(())
35    }
36}
37
38unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderLoadObjectRequest
39where
40    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
41    ___E: ::fidl_next::Encoder,
42{
43    #[inline]
44    fn encode_ref(
45        &self,
46        encoder_: &mut ___E,
47        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
48    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
49        ::fidl_next::munge! {
50            let Self::Encoded {
51
52                object_name,
53
54            } = out_;
55        }
56
57        ::fidl_next::EncodeRef::encode_ref(&self.object_name, encoder_, object_name)?;
58
59        Ok(())
60    }
61}
62
63impl ::fidl_next::EncodableOption for LoaderLoadObjectRequest {
64    type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderLoadObjectRequest<'static>>;
65}
66
67unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderLoadObjectRequest
68where
69    ___E: ::fidl_next::Encoder + ?Sized,
70    LoaderLoadObjectRequest: ::fidl_next::Encode<___E>,
71{
72    #[inline]
73    fn encode_option(
74        this: ::core::option::Option<Self>,
75        encoder: &mut ___E,
76        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
77    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
78        if let Some(inner) = this {
79            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
80            ::fidl_next::WireBox::encode_present(out);
81        } else {
82            ::fidl_next::WireBox::encode_absent(out);
83        }
84
85        Ok(())
86    }
87}
88
89unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LoaderLoadObjectRequest
90where
91    ___E: ::fidl_next::Encoder + ?Sized,
92    LoaderLoadObjectRequest: ::fidl_next::EncodeRef<___E>,
93{
94    #[inline]
95    fn encode_option_ref(
96        this: ::core::option::Option<&Self>,
97        encoder: &mut ___E,
98        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
99    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
100        if let Some(inner) = this {
101            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
102            ::fidl_next::WireBox::encode_present(out);
103        } else {
104            ::fidl_next::WireBox::encode_absent(out);
105        }
106
107        Ok(())
108    }
109}
110
111impl<'de> ::fidl_next::FromWire<WireLoaderLoadObjectRequest<'de>> for LoaderLoadObjectRequest {
112    #[inline]
113    fn from_wire(wire: WireLoaderLoadObjectRequest<'de>) -> Self {
114        Self { object_name: ::fidl_next::FromWire::from_wire(wire.object_name) }
115    }
116}
117
118impl<'de> ::fidl_next::IntoNatural for WireLoaderLoadObjectRequest<'de> {
119    type Natural = LoaderLoadObjectRequest;
120}
121
122impl<'de> ::fidl_next::FromWireRef<WireLoaderLoadObjectRequest<'de>> for LoaderLoadObjectRequest {
123    #[inline]
124    fn from_wire_ref(wire: &WireLoaderLoadObjectRequest<'de>) -> Self {
125        Self { object_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.object_name) }
126    }
127}
128
129/// The wire type corresponding to [`LoaderLoadObjectRequest`].
130#[derive(Debug)]
131#[repr(C)]
132pub struct WireLoaderLoadObjectRequest<'de> {
133    pub object_name: ::fidl_next::WireString<'de>,
134}
135static_assertions::const_assert_eq!(std::mem::size_of::<WireLoaderLoadObjectRequest<'_>>(), 16);
136static_assertions::const_assert_eq!(std::mem::align_of::<WireLoaderLoadObjectRequest<'_>>(), 8);
137
138static_assertions::const_assert_eq!(
139    std::mem::offset_of!(WireLoaderLoadObjectRequest<'_>, object_name),
140    0
141);
142
143unsafe impl ::fidl_next::Wire for WireLoaderLoadObjectRequest<'static> {
144    type Decoded<'de> = WireLoaderLoadObjectRequest<'de>;
145
146    #[inline]
147    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
148        ::fidl_next::munge! {
149            let Self {
150
151                object_name,
152
153            } = &mut *out_;
154        }
155
156        ::fidl_next::Wire::zero_padding(object_name);
157    }
158}
159
160unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderLoadObjectRequest<'static>
161where
162    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
163    ___D: ::fidl_next::Decoder,
164{
165    fn decode(
166        slot_: ::fidl_next::Slot<'_, Self>,
167        decoder_: &mut ___D,
168    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
169        ::fidl_next::munge! {
170            let Self {
171
172                mut object_name,
173
174            } = slot_;
175        }
176
177        ::fidl_next::Decode::decode(object_name.as_mut(), decoder_)?;
178
179        let object_name = unsafe { object_name.deref_unchecked() };
180
181        if object_name.len() > 1024 {
182            return Err(::fidl_next::DecodeError::VectorTooLong {
183                size: object_name.len() as u64,
184                limit: 1024,
185            });
186        }
187
188        Ok(())
189    }
190}
191
192#[derive(PartialEq, Debug)]
193#[repr(C)]
194pub struct LoaderLoadObjectResponse {
195    pub rv: i32,
196
197    pub object: ::core::option::Option<::fidl_next::fuchsia::zx::Vmo>,
198}
199
200impl ::fidl_next::Encodable for LoaderLoadObjectResponse {
201    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLoaderLoadObjectResponse> = unsafe {
202        ::fidl_next::CopyOptimization::enable_if(
203            true
204
205                && <
206                    i32 as ::fidl_next::Encodable
207                >::COPY_OPTIMIZATION.is_enabled()
208
209                && <
210                    ::core::option::Option<::fidl_next::fuchsia::zx::Vmo> as ::fidl_next::Encodable
211                >::COPY_OPTIMIZATION.is_enabled()
212
213        )
214    };
215
216    type Encoded = WireLoaderLoadObjectResponse;
217}
218
219unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderLoadObjectResponse
220where
221    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
222    ___E: ::fidl_next::fuchsia::HandleEncoder,
223{
224    #[inline]
225    fn encode(
226        self,
227        encoder_: &mut ___E,
228        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
229    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
230        ::fidl_next::munge! {
231            let Self::Encoded {
232                rv,
233                object,
234
235            } = out_;
236        }
237
238        ::fidl_next::Encode::encode(self.rv, encoder_, rv)?;
239
240        ::fidl_next::Encode::encode(self.object, encoder_, object)?;
241
242        Ok(())
243    }
244}
245
246impl ::fidl_next::EncodableOption for LoaderLoadObjectResponse {
247    type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderLoadObjectResponse>;
248}
249
250unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderLoadObjectResponse
251where
252    ___E: ::fidl_next::Encoder + ?Sized,
253    LoaderLoadObjectResponse: ::fidl_next::Encode<___E>,
254{
255    #[inline]
256    fn encode_option(
257        this: ::core::option::Option<Self>,
258        encoder: &mut ___E,
259        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
260    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
261        if let Some(inner) = this {
262            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
263            ::fidl_next::WireBox::encode_present(out);
264        } else {
265            ::fidl_next::WireBox::encode_absent(out);
266        }
267
268        Ok(())
269    }
270}
271
272impl ::fidl_next::FromWire<WireLoaderLoadObjectResponse> for LoaderLoadObjectResponse {
273    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLoaderLoadObjectResponse, Self> = unsafe {
274        ::fidl_next::CopyOptimization::enable_if(
275            true
276
277                && <
278                    i32 as ::fidl_next::FromWire<::fidl_next::WireI32>
279                >::COPY_OPTIMIZATION.is_enabled()
280
281                && <
282                    ::core::option::Option<::fidl_next::fuchsia::zx::Vmo> as ::fidl_next::FromWire<::fidl_next::fuchsia::WireOptionalVmo>
283                >::COPY_OPTIMIZATION.is_enabled()
284
285        )
286    };
287
288    #[inline]
289    fn from_wire(wire: WireLoaderLoadObjectResponse) -> Self {
290        Self {
291            rv: ::fidl_next::FromWire::from_wire(wire.rv),
292
293            object: ::fidl_next::FromWire::from_wire(wire.object),
294        }
295    }
296}
297
298impl ::fidl_next::IntoNatural for WireLoaderLoadObjectResponse {
299    type Natural = LoaderLoadObjectResponse;
300}
301
302/// The wire type corresponding to [`LoaderLoadObjectResponse`].
303#[derive(Debug)]
304#[repr(C)]
305pub struct WireLoaderLoadObjectResponse {
306    pub rv: ::fidl_next::WireI32,
307
308    pub object: ::fidl_next::fuchsia::WireOptionalVmo,
309}
310static_assertions::const_assert_eq!(std::mem::size_of::<WireLoaderLoadObjectResponse>(), 8);
311static_assertions::const_assert_eq!(std::mem::align_of::<WireLoaderLoadObjectResponse>(), 4);
312
313static_assertions::const_assert_eq!(std::mem::offset_of!(WireLoaderLoadObjectResponse, rv), 0);
314
315static_assertions::const_assert_eq!(std::mem::offset_of!(WireLoaderLoadObjectResponse, object), 4);
316
317unsafe impl ::fidl_next::Wire for WireLoaderLoadObjectResponse {
318    type Decoded<'de> = WireLoaderLoadObjectResponse;
319
320    #[inline]
321    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
322        ::fidl_next::munge! {
323            let Self {
324
325                rv,
326                object,
327
328            } = &mut *out_;
329        }
330
331        ::fidl_next::Wire::zero_padding(rv);
332
333        ::fidl_next::Wire::zero_padding(object);
334    }
335}
336
337unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderLoadObjectResponse
338where
339    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
340    ___D: ::fidl_next::fuchsia::HandleDecoder,
341{
342    fn decode(
343        slot_: ::fidl_next::Slot<'_, Self>,
344        decoder_: &mut ___D,
345    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
346        ::fidl_next::munge! {
347            let Self {
348
349                mut rv,
350                mut object,
351
352            } = slot_;
353        }
354
355        ::fidl_next::Decode::decode(rv.as_mut(), decoder_)?;
356
357        ::fidl_next::Decode::decode(object.as_mut(), decoder_)?;
358
359        Ok(())
360    }
361}
362
363#[derive(PartialEq, Clone, Debug)]
364pub struct LoaderConfigRequest {
365    pub config: ::std::string::String,
366}
367
368impl ::fidl_next::Encodable for LoaderConfigRequest {
369    type Encoded = WireLoaderConfigRequest<'static>;
370}
371
372unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderConfigRequest
373where
374    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
375    ___E: ::fidl_next::Encoder,
376{
377    #[inline]
378    fn encode(
379        self,
380        encoder_: &mut ___E,
381        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
382    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
383        ::fidl_next::munge! {
384            let Self::Encoded {
385                config,
386
387            } = out_;
388        }
389
390        ::fidl_next::Encode::encode(self.config, encoder_, config)?;
391
392        Ok(())
393    }
394}
395
396unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderConfigRequest
397where
398    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
399    ___E: ::fidl_next::Encoder,
400{
401    #[inline]
402    fn encode_ref(
403        &self,
404        encoder_: &mut ___E,
405        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
406    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
407        ::fidl_next::munge! {
408            let Self::Encoded {
409
410                config,
411
412            } = out_;
413        }
414
415        ::fidl_next::EncodeRef::encode_ref(&self.config, encoder_, config)?;
416
417        Ok(())
418    }
419}
420
421impl ::fidl_next::EncodableOption for LoaderConfigRequest {
422    type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderConfigRequest<'static>>;
423}
424
425unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderConfigRequest
426where
427    ___E: ::fidl_next::Encoder + ?Sized,
428    LoaderConfigRequest: ::fidl_next::Encode<___E>,
429{
430    #[inline]
431    fn encode_option(
432        this: ::core::option::Option<Self>,
433        encoder: &mut ___E,
434        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
435    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
436        if let Some(inner) = this {
437            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
438            ::fidl_next::WireBox::encode_present(out);
439        } else {
440            ::fidl_next::WireBox::encode_absent(out);
441        }
442
443        Ok(())
444    }
445}
446
447unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LoaderConfigRequest
448where
449    ___E: ::fidl_next::Encoder + ?Sized,
450    LoaderConfigRequest: ::fidl_next::EncodeRef<___E>,
451{
452    #[inline]
453    fn encode_option_ref(
454        this: ::core::option::Option<&Self>,
455        encoder: &mut ___E,
456        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
457    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
458        if let Some(inner) = this {
459            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
460            ::fidl_next::WireBox::encode_present(out);
461        } else {
462            ::fidl_next::WireBox::encode_absent(out);
463        }
464
465        Ok(())
466    }
467}
468
469impl<'de> ::fidl_next::FromWire<WireLoaderConfigRequest<'de>> for LoaderConfigRequest {
470    #[inline]
471    fn from_wire(wire: WireLoaderConfigRequest<'de>) -> Self {
472        Self { config: ::fidl_next::FromWire::from_wire(wire.config) }
473    }
474}
475
476impl<'de> ::fidl_next::IntoNatural for WireLoaderConfigRequest<'de> {
477    type Natural = LoaderConfigRequest;
478}
479
480impl<'de> ::fidl_next::FromWireRef<WireLoaderConfigRequest<'de>> for LoaderConfigRequest {
481    #[inline]
482    fn from_wire_ref(wire: &WireLoaderConfigRequest<'de>) -> Self {
483        Self { config: ::fidl_next::FromWireRef::from_wire_ref(&wire.config) }
484    }
485}
486
487/// The wire type corresponding to [`LoaderConfigRequest`].
488#[derive(Debug)]
489#[repr(C)]
490pub struct WireLoaderConfigRequest<'de> {
491    pub config: ::fidl_next::WireString<'de>,
492}
493static_assertions::const_assert_eq!(std::mem::size_of::<WireLoaderConfigRequest<'_>>(), 16);
494static_assertions::const_assert_eq!(std::mem::align_of::<WireLoaderConfigRequest<'_>>(), 8);
495
496static_assertions::const_assert_eq!(std::mem::offset_of!(WireLoaderConfigRequest<'_>, config), 0);
497
498unsafe impl ::fidl_next::Wire for WireLoaderConfigRequest<'static> {
499    type Decoded<'de> = WireLoaderConfigRequest<'de>;
500
501    #[inline]
502    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
503        ::fidl_next::munge! {
504            let Self {
505
506                config,
507
508            } = &mut *out_;
509        }
510
511        ::fidl_next::Wire::zero_padding(config);
512    }
513}
514
515unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderConfigRequest<'static>
516where
517    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
518    ___D: ::fidl_next::Decoder,
519{
520    fn decode(
521        slot_: ::fidl_next::Slot<'_, Self>,
522        decoder_: &mut ___D,
523    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
524        ::fidl_next::munge! {
525            let Self {
526
527                mut config,
528
529            } = slot_;
530        }
531
532        ::fidl_next::Decode::decode(config.as_mut(), decoder_)?;
533
534        let config = unsafe { config.deref_unchecked() };
535
536        if config.len() > 1024 {
537            return Err(::fidl_next::DecodeError::VectorTooLong {
538                size: config.len() as u64,
539                limit: 1024,
540            });
541        }
542
543        Ok(())
544    }
545}
546
547#[derive(PartialEq, Clone, Debug)]
548#[repr(C)]
549pub struct LoaderConfigResponse {
550    pub rv: i32,
551}
552
553impl ::fidl_next::Encodable for LoaderConfigResponse {
554    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLoaderConfigResponse> = unsafe {
555        ::fidl_next::CopyOptimization::enable_if(
556            true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
557        )
558    };
559
560    type Encoded = WireLoaderConfigResponse;
561}
562
563unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderConfigResponse
564where
565    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
566{
567    #[inline]
568    fn encode(
569        self,
570        encoder_: &mut ___E,
571        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
572    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
573        ::fidl_next::munge! {
574            let Self::Encoded {
575                rv,
576
577            } = out_;
578        }
579
580        ::fidl_next::Encode::encode(self.rv, encoder_, rv)?;
581
582        Ok(())
583    }
584}
585
586unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderConfigResponse
587where
588    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
589{
590    #[inline]
591    fn encode_ref(
592        &self,
593        encoder_: &mut ___E,
594        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
595    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
596        ::fidl_next::munge! {
597            let Self::Encoded {
598
599                rv,
600
601            } = out_;
602        }
603
604        ::fidl_next::EncodeRef::encode_ref(&self.rv, encoder_, rv)?;
605
606        Ok(())
607    }
608}
609
610impl ::fidl_next::EncodableOption for LoaderConfigResponse {
611    type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderConfigResponse>;
612}
613
614unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderConfigResponse
615where
616    ___E: ::fidl_next::Encoder + ?Sized,
617    LoaderConfigResponse: ::fidl_next::Encode<___E>,
618{
619    #[inline]
620    fn encode_option(
621        this: ::core::option::Option<Self>,
622        encoder: &mut ___E,
623        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
624    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
625        if let Some(inner) = this {
626            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
627            ::fidl_next::WireBox::encode_present(out);
628        } else {
629            ::fidl_next::WireBox::encode_absent(out);
630        }
631
632        Ok(())
633    }
634}
635
636unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LoaderConfigResponse
637where
638    ___E: ::fidl_next::Encoder + ?Sized,
639    LoaderConfigResponse: ::fidl_next::EncodeRef<___E>,
640{
641    #[inline]
642    fn encode_option_ref(
643        this: ::core::option::Option<&Self>,
644        encoder: &mut ___E,
645        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
646    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
647        if let Some(inner) = this {
648            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
649            ::fidl_next::WireBox::encode_present(out);
650        } else {
651            ::fidl_next::WireBox::encode_absent(out);
652        }
653
654        Ok(())
655    }
656}
657
658impl ::fidl_next::FromWire<WireLoaderConfigResponse> for LoaderConfigResponse {
659    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLoaderConfigResponse, Self> = unsafe {
660        ::fidl_next::CopyOptimization::enable_if(
661            true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
662                .is_enabled(),
663        )
664    };
665
666    #[inline]
667    fn from_wire(wire: WireLoaderConfigResponse) -> Self {
668        Self { rv: ::fidl_next::FromWire::from_wire(wire.rv) }
669    }
670}
671
672impl ::fidl_next::IntoNatural for WireLoaderConfigResponse {
673    type Natural = LoaderConfigResponse;
674}
675
676impl ::fidl_next::FromWireRef<WireLoaderConfigResponse> for LoaderConfigResponse {
677    #[inline]
678    fn from_wire_ref(wire: &WireLoaderConfigResponse) -> Self {
679        Self { rv: ::fidl_next::FromWireRef::from_wire_ref(&wire.rv) }
680    }
681}
682
683/// The wire type corresponding to [`LoaderConfigResponse`].
684#[derive(Clone, Debug)]
685#[repr(C)]
686pub struct WireLoaderConfigResponse {
687    pub rv: ::fidl_next::WireI32,
688}
689static_assertions::const_assert_eq!(std::mem::size_of::<WireLoaderConfigResponse>(), 4);
690static_assertions::const_assert_eq!(std::mem::align_of::<WireLoaderConfigResponse>(), 4);
691
692static_assertions::const_assert_eq!(std::mem::offset_of!(WireLoaderConfigResponse, rv), 0);
693
694unsafe impl ::fidl_next::Wire for WireLoaderConfigResponse {
695    type Decoded<'de> = WireLoaderConfigResponse;
696
697    #[inline]
698    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
699        ::fidl_next::munge! {
700            let Self {
701
702                rv,
703
704            } = &mut *out_;
705        }
706
707        ::fidl_next::Wire::zero_padding(rv);
708    }
709}
710
711unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderConfigResponse
712where
713    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
714{
715    fn decode(
716        slot_: ::fidl_next::Slot<'_, Self>,
717        decoder_: &mut ___D,
718    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
719        ::fidl_next::munge! {
720            let Self {
721
722                mut rv,
723
724            } = slot_;
725        }
726
727        ::fidl_next::Decode::decode(rv.as_mut(), decoder_)?;
728
729        Ok(())
730    }
731}
732
733#[derive(PartialEq, Debug)]
734#[repr(C)]
735pub struct LoaderCloneRequest {
736    pub loader: ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::fuchsia::zx::Channel>,
737}
738
739impl ::fidl_next::Encodable for LoaderCloneRequest {
740    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLoaderCloneRequest> = unsafe {
741        ::fidl_next::CopyOptimization::enable_if(
742            true
743
744                && <
745                    ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable
746                >::COPY_OPTIMIZATION.is_enabled()
747
748        )
749    };
750
751    type Encoded = WireLoaderCloneRequest;
752}
753
754unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderCloneRequest
755where
756    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
757    ___E: ::fidl_next::fuchsia::HandleEncoder,
758{
759    #[inline]
760    fn encode(
761        self,
762        encoder_: &mut ___E,
763        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
764    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
765        ::fidl_next::munge! {
766            let Self::Encoded {
767                loader,
768
769            } = out_;
770        }
771
772        ::fidl_next::Encode::encode(self.loader, encoder_, loader)?;
773
774        Ok(())
775    }
776}
777
778impl ::fidl_next::EncodableOption for LoaderCloneRequest {
779    type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderCloneRequest>;
780}
781
782unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderCloneRequest
783where
784    ___E: ::fidl_next::Encoder + ?Sized,
785    LoaderCloneRequest: ::fidl_next::Encode<___E>,
786{
787    #[inline]
788    fn encode_option(
789        this: ::core::option::Option<Self>,
790        encoder: &mut ___E,
791        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
792    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
793        if let Some(inner) = this {
794            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
795            ::fidl_next::WireBox::encode_present(out);
796        } else {
797            ::fidl_next::WireBox::encode_absent(out);
798        }
799
800        Ok(())
801    }
802}
803
804impl ::fidl_next::FromWire<WireLoaderCloneRequest> for LoaderCloneRequest {
805    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLoaderCloneRequest, Self> = unsafe {
806        ::fidl_next::CopyOptimization::enable_if(
807            true
808
809                && <
810                    ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Loader, ::fidl_next::fuchsia::WireChannel>>
811                >::COPY_OPTIMIZATION.is_enabled()
812
813        )
814    };
815
816    #[inline]
817    fn from_wire(wire: WireLoaderCloneRequest) -> Self {
818        Self { loader: ::fidl_next::FromWire::from_wire(wire.loader) }
819    }
820}
821
822impl ::fidl_next::IntoNatural for WireLoaderCloneRequest {
823    type Natural = LoaderCloneRequest;
824}
825
826/// The wire type corresponding to [`LoaderCloneRequest`].
827#[derive(Debug)]
828#[repr(C)]
829pub struct WireLoaderCloneRequest {
830    pub loader: ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::fuchsia::WireChannel>,
831}
832static_assertions::const_assert_eq!(std::mem::size_of::<WireLoaderCloneRequest>(), 4);
833static_assertions::const_assert_eq!(std::mem::align_of::<WireLoaderCloneRequest>(), 4);
834
835static_assertions::const_assert_eq!(std::mem::offset_of!(WireLoaderCloneRequest, loader), 0);
836
837unsafe impl ::fidl_next::Wire for WireLoaderCloneRequest {
838    type Decoded<'de> = WireLoaderCloneRequest;
839
840    #[inline]
841    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
842        ::fidl_next::munge! {
843            let Self {
844
845                loader,
846
847            } = &mut *out_;
848        }
849
850        ::fidl_next::Wire::zero_padding(loader);
851    }
852}
853
854unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderCloneRequest
855where
856    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
857    ___D: ::fidl_next::fuchsia::HandleDecoder,
858{
859    fn decode(
860        slot_: ::fidl_next::Slot<'_, Self>,
861        decoder_: &mut ___D,
862    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
863        ::fidl_next::munge! {
864            let Self {
865
866                mut loader,
867
868            } = slot_;
869        }
870
871        ::fidl_next::Decode::decode(loader.as_mut(), decoder_)?;
872
873        Ok(())
874    }
875}
876
877#[derive(PartialEq, Clone, Debug)]
878#[repr(C)]
879pub struct LoaderCloneResponse {
880    pub rv: i32,
881}
882
883impl ::fidl_next::Encodable for LoaderCloneResponse {
884    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLoaderCloneResponse> = unsafe {
885        ::fidl_next::CopyOptimization::enable_if(
886            true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
887        )
888    };
889
890    type Encoded = WireLoaderCloneResponse;
891}
892
893unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderCloneResponse
894where
895    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
896{
897    #[inline]
898    fn encode(
899        self,
900        encoder_: &mut ___E,
901        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
902    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
903        ::fidl_next::munge! {
904            let Self::Encoded {
905                rv,
906
907            } = out_;
908        }
909
910        ::fidl_next::Encode::encode(self.rv, encoder_, rv)?;
911
912        Ok(())
913    }
914}
915
916unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderCloneResponse
917where
918    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
919{
920    #[inline]
921    fn encode_ref(
922        &self,
923        encoder_: &mut ___E,
924        out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
925    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
926        ::fidl_next::munge! {
927            let Self::Encoded {
928
929                rv,
930
931            } = out_;
932        }
933
934        ::fidl_next::EncodeRef::encode_ref(&self.rv, encoder_, rv)?;
935
936        Ok(())
937    }
938}
939
940impl ::fidl_next::EncodableOption for LoaderCloneResponse {
941    type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderCloneResponse>;
942}
943
944unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderCloneResponse
945where
946    ___E: ::fidl_next::Encoder + ?Sized,
947    LoaderCloneResponse: ::fidl_next::Encode<___E>,
948{
949    #[inline]
950    fn encode_option(
951        this: ::core::option::Option<Self>,
952        encoder: &mut ___E,
953        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
954    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
955        if let Some(inner) = this {
956            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
957            ::fidl_next::WireBox::encode_present(out);
958        } else {
959            ::fidl_next::WireBox::encode_absent(out);
960        }
961
962        Ok(())
963    }
964}
965
966unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LoaderCloneResponse
967where
968    ___E: ::fidl_next::Encoder + ?Sized,
969    LoaderCloneResponse: ::fidl_next::EncodeRef<___E>,
970{
971    #[inline]
972    fn encode_option_ref(
973        this: ::core::option::Option<&Self>,
974        encoder: &mut ___E,
975        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
976    ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
977        if let Some(inner) = this {
978            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
979            ::fidl_next::WireBox::encode_present(out);
980        } else {
981            ::fidl_next::WireBox::encode_absent(out);
982        }
983
984        Ok(())
985    }
986}
987
988impl ::fidl_next::FromWire<WireLoaderCloneResponse> for LoaderCloneResponse {
989    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLoaderCloneResponse, Self> = unsafe {
990        ::fidl_next::CopyOptimization::enable_if(
991            true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
992                .is_enabled(),
993        )
994    };
995
996    #[inline]
997    fn from_wire(wire: WireLoaderCloneResponse) -> Self {
998        Self { rv: ::fidl_next::FromWire::from_wire(wire.rv) }
999    }
1000}
1001
1002impl ::fidl_next::IntoNatural for WireLoaderCloneResponse {
1003    type Natural = LoaderCloneResponse;
1004}
1005
1006impl ::fidl_next::FromWireRef<WireLoaderCloneResponse> for LoaderCloneResponse {
1007    #[inline]
1008    fn from_wire_ref(wire: &WireLoaderCloneResponse) -> Self {
1009        Self { rv: ::fidl_next::FromWireRef::from_wire_ref(&wire.rv) }
1010    }
1011}
1012
1013/// The wire type corresponding to [`LoaderCloneResponse`].
1014#[derive(Clone, Debug)]
1015#[repr(C)]
1016pub struct WireLoaderCloneResponse {
1017    pub rv: ::fidl_next::WireI32,
1018}
1019static_assertions::const_assert_eq!(std::mem::size_of::<WireLoaderCloneResponse>(), 4);
1020static_assertions::const_assert_eq!(std::mem::align_of::<WireLoaderCloneResponse>(), 4);
1021
1022static_assertions::const_assert_eq!(std::mem::offset_of!(WireLoaderCloneResponse, rv), 0);
1023
1024unsafe impl ::fidl_next::Wire for WireLoaderCloneResponse {
1025    type Decoded<'de> = WireLoaderCloneResponse;
1026
1027    #[inline]
1028    fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1029        ::fidl_next::munge! {
1030            let Self {
1031
1032                rv,
1033
1034            } = &mut *out_;
1035        }
1036
1037        ::fidl_next::Wire::zero_padding(rv);
1038    }
1039}
1040
1041unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderCloneResponse
1042where
1043    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1044{
1045    fn decode(
1046        slot_: ::fidl_next::Slot<'_, Self>,
1047        decoder_: &mut ___D,
1048    ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1049        ::fidl_next::munge! {
1050            let Self {
1051
1052                mut rv,
1053
1054            } = slot_;
1055        }
1056
1057        ::fidl_next::Decode::decode(rv.as_mut(), decoder_)?;
1058
1059        Ok(())
1060    }
1061}
1062
1063/// The type corresponding to the Loader protocol.
1064#[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"]
1065#[derive(PartialEq, Debug)]
1066pub struct Loader;
1067
1068pub mod loader {
1069    pub mod prelude {
1070        pub use crate::{Loader, LoaderClientHandler, LoaderServerHandler, loader};
1071
1072        pub use crate::LoaderCloneRequest;
1073
1074        pub use crate::LoaderCloneResponse;
1075
1076        pub use crate::LoaderConfigRequest;
1077
1078        pub use crate::LoaderConfigResponse;
1079
1080        pub use crate::LoaderLoadObjectRequest;
1081
1082        pub use crate::LoaderLoadObjectResponse;
1083    }
1084
1085    pub struct Done;
1086
1087    impl ::fidl_next::Method for Done {
1088        const ORDINAL: u64 = 7186174313520107521;
1089
1090        type Protocol = crate::Loader;
1091
1092        type Request = ();
1093
1094        type Response = ::fidl_next::Never;
1095    }
1096
1097    pub struct LoadObject;
1098
1099    impl ::fidl_next::Method for LoadObject {
1100        const ORDINAL: u64 = 5243774714012182611;
1101
1102        type Protocol = crate::Loader;
1103
1104        type Request = crate::WireLoaderLoadObjectRequest<'static>;
1105
1106        type Response = crate::WireLoaderLoadObjectResponse;
1107    }
1108
1109    pub struct Config;
1110
1111    impl ::fidl_next::Method for Config {
1112        const ORDINAL: u64 = 7676977189692319809;
1113
1114        type Protocol = crate::Loader;
1115
1116        type Request = crate::WireLoaderConfigRequest<'static>;
1117
1118        type Response = crate::WireLoaderConfigResponse;
1119    }
1120
1121    pub struct Clone;
1122
1123    impl ::fidl_next::Method for Clone {
1124        const ORDINAL: u64 = 6333824321947847721;
1125
1126        type Protocol = crate::Loader;
1127
1128        type Request = crate::WireLoaderCloneRequest;
1129
1130        type Response = crate::WireLoaderCloneResponse;
1131    }
1132
1133    mod ___detail {
1134
1135        pub struct LoadObject<T0> {
1136            object_name: T0,
1137        }
1138
1139        impl<T0> ::fidl_next::Encodable for LoadObject<T0>
1140        where
1141            T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
1142        {
1143            type Encoded = crate::WireLoaderLoadObjectRequest<'static>;
1144        }
1145
1146        unsafe impl<___E, T0> ::fidl_next::Encode<___E> for LoadObject<T0>
1147        where
1148            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1149            ___E: ::fidl_next::Encoder,
1150            T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
1151        {
1152            #[inline]
1153            fn encode(
1154                self,
1155                encoder_: &mut ___E,
1156                out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1157            ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1158                ::fidl_next::munge! {
1159                    let Self::Encoded {
1160                        object_name,
1161
1162                    } = out_;
1163                }
1164
1165                ::fidl_next::Encode::encode(self.object_name, encoder_, object_name)?;
1166
1167                Ok(())
1168            }
1169        }
1170
1171        pub struct Config<T0> {
1172            config: T0,
1173        }
1174
1175        impl<T0> ::fidl_next::Encodable for Config<T0>
1176        where
1177            T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
1178        {
1179            type Encoded = crate::WireLoaderConfigRequest<'static>;
1180        }
1181
1182        unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Config<T0>
1183        where
1184            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1185            ___E: ::fidl_next::Encoder,
1186            T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
1187        {
1188            #[inline]
1189            fn encode(
1190                self,
1191                encoder_: &mut ___E,
1192                out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1193            ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1194                ::fidl_next::munge! {
1195                    let Self::Encoded {
1196                        config,
1197
1198                    } = out_;
1199                }
1200
1201                ::fidl_next::Encode::encode(self.config, encoder_, config)?;
1202
1203                Ok(())
1204            }
1205        }
1206
1207        pub struct Clone<T0> {
1208            loader: T0,
1209        }
1210
1211        impl<T0> ::fidl_next::Encodable for Clone<T0>
1212        where
1213            T0: ::fidl_next::Encodable<
1214                    Encoded = ::fidl_next::ServerEnd<
1215                        crate::Loader,
1216                        ::fidl_next::fuchsia::WireChannel,
1217                    >,
1218                >,
1219        {
1220            type Encoded = crate::WireLoaderCloneRequest;
1221        }
1222
1223        unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
1224        where
1225            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1226            ___E: ::fidl_next::fuchsia::HandleEncoder,
1227            T0: ::fidl_next::Encode<
1228                    ___E,
1229                    Encoded = ::fidl_next::ServerEnd<
1230                        crate::Loader,
1231                        ::fidl_next::fuchsia::WireChannel,
1232                    >,
1233                >,
1234        {
1235            #[inline]
1236            fn encode(
1237                self,
1238                encoder_: &mut ___E,
1239                out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1240            ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1241                ::fidl_next::munge! {
1242                    let Self::Encoded {
1243                        loader,
1244
1245                    } = out_;
1246                }
1247
1248                ::fidl_next::Encode::encode(self.loader, encoder_, loader)?;
1249
1250                Ok(())
1251            }
1252        }
1253
1254        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Loader
1255        where
1256            ___T: ::fidl_next::Transport,
1257        {
1258            type Client = LoaderClient<___T>;
1259            type Server = LoaderServer<___T>;
1260        }
1261
1262        /// The client for the `Loader` protocol.
1263        #[repr(transparent)]
1264        pub struct LoaderClient<___T: ::fidl_next::Transport> {
1265            #[allow(dead_code)]
1266            client: ::fidl_next::protocol::Client<___T>,
1267        }
1268
1269        impl<___T> LoaderClient<___T>
1270        where
1271            ___T: ::fidl_next::Transport,
1272        {
1273            #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
1274            pub fn done(&self) -> ::fidl_next::SendFuture<'_, ___T> {
1275                ::fidl_next::SendFuture::from_untyped(
1276                    self.client.send_one_way(7186174313520107521, ()),
1277                )
1278            }
1279
1280            #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
1281            pub fn load_object(
1282                &self,
1283
1284                object_name: impl ::fidl_next::Encode<
1285                    <___T as ::fidl_next::Transport>::SendBuffer,
1286                    Encoded = ::fidl_next::WireString<'static>,
1287                >,
1288            ) -> ::fidl_next::TwoWayFuture<'_, super::LoadObject, ___T>
1289            where
1290                <___T as ::fidl_next::Transport>::SendBuffer:
1291                    ::fidl_next::encoder::InternalHandleEncoder,
1292                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1293            {
1294                self.load_object_with(LoadObject { object_name })
1295            }
1296
1297            #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
1298            pub fn load_object_with<___R>(
1299                &self,
1300                request: ___R,
1301            ) -> ::fidl_next::TwoWayFuture<'_, super::LoadObject, ___T>
1302            where
1303                ___R: ::fidl_next::Encode<
1304                        <___T as ::fidl_next::Transport>::SendBuffer,
1305                        Encoded = crate::WireLoaderLoadObjectRequest<'static>,
1306                    >,
1307            {
1308                ::fidl_next::TwoWayFuture::from_untyped(
1309                    self.client.send_two_way(5243774714012182611, request),
1310                )
1311            }
1312
1313            #[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"]
1314            pub fn config(
1315                &self,
1316
1317                config: impl ::fidl_next::Encode<
1318                    <___T as ::fidl_next::Transport>::SendBuffer,
1319                    Encoded = ::fidl_next::WireString<'static>,
1320                >,
1321            ) -> ::fidl_next::TwoWayFuture<'_, super::Config, ___T>
1322            where
1323                <___T as ::fidl_next::Transport>::SendBuffer:
1324                    ::fidl_next::encoder::InternalHandleEncoder,
1325                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1326            {
1327                self.config_with(Config { config })
1328            }
1329
1330            #[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"]
1331            pub fn config_with<___R>(
1332                &self,
1333                request: ___R,
1334            ) -> ::fidl_next::TwoWayFuture<'_, super::Config, ___T>
1335            where
1336                ___R: ::fidl_next::Encode<
1337                        <___T as ::fidl_next::Transport>::SendBuffer,
1338                        Encoded = crate::WireLoaderConfigRequest<'static>,
1339                    >,
1340            {
1341                ::fidl_next::TwoWayFuture::from_untyped(
1342                    self.client.send_two_way(7676977189692319809, request),
1343                )
1344            }
1345
1346            #[doc = " Obtain a new loader service connection.\n"]
1347            pub fn clone(
1348                &self,
1349
1350                loader: impl ::fidl_next::Encode<
1351                    <___T as ::fidl_next::Transport>::SendBuffer,
1352                    Encoded = ::fidl_next::ServerEnd<
1353                        crate::Loader,
1354                        ::fidl_next::fuchsia::WireChannel,
1355                    >,
1356                >,
1357            ) -> ::fidl_next::TwoWayFuture<'_, super::Clone, ___T>
1358            where
1359                <___T as ::fidl_next::Transport>::SendBuffer:
1360                    ::fidl_next::encoder::InternalHandleEncoder,
1361                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1362            {
1363                self.clone_with(Clone { loader })
1364            }
1365
1366            #[doc = " Obtain a new loader service connection.\n"]
1367            pub fn clone_with<___R>(
1368                &self,
1369                request: ___R,
1370            ) -> ::fidl_next::TwoWayFuture<'_, super::Clone, ___T>
1371            where
1372                ___R: ::fidl_next::Encode<
1373                        <___T as ::fidl_next::Transport>::SendBuffer,
1374                        Encoded = crate::WireLoaderCloneRequest,
1375                    >,
1376            {
1377                ::fidl_next::TwoWayFuture::from_untyped(
1378                    self.client.send_two_way(6333824321947847721, request),
1379                )
1380            }
1381        }
1382
1383        /// The server for the `Loader` protocol.
1384        #[repr(transparent)]
1385        pub struct LoaderServer<___T: ::fidl_next::Transport> {
1386            server: ::fidl_next::protocol::Server<___T>,
1387        }
1388
1389        impl<___T> LoaderServer<___T> where ___T: ::fidl_next::Transport {}
1390    }
1391}
1392
1393/// A client handler for the Loader protocol.
1394///
1395/// See [`Loader`] for more details.
1396pub trait LoaderClientHandler<
1397    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1398    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1399>
1400{
1401}
1402
1403impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Loader
1404where
1405    ___H: LoaderClientHandler<___T> + ::core::marker::Send,
1406    ___T: ::fidl_next::Transport,
1407    <loader::LoadObject as ::fidl_next::Method>::Response:
1408        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1409    <loader::Config as ::fidl_next::Method>::Response:
1410        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1411    <loader::Clone as ::fidl_next::Method>::Response:
1412        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1413{
1414    async fn on_event(
1415        handler: &mut ___H,
1416        ordinal: u64,
1417        buffer: ___T::RecvBuffer,
1418    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1419        match ordinal {
1420            ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1421        }
1422    }
1423}
1424
1425/// A server handler for the Loader protocol.
1426///
1427/// See [`Loader`] for more details.
1428pub trait LoaderServerHandler<
1429    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1430    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1431>
1432{
1433    #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
1434    fn done(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1435
1436    #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
1437    fn load_object(
1438        &mut self,
1439
1440        request: ::fidl_next::Request<loader::LoadObject, ___T>,
1441
1442        responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
1443    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1444
1445    #[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"]
1446    fn config(
1447        &mut self,
1448
1449        request: ::fidl_next::Request<loader::Config, ___T>,
1450
1451        responder: ::fidl_next::Responder<loader::Config, ___T>,
1452    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1453
1454    #[doc = " Obtain a new loader service connection.\n"]
1455    fn clone(
1456        &mut self,
1457
1458        request: ::fidl_next::Request<loader::Clone, ___T>,
1459
1460        responder: ::fidl_next::Responder<loader::Clone, ___T>,
1461    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1462}
1463
1464impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Loader
1465where
1466    ___H: LoaderServerHandler<___T> + ::core::marker::Send,
1467    ___T: ::fidl_next::Transport,
1468    <loader::LoadObject as ::fidl_next::Method>::Request:
1469        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1470    <loader::Config as ::fidl_next::Method>::Request:
1471        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1472    <loader::Clone as ::fidl_next::Method>::Request:
1473        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1474{
1475    async fn on_one_way(
1476        handler: &mut ___H,
1477        ordinal: u64,
1478        buffer: ___T::RecvBuffer,
1479    ) -> ::core::result::Result<
1480        (),
1481        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1482    > {
1483        match ordinal {
1484            7186174313520107521 => {
1485                handler.done().await;
1486                Ok(())
1487            }
1488
1489            ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1490        }
1491    }
1492
1493    async fn on_two_way(
1494        handler: &mut ___H,
1495        ordinal: u64,
1496        buffer: ___T::RecvBuffer,
1497        responder: ::fidl_next::protocol::Responder<___T>,
1498    ) -> ::core::result::Result<
1499        (),
1500        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1501    > {
1502        match ordinal {
1503            5243774714012182611 => {
1504                let responder = ::fidl_next::Responder::from_untyped(responder);
1505
1506                match ::fidl_next::DecoderExt::decode(buffer) {
1507                    Ok(decoded) => {
1508                        handler.load_object(decoded, responder).await;
1509                        Ok(())
1510                    }
1511                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1512                        ordinal: 5243774714012182611,
1513                        error,
1514                    }),
1515                }
1516            }
1517
1518            7676977189692319809 => {
1519                let responder = ::fidl_next::Responder::from_untyped(responder);
1520
1521                match ::fidl_next::DecoderExt::decode(buffer) {
1522                    Ok(decoded) => {
1523                        handler.config(decoded, responder).await;
1524                        Ok(())
1525                    }
1526                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1527                        ordinal: 7676977189692319809,
1528                        error,
1529                    }),
1530                }
1531            }
1532
1533            6333824321947847721 => {
1534                let responder = ::fidl_next::Responder::from_untyped(responder);
1535
1536                match ::fidl_next::DecoderExt::decode(buffer) {
1537                    Ok(decoded) => {
1538                        handler.clone(decoded, responder).await;
1539                        Ok(())
1540                    }
1541                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1542                        ordinal: 6333824321947847721,
1543                        error,
1544                    }),
1545                }
1546            }
1547
1548            ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1549        }
1550    }
1551}
1552
1553/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
1554pub mod compat {
1555
1556    impl ::fidl_next::CompatFrom<crate::LoaderLoadObjectRequest>
1557        for ::fidl_fuchsia_ldsvc::LoaderLoadObjectRequest
1558    {
1559        #[inline]
1560        fn compat_from(value: crate::LoaderLoadObjectRequest) -> Self {
1561            Self { object_name: ::fidl_next::CompatFrom::compat_from(value.object_name) }
1562        }
1563    }
1564
1565    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderLoadObjectRequest>
1566        for crate::LoaderLoadObjectRequest
1567    {
1568        #[inline]
1569        fn compat_from(value: ::fidl_fuchsia_ldsvc::LoaderLoadObjectRequest) -> Self {
1570            Self { object_name: ::fidl_next::CompatFrom::compat_from(value.object_name) }
1571        }
1572    }
1573
1574    impl ::fidl_next::CompatFrom<crate::LoaderLoadObjectResponse>
1575        for ::fidl_fuchsia_ldsvc::LoaderLoadObjectResponse
1576    {
1577        #[inline]
1578        fn compat_from(value: crate::LoaderLoadObjectResponse) -> Self {
1579            Self {
1580                rv: ::fidl_next::CompatFrom::compat_from(value.rv),
1581
1582                object: ::fidl_next::CompatFrom::compat_from(value.object),
1583            }
1584        }
1585    }
1586
1587    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderLoadObjectResponse>
1588        for crate::LoaderLoadObjectResponse
1589    {
1590        #[inline]
1591        fn compat_from(value: ::fidl_fuchsia_ldsvc::LoaderLoadObjectResponse) -> Self {
1592            Self {
1593                rv: ::fidl_next::CompatFrom::compat_from(value.rv),
1594
1595                object: ::fidl_next::CompatFrom::compat_from(value.object),
1596            }
1597        }
1598    }
1599
1600    impl ::fidl_next::CompatFrom<crate::LoaderConfigRequest>
1601        for ::fidl_fuchsia_ldsvc::LoaderConfigRequest
1602    {
1603        #[inline]
1604        fn compat_from(value: crate::LoaderConfigRequest) -> Self {
1605            Self { config: ::fidl_next::CompatFrom::compat_from(value.config) }
1606        }
1607    }
1608
1609    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderConfigRequest>
1610        for crate::LoaderConfigRequest
1611    {
1612        #[inline]
1613        fn compat_from(value: ::fidl_fuchsia_ldsvc::LoaderConfigRequest) -> Self {
1614            Self { config: ::fidl_next::CompatFrom::compat_from(value.config) }
1615        }
1616    }
1617
1618    impl ::fidl_next::CompatFrom<crate::LoaderConfigResponse>
1619        for ::fidl_fuchsia_ldsvc::LoaderConfigResponse
1620    {
1621        #[inline]
1622        fn compat_from(value: crate::LoaderConfigResponse) -> Self {
1623            Self { rv: ::fidl_next::CompatFrom::compat_from(value.rv) }
1624        }
1625    }
1626
1627    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderConfigResponse>
1628        for crate::LoaderConfigResponse
1629    {
1630        #[inline]
1631        fn compat_from(value: ::fidl_fuchsia_ldsvc::LoaderConfigResponse) -> Self {
1632            Self { rv: ::fidl_next::CompatFrom::compat_from(value.rv) }
1633        }
1634    }
1635
1636    impl ::fidl_next::CompatFrom<crate::LoaderCloneRequest>
1637        for ::fidl_fuchsia_ldsvc::LoaderCloneRequest
1638    {
1639        #[inline]
1640        fn compat_from(value: crate::LoaderCloneRequest) -> Self {
1641            Self { loader: ::fidl_next::CompatFrom::compat_from(value.loader) }
1642        }
1643    }
1644
1645    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderCloneRequest>
1646        for crate::LoaderCloneRequest
1647    {
1648        #[inline]
1649        fn compat_from(value: ::fidl_fuchsia_ldsvc::LoaderCloneRequest) -> Self {
1650            Self { loader: ::fidl_next::CompatFrom::compat_from(value.loader) }
1651        }
1652    }
1653
1654    impl ::fidl_next::CompatFrom<crate::LoaderCloneResponse>
1655        for ::fidl_fuchsia_ldsvc::LoaderCloneResponse
1656    {
1657        #[inline]
1658        fn compat_from(value: crate::LoaderCloneResponse) -> Self {
1659            Self { rv: ::fidl_next::CompatFrom::compat_from(value.rv) }
1660        }
1661    }
1662
1663    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderCloneResponse>
1664        for crate::LoaderCloneResponse
1665    {
1666        #[inline]
1667        fn compat_from(value: ::fidl_fuchsia_ldsvc::LoaderCloneResponse) -> Self {
1668            Self { rv: ::fidl_next::CompatFrom::compat_from(value.rv) }
1669        }
1670    }
1671
1672    #[cfg(target_os = "fuchsia")]
1673    /// An alias for a client over `zx::Channel` for the `Loader`
1674    /// protocol.
1675    pub type LoaderProxy = ::fidl_next::Client<crate::Loader>;
1676
1677    impl ::fidl_next::CompatFrom<crate::Loader> for ::fidl_fuchsia_ldsvc::LoaderMarker {
1678        fn compat_from(_: crate::Loader) -> Self {
1679            Self
1680        }
1681    }
1682
1683    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderMarker> for crate::Loader {
1684        fn compat_from(_: ::fidl_fuchsia_ldsvc::LoaderMarker) -> Self {
1685            Self
1686        }
1687    }
1688
1689    #[cfg(target_os = "fuchsia")]
1690
1691    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_ldsvc::LoaderProxy> for crate::Loader {
1692        fn client_compat_from(
1693            proxy: ::fidl_fuchsia_ldsvc::LoaderProxy,
1694        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
1695            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
1696            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
1697            ::fidl_next::ClientDispatcher::new(client_end)
1698        }
1699    }
1700}