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: ::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 ::fidl_next::fuchsia::zx::Status as ::fidl_next::Encode<::fidl_next::wire::fuchsia::Status, ___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 ::fidl_next::fuchsia::zx::Status as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::Status>
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::Status,
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::Status, ___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 = ::fidl_next::wire::Strict<crate::wire::LoaderLoadObjectResponse>;
518 }
519
520 impl<___R> ::fidl_next::Respond<___R> for LoadObject {
521 type Output = ::fidl_next::Strict<___R>;
522
523 fn respond(response: ___R) -> Self::Output {
524 ::fidl_next::Strict(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 = ::fidl_next::wire::Strict<crate::wire::LoaderConfigResponse>;
542 }
543
544 impl<___R> ::fidl_next::Respond<___R> for Config {
545 type Output = ::fidl_next::Strict<crate::generic::LoaderConfigResponse<___R>>;
546
547 fn respond(response: ___R) -> Self::Output {
548 ::fidl_next::Strict(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 = ::fidl_next::wire::Strict<crate::wire::LoaderCloneResponse>;
566 }
567
568 impl<___R> ::fidl_next::Respond<___R> for Clone {
569 type Output = ::fidl_next::Strict<crate::generic::LoaderCloneResponse<___R>>;
570
571 fn respond(response: ___R) -> Self::Output {
572 ::fidl_next::Strict(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 mut message: ::fidl_next::Message<___T>,
745 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
746 match *message.header().ordinal {
747 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
748 }
749 }
750}
751
752#[diagnostic::on_unimplemented(
753 note = "If {Self} implements the non-local LoaderServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
754)]
755
756pub trait LoaderLocalServerHandler<
760 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
761 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
762>
763{
764 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
765 fn done(&mut self) -> impl ::core::future::Future<Output = ()>;
766
767 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
768 fn load_object(
769 &mut self,
770
771 request: ::fidl_next::Request<loader::LoadObject, ___T>,
772
773 responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
774 ) -> impl ::core::future::Future<Output = ()>;
775
776 #[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"]
777 fn config(
778 &mut self,
779
780 request: ::fidl_next::Request<loader::Config, ___T>,
781
782 responder: ::fidl_next::Responder<loader::Config, ___T>,
783 ) -> impl ::core::future::Future<Output = ()>;
784
785 #[doc = " Obtain a new loader service connection.\n"]
786 fn clone(
787 &mut self,
788
789 request: ::fidl_next::Request<loader::Clone, ___T>,
790
791 responder: ::fidl_next::Responder<loader::Clone, ___T>,
792 ) -> impl ::core::future::Future<Output = ()>;
793}
794
795impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Loader
796where
797 ___H: LoaderLocalServerHandler<___T>,
798 ___T: ::fidl_next::Transport,
799 for<'de> crate::wire::LoaderLoadObjectRequest<'de>: ::fidl_next::Decode<
800 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
801 Constraint = (),
802 >,
803 for<'de> crate::wire::LoaderConfigRequest<'de>: ::fidl_next::Decode<
804 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
805 Constraint = (),
806 >,
807 for<'de> crate::wire::LoaderCloneRequest: ::fidl_next::Decode<
808 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
809 Constraint = (),
810 >,
811{
812 async fn on_one_way(
813 handler: &mut ___H,
814 mut message: ::fidl_next::Message<___T>,
815 ) -> ::core::result::Result<
816 (),
817 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
818 > {
819 match *message.header().ordinal {
820 7186174313520107521 => {
821 handler.done().await;
822 Ok(())
823 }
824
825 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
826 }
827 }
828
829 async fn on_two_way(
830 handler: &mut ___H,
831 mut message: ::fidl_next::Message<___T>,
832 responder: ::fidl_next::protocol::Responder<___T>,
833 ) -> ::core::result::Result<
834 (),
835 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
836 > {
837 match *message.header().ordinal {
838 5243774714012182611 => {
839 let responder = ::fidl_next::Responder::from_untyped(responder);
840
841 match ::fidl_next::AsDecoderExt::into_decoded(message) {
842 Ok(decoded) => {
843 handler
844 .load_object(::fidl_next::Request::from_decoded(decoded), responder)
845 .await;
846 Ok(())
847 }
848 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
849 ordinal: 5243774714012182611,
850 error,
851 }),
852 }
853 }
854
855 7676977189692319809 => {
856 let responder = ::fidl_next::Responder::from_untyped(responder);
857
858 match ::fidl_next::AsDecoderExt::into_decoded(message) {
859 Ok(decoded) => {
860 handler
861 .config(::fidl_next::Request::from_decoded(decoded), responder)
862 .await;
863 Ok(())
864 }
865 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
866 ordinal: 7676977189692319809,
867 error,
868 }),
869 }
870 }
871
872 6333824321947847721 => {
873 let responder = ::fidl_next::Responder::from_untyped(responder);
874
875 match ::fidl_next::AsDecoderExt::into_decoded(message) {
876 Ok(decoded) => {
877 handler.clone(::fidl_next::Request::from_decoded(decoded), responder).await;
878 Ok(())
879 }
880 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
881 ordinal: 6333824321947847721,
882 error,
883 }),
884 }
885 }
886
887 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
888 }
889 }
890}
891
892pub trait LoaderClientHandler<
896 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
897 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
898>
899{
900}
901
902impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Loader
903where
904 ___H: LoaderClientHandler<___T> + ::core::marker::Send,
905 ___T: ::fidl_next::Transport,
906{
907 async fn on_event(
908 handler: &mut ___H,
909 mut message: ::fidl_next::Message<___T>,
910 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
911 match *message.header().ordinal {
912 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
913 }
914 }
915}
916
917pub trait LoaderServerHandler<
921 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
922 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
923>
924{
925 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
926 fn done(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
927
928 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
929 fn load_object(
930 &mut self,
931
932 request: ::fidl_next::Request<loader::LoadObject, ___T>,
933
934 responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
935 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
936
937 #[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"]
938 fn config(
939 &mut self,
940
941 request: ::fidl_next::Request<loader::Config, ___T>,
942
943 responder: ::fidl_next::Responder<loader::Config, ___T>,
944 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
945
946 #[doc = " Obtain a new loader service connection.\n"]
947 fn clone(
948 &mut self,
949
950 request: ::fidl_next::Request<loader::Clone, ___T>,
951
952 responder: ::fidl_next::Responder<loader::Clone, ___T>,
953 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
954}
955
956impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Loader
957where
958 ___H: LoaderServerHandler<___T> + ::core::marker::Send,
959 ___T: ::fidl_next::Transport,
960 for<'de> crate::wire::LoaderLoadObjectRequest<'de>: ::fidl_next::Decode<
961 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
962 Constraint = (),
963 >,
964 for<'de> crate::wire::LoaderConfigRequest<'de>: ::fidl_next::Decode<
965 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
966 Constraint = (),
967 >,
968 for<'de> crate::wire::LoaderCloneRequest: ::fidl_next::Decode<
969 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
970 Constraint = (),
971 >,
972{
973 async fn on_one_way(
974 handler: &mut ___H,
975 mut message: ::fidl_next::Message<___T>,
976 ) -> ::core::result::Result<
977 (),
978 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
979 > {
980 match *message.header().ordinal {
981 7186174313520107521 => {
982 handler.done().await;
983 Ok(())
984 }
985
986 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
987 }
988 }
989
990 async fn on_two_way(
991 handler: &mut ___H,
992 mut message: ::fidl_next::Message<___T>,
993 responder: ::fidl_next::protocol::Responder<___T>,
994 ) -> ::core::result::Result<
995 (),
996 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
997 > {
998 match *message.header().ordinal {
999 5243774714012182611 => {
1000 let responder = ::fidl_next::Responder::from_untyped(responder);
1001
1002 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1003 Ok(decoded) => {
1004 handler
1005 .load_object(::fidl_next::Request::from_decoded(decoded), responder)
1006 .await;
1007 Ok(())
1008 }
1009 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1010 ordinal: 5243774714012182611,
1011 error,
1012 }),
1013 }
1014 }
1015
1016 7676977189692319809 => {
1017 let responder = ::fidl_next::Responder::from_untyped(responder);
1018
1019 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1020 Ok(decoded) => {
1021 handler
1022 .config(::fidl_next::Request::from_decoded(decoded), responder)
1023 .await;
1024 Ok(())
1025 }
1026 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1027 ordinal: 7676977189692319809,
1028 error,
1029 }),
1030 }
1031 }
1032
1033 6333824321947847721 => {
1034 let responder = ::fidl_next::Responder::from_untyped(responder);
1035
1036 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1037 Ok(decoded) => {
1038 handler.clone(::fidl_next::Request::from_decoded(decoded), responder).await;
1039 Ok(())
1040 }
1041 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1042 ordinal: 6333824321947847721,
1043 error,
1044 }),
1045 }
1046 }
1047
1048 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1049 }
1050 }
1051}
1052
1053impl<___T> LoaderClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
1054{}
1055
1056impl<___H, ___T> LoaderLocalClientHandler<___T> for ::fidl_next::Local<___H>
1057where
1058 ___H: LoaderClientHandler<___T>,
1059 ___T: ::fidl_next::Transport,
1060{
1061}
1062
1063impl<___H, ___T> LoaderLocalServerHandler<___T> for ::fidl_next::Local<___H>
1064where
1065 ___H: LoaderServerHandler<___T>,
1066 ___T: ::fidl_next::Transport,
1067{
1068 async fn done(&mut self) {
1069 ___H::done(&mut self.0).await
1070 }
1071
1072 async fn load_object(
1073 &mut self,
1074
1075 request: ::fidl_next::Request<loader::LoadObject, ___T>,
1076
1077 responder: ::fidl_next::Responder<loader::LoadObject, ___T>,
1078 ) {
1079 ___H::load_object(&mut self.0, request, responder).await
1080 }
1081
1082 async fn config(
1083 &mut self,
1084
1085 request: ::fidl_next::Request<loader::Config, ___T>,
1086
1087 responder: ::fidl_next::Responder<loader::Config, ___T>,
1088 ) {
1089 ___H::config(&mut self.0, request, responder).await
1090 }
1091
1092 async fn clone(
1093 &mut self,
1094
1095 request: ::fidl_next::Request<loader::Clone, ___T>,
1096
1097 responder: ::fidl_next::Responder<loader::Clone, ___T>,
1098 ) {
1099 ___H::clone(&mut self.0, request, responder).await
1100 }
1101}
1102
1103pub use fidl_next_common_fuchsia_ldsvc::*;