1#![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 #[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 rv,
263 object,
264
265 } = &mut *out_;
266 }
267
268 ::fidl_next::Wire::zero_padding(rv);
269
270 ::fidl_next::Wire::zero_padding(object);
271 }
272 }
273
274 unsafe impl<___D> ::fidl_next::Decode<___D> for LoaderLoadObjectResponse
275 where
276 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
277 ___D: ::fidl_next::fuchsia::HandleDecoder,
278 {
279 fn decode(
280 slot_: ::fidl_next::Slot<'_, Self>,
281 decoder_: &mut ___D,
282 _: (),
283 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
284 ::fidl_next::munge! {
285 let Self {
286 mut rv,
287 mut object,
288
289 } = slot_;
290 }
291
292 let _field = rv.as_mut();
293
294 ::fidl_next::Decode::decode(rv.as_mut(), decoder_, ())?;
295
296 let _field = object.as_mut();
297
298 ::fidl_next::Decode::decode(object.as_mut(), decoder_, ())?;
299
300 Ok(())
301 }
302 }
303
304 impl ::fidl_next::IntoNatural for LoaderLoadObjectResponse {
305 type Natural = crate::natural::LoaderLoadObjectResponse;
306 }
307
308 #[derive(Debug)]
310 #[repr(C)]
311 pub struct LoaderCloneRequest {
312 pub loader: ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>,
313 }
314
315 static_assertions::const_assert_eq!(std::mem::size_of::<LoaderCloneRequest>(), 4);
316 static_assertions::const_assert_eq!(std::mem::align_of::<LoaderCloneRequest>(), 4);
317
318 static_assertions::const_assert_eq!(std::mem::offset_of!(LoaderCloneRequest, loader), 0);
319
320 impl ::fidl_next::Constrained for LoaderCloneRequest {
321 type Constraint = ();
322
323 fn validate(
324 _: ::fidl_next::Slot<'_, Self>,
325 _: Self::Constraint,
326 ) -> Result<(), ::fidl_next::ValidationError> {
327 Ok(())
328 }
329 }
330
331 unsafe impl ::fidl_next::Wire for LoaderCloneRequest {
332 type Narrowed<'de> = LoaderCloneRequest;
333
334 #[inline]
335 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
336 ::fidl_next::munge! {
337 let Self {
338 loader,
339
340 } = &mut *out_;
341 }
342
343 ::fidl_next::Wire::zero_padding(loader);
344 }
345 }
346
347 unsafe impl<___D> ::fidl_next::Decode<___D> for LoaderCloneRequest
348 where
349 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
350 ___D: ::fidl_next::fuchsia::HandleDecoder,
351 {
352 fn decode(
353 slot_: ::fidl_next::Slot<'_, Self>,
354 decoder_: &mut ___D,
355 _: (),
356 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
357 ::fidl_next::munge! {
358 let Self {
359 mut loader,
360
361 } = slot_;
362 }
363
364 let _field = loader.as_mut();
365
366 ::fidl_next::Decode::decode(loader.as_mut(), decoder_, ())?;
367
368 Ok(())
369 }
370 }
371
372 impl ::fidl_next::IntoNatural for LoaderCloneRequest {
373 type Natural = crate::natural::LoaderCloneRequest;
374 }
375}
376
377pub mod wire_optional {
378
379 pub use fidl_next_common_fuchsia_ldsvc::wire_optional::*;
380}
381
382pub mod generic {
383
384 pub use fidl_next_common_fuchsia_ldsvc::generic::*;
385
386 pub struct LoaderLoadObjectResponse<T0, T1> {
388 pub rv: T0,
389
390 pub object: T1,
391 }
392
393 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::LoaderLoadObjectResponse, ___E>
394 for LoaderLoadObjectResponse<T0, T1>
395 where
396 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
397 ___E: ::fidl_next::fuchsia::HandleEncoder,
398 T0: ::fidl_next::Encode<::fidl_next::wire::Int32, ___E>,
399 T1: ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalVmo, ___E>,
400 {
401 #[inline]
402 fn encode(
403 self,
404 encoder_: &mut ___E,
405 out_: &mut ::core::mem::MaybeUninit<crate::wire::LoaderLoadObjectResponse>,
406 _: (),
407 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
408 ::fidl_next::munge! {
409 let crate::wire::LoaderLoadObjectResponse {
410 rv,
411 object,
412
413 } = out_;
414 }
415
416 ::fidl_next::Encode::encode(self.rv, encoder_, rv, ())?;
417
418 ::fidl_next::Encode::encode(self.object, encoder_, object, ())?;
419
420 Ok(())
421 }
422 }
423
424 pub struct LoaderCloneRequest<T0> {
426 pub loader: T0,
427 }
428
429 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LoaderCloneRequest, ___E>
430 for LoaderCloneRequest<T0>
431 where
432 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
433 ___E: ::fidl_next::fuchsia::HandleEncoder,
434 T0: ::fidl_next::Encode<
435 ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>,
436 ___E,
437 >,
438 {
439 #[inline]
440 fn encode(
441 self,
442 encoder_: &mut ___E,
443 out_: &mut ::core::mem::MaybeUninit<crate::wire::LoaderCloneRequest>,
444 _: (),
445 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
446 ::fidl_next::munge! {
447 let crate::wire::LoaderCloneRequest {
448 loader,
449
450 } = out_;
451 }
452
453 ::fidl_next::Encode::encode(self.loader, encoder_, loader, ())?;
454
455 Ok(())
456 }
457 }
458}
459
460pub use self::natural::*;
461
462#[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"]
464#[derive(PartialEq, Debug)]
465pub struct Loader;
466
467#[cfg(target_os = "fuchsia")]
468impl ::fidl_next::HasTransport for Loader {
469 type Transport = ::fidl_next::fuchsia::zx::Channel;
470}
471
472pub mod loader {
473 pub mod prelude {
474 pub use crate::{Loader, LoaderClientHandler, LoaderServerHandler, loader};
475
476 pub use crate::natural::LoaderCloneRequest;
477
478 pub use crate::natural::LoaderCloneResponse;
479
480 pub use crate::natural::LoaderConfigRequest;
481
482 pub use crate::natural::LoaderConfigResponse;
483
484 pub use crate::natural::LoaderLoadObjectRequest;
485
486 pub use crate::natural::LoaderLoadObjectResponse;
487 }
488
489 pub struct Done;
490
491 impl ::fidl_next::Method for Done {
492 const ORDINAL: u64 = 7186174313520107521;
493 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
494 ::fidl_next::protocol::Flexibility::Strict;
495
496 type Protocol = crate::Loader;
497
498 type Request = ::fidl_next::wire::EmptyMessageBody;
499 }
500
501 pub struct LoadObject;
502
503 impl ::fidl_next::Method for LoadObject {
504 const ORDINAL: u64 = 5243774714012182611;
505 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
506 ::fidl_next::protocol::Flexibility::Strict;
507
508 type Protocol = crate::Loader;
509
510 type Request = crate::wire::LoaderLoadObjectRequest<'static>;
511 }
512
513 impl ::fidl_next::TwoWayMethod for LoadObject {
514 type Response = crate::wire::LoaderLoadObjectResponse;
515 }
516
517 impl<___R> ::fidl_next::Respond<___R> for LoadObject {
518 type Output = ___R;
519
520 fn respond(response: ___R) -> Self::Output {
521 response
522 }
523 }
524
525 pub struct Config;
526
527 impl ::fidl_next::Method for Config {
528 const ORDINAL: u64 = 7676977189692319809;
529 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
530 ::fidl_next::protocol::Flexibility::Strict;
531
532 type Protocol = crate::Loader;
533
534 type Request = crate::wire::LoaderConfigRequest<'static>;
535 }
536
537 impl ::fidl_next::TwoWayMethod for Config {
538 type Response = crate::wire::LoaderConfigResponse;
539 }
540
541 impl<___R> ::fidl_next::Respond<___R> for Config {
542 type Output = crate::generic::LoaderConfigResponse<___R>;
543
544 fn respond(response: ___R) -> Self::Output {
545 crate::generic::LoaderConfigResponse { rv: response }
546 }
547 }
548
549 pub struct Clone;
550
551 impl ::fidl_next::Method for Clone {
552 const ORDINAL: u64 = 6333824321947847721;
553 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
554 ::fidl_next::protocol::Flexibility::Strict;
555
556 type Protocol = crate::Loader;
557
558 type Request = crate::wire::LoaderCloneRequest;
559 }
560
561 impl ::fidl_next::TwoWayMethod for Clone {
562 type Response = crate::wire::LoaderCloneResponse;
563 }
564
565 impl<___R> ::fidl_next::Respond<___R> for Clone {
566 type Output = crate::generic::LoaderCloneResponse<___R>;
567
568 fn respond(response: ___R) -> Self::Output {
569 crate::generic::LoaderCloneResponse { rv: response }
570 }
571 }
572
573 mod ___detail {
574 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Loader
575 where
576 ___T: ::fidl_next::Transport,
577 {
578 type Client = LoaderClient<___T>;
579 type Server = LoaderServer<___T>;
580 }
581
582 #[repr(transparent)]
584 pub struct LoaderClient<___T: ::fidl_next::Transport> {
585 #[allow(dead_code)]
586 client: ::fidl_next::protocol::Client<___T>,
587 }
588
589 impl<___T> LoaderClient<___T>
590 where
591 ___T: ::fidl_next::Transport,
592 {
593 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
594 pub fn done(&self) -> ::fidl_next::SendFuture<'_, ___T> {
595 ::fidl_next::SendFuture::from_untyped(
596 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
597 7186174313520107521,
598 <super::Done as ::fidl_next::Method>::FLEXIBILITY,
599 (),
600 ),
601 )
602 }
603
604 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
605 pub fn load_object(
606 &self,
607
608 object_name: impl ::fidl_next::Encode<
609 ::fidl_next::wire::String<'static>,
610 <___T as ::fidl_next::Transport>::SendBuffer,
611 >,
612 ) -> ::fidl_next::TwoWayFuture<'_, super::LoadObject, ___T>
613 where
614 <___T as ::fidl_next::Transport>::SendBuffer:
615 ::fidl_next::encoder::InternalHandleEncoder,
616 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
617 {
618 self.load_object_with(crate::generic::LoaderLoadObjectRequest { object_name })
619 }
620
621 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
622 pub fn load_object_with<___R>(
623 &self,
624 request: ___R,
625 ) -> ::fidl_next::TwoWayFuture<'_, super::LoadObject, ___T>
626 where
627 ___R: ::fidl_next::Encode<
628 crate::wire::LoaderLoadObjectRequest<'static>,
629 <___T as ::fidl_next::Transport>::SendBuffer,
630 >,
631 {
632 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
633 5243774714012182611,
634 <super::LoadObject as ::fidl_next::Method>::FLEXIBILITY,
635 request,
636 ))
637 }
638
639 #[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"]
640 pub fn config(
641 &self,
642
643 config: impl ::fidl_next::Encode<
644 ::fidl_next::wire::String<'static>,
645 <___T as ::fidl_next::Transport>::SendBuffer,
646 >,
647 ) -> ::fidl_next::TwoWayFuture<'_, super::Config, ___T>
648 where
649 <___T as ::fidl_next::Transport>::SendBuffer:
650 ::fidl_next::encoder::InternalHandleEncoder,
651 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
652 {
653 self.config_with(crate::generic::LoaderConfigRequest { config })
654 }
655
656 #[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"]
657 pub fn config_with<___R>(
658 &self,
659 request: ___R,
660 ) -> ::fidl_next::TwoWayFuture<'_, super::Config, ___T>
661 where
662 ___R: ::fidl_next::Encode<
663 crate::wire::LoaderConfigRequest<'static>,
664 <___T as ::fidl_next::Transport>::SendBuffer,
665 >,
666 {
667 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
668 7676977189692319809,
669 <super::Config as ::fidl_next::Method>::FLEXIBILITY,
670 request,
671 ))
672 }
673
674 #[doc = " Obtain a new loader service connection.\n"]
675 pub fn clone(
676 &self,
677
678 loader: impl ::fidl_next::Encode<
679 ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>,
680 <___T as ::fidl_next::Transport>::SendBuffer,
681 >,
682 ) -> ::fidl_next::TwoWayFuture<'_, super::Clone, ___T>
683 where
684 <___T as ::fidl_next::Transport>::SendBuffer:
685 ::fidl_next::encoder::InternalHandleEncoder,
686 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
687 {
688 self.clone_with(crate::generic::LoaderCloneRequest { loader })
689 }
690
691 #[doc = " Obtain a new loader service connection.\n"]
692 pub fn clone_with<___R>(
693 &self,
694 request: ___R,
695 ) -> ::fidl_next::TwoWayFuture<'_, super::Clone, ___T>
696 where
697 ___R: ::fidl_next::Encode<
698 crate::wire::LoaderCloneRequest,
699 <___T as ::fidl_next::Transport>::SendBuffer,
700 >,
701 {
702 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
703 6333824321947847721,
704 <super::Clone as ::fidl_next::Method>::FLEXIBILITY,
705 request,
706 ))
707 }
708 }
709
710 #[repr(transparent)]
712 pub struct LoaderServer<___T: ::fidl_next::Transport> {
713 server: ::fidl_next::protocol::Server<___T>,
714 }
715
716 impl<___T> LoaderServer<___T> where ___T: ::fidl_next::Transport {}
717 }
718}
719
720pub trait LoaderClientHandler<
724 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
725 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
726>
727{
728}
729
730impl<___T> LoaderClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
731{}
732
733impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Loader
734where
735 ___H: LoaderClientHandler<___T> + ::core::marker::Send,
736 ___T: ::fidl_next::Transport,
737{
738 async fn on_event(
739 handler: &mut ___H,
740 ordinal: u64,
741 flexibility: ::fidl_next::protocol::Flexibility,
742 body: ::fidl_next::Body<___T>,
743 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
744 match ordinal {
745 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
746 }
747 }
748}
749
750pub trait LoaderServerHandler<
754 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
755 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
756>
757{
758 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
759 fn done(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
760
761 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
762 fn load_object(
763 &mut self,
764
765 request: ::fidl_next::Request<loader::LoadObject, ___T>,
766
767 responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
768 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
769
770 #[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"]
771 fn config(
772 &mut self,
773
774 request: ::fidl_next::Request<loader::Config, ___T>,
775
776 responder: ::fidl_next::Responder<loader::Config, ___T>,
777 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
778
779 #[doc = " Obtain a new loader service connection.\n"]
780 fn clone(
781 &mut self,
782
783 request: ::fidl_next::Request<loader::Clone, ___T>,
784
785 responder: ::fidl_next::Responder<loader::Clone, ___T>,
786 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
787}
788
789impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Loader
790where
791 ___H: LoaderServerHandler<___T> + ::core::marker::Send,
792 ___T: ::fidl_next::Transport,
793 for<'de> crate::wire::LoaderLoadObjectRequest<'de>: ::fidl_next::Decode<
794 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
795 Constraint = (),
796 >,
797 for<'de> crate::wire::LoaderConfigRequest<'de>: ::fidl_next::Decode<
798 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
799 Constraint = (),
800 >,
801 for<'de> crate::wire::LoaderCloneRequest: ::fidl_next::Decode<
802 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
803 Constraint = (),
804 >,
805{
806 async fn on_one_way(
807 handler: &mut ___H,
808 ordinal: u64,
809 flexibility: ::fidl_next::protocol::Flexibility,
810 body: ::fidl_next::Body<___T>,
811 ) -> ::core::result::Result<
812 (),
813 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
814 > {
815 match ordinal {
816 7186174313520107521 => {
817 handler.done().await;
818 Ok(())
819 }
820
821 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
822 }
823 }
824
825 async fn on_two_way(
826 handler: &mut ___H,
827 ordinal: u64,
828 flexibility: ::fidl_next::protocol::Flexibility,
829 body: ::fidl_next::Body<___T>,
830 responder: ::fidl_next::protocol::Responder<___T>,
831 ) -> ::core::result::Result<
832 (),
833 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
834 > {
835 match ordinal {
836 5243774714012182611 => {
837 let responder = ::fidl_next::Responder::from_untyped(responder);
838
839 match ::fidl_next::AsDecoderExt::into_decoded(body) {
840 Ok(decoded) => {
841 handler
842 .load_object(::fidl_next::Request::from_decoded(decoded), responder)
843 .await;
844 Ok(())
845 }
846 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
847 ordinal: 5243774714012182611,
848 error,
849 }),
850 }
851 }
852
853 7676977189692319809 => {
854 let responder = ::fidl_next::Responder::from_untyped(responder);
855
856 match ::fidl_next::AsDecoderExt::into_decoded(body) {
857 Ok(decoded) => {
858 handler
859 .config(::fidl_next::Request::from_decoded(decoded), responder)
860 .await;
861 Ok(())
862 }
863 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
864 ordinal: 7676977189692319809,
865 error,
866 }),
867 }
868 }
869
870 6333824321947847721 => {
871 let responder = ::fidl_next::Responder::from_untyped(responder);
872
873 match ::fidl_next::AsDecoderExt::into_decoded(body) {
874 Ok(decoded) => {
875 handler.clone(::fidl_next::Request::from_decoded(decoded), responder).await;
876 Ok(())
877 }
878 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
879 ordinal: 6333824321947847721,
880 error,
881 }),
882 }
883 }
884
885 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
886 }
887 }
888}
889
890pub use fidl_next_common_fuchsia_ldsvc::*;