Skip to main content

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
5pub mod natural {
6
7    pub use fidl_next_common_fuchsia_ldsvc::natural::*;
8
9    #[derive(Debug, PartialEq)]
10    #[repr(C)]
11    pub struct LoaderLoadObjectResponse {
12        pub rv: i32,
13
14        pub object: ::core::option::Option<::fidl_next::fuchsia::zx::Vmo>,
15    }
16
17    unsafe impl<___E> ::fidl_next::Encode<crate::wire::LoaderLoadObjectResponse, ___E>
18        for LoaderLoadObjectResponse
19    where
20        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21        ___E: ::fidl_next::fuchsia::HandleEncoder,
22    {
23        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
24            Self,
25            crate::wire::LoaderLoadObjectResponse,
26        > = unsafe {
27            ::fidl_next::CopyOptimization::enable_if(
28            true
29
30                && <
31                    i32 as ::fidl_next::Encode<::fidl_next::wire::Int32, ___E>
32                >::COPY_OPTIMIZATION.is_enabled()
33
34                && <
35                    ::core::option::Option<::fidl_next::fuchsia::zx::Vmo> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalVmo, ___E>
36                >::COPY_OPTIMIZATION.is_enabled()
37
38        )
39        };
40
41        #[inline]
42        fn encode(
43            self,
44            encoder_: &mut ___E,
45            out_: &mut ::core::mem::MaybeUninit<crate::wire::LoaderLoadObjectResponse>,
46            _: (),
47        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
48            ::fidl_next::munge! {
49                let crate::wire::LoaderLoadObjectResponse {
50                    rv,
51                    object,
52
53                } = out_;
54            }
55
56            ::fidl_next::Encode::encode(self.rv, encoder_, rv, ())?;
57
58            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rv.as_mut_ptr()) };
59
60            ::fidl_next::Encode::encode(self.object, encoder_, object, ())?;
61
62            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(object.as_mut_ptr()) };
63
64            Ok(())
65        }
66    }
67
68    unsafe impl<___E>
69        ::fidl_next::EncodeOption<
70            ::fidl_next::wire::Box<'static, crate::wire::LoaderLoadObjectResponse>,
71            ___E,
72        > for LoaderLoadObjectResponse
73    where
74        ___E: ::fidl_next::Encoder + ?Sized,
75        LoaderLoadObjectResponse: ::fidl_next::Encode<crate::wire::LoaderLoadObjectResponse, ___E>,
76    {
77        #[inline]
78        fn encode_option(
79            this: ::core::option::Option<Self>,
80            encoder: &mut ___E,
81            out: &mut ::core::mem::MaybeUninit<
82                ::fidl_next::wire::Box<'static, crate::wire::LoaderLoadObjectResponse>,
83            >,
84            _: (),
85        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
86            if let Some(inner) = this {
87                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
88                ::fidl_next::wire::Box::encode_present(out);
89            } else {
90                ::fidl_next::wire::Box::encode_absent(out);
91            }
92
93            Ok(())
94        }
95    }
96
97    impl ::fidl_next::FromWire<crate::wire::LoaderLoadObjectResponse> for LoaderLoadObjectResponse {
98        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
99            crate::wire::LoaderLoadObjectResponse,
100            Self,
101        > = unsafe {
102            ::fidl_next::CopyOptimization::enable_if(
103            true
104
105                && <
106                    i32 as ::fidl_next::FromWire<::fidl_next::wire::Int32>
107                >::COPY_OPTIMIZATION.is_enabled()
108
109                && <
110                    ::core::option::Option<::fidl_next::fuchsia::zx::Vmo> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::OptionalVmo>
111                >::COPY_OPTIMIZATION.is_enabled()
112
113        )
114        };
115
116        #[inline]
117        fn from_wire(wire: crate::wire::LoaderLoadObjectResponse) -> Self {
118            Self {
119                rv: ::fidl_next::FromWire::from_wire(wire.rv),
120
121                object: ::fidl_next::FromWire::from_wire(wire.object),
122            }
123        }
124    }
125
126    #[derive(Debug, PartialEq)]
127    #[repr(C)]
128    pub struct LoaderCloneRequest {
129        pub loader: ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::fuchsia::zx::Channel>,
130    }
131
132    unsafe impl<___E> ::fidl_next::Encode<crate::wire::LoaderCloneRequest, ___E> for LoaderCloneRequest
133    where
134        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
135        ___E: ::fidl_next::fuchsia::HandleEncoder,
136    {
137        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
138            Self,
139            crate::wire::LoaderCloneRequest,
140        > = unsafe {
141            ::fidl_next::CopyOptimization::enable_if(
142            true
143
144                && <
145                    ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encode<::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>, ___E>
146                >::COPY_OPTIMIZATION.is_enabled()
147
148        )
149        };
150
151        #[inline]
152        fn encode(
153            self,
154            encoder_: &mut ___E,
155            out_: &mut ::core::mem::MaybeUninit<crate::wire::LoaderCloneRequest>,
156            _: (),
157        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
158            ::fidl_next::munge! {
159                let crate::wire::LoaderCloneRequest {
160                    loader,
161
162                } = out_;
163            }
164
165            ::fidl_next::Encode::encode(self.loader, encoder_, loader, ())?;
166
167            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(loader.as_mut_ptr()) };
168
169            Ok(())
170        }
171    }
172
173    unsafe impl<___E>
174        ::fidl_next::EncodeOption<
175            ::fidl_next::wire::Box<'static, crate::wire::LoaderCloneRequest>,
176            ___E,
177        > for LoaderCloneRequest
178    where
179        ___E: ::fidl_next::Encoder + ?Sized,
180        LoaderCloneRequest: ::fidl_next::Encode<crate::wire::LoaderCloneRequest, ___E>,
181    {
182        #[inline]
183        fn encode_option(
184            this: ::core::option::Option<Self>,
185            encoder: &mut ___E,
186            out: &mut ::core::mem::MaybeUninit<
187                ::fidl_next::wire::Box<'static, crate::wire::LoaderCloneRequest>,
188            >,
189            _: (),
190        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
191            if let Some(inner) = this {
192                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
193                ::fidl_next::wire::Box::encode_present(out);
194            } else {
195                ::fidl_next::wire::Box::encode_absent(out);
196            }
197
198            Ok(())
199        }
200    }
201
202    impl ::fidl_next::FromWire<crate::wire::LoaderCloneRequest> for LoaderCloneRequest {
203        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
204            crate::wire::LoaderCloneRequest,
205            Self,
206        > = unsafe {
207            ::fidl_next::CopyOptimization::enable_if(
208            true
209
210                && <
211                    ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>>
212                >::COPY_OPTIMIZATION.is_enabled()
213
214        )
215        };
216
217        #[inline]
218        fn from_wire(wire: crate::wire::LoaderCloneRequest) -> Self {
219            Self { loader: ::fidl_next::FromWire::from_wire(wire.loader) }
220        }
221    }
222}
223
224pub mod wire {
225
226    pub use fidl_next_common_fuchsia_ldsvc::wire::*;
227
228    /// The wire type corresponding to [`LoaderLoadObjectResponse`].
229    #[derive(Debug)]
230    #[repr(C)]
231    pub struct LoaderLoadObjectResponse {
232        pub rv: ::fidl_next::wire::Int32,
233
234        pub object: ::fidl_next::wire::fuchsia::OptionalVmo,
235    }
236
237    static_assertions::const_assert_eq!(std::mem::size_of::<LoaderLoadObjectResponse>(), 8);
238    static_assertions::const_assert_eq!(std::mem::align_of::<LoaderLoadObjectResponse>(), 4);
239
240    static_assertions::const_assert_eq!(std::mem::offset_of!(LoaderLoadObjectResponse, rv), 0);
241
242    static_assertions::const_assert_eq!(std::mem::offset_of!(LoaderLoadObjectResponse, object), 4);
243
244    impl ::fidl_next::Constrained for LoaderLoadObjectResponse {
245        type Constraint = ();
246
247        fn validate(
248            _: ::fidl_next::Slot<'_, Self>,
249            _: Self::Constraint,
250        ) -> Result<(), ::fidl_next::ValidationError> {
251            Ok(())
252        }
253    }
254
255    unsafe impl ::fidl_next::Wire for LoaderLoadObjectResponse {
256        type Narrowed<'de> = LoaderLoadObjectResponse;
257
258        #[inline]
259        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
260            ::fidl_next::munge! {
261                let Self {
262
263                    rv,
264                    object,
265
266                } = &mut *out_;
267            }
268
269            ::fidl_next::Wire::zero_padding(rv);
270
271            ::fidl_next::Wire::zero_padding(object);
272        }
273    }
274
275    unsafe impl<___D> ::fidl_next::Decode<___D> for LoaderLoadObjectResponse
276    where
277        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
278        ___D: ::fidl_next::fuchsia::HandleDecoder,
279    {
280        fn decode(
281            slot_: ::fidl_next::Slot<'_, Self>,
282            decoder_: &mut ___D,
283            _: (),
284        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
285            ::fidl_next::munge! {
286                let Self {
287
288                    mut rv,
289                    mut object,
290
291                } = slot_;
292            }
293
294            let _field = rv.as_mut();
295
296            ::fidl_next::Decode::decode(rv.as_mut(), decoder_, ())?;
297
298            let _field = object.as_mut();
299
300            ::fidl_next::Decode::decode(object.as_mut(), decoder_, ())?;
301
302            Ok(())
303        }
304    }
305
306    impl ::fidl_next::IntoNatural for LoaderLoadObjectResponse {
307        type Natural = crate::natural::LoaderLoadObjectResponse;
308    }
309
310    /// The wire type corresponding to [`LoaderCloneRequest`].
311    #[derive(Debug)]
312    #[repr(C)]
313    pub struct LoaderCloneRequest {
314        pub loader: ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>,
315    }
316
317    static_assertions::const_assert_eq!(std::mem::size_of::<LoaderCloneRequest>(), 4);
318    static_assertions::const_assert_eq!(std::mem::align_of::<LoaderCloneRequest>(), 4);
319
320    static_assertions::const_assert_eq!(std::mem::offset_of!(LoaderCloneRequest, loader), 0);
321
322    impl ::fidl_next::Constrained for LoaderCloneRequest {
323        type Constraint = ();
324
325        fn validate(
326            _: ::fidl_next::Slot<'_, Self>,
327            _: Self::Constraint,
328        ) -> Result<(), ::fidl_next::ValidationError> {
329            Ok(())
330        }
331    }
332
333    unsafe impl ::fidl_next::Wire for LoaderCloneRequest {
334        type Narrowed<'de> = LoaderCloneRequest;
335
336        #[inline]
337        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
338            ::fidl_next::munge! {
339                let Self {
340
341                    loader,
342
343                } = &mut *out_;
344            }
345
346            ::fidl_next::Wire::zero_padding(loader);
347        }
348    }
349
350    unsafe impl<___D> ::fidl_next::Decode<___D> for LoaderCloneRequest
351    where
352        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
353        ___D: ::fidl_next::fuchsia::HandleDecoder,
354    {
355        fn decode(
356            slot_: ::fidl_next::Slot<'_, Self>,
357            decoder_: &mut ___D,
358            _: (),
359        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
360            ::fidl_next::munge! {
361                let Self {
362
363                    mut loader,
364
365                } = slot_;
366            }
367
368            let _field = loader.as_mut();
369
370            ::fidl_next::Decode::decode(loader.as_mut(), decoder_, ())?;
371
372            Ok(())
373        }
374    }
375
376    impl ::fidl_next::IntoNatural for LoaderCloneRequest {
377        type Natural = crate::natural::LoaderCloneRequest;
378    }
379}
380
381pub mod wire_optional {
382
383    pub use fidl_next_common_fuchsia_ldsvc::wire_optional::*;
384}
385
386pub mod generic {
387
388    pub use fidl_next_common_fuchsia_ldsvc::generic::*;
389
390    pub struct LoaderLoadObjectResponse<T0, T1> {
391        pub rv: T0,
392
393        pub object: T1,
394    }
395
396    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::LoaderLoadObjectResponse, ___E>
397        for LoaderLoadObjectResponse<T0, T1>
398    where
399        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
400        ___E: ::fidl_next::fuchsia::HandleEncoder,
401        T0: ::fidl_next::Encode<::fidl_next::wire::Int32, ___E>,
402        T1: ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalVmo, ___E>,
403    {
404        #[inline]
405        fn encode(
406            self,
407            encoder_: &mut ___E,
408            out_: &mut ::core::mem::MaybeUninit<crate::wire::LoaderLoadObjectResponse>,
409            _: (),
410        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
411            ::fidl_next::munge! {
412                let crate::wire::LoaderLoadObjectResponse {
413
414                    rv,
415                    object,
416
417                } = out_;
418            }
419
420            ::fidl_next::Encode::encode(self.rv, encoder_, rv, ())?;
421
422            ::fidl_next::Encode::encode(self.object, encoder_, object, ())?;
423
424            Ok(())
425        }
426    }
427
428    pub struct LoaderCloneRequest<T0> {
429        pub loader: T0,
430    }
431
432    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LoaderCloneRequest, ___E>
433        for LoaderCloneRequest<T0>
434    where
435        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
436        ___E: ::fidl_next::fuchsia::HandleEncoder,
437        T0: ::fidl_next::Encode<
438                ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>,
439                ___E,
440            >,
441    {
442        #[inline]
443        fn encode(
444            self,
445            encoder_: &mut ___E,
446            out_: &mut ::core::mem::MaybeUninit<crate::wire::LoaderCloneRequest>,
447            _: (),
448        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
449            ::fidl_next::munge! {
450                let crate::wire::LoaderCloneRequest {
451
452                    loader,
453
454                } = out_;
455            }
456
457            ::fidl_next::Encode::encode(self.loader, encoder_, loader, ())?;
458
459            Ok(())
460        }
461    }
462}
463
464pub use self::natural::*;
465
466/// The type corresponding to the Loader protocol.
467#[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"]
468#[derive(PartialEq, Debug)]
469pub struct Loader;
470
471#[cfg(target_os = "fuchsia")]
472impl ::fidl_next::HasTransport for Loader {
473    type Transport = ::fidl_next::fuchsia::zx::Channel;
474}
475
476pub mod loader {
477    pub mod prelude {
478        pub use crate::{Loader, LoaderClientHandler, LoaderServerHandler, loader};
479
480        pub use crate::natural::LoaderCloneRequest;
481
482        pub use crate::natural::LoaderCloneResponse;
483
484        pub use crate::natural::LoaderConfigRequest;
485
486        pub use crate::natural::LoaderConfigResponse;
487
488        pub use crate::natural::LoaderLoadObjectRequest;
489
490        pub use crate::natural::LoaderLoadObjectResponse;
491    }
492
493    pub struct Done;
494
495    impl ::fidl_next::Method for Done {
496        const ORDINAL: u64 = 7186174313520107521;
497        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
498            ::fidl_next::protocol::Flexibility::Strict;
499
500        type Protocol = crate::Loader;
501
502        type Request = ();
503    }
504
505    pub struct LoadObject;
506
507    impl ::fidl_next::Method for LoadObject {
508        const ORDINAL: u64 = 5243774714012182611;
509        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
510            ::fidl_next::protocol::Flexibility::Strict;
511
512        type Protocol = crate::Loader;
513
514        type Request = crate::wire::LoaderLoadObjectRequest<'static>;
515    }
516
517    impl ::fidl_next::TwoWayMethod for LoadObject {
518        type Response = crate::wire::LoaderLoadObjectResponse;
519    }
520
521    impl<___R> ::fidl_next::Respond<___R> for LoadObject {
522        type Output = ___R;
523
524        fn respond(response: ___R) -> Self::Output {
525            response
526        }
527    }
528
529    pub struct Config;
530
531    impl ::fidl_next::Method for Config {
532        const ORDINAL: u64 = 7676977189692319809;
533        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
534            ::fidl_next::protocol::Flexibility::Strict;
535
536        type Protocol = crate::Loader;
537
538        type Request = crate::wire::LoaderConfigRequest<'static>;
539    }
540
541    impl ::fidl_next::TwoWayMethod for Config {
542        type Response = crate::wire::LoaderConfigResponse;
543    }
544
545    impl<___R> ::fidl_next::Respond<___R> for Config {
546        type Output = crate::generic::LoaderConfigResponse<___R>;
547
548        fn respond(response: ___R) -> Self::Output {
549            crate::generic::LoaderConfigResponse { rv: response }
550        }
551    }
552
553    pub struct Clone;
554
555    impl ::fidl_next::Method for Clone {
556        const ORDINAL: u64 = 6333824321947847721;
557        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
558            ::fidl_next::protocol::Flexibility::Strict;
559
560        type Protocol = crate::Loader;
561
562        type Request = crate::wire::LoaderCloneRequest;
563    }
564
565    impl ::fidl_next::TwoWayMethod for Clone {
566        type Response = crate::wire::LoaderCloneResponse;
567    }
568
569    impl<___R> ::fidl_next::Respond<___R> for Clone {
570        type Output = crate::generic::LoaderCloneResponse<___R>;
571
572        fn respond(response: ___R) -> Self::Output {
573            crate::generic::LoaderCloneResponse { rv: response }
574        }
575    }
576
577    mod ___detail {
578        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Loader
579        where
580            ___T: ::fidl_next::Transport,
581        {
582            type Client = LoaderClient<___T>;
583            type Server = LoaderServer<___T>;
584        }
585
586        /// The client for the `Loader` protocol.
587        #[repr(transparent)]
588        pub struct LoaderClient<___T: ::fidl_next::Transport> {
589            #[allow(dead_code)]
590            client: ::fidl_next::protocol::Client<___T>,
591        }
592
593        impl<___T> LoaderClient<___T>
594        where
595            ___T: ::fidl_next::Transport,
596        {
597            #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
598            pub fn done(&self) -> ::fidl_next::SendFuture<'_, ___T> {
599                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
600                    7186174313520107521,
601                    <super::Done as ::fidl_next::Method>::FLEXIBILITY,
602                    (),
603                ))
604            }
605
606            #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
607            pub fn load_object(
608                &self,
609
610                object_name: impl ::fidl_next::Encode<
611                    ::fidl_next::wire::String<'static>,
612                    <___T as ::fidl_next::Transport>::SendBuffer,
613                >,
614            ) -> ::fidl_next::TwoWayFuture<'_, super::LoadObject, ___T>
615            where
616                <___T as ::fidl_next::Transport>::SendBuffer:
617                    ::fidl_next::encoder::InternalHandleEncoder,
618                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
619            {
620                self.load_object_with(crate::generic::LoaderLoadObjectRequest { object_name })
621            }
622
623            #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
624            pub fn load_object_with<___R>(
625                &self,
626                request: ___R,
627            ) -> ::fidl_next::TwoWayFuture<'_, super::LoadObject, ___T>
628            where
629                ___R: ::fidl_next::Encode<
630                        crate::wire::LoaderLoadObjectRequest<'static>,
631                        <___T as ::fidl_next::Transport>::SendBuffer,
632                    >,
633            {
634                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
635                    5243774714012182611,
636                    <super::LoadObject as ::fidl_next::Method>::FLEXIBILITY,
637                    request,
638                ))
639            }
640
641            #[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"]
642            pub fn config(
643                &self,
644
645                config: impl ::fidl_next::Encode<
646                    ::fidl_next::wire::String<'static>,
647                    <___T as ::fidl_next::Transport>::SendBuffer,
648                >,
649            ) -> ::fidl_next::TwoWayFuture<'_, super::Config, ___T>
650            where
651                <___T as ::fidl_next::Transport>::SendBuffer:
652                    ::fidl_next::encoder::InternalHandleEncoder,
653                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
654            {
655                self.config_with(crate::generic::LoaderConfigRequest { config })
656            }
657
658            #[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"]
659            pub fn config_with<___R>(
660                &self,
661                request: ___R,
662            ) -> ::fidl_next::TwoWayFuture<'_, super::Config, ___T>
663            where
664                ___R: ::fidl_next::Encode<
665                        crate::wire::LoaderConfigRequest<'static>,
666                        <___T as ::fidl_next::Transport>::SendBuffer,
667                    >,
668            {
669                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
670                    7676977189692319809,
671                    <super::Config as ::fidl_next::Method>::FLEXIBILITY,
672                    request,
673                ))
674            }
675
676            #[doc = " Obtain a new loader service connection.\n"]
677            pub fn clone(
678                &self,
679
680                loader: impl ::fidl_next::Encode<
681                    ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>,
682                    <___T as ::fidl_next::Transport>::SendBuffer,
683                >,
684            ) -> ::fidl_next::TwoWayFuture<'_, super::Clone, ___T>
685            where
686                <___T as ::fidl_next::Transport>::SendBuffer:
687                    ::fidl_next::encoder::InternalHandleEncoder,
688                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
689            {
690                self.clone_with(crate::generic::LoaderCloneRequest { loader })
691            }
692
693            #[doc = " Obtain a new loader service connection.\n"]
694            pub fn clone_with<___R>(
695                &self,
696                request: ___R,
697            ) -> ::fidl_next::TwoWayFuture<'_, super::Clone, ___T>
698            where
699                ___R: ::fidl_next::Encode<
700                        crate::wire::LoaderCloneRequest,
701                        <___T as ::fidl_next::Transport>::SendBuffer,
702                    >,
703            {
704                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
705                    6333824321947847721,
706                    <super::Clone as ::fidl_next::Method>::FLEXIBILITY,
707                    request,
708                ))
709            }
710        }
711
712        /// The server for the `Loader` protocol.
713        #[repr(transparent)]
714        pub struct LoaderServer<___T: ::fidl_next::Transport> {
715            server: ::fidl_next::protocol::Server<___T>,
716        }
717
718        impl<___T> LoaderServer<___T> where ___T: ::fidl_next::Transport {}
719    }
720}
721
722/// A client handler for the Loader protocol.
723///
724/// See [`Loader`] for more details.
725pub trait LoaderClientHandler<
726    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
727    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
728>
729{
730}
731
732impl<___T> LoaderClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
733{}
734
735impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Loader
736where
737    ___H: LoaderClientHandler<___T> + ::core::marker::Send,
738    ___T: ::fidl_next::Transport,
739{
740    async fn on_event(
741        handler: &mut ___H,
742        ordinal: u64,
743        flexibility: ::fidl_next::protocol::Flexibility,
744        body: ::fidl_next::Body<___T>,
745    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
746        match ordinal {
747            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
748        }
749    }
750}
751
752/// A server handler for the Loader protocol.
753///
754/// See [`Loader`] for more details.
755pub trait LoaderServerHandler<
756    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
757    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
758>
759{
760    #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
761    fn done(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
762
763    #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
764    fn load_object(
765        &mut self,
766
767        request: ::fidl_next::Request<loader::LoadObject, ___T>,
768
769        responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
770    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
771
772    #[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"]
773    fn config(
774        &mut self,
775
776        request: ::fidl_next::Request<loader::Config, ___T>,
777
778        responder: ::fidl_next::Responder<loader::Config, ___T>,
779    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
780
781    #[doc = " Obtain a new loader service connection.\n"]
782    fn clone(
783        &mut self,
784
785        request: ::fidl_next::Request<loader::Clone, ___T>,
786
787        responder: ::fidl_next::Responder<loader::Clone, ___T>,
788    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
789}
790
791impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Loader
792where
793    ___H: LoaderServerHandler<___T> + ::core::marker::Send,
794    ___T: ::fidl_next::Transport,
795    for<'de> crate::wire::LoaderLoadObjectRequest<'de>: ::fidl_next::Decode<
796            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
797            Constraint = (),
798        >,
799    for<'de> crate::wire::LoaderConfigRequest<'de>: ::fidl_next::Decode<
800            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
801            Constraint = (),
802        >,
803    for<'de> crate::wire::LoaderCloneRequest: ::fidl_next::Decode<
804            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
805            Constraint = (),
806        >,
807{
808    async fn on_one_way(
809        handler: &mut ___H,
810        ordinal: u64,
811        flexibility: ::fidl_next::protocol::Flexibility,
812        body: ::fidl_next::Body<___T>,
813    ) -> ::core::result::Result<
814        (),
815        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
816    > {
817        match ordinal {
818            7186174313520107521 => {
819                handler.done().await;
820                Ok(())
821            }
822
823            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
824        }
825    }
826
827    async fn on_two_way(
828        handler: &mut ___H,
829        ordinal: u64,
830        flexibility: ::fidl_next::protocol::Flexibility,
831        body: ::fidl_next::Body<___T>,
832        responder: ::fidl_next::protocol::Responder<___T>,
833    ) -> ::core::result::Result<
834        (),
835        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
836    > {
837        match ordinal {
838            5243774714012182611 => {
839                let responder = ::fidl_next::Responder::from_untyped(responder);
840
841                match ::fidl_next::AsDecoderExt::into_decoded(body) {
842                    Ok(decoded) => {
843                        handler
844                            .load_object(::fidl_next::Request::from_decoded(decoded), responder)
845                            .await;
846                        Ok(())
847                    }
848                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
849                        ordinal: 5243774714012182611,
850                        error,
851                    }),
852                }
853            }
854
855            7676977189692319809 => {
856                let responder = ::fidl_next::Responder::from_untyped(responder);
857
858                match ::fidl_next::AsDecoderExt::into_decoded(body) {
859                    Ok(decoded) => {
860                        handler
861                            .config(::fidl_next::Request::from_decoded(decoded), responder)
862                            .await;
863                        Ok(())
864                    }
865                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
866                        ordinal: 7676977189692319809,
867                        error,
868                    }),
869                }
870            }
871
872            6333824321947847721 => {
873                let responder = ::fidl_next::Responder::from_untyped(responder);
874
875                match ::fidl_next::AsDecoderExt::into_decoded(body) {
876                    Ok(decoded) => {
877                        handler.clone(::fidl_next::Request::from_decoded(decoded), responder).await;
878                        Ok(())
879                    }
880                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
881                        ordinal: 6333824321947847721,
882                        error,
883                    }),
884                }
885            }
886
887            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
888        }
889    }
890}
891
892pub use fidl_next_common_fuchsia_ldsvc::*;
893
894/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
895pub mod compat {
896
897    pub use fidl_next_common_fuchsia_ldsvc::compat::*;
898
899    impl ::fidl_next::CompatFrom<crate::LoaderLoadObjectResponse>
900        for ::fidl_fuchsia_ldsvc::LoaderLoadObjectResponse
901    {
902        #[inline]
903        fn compat_from(value: crate::LoaderLoadObjectResponse) -> Self {
904            Self {
905                rv: ::fidl_next::CompatFrom::compat_from(value.rv),
906
907                object: ::fidl_next::CompatFrom::compat_from(value.object),
908            }
909        }
910    }
911
912    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderLoadObjectResponse>
913        for crate::LoaderLoadObjectResponse
914    {
915        #[inline]
916        fn compat_from(value: ::fidl_fuchsia_ldsvc::LoaderLoadObjectResponse) -> Self {
917            Self {
918                rv: ::fidl_next::CompatFrom::compat_from(value.rv),
919
920                object: ::fidl_next::CompatFrom::compat_from(value.object),
921            }
922        }
923    }
924
925    impl ::fidl_next::CompatFrom<crate::LoaderCloneRequest>
926        for ::fidl_fuchsia_ldsvc::LoaderCloneRequest
927    {
928        #[inline]
929        fn compat_from(value: crate::LoaderCloneRequest) -> Self {
930            Self { loader: ::fidl_next::CompatFrom::compat_from(value.loader) }
931        }
932    }
933
934    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderCloneRequest>
935        for crate::LoaderCloneRequest
936    {
937        #[inline]
938        fn compat_from(value: ::fidl_fuchsia_ldsvc::LoaderCloneRequest) -> Self {
939            Self { loader: ::fidl_next::CompatFrom::compat_from(value.loader) }
940        }
941    }
942
943    #[cfg(target_os = "fuchsia")]
944    /// An alias for a client over `zx::Channel` for the `Loader`
945    /// protocol.
946    pub type LoaderProxy = ::fidl_next::Client<crate::Loader>;
947
948    impl ::fidl_next::CompatFrom<crate::Loader> for ::fidl_fuchsia_ldsvc::LoaderMarker {
949        fn compat_from(_: crate::Loader) -> Self {
950            Self
951        }
952    }
953
954    impl ::fidl_next::CompatFrom<::fidl_fuchsia_ldsvc::LoaderMarker> for crate::Loader {
955        fn compat_from(_: ::fidl_fuchsia_ldsvc::LoaderMarker) -> Self {
956            Self
957        }
958    }
959
960    #[cfg(target_os = "fuchsia")]
961
962    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_ldsvc::LoaderProxy> for crate::Loader {
963        fn client_compat_from(
964            proxy: ::fidl_fuchsia_ldsvc::LoaderProxy,
965        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
966            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
967            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
968            ::fidl_next::ClientDispatcher::new(client_end)
969        }
970    }
971}