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::{
475 Loader, LoaderClientHandler, LoaderLocalClientHandler, LoaderLocalServerHandler,
476 LoaderServerHandler, loader,
477 };
478
479 pub use crate::natural::LoaderCloneRequest;
480
481 pub use crate::natural::LoaderCloneResponse;
482
483 pub use crate::natural::LoaderConfigRequest;
484
485 pub use crate::natural::LoaderConfigResponse;
486
487 pub use crate::natural::LoaderLoadObjectRequest;
488
489 pub use crate::natural::LoaderLoadObjectResponse;
490 }
491
492 pub struct Done;
493
494 impl ::fidl_next::Method for Done {
495 const ORDINAL: u64 = 7186174313520107521;
496 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
497 ::fidl_next::protocol::Flexibility::Strict;
498
499 type Protocol = crate::Loader;
500
501 type Request = ::fidl_next::wire::EmptyMessageBody;
502 }
503
504 pub struct LoadObject;
505
506 impl ::fidl_next::Method for LoadObject {
507 const ORDINAL: u64 = 5243774714012182611;
508 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
509 ::fidl_next::protocol::Flexibility::Strict;
510
511 type Protocol = crate::Loader;
512
513 type Request = crate::wire::LoaderLoadObjectRequest<'static>;
514 }
515
516 impl ::fidl_next::TwoWayMethod for LoadObject {
517 type Response = crate::wire::LoaderLoadObjectResponse;
518 }
519
520 impl<___R> ::fidl_next::Respond<___R> for LoadObject {
521 type Output = ___R;
522
523 fn respond(response: ___R) -> Self::Output {
524 response
525 }
526 }
527
528 pub struct Config;
529
530 impl ::fidl_next::Method for Config {
531 const ORDINAL: u64 = 7676977189692319809;
532 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
533 ::fidl_next::protocol::Flexibility::Strict;
534
535 type Protocol = crate::Loader;
536
537 type Request = crate::wire::LoaderConfigRequest<'static>;
538 }
539
540 impl ::fidl_next::TwoWayMethod for Config {
541 type Response = crate::wire::LoaderConfigResponse;
542 }
543
544 impl<___R> ::fidl_next::Respond<___R> for Config {
545 type Output = crate::generic::LoaderConfigResponse<___R>;
546
547 fn respond(response: ___R) -> Self::Output {
548 crate::generic::LoaderConfigResponse { rv: response }
549 }
550 }
551
552 pub struct Clone;
553
554 impl ::fidl_next::Method for Clone {
555 const ORDINAL: u64 = 6333824321947847721;
556 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
557 ::fidl_next::protocol::Flexibility::Strict;
558
559 type Protocol = crate::Loader;
560
561 type Request = crate::wire::LoaderCloneRequest;
562 }
563
564 impl ::fidl_next::TwoWayMethod for Clone {
565 type Response = crate::wire::LoaderCloneResponse;
566 }
567
568 impl<___R> ::fidl_next::Respond<___R> for Clone {
569 type Output = crate::generic::LoaderCloneResponse<___R>;
570
571 fn respond(response: ___R) -> Self::Output {
572 crate::generic::LoaderCloneResponse { rv: response }
573 }
574 }
575
576 mod ___detail {
577 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Loader
578 where
579 ___T: ::fidl_next::Transport,
580 {
581 type Client = LoaderClient<___T>;
582 type Server = LoaderServer<___T>;
583 }
584
585 #[repr(transparent)]
587 pub struct LoaderClient<___T: ::fidl_next::Transport> {
588 #[allow(dead_code)]
589 client: ::fidl_next::protocol::Client<___T>,
590 }
591
592 impl<___T> LoaderClient<___T>
593 where
594 ___T: ::fidl_next::Transport,
595 {
596 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
597 pub fn done(&self) -> ::fidl_next::SendFuture<'_, ___T> {
598 ::fidl_next::SendFuture::from_untyped(
599 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
600 7186174313520107521,
601 <super::Done as ::fidl_next::Method>::FLEXIBILITY,
602 (),
603 ),
604 )
605 }
606
607 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
608 pub fn load_object(
609 &self,
610
611 object_name: impl ::fidl_next::Encode<
612 ::fidl_next::wire::String<'static>,
613 <___T as ::fidl_next::Transport>::SendBuffer,
614 >,
615 ) -> ::fidl_next::TwoWayFuture<'_, super::LoadObject, ___T>
616 where
617 <___T as ::fidl_next::Transport>::SendBuffer:
618 ::fidl_next::encoder::InternalHandleEncoder,
619 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
620 {
621 self.load_object_with(crate::generic::LoaderLoadObjectRequest { object_name })
622 }
623
624 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
625 pub fn load_object_with<___R>(
626 &self,
627 request: ___R,
628 ) -> ::fidl_next::TwoWayFuture<'_, super::LoadObject, ___T>
629 where
630 ___R: ::fidl_next::Encode<
631 crate::wire::LoaderLoadObjectRequest<'static>,
632 <___T as ::fidl_next::Transport>::SendBuffer,
633 >,
634 {
635 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
636 5243774714012182611,
637 <super::LoadObject as ::fidl_next::Method>::FLEXIBILITY,
638 request,
639 ))
640 }
641
642 #[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"]
643 pub fn config(
644 &self,
645
646 config: impl ::fidl_next::Encode<
647 ::fidl_next::wire::String<'static>,
648 <___T as ::fidl_next::Transport>::SendBuffer,
649 >,
650 ) -> ::fidl_next::TwoWayFuture<'_, super::Config, ___T>
651 where
652 <___T as ::fidl_next::Transport>::SendBuffer:
653 ::fidl_next::encoder::InternalHandleEncoder,
654 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
655 {
656 self.config_with(crate::generic::LoaderConfigRequest { config })
657 }
658
659 #[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"]
660 pub fn config_with<___R>(
661 &self,
662 request: ___R,
663 ) -> ::fidl_next::TwoWayFuture<'_, super::Config, ___T>
664 where
665 ___R: ::fidl_next::Encode<
666 crate::wire::LoaderConfigRequest<'static>,
667 <___T as ::fidl_next::Transport>::SendBuffer,
668 >,
669 {
670 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
671 7676977189692319809,
672 <super::Config as ::fidl_next::Method>::FLEXIBILITY,
673 request,
674 ))
675 }
676
677 #[doc = " Obtain a new loader service connection.\n"]
678 pub fn clone(
679 &self,
680
681 loader: impl ::fidl_next::Encode<
682 ::fidl_next::ServerEnd<crate::Loader, ::fidl_next::wire::fuchsia::Channel>,
683 <___T as ::fidl_next::Transport>::SendBuffer,
684 >,
685 ) -> ::fidl_next::TwoWayFuture<'_, super::Clone, ___T>
686 where
687 <___T as ::fidl_next::Transport>::SendBuffer:
688 ::fidl_next::encoder::InternalHandleEncoder,
689 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
690 {
691 self.clone_with(crate::generic::LoaderCloneRequest { loader })
692 }
693
694 #[doc = " Obtain a new loader service connection.\n"]
695 pub fn clone_with<___R>(
696 &self,
697 request: ___R,
698 ) -> ::fidl_next::TwoWayFuture<'_, super::Clone, ___T>
699 where
700 ___R: ::fidl_next::Encode<
701 crate::wire::LoaderCloneRequest,
702 <___T as ::fidl_next::Transport>::SendBuffer,
703 >,
704 {
705 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
706 6333824321947847721,
707 <super::Clone as ::fidl_next::Method>::FLEXIBILITY,
708 request,
709 ))
710 }
711 }
712
713 #[repr(transparent)]
715 pub struct LoaderServer<___T: ::fidl_next::Transport> {
716 server: ::fidl_next::protocol::Server<___T>,
717 }
718
719 impl<___T> LoaderServer<___T> where ___T: ::fidl_next::Transport {}
720 }
721}
722
723#[diagnostic::on_unimplemented(
724 note = "If {Self} implements the non-local LoaderClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
725)]
726
727pub trait LoaderLocalClientHandler<
731 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
732 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
733>
734{
735}
736
737impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Loader
738where
739 ___H: LoaderLocalClientHandler<___T>,
740 ___T: ::fidl_next::Transport,
741{
742 async fn on_event(
743 handler: &mut ___H,
744 ordinal: u64,
745 flexibility: ::fidl_next::protocol::Flexibility,
746 body: ::fidl_next::Body<___T>,
747 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
748 match ordinal {
749 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
750 }
751 }
752}
753
754#[diagnostic::on_unimplemented(
755 note = "If {Self} implements the non-local LoaderServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
756)]
757
758pub trait LoaderLocalServerHandler<
762 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
763 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
764>
765{
766 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
767 fn done(&mut self) -> impl ::core::future::Future<Output = ()>;
768
769 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
770 fn load_object(
771 &mut self,
772
773 request: ::fidl_next::Request<loader::LoadObject, ___T>,
774
775 responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
776 ) -> impl ::core::future::Future<Output = ()>;
777
778 #[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"]
779 fn config(
780 &mut self,
781
782 request: ::fidl_next::Request<loader::Config, ___T>,
783
784 responder: ::fidl_next::Responder<loader::Config, ___T>,
785 ) -> impl ::core::future::Future<Output = ()>;
786
787 #[doc = " Obtain a new loader service connection.\n"]
788 fn clone(
789 &mut self,
790
791 request: ::fidl_next::Request<loader::Clone, ___T>,
792
793 responder: ::fidl_next::Responder<loader::Clone, ___T>,
794 ) -> impl ::core::future::Future<Output = ()>;
795}
796
797impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Loader
798where
799 ___H: LoaderLocalServerHandler<___T>,
800 ___T: ::fidl_next::Transport,
801 for<'de> crate::wire::LoaderLoadObjectRequest<'de>: ::fidl_next::Decode<
802 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
803 Constraint = (),
804 >,
805 for<'de> crate::wire::LoaderConfigRequest<'de>: ::fidl_next::Decode<
806 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
807 Constraint = (),
808 >,
809 for<'de> crate::wire::LoaderCloneRequest: ::fidl_next::Decode<
810 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
811 Constraint = (),
812 >,
813{
814 async fn on_one_way(
815 handler: &mut ___H,
816 ordinal: u64,
817 flexibility: ::fidl_next::protocol::Flexibility,
818 body: ::fidl_next::Body<___T>,
819 ) -> ::core::result::Result<
820 (),
821 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
822 > {
823 match ordinal {
824 7186174313520107521 => {
825 handler.done().await;
826 Ok(())
827 }
828
829 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
830 }
831 }
832
833 async fn on_two_way(
834 handler: &mut ___H,
835 ordinal: u64,
836 flexibility: ::fidl_next::protocol::Flexibility,
837 body: ::fidl_next::Body<___T>,
838 responder: ::fidl_next::protocol::Responder<___T>,
839 ) -> ::core::result::Result<
840 (),
841 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
842 > {
843 match ordinal {
844 5243774714012182611 => {
845 let responder = ::fidl_next::Responder::from_untyped(responder);
846
847 match ::fidl_next::AsDecoderExt::into_decoded(body) {
848 Ok(decoded) => {
849 handler
850 .load_object(::fidl_next::Request::from_decoded(decoded), responder)
851 .await;
852 Ok(())
853 }
854 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
855 ordinal: 5243774714012182611,
856 error,
857 }),
858 }
859 }
860
861 7676977189692319809 => {
862 let responder = ::fidl_next::Responder::from_untyped(responder);
863
864 match ::fidl_next::AsDecoderExt::into_decoded(body) {
865 Ok(decoded) => {
866 handler
867 .config(::fidl_next::Request::from_decoded(decoded), responder)
868 .await;
869 Ok(())
870 }
871 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
872 ordinal: 7676977189692319809,
873 error,
874 }),
875 }
876 }
877
878 6333824321947847721 => {
879 let responder = ::fidl_next::Responder::from_untyped(responder);
880
881 match ::fidl_next::AsDecoderExt::into_decoded(body) {
882 Ok(decoded) => {
883 handler.clone(::fidl_next::Request::from_decoded(decoded), responder).await;
884 Ok(())
885 }
886 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
887 ordinal: 6333824321947847721,
888 error,
889 }),
890 }
891 }
892
893 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
894 }
895 }
896}
897
898pub trait LoaderClientHandler<
902 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
903 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
904>
905{
906}
907
908impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Loader
909where
910 ___H: LoaderClientHandler<___T> + ::core::marker::Send,
911 ___T: ::fidl_next::Transport,
912{
913 async fn on_event(
914 handler: &mut ___H,
915 ordinal: u64,
916 flexibility: ::fidl_next::protocol::Flexibility,
917 body: ::fidl_next::Body<___T>,
918 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
919 match ordinal {
920 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
921 }
922 }
923}
924
925pub trait LoaderServerHandler<
929 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
930 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
931>
932{
933 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
934 fn done(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
935
936 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
937 fn load_object(
938 &mut self,
939
940 request: ::fidl_next::Request<loader::LoadObject, ___T>,
941
942 responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
943 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
944
945 #[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"]
946 fn config(
947 &mut self,
948
949 request: ::fidl_next::Request<loader::Config, ___T>,
950
951 responder: ::fidl_next::Responder<loader::Config, ___T>,
952 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
953
954 #[doc = " Obtain a new loader service connection.\n"]
955 fn clone(
956 &mut self,
957
958 request: ::fidl_next::Request<loader::Clone, ___T>,
959
960 responder: ::fidl_next::Responder<loader::Clone, ___T>,
961 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
962}
963
964impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Loader
965where
966 ___H: LoaderServerHandler<___T> + ::core::marker::Send,
967 ___T: ::fidl_next::Transport,
968 for<'de> crate::wire::LoaderLoadObjectRequest<'de>: ::fidl_next::Decode<
969 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
970 Constraint = (),
971 >,
972 for<'de> crate::wire::LoaderConfigRequest<'de>: ::fidl_next::Decode<
973 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
974 Constraint = (),
975 >,
976 for<'de> crate::wire::LoaderCloneRequest: ::fidl_next::Decode<
977 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
978 Constraint = (),
979 >,
980{
981 async fn on_one_way(
982 handler: &mut ___H,
983 ordinal: u64,
984 flexibility: ::fidl_next::protocol::Flexibility,
985 body: ::fidl_next::Body<___T>,
986 ) -> ::core::result::Result<
987 (),
988 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
989 > {
990 match ordinal {
991 7186174313520107521 => {
992 handler.done().await;
993 Ok(())
994 }
995
996 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
997 }
998 }
999
1000 async fn on_two_way(
1001 handler: &mut ___H,
1002 ordinal: u64,
1003 flexibility: ::fidl_next::protocol::Flexibility,
1004 body: ::fidl_next::Body<___T>,
1005 responder: ::fidl_next::protocol::Responder<___T>,
1006 ) -> ::core::result::Result<
1007 (),
1008 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1009 > {
1010 match ordinal {
1011 5243774714012182611 => {
1012 let responder = ::fidl_next::Responder::from_untyped(responder);
1013
1014 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1015 Ok(decoded) => {
1016 handler
1017 .load_object(::fidl_next::Request::from_decoded(decoded), responder)
1018 .await;
1019 Ok(())
1020 }
1021 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1022 ordinal: 5243774714012182611,
1023 error,
1024 }),
1025 }
1026 }
1027
1028 7676977189692319809 => {
1029 let responder = ::fidl_next::Responder::from_untyped(responder);
1030
1031 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1032 Ok(decoded) => {
1033 handler
1034 .config(::fidl_next::Request::from_decoded(decoded), responder)
1035 .await;
1036 Ok(())
1037 }
1038 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1039 ordinal: 7676977189692319809,
1040 error,
1041 }),
1042 }
1043 }
1044
1045 6333824321947847721 => {
1046 let responder = ::fidl_next::Responder::from_untyped(responder);
1047
1048 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1049 Ok(decoded) => {
1050 handler.clone(::fidl_next::Request::from_decoded(decoded), responder).await;
1051 Ok(())
1052 }
1053 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1054 ordinal: 6333824321947847721,
1055 error,
1056 }),
1057 }
1058 }
1059
1060 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1061 }
1062 }
1063}
1064
1065impl<___T> LoaderClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
1066{}
1067
1068impl<___H, ___T> LoaderLocalClientHandler<___T> for ::fidl_next::Local<___H>
1069where
1070 ___H: LoaderClientHandler<___T>,
1071 ___T: ::fidl_next::Transport,
1072{
1073}
1074
1075impl<___H, ___T> LoaderLocalServerHandler<___T> for ::fidl_next::Local<___H>
1076where
1077 ___H: LoaderServerHandler<___T>,
1078 ___T: ::fidl_next::Transport,
1079{
1080 async fn done(&mut self) {
1081 ___H::done(&mut self.0).await
1082 }
1083
1084 async fn load_object(
1085 &mut self,
1086
1087 request: ::fidl_next::Request<loader::LoadObject, ___T>,
1088
1089 responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
1090 ) {
1091 ___H::load_object(&mut self.0, request, responder).await
1092 }
1093
1094 async fn config(
1095 &mut self,
1096
1097 request: ::fidl_next::Request<loader::Config, ___T>,
1098
1099 responder: ::fidl_next::Responder<loader::Config, ___T>,
1100 ) {
1101 ___H::config(&mut self.0, request, responder).await
1102 }
1103
1104 async fn clone(
1105 &mut self,
1106
1107 request: ::fidl_next::Request<loader::Clone, ___T>,
1108
1109 responder: ::fidl_next::Responder<loader::Clone, ___T>,
1110 ) {
1111 ___H::clone(&mut self.0, request, responder).await
1112 }
1113}
1114
1115pub use fidl_next_common_fuchsia_ldsvc::*;