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