1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(Clone, Debug)]
6pub struct LoaderLoadObjectRequest {
7 pub object_name: String,
8}
9
10impl ::fidl_next::Encodable for LoaderLoadObjectRequest {
11 type Encoded = WireLoaderLoadObjectRequest<'static>;
12}
13
14unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderLoadObjectRequest
15where
16 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17
18 ___E: ::fidl_next::Encoder,
19{
20 #[inline]
21 fn encode(
22 self,
23 encoder: &mut ___E,
24 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25 ) -> Result<(), ::fidl_next::EncodeError> {
26 ::fidl_next::munge! {
27 let Self::Encoded {
28 object_name,
29
30 } = out;
31 }
32
33 ::fidl_next::Encode::encode(self.object_name, encoder, object_name)?;
34
35 Ok(())
36 }
37}
38
39unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderLoadObjectRequest
40where
41 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
42
43 ___E: ::fidl_next::Encoder,
44{
45 #[inline]
46 fn encode_ref(
47 &self,
48 encoder: &mut ___E,
49 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
50 ) -> Result<(), ::fidl_next::EncodeError> {
51 ::fidl_next::munge! {
52 let Self::Encoded {
53 object_name,
54
55 } = out;
56 }
57
58 ::fidl_next::EncodeRef::encode_ref(&self.object_name, encoder, object_name)?;
59
60 Ok(())
61 }
62}
63
64impl ::fidl_next::EncodableOption for LoaderLoadObjectRequest {
65 type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderLoadObjectRequest<'static>>;
66}
67
68unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderLoadObjectRequest
69where
70 ___E: ::fidl_next::Encoder + ?Sized,
71 LoaderLoadObjectRequest: ::fidl_next::Encode<___E>,
72{
73 #[inline]
74 fn encode_option(
75 this: Option<Self>,
76 encoder: &mut ___E,
77 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
78 ) -> Result<(), ::fidl_next::EncodeError> {
79 if let Some(inner) = this {
80 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
81 ::fidl_next::WireBox::encode_present(out);
82 } else {
83 ::fidl_next::WireBox::encode_absent(out);
84 }
85
86 Ok(())
87 }
88}
89
90unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LoaderLoadObjectRequest
91where
92 ___E: ::fidl_next::Encoder + ?Sized,
93 LoaderLoadObjectRequest: ::fidl_next::EncodeRef<___E>,
94{
95 #[inline]
96 fn encode_option_ref(
97 this: Option<&Self>,
98 encoder: &mut ___E,
99 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
100 ) -> Result<(), ::fidl_next::EncodeError> {
101 if let Some(inner) = this {
102 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
103 ::fidl_next::WireBox::encode_present(out);
104 } else {
105 ::fidl_next::WireBox::encode_absent(out);
106 }
107
108 Ok(())
109 }
110}
111
112impl<'de> ::fidl_next::FromWire<WireLoaderLoadObjectRequest<'de>> for LoaderLoadObjectRequest {
113 #[inline]
114 fn from_wire(wire: WireLoaderLoadObjectRequest<'de>) -> Self {
115 Self { object_name: ::fidl_next::FromWire::from_wire(wire.object_name) }
116 }
117}
118
119impl<'de> ::fidl_next::FromWireRef<WireLoaderLoadObjectRequest<'de>> for LoaderLoadObjectRequest {
120 #[inline]
121 fn from_wire_ref(wire: &WireLoaderLoadObjectRequest<'de>) -> Self {
122 Self { object_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.object_name) }
123 }
124}
125
126#[derive(Debug)]
128#[repr(C)]
129pub struct WireLoaderLoadObjectRequest<'de> {
130 pub object_name: ::fidl_next::WireString<'de>,
131}
132
133unsafe impl ::fidl_next::Wire for WireLoaderLoadObjectRequest<'static> {
134 type Decoded<'de> = WireLoaderLoadObjectRequest<'de>;
135
136 #[inline]
137 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
138}
139
140unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderLoadObjectRequest<'static>
141where
142 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
143
144 ___D: ::fidl_next::Decoder,
145{
146 fn decode(
147 slot: ::fidl_next::Slot<'_, Self>,
148 decoder: &mut ___D,
149 ) -> Result<(), ::fidl_next::DecodeError> {
150 ::fidl_next::munge! {
151 let Self {
152 mut object_name,
153
154 } = slot;
155 }
156
157 ::fidl_next::Decode::decode(object_name.as_mut(), decoder)?;
158
159 let object_name = unsafe { object_name.deref_unchecked() };
160
161 if object_name.len() > 1024 {
162 return Err(::fidl_next::DecodeError::VectorTooLong {
163 size: object_name.len() as u64,
164 limit: 1024,
165 });
166 }
167
168 Ok(())
169 }
170}
171
172#[derive(Debug)]
173#[repr(C)]
174pub struct LoaderLoadObjectResponse {
175 pub rv: i32,
176
177 pub object: Option<::fidl_next::fuchsia::zx::Handle>,
178}
179
180impl ::fidl_next::Encodable for LoaderLoadObjectResponse {
181 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLoaderLoadObjectResponse> = unsafe {
182 ::fidl_next::CopyOptimization::enable_if(
183 true
184
185 && <
186 i32 as ::fidl_next::Encodable
187 >::COPY_OPTIMIZATION.is_enabled()
188
189 && <
190 Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::Encodable
191 >::COPY_OPTIMIZATION.is_enabled()
192
193 )
194 };
195
196 type Encoded = WireLoaderLoadObjectResponse;
197}
198
199unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderLoadObjectResponse
200where
201 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
202
203 ___E: ::fidl_next::fuchsia::HandleEncoder,
204{
205 #[inline]
206 fn encode(
207 self,
208 encoder: &mut ___E,
209 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
210 ) -> Result<(), ::fidl_next::EncodeError> {
211 ::fidl_next::munge! {
212 let Self::Encoded {
213 rv,
214 object,
215
216 } = out;
217 }
218
219 ::fidl_next::Encode::encode(self.rv, encoder, rv)?;
220
221 ::fidl_next::Encode::encode(self.object, encoder, object)?;
222
223 Ok(())
224 }
225}
226
227impl ::fidl_next::EncodableOption for LoaderLoadObjectResponse {
228 type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderLoadObjectResponse>;
229}
230
231unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderLoadObjectResponse
232where
233 ___E: ::fidl_next::Encoder + ?Sized,
234 LoaderLoadObjectResponse: ::fidl_next::Encode<___E>,
235{
236 #[inline]
237 fn encode_option(
238 this: Option<Self>,
239 encoder: &mut ___E,
240 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
241 ) -> Result<(), ::fidl_next::EncodeError> {
242 if let Some(inner) = this {
243 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
244 ::fidl_next::WireBox::encode_present(out);
245 } else {
246 ::fidl_next::WireBox::encode_absent(out);
247 }
248
249 Ok(())
250 }
251}
252
253impl ::fidl_next::FromWire<WireLoaderLoadObjectResponse> for LoaderLoadObjectResponse {
254 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLoaderLoadObjectResponse, Self> = unsafe {
255 ::fidl_next::CopyOptimization::enable_if(
256 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
257 .is_enabled()
258 && <Option<::fidl_next::fuchsia::zx::Handle> as ::fidl_next::FromWire<
259 ::fidl_next::fuchsia::WireOptionalHandle,
260 >>::COPY_OPTIMIZATION
261 .is_enabled(),
262 )
263 };
264
265 #[inline]
266 fn from_wire(wire: WireLoaderLoadObjectResponse) -> Self {
267 Self {
268 rv: ::fidl_next::FromWire::from_wire(wire.rv),
269
270 object: ::fidl_next::FromWire::from_wire(wire.object),
271 }
272 }
273}
274
275#[derive(Debug)]
277#[repr(C)]
278pub struct WireLoaderLoadObjectResponse {
279 pub rv: ::fidl_next::WireI32,
280
281 pub object: ::fidl_next::fuchsia::WireOptionalHandle,
282}
283
284unsafe impl ::fidl_next::Wire for WireLoaderLoadObjectResponse {
285 type Decoded<'de> = WireLoaderLoadObjectResponse;
286
287 #[inline]
288 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
289}
290
291unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderLoadObjectResponse
292where
293 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
294
295 ___D: ::fidl_next::fuchsia::HandleDecoder,
296{
297 fn decode(
298 slot: ::fidl_next::Slot<'_, Self>,
299 decoder: &mut ___D,
300 ) -> Result<(), ::fidl_next::DecodeError> {
301 ::fidl_next::munge! {
302 let Self {
303 mut rv,
304 mut object,
305
306 } = slot;
307 }
308
309 ::fidl_next::Decode::decode(rv.as_mut(), decoder)?;
310
311 ::fidl_next::Decode::decode(object.as_mut(), decoder)?;
312
313 Ok(())
314 }
315}
316
317#[derive(Clone, Debug)]
318pub struct LoaderConfigRequest {
319 pub config: String,
320}
321
322impl ::fidl_next::Encodable for LoaderConfigRequest {
323 type Encoded = WireLoaderConfigRequest<'static>;
324}
325
326unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderConfigRequest
327where
328 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
329
330 ___E: ::fidl_next::Encoder,
331{
332 #[inline]
333 fn encode(
334 self,
335 encoder: &mut ___E,
336 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
337 ) -> Result<(), ::fidl_next::EncodeError> {
338 ::fidl_next::munge! {
339 let Self::Encoded {
340 config,
341
342 } = out;
343 }
344
345 ::fidl_next::Encode::encode(self.config, encoder, config)?;
346
347 Ok(())
348 }
349}
350
351unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderConfigRequest
352where
353 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
354
355 ___E: ::fidl_next::Encoder,
356{
357 #[inline]
358 fn encode_ref(
359 &self,
360 encoder: &mut ___E,
361 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
362 ) -> Result<(), ::fidl_next::EncodeError> {
363 ::fidl_next::munge! {
364 let Self::Encoded {
365 config,
366
367 } = out;
368 }
369
370 ::fidl_next::EncodeRef::encode_ref(&self.config, encoder, config)?;
371
372 Ok(())
373 }
374}
375
376impl ::fidl_next::EncodableOption for LoaderConfigRequest {
377 type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderConfigRequest<'static>>;
378}
379
380unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderConfigRequest
381where
382 ___E: ::fidl_next::Encoder + ?Sized,
383 LoaderConfigRequest: ::fidl_next::Encode<___E>,
384{
385 #[inline]
386 fn encode_option(
387 this: Option<Self>,
388 encoder: &mut ___E,
389 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
390 ) -> Result<(), ::fidl_next::EncodeError> {
391 if let Some(inner) = this {
392 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
393 ::fidl_next::WireBox::encode_present(out);
394 } else {
395 ::fidl_next::WireBox::encode_absent(out);
396 }
397
398 Ok(())
399 }
400}
401
402unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LoaderConfigRequest
403where
404 ___E: ::fidl_next::Encoder + ?Sized,
405 LoaderConfigRequest: ::fidl_next::EncodeRef<___E>,
406{
407 #[inline]
408 fn encode_option_ref(
409 this: Option<&Self>,
410 encoder: &mut ___E,
411 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
412 ) -> Result<(), ::fidl_next::EncodeError> {
413 if let Some(inner) = this {
414 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
415 ::fidl_next::WireBox::encode_present(out);
416 } else {
417 ::fidl_next::WireBox::encode_absent(out);
418 }
419
420 Ok(())
421 }
422}
423
424impl<'de> ::fidl_next::FromWire<WireLoaderConfigRequest<'de>> for LoaderConfigRequest {
425 #[inline]
426 fn from_wire(wire: WireLoaderConfigRequest<'de>) -> Self {
427 Self { config: ::fidl_next::FromWire::from_wire(wire.config) }
428 }
429}
430
431impl<'de> ::fidl_next::FromWireRef<WireLoaderConfigRequest<'de>> for LoaderConfigRequest {
432 #[inline]
433 fn from_wire_ref(wire: &WireLoaderConfigRequest<'de>) -> Self {
434 Self { config: ::fidl_next::FromWireRef::from_wire_ref(&wire.config) }
435 }
436}
437
438#[derive(Debug)]
440#[repr(C)]
441pub struct WireLoaderConfigRequest<'de> {
442 pub config: ::fidl_next::WireString<'de>,
443}
444
445unsafe impl ::fidl_next::Wire for WireLoaderConfigRequest<'static> {
446 type Decoded<'de> = WireLoaderConfigRequest<'de>;
447
448 #[inline]
449 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
450}
451
452unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderConfigRequest<'static>
453where
454 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
455
456 ___D: ::fidl_next::Decoder,
457{
458 fn decode(
459 slot: ::fidl_next::Slot<'_, Self>,
460 decoder: &mut ___D,
461 ) -> Result<(), ::fidl_next::DecodeError> {
462 ::fidl_next::munge! {
463 let Self {
464 mut config,
465
466 } = slot;
467 }
468
469 ::fidl_next::Decode::decode(config.as_mut(), decoder)?;
470
471 let config = unsafe { config.deref_unchecked() };
472
473 if config.len() > 1024 {
474 return Err(::fidl_next::DecodeError::VectorTooLong {
475 size: config.len() as u64,
476 limit: 1024,
477 });
478 }
479
480 Ok(())
481 }
482}
483
484#[derive(Clone, Debug)]
485#[repr(C)]
486pub struct LoaderConfigResponse {
487 pub rv: i32,
488}
489
490impl ::fidl_next::Encodable for LoaderConfigResponse {
491 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLoaderConfigResponse> = unsafe {
492 ::fidl_next::CopyOptimization::enable_if(
493 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
494 )
495 };
496
497 type Encoded = WireLoaderConfigResponse;
498}
499
500unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderConfigResponse
501where
502 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
503{
504 #[inline]
505 fn encode(
506 self,
507 encoder: &mut ___E,
508 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
509 ) -> Result<(), ::fidl_next::EncodeError> {
510 ::fidl_next::munge! {
511 let Self::Encoded {
512 rv,
513
514 } = out;
515 }
516
517 ::fidl_next::Encode::encode(self.rv, encoder, rv)?;
518
519 Ok(())
520 }
521}
522
523unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderConfigResponse
524where
525 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
526{
527 #[inline]
528 fn encode_ref(
529 &self,
530 encoder: &mut ___E,
531 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
532 ) -> Result<(), ::fidl_next::EncodeError> {
533 ::fidl_next::munge! {
534 let Self::Encoded {
535 rv,
536
537 } = out;
538 }
539
540 ::fidl_next::EncodeRef::encode_ref(&self.rv, encoder, rv)?;
541
542 Ok(())
543 }
544}
545
546impl ::fidl_next::EncodableOption for LoaderConfigResponse {
547 type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderConfigResponse>;
548}
549
550unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderConfigResponse
551where
552 ___E: ::fidl_next::Encoder + ?Sized,
553 LoaderConfigResponse: ::fidl_next::Encode<___E>,
554{
555 #[inline]
556 fn encode_option(
557 this: Option<Self>,
558 encoder: &mut ___E,
559 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
560 ) -> Result<(), ::fidl_next::EncodeError> {
561 if let Some(inner) = this {
562 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
563 ::fidl_next::WireBox::encode_present(out);
564 } else {
565 ::fidl_next::WireBox::encode_absent(out);
566 }
567
568 Ok(())
569 }
570}
571
572unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LoaderConfigResponse
573where
574 ___E: ::fidl_next::Encoder + ?Sized,
575 LoaderConfigResponse: ::fidl_next::EncodeRef<___E>,
576{
577 #[inline]
578 fn encode_option_ref(
579 this: Option<&Self>,
580 encoder: &mut ___E,
581 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
582 ) -> Result<(), ::fidl_next::EncodeError> {
583 if let Some(inner) = this {
584 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
585 ::fidl_next::WireBox::encode_present(out);
586 } else {
587 ::fidl_next::WireBox::encode_absent(out);
588 }
589
590 Ok(())
591 }
592}
593
594impl ::fidl_next::FromWire<WireLoaderConfigResponse> for LoaderConfigResponse {
595 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLoaderConfigResponse, Self> = unsafe {
596 ::fidl_next::CopyOptimization::enable_if(
597 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
598 .is_enabled(),
599 )
600 };
601
602 #[inline]
603 fn from_wire(wire: WireLoaderConfigResponse) -> Self {
604 Self { rv: ::fidl_next::FromWire::from_wire(wire.rv) }
605 }
606}
607
608impl ::fidl_next::FromWireRef<WireLoaderConfigResponse> for LoaderConfigResponse {
609 #[inline]
610 fn from_wire_ref(wire: &WireLoaderConfigResponse) -> Self {
611 Self { rv: ::fidl_next::FromWireRef::from_wire_ref(&wire.rv) }
612 }
613}
614
615#[derive(Clone, Debug)]
617#[repr(C)]
618pub struct WireLoaderConfigResponse {
619 pub rv: ::fidl_next::WireI32,
620}
621
622unsafe impl ::fidl_next::Wire for WireLoaderConfigResponse {
623 type Decoded<'de> = WireLoaderConfigResponse;
624
625 #[inline]
626 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
627}
628
629unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderConfigResponse
630where
631 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
632{
633 fn decode(
634 slot: ::fidl_next::Slot<'_, Self>,
635 decoder: &mut ___D,
636 ) -> Result<(), ::fidl_next::DecodeError> {
637 ::fidl_next::munge! {
638 let Self {
639 mut rv,
640
641 } = slot;
642 }
643
644 ::fidl_next::Decode::decode(rv.as_mut(), decoder)?;
645
646 Ok(())
647 }
648}
649
650#[derive(Debug)]
651#[repr(C)]
652pub struct LoaderCloneRequest {
653 pub loader: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Loader>,
654}
655
656impl ::fidl_next::Encodable for LoaderCloneRequest {
657 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLoaderCloneRequest> = unsafe {
658 ::fidl_next::CopyOptimization::enable_if(
659 true
660
661 && <
662 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel,crate::Loader,
663 > as ::fidl_next::Encodable
664 >::COPY_OPTIMIZATION.is_enabled()
665
666 )
667 };
668
669 type Encoded = WireLoaderCloneRequest;
670}
671
672unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderCloneRequest
673where
674 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
675
676 ___E: ::fidl_next::fuchsia::HandleEncoder,
677{
678 #[inline]
679 fn encode(
680 self,
681 encoder: &mut ___E,
682 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
683 ) -> Result<(), ::fidl_next::EncodeError> {
684 ::fidl_next::munge! {
685 let Self::Encoded {
686 loader,
687
688 } = out;
689 }
690
691 ::fidl_next::Encode::encode(self.loader, encoder, loader)?;
692
693 Ok(())
694 }
695}
696
697impl ::fidl_next::EncodableOption for LoaderCloneRequest {
698 type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderCloneRequest>;
699}
700
701unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderCloneRequest
702where
703 ___E: ::fidl_next::Encoder + ?Sized,
704 LoaderCloneRequest: ::fidl_next::Encode<___E>,
705{
706 #[inline]
707 fn encode_option(
708 this: Option<Self>,
709 encoder: &mut ___E,
710 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
711 ) -> Result<(), ::fidl_next::EncodeError> {
712 if let Some(inner) = this {
713 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
714 ::fidl_next::WireBox::encode_present(out);
715 } else {
716 ::fidl_next::WireBox::encode_absent(out);
717 }
718
719 Ok(())
720 }
721}
722
723impl ::fidl_next::FromWire<WireLoaderCloneRequest> for LoaderCloneRequest {
724 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLoaderCloneRequest, Self> = unsafe {
725 ::fidl_next::CopyOptimization::enable_if(
726 true
727
728 && <
729 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel,crate::Loader,
730 > as ::fidl_next::FromWire<::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel,crate::Loader,
731 >>
732 >::COPY_OPTIMIZATION.is_enabled()
733
734 )
735 };
736
737 #[inline]
738 fn from_wire(wire: WireLoaderCloneRequest) -> Self {
739 Self { loader: ::fidl_next::FromWire::from_wire(wire.loader) }
740 }
741}
742
743#[derive(Debug)]
745#[repr(C)]
746pub struct WireLoaderCloneRequest {
747 pub loader: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Loader>,
748}
749
750unsafe impl ::fidl_next::Wire for WireLoaderCloneRequest {
751 type Decoded<'de> = WireLoaderCloneRequest;
752
753 #[inline]
754 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
755}
756
757unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderCloneRequest
758where
759 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
760
761 ___D: ::fidl_next::fuchsia::HandleDecoder,
762{
763 fn decode(
764 slot: ::fidl_next::Slot<'_, Self>,
765 decoder: &mut ___D,
766 ) -> Result<(), ::fidl_next::DecodeError> {
767 ::fidl_next::munge! {
768 let Self {
769 mut loader,
770
771 } = slot;
772 }
773
774 ::fidl_next::Decode::decode(loader.as_mut(), decoder)?;
775
776 Ok(())
777 }
778}
779
780#[derive(Clone, Debug)]
781#[repr(C)]
782pub struct LoaderCloneResponse {
783 pub rv: i32,
784}
785
786impl ::fidl_next::Encodable for LoaderCloneResponse {
787 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireLoaderCloneResponse> = unsafe {
788 ::fidl_next::CopyOptimization::enable_if(
789 true && <i32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
790 )
791 };
792
793 type Encoded = WireLoaderCloneResponse;
794}
795
796unsafe impl<___E> ::fidl_next::Encode<___E> for LoaderCloneResponse
797where
798 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
799{
800 #[inline]
801 fn encode(
802 self,
803 encoder: &mut ___E,
804 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
805 ) -> Result<(), ::fidl_next::EncodeError> {
806 ::fidl_next::munge! {
807 let Self::Encoded {
808 rv,
809
810 } = out;
811 }
812
813 ::fidl_next::Encode::encode(self.rv, encoder, rv)?;
814
815 Ok(())
816 }
817}
818
819unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LoaderCloneResponse
820where
821 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
822{
823 #[inline]
824 fn encode_ref(
825 &self,
826 encoder: &mut ___E,
827 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
828 ) -> Result<(), ::fidl_next::EncodeError> {
829 ::fidl_next::munge! {
830 let Self::Encoded {
831 rv,
832
833 } = out;
834 }
835
836 ::fidl_next::EncodeRef::encode_ref(&self.rv, encoder, rv)?;
837
838 Ok(())
839 }
840}
841
842impl ::fidl_next::EncodableOption for LoaderCloneResponse {
843 type EncodedOption = ::fidl_next::WireBox<'static, WireLoaderCloneResponse>;
844}
845
846unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LoaderCloneResponse
847where
848 ___E: ::fidl_next::Encoder + ?Sized,
849 LoaderCloneResponse: ::fidl_next::Encode<___E>,
850{
851 #[inline]
852 fn encode_option(
853 this: Option<Self>,
854 encoder: &mut ___E,
855 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
856 ) -> Result<(), ::fidl_next::EncodeError> {
857 if let Some(inner) = this {
858 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
859 ::fidl_next::WireBox::encode_present(out);
860 } else {
861 ::fidl_next::WireBox::encode_absent(out);
862 }
863
864 Ok(())
865 }
866}
867
868unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LoaderCloneResponse
869where
870 ___E: ::fidl_next::Encoder + ?Sized,
871 LoaderCloneResponse: ::fidl_next::EncodeRef<___E>,
872{
873 #[inline]
874 fn encode_option_ref(
875 this: Option<&Self>,
876 encoder: &mut ___E,
877 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
878 ) -> Result<(), ::fidl_next::EncodeError> {
879 if let Some(inner) = this {
880 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
881 ::fidl_next::WireBox::encode_present(out);
882 } else {
883 ::fidl_next::WireBox::encode_absent(out);
884 }
885
886 Ok(())
887 }
888}
889
890impl ::fidl_next::FromWire<WireLoaderCloneResponse> for LoaderCloneResponse {
891 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireLoaderCloneResponse, Self> = unsafe {
892 ::fidl_next::CopyOptimization::enable_if(
893 true && <i32 as ::fidl_next::FromWire<::fidl_next::WireI32>>::COPY_OPTIMIZATION
894 .is_enabled(),
895 )
896 };
897
898 #[inline]
899 fn from_wire(wire: WireLoaderCloneResponse) -> Self {
900 Self { rv: ::fidl_next::FromWire::from_wire(wire.rv) }
901 }
902}
903
904impl ::fidl_next::FromWireRef<WireLoaderCloneResponse> for LoaderCloneResponse {
905 #[inline]
906 fn from_wire_ref(wire: &WireLoaderCloneResponse) -> Self {
907 Self { rv: ::fidl_next::FromWireRef::from_wire_ref(&wire.rv) }
908 }
909}
910
911#[derive(Clone, Debug)]
913#[repr(C)]
914pub struct WireLoaderCloneResponse {
915 pub rv: ::fidl_next::WireI32,
916}
917
918unsafe impl ::fidl_next::Wire for WireLoaderCloneResponse {
919 type Decoded<'de> = WireLoaderCloneResponse;
920
921 #[inline]
922 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
923}
924
925unsafe impl<___D> ::fidl_next::Decode<___D> for WireLoaderCloneResponse
926where
927 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
928{
929 fn decode(
930 slot: ::fidl_next::Slot<'_, Self>,
931 decoder: &mut ___D,
932 ) -> Result<(), ::fidl_next::DecodeError> {
933 ::fidl_next::munge! {
934 let Self {
935 mut rv,
936
937 } = slot;
938 }
939
940 ::fidl_next::Decode::decode(rv.as_mut(), decoder)?;
941
942 Ok(())
943 }
944}
945
946#[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"]
948#[derive(Debug)]
949pub struct Loader;
950
951pub mod loader {
952 pub mod prelude {
953 pub use crate::{
954 loader, Loader, LoaderClientHandler, LoaderClientSender, LoaderServerHandler,
955 LoaderServerSender,
956 };
957
958 pub use crate::LoaderCloneRequest;
959
960 pub use crate::LoaderCloneResponse;
961
962 pub use crate::LoaderConfigRequest;
963
964 pub use crate::LoaderConfigResponse;
965
966 pub use crate::LoaderLoadObjectRequest;
967
968 pub use crate::LoaderLoadObjectResponse;
969 }
970
971 pub struct Done;
972
973 impl ::fidl_next::Method for Done {
974 const ORDINAL: u64 = 7186174313520107521;
975
976 type Protocol = crate::Loader;
977
978 type Request = ();
979
980 type Response = ::fidl_next::Never;
981 }
982
983 pub struct LoadObject;
984
985 impl ::fidl_next::Method for LoadObject {
986 const ORDINAL: u64 = 5243774714012182611;
987
988 type Protocol = crate::Loader;
989
990 type Request = crate::WireLoaderLoadObjectRequest<'static>;
991
992 type Response = crate::WireLoaderLoadObjectResponse;
993 }
994
995 pub struct Config;
996
997 impl ::fidl_next::Method for Config {
998 const ORDINAL: u64 = 7676977189692319809;
999
1000 type Protocol = crate::Loader;
1001
1002 type Request = crate::WireLoaderConfigRequest<'static>;
1003
1004 type Response = crate::WireLoaderConfigResponse;
1005 }
1006
1007 pub struct Clone;
1008
1009 impl ::fidl_next::Method for Clone {
1010 const ORDINAL: u64 = 6333824321947847721;
1011
1012 type Protocol = crate::Loader;
1013
1014 type Request = crate::WireLoaderCloneRequest;
1015
1016 type Response = crate::WireLoaderCloneResponse;
1017 }
1018}
1019
1020pub trait LoaderClientSender {
1022 type Transport: ::fidl_next::Transport;
1023
1024 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
1025 fn done(
1026 &self,
1027 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
1028
1029 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
1030 fn load_object<___R>(
1031 &self,
1032 request: ___R,
1033 ) -> Result<
1034 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::LoadObject>,
1035 ::fidl_next::EncodeError,
1036 >
1037 where
1038 ___R: ::fidl_next::Encode<
1039 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1040 Encoded = crate::WireLoaderLoadObjectRequest<'static>,
1041 >;
1042
1043 #[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"]
1044 fn config<___R>(
1045 &self,
1046 request: ___R,
1047 ) -> Result<
1048 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::Config>,
1049 ::fidl_next::EncodeError,
1050 >
1051 where
1052 ___R: ::fidl_next::Encode<
1053 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1054 Encoded = crate::WireLoaderConfigRequest<'static>,
1055 >;
1056
1057 #[doc = " Obtain a new loader service connection.\n"]
1058 fn clone<___R>(
1059 &self,
1060 request: ___R,
1061 ) -> Result<
1062 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::Clone>,
1063 ::fidl_next::EncodeError,
1064 >
1065 where
1066 ___R: ::fidl_next::Encode<
1067 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1068 Encoded = crate::WireLoaderCloneRequest,
1069 >;
1070}
1071
1072impl<___T> LoaderClientSender for ::fidl_next::ClientSender<___T, Loader>
1073where
1074 ___T: ::fidl_next::Transport,
1075{
1076 type Transport = ___T;
1077
1078 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
1079 fn done(
1080 &self,
1081 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
1082 self.as_untyped().send_one_way(7186174313520107521, ())
1083 }
1084
1085 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
1086 fn load_object<___R>(
1087 &self,
1088 request: ___R,
1089 ) -> Result<
1090 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::LoadObject>,
1091 ::fidl_next::EncodeError,
1092 >
1093 where
1094 ___R: ::fidl_next::Encode<
1095 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1096 Encoded = crate::WireLoaderLoadObjectRequest<'static>,
1097 >,
1098 {
1099 self.as_untyped()
1100 .send_two_way(5243774714012182611, request)
1101 .map(::fidl_next::ResponseFuture::from_untyped)
1102 }
1103
1104 #[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"]
1105 fn config<___R>(
1106 &self,
1107 request: ___R,
1108 ) -> Result<
1109 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::Config>,
1110 ::fidl_next::EncodeError,
1111 >
1112 where
1113 ___R: ::fidl_next::Encode<
1114 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1115 Encoded = crate::WireLoaderConfigRequest<'static>,
1116 >,
1117 {
1118 self.as_untyped()
1119 .send_two_way(7676977189692319809, request)
1120 .map(::fidl_next::ResponseFuture::from_untyped)
1121 }
1122
1123 #[doc = " Obtain a new loader service connection.\n"]
1124 fn clone<___R>(
1125 &self,
1126 request: ___R,
1127 ) -> Result<
1128 ::fidl_next::ResponseFuture<'_, Self::Transport, loader::Clone>,
1129 ::fidl_next::EncodeError,
1130 >
1131 where
1132 ___R: ::fidl_next::Encode<
1133 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1134 Encoded = crate::WireLoaderCloneRequest,
1135 >,
1136 {
1137 self.as_untyped()
1138 .send_two_way(6333824321947847721, request)
1139 .map(::fidl_next::ResponseFuture::from_untyped)
1140 }
1141}
1142
1143pub trait LoaderClientHandler<___T: ::fidl_next::Transport> {}
1147
1148impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Loader
1149where
1150 ___T: ::fidl_next::Transport,
1151 ___H: LoaderClientHandler<___T>,
1152
1153 <loader::LoadObject as ::fidl_next::Method>::Response:
1154 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1155
1156 <loader::Config as ::fidl_next::Method>::Response:
1157 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1158
1159 <loader::Clone as ::fidl_next::Method>::Response:
1160 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1161{
1162 fn on_event(
1163 handler: &mut ___H,
1164 sender: &::fidl_next::ClientSender<___T, Self>,
1165 ordinal: u64,
1166 buffer: ___T::RecvBuffer,
1167 ) {
1168 match ordinal {
1169 ordinal => {
1170 sender.close();
1171 }
1172 }
1173 }
1174}
1175
1176pub trait LoaderServerSender {
1178 type Transport: ::fidl_next::Transport;
1179}
1180
1181impl<___T> LoaderServerSender for ::fidl_next::ServerSender<___T, Loader>
1182where
1183 ___T: ::fidl_next::Transport,
1184{
1185 type Transport = ___T;
1186}
1187
1188pub trait LoaderServerHandler<___T: ::fidl_next::Transport> {
1192 #[doc = " Cleanly shutdown the connection to the Loader service.\n"]
1193 fn done(&mut self, sender: &::fidl_next::ServerSender<___T, Loader>);
1194
1195 #[doc = " The dynamic linker sends `object_name` and gets back a VMO\n handle containing the file.\n"]
1196 fn load_object(
1197 &mut self,
1198 sender: &::fidl_next::ServerSender<___T, Loader>,
1199
1200 request: ::fidl_next::Request<___T, loader::LoadObject>,
1201
1202 responder: ::fidl_next::Responder<loader::LoadObject>,
1203 );
1204
1205 #[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"]
1206 fn config(
1207 &mut self,
1208 sender: &::fidl_next::ServerSender<___T, Loader>,
1209
1210 request: ::fidl_next::Request<___T, loader::Config>,
1211
1212 responder: ::fidl_next::Responder<loader::Config>,
1213 );
1214
1215 #[doc = " Obtain a new loader service connection.\n"]
1216 fn clone(
1217 &mut self,
1218 sender: &::fidl_next::ServerSender<___T, Loader>,
1219
1220 request: ::fidl_next::Request<___T, loader::Clone>,
1221
1222 responder: ::fidl_next::Responder<loader::Clone>,
1223 );
1224}
1225
1226impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Loader
1227where
1228 ___T: ::fidl_next::Transport,
1229 ___H: LoaderServerHandler<___T>,
1230
1231 <loader::LoadObject as ::fidl_next::Method>::Request:
1232 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1233
1234 <loader::Config as ::fidl_next::Method>::Request:
1235 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1236
1237 <loader::Clone as ::fidl_next::Method>::Request:
1238 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1239{
1240 fn on_one_way(
1241 handler: &mut ___H,
1242 sender: &::fidl_next::ServerSender<___T, Self>,
1243 ordinal: u64,
1244 buffer: ___T::RecvBuffer,
1245 ) {
1246 match ordinal {
1247 7186174313520107521 => {
1248 handler.done(sender);
1249 }
1250
1251 ordinal => {
1252 sender.close();
1253 }
1254 }
1255 }
1256
1257 fn on_two_way(
1258 handler: &mut ___H,
1259 sender: &::fidl_next::ServerSender<___T, Self>,
1260 ordinal: u64,
1261 buffer: ___T::RecvBuffer,
1262 responder: ::fidl_next::protocol::Responder,
1263 ) {
1264 match ordinal {
1265 5243774714012182611 => {
1266 let responder = ::fidl_next::Responder::from_untyped(responder);
1267
1268 match ::fidl_next::DecoderExt::decode(buffer) {
1269 Ok(decoded) => handler.load_object(sender, decoded, responder),
1270 Err(e) => {
1271 sender.close();
1272 }
1273 }
1274 }
1275
1276 7676977189692319809 => {
1277 let responder = ::fidl_next::Responder::from_untyped(responder);
1278
1279 match ::fidl_next::DecoderExt::decode(buffer) {
1280 Ok(decoded) => handler.config(sender, decoded, responder),
1281 Err(e) => {
1282 sender.close();
1283 }
1284 }
1285 }
1286
1287 6333824321947847721 => {
1288 let responder = ::fidl_next::Responder::from_untyped(responder);
1289
1290 match ::fidl_next::DecoderExt::decode(buffer) {
1291 Ok(decoded) => handler.clone(sender, decoded, responder),
1292 Err(e) => {
1293 sender.close();
1294 }
1295 }
1296 }
1297
1298 ordinal => {
1299 sender.close();
1300 }
1301 }
1302 }
1303}
1304
1305pub mod compat {
1307
1308 #[cfg(target_os = "fuchsia")]
1309 pub type LoaderProxy =
1312 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Loader>;
1313
1314 impl ::core::convert::From<crate::Loader> for ::fidl_fuchsia_ldsvc::LoaderMarker {
1315 #[inline]
1316 fn from(_: crate::Loader) -> Self {
1317 Self
1318 }
1319 }
1320}