1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[doc = " Describes the expected availability of the capability.\n\n Some capabilities may not be present on all system configurations. In those\n cases, the availability will be declared as `OPTIONAL` along the chains of\n exposes/offers/uses, and the capability would be routed from `void` on\n system configurations where it does not make sense to route or provide a\n particular capability (e.g. graphical capabilities on a headless system).\n"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u32)]
8pub enum Availability {
9 Required = 1,
10 Optional = 2,
11 SameAsTarget = 3,
12 Transitional = 4,
13}
14
15impl ::fidl_next::Encodable for Availability {
16 type Encoded = WireAvailability;
17}
18impl ::std::convert::TryFrom<u32> for Availability {
19 type Error = ::fidl_next::UnknownStrictEnumMemberError;
20 fn try_from(value: u32) -> Result<Self, Self::Error> {
21 match value {
22 1 => Ok(Self::Required),
23 2 => Ok(Self::Optional),
24 3 => Ok(Self::SameAsTarget),
25 4 => Ok(Self::Transitional),
26
27 _ => Err(Self::Error::new(value.into())),
28 }
29 }
30}
31
32unsafe impl<___E> ::fidl_next::Encode<___E> for Availability
33where
34 ___E: ?Sized,
35{
36 #[inline]
37 fn encode(
38 self,
39 encoder: &mut ___E,
40 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
41 ) -> Result<(), ::fidl_next::EncodeError> {
42 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
43 }
44}
45
46unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Availability
47where
48 ___E: ?Sized,
49{
50 #[inline]
51 fn encode_ref(
52 &self,
53 encoder: &mut ___E,
54 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
55 ) -> Result<(), ::fidl_next::EncodeError> {
56 ::fidl_next::munge!(let WireAvailability { value } = out);
57 let _ = value.write(::fidl_next::WireU32::from(match *self {
58 Self::Required => 1,
59
60 Self::Optional => 2,
61
62 Self::SameAsTarget => 3,
63
64 Self::Transitional => 4,
65 }));
66
67 Ok(())
68 }
69}
70
71impl ::core::convert::From<WireAvailability> for Availability {
72 fn from(wire: WireAvailability) -> Self {
73 match u32::from(wire.value) {
74 1 => Self::Required,
75
76 2 => Self::Optional,
77
78 3 => Self::SameAsTarget,
79
80 4 => Self::Transitional,
81
82 _ => unsafe { ::core::hint::unreachable_unchecked() },
83 }
84 }
85}
86
87impl ::fidl_next::FromWire<WireAvailability> for Availability {
88 #[inline]
89 fn from_wire(wire: WireAvailability) -> Self {
90 Self::from(wire)
91 }
92}
93
94impl ::fidl_next::FromWireRef<WireAvailability> for Availability {
95 #[inline]
96 fn from_wire_ref(wire: &WireAvailability) -> Self {
97 Self::from(*wire)
98 }
99}
100
101#[derive(Clone, Copy, Debug, PartialEq, Eq)]
103#[repr(transparent)]
104pub struct WireAvailability {
105 value: ::fidl_next::WireU32,
106}
107
108unsafe impl ::fidl_next::Wire for WireAvailability {
109 type Decoded<'de> = Self;
110
111 #[inline]
112 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
113 }
115}
116
117impl WireAvailability {
118 pub const REQUIRED: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(1) };
119
120 pub const OPTIONAL: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(2) };
121
122 pub const SAME_AS_TARGET: WireAvailability =
123 WireAvailability { value: ::fidl_next::WireU32(3) };
124
125 pub const TRANSITIONAL: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(4) };
126}
127
128unsafe impl<___D> ::fidl_next::Decode<___D> for WireAvailability
129where
130 ___D: ?Sized,
131{
132 fn decode(
133 slot: ::fidl_next::Slot<'_, Self>,
134 _: &mut ___D,
135 ) -> Result<(), ::fidl_next::DecodeError> {
136 ::fidl_next::munge!(let Self { value } = slot);
137
138 match u32::from(*value) {
139 1 | 2 | 3 | 4 => (),
140 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
141 }
142
143 Ok(())
144 }
145}
146
147impl ::core::convert::From<Availability> for WireAvailability {
148 fn from(natural: Availability) -> Self {
149 match natural {
150 Availability::Required => WireAvailability::REQUIRED,
151
152 Availability::Optional => WireAvailability::OPTIONAL,
153
154 Availability::SameAsTarget => WireAvailability::SAME_AS_TARGET,
155
156 Availability::Transitional => WireAvailability::TRANSITIONAL,
157 }
158 }
159}
160
161#[derive(Clone, Debug)]
162#[repr(C)]
163pub struct Unit {}
164
165impl ::fidl_next::Encodable for Unit {
166 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireUnit> =
167 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
168
169 type Encoded = WireUnit;
170}
171
172unsafe impl<___E> ::fidl_next::Encode<___E> for Unit
173where
174 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
175{
176 #[inline]
177 fn encode(
178 self,
179 encoder: &mut ___E,
180 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
181 ) -> Result<(), ::fidl_next::EncodeError> {
182 ::fidl_next::munge! {
183 let Self::Encoded {
184
185 } = out;
186 }
187
188 Ok(())
189 }
190}
191
192unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Unit
193where
194 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
195{
196 #[inline]
197 fn encode_ref(
198 &self,
199 encoder: &mut ___E,
200 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
201 ) -> Result<(), ::fidl_next::EncodeError> {
202 ::fidl_next::munge! {
203 let Self::Encoded {
204
205 } = out;
206 }
207
208 Ok(())
209 }
210}
211
212impl ::fidl_next::EncodableOption for Unit {
213 type EncodedOption = ::fidl_next::WireBox<'static, WireUnit>;
214}
215
216unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Unit
217where
218 ___E: ::fidl_next::Encoder + ?Sized,
219 Unit: ::fidl_next::Encode<___E>,
220{
221 #[inline]
222 fn encode_option(
223 this: Option<Self>,
224 encoder: &mut ___E,
225 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
226 ) -> Result<(), ::fidl_next::EncodeError> {
227 if let Some(inner) = this {
228 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
229 ::fidl_next::WireBox::encode_present(out);
230 } else {
231 ::fidl_next::WireBox::encode_absent(out);
232 }
233
234 Ok(())
235 }
236}
237
238unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Unit
239where
240 ___E: ::fidl_next::Encoder + ?Sized,
241 Unit: ::fidl_next::EncodeRef<___E>,
242{
243 #[inline]
244 fn encode_option_ref(
245 this: Option<&Self>,
246 encoder: &mut ___E,
247 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
248 ) -> Result<(), ::fidl_next::EncodeError> {
249 if let Some(inner) = this {
250 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
251 ::fidl_next::WireBox::encode_present(out);
252 } else {
253 ::fidl_next::WireBox::encode_absent(out);
254 }
255
256 Ok(())
257 }
258}
259
260impl ::fidl_next::FromWire<WireUnit> for Unit {
261 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireUnit, Self> =
262 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
263
264 #[inline]
265 fn from_wire(wire: WireUnit) -> Self {
266 Self {}
267 }
268}
269
270impl ::fidl_next::FromWireRef<WireUnit> for Unit {
271 #[inline]
272 fn from_wire_ref(wire: &WireUnit) -> Self {
273 Self {}
274 }
275}
276
277#[derive(Clone, Debug)]
279#[repr(C)]
280pub struct WireUnit {}
281
282unsafe impl ::fidl_next::Wire for WireUnit {
283 type Decoded<'de> = WireUnit;
284
285 #[inline]
286 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
287}
288
289unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnit
290where
291 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
292{
293 fn decode(
294 slot: ::fidl_next::Slot<'_, Self>,
295 decoder: &mut ___D,
296 ) -> Result<(), ::fidl_next::DecodeError> {
297 ::fidl_next::munge! {
298 let Self {
299
300 } = slot;
301 }
302
303 Ok(())
304 }
305}
306
307#[doc = " Maximum number of bytes in a [Data].\n"]
308pub const MAX_DATA_LENGTH: u32 = 8192;
309
310#[derive(Clone, Debug)]
311pub enum Data {
312 Bytes(Vec<u8>),
313
314 String(String),
315
316 Int64(i64),
317
318 Uint64(u64),
319
320 UnknownOrdinal_(u64),
321}
322
323impl ::fidl_next::Encodable for Data {
324 type Encoded = WireData<'static>;
325}
326
327unsafe impl<___E> ::fidl_next::Encode<___E> for Data
328where
329 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
330
331 ___E: ::fidl_next::Encoder,
332{
333 #[inline]
334 fn encode(
335 self,
336 encoder: &mut ___E,
337 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
338 ) -> Result<(), ::fidl_next::EncodeError> {
339 ::fidl_next::munge!(let WireData { raw, _phantom: _ } = out);
340
341 match self {
342 Self::Bytes(value) => {
343 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 1, encoder, raw)?
344 }
345
346 Self::String(value) => {
347 ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 2, encoder, raw)?
348 }
349
350 Self::Int64(value) => {
351 ::fidl_next::RawWireUnion::encode_as::<___E, i64>(value, 3, encoder, raw)?
352 }
353
354 Self::Uint64(value) => {
355 ::fidl_next::RawWireUnion::encode_as::<___E, u64>(value, 4, encoder, raw)?
356 }
357
358 Self::UnknownOrdinal_(ordinal) => {
359 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
360 }
361 }
362
363 Ok(())
364 }
365}
366
367unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Data
368where
369 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
370
371 ___E: ::fidl_next::Encoder,
372{
373 #[inline]
374 fn encode_ref(
375 &self,
376 encoder: &mut ___E,
377 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
378 ) -> Result<(), ::fidl_next::EncodeError> {
379 ::fidl_next::munge!(let WireData { raw, _phantom: _ } = out);
380
381 match self {
382 Self::Bytes(value) => {
383 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u8>>(value, 1, encoder, raw)?
384 }
385
386 Self::String(value) => {
387 ::fidl_next::RawWireUnion::encode_as::<___E, &String>(value, 2, encoder, raw)?
388 }
389
390 Self::Int64(value) => {
391 ::fidl_next::RawWireUnion::encode_as::<___E, &i64>(value, 3, encoder, raw)?
392 }
393
394 Self::Uint64(value) => {
395 ::fidl_next::RawWireUnion::encode_as::<___E, &u64>(value, 4, encoder, raw)?
396 }
397
398 Self::UnknownOrdinal_(ordinal) => {
399 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
400 }
401 }
402
403 Ok(())
404 }
405}
406
407impl ::fidl_next::EncodableOption for Data {
408 type EncodedOption = WireOptionalData<'static>;
409}
410
411unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Data
412where
413 ___E: ?Sized,
414 Data: ::fidl_next::Encode<___E>,
415{
416 #[inline]
417 fn encode_option(
418 this: Option<Self>,
419 encoder: &mut ___E,
420 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
421 ) -> Result<(), ::fidl_next::EncodeError> {
422 ::fidl_next::munge!(let WireOptionalData { raw, _phantom: _ } = &mut *out);
423
424 if let Some(inner) = this {
425 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
426 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
427 } else {
428 ::fidl_next::RawWireUnion::encode_absent(raw);
429 }
430
431 Ok(())
432 }
433}
434
435unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Data
436where
437 ___E: ?Sized,
438 Data: ::fidl_next::EncodeRef<___E>,
439{
440 #[inline]
441 fn encode_option_ref(
442 this: Option<&Self>,
443 encoder: &mut ___E,
444 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
445 ) -> Result<(), ::fidl_next::EncodeError> {
446 ::fidl_next::munge!(let WireOptionalData { raw, _phantom: _ } = &mut *out);
447
448 if let Some(inner) = this {
449 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
450 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
451 } else {
452 ::fidl_next::RawWireUnion::encode_absent(raw);
453 }
454
455 Ok(())
456 }
457}
458
459impl<'de> ::fidl_next::FromWire<WireData<'de>> for Data {
460 #[inline]
461 fn from_wire(wire: WireData<'de>) -> Self {
462 let wire = ::core::mem::ManuallyDrop::new(wire);
463 match wire.raw.ordinal() {
464 1 => Self::Bytes(::fidl_next::FromWire::from_wire(unsafe {
465 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
466 })),
467
468 2 => Self::String(::fidl_next::FromWire::from_wire(unsafe {
469 wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
470 })),
471
472 3 => Self::Int64(::fidl_next::FromWire::from_wire(unsafe {
473 wire.raw.get().read_unchecked::<::fidl_next::WireI64>()
474 })),
475
476 4 => Self::Uint64(::fidl_next::FromWire::from_wire(unsafe {
477 wire.raw.get().read_unchecked::<::fidl_next::WireU64>()
478 })),
479
480 _ => unsafe { ::core::hint::unreachable_unchecked() },
481 }
482 }
483}
484
485impl<'de> ::fidl_next::FromWireRef<WireData<'de>> for Data {
486 #[inline]
487 fn from_wire_ref(wire: &WireData<'de>) -> Self {
488 match wire.raw.ordinal() {
489 1 => Self::Bytes(::fidl_next::FromWireRef::from_wire_ref(unsafe {
490 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
491 })),
492
493 2 => Self::String(::fidl_next::FromWireRef::from_wire_ref(unsafe {
494 wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
495 })),
496
497 3 => Self::Int64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
498 wire.raw.get().deref_unchecked::<::fidl_next::WireI64>()
499 })),
500
501 4 => Self::Uint64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
502 wire.raw.get().deref_unchecked::<::fidl_next::WireU64>()
503 })),
504
505 _ => unsafe { ::core::hint::unreachable_unchecked() },
506 }
507 }
508}
509
510impl<'de> ::fidl_next::FromWireOption<WireOptionalData<'de>> for Box<Data> {
511 #[inline]
512 fn from_wire_option(wire: WireOptionalData<'de>) -> Option<Self> {
513 if let Some(inner) = wire.into_option() {
514 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
515 } else {
516 None
517 }
518 }
519}
520
521impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalData<'de>> for Box<Data> {
522 #[inline]
523 fn from_wire_option_ref(wire: &WireOptionalData<'de>) -> Option<Self> {
524 if let Some(inner) = wire.as_ref() {
525 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
526 } else {
527 None
528 }
529 }
530}
531
532#[repr(transparent)]
534pub struct WireData<'de> {
535 raw: ::fidl_next::RawWireUnion,
536 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
537}
538
539impl<'de> Drop for WireData<'de> {
540 fn drop(&mut self) {
541 match self.raw.ordinal() {
542 1 => {
543 let _ =
544 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
545 }
546
547 2 => {
548 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
549 }
550
551 3 => {
552 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI64>() };
553 }
554
555 4 => {
556 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU64>() };
557 }
558
559 _ => (),
560 }
561 }
562}
563
564unsafe impl ::fidl_next::Wire for WireData<'static> {
565 type Decoded<'de> = WireData<'de>;
566
567 #[inline]
568 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
569 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
570 ::fidl_next::RawWireUnion::zero_padding(raw);
571 }
572}
573
574pub mod data {
575 pub enum Ref<'de> {
576 Bytes(&'de ::fidl_next::WireVector<'de, u8>),
577
578 String(&'de ::fidl_next::WireString<'de>),
579
580 Int64(&'de ::fidl_next::WireI64),
581
582 Uint64(&'de ::fidl_next::WireU64),
583
584 UnknownOrdinal_(u64),
585 }
586}
587
588impl<'de> WireData<'de> {
589 pub fn as_ref(&self) -> crate::data::Ref<'_> {
590 match self.raw.ordinal() {
591 1 => crate::data::Ref::Bytes(unsafe {
592 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
593 }),
594
595 2 => crate::data::Ref::String(unsafe {
596 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
597 }),
598
599 3 => crate::data::Ref::Int64(unsafe {
600 self.raw.get().deref_unchecked::<::fidl_next::WireI64>()
601 }),
602
603 4 => crate::data::Ref::Uint64(unsafe {
604 self.raw.get().deref_unchecked::<::fidl_next::WireU64>()
605 }),
606
607 unknown => crate::data::Ref::UnknownOrdinal_(unknown),
608 }
609 }
610}
611
612unsafe impl<___D> ::fidl_next::Decode<___D> for WireData<'static>
613where
614 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
615
616 ___D: ::fidl_next::Decoder,
617{
618 fn decode(
619 mut slot: ::fidl_next::Slot<'_, Self>,
620 decoder: &mut ___D,
621 ) -> Result<(), ::fidl_next::DecodeError> {
622 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
623 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
624 1 => {
625 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
626 raw, decoder,
627 )?
628 }
629
630 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
631 raw, decoder,
632 )?,
633
634 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(raw, decoder)?,
635
636 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(raw, decoder)?,
637
638 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
639 }
640
641 Ok(())
642 }
643}
644
645impl<'de> ::core::fmt::Debug for WireData<'de> {
646 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
647 match self.raw.ordinal() {
648 1 => unsafe {
649 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
650 },
651 2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
652 3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI64>().fmt(f) },
653 4 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU64>().fmt(f) },
654 _ => unsafe { ::core::hint::unreachable_unchecked() },
655 }
656 }
657}
658
659#[repr(transparent)]
660pub struct WireOptionalData<'de> {
661 raw: ::fidl_next::RawWireUnion,
662 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
663}
664
665unsafe impl ::fidl_next::Wire for WireOptionalData<'static> {
666 type Decoded<'de> = WireOptionalData<'de>;
667
668 #[inline]
669 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
670 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
671 ::fidl_next::RawWireUnion::zero_padding(raw);
672 }
673}
674
675impl<'de> WireOptionalData<'de> {
676 pub fn is_some(&self) -> bool {
677 self.raw.is_some()
678 }
679
680 pub fn is_none(&self) -> bool {
681 self.raw.is_none()
682 }
683
684 pub fn as_ref(&self) -> Option<&WireData<'de>> {
685 if self.is_some() {
686 Some(unsafe { &*(self as *const Self).cast() })
687 } else {
688 None
689 }
690 }
691
692 pub fn into_option(self) -> Option<WireData<'de>> {
693 if self.is_some() {
694 Some(WireData { raw: self.raw, _phantom: ::core::marker::PhantomData })
695 } else {
696 None
697 }
698 }
699}
700
701unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalData<'static>
702where
703 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
704
705 ___D: ::fidl_next::Decoder,
706{
707 fn decode(
708 mut slot: ::fidl_next::Slot<'_, Self>,
709 decoder: &mut ___D,
710 ) -> Result<(), ::fidl_next::DecodeError> {
711 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
712 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
713 1 => {
714 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
715 raw, decoder,
716 )?
717 }
718
719 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
720 raw, decoder,
721 )?,
722
723 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(raw, decoder)?,
724
725 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(raw, decoder)?,
726
727 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
728 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
729 }
730
731 Ok(())
732 }
733}
734
735impl<'de> ::core::fmt::Debug for WireOptionalData<'de> {
736 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
737 self.as_ref().fmt(f)
738 }
739}
740
741#[doc = " A token represents a bedrock object. Tokens are reference counted, dropping\n all counts of the token removes the object.\n"]
742pub type Token = ::fidl_next::fuchsia::zx::Handle;
743
744pub type WireToken = ::fidl_next::fuchsia::WireHandle;
746
747#[derive(Debug)]
748#[repr(C)]
749pub struct DictionaryRef {
750 pub token: ::fidl_next::fuchsia::zx::Handle,
751}
752
753impl ::fidl_next::Encodable for DictionaryRef {
754 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDictionaryRef> = unsafe {
755 ::fidl_next::CopyOptimization::enable_if(
756 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
757 .is_enabled(),
758 )
759 };
760
761 type Encoded = WireDictionaryRef;
762}
763
764unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryRef
765where
766 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
767
768 ___E: ::fidl_next::fuchsia::HandleEncoder,
769{
770 #[inline]
771 fn encode(
772 self,
773 encoder: &mut ___E,
774 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
775 ) -> Result<(), ::fidl_next::EncodeError> {
776 ::fidl_next::munge! {
777 let Self::Encoded {
778 token,
779
780 } = out;
781 }
782
783 ::fidl_next::Encode::encode(self.token, encoder, token)?;
784
785 Ok(())
786 }
787}
788
789impl ::fidl_next::EncodableOption for DictionaryRef {
790 type EncodedOption = ::fidl_next::WireBox<'static, WireDictionaryRef>;
791}
792
793unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryRef
794where
795 ___E: ::fidl_next::Encoder + ?Sized,
796 DictionaryRef: ::fidl_next::Encode<___E>,
797{
798 #[inline]
799 fn encode_option(
800 this: Option<Self>,
801 encoder: &mut ___E,
802 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
803 ) -> Result<(), ::fidl_next::EncodeError> {
804 if let Some(inner) = this {
805 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
806 ::fidl_next::WireBox::encode_present(out);
807 } else {
808 ::fidl_next::WireBox::encode_absent(out);
809 }
810
811 Ok(())
812 }
813}
814
815impl ::fidl_next::FromWire<WireDictionaryRef> for DictionaryRef {
816 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDictionaryRef, Self> = unsafe {
817 ::fidl_next::CopyOptimization::enable_if(
818 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
819 ::fidl_next::fuchsia::WireHandle,
820 >>::COPY_OPTIMIZATION
821 .is_enabled(),
822 )
823 };
824
825 #[inline]
826 fn from_wire(wire: WireDictionaryRef) -> Self {
827 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
828 }
829}
830
831#[derive(Debug)]
833#[repr(C)]
834pub struct WireDictionaryRef {
835 pub token: ::fidl_next::fuchsia::WireHandle,
836}
837
838unsafe impl ::fidl_next::Wire for WireDictionaryRef {
839 type Decoded<'de> = WireDictionaryRef;
840
841 #[inline]
842 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
843}
844
845unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryRef
846where
847 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
848
849 ___D: ::fidl_next::fuchsia::HandleDecoder,
850{
851 fn decode(
852 slot: ::fidl_next::Slot<'_, Self>,
853 decoder: &mut ___D,
854 ) -> Result<(), ::fidl_next::DecodeError> {
855 ::fidl_next::munge! {
856 let Self {
857 mut token,
858
859 } = slot;
860 }
861
862 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
863
864 Ok(())
865 }
866}
867
868#[derive(Debug)]
869#[repr(C)]
870pub struct Connector {
871 pub token: ::fidl_next::fuchsia::zx::Handle,
872}
873
874impl ::fidl_next::Encodable for Connector {
875 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireConnector> = unsafe {
876 ::fidl_next::CopyOptimization::enable_if(
877 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
878 .is_enabled(),
879 )
880 };
881
882 type Encoded = WireConnector;
883}
884
885unsafe impl<___E> ::fidl_next::Encode<___E> for Connector
886where
887 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
888
889 ___E: ::fidl_next::fuchsia::HandleEncoder,
890{
891 #[inline]
892 fn encode(
893 self,
894 encoder: &mut ___E,
895 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
896 ) -> Result<(), ::fidl_next::EncodeError> {
897 ::fidl_next::munge! {
898 let Self::Encoded {
899 token,
900
901 } = out;
902 }
903
904 ::fidl_next::Encode::encode(self.token, encoder, token)?;
905
906 Ok(())
907 }
908}
909
910impl ::fidl_next::EncodableOption for Connector {
911 type EncodedOption = ::fidl_next::WireBox<'static, WireConnector>;
912}
913
914unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Connector
915where
916 ___E: ::fidl_next::Encoder + ?Sized,
917 Connector: ::fidl_next::Encode<___E>,
918{
919 #[inline]
920 fn encode_option(
921 this: Option<Self>,
922 encoder: &mut ___E,
923 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
924 ) -> Result<(), ::fidl_next::EncodeError> {
925 if let Some(inner) = this {
926 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
927 ::fidl_next::WireBox::encode_present(out);
928 } else {
929 ::fidl_next::WireBox::encode_absent(out);
930 }
931
932 Ok(())
933 }
934}
935
936impl ::fidl_next::FromWire<WireConnector> for Connector {
937 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireConnector, Self> = unsafe {
938 ::fidl_next::CopyOptimization::enable_if(
939 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
940 ::fidl_next::fuchsia::WireHandle,
941 >>::COPY_OPTIMIZATION
942 .is_enabled(),
943 )
944 };
945
946 #[inline]
947 fn from_wire(wire: WireConnector) -> Self {
948 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
949 }
950}
951
952#[derive(Debug)]
954#[repr(C)]
955pub struct WireConnector {
956 pub token: ::fidl_next::fuchsia::WireHandle,
957}
958
959unsafe impl ::fidl_next::Wire for WireConnector {
960 type Decoded<'de> = WireConnector;
961
962 #[inline]
963 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
964}
965
966unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnector
967where
968 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
969
970 ___D: ::fidl_next::fuchsia::HandleDecoder,
971{
972 fn decode(
973 slot: ::fidl_next::Slot<'_, Self>,
974 decoder: &mut ___D,
975 ) -> Result<(), ::fidl_next::DecodeError> {
976 ::fidl_next::munge! {
977 let Self {
978 mut token,
979
980 } = slot;
981 }
982
983 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
984
985 Ok(())
986 }
987}
988
989#[derive(Debug)]
990#[repr(C)]
991pub struct DirConnector {
992 pub token: ::fidl_next::fuchsia::zx::Handle,
993}
994
995impl ::fidl_next::Encodable for DirConnector {
996 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirConnector> = unsafe {
997 ::fidl_next::CopyOptimization::enable_if(
998 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
999 .is_enabled(),
1000 )
1001 };
1002
1003 type Encoded = WireDirConnector;
1004}
1005
1006unsafe impl<___E> ::fidl_next::Encode<___E> for DirConnector
1007where
1008 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1009
1010 ___E: ::fidl_next::fuchsia::HandleEncoder,
1011{
1012 #[inline]
1013 fn encode(
1014 self,
1015 encoder: &mut ___E,
1016 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1017 ) -> Result<(), ::fidl_next::EncodeError> {
1018 ::fidl_next::munge! {
1019 let Self::Encoded {
1020 token,
1021
1022 } = out;
1023 }
1024
1025 ::fidl_next::Encode::encode(self.token, encoder, token)?;
1026
1027 Ok(())
1028 }
1029}
1030
1031impl ::fidl_next::EncodableOption for DirConnector {
1032 type EncodedOption = ::fidl_next::WireBox<'static, WireDirConnector>;
1033}
1034
1035unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirConnector
1036where
1037 ___E: ::fidl_next::Encoder + ?Sized,
1038 DirConnector: ::fidl_next::Encode<___E>,
1039{
1040 #[inline]
1041 fn encode_option(
1042 this: Option<Self>,
1043 encoder: &mut ___E,
1044 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1045 ) -> Result<(), ::fidl_next::EncodeError> {
1046 if let Some(inner) = this {
1047 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1048 ::fidl_next::WireBox::encode_present(out);
1049 } else {
1050 ::fidl_next::WireBox::encode_absent(out);
1051 }
1052
1053 Ok(())
1054 }
1055}
1056
1057impl ::fidl_next::FromWire<WireDirConnector> for DirConnector {
1058 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirConnector, Self> = unsafe {
1059 ::fidl_next::CopyOptimization::enable_if(
1060 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
1061 ::fidl_next::fuchsia::WireHandle,
1062 >>::COPY_OPTIMIZATION
1063 .is_enabled(),
1064 )
1065 };
1066
1067 #[inline]
1068 fn from_wire(wire: WireDirConnector) -> Self {
1069 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
1070 }
1071}
1072
1073#[derive(Debug)]
1075#[repr(C)]
1076pub struct WireDirConnector {
1077 pub token: ::fidl_next::fuchsia::WireHandle,
1078}
1079
1080unsafe impl ::fidl_next::Wire for WireDirConnector {
1081 type Decoded<'de> = WireDirConnector;
1082
1083 #[inline]
1084 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1085}
1086
1087unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirConnector
1088where
1089 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1090
1091 ___D: ::fidl_next::fuchsia::HandleDecoder,
1092{
1093 fn decode(
1094 slot: ::fidl_next::Slot<'_, Self>,
1095 decoder: &mut ___D,
1096 ) -> Result<(), ::fidl_next::DecodeError> {
1097 ::fidl_next::munge! {
1098 let Self {
1099 mut token,
1100
1101 } = slot;
1102 }
1103
1104 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
1105
1106 Ok(())
1107 }
1108}
1109
1110#[derive(Debug)]
1111#[repr(C)]
1112pub struct DirEntry {
1113 pub token: ::fidl_next::fuchsia::zx::Handle,
1114}
1115
1116impl ::fidl_next::Encodable for DirEntry {
1117 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirEntry> = unsafe {
1118 ::fidl_next::CopyOptimization::enable_if(
1119 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
1120 .is_enabled(),
1121 )
1122 };
1123
1124 type Encoded = WireDirEntry;
1125}
1126
1127unsafe impl<___E> ::fidl_next::Encode<___E> for DirEntry
1128where
1129 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1130
1131 ___E: ::fidl_next::fuchsia::HandleEncoder,
1132{
1133 #[inline]
1134 fn encode(
1135 self,
1136 encoder: &mut ___E,
1137 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1138 ) -> Result<(), ::fidl_next::EncodeError> {
1139 ::fidl_next::munge! {
1140 let Self::Encoded {
1141 token,
1142
1143 } = out;
1144 }
1145
1146 ::fidl_next::Encode::encode(self.token, encoder, token)?;
1147
1148 Ok(())
1149 }
1150}
1151
1152impl ::fidl_next::EncodableOption for DirEntry {
1153 type EncodedOption = ::fidl_next::WireBox<'static, WireDirEntry>;
1154}
1155
1156unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirEntry
1157where
1158 ___E: ::fidl_next::Encoder + ?Sized,
1159 DirEntry: ::fidl_next::Encode<___E>,
1160{
1161 #[inline]
1162 fn encode_option(
1163 this: Option<Self>,
1164 encoder: &mut ___E,
1165 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1166 ) -> Result<(), ::fidl_next::EncodeError> {
1167 if let Some(inner) = this {
1168 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1169 ::fidl_next::WireBox::encode_present(out);
1170 } else {
1171 ::fidl_next::WireBox::encode_absent(out);
1172 }
1173
1174 Ok(())
1175 }
1176}
1177
1178impl ::fidl_next::FromWire<WireDirEntry> for DirEntry {
1179 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirEntry, Self> = unsafe {
1180 ::fidl_next::CopyOptimization::enable_if(
1181 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
1182 ::fidl_next::fuchsia::WireHandle,
1183 >>::COPY_OPTIMIZATION
1184 .is_enabled(),
1185 )
1186 };
1187
1188 #[inline]
1189 fn from_wire(wire: WireDirEntry) -> Self {
1190 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
1191 }
1192}
1193
1194#[derive(Debug)]
1196#[repr(C)]
1197pub struct WireDirEntry {
1198 pub token: ::fidl_next::fuchsia::WireHandle,
1199}
1200
1201unsafe impl ::fidl_next::Wire for WireDirEntry {
1202 type Decoded<'de> = WireDirEntry;
1203
1204 #[inline]
1205 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1206}
1207
1208unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirEntry
1209where
1210 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1211
1212 ___D: ::fidl_next::fuchsia::HandleDecoder,
1213{
1214 fn decode(
1215 slot: ::fidl_next::Slot<'_, Self>,
1216 decoder: &mut ___D,
1217 ) -> Result<(), ::fidl_next::DecodeError> {
1218 ::fidl_next::munge! {
1219 let Self {
1220 mut token,
1221
1222 } = slot;
1223 }
1224
1225 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
1226
1227 Ok(())
1228 }
1229}
1230
1231#[derive(Debug)]
1232pub enum Capability {
1233 Unit(crate::Unit),
1234
1235 Handle(::fidl_next::fuchsia::zx::Handle),
1236
1237 Data(crate::Data),
1238
1239 Dictionary(crate::DictionaryRef),
1240
1241 Connector(crate::Connector),
1242
1243 DirConnector(crate::DirConnector),
1244
1245 Directory(
1246 ::fidl_next::ClientEnd<
1247 ::fidl_next_fuchsia_io::Directory,
1248 ::fidl_next::fuchsia::zx::Channel,
1249 >,
1250 ),
1251
1252 DirEntry(crate::DirEntry),
1253
1254 ConnectorRouter(
1255 ::fidl_next::ClientEnd<crate::ConnectorRouter, ::fidl_next::fuchsia::zx::Channel>,
1256 ),
1257
1258 DictionaryRouter(
1259 ::fidl_next::ClientEnd<crate::DictionaryRouter, ::fidl_next::fuchsia::zx::Channel>,
1260 ),
1261
1262 DirEntryRouter(
1263 ::fidl_next::ClientEnd<crate::DirEntryRouter, ::fidl_next::fuchsia::zx::Channel>,
1264 ),
1265
1266 DataRouter(::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::zx::Channel>),
1267
1268 DirConnectorRouter(
1269 ::fidl_next::ClientEnd<crate::DirConnectorRouter, ::fidl_next::fuchsia::zx::Channel>,
1270 ),
1271
1272 UnknownOrdinal_(u64),
1273}
1274
1275impl ::fidl_next::Encodable for Capability {
1276 type Encoded = WireCapability<'static>;
1277}
1278
1279unsafe impl<___E> ::fidl_next::Encode<___E> for Capability
1280where
1281 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1282
1283 ___E: ::fidl_next::Encoder,
1284
1285 ___E: ::fidl_next::fuchsia::HandleEncoder,
1286{
1287 #[inline]
1288 fn encode(
1289 self,
1290 encoder: &mut ___E,
1291 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1292 ) -> Result<(), ::fidl_next::EncodeError> {
1293 ::fidl_next::munge!(let WireCapability { raw, _phantom: _ } = out);
1294
1295 match self {
1296 Self::Unit(value) => {
1297 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Unit>(value, 1, encoder, raw)?
1298 }
1299
1300 Self::Handle(value) => ::fidl_next::RawWireUnion::encode_as::<
1301 ___E,
1302 ::fidl_next::fuchsia::zx::Handle,
1303 >(value, 2, encoder, raw)?,
1304
1305 Self::Data(value) => {
1306 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Data>(value, 3, encoder, raw)?
1307 }
1308
1309 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
1310 ___E,
1311 crate::DictionaryRef,
1312 >(value, 4, encoder, raw)?,
1313
1314 Self::Connector(value) => {
1315 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Connector>(
1316 value, 5, encoder, raw,
1317 )?
1318 }
1319
1320 Self::DirConnector(value) => ::fidl_next::RawWireUnion::encode_as::<
1321 ___E,
1322 crate::DirConnector,
1323 >(value, 6, encoder, raw)?,
1324
1325 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
1326 ___E,
1327 ::fidl_next::ClientEnd<
1328 ::fidl_next_fuchsia_io::Directory,
1329 ::fidl_next::fuchsia::zx::Channel,
1330 >,
1331 >(value, 7, encoder, raw)?,
1332
1333 Self::DirEntry(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::DirEntry>(
1334 value, 8, encoder, raw,
1335 )?,
1336
1337 Self::ConnectorRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1338 ___E,
1339 ::fidl_next::ClientEnd<crate::ConnectorRouter, ::fidl_next::fuchsia::zx::Channel>,
1340 >(value, 9, encoder, raw)?,
1341
1342 Self::DictionaryRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1343 ___E,
1344 ::fidl_next::ClientEnd<crate::DictionaryRouter, ::fidl_next::fuchsia::zx::Channel>,
1345 >(value, 10, encoder, raw)?,
1346
1347 Self::DirEntryRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1348 ___E,
1349 ::fidl_next::ClientEnd<crate::DirEntryRouter, ::fidl_next::fuchsia::zx::Channel>,
1350 >(value, 11, encoder, raw)?,
1351
1352 Self::DataRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1353 ___E,
1354 ::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::zx::Channel>,
1355 >(value, 12, encoder, raw)?,
1356
1357 Self::DirConnectorRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1358 ___E,
1359 ::fidl_next::ClientEnd<
1360 crate::DirConnectorRouter,
1361 ::fidl_next::fuchsia::zx::Channel,
1362 >,
1363 >(value, 13, encoder, raw)?,
1364
1365 Self::UnknownOrdinal_(ordinal) => {
1366 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
1367 }
1368 }
1369
1370 Ok(())
1371 }
1372}
1373
1374impl ::fidl_next::EncodableOption for Capability {
1375 type EncodedOption = WireOptionalCapability<'static>;
1376}
1377
1378unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Capability
1379where
1380 ___E: ?Sized,
1381 Capability: ::fidl_next::Encode<___E>,
1382{
1383 #[inline]
1384 fn encode_option(
1385 this: Option<Self>,
1386 encoder: &mut ___E,
1387 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1388 ) -> Result<(), ::fidl_next::EncodeError> {
1389 ::fidl_next::munge!(let WireOptionalCapability { raw, _phantom: _ } = &mut *out);
1390
1391 if let Some(inner) = this {
1392 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1393 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
1394 } else {
1395 ::fidl_next::RawWireUnion::encode_absent(raw);
1396 }
1397
1398 Ok(())
1399 }
1400}
1401
1402impl<'de> ::fidl_next::FromWire<WireCapability<'de>> for Capability {
1403 #[inline]
1404 fn from_wire(wire: WireCapability<'de>) -> Self {
1405 let wire = ::core::mem::ManuallyDrop::new(wire);
1406 match wire.raw.ordinal() {
1407 1 => Self::Unit(::fidl_next::FromWire::from_wire(unsafe {
1408 wire.raw.get().read_unchecked::<crate::WireUnit>()
1409 })),
1410
1411 2 => Self::Handle(::fidl_next::FromWire::from_wire(unsafe {
1412 wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireHandle>()
1413 })),
1414
1415 3 => Self::Data(::fidl_next::FromWire::from_wire(unsafe {
1416 wire.raw.get().read_unchecked::<crate::WireData<'de>>()
1417 })),
1418
1419 4 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
1420 wire.raw.get().read_unchecked::<crate::WireDictionaryRef>()
1421 })),
1422
1423 5 => Self::Connector(::fidl_next::FromWire::from_wire(unsafe {
1424 wire.raw.get().read_unchecked::<crate::WireConnector>()
1425 })),
1426
1427 6 => Self::DirConnector(::fidl_next::FromWire::from_wire(unsafe {
1428 wire.raw.get().read_unchecked::<crate::WireDirConnector>()
1429 })),
1430
1431 7 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
1432 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1433 ::fidl_next_fuchsia_io::Directory,
1434 ::fidl_next::fuchsia::WireChannel,
1435 >>()
1436 })),
1437
1438 8 => Self::DirEntry(::fidl_next::FromWire::from_wire(unsafe {
1439 wire.raw.get().read_unchecked::<crate::WireDirEntry>()
1440 })),
1441
1442 9 => Self::ConnectorRouter(::fidl_next::FromWire::from_wire(unsafe {
1443 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1444 crate::ConnectorRouter,
1445 ::fidl_next::fuchsia::WireChannel,
1446 >>()
1447 })),
1448
1449 10 => Self::DictionaryRouter(::fidl_next::FromWire::from_wire(unsafe {
1450 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1451 crate::DictionaryRouter,
1452 ::fidl_next::fuchsia::WireChannel,
1453 >>()
1454 })),
1455
1456 11 => Self::DirEntryRouter(::fidl_next::FromWire::from_wire(unsafe {
1457 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<crate::DirEntryRouter, ::fidl_next::fuchsia::WireChannel>>()
1458 })),
1459
1460 12 => Self::DataRouter(::fidl_next::FromWire::from_wire(unsafe {
1461 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::WireChannel>>()
1462 })),
1463
1464 13 => Self::DirConnectorRouter(::fidl_next::FromWire::from_wire(unsafe {
1465 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1466 crate::DirConnectorRouter,
1467 ::fidl_next::fuchsia::WireChannel,
1468 >>()
1469 })),
1470
1471 _ => unsafe { ::core::hint::unreachable_unchecked() },
1472 }
1473 }
1474}
1475
1476impl<'de> ::fidl_next::FromWireOption<WireOptionalCapability<'de>> for Box<Capability> {
1477 #[inline]
1478 fn from_wire_option(wire: WireOptionalCapability<'de>) -> Option<Self> {
1479 if let Some(inner) = wire.into_option() {
1480 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
1481 } else {
1482 None
1483 }
1484 }
1485}
1486
1487#[repr(transparent)]
1489pub struct WireCapability<'de> {
1490 raw: ::fidl_next::RawWireUnion,
1491 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1492}
1493
1494impl<'de> Drop for WireCapability<'de> {
1495 fn drop(&mut self) {
1496 match self.raw.ordinal() {
1497 1 => {
1498 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
1499 }
1500
1501 2 => {
1502 let _ =
1503 unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireHandle>() };
1504 }
1505
1506 3 => {
1507 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireData<'de>>() };
1508 }
1509
1510 4 => {
1511 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDictionaryRef>() };
1512 }
1513
1514 5 => {
1515 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireConnector>() };
1516 }
1517
1518 6 => {
1519 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirConnector>() };
1520 }
1521
1522 7 => {
1523 let _ = unsafe {
1524 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1525 ::fidl_next_fuchsia_io::Directory,
1526 ::fidl_next::fuchsia::WireChannel,
1527 >>()
1528 };
1529 }
1530
1531 8 => {
1532 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirEntry>() };
1533 }
1534
1535 9 => {
1536 let _ = unsafe {
1537 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1538 crate::ConnectorRouter,
1539 ::fidl_next::fuchsia::WireChannel,
1540 >>()
1541 };
1542 }
1543
1544 10 => {
1545 let _ = unsafe {
1546 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1547 crate::DictionaryRouter,
1548 ::fidl_next::fuchsia::WireChannel,
1549 >>()
1550 };
1551 }
1552
1553 11 => {
1554 let _ = unsafe {
1555 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1556 crate::DirEntryRouter,
1557 ::fidl_next::fuchsia::WireChannel,
1558 >>()
1559 };
1560 }
1561
1562 12 => {
1563 let _ = unsafe {
1564 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::WireChannel>>()
1565 };
1566 }
1567
1568 13 => {
1569 let _ = unsafe {
1570 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1571 crate::DirConnectorRouter,
1572 ::fidl_next::fuchsia::WireChannel,
1573 >>()
1574 };
1575 }
1576
1577 _ => (),
1578 }
1579 }
1580}
1581
1582unsafe impl ::fidl_next::Wire for WireCapability<'static> {
1583 type Decoded<'de> = WireCapability<'de>;
1584
1585 #[inline]
1586 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1587 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1588 ::fidl_next::RawWireUnion::zero_padding(raw);
1589 }
1590}
1591
1592pub mod capability {
1593 pub enum Ref<'de> {
1594 Unit(&'de crate::WireUnit),
1595
1596 Handle(&'de ::fidl_next::fuchsia::WireHandle),
1597
1598 Data(&'de crate::WireData<'de>),
1599
1600 Dictionary(&'de crate::WireDictionaryRef),
1601
1602 Connector(&'de crate::WireConnector),
1603
1604 DirConnector(&'de crate::WireDirConnector),
1605
1606 Directory(
1607 &'de ::fidl_next::ClientEnd<
1608 ::fidl_next_fuchsia_io::Directory,
1609 ::fidl_next::fuchsia::WireChannel,
1610 >,
1611 ),
1612
1613 DirEntry(&'de crate::WireDirEntry),
1614
1615 ConnectorRouter(
1616 &'de ::fidl_next::ClientEnd<crate::ConnectorRouter, ::fidl_next::fuchsia::WireChannel>,
1617 ),
1618
1619 DictionaryRouter(
1620 &'de ::fidl_next::ClientEnd<crate::DictionaryRouter, ::fidl_next::fuchsia::WireChannel>,
1621 ),
1622
1623 DirEntryRouter(
1624 &'de ::fidl_next::ClientEnd<crate::DirEntryRouter, ::fidl_next::fuchsia::WireChannel>,
1625 ),
1626
1627 DataRouter(
1628 &'de ::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::WireChannel>,
1629 ),
1630
1631 DirConnectorRouter(
1632 &'de ::fidl_next::ClientEnd<
1633 crate::DirConnectorRouter,
1634 ::fidl_next::fuchsia::WireChannel,
1635 >,
1636 ),
1637
1638 UnknownOrdinal_(u64),
1639 }
1640}
1641
1642impl<'de> WireCapability<'de> {
1643 pub fn as_ref(&self) -> crate::capability::Ref<'_> {
1644 match self.raw.ordinal() {
1645 1 => crate::capability::Ref::Unit(unsafe {
1646 self.raw.get().deref_unchecked::<crate::WireUnit>()
1647 }),
1648
1649 2 => crate::capability::Ref::Handle(unsafe {
1650 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
1651 }),
1652
1653 3 => crate::capability::Ref::Data(unsafe {
1654 self.raw.get().deref_unchecked::<crate::WireData<'_>>()
1655 }),
1656
1657 4 => crate::capability::Ref::Dictionary(unsafe {
1658 self.raw.get().deref_unchecked::<crate::WireDictionaryRef>()
1659 }),
1660
1661 5 => crate::capability::Ref::Connector(unsafe {
1662 self.raw.get().deref_unchecked::<crate::WireConnector>()
1663 }),
1664
1665 6 => crate::capability::Ref::DirConnector(unsafe {
1666 self.raw.get().deref_unchecked::<crate::WireDirConnector>()
1667 }),
1668
1669 7 => crate::capability::Ref::Directory(unsafe {
1670 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
1671 ::fidl_next_fuchsia_io::Directory,
1672 ::fidl_next::fuchsia::WireChannel,
1673 >>()
1674 }),
1675
1676 8 => crate::capability::Ref::DirEntry(unsafe {
1677 self.raw.get().deref_unchecked::<crate::WireDirEntry>()
1678 }),
1679
1680 9 => crate::capability::Ref::ConnectorRouter(unsafe {
1681 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
1682 crate::ConnectorRouter,
1683 ::fidl_next::fuchsia::WireChannel,
1684 >>()
1685 }),
1686
1687 10 => crate::capability::Ref::DictionaryRouter(unsafe {
1688 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
1689 crate::DictionaryRouter,
1690 ::fidl_next::fuchsia::WireChannel,
1691 >>()
1692 }),
1693
1694 11 => crate::capability::Ref::DirEntryRouter(unsafe {
1695 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<crate::DirEntryRouter, ::fidl_next::fuchsia::WireChannel>>()
1696 }),
1697
1698 12 => crate::capability::Ref::DataRouter(unsafe {
1699 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::WireChannel>>()
1700 }),
1701
1702 13 => crate::capability::Ref::DirConnectorRouter(unsafe {
1703 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
1704 crate::DirConnectorRouter,
1705 ::fidl_next::fuchsia::WireChannel,
1706 >>()
1707 }),
1708
1709 unknown => crate::capability::Ref::UnknownOrdinal_(unknown),
1710 }
1711 }
1712}
1713
1714unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapability<'static>
1715where
1716 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1717
1718 ___D: ::fidl_next::Decoder,
1719
1720 ___D: ::fidl_next::fuchsia::HandleDecoder,
1721{
1722 fn decode(
1723 mut slot: ::fidl_next::Slot<'_, Self>,
1724 decoder: &mut ___D,
1725 ) -> Result<(), ::fidl_next::DecodeError> {
1726 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1727 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1728 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnit>(raw, decoder)?,
1729
1730 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
1731 raw, decoder,
1732 )?,
1733
1734 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireData<'static>>(
1735 raw, decoder,
1736 )?,
1737
1738 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionaryRef>(
1739 raw, decoder,
1740 )?,
1741
1742 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConnector>(raw, decoder)?,
1743
1744 6 => {
1745 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirConnector>(raw, decoder)?
1746 }
1747
1748 7 => ::fidl_next::RawWireUnion::decode_as::<
1749 ___D,
1750 ::fidl_next::ClientEnd<
1751 ::fidl_next_fuchsia_io::Directory,
1752 ::fidl_next::fuchsia::WireChannel,
1753 >,
1754 >(raw, decoder)?,
1755
1756 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirEntry>(raw, decoder)?,
1757
1758 9 => ::fidl_next::RawWireUnion::decode_as::<
1759 ___D,
1760 ::fidl_next::ClientEnd<crate::ConnectorRouter, ::fidl_next::fuchsia::WireChannel>,
1761 >(raw, decoder)?,
1762
1763 10 => ::fidl_next::RawWireUnion::decode_as::<
1764 ___D,
1765 ::fidl_next::ClientEnd<crate::DictionaryRouter, ::fidl_next::fuchsia::WireChannel>,
1766 >(raw, decoder)?,
1767
1768 11 => ::fidl_next::RawWireUnion::decode_as::<
1769 ___D,
1770 ::fidl_next::ClientEnd<crate::DirEntryRouter, ::fidl_next::fuchsia::WireChannel>,
1771 >(raw, decoder)?,
1772
1773 12 => ::fidl_next::RawWireUnion::decode_as::<
1774 ___D,
1775 ::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::WireChannel>,
1776 >(raw, decoder)?,
1777
1778 13 => ::fidl_next::RawWireUnion::decode_as::<
1779 ___D,
1780 ::fidl_next::ClientEnd<
1781 crate::DirConnectorRouter,
1782 ::fidl_next::fuchsia::WireChannel,
1783 >,
1784 >(raw, decoder)?,
1785
1786 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
1787 }
1788
1789 Ok(())
1790 }
1791}
1792
1793impl<'de> ::core::fmt::Debug for WireCapability<'de> {
1794 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1795 match self.raw.ordinal() {
1796 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
1797 2 => unsafe {
1798 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>().fmt(f)
1799 },
1800 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireData<'_>>().fmt(f) },
1801 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireDictionaryRef>().fmt(f) },
1802 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireConnector>().fmt(f) },
1803 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirConnector>().fmt(f) },
1804 7 => unsafe {
1805 self.raw
1806 .get()
1807 .deref_unchecked::<::fidl_next::ClientEnd<
1808 ::fidl_next_fuchsia_io::Directory,
1809 ::fidl_next::fuchsia::WireChannel,
1810 >>()
1811 .fmt(f)
1812 },
1813 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirEntry>().fmt(f) },
1814 9 => unsafe {
1815 self.raw
1816 .get()
1817 .deref_unchecked::<::fidl_next::ClientEnd<
1818 crate::ConnectorRouter,
1819 ::fidl_next::fuchsia::WireChannel,
1820 >>()
1821 .fmt(f)
1822 },
1823 10 => unsafe {
1824 self.raw
1825 .get()
1826 .deref_unchecked::<::fidl_next::ClientEnd<
1827 crate::DictionaryRouter,
1828 ::fidl_next::fuchsia::WireChannel,
1829 >>()
1830 .fmt(f)
1831 },
1832 11 => unsafe {
1833 self.raw.get().deref_unchecked::<
1834 ::fidl_next::ClientEnd<crate::DirEntryRouter, ::fidl_next::fuchsia::WireChannel>
1835 >().fmt(f)
1836 },
1837 12 => unsafe {
1838 self.raw.get().deref_unchecked::<
1839 ::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::WireChannel>
1840 >().fmt(f)
1841 },
1842 13 => unsafe {
1843 self.raw
1844 .get()
1845 .deref_unchecked::<::fidl_next::ClientEnd<
1846 crate::DirConnectorRouter,
1847 ::fidl_next::fuchsia::WireChannel,
1848 >>()
1849 .fmt(f)
1850 },
1851 _ => unsafe { ::core::hint::unreachable_unchecked() },
1852 }
1853 }
1854}
1855
1856#[repr(transparent)]
1857pub struct WireOptionalCapability<'de> {
1858 raw: ::fidl_next::RawWireUnion,
1859 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1860}
1861
1862unsafe impl ::fidl_next::Wire for WireOptionalCapability<'static> {
1863 type Decoded<'de> = WireOptionalCapability<'de>;
1864
1865 #[inline]
1866 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1867 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1868 ::fidl_next::RawWireUnion::zero_padding(raw);
1869 }
1870}
1871
1872impl<'de> WireOptionalCapability<'de> {
1873 pub fn is_some(&self) -> bool {
1874 self.raw.is_some()
1875 }
1876
1877 pub fn is_none(&self) -> bool {
1878 self.raw.is_none()
1879 }
1880
1881 pub fn as_ref(&self) -> Option<&WireCapability<'de>> {
1882 if self.is_some() {
1883 Some(unsafe { &*(self as *const Self).cast() })
1884 } else {
1885 None
1886 }
1887 }
1888
1889 pub fn into_option(self) -> Option<WireCapability<'de>> {
1890 if self.is_some() {
1891 Some(WireCapability { raw: self.raw, _phantom: ::core::marker::PhantomData })
1892 } else {
1893 None
1894 }
1895 }
1896}
1897
1898unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalCapability<'static>
1899where
1900 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1901
1902 ___D: ::fidl_next::Decoder,
1903
1904 ___D: ::fidl_next::fuchsia::HandleDecoder,
1905{
1906 fn decode(
1907 mut slot: ::fidl_next::Slot<'_, Self>,
1908 decoder: &mut ___D,
1909 ) -> Result<(), ::fidl_next::DecodeError> {
1910 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1911 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1912 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnit>(raw, decoder)?,
1913
1914 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
1915 raw, decoder,
1916 )?,
1917
1918 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireData<'static>>(
1919 raw, decoder,
1920 )?,
1921
1922 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionaryRef>(
1923 raw, decoder,
1924 )?,
1925
1926 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConnector>(raw, decoder)?,
1927
1928 6 => {
1929 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirConnector>(raw, decoder)?
1930 }
1931
1932 7 => ::fidl_next::RawWireUnion::decode_as::<
1933 ___D,
1934 ::fidl_next::ClientEnd<
1935 ::fidl_next_fuchsia_io::Directory,
1936 ::fidl_next::fuchsia::WireChannel,
1937 >,
1938 >(raw, decoder)?,
1939
1940 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirEntry>(raw, decoder)?,
1941
1942 9 => ::fidl_next::RawWireUnion::decode_as::<
1943 ___D,
1944 ::fidl_next::ClientEnd<crate::ConnectorRouter, ::fidl_next::fuchsia::WireChannel>,
1945 >(raw, decoder)?,
1946
1947 10 => ::fidl_next::RawWireUnion::decode_as::<
1948 ___D,
1949 ::fidl_next::ClientEnd<crate::DictionaryRouter, ::fidl_next::fuchsia::WireChannel>,
1950 >(raw, decoder)?,
1951
1952 11 => ::fidl_next::RawWireUnion::decode_as::<
1953 ___D,
1954 ::fidl_next::ClientEnd<crate::DirEntryRouter, ::fidl_next::fuchsia::WireChannel>,
1955 >(raw, decoder)?,
1956
1957 12 => ::fidl_next::RawWireUnion::decode_as::<
1958 ___D,
1959 ::fidl_next::ClientEnd<crate::DataRouter, ::fidl_next::fuchsia::WireChannel>,
1960 >(raw, decoder)?,
1961
1962 13 => ::fidl_next::RawWireUnion::decode_as::<
1963 ___D,
1964 ::fidl_next::ClientEnd<
1965 crate::DirConnectorRouter,
1966 ::fidl_next::fuchsia::WireChannel,
1967 >,
1968 >(raw, decoder)?,
1969
1970 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
1971 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
1972 }
1973
1974 Ok(())
1975 }
1976}
1977
1978impl<'de> ::core::fmt::Debug for WireOptionalCapability<'de> {
1979 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1980 self.as_ref().fmt(f)
1981 }
1982}
1983
1984#[doc = " A client-assigned id of a [Capability] in a [CapabilityStore].\n\n The id is relative to the [CapabilityStore]. In the case where two\n [CapabilityStore]s have a capability / assigned to the same id, there is\n no relation between them\n"]
1985pub type CapabilityId = u64;
1986
1987pub type WireCapabilityId = ::fidl_next::WireU64;
1989
1990#[doc = " A client-assigned id of a new [Capability] in a [CapabilityStore]. Same as [CapabilityId],\n but used to distinguish output parameters in [CapabilityStore] methods.\n"]
1991pub type NewCapabilityId = u64;
1992
1993pub type WireNewCapabilityId = ::fidl_next::WireU64;
1995
1996#[derive(Clone, Debug)]
1997#[repr(C)]
1998pub struct CapabilityStoreDuplicateRequest {
1999 pub id: u64,
2000
2001 pub dest_id: u64,
2002}
2003
2004impl ::fidl_next::Encodable for CapabilityStoreDuplicateRequest {
2005 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2006 Self,
2007 WireCapabilityStoreDuplicateRequest,
2008 > = unsafe {
2009 ::fidl_next::CopyOptimization::enable_if(
2010 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
2011 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2012 )
2013 };
2014
2015 type Encoded = WireCapabilityStoreDuplicateRequest;
2016}
2017
2018unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDuplicateRequest
2019where
2020 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2021{
2022 #[inline]
2023 fn encode(
2024 self,
2025 encoder: &mut ___E,
2026 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2027 ) -> Result<(), ::fidl_next::EncodeError> {
2028 ::fidl_next::munge! {
2029 let Self::Encoded {
2030 id,
2031 dest_id,
2032
2033 } = out;
2034 }
2035
2036 ::fidl_next::Encode::encode(self.id, encoder, id)?;
2037
2038 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
2039
2040 Ok(())
2041 }
2042}
2043
2044unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDuplicateRequest
2045where
2046 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2047{
2048 #[inline]
2049 fn encode_ref(
2050 &self,
2051 encoder: &mut ___E,
2052 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2053 ) -> Result<(), ::fidl_next::EncodeError> {
2054 ::fidl_next::munge! {
2055 let Self::Encoded {
2056 id,
2057 dest_id,
2058
2059 } = out;
2060 }
2061
2062 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
2063
2064 ::fidl_next::EncodeRef::encode_ref(&self.dest_id, encoder, dest_id)?;
2065
2066 Ok(())
2067 }
2068}
2069
2070impl ::fidl_next::EncodableOption for CapabilityStoreDuplicateRequest {
2071 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDuplicateRequest>;
2072}
2073
2074unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDuplicateRequest
2075where
2076 ___E: ::fidl_next::Encoder + ?Sized,
2077 CapabilityStoreDuplicateRequest: ::fidl_next::Encode<___E>,
2078{
2079 #[inline]
2080 fn encode_option(
2081 this: Option<Self>,
2082 encoder: &mut ___E,
2083 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2084 ) -> Result<(), ::fidl_next::EncodeError> {
2085 if let Some(inner) = this {
2086 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2087 ::fidl_next::WireBox::encode_present(out);
2088 } else {
2089 ::fidl_next::WireBox::encode_absent(out);
2090 }
2091
2092 Ok(())
2093 }
2094}
2095
2096unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDuplicateRequest
2097where
2098 ___E: ::fidl_next::Encoder + ?Sized,
2099 CapabilityStoreDuplicateRequest: ::fidl_next::EncodeRef<___E>,
2100{
2101 #[inline]
2102 fn encode_option_ref(
2103 this: Option<&Self>,
2104 encoder: &mut ___E,
2105 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2106 ) -> Result<(), ::fidl_next::EncodeError> {
2107 if let Some(inner) = this {
2108 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2109 ::fidl_next::WireBox::encode_present(out);
2110 } else {
2111 ::fidl_next::WireBox::encode_absent(out);
2112 }
2113
2114 Ok(())
2115 }
2116}
2117
2118impl ::fidl_next::FromWire<WireCapabilityStoreDuplicateRequest>
2119 for CapabilityStoreDuplicateRequest
2120{
2121 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2122 WireCapabilityStoreDuplicateRequest,
2123 Self,
2124 > = unsafe {
2125 ::fidl_next::CopyOptimization::enable_if(
2126 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2127 .is_enabled()
2128 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2129 .is_enabled(),
2130 )
2131 };
2132
2133 #[inline]
2134 fn from_wire(wire: WireCapabilityStoreDuplicateRequest) -> Self {
2135 Self {
2136 id: ::fidl_next::FromWire::from_wire(wire.id),
2137
2138 dest_id: ::fidl_next::FromWire::from_wire(wire.dest_id),
2139 }
2140 }
2141}
2142
2143impl ::fidl_next::FromWireRef<WireCapabilityStoreDuplicateRequest>
2144 for CapabilityStoreDuplicateRequest
2145{
2146 #[inline]
2147 fn from_wire_ref(wire: &WireCapabilityStoreDuplicateRequest) -> Self {
2148 Self {
2149 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
2150
2151 dest_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.dest_id),
2152 }
2153 }
2154}
2155
2156#[derive(Clone, Debug)]
2158#[repr(C)]
2159pub struct WireCapabilityStoreDuplicateRequest {
2160 pub id: ::fidl_next::WireU64,
2161
2162 pub dest_id: ::fidl_next::WireU64,
2163}
2164
2165unsafe impl ::fidl_next::Wire for WireCapabilityStoreDuplicateRequest {
2166 type Decoded<'de> = WireCapabilityStoreDuplicateRequest;
2167
2168 #[inline]
2169 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2170}
2171
2172unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDuplicateRequest
2173where
2174 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2175{
2176 fn decode(
2177 slot: ::fidl_next::Slot<'_, Self>,
2178 decoder: &mut ___D,
2179 ) -> Result<(), ::fidl_next::DecodeError> {
2180 ::fidl_next::munge! {
2181 let Self {
2182 mut id,
2183 mut dest_id,
2184
2185 } = slot;
2186 }
2187
2188 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
2189
2190 ::fidl_next::Decode::decode(dest_id.as_mut(), decoder)?;
2191
2192 Ok(())
2193 }
2194}
2195
2196pub type CapabilityStoreDuplicateResponse = ();
2197
2198pub type WireCapabilityStoreDuplicateResponse = ();
2200
2201#[doc = " Error returned from methods in [CapabilityStore].\n"]
2202#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2203#[repr(u32)]
2204pub enum CapabilityStoreError {
2205 IdNotFound = 1,
2206 IdAlreadyExists = 2,
2207 BadCapability = 3,
2208 WrongType = 4,
2209 NotDuplicatable = 5,
2210 ItemNotFound = 6,
2211 ItemAlreadyExists = 7,
2212 InvalidKey = 8,
2213 InvalidArgs = 9,
2214 UnknownOrdinal_(u32),
2215}
2216
2217impl ::fidl_next::Encodable for CapabilityStoreError {
2218 type Encoded = WireCapabilityStoreError;
2219}
2220impl ::std::convert::From<u32> for CapabilityStoreError {
2221 fn from(value: u32) -> Self {
2222 match value {
2223 1 => Self::IdNotFound,
2224 2 => Self::IdAlreadyExists,
2225 3 => Self::BadCapability,
2226 4 => Self::WrongType,
2227 5 => Self::NotDuplicatable,
2228 6 => Self::ItemNotFound,
2229 7 => Self::ItemAlreadyExists,
2230 8 => Self::InvalidKey,
2231 9 => Self::InvalidArgs,
2232
2233 _ => Self::UnknownOrdinal_(value),
2234 }
2235 }
2236}
2237
2238unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreError
2239where
2240 ___E: ?Sized,
2241{
2242 #[inline]
2243 fn encode(
2244 self,
2245 encoder: &mut ___E,
2246 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2247 ) -> Result<(), ::fidl_next::EncodeError> {
2248 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2249 }
2250}
2251
2252unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreError
2253where
2254 ___E: ?Sized,
2255{
2256 #[inline]
2257 fn encode_ref(
2258 &self,
2259 encoder: &mut ___E,
2260 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2261 ) -> Result<(), ::fidl_next::EncodeError> {
2262 ::fidl_next::munge!(let WireCapabilityStoreError { value } = out);
2263 let _ = value.write(::fidl_next::WireU32::from(match *self {
2264 Self::IdNotFound => 1,
2265
2266 Self::IdAlreadyExists => 2,
2267
2268 Self::BadCapability => 3,
2269
2270 Self::WrongType => 4,
2271
2272 Self::NotDuplicatable => 5,
2273
2274 Self::ItemNotFound => 6,
2275
2276 Self::ItemAlreadyExists => 7,
2277
2278 Self::InvalidKey => 8,
2279
2280 Self::InvalidArgs => 9,
2281
2282 Self::UnknownOrdinal_(value) => value,
2283 }));
2284
2285 Ok(())
2286 }
2287}
2288
2289impl ::core::convert::From<WireCapabilityStoreError> for CapabilityStoreError {
2290 fn from(wire: WireCapabilityStoreError) -> Self {
2291 match u32::from(wire.value) {
2292 1 => Self::IdNotFound,
2293
2294 2 => Self::IdAlreadyExists,
2295
2296 3 => Self::BadCapability,
2297
2298 4 => Self::WrongType,
2299
2300 5 => Self::NotDuplicatable,
2301
2302 6 => Self::ItemNotFound,
2303
2304 7 => Self::ItemAlreadyExists,
2305
2306 8 => Self::InvalidKey,
2307
2308 9 => Self::InvalidArgs,
2309
2310 value => Self::UnknownOrdinal_(value),
2311 }
2312 }
2313}
2314
2315impl ::fidl_next::FromWire<WireCapabilityStoreError> for CapabilityStoreError {
2316 #[inline]
2317 fn from_wire(wire: WireCapabilityStoreError) -> Self {
2318 Self::from(wire)
2319 }
2320}
2321
2322impl ::fidl_next::FromWireRef<WireCapabilityStoreError> for CapabilityStoreError {
2323 #[inline]
2324 fn from_wire_ref(wire: &WireCapabilityStoreError) -> Self {
2325 Self::from(*wire)
2326 }
2327}
2328
2329#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2331#[repr(transparent)]
2332pub struct WireCapabilityStoreError {
2333 value: ::fidl_next::WireU32,
2334}
2335
2336unsafe impl ::fidl_next::Wire for WireCapabilityStoreError {
2337 type Decoded<'de> = Self;
2338
2339 #[inline]
2340 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2341 }
2343}
2344
2345impl WireCapabilityStoreError {
2346 pub const ID_NOT_FOUND: WireCapabilityStoreError =
2347 WireCapabilityStoreError { value: ::fidl_next::WireU32(1) };
2348
2349 pub const ID_ALREADY_EXISTS: WireCapabilityStoreError =
2350 WireCapabilityStoreError { value: ::fidl_next::WireU32(2) };
2351
2352 pub const BAD_CAPABILITY: WireCapabilityStoreError =
2353 WireCapabilityStoreError { value: ::fidl_next::WireU32(3) };
2354
2355 pub const WRONG_TYPE: WireCapabilityStoreError =
2356 WireCapabilityStoreError { value: ::fidl_next::WireU32(4) };
2357
2358 pub const NOT_DUPLICATABLE: WireCapabilityStoreError =
2359 WireCapabilityStoreError { value: ::fidl_next::WireU32(5) };
2360
2361 pub const ITEM_NOT_FOUND: WireCapabilityStoreError =
2362 WireCapabilityStoreError { value: ::fidl_next::WireU32(6) };
2363
2364 pub const ITEM_ALREADY_EXISTS: WireCapabilityStoreError =
2365 WireCapabilityStoreError { value: ::fidl_next::WireU32(7) };
2366
2367 pub const INVALID_KEY: WireCapabilityStoreError =
2368 WireCapabilityStoreError { value: ::fidl_next::WireU32(8) };
2369
2370 pub const INVALID_ARGS: WireCapabilityStoreError =
2371 WireCapabilityStoreError { value: ::fidl_next::WireU32(9) };
2372}
2373
2374unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreError
2375where
2376 ___D: ?Sized,
2377{
2378 fn decode(
2379 slot: ::fidl_next::Slot<'_, Self>,
2380 _: &mut ___D,
2381 ) -> Result<(), ::fidl_next::DecodeError> {
2382 Ok(())
2383 }
2384}
2385
2386impl ::core::convert::From<CapabilityStoreError> for WireCapabilityStoreError {
2387 fn from(natural: CapabilityStoreError) -> Self {
2388 match natural {
2389 CapabilityStoreError::IdNotFound => WireCapabilityStoreError::ID_NOT_FOUND,
2390
2391 CapabilityStoreError::IdAlreadyExists => WireCapabilityStoreError::ID_ALREADY_EXISTS,
2392
2393 CapabilityStoreError::BadCapability => WireCapabilityStoreError::BAD_CAPABILITY,
2394
2395 CapabilityStoreError::WrongType => WireCapabilityStoreError::WRONG_TYPE,
2396
2397 CapabilityStoreError::NotDuplicatable => WireCapabilityStoreError::NOT_DUPLICATABLE,
2398
2399 CapabilityStoreError::ItemNotFound => WireCapabilityStoreError::ITEM_NOT_FOUND,
2400
2401 CapabilityStoreError::ItemAlreadyExists => {
2402 WireCapabilityStoreError::ITEM_ALREADY_EXISTS
2403 }
2404
2405 CapabilityStoreError::InvalidKey => WireCapabilityStoreError::INVALID_KEY,
2406
2407 CapabilityStoreError::InvalidArgs => WireCapabilityStoreError::INVALID_ARGS,
2408
2409 CapabilityStoreError::UnknownOrdinal_(value) => {
2410 WireCapabilityStoreError { value: ::fidl_next::WireU32::from(value) }
2411 }
2412 }
2413 }
2414}
2415
2416#[derive(Clone, Debug)]
2417#[repr(C)]
2418pub struct CapabilityStoreDropRequest {
2419 pub id: u64,
2420}
2421
2422impl ::fidl_next::Encodable for CapabilityStoreDropRequest {
2423 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCapabilityStoreDropRequest> = unsafe {
2424 ::fidl_next::CopyOptimization::enable_if(
2425 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2426 )
2427 };
2428
2429 type Encoded = WireCapabilityStoreDropRequest;
2430}
2431
2432unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDropRequest
2433where
2434 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2435{
2436 #[inline]
2437 fn encode(
2438 self,
2439 encoder: &mut ___E,
2440 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2441 ) -> Result<(), ::fidl_next::EncodeError> {
2442 ::fidl_next::munge! {
2443 let Self::Encoded {
2444 id,
2445
2446 } = out;
2447 }
2448
2449 ::fidl_next::Encode::encode(self.id, encoder, id)?;
2450
2451 Ok(())
2452 }
2453}
2454
2455unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDropRequest
2456where
2457 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2458{
2459 #[inline]
2460 fn encode_ref(
2461 &self,
2462 encoder: &mut ___E,
2463 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2464 ) -> Result<(), ::fidl_next::EncodeError> {
2465 ::fidl_next::munge! {
2466 let Self::Encoded {
2467 id,
2468
2469 } = out;
2470 }
2471
2472 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
2473
2474 Ok(())
2475 }
2476}
2477
2478impl ::fidl_next::EncodableOption for CapabilityStoreDropRequest {
2479 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDropRequest>;
2480}
2481
2482unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDropRequest
2483where
2484 ___E: ::fidl_next::Encoder + ?Sized,
2485 CapabilityStoreDropRequest: ::fidl_next::Encode<___E>,
2486{
2487 #[inline]
2488 fn encode_option(
2489 this: Option<Self>,
2490 encoder: &mut ___E,
2491 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2492 ) -> Result<(), ::fidl_next::EncodeError> {
2493 if let Some(inner) = this {
2494 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2495 ::fidl_next::WireBox::encode_present(out);
2496 } else {
2497 ::fidl_next::WireBox::encode_absent(out);
2498 }
2499
2500 Ok(())
2501 }
2502}
2503
2504unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDropRequest
2505where
2506 ___E: ::fidl_next::Encoder + ?Sized,
2507 CapabilityStoreDropRequest: ::fidl_next::EncodeRef<___E>,
2508{
2509 #[inline]
2510 fn encode_option_ref(
2511 this: Option<&Self>,
2512 encoder: &mut ___E,
2513 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2514 ) -> Result<(), ::fidl_next::EncodeError> {
2515 if let Some(inner) = this {
2516 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2517 ::fidl_next::WireBox::encode_present(out);
2518 } else {
2519 ::fidl_next::WireBox::encode_absent(out);
2520 }
2521
2522 Ok(())
2523 }
2524}
2525
2526impl ::fidl_next::FromWire<WireCapabilityStoreDropRequest> for CapabilityStoreDropRequest {
2527 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCapabilityStoreDropRequest, Self> = unsafe {
2528 ::fidl_next::CopyOptimization::enable_if(
2529 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2530 .is_enabled(),
2531 )
2532 };
2533
2534 #[inline]
2535 fn from_wire(wire: WireCapabilityStoreDropRequest) -> Self {
2536 Self { id: ::fidl_next::FromWire::from_wire(wire.id) }
2537 }
2538}
2539
2540impl ::fidl_next::FromWireRef<WireCapabilityStoreDropRequest> for CapabilityStoreDropRequest {
2541 #[inline]
2542 fn from_wire_ref(wire: &WireCapabilityStoreDropRequest) -> Self {
2543 Self { id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id) }
2544 }
2545}
2546
2547#[derive(Clone, Debug)]
2549#[repr(C)]
2550pub struct WireCapabilityStoreDropRequest {
2551 pub id: ::fidl_next::WireU64,
2552}
2553
2554unsafe impl ::fidl_next::Wire for WireCapabilityStoreDropRequest {
2555 type Decoded<'de> = WireCapabilityStoreDropRequest;
2556
2557 #[inline]
2558 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2559}
2560
2561unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDropRequest
2562where
2563 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2564{
2565 fn decode(
2566 slot: ::fidl_next::Slot<'_, Self>,
2567 decoder: &mut ___D,
2568 ) -> Result<(), ::fidl_next::DecodeError> {
2569 ::fidl_next::munge! {
2570 let Self {
2571 mut id,
2572
2573 } = slot;
2574 }
2575
2576 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
2577
2578 Ok(())
2579 }
2580}
2581
2582pub type CapabilityStoreDropResponse = ();
2583
2584pub type WireCapabilityStoreDropResponse = ();
2586
2587#[derive(Clone, Debug)]
2588#[repr(C)]
2589pub struct CapabilityStoreExportRequest {
2590 pub id: u64,
2591}
2592
2593impl ::fidl_next::Encodable for CapabilityStoreExportRequest {
2594 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCapabilityStoreExportRequest> = unsafe {
2595 ::fidl_next::CopyOptimization::enable_if(
2596 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2597 )
2598 };
2599
2600 type Encoded = WireCapabilityStoreExportRequest;
2601}
2602
2603unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreExportRequest
2604where
2605 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2606{
2607 #[inline]
2608 fn encode(
2609 self,
2610 encoder: &mut ___E,
2611 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2612 ) -> Result<(), ::fidl_next::EncodeError> {
2613 ::fidl_next::munge! {
2614 let Self::Encoded {
2615 id,
2616
2617 } = out;
2618 }
2619
2620 ::fidl_next::Encode::encode(self.id, encoder, id)?;
2621
2622 Ok(())
2623 }
2624}
2625
2626unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreExportRequest
2627where
2628 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2629{
2630 #[inline]
2631 fn encode_ref(
2632 &self,
2633 encoder: &mut ___E,
2634 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2635 ) -> Result<(), ::fidl_next::EncodeError> {
2636 ::fidl_next::munge! {
2637 let Self::Encoded {
2638 id,
2639
2640 } = out;
2641 }
2642
2643 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
2644
2645 Ok(())
2646 }
2647}
2648
2649impl ::fidl_next::EncodableOption for CapabilityStoreExportRequest {
2650 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreExportRequest>;
2651}
2652
2653unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreExportRequest
2654where
2655 ___E: ::fidl_next::Encoder + ?Sized,
2656 CapabilityStoreExportRequest: ::fidl_next::Encode<___E>,
2657{
2658 #[inline]
2659 fn encode_option(
2660 this: Option<Self>,
2661 encoder: &mut ___E,
2662 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2663 ) -> Result<(), ::fidl_next::EncodeError> {
2664 if let Some(inner) = this {
2665 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2666 ::fidl_next::WireBox::encode_present(out);
2667 } else {
2668 ::fidl_next::WireBox::encode_absent(out);
2669 }
2670
2671 Ok(())
2672 }
2673}
2674
2675unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreExportRequest
2676where
2677 ___E: ::fidl_next::Encoder + ?Sized,
2678 CapabilityStoreExportRequest: ::fidl_next::EncodeRef<___E>,
2679{
2680 #[inline]
2681 fn encode_option_ref(
2682 this: Option<&Self>,
2683 encoder: &mut ___E,
2684 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2685 ) -> Result<(), ::fidl_next::EncodeError> {
2686 if let Some(inner) = this {
2687 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2688 ::fidl_next::WireBox::encode_present(out);
2689 } else {
2690 ::fidl_next::WireBox::encode_absent(out);
2691 }
2692
2693 Ok(())
2694 }
2695}
2696
2697impl ::fidl_next::FromWire<WireCapabilityStoreExportRequest> for CapabilityStoreExportRequest {
2698 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCapabilityStoreExportRequest, Self> = unsafe {
2699 ::fidl_next::CopyOptimization::enable_if(
2700 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2701 .is_enabled(),
2702 )
2703 };
2704
2705 #[inline]
2706 fn from_wire(wire: WireCapabilityStoreExportRequest) -> Self {
2707 Self { id: ::fidl_next::FromWire::from_wire(wire.id) }
2708 }
2709}
2710
2711impl ::fidl_next::FromWireRef<WireCapabilityStoreExportRequest> for CapabilityStoreExportRequest {
2712 #[inline]
2713 fn from_wire_ref(wire: &WireCapabilityStoreExportRequest) -> Self {
2714 Self { id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id) }
2715 }
2716}
2717
2718#[derive(Clone, Debug)]
2720#[repr(C)]
2721pub struct WireCapabilityStoreExportRequest {
2722 pub id: ::fidl_next::WireU64,
2723}
2724
2725unsafe impl ::fidl_next::Wire for WireCapabilityStoreExportRequest {
2726 type Decoded<'de> = WireCapabilityStoreExportRequest;
2727
2728 #[inline]
2729 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2730}
2731
2732unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreExportRequest
2733where
2734 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2735{
2736 fn decode(
2737 slot: ::fidl_next::Slot<'_, Self>,
2738 decoder: &mut ___D,
2739 ) -> Result<(), ::fidl_next::DecodeError> {
2740 ::fidl_next::munge! {
2741 let Self {
2742 mut id,
2743
2744 } = slot;
2745 }
2746
2747 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
2748
2749 Ok(())
2750 }
2751}
2752
2753#[derive(Debug)]
2754pub struct CapabilityStoreExportResponse {
2755 pub capability: crate::Capability,
2756}
2757
2758impl ::fidl_next::Encodable for CapabilityStoreExportResponse {
2759 type Encoded = WireCapabilityStoreExportResponse<'static>;
2760}
2761
2762unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreExportResponse
2763where
2764 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2765
2766 ___E: ::fidl_next::Encoder,
2767
2768 ___E: ::fidl_next::fuchsia::HandleEncoder,
2769{
2770 #[inline]
2771 fn encode(
2772 self,
2773 encoder: &mut ___E,
2774 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2775 ) -> Result<(), ::fidl_next::EncodeError> {
2776 ::fidl_next::munge! {
2777 let Self::Encoded {
2778 capability,
2779
2780 } = out;
2781 }
2782
2783 ::fidl_next::Encode::encode(self.capability, encoder, capability)?;
2784
2785 Ok(())
2786 }
2787}
2788
2789impl ::fidl_next::EncodableOption for CapabilityStoreExportResponse {
2790 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreExportResponse<'static>>;
2791}
2792
2793unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreExportResponse
2794where
2795 ___E: ::fidl_next::Encoder + ?Sized,
2796 CapabilityStoreExportResponse: ::fidl_next::Encode<___E>,
2797{
2798 #[inline]
2799 fn encode_option(
2800 this: Option<Self>,
2801 encoder: &mut ___E,
2802 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2803 ) -> Result<(), ::fidl_next::EncodeError> {
2804 if let Some(inner) = this {
2805 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2806 ::fidl_next::WireBox::encode_present(out);
2807 } else {
2808 ::fidl_next::WireBox::encode_absent(out);
2809 }
2810
2811 Ok(())
2812 }
2813}
2814
2815impl<'de> ::fidl_next::FromWire<WireCapabilityStoreExportResponse<'de>>
2816 for CapabilityStoreExportResponse
2817{
2818 #[inline]
2819 fn from_wire(wire: WireCapabilityStoreExportResponse<'de>) -> Self {
2820 Self { capability: ::fidl_next::FromWire::from_wire(wire.capability) }
2821 }
2822}
2823
2824#[derive(Debug)]
2826#[repr(C)]
2827pub struct WireCapabilityStoreExportResponse<'de> {
2828 pub capability: crate::WireCapability<'de>,
2829}
2830
2831unsafe impl ::fidl_next::Wire for WireCapabilityStoreExportResponse<'static> {
2832 type Decoded<'de> = WireCapabilityStoreExportResponse<'de>;
2833
2834 #[inline]
2835 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2836}
2837
2838unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreExportResponse<'static>
2839where
2840 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2841
2842 ___D: ::fidl_next::Decoder,
2843
2844 ___D: ::fidl_next::fuchsia::HandleDecoder,
2845{
2846 fn decode(
2847 slot: ::fidl_next::Slot<'_, Self>,
2848 decoder: &mut ___D,
2849 ) -> Result<(), ::fidl_next::DecodeError> {
2850 ::fidl_next::munge! {
2851 let Self {
2852 mut capability,
2853
2854 } = slot;
2855 }
2856
2857 ::fidl_next::Decode::decode(capability.as_mut(), decoder)?;
2858
2859 Ok(())
2860 }
2861}
2862
2863#[derive(Debug)]
2864pub struct CapabilityStoreImportRequest {
2865 pub id: u64,
2866
2867 pub capability: crate::Capability,
2868}
2869
2870impl ::fidl_next::Encodable for CapabilityStoreImportRequest {
2871 type Encoded = WireCapabilityStoreImportRequest<'static>;
2872}
2873
2874unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreImportRequest
2875where
2876 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2877
2878 ___E: ::fidl_next::Encoder,
2879
2880 ___E: ::fidl_next::fuchsia::HandleEncoder,
2881{
2882 #[inline]
2883 fn encode(
2884 self,
2885 encoder: &mut ___E,
2886 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2887 ) -> Result<(), ::fidl_next::EncodeError> {
2888 ::fidl_next::munge! {
2889 let Self::Encoded {
2890 id,
2891 capability,
2892
2893 } = out;
2894 }
2895
2896 ::fidl_next::Encode::encode(self.id, encoder, id)?;
2897
2898 ::fidl_next::Encode::encode(self.capability, encoder, capability)?;
2899
2900 Ok(())
2901 }
2902}
2903
2904impl ::fidl_next::EncodableOption for CapabilityStoreImportRequest {
2905 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreImportRequest<'static>>;
2906}
2907
2908unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreImportRequest
2909where
2910 ___E: ::fidl_next::Encoder + ?Sized,
2911 CapabilityStoreImportRequest: ::fidl_next::Encode<___E>,
2912{
2913 #[inline]
2914 fn encode_option(
2915 this: Option<Self>,
2916 encoder: &mut ___E,
2917 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2918 ) -> Result<(), ::fidl_next::EncodeError> {
2919 if let Some(inner) = this {
2920 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2921 ::fidl_next::WireBox::encode_present(out);
2922 } else {
2923 ::fidl_next::WireBox::encode_absent(out);
2924 }
2925
2926 Ok(())
2927 }
2928}
2929
2930impl<'de> ::fidl_next::FromWire<WireCapabilityStoreImportRequest<'de>>
2931 for CapabilityStoreImportRequest
2932{
2933 #[inline]
2934 fn from_wire(wire: WireCapabilityStoreImportRequest<'de>) -> Self {
2935 Self {
2936 id: ::fidl_next::FromWire::from_wire(wire.id),
2937
2938 capability: ::fidl_next::FromWire::from_wire(wire.capability),
2939 }
2940 }
2941}
2942
2943#[derive(Debug)]
2945#[repr(C)]
2946pub struct WireCapabilityStoreImportRequest<'de> {
2947 pub id: ::fidl_next::WireU64,
2948
2949 pub capability: crate::WireCapability<'de>,
2950}
2951
2952unsafe impl ::fidl_next::Wire for WireCapabilityStoreImportRequest<'static> {
2953 type Decoded<'de> = WireCapabilityStoreImportRequest<'de>;
2954
2955 #[inline]
2956 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2957}
2958
2959unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreImportRequest<'static>
2960where
2961 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2962
2963 ___D: ::fidl_next::Decoder,
2964
2965 ___D: ::fidl_next::fuchsia::HandleDecoder,
2966{
2967 fn decode(
2968 slot: ::fidl_next::Slot<'_, Self>,
2969 decoder: &mut ___D,
2970 ) -> Result<(), ::fidl_next::DecodeError> {
2971 ::fidl_next::munge! {
2972 let Self {
2973 mut id,
2974 mut capability,
2975
2976 } = slot;
2977 }
2978
2979 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
2980
2981 ::fidl_next::Decode::decode(capability.as_mut(), decoder)?;
2982
2983 Ok(())
2984 }
2985}
2986
2987pub type CapabilityStoreImportResponse = ();
2988
2989pub type WireCapabilityStoreImportResponse = ();
2991
2992#[derive(Debug)]
2993pub struct CapabilityStoreConnectorCreateRequest {
2994 pub id: u64,
2995
2996 pub receiver: ::fidl_next::ClientEnd<crate::Receiver, ::fidl_next::fuchsia::zx::Channel>,
2997}
2998
2999impl ::fidl_next::Encodable for CapabilityStoreConnectorCreateRequest {
3000 type Encoded = WireCapabilityStoreConnectorCreateRequest;
3001}
3002
3003unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreConnectorCreateRequest
3004where
3005 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3006
3007 ___E: ::fidl_next::fuchsia::HandleEncoder,
3008{
3009 #[inline]
3010 fn encode(
3011 self,
3012 encoder: &mut ___E,
3013 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3014 ) -> Result<(), ::fidl_next::EncodeError> {
3015 ::fidl_next::munge! {
3016 let Self::Encoded {
3017 id,
3018 receiver,
3019
3020 } = out;
3021 }
3022
3023 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3024
3025 ::fidl_next::Encode::encode(self.receiver, encoder, receiver)?;
3026
3027 Ok(())
3028 }
3029}
3030
3031impl ::fidl_next::EncodableOption for CapabilityStoreConnectorCreateRequest {
3032 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreConnectorCreateRequest>;
3033}
3034
3035unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreConnectorCreateRequest
3036where
3037 ___E: ::fidl_next::Encoder + ?Sized,
3038 CapabilityStoreConnectorCreateRequest: ::fidl_next::Encode<___E>,
3039{
3040 #[inline]
3041 fn encode_option(
3042 this: Option<Self>,
3043 encoder: &mut ___E,
3044 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3045 ) -> Result<(), ::fidl_next::EncodeError> {
3046 if let Some(inner) = this {
3047 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3048 ::fidl_next::WireBox::encode_present(out);
3049 } else {
3050 ::fidl_next::WireBox::encode_absent(out);
3051 }
3052
3053 Ok(())
3054 }
3055}
3056
3057impl ::fidl_next::FromWire<WireCapabilityStoreConnectorCreateRequest>
3058 for CapabilityStoreConnectorCreateRequest
3059{
3060 #[inline]
3061 fn from_wire(wire: WireCapabilityStoreConnectorCreateRequest) -> Self {
3062 Self {
3063 id: ::fidl_next::FromWire::from_wire(wire.id),
3064
3065 receiver: ::fidl_next::FromWire::from_wire(wire.receiver),
3066 }
3067 }
3068}
3069
3070#[derive(Debug)]
3072#[repr(C)]
3073pub struct WireCapabilityStoreConnectorCreateRequest {
3074 pub id: ::fidl_next::WireU64,
3075
3076 pub receiver: ::fidl_next::ClientEnd<crate::Receiver, ::fidl_next::fuchsia::WireChannel>,
3077}
3078
3079unsafe impl ::fidl_next::Wire for WireCapabilityStoreConnectorCreateRequest {
3080 type Decoded<'de> = WireCapabilityStoreConnectorCreateRequest;
3081
3082 #[inline]
3083 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3084 unsafe {
3085 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3086 }
3087 }
3088}
3089
3090unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreConnectorCreateRequest
3091where
3092 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3093
3094 ___D: ::fidl_next::fuchsia::HandleDecoder,
3095{
3096 fn decode(
3097 slot: ::fidl_next::Slot<'_, Self>,
3098 decoder: &mut ___D,
3099 ) -> Result<(), ::fidl_next::DecodeError> {
3100 ::fidl_next::munge! {
3101 let Self {
3102 mut id,
3103 mut receiver,
3104
3105 } = slot;
3106 }
3107
3108 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3109
3110 ::fidl_next::Decode::decode(receiver.as_mut(), decoder)?;
3111
3112 Ok(())
3113 }
3114}
3115
3116pub type CapabilityStoreConnectorCreateResponse = ();
3117
3118pub type WireCapabilityStoreConnectorCreateResponse = ();
3120
3121#[derive(Debug)]
3122pub struct CapabilityStoreConnectorOpenRequest {
3123 pub id: u64,
3124
3125 pub server_end: ::fidl_next::fuchsia::zx::Handle,
3126}
3127
3128impl ::fidl_next::Encodable for CapabilityStoreConnectorOpenRequest {
3129 type Encoded = WireCapabilityStoreConnectorOpenRequest;
3130}
3131
3132unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreConnectorOpenRequest
3133where
3134 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3135
3136 ___E: ::fidl_next::fuchsia::HandleEncoder,
3137{
3138 #[inline]
3139 fn encode(
3140 self,
3141 encoder: &mut ___E,
3142 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3143 ) -> Result<(), ::fidl_next::EncodeError> {
3144 ::fidl_next::munge! {
3145 let Self::Encoded {
3146 id,
3147 server_end,
3148
3149 } = out;
3150 }
3151
3152 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3153
3154 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
3155
3156 Ok(())
3157 }
3158}
3159
3160impl ::fidl_next::EncodableOption for CapabilityStoreConnectorOpenRequest {
3161 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreConnectorOpenRequest>;
3162}
3163
3164unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreConnectorOpenRequest
3165where
3166 ___E: ::fidl_next::Encoder + ?Sized,
3167 CapabilityStoreConnectorOpenRequest: ::fidl_next::Encode<___E>,
3168{
3169 #[inline]
3170 fn encode_option(
3171 this: Option<Self>,
3172 encoder: &mut ___E,
3173 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3174 ) -> Result<(), ::fidl_next::EncodeError> {
3175 if let Some(inner) = this {
3176 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3177 ::fidl_next::WireBox::encode_present(out);
3178 } else {
3179 ::fidl_next::WireBox::encode_absent(out);
3180 }
3181
3182 Ok(())
3183 }
3184}
3185
3186impl ::fidl_next::FromWire<WireCapabilityStoreConnectorOpenRequest>
3187 for CapabilityStoreConnectorOpenRequest
3188{
3189 #[inline]
3190 fn from_wire(wire: WireCapabilityStoreConnectorOpenRequest) -> Self {
3191 Self {
3192 id: ::fidl_next::FromWire::from_wire(wire.id),
3193
3194 server_end: ::fidl_next::FromWire::from_wire(wire.server_end),
3195 }
3196 }
3197}
3198
3199#[derive(Debug)]
3201#[repr(C)]
3202pub struct WireCapabilityStoreConnectorOpenRequest {
3203 pub id: ::fidl_next::WireU64,
3204
3205 pub server_end: ::fidl_next::fuchsia::WireHandle,
3206}
3207
3208unsafe impl ::fidl_next::Wire for WireCapabilityStoreConnectorOpenRequest {
3209 type Decoded<'de> = WireCapabilityStoreConnectorOpenRequest;
3210
3211 #[inline]
3212 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3213 unsafe {
3214 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3215 }
3216 }
3217}
3218
3219unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreConnectorOpenRequest
3220where
3221 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3222
3223 ___D: ::fidl_next::fuchsia::HandleDecoder,
3224{
3225 fn decode(
3226 slot: ::fidl_next::Slot<'_, Self>,
3227 decoder: &mut ___D,
3228 ) -> Result<(), ::fidl_next::DecodeError> {
3229 ::fidl_next::munge! {
3230 let Self {
3231 mut id,
3232 mut server_end,
3233
3234 } = slot;
3235 }
3236
3237 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3238
3239 ::fidl_next::Decode::decode(server_end.as_mut(), decoder)?;
3240
3241 Ok(())
3242 }
3243}
3244
3245pub type CapabilityStoreConnectorOpenResponse = ();
3246
3247pub type WireCapabilityStoreConnectorOpenResponse = ();
3249
3250#[derive(Debug)]
3251pub struct CapabilityStoreDirConnectorCreateRequest {
3252 pub id: u64,
3253
3254 pub receiver: ::fidl_next::ClientEnd<crate::DirReceiver, ::fidl_next::fuchsia::zx::Channel>,
3255}
3256
3257impl ::fidl_next::Encodable for CapabilityStoreDirConnectorCreateRequest {
3258 type Encoded = WireCapabilityStoreDirConnectorCreateRequest;
3259}
3260
3261unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDirConnectorCreateRequest
3262where
3263 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3264
3265 ___E: ::fidl_next::fuchsia::HandleEncoder,
3266{
3267 #[inline]
3268 fn encode(
3269 self,
3270 encoder: &mut ___E,
3271 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3272 ) -> Result<(), ::fidl_next::EncodeError> {
3273 ::fidl_next::munge! {
3274 let Self::Encoded {
3275 id,
3276 receiver,
3277
3278 } = out;
3279 }
3280
3281 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3282
3283 ::fidl_next::Encode::encode(self.receiver, encoder, receiver)?;
3284
3285 Ok(())
3286 }
3287}
3288
3289impl ::fidl_next::EncodableOption for CapabilityStoreDirConnectorCreateRequest {
3290 type EncodedOption =
3291 ::fidl_next::WireBox<'static, WireCapabilityStoreDirConnectorCreateRequest>;
3292}
3293
3294unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDirConnectorCreateRequest
3295where
3296 ___E: ::fidl_next::Encoder + ?Sized,
3297 CapabilityStoreDirConnectorCreateRequest: ::fidl_next::Encode<___E>,
3298{
3299 #[inline]
3300 fn encode_option(
3301 this: Option<Self>,
3302 encoder: &mut ___E,
3303 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3304 ) -> Result<(), ::fidl_next::EncodeError> {
3305 if let Some(inner) = this {
3306 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3307 ::fidl_next::WireBox::encode_present(out);
3308 } else {
3309 ::fidl_next::WireBox::encode_absent(out);
3310 }
3311
3312 Ok(())
3313 }
3314}
3315
3316impl ::fidl_next::FromWire<WireCapabilityStoreDirConnectorCreateRequest>
3317 for CapabilityStoreDirConnectorCreateRequest
3318{
3319 #[inline]
3320 fn from_wire(wire: WireCapabilityStoreDirConnectorCreateRequest) -> Self {
3321 Self {
3322 id: ::fidl_next::FromWire::from_wire(wire.id),
3323
3324 receiver: ::fidl_next::FromWire::from_wire(wire.receiver),
3325 }
3326 }
3327}
3328
3329#[derive(Debug)]
3331#[repr(C)]
3332pub struct WireCapabilityStoreDirConnectorCreateRequest {
3333 pub id: ::fidl_next::WireU64,
3334
3335 pub receiver: ::fidl_next::ClientEnd<crate::DirReceiver, ::fidl_next::fuchsia::WireChannel>,
3336}
3337
3338unsafe impl ::fidl_next::Wire for WireCapabilityStoreDirConnectorCreateRequest {
3339 type Decoded<'de> = WireCapabilityStoreDirConnectorCreateRequest;
3340
3341 #[inline]
3342 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3343 unsafe {
3344 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3345 }
3346 }
3347}
3348
3349unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDirConnectorCreateRequest
3350where
3351 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3352
3353 ___D: ::fidl_next::fuchsia::HandleDecoder,
3354{
3355 fn decode(
3356 slot: ::fidl_next::Slot<'_, Self>,
3357 decoder: &mut ___D,
3358 ) -> Result<(), ::fidl_next::DecodeError> {
3359 ::fidl_next::munge! {
3360 let Self {
3361 mut id,
3362 mut receiver,
3363
3364 } = slot;
3365 }
3366
3367 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3368
3369 ::fidl_next::Decode::decode(receiver.as_mut(), decoder)?;
3370
3371 Ok(())
3372 }
3373}
3374
3375pub type CapabilityStoreDirConnectorCreateResponse = ();
3376
3377pub type WireCapabilityStoreDirConnectorCreateResponse = ();
3379
3380#[derive(Debug)]
3381pub struct CapabilityStoreDirConnectorOpenRequest {
3382 pub id: u64,
3383
3384 pub server_end: ::fidl_next::ServerEnd<
3385 ::fidl_next_fuchsia_io::Directory,
3386 ::fidl_next::fuchsia::zx::Channel,
3387 >,
3388}
3389
3390impl ::fidl_next::Encodable for CapabilityStoreDirConnectorOpenRequest {
3391 type Encoded = WireCapabilityStoreDirConnectorOpenRequest;
3392}
3393
3394unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDirConnectorOpenRequest
3395where
3396 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3397
3398 ___E: ::fidl_next::fuchsia::HandleEncoder,
3399{
3400 #[inline]
3401 fn encode(
3402 self,
3403 encoder: &mut ___E,
3404 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3405 ) -> Result<(), ::fidl_next::EncodeError> {
3406 ::fidl_next::munge! {
3407 let Self::Encoded {
3408 id,
3409 server_end,
3410
3411 } = out;
3412 }
3413
3414 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3415
3416 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
3417
3418 Ok(())
3419 }
3420}
3421
3422impl ::fidl_next::EncodableOption for CapabilityStoreDirConnectorOpenRequest {
3423 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDirConnectorOpenRequest>;
3424}
3425
3426unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDirConnectorOpenRequest
3427where
3428 ___E: ::fidl_next::Encoder + ?Sized,
3429 CapabilityStoreDirConnectorOpenRequest: ::fidl_next::Encode<___E>,
3430{
3431 #[inline]
3432 fn encode_option(
3433 this: Option<Self>,
3434 encoder: &mut ___E,
3435 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3436 ) -> Result<(), ::fidl_next::EncodeError> {
3437 if let Some(inner) = this {
3438 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3439 ::fidl_next::WireBox::encode_present(out);
3440 } else {
3441 ::fidl_next::WireBox::encode_absent(out);
3442 }
3443
3444 Ok(())
3445 }
3446}
3447
3448impl ::fidl_next::FromWire<WireCapabilityStoreDirConnectorOpenRequest>
3449 for CapabilityStoreDirConnectorOpenRequest
3450{
3451 #[inline]
3452 fn from_wire(wire: WireCapabilityStoreDirConnectorOpenRequest) -> Self {
3453 Self {
3454 id: ::fidl_next::FromWire::from_wire(wire.id),
3455
3456 server_end: ::fidl_next::FromWire::from_wire(wire.server_end),
3457 }
3458 }
3459}
3460
3461#[derive(Debug)]
3463#[repr(C)]
3464pub struct WireCapabilityStoreDirConnectorOpenRequest {
3465 pub id: ::fidl_next::WireU64,
3466
3467 pub server_end: ::fidl_next::ServerEnd<
3468 ::fidl_next_fuchsia_io::Directory,
3469 ::fidl_next::fuchsia::WireChannel,
3470 >,
3471}
3472
3473unsafe impl ::fidl_next::Wire for WireCapabilityStoreDirConnectorOpenRequest {
3474 type Decoded<'de> = WireCapabilityStoreDirConnectorOpenRequest;
3475
3476 #[inline]
3477 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3478 unsafe {
3479 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3480 }
3481 }
3482}
3483
3484unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDirConnectorOpenRequest
3485where
3486 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3487
3488 ___D: ::fidl_next::fuchsia::HandleDecoder,
3489{
3490 fn decode(
3491 slot: ::fidl_next::Slot<'_, Self>,
3492 decoder: &mut ___D,
3493 ) -> Result<(), ::fidl_next::DecodeError> {
3494 ::fidl_next::munge! {
3495 let Self {
3496 mut id,
3497 mut server_end,
3498
3499 } = slot;
3500 }
3501
3502 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3503
3504 ::fidl_next::Decode::decode(server_end.as_mut(), decoder)?;
3505
3506 Ok(())
3507 }
3508}
3509
3510pub type CapabilityStoreDirConnectorOpenResponse = ();
3511
3512pub type WireCapabilityStoreDirConnectorOpenResponse = ();
3514
3515#[derive(Clone, Debug)]
3516#[repr(C)]
3517pub struct CapabilityStoreDictionaryCreateRequest {
3518 pub id: u64,
3519}
3520
3521impl ::fidl_next::Encodable for CapabilityStoreDictionaryCreateRequest {
3522 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3523 Self,
3524 WireCapabilityStoreDictionaryCreateRequest,
3525 > = unsafe {
3526 ::fidl_next::CopyOptimization::enable_if(
3527 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3528 )
3529 };
3530
3531 type Encoded = WireCapabilityStoreDictionaryCreateRequest;
3532}
3533
3534unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryCreateRequest
3535where
3536 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3537{
3538 #[inline]
3539 fn encode(
3540 self,
3541 encoder: &mut ___E,
3542 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3543 ) -> Result<(), ::fidl_next::EncodeError> {
3544 ::fidl_next::munge! {
3545 let Self::Encoded {
3546 id,
3547
3548 } = out;
3549 }
3550
3551 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3552
3553 Ok(())
3554 }
3555}
3556
3557unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryCreateRequest
3558where
3559 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3560{
3561 #[inline]
3562 fn encode_ref(
3563 &self,
3564 encoder: &mut ___E,
3565 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3566 ) -> Result<(), ::fidl_next::EncodeError> {
3567 ::fidl_next::munge! {
3568 let Self::Encoded {
3569 id,
3570
3571 } = out;
3572 }
3573
3574 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
3575
3576 Ok(())
3577 }
3578}
3579
3580impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryCreateRequest {
3581 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryCreateRequest>;
3582}
3583
3584unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryCreateRequest
3585where
3586 ___E: ::fidl_next::Encoder + ?Sized,
3587 CapabilityStoreDictionaryCreateRequest: ::fidl_next::Encode<___E>,
3588{
3589 #[inline]
3590 fn encode_option(
3591 this: Option<Self>,
3592 encoder: &mut ___E,
3593 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3594 ) -> Result<(), ::fidl_next::EncodeError> {
3595 if let Some(inner) = this {
3596 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3597 ::fidl_next::WireBox::encode_present(out);
3598 } else {
3599 ::fidl_next::WireBox::encode_absent(out);
3600 }
3601
3602 Ok(())
3603 }
3604}
3605
3606unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryCreateRequest
3607where
3608 ___E: ::fidl_next::Encoder + ?Sized,
3609 CapabilityStoreDictionaryCreateRequest: ::fidl_next::EncodeRef<___E>,
3610{
3611 #[inline]
3612 fn encode_option_ref(
3613 this: Option<&Self>,
3614 encoder: &mut ___E,
3615 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3616 ) -> Result<(), ::fidl_next::EncodeError> {
3617 if let Some(inner) = this {
3618 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3619 ::fidl_next::WireBox::encode_present(out);
3620 } else {
3621 ::fidl_next::WireBox::encode_absent(out);
3622 }
3623
3624 Ok(())
3625 }
3626}
3627
3628impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryCreateRequest>
3629 for CapabilityStoreDictionaryCreateRequest
3630{
3631 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3632 WireCapabilityStoreDictionaryCreateRequest,
3633 Self,
3634 > = unsafe {
3635 ::fidl_next::CopyOptimization::enable_if(
3636 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
3637 .is_enabled(),
3638 )
3639 };
3640
3641 #[inline]
3642 fn from_wire(wire: WireCapabilityStoreDictionaryCreateRequest) -> Self {
3643 Self { id: ::fidl_next::FromWire::from_wire(wire.id) }
3644 }
3645}
3646
3647impl ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryCreateRequest>
3648 for CapabilityStoreDictionaryCreateRequest
3649{
3650 #[inline]
3651 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryCreateRequest) -> Self {
3652 Self { id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id) }
3653 }
3654}
3655
3656#[derive(Clone, Debug)]
3658#[repr(C)]
3659pub struct WireCapabilityStoreDictionaryCreateRequest {
3660 pub id: ::fidl_next::WireU64,
3661}
3662
3663unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryCreateRequest {
3664 type Decoded<'de> = WireCapabilityStoreDictionaryCreateRequest;
3665
3666 #[inline]
3667 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3668}
3669
3670unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryCreateRequest
3671where
3672 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3673{
3674 fn decode(
3675 slot: ::fidl_next::Slot<'_, Self>,
3676 decoder: &mut ___D,
3677 ) -> Result<(), ::fidl_next::DecodeError> {
3678 ::fidl_next::munge! {
3679 let Self {
3680 mut id,
3681
3682 } = slot;
3683 }
3684
3685 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3686
3687 Ok(())
3688 }
3689}
3690
3691pub type CapabilityStoreDictionaryCreateResponse = ();
3692
3693pub type WireCapabilityStoreDictionaryCreateResponse = ();
3695
3696#[derive(Debug)]
3697pub struct CapabilityStoreDictionaryLegacyImportRequest {
3698 pub id: u64,
3699
3700 pub client_end: ::fidl_next::fuchsia::zx::Handle,
3701}
3702
3703impl ::fidl_next::Encodable for CapabilityStoreDictionaryLegacyImportRequest {
3704 type Encoded = WireCapabilityStoreDictionaryLegacyImportRequest;
3705}
3706
3707unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryLegacyImportRequest
3708where
3709 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3710
3711 ___E: ::fidl_next::fuchsia::HandleEncoder,
3712{
3713 #[inline]
3714 fn encode(
3715 self,
3716 encoder: &mut ___E,
3717 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3718 ) -> Result<(), ::fidl_next::EncodeError> {
3719 ::fidl_next::munge! {
3720 let Self::Encoded {
3721 id,
3722 client_end,
3723
3724 } = out;
3725 }
3726
3727 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3728
3729 ::fidl_next::Encode::encode(self.client_end, encoder, client_end)?;
3730
3731 Ok(())
3732 }
3733}
3734
3735impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryLegacyImportRequest {
3736 type EncodedOption =
3737 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryLegacyImportRequest>;
3738}
3739
3740unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryLegacyImportRequest
3741where
3742 ___E: ::fidl_next::Encoder + ?Sized,
3743 CapabilityStoreDictionaryLegacyImportRequest: ::fidl_next::Encode<___E>,
3744{
3745 #[inline]
3746 fn encode_option(
3747 this: Option<Self>,
3748 encoder: &mut ___E,
3749 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3750 ) -> Result<(), ::fidl_next::EncodeError> {
3751 if let Some(inner) = this {
3752 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3753 ::fidl_next::WireBox::encode_present(out);
3754 } else {
3755 ::fidl_next::WireBox::encode_absent(out);
3756 }
3757
3758 Ok(())
3759 }
3760}
3761
3762impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryLegacyImportRequest>
3763 for CapabilityStoreDictionaryLegacyImportRequest
3764{
3765 #[inline]
3766 fn from_wire(wire: WireCapabilityStoreDictionaryLegacyImportRequest) -> Self {
3767 Self {
3768 id: ::fidl_next::FromWire::from_wire(wire.id),
3769
3770 client_end: ::fidl_next::FromWire::from_wire(wire.client_end),
3771 }
3772 }
3773}
3774
3775#[derive(Debug)]
3777#[repr(C)]
3778pub struct WireCapabilityStoreDictionaryLegacyImportRequest {
3779 pub id: ::fidl_next::WireU64,
3780
3781 pub client_end: ::fidl_next::fuchsia::WireHandle,
3782}
3783
3784unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryLegacyImportRequest {
3785 type Decoded<'de> = WireCapabilityStoreDictionaryLegacyImportRequest;
3786
3787 #[inline]
3788 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3789 unsafe {
3790 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3791 }
3792 }
3793}
3794
3795unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryLegacyImportRequest
3796where
3797 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3798
3799 ___D: ::fidl_next::fuchsia::HandleDecoder,
3800{
3801 fn decode(
3802 slot: ::fidl_next::Slot<'_, Self>,
3803 decoder: &mut ___D,
3804 ) -> Result<(), ::fidl_next::DecodeError> {
3805 ::fidl_next::munge! {
3806 let Self {
3807 mut id,
3808 mut client_end,
3809
3810 } = slot;
3811 }
3812
3813 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3814
3815 ::fidl_next::Decode::decode(client_end.as_mut(), decoder)?;
3816
3817 Ok(())
3818 }
3819}
3820
3821pub type CapabilityStoreDictionaryLegacyImportResponse = ();
3822
3823pub type WireCapabilityStoreDictionaryLegacyImportResponse = ();
3825
3826#[derive(Debug)]
3827pub struct CapabilityStoreDictionaryLegacyExportRequest {
3828 pub id: u64,
3829
3830 pub server_end: ::fidl_next::fuchsia::zx::Handle,
3831}
3832
3833impl ::fidl_next::Encodable for CapabilityStoreDictionaryLegacyExportRequest {
3834 type Encoded = WireCapabilityStoreDictionaryLegacyExportRequest;
3835}
3836
3837unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryLegacyExportRequest
3838where
3839 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3840
3841 ___E: ::fidl_next::fuchsia::HandleEncoder,
3842{
3843 #[inline]
3844 fn encode(
3845 self,
3846 encoder: &mut ___E,
3847 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3848 ) -> Result<(), ::fidl_next::EncodeError> {
3849 ::fidl_next::munge! {
3850 let Self::Encoded {
3851 id,
3852 server_end,
3853
3854 } = out;
3855 }
3856
3857 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3858
3859 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
3860
3861 Ok(())
3862 }
3863}
3864
3865impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryLegacyExportRequest {
3866 type EncodedOption =
3867 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryLegacyExportRequest>;
3868}
3869
3870unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryLegacyExportRequest
3871where
3872 ___E: ::fidl_next::Encoder + ?Sized,
3873 CapabilityStoreDictionaryLegacyExportRequest: ::fidl_next::Encode<___E>,
3874{
3875 #[inline]
3876 fn encode_option(
3877 this: Option<Self>,
3878 encoder: &mut ___E,
3879 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3880 ) -> Result<(), ::fidl_next::EncodeError> {
3881 if let Some(inner) = this {
3882 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3883 ::fidl_next::WireBox::encode_present(out);
3884 } else {
3885 ::fidl_next::WireBox::encode_absent(out);
3886 }
3887
3888 Ok(())
3889 }
3890}
3891
3892impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryLegacyExportRequest>
3893 for CapabilityStoreDictionaryLegacyExportRequest
3894{
3895 #[inline]
3896 fn from_wire(wire: WireCapabilityStoreDictionaryLegacyExportRequest) -> Self {
3897 Self {
3898 id: ::fidl_next::FromWire::from_wire(wire.id),
3899
3900 server_end: ::fidl_next::FromWire::from_wire(wire.server_end),
3901 }
3902 }
3903}
3904
3905#[derive(Debug)]
3907#[repr(C)]
3908pub struct WireCapabilityStoreDictionaryLegacyExportRequest {
3909 pub id: ::fidl_next::WireU64,
3910
3911 pub server_end: ::fidl_next::fuchsia::WireHandle,
3912}
3913
3914unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryLegacyExportRequest {
3915 type Decoded<'de> = WireCapabilityStoreDictionaryLegacyExportRequest;
3916
3917 #[inline]
3918 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3919 unsafe {
3920 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3921 }
3922 }
3923}
3924
3925unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryLegacyExportRequest
3926where
3927 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3928
3929 ___D: ::fidl_next::fuchsia::HandleDecoder,
3930{
3931 fn decode(
3932 slot: ::fidl_next::Slot<'_, Self>,
3933 decoder: &mut ___D,
3934 ) -> Result<(), ::fidl_next::DecodeError> {
3935 ::fidl_next::munge! {
3936 let Self {
3937 mut id,
3938 mut server_end,
3939
3940 } = slot;
3941 }
3942
3943 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3944
3945 ::fidl_next::Decode::decode(server_end.as_mut(), decoder)?;
3946
3947 Ok(())
3948 }
3949}
3950
3951pub type CapabilityStoreDictionaryLegacyExportResponse = ();
3952
3953pub type WireCapabilityStoreDictionaryLegacyExportResponse = ();
3955
3956#[doc = " The maximum length of a dictionary key. This should coincide with\n fuchsia.component.MAX_NAME_LENGTH.\n"]
3957pub const MAX_NAME_LENGTH: u64 = 255;
3958
3959#[doc = " The key of a [`DictionaryItem`]. The constraints for valid keys are documented at\n https://fuchsia.dev/reference/cml#names.\n"]
3960pub type DictionaryKey = String;
3961
3962pub type WireDictionaryKey<'de> = ::fidl_next::WireString<'de>;
3964
3965#[doc = " A key-value pair in a [`DictionaryRef`].\n"]
3966#[derive(Clone, Debug)]
3967pub struct DictionaryItem {
3968 pub key: String,
3969
3970 pub value: u64,
3971}
3972
3973impl ::fidl_next::Encodable for DictionaryItem {
3974 type Encoded = WireDictionaryItem<'static>;
3975}
3976
3977unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryItem
3978where
3979 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3980
3981 ___E: ::fidl_next::Encoder,
3982{
3983 #[inline]
3984 fn encode(
3985 self,
3986 encoder: &mut ___E,
3987 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3988 ) -> Result<(), ::fidl_next::EncodeError> {
3989 ::fidl_next::munge! {
3990 let Self::Encoded {
3991 key,
3992 value,
3993
3994 } = out;
3995 }
3996
3997 ::fidl_next::Encode::encode(self.key, encoder, key)?;
3998
3999 ::fidl_next::Encode::encode(self.value, encoder, value)?;
4000
4001 Ok(())
4002 }
4003}
4004
4005unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DictionaryItem
4006where
4007 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4008
4009 ___E: ::fidl_next::Encoder,
4010{
4011 #[inline]
4012 fn encode_ref(
4013 &self,
4014 encoder: &mut ___E,
4015 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4016 ) -> Result<(), ::fidl_next::EncodeError> {
4017 ::fidl_next::munge! {
4018 let Self::Encoded {
4019 key,
4020 value,
4021
4022 } = out;
4023 }
4024
4025 ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
4026
4027 ::fidl_next::EncodeRef::encode_ref(&self.value, encoder, value)?;
4028
4029 Ok(())
4030 }
4031}
4032
4033impl ::fidl_next::EncodableOption for DictionaryItem {
4034 type EncodedOption = ::fidl_next::WireBox<'static, WireDictionaryItem<'static>>;
4035}
4036
4037unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryItem
4038where
4039 ___E: ::fidl_next::Encoder + ?Sized,
4040 DictionaryItem: ::fidl_next::Encode<___E>,
4041{
4042 #[inline]
4043 fn encode_option(
4044 this: Option<Self>,
4045 encoder: &mut ___E,
4046 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4047 ) -> Result<(), ::fidl_next::EncodeError> {
4048 if let Some(inner) = this {
4049 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4050 ::fidl_next::WireBox::encode_present(out);
4051 } else {
4052 ::fidl_next::WireBox::encode_absent(out);
4053 }
4054
4055 Ok(())
4056 }
4057}
4058
4059unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DictionaryItem
4060where
4061 ___E: ::fidl_next::Encoder + ?Sized,
4062 DictionaryItem: ::fidl_next::EncodeRef<___E>,
4063{
4064 #[inline]
4065 fn encode_option_ref(
4066 this: Option<&Self>,
4067 encoder: &mut ___E,
4068 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4069 ) -> Result<(), ::fidl_next::EncodeError> {
4070 if let Some(inner) = this {
4071 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4072 ::fidl_next::WireBox::encode_present(out);
4073 } else {
4074 ::fidl_next::WireBox::encode_absent(out);
4075 }
4076
4077 Ok(())
4078 }
4079}
4080
4081impl<'de> ::fidl_next::FromWire<WireDictionaryItem<'de>> for DictionaryItem {
4082 #[inline]
4083 fn from_wire(wire: WireDictionaryItem<'de>) -> Self {
4084 Self {
4085 key: ::fidl_next::FromWire::from_wire(wire.key),
4086
4087 value: ::fidl_next::FromWire::from_wire(wire.value),
4088 }
4089 }
4090}
4091
4092impl<'de> ::fidl_next::FromWireRef<WireDictionaryItem<'de>> for DictionaryItem {
4093 #[inline]
4094 fn from_wire_ref(wire: &WireDictionaryItem<'de>) -> Self {
4095 Self {
4096 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4097
4098 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
4099 }
4100 }
4101}
4102
4103#[derive(Debug)]
4105#[repr(C)]
4106pub struct WireDictionaryItem<'de> {
4107 pub key: ::fidl_next::WireString<'de>,
4108
4109 pub value: ::fidl_next::WireU64,
4110}
4111
4112unsafe impl ::fidl_next::Wire for WireDictionaryItem<'static> {
4113 type Decoded<'de> = WireDictionaryItem<'de>;
4114
4115 #[inline]
4116 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4117}
4118
4119unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryItem<'static>
4120where
4121 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4122
4123 ___D: ::fidl_next::Decoder,
4124{
4125 fn decode(
4126 slot: ::fidl_next::Slot<'_, Self>,
4127 decoder: &mut ___D,
4128 ) -> Result<(), ::fidl_next::DecodeError> {
4129 ::fidl_next::munge! {
4130 let Self {
4131 mut key,
4132 mut value,
4133
4134 } = slot;
4135 }
4136
4137 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
4138
4139 let key = unsafe { key.deref_unchecked() };
4140
4141 if key.len() > 255 {
4142 return Err(::fidl_next::DecodeError::VectorTooLong {
4143 size: key.len() as u64,
4144 limit: 255,
4145 });
4146 }
4147
4148 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
4149
4150 Ok(())
4151 }
4152}
4153
4154#[derive(Clone, Debug)]
4155pub struct CapabilityStoreDictionaryInsertRequest {
4156 pub id: u64,
4157
4158 pub item: crate::DictionaryItem,
4159}
4160
4161impl ::fidl_next::Encodable for CapabilityStoreDictionaryInsertRequest {
4162 type Encoded = WireCapabilityStoreDictionaryInsertRequest<'static>;
4163}
4164
4165unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryInsertRequest
4166where
4167 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4168
4169 ___E: ::fidl_next::Encoder,
4170{
4171 #[inline]
4172 fn encode(
4173 self,
4174 encoder: &mut ___E,
4175 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4176 ) -> Result<(), ::fidl_next::EncodeError> {
4177 ::fidl_next::munge! {
4178 let Self::Encoded {
4179 id,
4180 item,
4181
4182 } = out;
4183 }
4184
4185 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4186
4187 ::fidl_next::Encode::encode(self.item, encoder, item)?;
4188
4189 Ok(())
4190 }
4191}
4192
4193unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryInsertRequest
4194where
4195 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4196
4197 ___E: ::fidl_next::Encoder,
4198{
4199 #[inline]
4200 fn encode_ref(
4201 &self,
4202 encoder: &mut ___E,
4203 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4204 ) -> Result<(), ::fidl_next::EncodeError> {
4205 ::fidl_next::munge! {
4206 let Self::Encoded {
4207 id,
4208 item,
4209
4210 } = out;
4211 }
4212
4213 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
4214
4215 ::fidl_next::EncodeRef::encode_ref(&self.item, encoder, item)?;
4216
4217 Ok(())
4218 }
4219}
4220
4221impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryInsertRequest {
4222 type EncodedOption =
4223 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryInsertRequest<'static>>;
4224}
4225
4226unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryInsertRequest
4227where
4228 ___E: ::fidl_next::Encoder + ?Sized,
4229 CapabilityStoreDictionaryInsertRequest: ::fidl_next::Encode<___E>,
4230{
4231 #[inline]
4232 fn encode_option(
4233 this: Option<Self>,
4234 encoder: &mut ___E,
4235 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4236 ) -> Result<(), ::fidl_next::EncodeError> {
4237 if let Some(inner) = this {
4238 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4239 ::fidl_next::WireBox::encode_present(out);
4240 } else {
4241 ::fidl_next::WireBox::encode_absent(out);
4242 }
4243
4244 Ok(())
4245 }
4246}
4247
4248unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryInsertRequest
4249where
4250 ___E: ::fidl_next::Encoder + ?Sized,
4251 CapabilityStoreDictionaryInsertRequest: ::fidl_next::EncodeRef<___E>,
4252{
4253 #[inline]
4254 fn encode_option_ref(
4255 this: Option<&Self>,
4256 encoder: &mut ___E,
4257 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4258 ) -> Result<(), ::fidl_next::EncodeError> {
4259 if let Some(inner) = this {
4260 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4261 ::fidl_next::WireBox::encode_present(out);
4262 } else {
4263 ::fidl_next::WireBox::encode_absent(out);
4264 }
4265
4266 Ok(())
4267 }
4268}
4269
4270impl<'de> ::fidl_next::FromWire<WireCapabilityStoreDictionaryInsertRequest<'de>>
4271 for CapabilityStoreDictionaryInsertRequest
4272{
4273 #[inline]
4274 fn from_wire(wire: WireCapabilityStoreDictionaryInsertRequest<'de>) -> Self {
4275 Self {
4276 id: ::fidl_next::FromWire::from_wire(wire.id),
4277
4278 item: ::fidl_next::FromWire::from_wire(wire.item),
4279 }
4280 }
4281}
4282
4283impl<'de> ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryInsertRequest<'de>>
4284 for CapabilityStoreDictionaryInsertRequest
4285{
4286 #[inline]
4287 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryInsertRequest<'de>) -> Self {
4288 Self {
4289 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
4290
4291 item: ::fidl_next::FromWireRef::from_wire_ref(&wire.item),
4292 }
4293 }
4294}
4295
4296#[derive(Debug)]
4298#[repr(C)]
4299pub struct WireCapabilityStoreDictionaryInsertRequest<'de> {
4300 pub id: ::fidl_next::WireU64,
4301
4302 pub item: crate::WireDictionaryItem<'de>,
4303}
4304
4305unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryInsertRequest<'static> {
4306 type Decoded<'de> = WireCapabilityStoreDictionaryInsertRequest<'de>;
4307
4308 #[inline]
4309 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4310}
4311
4312unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryInsertRequest<'static>
4313where
4314 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4315
4316 ___D: ::fidl_next::Decoder,
4317{
4318 fn decode(
4319 slot: ::fidl_next::Slot<'_, Self>,
4320 decoder: &mut ___D,
4321 ) -> Result<(), ::fidl_next::DecodeError> {
4322 ::fidl_next::munge! {
4323 let Self {
4324 mut id,
4325 mut item,
4326
4327 } = slot;
4328 }
4329
4330 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
4331
4332 ::fidl_next::Decode::decode(item.as_mut(), decoder)?;
4333
4334 Ok(())
4335 }
4336}
4337
4338pub type CapabilityStoreDictionaryInsertResponse = ();
4339
4340pub type WireCapabilityStoreDictionaryInsertResponse = ();
4342
4343#[derive(Clone, Debug)]
4344pub struct CapabilityStoreDictionaryGetRequest {
4345 pub id: u64,
4346
4347 pub key: String,
4348
4349 pub dest_id: u64,
4350}
4351
4352impl ::fidl_next::Encodable for CapabilityStoreDictionaryGetRequest {
4353 type Encoded = WireCapabilityStoreDictionaryGetRequest<'static>;
4354}
4355
4356unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryGetRequest
4357where
4358 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4359
4360 ___E: ::fidl_next::Encoder,
4361{
4362 #[inline]
4363 fn encode(
4364 self,
4365 encoder: &mut ___E,
4366 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4367 ) -> Result<(), ::fidl_next::EncodeError> {
4368 ::fidl_next::munge! {
4369 let Self::Encoded {
4370 id,
4371 key,
4372 dest_id,
4373
4374 } = out;
4375 }
4376
4377 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4378
4379 ::fidl_next::Encode::encode(self.key, encoder, key)?;
4380
4381 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
4382
4383 Ok(())
4384 }
4385}
4386
4387unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryGetRequest
4388where
4389 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4390
4391 ___E: ::fidl_next::Encoder,
4392{
4393 #[inline]
4394 fn encode_ref(
4395 &self,
4396 encoder: &mut ___E,
4397 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4398 ) -> Result<(), ::fidl_next::EncodeError> {
4399 ::fidl_next::munge! {
4400 let Self::Encoded {
4401 id,
4402 key,
4403 dest_id,
4404
4405 } = out;
4406 }
4407
4408 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
4409
4410 ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
4411
4412 ::fidl_next::EncodeRef::encode_ref(&self.dest_id, encoder, dest_id)?;
4413
4414 Ok(())
4415 }
4416}
4417
4418impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryGetRequest {
4419 type EncodedOption =
4420 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryGetRequest<'static>>;
4421}
4422
4423unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryGetRequest
4424where
4425 ___E: ::fidl_next::Encoder + ?Sized,
4426 CapabilityStoreDictionaryGetRequest: ::fidl_next::Encode<___E>,
4427{
4428 #[inline]
4429 fn encode_option(
4430 this: Option<Self>,
4431 encoder: &mut ___E,
4432 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4433 ) -> Result<(), ::fidl_next::EncodeError> {
4434 if let Some(inner) = this {
4435 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4436 ::fidl_next::WireBox::encode_present(out);
4437 } else {
4438 ::fidl_next::WireBox::encode_absent(out);
4439 }
4440
4441 Ok(())
4442 }
4443}
4444
4445unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryGetRequest
4446where
4447 ___E: ::fidl_next::Encoder + ?Sized,
4448 CapabilityStoreDictionaryGetRequest: ::fidl_next::EncodeRef<___E>,
4449{
4450 #[inline]
4451 fn encode_option_ref(
4452 this: Option<&Self>,
4453 encoder: &mut ___E,
4454 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4455 ) -> Result<(), ::fidl_next::EncodeError> {
4456 if let Some(inner) = this {
4457 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4458 ::fidl_next::WireBox::encode_present(out);
4459 } else {
4460 ::fidl_next::WireBox::encode_absent(out);
4461 }
4462
4463 Ok(())
4464 }
4465}
4466
4467impl<'de> ::fidl_next::FromWire<WireCapabilityStoreDictionaryGetRequest<'de>>
4468 for CapabilityStoreDictionaryGetRequest
4469{
4470 #[inline]
4471 fn from_wire(wire: WireCapabilityStoreDictionaryGetRequest<'de>) -> Self {
4472 Self {
4473 id: ::fidl_next::FromWire::from_wire(wire.id),
4474
4475 key: ::fidl_next::FromWire::from_wire(wire.key),
4476
4477 dest_id: ::fidl_next::FromWire::from_wire(wire.dest_id),
4478 }
4479 }
4480}
4481
4482impl<'de> ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryGetRequest<'de>>
4483 for CapabilityStoreDictionaryGetRequest
4484{
4485 #[inline]
4486 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryGetRequest<'de>) -> Self {
4487 Self {
4488 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
4489
4490 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4491
4492 dest_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.dest_id),
4493 }
4494 }
4495}
4496
4497#[derive(Debug)]
4499#[repr(C)]
4500pub struct WireCapabilityStoreDictionaryGetRequest<'de> {
4501 pub id: ::fidl_next::WireU64,
4502
4503 pub key: ::fidl_next::WireString<'de>,
4504
4505 pub dest_id: ::fidl_next::WireU64,
4506}
4507
4508unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryGetRequest<'static> {
4509 type Decoded<'de> = WireCapabilityStoreDictionaryGetRequest<'de>;
4510
4511 #[inline]
4512 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4513}
4514
4515unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryGetRequest<'static>
4516where
4517 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4518
4519 ___D: ::fidl_next::Decoder,
4520{
4521 fn decode(
4522 slot: ::fidl_next::Slot<'_, Self>,
4523 decoder: &mut ___D,
4524 ) -> Result<(), ::fidl_next::DecodeError> {
4525 ::fidl_next::munge! {
4526 let Self {
4527 mut id,
4528 mut key,
4529 mut dest_id,
4530
4531 } = slot;
4532 }
4533
4534 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
4535
4536 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
4537
4538 let key = unsafe { key.deref_unchecked() };
4539
4540 if key.len() > 255 {
4541 return Err(::fidl_next::DecodeError::VectorTooLong {
4542 size: key.len() as u64,
4543 limit: 255,
4544 });
4545 }
4546
4547 ::fidl_next::Decode::decode(dest_id.as_mut(), decoder)?;
4548
4549 Ok(())
4550 }
4551}
4552
4553pub type CapabilityStoreDictionaryGetResponse = ();
4554
4555pub type WireCapabilityStoreDictionaryGetResponse = ();
4557
4558#[doc = " A [CapabilityId] wrapped in a struct. This is useful for putting a [CapabilityId] in a `box<>`,\n which FIDL does not allow for pure integral types.\n"]
4559#[derive(Clone, Debug)]
4560#[repr(C)]
4561pub struct WrappedCapabilityId {
4562 pub id: u64,
4563}
4564
4565impl ::fidl_next::Encodable for WrappedCapabilityId {
4566 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireWrappedCapabilityId> = unsafe {
4567 ::fidl_next::CopyOptimization::enable_if(
4568 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4569 )
4570 };
4571
4572 type Encoded = WireWrappedCapabilityId;
4573}
4574
4575unsafe impl<___E> ::fidl_next::Encode<___E> for WrappedCapabilityId
4576where
4577 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4578{
4579 #[inline]
4580 fn encode(
4581 self,
4582 encoder: &mut ___E,
4583 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4584 ) -> Result<(), ::fidl_next::EncodeError> {
4585 ::fidl_next::munge! {
4586 let Self::Encoded {
4587 id,
4588
4589 } = out;
4590 }
4591
4592 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4593
4594 Ok(())
4595 }
4596}
4597
4598unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WrappedCapabilityId
4599where
4600 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4601{
4602 #[inline]
4603 fn encode_ref(
4604 &self,
4605 encoder: &mut ___E,
4606 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4607 ) -> Result<(), ::fidl_next::EncodeError> {
4608 ::fidl_next::munge! {
4609 let Self::Encoded {
4610 id,
4611
4612 } = out;
4613 }
4614
4615 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
4616
4617 Ok(())
4618 }
4619}
4620
4621impl ::fidl_next::EncodableOption for WrappedCapabilityId {
4622 type EncodedOption = ::fidl_next::WireBox<'static, WireWrappedCapabilityId>;
4623}
4624
4625unsafe impl<___E> ::fidl_next::EncodeOption<___E> for WrappedCapabilityId
4626where
4627 ___E: ::fidl_next::Encoder + ?Sized,
4628 WrappedCapabilityId: ::fidl_next::Encode<___E>,
4629{
4630 #[inline]
4631 fn encode_option(
4632 this: Option<Self>,
4633 encoder: &mut ___E,
4634 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4635 ) -> Result<(), ::fidl_next::EncodeError> {
4636 if let Some(inner) = this {
4637 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4638 ::fidl_next::WireBox::encode_present(out);
4639 } else {
4640 ::fidl_next::WireBox::encode_absent(out);
4641 }
4642
4643 Ok(())
4644 }
4645}
4646
4647unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for WrappedCapabilityId
4648where
4649 ___E: ::fidl_next::Encoder + ?Sized,
4650 WrappedCapabilityId: ::fidl_next::EncodeRef<___E>,
4651{
4652 #[inline]
4653 fn encode_option_ref(
4654 this: Option<&Self>,
4655 encoder: &mut ___E,
4656 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4657 ) -> Result<(), ::fidl_next::EncodeError> {
4658 if let Some(inner) = this {
4659 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4660 ::fidl_next::WireBox::encode_present(out);
4661 } else {
4662 ::fidl_next::WireBox::encode_absent(out);
4663 }
4664
4665 Ok(())
4666 }
4667}
4668
4669impl ::fidl_next::FromWire<WireWrappedCapabilityId> for WrappedCapabilityId {
4670 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireWrappedCapabilityId, Self> = unsafe {
4671 ::fidl_next::CopyOptimization::enable_if(
4672 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
4673 .is_enabled(),
4674 )
4675 };
4676
4677 #[inline]
4678 fn from_wire(wire: WireWrappedCapabilityId) -> Self {
4679 Self { id: ::fidl_next::FromWire::from_wire(wire.id) }
4680 }
4681}
4682
4683impl ::fidl_next::FromWireRef<WireWrappedCapabilityId> for WrappedCapabilityId {
4684 #[inline]
4685 fn from_wire_ref(wire: &WireWrappedCapabilityId) -> Self {
4686 Self { id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id) }
4687 }
4688}
4689
4690#[derive(Clone, Debug)]
4692#[repr(C)]
4693pub struct WireWrappedCapabilityId {
4694 pub id: ::fidl_next::WireU64,
4695}
4696
4697unsafe impl ::fidl_next::Wire for WireWrappedCapabilityId {
4698 type Decoded<'de> = WireWrappedCapabilityId;
4699
4700 #[inline]
4701 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4702}
4703
4704unsafe impl<___D> ::fidl_next::Decode<___D> for WireWrappedCapabilityId
4705where
4706 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4707{
4708 fn decode(
4709 slot: ::fidl_next::Slot<'_, Self>,
4710 decoder: &mut ___D,
4711 ) -> Result<(), ::fidl_next::DecodeError> {
4712 ::fidl_next::munge! {
4713 let Self {
4714 mut id,
4715
4716 } = slot;
4717 }
4718
4719 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
4720
4721 Ok(())
4722 }
4723}
4724
4725pub type WrappedNewCapabilityId = crate::WrappedCapabilityId;
4726
4727pub type WireWrappedNewCapabilityId = crate::WireWrappedCapabilityId;
4729
4730#[derive(Clone, Debug)]
4731pub struct CapabilityStoreDictionaryRemoveRequest {
4732 pub id: u64,
4733
4734 pub key: String,
4735
4736 pub dest_id: Option<Box<crate::WrappedCapabilityId>>,
4737}
4738
4739impl ::fidl_next::Encodable for CapabilityStoreDictionaryRemoveRequest {
4740 type Encoded = WireCapabilityStoreDictionaryRemoveRequest<'static>;
4741}
4742
4743unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryRemoveRequest
4744where
4745 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4746
4747 ___E: ::fidl_next::Encoder,
4748{
4749 #[inline]
4750 fn encode(
4751 self,
4752 encoder: &mut ___E,
4753 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4754 ) -> Result<(), ::fidl_next::EncodeError> {
4755 ::fidl_next::munge! {
4756 let Self::Encoded {
4757 id,
4758 key,
4759 dest_id,
4760
4761 } = out;
4762 }
4763
4764 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4765
4766 ::fidl_next::Encode::encode(self.key, encoder, key)?;
4767
4768 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
4769
4770 Ok(())
4771 }
4772}
4773
4774unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryRemoveRequest
4775where
4776 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4777
4778 ___E: ::fidl_next::Encoder,
4779{
4780 #[inline]
4781 fn encode_ref(
4782 &self,
4783 encoder: &mut ___E,
4784 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4785 ) -> Result<(), ::fidl_next::EncodeError> {
4786 ::fidl_next::munge! {
4787 let Self::Encoded {
4788 id,
4789 key,
4790 dest_id,
4791
4792 } = out;
4793 }
4794
4795 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
4796
4797 ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
4798
4799 ::fidl_next::EncodeRef::encode_ref(&self.dest_id, encoder, dest_id)?;
4800
4801 Ok(())
4802 }
4803}
4804
4805impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryRemoveRequest {
4806 type EncodedOption =
4807 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryRemoveRequest<'static>>;
4808}
4809
4810unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryRemoveRequest
4811where
4812 ___E: ::fidl_next::Encoder + ?Sized,
4813 CapabilityStoreDictionaryRemoveRequest: ::fidl_next::Encode<___E>,
4814{
4815 #[inline]
4816 fn encode_option(
4817 this: Option<Self>,
4818 encoder: &mut ___E,
4819 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4820 ) -> Result<(), ::fidl_next::EncodeError> {
4821 if let Some(inner) = this {
4822 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4823 ::fidl_next::WireBox::encode_present(out);
4824 } else {
4825 ::fidl_next::WireBox::encode_absent(out);
4826 }
4827
4828 Ok(())
4829 }
4830}
4831
4832unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryRemoveRequest
4833where
4834 ___E: ::fidl_next::Encoder + ?Sized,
4835 CapabilityStoreDictionaryRemoveRequest: ::fidl_next::EncodeRef<___E>,
4836{
4837 #[inline]
4838 fn encode_option_ref(
4839 this: Option<&Self>,
4840 encoder: &mut ___E,
4841 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4842 ) -> Result<(), ::fidl_next::EncodeError> {
4843 if let Some(inner) = this {
4844 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4845 ::fidl_next::WireBox::encode_present(out);
4846 } else {
4847 ::fidl_next::WireBox::encode_absent(out);
4848 }
4849
4850 Ok(())
4851 }
4852}
4853
4854impl<'de> ::fidl_next::FromWire<WireCapabilityStoreDictionaryRemoveRequest<'de>>
4855 for CapabilityStoreDictionaryRemoveRequest
4856{
4857 #[inline]
4858 fn from_wire(wire: WireCapabilityStoreDictionaryRemoveRequest<'de>) -> Self {
4859 Self {
4860 id: ::fidl_next::FromWire::from_wire(wire.id),
4861
4862 key: ::fidl_next::FromWire::from_wire(wire.key),
4863
4864 dest_id: ::fidl_next::FromWire::from_wire(wire.dest_id),
4865 }
4866 }
4867}
4868
4869impl<'de> ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryRemoveRequest<'de>>
4870 for CapabilityStoreDictionaryRemoveRequest
4871{
4872 #[inline]
4873 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryRemoveRequest<'de>) -> Self {
4874 Self {
4875 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
4876
4877 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4878
4879 dest_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.dest_id),
4880 }
4881 }
4882}
4883
4884#[derive(Debug)]
4886#[repr(C)]
4887pub struct WireCapabilityStoreDictionaryRemoveRequest<'de> {
4888 pub id: ::fidl_next::WireU64,
4889
4890 pub key: ::fidl_next::WireString<'de>,
4891
4892 pub dest_id: ::fidl_next::WireBox<'de, crate::WireWrappedCapabilityId>,
4893}
4894
4895unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryRemoveRequest<'static> {
4896 type Decoded<'de> = WireCapabilityStoreDictionaryRemoveRequest<'de>;
4897
4898 #[inline]
4899 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4900}
4901
4902unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryRemoveRequest<'static>
4903where
4904 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4905
4906 ___D: ::fidl_next::Decoder,
4907{
4908 fn decode(
4909 slot: ::fidl_next::Slot<'_, Self>,
4910 decoder: &mut ___D,
4911 ) -> Result<(), ::fidl_next::DecodeError> {
4912 ::fidl_next::munge! {
4913 let Self {
4914 mut id,
4915 mut key,
4916 mut dest_id,
4917
4918 } = slot;
4919 }
4920
4921 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
4922
4923 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
4924
4925 let key = unsafe { key.deref_unchecked() };
4926
4927 if key.len() > 255 {
4928 return Err(::fidl_next::DecodeError::VectorTooLong {
4929 size: key.len() as u64,
4930 limit: 255,
4931 });
4932 }
4933
4934 ::fidl_next::Decode::decode(dest_id.as_mut(), decoder)?;
4935
4936 Ok(())
4937 }
4938}
4939
4940pub type CapabilityStoreDictionaryRemoveResponse = ();
4941
4942pub type WireCapabilityStoreDictionaryRemoveResponse = ();
4944
4945#[derive(Clone, Debug)]
4946#[repr(C)]
4947pub struct CapabilityStoreDictionaryCopyRequest {
4948 pub id: u64,
4949
4950 pub dest_id: u64,
4951}
4952
4953impl ::fidl_next::Encodable for CapabilityStoreDictionaryCopyRequest {
4954 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4955 Self,
4956 WireCapabilityStoreDictionaryCopyRequest,
4957 > = unsafe {
4958 ::fidl_next::CopyOptimization::enable_if(
4959 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4960 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4961 )
4962 };
4963
4964 type Encoded = WireCapabilityStoreDictionaryCopyRequest;
4965}
4966
4967unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryCopyRequest
4968where
4969 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4970{
4971 #[inline]
4972 fn encode(
4973 self,
4974 encoder: &mut ___E,
4975 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4976 ) -> Result<(), ::fidl_next::EncodeError> {
4977 ::fidl_next::munge! {
4978 let Self::Encoded {
4979 id,
4980 dest_id,
4981
4982 } = out;
4983 }
4984
4985 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4986
4987 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
4988
4989 Ok(())
4990 }
4991}
4992
4993unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryCopyRequest
4994where
4995 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4996{
4997 #[inline]
4998 fn encode_ref(
4999 &self,
5000 encoder: &mut ___E,
5001 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5002 ) -> Result<(), ::fidl_next::EncodeError> {
5003 ::fidl_next::munge! {
5004 let Self::Encoded {
5005 id,
5006 dest_id,
5007
5008 } = out;
5009 }
5010
5011 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
5012
5013 ::fidl_next::EncodeRef::encode_ref(&self.dest_id, encoder, dest_id)?;
5014
5015 Ok(())
5016 }
5017}
5018
5019impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryCopyRequest {
5020 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryCopyRequest>;
5021}
5022
5023unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryCopyRequest
5024where
5025 ___E: ::fidl_next::Encoder + ?Sized,
5026 CapabilityStoreDictionaryCopyRequest: ::fidl_next::Encode<___E>,
5027{
5028 #[inline]
5029 fn encode_option(
5030 this: Option<Self>,
5031 encoder: &mut ___E,
5032 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5033 ) -> Result<(), ::fidl_next::EncodeError> {
5034 if let Some(inner) = this {
5035 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5036 ::fidl_next::WireBox::encode_present(out);
5037 } else {
5038 ::fidl_next::WireBox::encode_absent(out);
5039 }
5040
5041 Ok(())
5042 }
5043}
5044
5045unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryCopyRequest
5046where
5047 ___E: ::fidl_next::Encoder + ?Sized,
5048 CapabilityStoreDictionaryCopyRequest: ::fidl_next::EncodeRef<___E>,
5049{
5050 #[inline]
5051 fn encode_option_ref(
5052 this: Option<&Self>,
5053 encoder: &mut ___E,
5054 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5055 ) -> Result<(), ::fidl_next::EncodeError> {
5056 if let Some(inner) = this {
5057 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5058 ::fidl_next::WireBox::encode_present(out);
5059 } else {
5060 ::fidl_next::WireBox::encode_absent(out);
5061 }
5062
5063 Ok(())
5064 }
5065}
5066
5067impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryCopyRequest>
5068 for CapabilityStoreDictionaryCopyRequest
5069{
5070 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
5071 WireCapabilityStoreDictionaryCopyRequest,
5072 Self,
5073 > = unsafe {
5074 ::fidl_next::CopyOptimization::enable_if(
5075 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
5076 .is_enabled()
5077 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
5078 .is_enabled(),
5079 )
5080 };
5081
5082 #[inline]
5083 fn from_wire(wire: WireCapabilityStoreDictionaryCopyRequest) -> Self {
5084 Self {
5085 id: ::fidl_next::FromWire::from_wire(wire.id),
5086
5087 dest_id: ::fidl_next::FromWire::from_wire(wire.dest_id),
5088 }
5089 }
5090}
5091
5092impl ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryCopyRequest>
5093 for CapabilityStoreDictionaryCopyRequest
5094{
5095 #[inline]
5096 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryCopyRequest) -> Self {
5097 Self {
5098 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
5099
5100 dest_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.dest_id),
5101 }
5102 }
5103}
5104
5105#[derive(Clone, Debug)]
5107#[repr(C)]
5108pub struct WireCapabilityStoreDictionaryCopyRequest {
5109 pub id: ::fidl_next::WireU64,
5110
5111 pub dest_id: ::fidl_next::WireU64,
5112}
5113
5114unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryCopyRequest {
5115 type Decoded<'de> = WireCapabilityStoreDictionaryCopyRequest;
5116
5117 #[inline]
5118 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5119}
5120
5121unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryCopyRequest
5122where
5123 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5124{
5125 fn decode(
5126 slot: ::fidl_next::Slot<'_, Self>,
5127 decoder: &mut ___D,
5128 ) -> Result<(), ::fidl_next::DecodeError> {
5129 ::fidl_next::munge! {
5130 let Self {
5131 mut id,
5132 mut dest_id,
5133
5134 } = slot;
5135 }
5136
5137 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
5138
5139 ::fidl_next::Decode::decode(dest_id.as_mut(), decoder)?;
5140
5141 Ok(())
5142 }
5143}
5144
5145pub type CapabilityStoreDictionaryCopyResponse = ();
5146
5147pub type WireCapabilityStoreDictionaryCopyResponse = ();
5149
5150#[derive(Debug)]
5151pub struct CapabilityStoreDictionaryKeysRequest {
5152 pub id: u64,
5153
5154 pub iterator:
5155 ::fidl_next::ServerEnd<crate::DictionaryKeysIterator, ::fidl_next::fuchsia::zx::Channel>,
5156}
5157
5158impl ::fidl_next::Encodable for CapabilityStoreDictionaryKeysRequest {
5159 type Encoded = WireCapabilityStoreDictionaryKeysRequest;
5160}
5161
5162unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryKeysRequest
5163where
5164 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5165
5166 ___E: ::fidl_next::fuchsia::HandleEncoder,
5167{
5168 #[inline]
5169 fn encode(
5170 self,
5171 encoder: &mut ___E,
5172 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5173 ) -> Result<(), ::fidl_next::EncodeError> {
5174 ::fidl_next::munge! {
5175 let Self::Encoded {
5176 id,
5177 iterator,
5178
5179 } = out;
5180 }
5181
5182 ::fidl_next::Encode::encode(self.id, encoder, id)?;
5183
5184 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
5185
5186 Ok(())
5187 }
5188}
5189
5190impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryKeysRequest {
5191 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryKeysRequest>;
5192}
5193
5194unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryKeysRequest
5195where
5196 ___E: ::fidl_next::Encoder + ?Sized,
5197 CapabilityStoreDictionaryKeysRequest: ::fidl_next::Encode<___E>,
5198{
5199 #[inline]
5200 fn encode_option(
5201 this: Option<Self>,
5202 encoder: &mut ___E,
5203 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5204 ) -> Result<(), ::fidl_next::EncodeError> {
5205 if let Some(inner) = this {
5206 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5207 ::fidl_next::WireBox::encode_present(out);
5208 } else {
5209 ::fidl_next::WireBox::encode_absent(out);
5210 }
5211
5212 Ok(())
5213 }
5214}
5215
5216impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryKeysRequest>
5217 for CapabilityStoreDictionaryKeysRequest
5218{
5219 #[inline]
5220 fn from_wire(wire: WireCapabilityStoreDictionaryKeysRequest) -> Self {
5221 Self {
5222 id: ::fidl_next::FromWire::from_wire(wire.id),
5223
5224 iterator: ::fidl_next::FromWire::from_wire(wire.iterator),
5225 }
5226 }
5227}
5228
5229#[derive(Debug)]
5231#[repr(C)]
5232pub struct WireCapabilityStoreDictionaryKeysRequest {
5233 pub id: ::fidl_next::WireU64,
5234
5235 pub iterator:
5236 ::fidl_next::ServerEnd<crate::DictionaryKeysIterator, ::fidl_next::fuchsia::WireChannel>,
5237}
5238
5239unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryKeysRequest {
5240 type Decoded<'de> = WireCapabilityStoreDictionaryKeysRequest;
5241
5242 #[inline]
5243 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5244 unsafe {
5245 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
5246 }
5247 }
5248}
5249
5250unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryKeysRequest
5251where
5252 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5253
5254 ___D: ::fidl_next::fuchsia::HandleDecoder,
5255{
5256 fn decode(
5257 slot: ::fidl_next::Slot<'_, Self>,
5258 decoder: &mut ___D,
5259 ) -> Result<(), ::fidl_next::DecodeError> {
5260 ::fidl_next::munge! {
5261 let Self {
5262 mut id,
5263 mut iterator,
5264
5265 } = slot;
5266 }
5267
5268 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
5269
5270 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
5271
5272 Ok(())
5273 }
5274}
5275
5276pub type CapabilityStoreDictionaryKeysResponse = ();
5277
5278pub type WireCapabilityStoreDictionaryKeysResponse = ();
5280
5281#[derive(Debug)]
5282pub struct CapabilityStoreDictionaryEnumerateRequest {
5283 pub id: u64,
5284
5285 pub iterator: ::fidl_next::ServerEnd<
5286 crate::DictionaryEnumerateIterator,
5287 ::fidl_next::fuchsia::zx::Channel,
5288 >,
5289}
5290
5291impl ::fidl_next::Encodable for CapabilityStoreDictionaryEnumerateRequest {
5292 type Encoded = WireCapabilityStoreDictionaryEnumerateRequest;
5293}
5294
5295unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryEnumerateRequest
5296where
5297 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5298
5299 ___E: ::fidl_next::fuchsia::HandleEncoder,
5300{
5301 #[inline]
5302 fn encode(
5303 self,
5304 encoder: &mut ___E,
5305 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5306 ) -> Result<(), ::fidl_next::EncodeError> {
5307 ::fidl_next::munge! {
5308 let Self::Encoded {
5309 id,
5310 iterator,
5311
5312 } = out;
5313 }
5314
5315 ::fidl_next::Encode::encode(self.id, encoder, id)?;
5316
5317 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
5318
5319 Ok(())
5320 }
5321}
5322
5323impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryEnumerateRequest {
5324 type EncodedOption =
5325 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryEnumerateRequest>;
5326}
5327
5328unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryEnumerateRequest
5329where
5330 ___E: ::fidl_next::Encoder + ?Sized,
5331 CapabilityStoreDictionaryEnumerateRequest: ::fidl_next::Encode<___E>,
5332{
5333 #[inline]
5334 fn encode_option(
5335 this: Option<Self>,
5336 encoder: &mut ___E,
5337 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5338 ) -> Result<(), ::fidl_next::EncodeError> {
5339 if let Some(inner) = this {
5340 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5341 ::fidl_next::WireBox::encode_present(out);
5342 } else {
5343 ::fidl_next::WireBox::encode_absent(out);
5344 }
5345
5346 Ok(())
5347 }
5348}
5349
5350impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryEnumerateRequest>
5351 for CapabilityStoreDictionaryEnumerateRequest
5352{
5353 #[inline]
5354 fn from_wire(wire: WireCapabilityStoreDictionaryEnumerateRequest) -> Self {
5355 Self {
5356 id: ::fidl_next::FromWire::from_wire(wire.id),
5357
5358 iterator: ::fidl_next::FromWire::from_wire(wire.iterator),
5359 }
5360 }
5361}
5362
5363#[derive(Debug)]
5365#[repr(C)]
5366pub struct WireCapabilityStoreDictionaryEnumerateRequest {
5367 pub id: ::fidl_next::WireU64,
5368
5369 pub iterator: ::fidl_next::ServerEnd<
5370 crate::DictionaryEnumerateIterator,
5371 ::fidl_next::fuchsia::WireChannel,
5372 >,
5373}
5374
5375unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryEnumerateRequest {
5376 type Decoded<'de> = WireCapabilityStoreDictionaryEnumerateRequest;
5377
5378 #[inline]
5379 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5380 unsafe {
5381 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
5382 }
5383 }
5384}
5385
5386unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryEnumerateRequest
5387where
5388 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5389
5390 ___D: ::fidl_next::fuchsia::HandleDecoder,
5391{
5392 fn decode(
5393 slot: ::fidl_next::Slot<'_, Self>,
5394 decoder: &mut ___D,
5395 ) -> Result<(), ::fidl_next::DecodeError> {
5396 ::fidl_next::munge! {
5397 let Self {
5398 mut id,
5399 mut iterator,
5400
5401 } = slot;
5402 }
5403
5404 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
5405
5406 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
5407
5408 Ok(())
5409 }
5410}
5411
5412pub type CapabilityStoreDictionaryEnumerateResponse = ();
5413
5414pub type WireCapabilityStoreDictionaryEnumerateResponse = ();
5416
5417#[derive(Debug)]
5418pub struct CapabilityStoreDictionaryDrainRequest {
5419 pub id: u64,
5420
5421 pub iterator: Option<
5422 ::fidl_next::ServerEnd<crate::DictionaryDrainIterator, ::fidl_next::fuchsia::zx::Channel>,
5423 >,
5424}
5425
5426impl ::fidl_next::Encodable for CapabilityStoreDictionaryDrainRequest {
5427 type Encoded = WireCapabilityStoreDictionaryDrainRequest;
5428}
5429
5430unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryDrainRequest
5431where
5432 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5433
5434 ___E: ::fidl_next::fuchsia::HandleEncoder,
5435{
5436 #[inline]
5437 fn encode(
5438 self,
5439 encoder: &mut ___E,
5440 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5441 ) -> Result<(), ::fidl_next::EncodeError> {
5442 ::fidl_next::munge! {
5443 let Self::Encoded {
5444 id,
5445 iterator,
5446
5447 } = out;
5448 }
5449
5450 ::fidl_next::Encode::encode(self.id, encoder, id)?;
5451
5452 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
5453
5454 Ok(())
5455 }
5456}
5457
5458impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryDrainRequest {
5459 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryDrainRequest>;
5460}
5461
5462unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryDrainRequest
5463where
5464 ___E: ::fidl_next::Encoder + ?Sized,
5465 CapabilityStoreDictionaryDrainRequest: ::fidl_next::Encode<___E>,
5466{
5467 #[inline]
5468 fn encode_option(
5469 this: Option<Self>,
5470 encoder: &mut ___E,
5471 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5472 ) -> Result<(), ::fidl_next::EncodeError> {
5473 if let Some(inner) = this {
5474 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5475 ::fidl_next::WireBox::encode_present(out);
5476 } else {
5477 ::fidl_next::WireBox::encode_absent(out);
5478 }
5479
5480 Ok(())
5481 }
5482}
5483
5484impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryDrainRequest>
5485 for CapabilityStoreDictionaryDrainRequest
5486{
5487 #[inline]
5488 fn from_wire(wire: WireCapabilityStoreDictionaryDrainRequest) -> Self {
5489 Self {
5490 id: ::fidl_next::FromWire::from_wire(wire.id),
5491
5492 iterator: ::fidl_next::FromWire::from_wire(wire.iterator),
5493 }
5494 }
5495}
5496
5497#[derive(Debug)]
5499#[repr(C)]
5500pub struct WireCapabilityStoreDictionaryDrainRequest {
5501 pub id: ::fidl_next::WireU64,
5502
5503 pub iterator: ::fidl_next::ServerEnd<
5504 crate::DictionaryDrainIterator,
5505 ::fidl_next::fuchsia::WireOptionalChannel,
5506 >,
5507}
5508
5509unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryDrainRequest {
5510 type Decoded<'de> = WireCapabilityStoreDictionaryDrainRequest;
5511
5512 #[inline]
5513 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5514 unsafe {
5515 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
5516 }
5517 }
5518}
5519
5520unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryDrainRequest
5521where
5522 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5523
5524 ___D: ::fidl_next::fuchsia::HandleDecoder,
5525{
5526 fn decode(
5527 slot: ::fidl_next::Slot<'_, Self>,
5528 decoder: &mut ___D,
5529 ) -> Result<(), ::fidl_next::DecodeError> {
5530 ::fidl_next::munge! {
5531 let Self {
5532 mut id,
5533 mut iterator,
5534
5535 } = slot;
5536 }
5537
5538 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
5539
5540 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
5541
5542 Ok(())
5543 }
5544}
5545
5546pub type CapabilityStoreDictionaryDrainResponse = ();
5547
5548pub type WireCapabilityStoreDictionaryDrainResponse = ();
5550
5551#[doc = " Protocol that represents the concept of a \"capability store\", a repository\n for [Capability]s that are held by the component framework runtime.\n\n [CapabilityStore] serves as the main bridge between the component runtime and clients\n that enables them to operate on and exchange [Capability]s. A [CapabilityStore] instance\n contains a set of [Capability]s, each of which has a [CapabilityId] assigned by the client.\n\n Normally, a program would not exchange a [CapabilityStore] or [CapabilityId] with other\n programs -- a [CapabilityStore] connection and its enclosed capabilities are intended to\n be \"local\" to a program. Instead, if a program wishes to exchange a [Capability] with other\n programs, it should [Export] the [Capability] out of the store, send the [Capability] to the\n target program, which can then [Import] the capability into its own store.\n\n [CapabilityStore] is also used to manage capability lifetimes. The lifetime of a capability is\n scoped to the [CapabilityStore] in which it resides; i.e. to drop the [CapabilityStore]\n connections to release the capabilities instead it. In addition, [CapabilityStore] supports a\n [Drop] API to drop an individual [Capability] reference. (Note that it is possible for a\n some capabilities, like [DictionaryRef], to have multiple references, in which case all of\n the references must be dropped for the underlying resource to be released.)\n\n A note about semantics: the [CapabilityStore] APIs do not return [CapabilityId]s, because\n [CapabilityId]s are assigned by the client. Instead, when a method would semantically return\n a capability, this is expressed by taking the destination [CapabilityId] as an output parameter.\n"]
5553#[derive(Debug)]
5554pub struct CapabilityStore;
5555
5556impl ::fidl_next::Discoverable for CapabilityStore {
5557 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
5558}
5559
5560pub mod capability_store {
5561 pub mod prelude {
5562 pub use crate::{
5563 capability_store, CapabilityStore, CapabilityStoreClientHandler,
5564 CapabilityStoreServerHandler,
5565 };
5566
5567 pub use crate::CapabilityStoreConnectorCreateRequest;
5568
5569 pub use crate::CapabilityStoreConnectorOpenRequest;
5570
5571 pub use crate::CapabilityStoreDictionaryCopyRequest;
5572
5573 pub use crate::CapabilityStoreDictionaryCreateRequest;
5574
5575 pub use crate::CapabilityStoreDictionaryDrainRequest;
5576
5577 pub use crate::CapabilityStoreDictionaryEnumerateRequest;
5578
5579 pub use crate::CapabilityStoreDictionaryGetRequest;
5580
5581 pub use crate::CapabilityStoreDictionaryInsertRequest;
5582
5583 pub use crate::CapabilityStoreDictionaryKeysRequest;
5584
5585 pub use crate::CapabilityStoreDictionaryLegacyExportRequest;
5586
5587 pub use crate::CapabilityStoreDictionaryLegacyImportRequest;
5588
5589 pub use crate::CapabilityStoreDictionaryRemoveRequest;
5590
5591 pub use crate::CapabilityStoreDirConnectorCreateRequest;
5592
5593 pub use crate::CapabilityStoreDirConnectorOpenRequest;
5594
5595 pub use crate::CapabilityStoreDropRequest;
5596
5597 pub use crate::CapabilityStoreDuplicateRequest;
5598
5599 pub use crate::CapabilityStoreError;
5600
5601 pub use crate::CapabilityStoreExportRequest;
5602
5603 pub use crate::CapabilityStoreImportRequest;
5604
5605 pub use crate::CapabilityStoreConnectorCreateResponse;
5606
5607 pub use crate::CapabilityStoreConnectorOpenResponse;
5608
5609 pub use crate::CapabilityStoreDictionaryCopyResponse;
5610
5611 pub use crate::CapabilityStoreDictionaryCreateResponse;
5612
5613 pub use crate::CapabilityStoreDictionaryDrainResponse;
5614
5615 pub use crate::CapabilityStoreDictionaryEnumerateResponse;
5616
5617 pub use crate::CapabilityStoreDictionaryGetResponse;
5618
5619 pub use crate::CapabilityStoreDictionaryInsertResponse;
5620
5621 pub use crate::CapabilityStoreDictionaryKeysResponse;
5622
5623 pub use crate::CapabilityStoreDictionaryLegacyExportResponse;
5624
5625 pub use crate::CapabilityStoreDictionaryLegacyImportResponse;
5626
5627 pub use crate::CapabilityStoreDictionaryRemoveResponse;
5628
5629 pub use crate::CapabilityStoreDirConnectorCreateResponse;
5630
5631 pub use crate::CapabilityStoreDirConnectorOpenResponse;
5632
5633 pub use crate::CapabilityStoreDropResponse;
5634
5635 pub use crate::CapabilityStoreDuplicateResponse;
5636
5637 pub use crate::CapabilityStoreExportResponse;
5638
5639 pub use crate::CapabilityStoreImportResponse;
5640 }
5641
5642 pub struct Duplicate;
5643
5644 impl ::fidl_next::Method for Duplicate {
5645 const ORDINAL: u64 = 6727592627741008260;
5646
5647 type Protocol = crate::CapabilityStore;
5648
5649 type Request = crate::WireCapabilityStoreDuplicateRequest;
5650
5651 type Response = ::fidl_next::WireFlexibleResult<
5652 'static,
5653 crate::WireCapabilityStoreDuplicateResponse,
5654 crate::WireCapabilityStoreError,
5655 >;
5656 }
5657
5658 pub struct Drop;
5659
5660 impl ::fidl_next::Method for Drop {
5661 const ORDINAL: u64 = 753328233834620249;
5662
5663 type Protocol = crate::CapabilityStore;
5664
5665 type Request = crate::WireCapabilityStoreDropRequest;
5666
5667 type Response = ::fidl_next::WireFlexibleResult<
5668 'static,
5669 crate::WireCapabilityStoreDropResponse,
5670 crate::WireCapabilityStoreError,
5671 >;
5672 }
5673
5674 pub struct Export;
5675
5676 impl ::fidl_next::Method for Export {
5677 const ORDINAL: u64 = 226159162093533951;
5678
5679 type Protocol = crate::CapabilityStore;
5680
5681 type Request = crate::WireCapabilityStoreExportRequest;
5682
5683 type Response = ::fidl_next::WireFlexibleResult<
5684 'static,
5685 crate::WireCapabilityStoreExportResponse<'static>,
5686 crate::WireCapabilityStoreError,
5687 >;
5688 }
5689
5690 pub struct Import;
5691
5692 impl ::fidl_next::Method for Import {
5693 const ORDINAL: u64 = 2276030276116435867;
5694
5695 type Protocol = crate::CapabilityStore;
5696
5697 type Request = crate::WireCapabilityStoreImportRequest<'static>;
5698
5699 type Response = ::fidl_next::WireFlexibleResult<
5700 'static,
5701 crate::WireCapabilityStoreImportResponse,
5702 crate::WireCapabilityStoreError,
5703 >;
5704 }
5705
5706 pub struct ConnectorCreate;
5707
5708 impl ::fidl_next::Method for ConnectorCreate {
5709 const ORDINAL: u64 = 2979461408102095909;
5710
5711 type Protocol = crate::CapabilityStore;
5712
5713 type Request = crate::WireCapabilityStoreConnectorCreateRequest;
5714
5715 type Response = ::fidl_next::WireFlexibleResult<
5716 'static,
5717 crate::WireCapabilityStoreConnectorCreateResponse,
5718 crate::WireCapabilityStoreError,
5719 >;
5720 }
5721
5722 pub struct ConnectorOpen;
5723
5724 impl ::fidl_next::Method for ConnectorOpen {
5725 const ORDINAL: u64 = 6016362336453278623;
5726
5727 type Protocol = crate::CapabilityStore;
5728
5729 type Request = crate::WireCapabilityStoreConnectorOpenRequest;
5730
5731 type Response = ::fidl_next::WireFlexibleResult<
5732 'static,
5733 crate::WireCapabilityStoreConnectorOpenResponse,
5734 crate::WireCapabilityStoreError,
5735 >;
5736 }
5737
5738 pub struct DirConnectorCreate;
5739
5740 impl ::fidl_next::Method for DirConnectorCreate {
5741 const ORDINAL: u64 = 1756747594275428795;
5742
5743 type Protocol = crate::CapabilityStore;
5744
5745 type Request = crate::WireCapabilityStoreDirConnectorCreateRequest;
5746
5747 type Response = ::fidl_next::WireFlexibleResult<
5748 'static,
5749 crate::WireCapabilityStoreDirConnectorCreateResponse,
5750 crate::WireCapabilityStoreError,
5751 >;
5752 }
5753
5754 pub struct DirConnectorOpen;
5755
5756 impl ::fidl_next::Method for DirConnectorOpen {
5757 const ORDINAL: u64 = 6219704004220369153;
5758
5759 type Protocol = crate::CapabilityStore;
5760
5761 type Request = crate::WireCapabilityStoreDirConnectorOpenRequest;
5762
5763 type Response = ::fidl_next::WireFlexibleResult<
5764 'static,
5765 crate::WireCapabilityStoreDirConnectorOpenResponse,
5766 crate::WireCapabilityStoreError,
5767 >;
5768 }
5769
5770 pub struct DictionaryCreate;
5771
5772 impl ::fidl_next::Method for DictionaryCreate {
5773 const ORDINAL: u64 = 7608770958894948499;
5774
5775 type Protocol = crate::CapabilityStore;
5776
5777 type Request = crate::WireCapabilityStoreDictionaryCreateRequest;
5778
5779 type Response = ::fidl_next::WireFlexibleResult<
5780 'static,
5781 crate::WireCapabilityStoreDictionaryCreateResponse,
5782 crate::WireCapabilityStoreError,
5783 >;
5784 }
5785
5786 pub struct DictionaryLegacyImport;
5787
5788 impl ::fidl_next::Method for DictionaryLegacyImport {
5789 const ORDINAL: u64 = 8285893703432012383;
5790
5791 type Protocol = crate::CapabilityStore;
5792
5793 type Request = crate::WireCapabilityStoreDictionaryLegacyImportRequest;
5794
5795 type Response = ::fidl_next::WireFlexibleResult<
5796 'static,
5797 crate::WireCapabilityStoreDictionaryLegacyImportResponse,
5798 crate::WireCapabilityStoreError,
5799 >;
5800 }
5801
5802 pub struct DictionaryLegacyExport;
5803
5804 impl ::fidl_next::Method for DictionaryLegacyExport {
5805 const ORDINAL: u64 = 4647175832683306445;
5806
5807 type Protocol = crate::CapabilityStore;
5808
5809 type Request = crate::WireCapabilityStoreDictionaryLegacyExportRequest;
5810
5811 type Response = ::fidl_next::WireFlexibleResult<
5812 'static,
5813 crate::WireCapabilityStoreDictionaryLegacyExportResponse,
5814 crate::WireCapabilityStoreError,
5815 >;
5816 }
5817
5818 pub struct DictionaryInsert;
5819
5820 impl ::fidl_next::Method for DictionaryInsert {
5821 const ORDINAL: u64 = 8575443262986538023;
5822
5823 type Protocol = crate::CapabilityStore;
5824
5825 type Request = crate::WireCapabilityStoreDictionaryInsertRequest<'static>;
5826
5827 type Response = ::fidl_next::WireFlexibleResult<
5828 'static,
5829 crate::WireCapabilityStoreDictionaryInsertResponse,
5830 crate::WireCapabilityStoreError,
5831 >;
5832 }
5833
5834 pub struct DictionaryGet;
5835
5836 impl ::fidl_next::Method for DictionaryGet {
5837 const ORDINAL: u64 = 5592951026866236882;
5838
5839 type Protocol = crate::CapabilityStore;
5840
5841 type Request = crate::WireCapabilityStoreDictionaryGetRequest<'static>;
5842
5843 type Response = ::fidl_next::WireFlexibleResult<
5844 'static,
5845 crate::WireCapabilityStoreDictionaryGetResponse,
5846 crate::WireCapabilityStoreError,
5847 >;
5848 }
5849
5850 pub struct DictionaryRemove;
5851
5852 impl ::fidl_next::Method for DictionaryRemove {
5853 const ORDINAL: u64 = 343892214579320051;
5854
5855 type Protocol = crate::CapabilityStore;
5856
5857 type Request = crate::WireCapabilityStoreDictionaryRemoveRequest<'static>;
5858
5859 type Response = ::fidl_next::WireFlexibleResult<
5860 'static,
5861 crate::WireCapabilityStoreDictionaryRemoveResponse,
5862 crate::WireCapabilityStoreError,
5863 >;
5864 }
5865
5866 pub struct DictionaryCopy;
5867
5868 impl ::fidl_next::Method for DictionaryCopy {
5869 const ORDINAL: u64 = 3977783339739362383;
5870
5871 type Protocol = crate::CapabilityStore;
5872
5873 type Request = crate::WireCapabilityStoreDictionaryCopyRequest;
5874
5875 type Response = ::fidl_next::WireFlexibleResult<
5876 'static,
5877 crate::WireCapabilityStoreDictionaryCopyResponse,
5878 crate::WireCapabilityStoreError,
5879 >;
5880 }
5881
5882 pub struct DictionaryKeys;
5883
5884 impl ::fidl_next::Method for DictionaryKeys {
5885 const ORDINAL: u64 = 597577248872787102;
5886
5887 type Protocol = crate::CapabilityStore;
5888
5889 type Request = crate::WireCapabilityStoreDictionaryKeysRequest;
5890
5891 type Response = ::fidl_next::WireFlexibleResult<
5892 'static,
5893 crate::WireCapabilityStoreDictionaryKeysResponse,
5894 crate::WireCapabilityStoreError,
5895 >;
5896 }
5897
5898 pub struct DictionaryEnumerate;
5899
5900 impl ::fidl_next::Method for DictionaryEnumerate {
5901 const ORDINAL: u64 = 964467096271472193;
5902
5903 type Protocol = crate::CapabilityStore;
5904
5905 type Request = crate::WireCapabilityStoreDictionaryEnumerateRequest;
5906
5907 type Response = ::fidl_next::WireFlexibleResult<
5908 'static,
5909 crate::WireCapabilityStoreDictionaryEnumerateResponse,
5910 crate::WireCapabilityStoreError,
5911 >;
5912 }
5913
5914 pub struct DictionaryDrain;
5915
5916 impl ::fidl_next::Method for DictionaryDrain {
5917 const ORDINAL: u64 = 2928364469569621208;
5918
5919 type Protocol = crate::CapabilityStore;
5920
5921 type Request = crate::WireCapabilityStoreDictionaryDrainRequest;
5922
5923 type Response = ::fidl_next::WireFlexibleResult<
5924 'static,
5925 crate::WireCapabilityStoreDictionaryDrainResponse,
5926 crate::WireCapabilityStoreError,
5927 >;
5928 }
5929
5930 mod ___detail {
5931
5932 pub struct Duplicate<T0, T1> {
5933 id: T0,
5934
5935 dest_id: T1,
5936 }
5937
5938 impl<T0, T1> ::fidl_next::Encodable for Duplicate<T0, T1>
5939 where
5940 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
5941
5942 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
5943 {
5944 type Encoded = crate::WireCapabilityStoreDuplicateRequest;
5945 }
5946
5947 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Duplicate<T0, T1>
5948 where
5949 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5950
5951 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
5952
5953 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
5954 {
5955 #[inline]
5956 fn encode(
5957 self,
5958 encoder: &mut ___E,
5959 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5960 ) -> Result<(), ::fidl_next::EncodeError> {
5961 ::fidl_next::munge! {
5962 let Self::Encoded {
5963 id,
5964 dest_id,
5965
5966 } = out;
5967 }
5968
5969 ::fidl_next::Encode::encode(self.id, encoder, id)?;
5970
5971 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
5972
5973 Ok(())
5974 }
5975 }
5976
5977 pub struct Drop<T0> {
5978 id: T0,
5979 }
5980
5981 impl<T0> ::fidl_next::Encodable for Drop<T0>
5982 where
5983 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
5984 {
5985 type Encoded = crate::WireCapabilityStoreDropRequest;
5986 }
5987
5988 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Drop<T0>
5989 where
5990 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5991
5992 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
5993 {
5994 #[inline]
5995 fn encode(
5996 self,
5997 encoder: &mut ___E,
5998 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5999 ) -> Result<(), ::fidl_next::EncodeError> {
6000 ::fidl_next::munge! {
6001 let Self::Encoded {
6002 id,
6003
6004 } = out;
6005 }
6006
6007 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6008
6009 Ok(())
6010 }
6011 }
6012
6013 pub struct Export<T0> {
6014 id: T0,
6015 }
6016
6017 impl<T0> ::fidl_next::Encodable for Export<T0>
6018 where
6019 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6020 {
6021 type Encoded = crate::WireCapabilityStoreExportRequest;
6022 }
6023
6024 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Export<T0>
6025 where
6026 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6027
6028 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6029 {
6030 #[inline]
6031 fn encode(
6032 self,
6033 encoder: &mut ___E,
6034 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6035 ) -> Result<(), ::fidl_next::EncodeError> {
6036 ::fidl_next::munge! {
6037 let Self::Encoded {
6038 id,
6039
6040 } = out;
6041 }
6042
6043 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6044
6045 Ok(())
6046 }
6047 }
6048
6049 pub struct Import<T0, T1> {
6050 id: T0,
6051
6052 capability: T1,
6053 }
6054
6055 impl<T0, T1> ::fidl_next::Encodable for Import<T0, T1>
6056 where
6057 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6058
6059 T1: ::fidl_next::Encodable<Encoded = crate::WireCapability<'static>>,
6060 {
6061 type Encoded = crate::WireCapabilityStoreImportRequest<'static>;
6062 }
6063
6064 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Import<T0, T1>
6065 where
6066 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6067
6068 ___E: ::fidl_next::Encoder,
6069
6070 ___E: ::fidl_next::fuchsia::HandleEncoder,
6071
6072 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6073
6074 T1: ::fidl_next::Encode<___E, Encoded = crate::WireCapability<'static>>,
6075 {
6076 #[inline]
6077 fn encode(
6078 self,
6079 encoder: &mut ___E,
6080 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6081 ) -> Result<(), ::fidl_next::EncodeError> {
6082 ::fidl_next::munge! {
6083 let Self::Encoded {
6084 id,
6085 capability,
6086
6087 } = out;
6088 }
6089
6090 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6091
6092 ::fidl_next::Encode::encode(self.capability, encoder, capability)?;
6093
6094 Ok(())
6095 }
6096 }
6097
6098 pub struct ConnectorCreate<T0, T1> {
6099 id: T0,
6100
6101 receiver: T1,
6102 }
6103
6104 impl<T0, T1> ::fidl_next::Encodable for ConnectorCreate<T0, T1>
6105 where
6106 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6107
6108 T1: ::fidl_next::Encodable<
6109 Encoded = ::fidl_next::ClientEnd<
6110 crate::Receiver,
6111 ::fidl_next::fuchsia::WireChannel,
6112 >,
6113 >,
6114 {
6115 type Encoded = crate::WireCapabilityStoreConnectorCreateRequest;
6116 }
6117
6118 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for ConnectorCreate<T0, T1>
6119 where
6120 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6121
6122 ___E: ::fidl_next::fuchsia::HandleEncoder,
6123
6124 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6125
6126 T1: ::fidl_next::Encode<
6127 ___E,
6128 Encoded = ::fidl_next::ClientEnd<
6129 crate::Receiver,
6130 ::fidl_next::fuchsia::WireChannel,
6131 >,
6132 >,
6133 {
6134 #[inline]
6135 fn encode(
6136 self,
6137 encoder: &mut ___E,
6138 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6139 ) -> Result<(), ::fidl_next::EncodeError> {
6140 ::fidl_next::munge! {
6141 let Self::Encoded {
6142 id,
6143 receiver,
6144
6145 } = out;
6146 }
6147
6148 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6149
6150 ::fidl_next::Encode::encode(self.receiver, encoder, receiver)?;
6151
6152 Ok(())
6153 }
6154 }
6155
6156 pub struct ConnectorOpen<T0, T1> {
6157 id: T0,
6158
6159 server_end: T1,
6160 }
6161
6162 impl<T0, T1> ::fidl_next::Encodable for ConnectorOpen<T0, T1>
6163 where
6164 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6165
6166 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
6167 {
6168 type Encoded = crate::WireCapabilityStoreConnectorOpenRequest;
6169 }
6170
6171 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for ConnectorOpen<T0, T1>
6172 where
6173 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6174
6175 ___E: ::fidl_next::fuchsia::HandleEncoder,
6176
6177 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6178
6179 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
6180 {
6181 #[inline]
6182 fn encode(
6183 self,
6184 encoder: &mut ___E,
6185 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6186 ) -> Result<(), ::fidl_next::EncodeError> {
6187 ::fidl_next::munge! {
6188 let Self::Encoded {
6189 id,
6190 server_end,
6191
6192 } = out;
6193 }
6194
6195 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6196
6197 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
6198
6199 Ok(())
6200 }
6201 }
6202
6203 pub struct DirConnectorCreate<T0, T1> {
6204 id: T0,
6205
6206 receiver: T1,
6207 }
6208
6209 impl<T0, T1> ::fidl_next::Encodable for DirConnectorCreate<T0, T1>
6210 where
6211 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6212
6213 T1: ::fidl_next::Encodable<
6214 Encoded = ::fidl_next::ClientEnd<
6215 crate::DirReceiver,
6216 ::fidl_next::fuchsia::WireChannel,
6217 >,
6218 >,
6219 {
6220 type Encoded = crate::WireCapabilityStoreDirConnectorCreateRequest;
6221 }
6222
6223 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DirConnectorCreate<T0, T1>
6224 where
6225 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6226
6227 ___E: ::fidl_next::fuchsia::HandleEncoder,
6228
6229 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6230
6231 T1: ::fidl_next::Encode<
6232 ___E,
6233 Encoded = ::fidl_next::ClientEnd<
6234 crate::DirReceiver,
6235 ::fidl_next::fuchsia::WireChannel,
6236 >,
6237 >,
6238 {
6239 #[inline]
6240 fn encode(
6241 self,
6242 encoder: &mut ___E,
6243 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6244 ) -> Result<(), ::fidl_next::EncodeError> {
6245 ::fidl_next::munge! {
6246 let Self::Encoded {
6247 id,
6248 receiver,
6249
6250 } = out;
6251 }
6252
6253 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6254
6255 ::fidl_next::Encode::encode(self.receiver, encoder, receiver)?;
6256
6257 Ok(())
6258 }
6259 }
6260
6261 pub struct DirConnectorOpen<T0, T1> {
6262 id: T0,
6263
6264 server_end: T1,
6265 }
6266
6267 impl<T0, T1> ::fidl_next::Encodable for DirConnectorOpen<T0, T1>
6268 where
6269 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6270
6271 T1: ::fidl_next::Encodable<
6272 Encoded = ::fidl_next::ServerEnd<
6273 ::fidl_next_fuchsia_io::Directory,
6274 ::fidl_next::fuchsia::WireChannel,
6275 >,
6276 >,
6277 {
6278 type Encoded = crate::WireCapabilityStoreDirConnectorOpenRequest;
6279 }
6280
6281 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DirConnectorOpen<T0, T1>
6282 where
6283 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6284
6285 ___E: ::fidl_next::fuchsia::HandleEncoder,
6286
6287 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6288
6289 T1: ::fidl_next::Encode<
6290 ___E,
6291 Encoded = ::fidl_next::ServerEnd<
6292 ::fidl_next_fuchsia_io::Directory,
6293 ::fidl_next::fuchsia::WireChannel,
6294 >,
6295 >,
6296 {
6297 #[inline]
6298 fn encode(
6299 self,
6300 encoder: &mut ___E,
6301 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6302 ) -> Result<(), ::fidl_next::EncodeError> {
6303 ::fidl_next::munge! {
6304 let Self::Encoded {
6305 id,
6306 server_end,
6307
6308 } = out;
6309 }
6310
6311 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6312
6313 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
6314
6315 Ok(())
6316 }
6317 }
6318
6319 pub struct DictionaryCreate<T0> {
6320 id: T0,
6321 }
6322
6323 impl<T0> ::fidl_next::Encodable for DictionaryCreate<T0>
6324 where
6325 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6326 {
6327 type Encoded = crate::WireCapabilityStoreDictionaryCreateRequest;
6328 }
6329
6330 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for DictionaryCreate<T0>
6331 where
6332 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6333
6334 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6335 {
6336 #[inline]
6337 fn encode(
6338 self,
6339 encoder: &mut ___E,
6340 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6341 ) -> Result<(), ::fidl_next::EncodeError> {
6342 ::fidl_next::munge! {
6343 let Self::Encoded {
6344 id,
6345
6346 } = out;
6347 }
6348
6349 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6350
6351 Ok(())
6352 }
6353 }
6354
6355 pub struct DictionaryLegacyImport<T0, T1> {
6356 id: T0,
6357
6358 client_end: T1,
6359 }
6360
6361 impl<T0, T1> ::fidl_next::Encodable for DictionaryLegacyImport<T0, T1>
6362 where
6363 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6364
6365 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
6366 {
6367 type Encoded = crate::WireCapabilityStoreDictionaryLegacyImportRequest;
6368 }
6369
6370 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DictionaryLegacyImport<T0, T1>
6371 where
6372 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6373
6374 ___E: ::fidl_next::fuchsia::HandleEncoder,
6375
6376 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6377
6378 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
6379 {
6380 #[inline]
6381 fn encode(
6382 self,
6383 encoder: &mut ___E,
6384 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6385 ) -> Result<(), ::fidl_next::EncodeError> {
6386 ::fidl_next::munge! {
6387 let Self::Encoded {
6388 id,
6389 client_end,
6390
6391 } = out;
6392 }
6393
6394 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6395
6396 ::fidl_next::Encode::encode(self.client_end, encoder, client_end)?;
6397
6398 Ok(())
6399 }
6400 }
6401
6402 pub struct DictionaryLegacyExport<T0, T1> {
6403 id: T0,
6404
6405 server_end: T1,
6406 }
6407
6408 impl<T0, T1> ::fidl_next::Encodable for DictionaryLegacyExport<T0, T1>
6409 where
6410 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6411
6412 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
6413 {
6414 type Encoded = crate::WireCapabilityStoreDictionaryLegacyExportRequest;
6415 }
6416
6417 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DictionaryLegacyExport<T0, T1>
6418 where
6419 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6420
6421 ___E: ::fidl_next::fuchsia::HandleEncoder,
6422
6423 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6424
6425 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
6426 {
6427 #[inline]
6428 fn encode(
6429 self,
6430 encoder: &mut ___E,
6431 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6432 ) -> Result<(), ::fidl_next::EncodeError> {
6433 ::fidl_next::munge! {
6434 let Self::Encoded {
6435 id,
6436 server_end,
6437
6438 } = out;
6439 }
6440
6441 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6442
6443 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
6444
6445 Ok(())
6446 }
6447 }
6448
6449 pub struct DictionaryInsert<T0, T1> {
6450 id: T0,
6451
6452 item: T1,
6453 }
6454
6455 impl<T0, T1> ::fidl_next::Encodable for DictionaryInsert<T0, T1>
6456 where
6457 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6458
6459 T1: ::fidl_next::Encodable<Encoded = crate::WireDictionaryItem<'static>>,
6460 {
6461 type Encoded = crate::WireCapabilityStoreDictionaryInsertRequest<'static>;
6462 }
6463
6464 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DictionaryInsert<T0, T1>
6465 where
6466 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6467
6468 ___E: ::fidl_next::Encoder,
6469
6470 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6471
6472 T1: ::fidl_next::Encode<___E, Encoded = crate::WireDictionaryItem<'static>>,
6473 {
6474 #[inline]
6475 fn encode(
6476 self,
6477 encoder: &mut ___E,
6478 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6479 ) -> Result<(), ::fidl_next::EncodeError> {
6480 ::fidl_next::munge! {
6481 let Self::Encoded {
6482 id,
6483 item,
6484
6485 } = out;
6486 }
6487
6488 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6489
6490 ::fidl_next::Encode::encode(self.item, encoder, item)?;
6491
6492 Ok(())
6493 }
6494 }
6495
6496 pub struct DictionaryGet<T0, T1, T2> {
6497 id: T0,
6498
6499 key: T1,
6500
6501 dest_id: T2,
6502 }
6503
6504 impl<T0, T1, T2> ::fidl_next::Encodable for DictionaryGet<T0, T1, T2>
6505 where
6506 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6507
6508 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
6509
6510 T2: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6511 {
6512 type Encoded = crate::WireCapabilityStoreDictionaryGetRequest<'static>;
6513 }
6514
6515 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for DictionaryGet<T0, T1, T2>
6516 where
6517 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6518
6519 ___E: ::fidl_next::Encoder,
6520
6521 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6522
6523 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
6524
6525 T2: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6526 {
6527 #[inline]
6528 fn encode(
6529 self,
6530 encoder: &mut ___E,
6531 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6532 ) -> Result<(), ::fidl_next::EncodeError> {
6533 ::fidl_next::munge! {
6534 let Self::Encoded {
6535 id,
6536 key,
6537 dest_id,
6538
6539 } = out;
6540 }
6541
6542 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6543
6544 ::fidl_next::Encode::encode(self.key, encoder, key)?;
6545
6546 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
6547
6548 Ok(())
6549 }
6550 }
6551
6552 pub struct DictionaryRemove<T0, T1, T2> {
6553 id: T0,
6554
6555 key: T1,
6556
6557 dest_id: T2,
6558 }
6559
6560 impl<T0, T1, T2> ::fidl_next::Encodable for DictionaryRemove<T0, T1, T2>
6561 where
6562 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6563
6564 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
6565
6566 T2: ::fidl_next::Encodable<
6567 Encoded = ::fidl_next::WireBox<'static, crate::WireWrappedCapabilityId>,
6568 >,
6569 {
6570 type Encoded = crate::WireCapabilityStoreDictionaryRemoveRequest<'static>;
6571 }
6572
6573 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<___E> for DictionaryRemove<T0, T1, T2>
6574 where
6575 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6576
6577 ___E: ::fidl_next::Encoder,
6578
6579 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6580
6581 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
6582
6583 T2: ::fidl_next::Encode<
6584 ___E,
6585 Encoded = ::fidl_next::WireBox<'static, crate::WireWrappedCapabilityId>,
6586 >,
6587 {
6588 #[inline]
6589 fn encode(
6590 self,
6591 encoder: &mut ___E,
6592 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6593 ) -> Result<(), ::fidl_next::EncodeError> {
6594 ::fidl_next::munge! {
6595 let Self::Encoded {
6596 id,
6597 key,
6598 dest_id,
6599
6600 } = out;
6601 }
6602
6603 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6604
6605 ::fidl_next::Encode::encode(self.key, encoder, key)?;
6606
6607 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
6608
6609 Ok(())
6610 }
6611 }
6612
6613 pub struct DictionaryCopy<T0, T1> {
6614 id: T0,
6615
6616 dest_id: T1,
6617 }
6618
6619 impl<T0, T1> ::fidl_next::Encodable for DictionaryCopy<T0, T1>
6620 where
6621 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6622
6623 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6624 {
6625 type Encoded = crate::WireCapabilityStoreDictionaryCopyRequest;
6626 }
6627
6628 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DictionaryCopy<T0, T1>
6629 where
6630 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6631
6632 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6633
6634 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6635 {
6636 #[inline]
6637 fn encode(
6638 self,
6639 encoder: &mut ___E,
6640 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6641 ) -> Result<(), ::fidl_next::EncodeError> {
6642 ::fidl_next::munge! {
6643 let Self::Encoded {
6644 id,
6645 dest_id,
6646
6647 } = out;
6648 }
6649
6650 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6651
6652 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
6653
6654 Ok(())
6655 }
6656 }
6657
6658 pub struct DictionaryKeys<T0, T1> {
6659 id: T0,
6660
6661 iterator: T1,
6662 }
6663
6664 impl<T0, T1> ::fidl_next::Encodable for DictionaryKeys<T0, T1>
6665 where
6666 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6667
6668 T1: ::fidl_next::Encodable<
6669 Encoded = ::fidl_next::ServerEnd<
6670 crate::DictionaryKeysIterator,
6671 ::fidl_next::fuchsia::WireChannel,
6672 >,
6673 >,
6674 {
6675 type Encoded = crate::WireCapabilityStoreDictionaryKeysRequest;
6676 }
6677
6678 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DictionaryKeys<T0, T1>
6679 where
6680 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6681
6682 ___E: ::fidl_next::fuchsia::HandleEncoder,
6683
6684 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6685
6686 T1: ::fidl_next::Encode<
6687 ___E,
6688 Encoded = ::fidl_next::ServerEnd<
6689 crate::DictionaryKeysIterator,
6690 ::fidl_next::fuchsia::WireChannel,
6691 >,
6692 >,
6693 {
6694 #[inline]
6695 fn encode(
6696 self,
6697 encoder: &mut ___E,
6698 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6699 ) -> Result<(), ::fidl_next::EncodeError> {
6700 ::fidl_next::munge! {
6701 let Self::Encoded {
6702 id,
6703 iterator,
6704
6705 } = out;
6706 }
6707
6708 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6709
6710 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
6711
6712 Ok(())
6713 }
6714 }
6715
6716 pub struct DictionaryEnumerate<T0, T1> {
6717 id: T0,
6718
6719 iterator: T1,
6720 }
6721
6722 impl<T0, T1> ::fidl_next::Encodable for DictionaryEnumerate<T0, T1>
6723 where
6724 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6725
6726 T1: ::fidl_next::Encodable<
6727 Encoded = ::fidl_next::ServerEnd<
6728 crate::DictionaryEnumerateIterator,
6729 ::fidl_next::fuchsia::WireChannel,
6730 >,
6731 >,
6732 {
6733 type Encoded = crate::WireCapabilityStoreDictionaryEnumerateRequest;
6734 }
6735
6736 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DictionaryEnumerate<T0, T1>
6737 where
6738 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6739
6740 ___E: ::fidl_next::fuchsia::HandleEncoder,
6741
6742 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6743
6744 T1: ::fidl_next::Encode<
6745 ___E,
6746 Encoded = ::fidl_next::ServerEnd<
6747 crate::DictionaryEnumerateIterator,
6748 ::fidl_next::fuchsia::WireChannel,
6749 >,
6750 >,
6751 {
6752 #[inline]
6753 fn encode(
6754 self,
6755 encoder: &mut ___E,
6756 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6757 ) -> Result<(), ::fidl_next::EncodeError> {
6758 ::fidl_next::munge! {
6759 let Self::Encoded {
6760 id,
6761 iterator,
6762
6763 } = out;
6764 }
6765
6766 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6767
6768 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
6769
6770 Ok(())
6771 }
6772 }
6773
6774 pub struct DictionaryDrain<T0, T1> {
6775 id: T0,
6776
6777 iterator: T1,
6778 }
6779
6780 impl<T0, T1> ::fidl_next::Encodable for DictionaryDrain<T0, T1>
6781 where
6782 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
6783
6784 T1: ::fidl_next::Encodable<
6785 Encoded = ::fidl_next::ServerEnd<
6786 crate::DictionaryDrainIterator,
6787 ::fidl_next::fuchsia::WireOptionalChannel,
6788 >,
6789 >,
6790 {
6791 type Encoded = crate::WireCapabilityStoreDictionaryDrainRequest;
6792 }
6793
6794 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for DictionaryDrain<T0, T1>
6795 where
6796 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6797
6798 ___E: ::fidl_next::fuchsia::HandleEncoder,
6799
6800 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
6801
6802 T1: ::fidl_next::Encode<
6803 ___E,
6804 Encoded = ::fidl_next::ServerEnd<
6805 crate::DictionaryDrainIterator,
6806 ::fidl_next::fuchsia::WireOptionalChannel,
6807 >,
6808 >,
6809 {
6810 #[inline]
6811 fn encode(
6812 self,
6813 encoder: &mut ___E,
6814 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6815 ) -> Result<(), ::fidl_next::EncodeError> {
6816 ::fidl_next::munge! {
6817 let Self::Encoded {
6818 id,
6819 iterator,
6820
6821 } = out;
6822 }
6823
6824 ::fidl_next::Encode::encode(self.id, encoder, id)?;
6825
6826 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
6827
6828 Ok(())
6829 }
6830 }
6831
6832 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::CapabilityStore
6833 where
6834 ___T: ::fidl_next::Transport,
6835 {
6836 type ClientSender = CapabilityStoreClientSender<___T>;
6837 type ServerSender = CapabilityStoreServerSender<___T>;
6838 }
6839
6840 pub struct CapabilityStoreClientSender<___T: ::fidl_next::Transport> {
6842 #[allow(dead_code)]
6843 sender: ::fidl_next::protocol::ClientSender<___T>,
6844 }
6845
6846 impl<___T> CapabilityStoreClientSender<___T>
6847 where
6848 ___T: ::fidl_next::Transport,
6849 {
6850 #[doc = " Duplicates the capability with `id` to `dest_id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `NOT_DUPLICATABLE` if `id` could not be duplicated.\n"]
6851 pub fn duplicate(
6852 &self,
6853
6854 id: impl ::fidl_next::Encode<
6855 <___T as ::fidl_next::Transport>::SendBuffer,
6856 Encoded = ::fidl_next::WireU64,
6857 >,
6858
6859 dest_id: impl ::fidl_next::Encode<
6860 <___T as ::fidl_next::Transport>::SendBuffer,
6861 Encoded = ::fidl_next::WireU64,
6862 >,
6863 ) -> Result<
6864 ::fidl_next::ResponseFuture<'_, super::Duplicate, ___T>,
6865 ::fidl_next::EncodeError,
6866 >
6867 where
6868 <___T as ::fidl_next::Transport>::SendBuffer:
6869 ::fidl_next::encoder::InternalHandleEncoder,
6870 {
6871 self.duplicate_with(Duplicate { id, dest_id })
6872 }
6873
6874 #[doc = " Duplicates the capability with `id` to `dest_id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `NOT_DUPLICATABLE` if `id` could not be duplicated.\n"]
6875 pub fn duplicate_with<___R>(
6876 &self,
6877 request: ___R,
6878 ) -> Result<
6879 ::fidl_next::ResponseFuture<'_, super::Duplicate, ___T>,
6880 ::fidl_next::EncodeError,
6881 >
6882 where
6883 ___R: ::fidl_next::Encode<
6884 <___T as ::fidl_next::Transport>::SendBuffer,
6885 Encoded = crate::WireCapabilityStoreDuplicateRequest,
6886 >,
6887 {
6888 self.sender
6889 .send_two_way(6727592627741008260, request)
6890 .map(::fidl_next::ResponseFuture::from_untyped)
6891 }
6892
6893 #[doc = " Drops the capability with `id` from this [`CapabilityStore`].\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
6894 pub fn drop(
6895 &self,
6896
6897 id: impl ::fidl_next::Encode<
6898 <___T as ::fidl_next::Transport>::SendBuffer,
6899 Encoded = ::fidl_next::WireU64,
6900 >,
6901 ) -> Result<::fidl_next::ResponseFuture<'_, super::Drop, ___T>, ::fidl_next::EncodeError>
6902 where
6903 <___T as ::fidl_next::Transport>::SendBuffer:
6904 ::fidl_next::encoder::InternalHandleEncoder,
6905 {
6906 self.drop_with(Drop { id })
6907 }
6908
6909 #[doc = " Drops the capability with `id` from this [`CapabilityStore`].\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
6910 pub fn drop_with<___R>(
6911 &self,
6912 request: ___R,
6913 ) -> Result<::fidl_next::ResponseFuture<'_, super::Drop, ___T>, ::fidl_next::EncodeError>
6914 where
6915 ___R: ::fidl_next::Encode<
6916 <___T as ::fidl_next::Transport>::SendBuffer,
6917 Encoded = crate::WireCapabilityStoreDropRequest,
6918 >,
6919 {
6920 self.sender
6921 .send_two_way(753328233834620249, request)
6922 .map(::fidl_next::ResponseFuture::from_untyped)
6923 }
6924
6925 #[doc = " Exports the capability with the client-assigned identifier `id` to\n `capability`. This operation removes the capability from the store. If\n this is not desired, [Duplicate] the capability first.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
6926 pub fn export(
6927 &self,
6928
6929 id: impl ::fidl_next::Encode<
6930 <___T as ::fidl_next::Transport>::SendBuffer,
6931 Encoded = ::fidl_next::WireU64,
6932 >,
6933 ) -> Result<
6934 ::fidl_next::ResponseFuture<'_, super::Export, ___T>,
6935 ::fidl_next::EncodeError,
6936 >
6937 where
6938 <___T as ::fidl_next::Transport>::SendBuffer:
6939 ::fidl_next::encoder::InternalHandleEncoder,
6940 {
6941 self.export_with(Export { id })
6942 }
6943
6944 #[doc = " Exports the capability with the client-assigned identifier `id` to\n `capability`. This operation removes the capability from the store. If\n this is not desired, [Duplicate] the capability first.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
6945 pub fn export_with<___R>(
6946 &self,
6947 request: ___R,
6948 ) -> Result<
6949 ::fidl_next::ResponseFuture<'_, super::Export, ___T>,
6950 ::fidl_next::EncodeError,
6951 >
6952 where
6953 ___R: ::fidl_next::Encode<
6954 <___T as ::fidl_next::Transport>::SendBuffer,
6955 Encoded = crate::WireCapabilityStoreExportRequest,
6956 >,
6957 {
6958 self.sender
6959 .send_two_way(226159162093533951, request)
6960 .map(::fidl_next::ResponseFuture::from_untyped)
6961 }
6962
6963 #[doc = " Imports `capability` into this store with the client-assigned `id`.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n - `BAD_CAPABILITY` if `capability` was not a valid [Capability].\n"]
6964 pub fn import(
6965 &self,
6966
6967 id: impl ::fidl_next::Encode<
6968 <___T as ::fidl_next::Transport>::SendBuffer,
6969 Encoded = ::fidl_next::WireU64,
6970 >,
6971
6972 capability: impl ::fidl_next::Encode<
6973 <___T as ::fidl_next::Transport>::SendBuffer,
6974 Encoded = crate::WireCapability<'static>,
6975 >,
6976 ) -> Result<
6977 ::fidl_next::ResponseFuture<'_, super::Import, ___T>,
6978 ::fidl_next::EncodeError,
6979 >
6980 where
6981 <___T as ::fidl_next::Transport>::SendBuffer:
6982 ::fidl_next::encoder::InternalHandleEncoder,
6983
6984 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
6985
6986 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
6987 {
6988 self.import_with(Import { id, capability })
6989 }
6990
6991 #[doc = " Imports `capability` into this store with the client-assigned `id`.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n - `BAD_CAPABILITY` if `capability` was not a valid [Capability].\n"]
6992 pub fn import_with<___R>(
6993 &self,
6994 request: ___R,
6995 ) -> Result<
6996 ::fidl_next::ResponseFuture<'_, super::Import, ___T>,
6997 ::fidl_next::EncodeError,
6998 >
6999 where
7000 ___R: ::fidl_next::Encode<
7001 <___T as ::fidl_next::Transport>::SendBuffer,
7002 Encoded = crate::WireCapabilityStoreImportRequest<'static>,
7003 >,
7004 {
7005 self.sender
7006 .send_two_way(2276030276116435867, request)
7007 .map(::fidl_next::ResponseFuture::from_untyped)
7008 }
7009
7010 #[doc = " Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be\n dispatched to this [Receiver].\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7011 pub fn connector_create(
7012 &self,
7013
7014 id: impl ::fidl_next::Encode<
7015 <___T as ::fidl_next::Transport>::SendBuffer,
7016 Encoded = ::fidl_next::WireU64,
7017 >,
7018
7019 receiver: impl ::fidl_next::Encode<
7020 <___T as ::fidl_next::Transport>::SendBuffer,
7021 Encoded = ::fidl_next::ClientEnd<
7022 crate::Receiver,
7023 ::fidl_next::fuchsia::WireChannel,
7024 >,
7025 >,
7026 ) -> Result<
7027 ::fidl_next::ResponseFuture<'_, super::ConnectorCreate, ___T>,
7028 ::fidl_next::EncodeError,
7029 >
7030 where
7031 <___T as ::fidl_next::Transport>::SendBuffer:
7032 ::fidl_next::encoder::InternalHandleEncoder,
7033
7034 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7035 {
7036 self.connector_create_with(ConnectorCreate { id, receiver })
7037 }
7038
7039 #[doc = " Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be\n dispatched to this [Receiver].\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7040 pub fn connector_create_with<___R>(
7041 &self,
7042 request: ___R,
7043 ) -> Result<
7044 ::fidl_next::ResponseFuture<'_, super::ConnectorCreate, ___T>,
7045 ::fidl_next::EncodeError,
7046 >
7047 where
7048 ___R: ::fidl_next::Encode<
7049 <___T as ::fidl_next::Transport>::SendBuffer,
7050 Encoded = crate::WireCapabilityStoreConnectorCreateRequest,
7051 >,
7052 {
7053 self.sender
7054 .send_two_way(2979461408102095909, request)
7055 .map(::fidl_next::ResponseFuture::from_untyped)
7056 }
7057
7058 #[doc = " Open a connection from the provided [Connector] capability that will be dispatched to\n the [Receiver] on the other end.\n\n If there is an error, it will be reported as a zx.Status epitaph on `server_end`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a connector capability.\n"]
7059 pub fn connector_open(
7060 &self,
7061
7062 id: impl ::fidl_next::Encode<
7063 <___T as ::fidl_next::Transport>::SendBuffer,
7064 Encoded = ::fidl_next::WireU64,
7065 >,
7066
7067 server_end: impl ::fidl_next::Encode<
7068 <___T as ::fidl_next::Transport>::SendBuffer,
7069 Encoded = ::fidl_next::fuchsia::WireHandle,
7070 >,
7071 ) -> Result<
7072 ::fidl_next::ResponseFuture<'_, super::ConnectorOpen, ___T>,
7073 ::fidl_next::EncodeError,
7074 >
7075 where
7076 <___T as ::fidl_next::Transport>::SendBuffer:
7077 ::fidl_next::encoder::InternalHandleEncoder,
7078
7079 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7080 {
7081 self.connector_open_with(ConnectorOpen { id, server_end })
7082 }
7083
7084 #[doc = " Open a connection from the provided [Connector] capability that will be dispatched to\n the [Receiver] on the other end.\n\n If there is an error, it will be reported as a zx.Status epitaph on `server_end`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a connector capability.\n"]
7085 pub fn connector_open_with<___R>(
7086 &self,
7087 request: ___R,
7088 ) -> Result<
7089 ::fidl_next::ResponseFuture<'_, super::ConnectorOpen, ___T>,
7090 ::fidl_next::EncodeError,
7091 >
7092 where
7093 ___R: ::fidl_next::Encode<
7094 <___T as ::fidl_next::Transport>::SendBuffer,
7095 Encoded = crate::WireCapabilityStoreConnectorOpenRequest,
7096 >,
7097 {
7098 self.sender
7099 .send_two_way(6016362336453278623, request)
7100 .map(::fidl_next::ResponseFuture::from_untyped)
7101 }
7102
7103 #[doc = " Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]\n will be dispatched to this [DirReceiver].\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7104 pub fn dir_connector_create(
7105 &self,
7106
7107 id: impl ::fidl_next::Encode<
7108 <___T as ::fidl_next::Transport>::SendBuffer,
7109 Encoded = ::fidl_next::WireU64,
7110 >,
7111
7112 receiver: impl ::fidl_next::Encode<
7113 <___T as ::fidl_next::Transport>::SendBuffer,
7114 Encoded = ::fidl_next::ClientEnd<
7115 crate::DirReceiver,
7116 ::fidl_next::fuchsia::WireChannel,
7117 >,
7118 >,
7119 ) -> Result<
7120 ::fidl_next::ResponseFuture<'_, super::DirConnectorCreate, ___T>,
7121 ::fidl_next::EncodeError,
7122 >
7123 where
7124 <___T as ::fidl_next::Transport>::SendBuffer:
7125 ::fidl_next::encoder::InternalHandleEncoder,
7126
7127 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7128 {
7129 self.dir_connector_create_with(DirConnectorCreate { id, receiver })
7130 }
7131
7132 #[doc = " Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]\n will be dispatched to this [DirReceiver].\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7133 pub fn dir_connector_create_with<___R>(
7134 &self,
7135 request: ___R,
7136 ) -> Result<
7137 ::fidl_next::ResponseFuture<'_, super::DirConnectorCreate, ___T>,
7138 ::fidl_next::EncodeError,
7139 >
7140 where
7141 ___R: ::fidl_next::Encode<
7142 <___T as ::fidl_next::Transport>::SendBuffer,
7143 Encoded = crate::WireCapabilityStoreDirConnectorCreateRequest,
7144 >,
7145 {
7146 self.sender
7147 .send_two_way(1756747594275428795, request)
7148 .map(::fidl_next::ResponseFuture::from_untyped)
7149 }
7150
7151 #[doc = " Open a connection from the provided [DirConnector] capability that will be dispatched to\n the [DirReceiver] on the other end.\n\n This method does not take `Open`/`Open3` parameters such as `flags` or `path`.\n Clients that wish to specify these can get an initial connection from this method\n and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for\n more information about the expectations of the server side.\n\n If there was an error making the connection, it will be reported as a zx.Status\n epitaph on `server_end`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a connector capability.\n"]
7152 pub fn dir_connector_open(
7153 &self,
7154
7155 id: impl ::fidl_next::Encode<
7156 <___T as ::fidl_next::Transport>::SendBuffer,
7157 Encoded = ::fidl_next::WireU64,
7158 >,
7159
7160 server_end: impl ::fidl_next::Encode<
7161 <___T as ::fidl_next::Transport>::SendBuffer,
7162 Encoded = ::fidl_next::ServerEnd<
7163 ::fidl_next_fuchsia_io::Directory,
7164 ::fidl_next::fuchsia::WireChannel,
7165 >,
7166 >,
7167 ) -> Result<
7168 ::fidl_next::ResponseFuture<'_, super::DirConnectorOpen, ___T>,
7169 ::fidl_next::EncodeError,
7170 >
7171 where
7172 <___T as ::fidl_next::Transport>::SendBuffer:
7173 ::fidl_next::encoder::InternalHandleEncoder,
7174
7175 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7176 {
7177 self.dir_connector_open_with(DirConnectorOpen { id, server_end })
7178 }
7179
7180 #[doc = " Open a connection from the provided [DirConnector] capability that will be dispatched to\n the [DirReceiver] on the other end.\n\n This method does not take `Open`/`Open3` parameters such as `flags` or `path`.\n Clients that wish to specify these can get an initial connection from this method\n and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for\n more information about the expectations of the server side.\n\n If there was an error making the connection, it will be reported as a zx.Status\n epitaph on `server_end`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a connector capability.\n"]
7181 pub fn dir_connector_open_with<___R>(
7182 &self,
7183 request: ___R,
7184 ) -> Result<
7185 ::fidl_next::ResponseFuture<'_, super::DirConnectorOpen, ___T>,
7186 ::fidl_next::EncodeError,
7187 >
7188 where
7189 ___R: ::fidl_next::Encode<
7190 <___T as ::fidl_next::Transport>::SendBuffer,
7191 Encoded = crate::WireCapabilityStoreDirConnectorOpenRequest,
7192 >,
7193 {
7194 self.sender
7195 .send_two_way(6219704004220369153, request)
7196 .map(::fidl_next::ResponseFuture::from_untyped)
7197 }
7198
7199 #[doc = " Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7200 pub fn dictionary_create(
7201 &self,
7202
7203 id: impl ::fidl_next::Encode<
7204 <___T as ::fidl_next::Transport>::SendBuffer,
7205 Encoded = ::fidl_next::WireU64,
7206 >,
7207 ) -> Result<
7208 ::fidl_next::ResponseFuture<'_, super::DictionaryCreate, ___T>,
7209 ::fidl_next::EncodeError,
7210 >
7211 where
7212 <___T as ::fidl_next::Transport>::SendBuffer:
7213 ::fidl_next::encoder::InternalHandleEncoder,
7214 {
7215 self.dictionary_create_with(DictionaryCreate { id })
7216 }
7217
7218 #[doc = " Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7219 pub fn dictionary_create_with<___R>(
7220 &self,
7221 request: ___R,
7222 ) -> Result<
7223 ::fidl_next::ResponseFuture<'_, super::DictionaryCreate, ___T>,
7224 ::fidl_next::EncodeError,
7225 >
7226 where
7227 ___R: ::fidl_next::Encode<
7228 <___T as ::fidl_next::Transport>::SendBuffer,
7229 Encoded = crate::WireCapabilityStoreDictionaryCreateRequest,
7230 >,
7231 {
7232 self.sender
7233 .send_two_way(7608770958894948499, request)
7234 .map(::fidl_next::ResponseFuture::from_untyped)
7235 }
7236
7237 #[doc = " Imports a dictionary in the form of a channel.\n\n This is a legacy API to support backward compatibility with APIs that take a [Dictionary]\n channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.\n"]
7238 pub fn dictionary_legacy_import(
7239 &self,
7240
7241 id: impl ::fidl_next::Encode<
7242 <___T as ::fidl_next::Transport>::SendBuffer,
7243 Encoded = ::fidl_next::WireU64,
7244 >,
7245
7246 client_end: impl ::fidl_next::Encode<
7247 <___T as ::fidl_next::Transport>::SendBuffer,
7248 Encoded = ::fidl_next::fuchsia::WireHandle,
7249 >,
7250 ) -> Result<
7251 ::fidl_next::ResponseFuture<'_, super::DictionaryLegacyImport, ___T>,
7252 ::fidl_next::EncodeError,
7253 >
7254 where
7255 <___T as ::fidl_next::Transport>::SendBuffer:
7256 ::fidl_next::encoder::InternalHandleEncoder,
7257
7258 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7259 {
7260 self.dictionary_legacy_import_with(DictionaryLegacyImport { id, client_end })
7261 }
7262
7263 #[doc = " Imports a dictionary in the form of a channel.\n\n This is a legacy API to support backward compatibility with APIs that take a [Dictionary]\n channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.\n"]
7264 pub fn dictionary_legacy_import_with<___R>(
7265 &self,
7266 request: ___R,
7267 ) -> Result<
7268 ::fidl_next::ResponseFuture<'_, super::DictionaryLegacyImport, ___T>,
7269 ::fidl_next::EncodeError,
7270 >
7271 where
7272 ___R: ::fidl_next::Encode<
7273 <___T as ::fidl_next::Transport>::SendBuffer,
7274 Encoded = crate::WireCapabilityStoreDictionaryLegacyImportRequest,
7275 >,
7276 {
7277 self.sender
7278 .send_two_way(8285893703432012383, request)
7279 .map(::fidl_next::ResponseFuture::from_untyped)
7280 }
7281
7282 #[doc = " Binds a channel to the dictionary with `id`. The channel can\n be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].\n\n This is a legacy API to support backward compatibility with APIs that take a [Dictionary]\n channel.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
7283 pub fn dictionary_legacy_export(
7284 &self,
7285
7286 id: impl ::fidl_next::Encode<
7287 <___T as ::fidl_next::Transport>::SendBuffer,
7288 Encoded = ::fidl_next::WireU64,
7289 >,
7290
7291 server_end: impl ::fidl_next::Encode<
7292 <___T as ::fidl_next::Transport>::SendBuffer,
7293 Encoded = ::fidl_next::fuchsia::WireHandle,
7294 >,
7295 ) -> Result<
7296 ::fidl_next::ResponseFuture<'_, super::DictionaryLegacyExport, ___T>,
7297 ::fidl_next::EncodeError,
7298 >
7299 where
7300 <___T as ::fidl_next::Transport>::SendBuffer:
7301 ::fidl_next::encoder::InternalHandleEncoder,
7302
7303 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7304 {
7305 self.dictionary_legacy_export_with(DictionaryLegacyExport { id, server_end })
7306 }
7307
7308 #[doc = " Binds a channel to the dictionary with `id`. The channel can\n be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].\n\n This is a legacy API to support backward compatibility with APIs that take a [Dictionary]\n channel.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
7309 pub fn dictionary_legacy_export_with<___R>(
7310 &self,
7311 request: ___R,
7312 ) -> Result<
7313 ::fidl_next::ResponseFuture<'_, super::DictionaryLegacyExport, ___T>,
7314 ::fidl_next::EncodeError,
7315 >
7316 where
7317 ___R: ::fidl_next::Encode<
7318 <___T as ::fidl_next::Transport>::SendBuffer,
7319 Encoded = crate::WireCapabilityStoreDictionaryLegacyExportRequest,
7320 >,
7321 {
7322 self.sender
7323 .send_two_way(4647175832683306445, request)
7324 .map(::fidl_next::ResponseFuture::from_untyped)
7325 }
7326
7327 #[doc = " Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and\n its id is released if this call succeeds.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `item.key` was invalid.\n - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.\n"]
7328 pub fn dictionary_insert(
7329 &self,
7330
7331 id: impl ::fidl_next::Encode<
7332 <___T as ::fidl_next::Transport>::SendBuffer,
7333 Encoded = ::fidl_next::WireU64,
7334 >,
7335
7336 item: impl ::fidl_next::Encode<
7337 <___T as ::fidl_next::Transport>::SendBuffer,
7338 Encoded = crate::WireDictionaryItem<'static>,
7339 >,
7340 ) -> Result<
7341 ::fidl_next::ResponseFuture<'_, super::DictionaryInsert, ___T>,
7342 ::fidl_next::EncodeError,
7343 >
7344 where
7345 <___T as ::fidl_next::Transport>::SendBuffer:
7346 ::fidl_next::encoder::InternalHandleEncoder,
7347
7348 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
7349 {
7350 self.dictionary_insert_with(DictionaryInsert { id, item })
7351 }
7352
7353 #[doc = " Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and\n its id is released if this call succeeds.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `item.key` was invalid.\n - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.\n"]
7354 pub fn dictionary_insert_with<___R>(
7355 &self,
7356 request: ___R,
7357 ) -> Result<
7358 ::fidl_next::ResponseFuture<'_, super::DictionaryInsert, ___T>,
7359 ::fidl_next::EncodeError,
7360 >
7361 where
7362 ___R: ::fidl_next::Encode<
7363 <___T as ::fidl_next::Transport>::SendBuffer,
7364 Encoded = crate::WireCapabilityStoreDictionaryInsertRequest<'static>,
7365 >,
7366 {
7367 self.sender
7368 .send_two_way(8575443262986538023, request)
7369 .map(::fidl_next::ResponseFuture::from_untyped)
7370 }
7371
7372 #[doc = " Get a duplicate of a capability from the dictionary with `id`, which is\n loaded into `dest_id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `item.key` was invalid.\n - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.\n - `NOT_DUPLICATABLE` if the capability could not be duplicated.\n"]
7373 pub fn dictionary_get(
7374 &self,
7375
7376 id: impl ::fidl_next::Encode<
7377 <___T as ::fidl_next::Transport>::SendBuffer,
7378 Encoded = ::fidl_next::WireU64,
7379 >,
7380
7381 key: impl ::fidl_next::Encode<
7382 <___T as ::fidl_next::Transport>::SendBuffer,
7383 Encoded = ::fidl_next::WireString<'static>,
7384 >,
7385
7386 dest_id: impl ::fidl_next::Encode<
7387 <___T as ::fidl_next::Transport>::SendBuffer,
7388 Encoded = ::fidl_next::WireU64,
7389 >,
7390 ) -> Result<
7391 ::fidl_next::ResponseFuture<'_, super::DictionaryGet, ___T>,
7392 ::fidl_next::EncodeError,
7393 >
7394 where
7395 <___T as ::fidl_next::Transport>::SendBuffer:
7396 ::fidl_next::encoder::InternalHandleEncoder,
7397
7398 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
7399 {
7400 self.dictionary_get_with(DictionaryGet { id, key, dest_id })
7401 }
7402
7403 #[doc = " Get a duplicate of a capability from the dictionary with `id`, which is\n loaded into `dest_id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `item.key` was invalid.\n - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.\n - `NOT_DUPLICATABLE` if the capability could not be duplicated.\n"]
7404 pub fn dictionary_get_with<___R>(
7405 &self,
7406 request: ___R,
7407 ) -> Result<
7408 ::fidl_next::ResponseFuture<'_, super::DictionaryGet, ___T>,
7409 ::fidl_next::EncodeError,
7410 >
7411 where
7412 ___R: ::fidl_next::Encode<
7413 <___T as ::fidl_next::Transport>::SendBuffer,
7414 Encoded = crate::WireCapabilityStoreDictionaryGetRequest<'static>,
7415 >,
7416 {
7417 self.sender
7418 .send_two_way(5592951026866236882, request)
7419 .map(::fidl_next::ResponseFuture::from_untyped)
7420 }
7421
7422 #[doc = " Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value\n into it, otherwise discards the value.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `key` was invalid.\n - `ITEM_NOT_FOUND` if the dictionary does not contain the key.\n"]
7423 pub fn dictionary_remove(
7424 &self,
7425
7426 id: impl ::fidl_next::Encode<
7427 <___T as ::fidl_next::Transport>::SendBuffer,
7428 Encoded = ::fidl_next::WireU64,
7429 >,
7430
7431 key: impl ::fidl_next::Encode<
7432 <___T as ::fidl_next::Transport>::SendBuffer,
7433 Encoded = ::fidl_next::WireString<'static>,
7434 >,
7435
7436 dest_id: impl ::fidl_next::Encode<
7437 <___T as ::fidl_next::Transport>::SendBuffer,
7438 Encoded = ::fidl_next::WireBox<'static, crate::WireWrappedCapabilityId>,
7439 >,
7440 ) -> Result<
7441 ::fidl_next::ResponseFuture<'_, super::DictionaryRemove, ___T>,
7442 ::fidl_next::EncodeError,
7443 >
7444 where
7445 <___T as ::fidl_next::Transport>::SendBuffer:
7446 ::fidl_next::encoder::InternalHandleEncoder,
7447
7448 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
7449 {
7450 self.dictionary_remove_with(DictionaryRemove { id, key, dest_id })
7451 }
7452
7453 #[doc = " Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value\n into it, otherwise discards the value.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `key` was invalid.\n - `ITEM_NOT_FOUND` if the dictionary does not contain the key.\n"]
7454 pub fn dictionary_remove_with<___R>(
7455 &self,
7456 request: ___R,
7457 ) -> Result<
7458 ::fidl_next::ResponseFuture<'_, super::DictionaryRemove, ___T>,
7459 ::fidl_next::EncodeError,
7460 >
7461 where
7462 ___R: ::fidl_next::Encode<
7463 <___T as ::fidl_next::Transport>::SendBuffer,
7464 Encoded = crate::WireCapabilityStoreDictionaryRemoveRequest<'static>,
7465 >,
7466 {
7467 self.sender
7468 .send_two_way(343892214579320051, request)
7469 .map(::fidl_next::ResponseFuture::from_untyped)
7470 }
7471
7472 #[doc = " Create a new dictionary that contains a duplicate of all the entries in\n the dictionary with `id`, assigning `dest_id` to the new dictionary.\n The runtime of this method is linear in the number of top-level entries\n in the dictionary.\n\n For example, if the dictionary contains nested dictionaries, the newly\n created dictionary will contain references to those same nested\n dictionaries because the entries are duplicated rather than deep-copied.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.\n"]
7473 pub fn dictionary_copy(
7474 &self,
7475
7476 id: impl ::fidl_next::Encode<
7477 <___T as ::fidl_next::Transport>::SendBuffer,
7478 Encoded = ::fidl_next::WireU64,
7479 >,
7480
7481 dest_id: impl ::fidl_next::Encode<
7482 <___T as ::fidl_next::Transport>::SendBuffer,
7483 Encoded = ::fidl_next::WireU64,
7484 >,
7485 ) -> Result<
7486 ::fidl_next::ResponseFuture<'_, super::DictionaryCopy, ___T>,
7487 ::fidl_next::EncodeError,
7488 >
7489 where
7490 <___T as ::fidl_next::Transport>::SendBuffer:
7491 ::fidl_next::encoder::InternalHandleEncoder,
7492 {
7493 self.dictionary_copy_with(DictionaryCopy { id, dest_id })
7494 }
7495
7496 #[doc = " Create a new dictionary that contains a duplicate of all the entries in\n the dictionary with `id`, assigning `dest_id` to the new dictionary.\n The runtime of this method is linear in the number of top-level entries\n in the dictionary.\n\n For example, if the dictionary contains nested dictionaries, the newly\n created dictionary will contain references to those same nested\n dictionaries because the entries are duplicated rather than deep-copied.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.\n"]
7497 pub fn dictionary_copy_with<___R>(
7498 &self,
7499 request: ___R,
7500 ) -> Result<
7501 ::fidl_next::ResponseFuture<'_, super::DictionaryCopy, ___T>,
7502 ::fidl_next::EncodeError,
7503 >
7504 where
7505 ___R: ::fidl_next::Encode<
7506 <___T as ::fidl_next::Transport>::SendBuffer,
7507 Encoded = crate::WireCapabilityStoreDictionaryCopyRequest,
7508 >,
7509 {
7510 self.sender
7511 .send_two_way(3977783339739362383, request)
7512 .map(::fidl_next::ResponseFuture::from_untyped)
7513 }
7514
7515 #[doc = " Enumerates the keys in the dictionary with `id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7516 pub fn dictionary_keys(
7517 &self,
7518
7519 id: impl ::fidl_next::Encode<
7520 <___T as ::fidl_next::Transport>::SendBuffer,
7521 Encoded = ::fidl_next::WireU64,
7522 >,
7523
7524 iterator: impl ::fidl_next::Encode<
7525 <___T as ::fidl_next::Transport>::SendBuffer,
7526 Encoded = ::fidl_next::ServerEnd<
7527 crate::DictionaryKeysIterator,
7528 ::fidl_next::fuchsia::WireChannel,
7529 >,
7530 >,
7531 ) -> Result<
7532 ::fidl_next::ResponseFuture<'_, super::DictionaryKeys, ___T>,
7533 ::fidl_next::EncodeError,
7534 >
7535 where
7536 <___T as ::fidl_next::Transport>::SendBuffer:
7537 ::fidl_next::encoder::InternalHandleEncoder,
7538
7539 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7540 {
7541 self.dictionary_keys_with(DictionaryKeys { id, iterator })
7542 }
7543
7544 #[doc = " Enumerates the keys in the dictionary with `id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7545 pub fn dictionary_keys_with<___R>(
7546 &self,
7547 request: ___R,
7548 ) -> Result<
7549 ::fidl_next::ResponseFuture<'_, super::DictionaryKeys, ___T>,
7550 ::fidl_next::EncodeError,
7551 >
7552 where
7553 ___R: ::fidl_next::Encode<
7554 <___T as ::fidl_next::Transport>::SendBuffer,
7555 Encoded = crate::WireCapabilityStoreDictionaryKeysRequest,
7556 >,
7557 {
7558 self.sender
7559 .send_two_way(597577248872787102, request)
7560 .map(::fidl_next::ResponseFuture::from_untyped)
7561 }
7562
7563 #[doc = " Enumerates the items (keys and values) in the dictionary with `id`.\n\n Creates a duplicate of each value (capability). If a value could not be duplicated,\n the value will be null.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7564 pub fn dictionary_enumerate(
7565 &self,
7566
7567 id: impl ::fidl_next::Encode<
7568 <___T as ::fidl_next::Transport>::SendBuffer,
7569 Encoded = ::fidl_next::WireU64,
7570 >,
7571
7572 iterator: impl ::fidl_next::Encode<
7573 <___T as ::fidl_next::Transport>::SendBuffer,
7574 Encoded = ::fidl_next::ServerEnd<
7575 crate::DictionaryEnumerateIterator,
7576 ::fidl_next::fuchsia::WireChannel,
7577 >,
7578 >,
7579 ) -> Result<
7580 ::fidl_next::ResponseFuture<'_, super::DictionaryEnumerate, ___T>,
7581 ::fidl_next::EncodeError,
7582 >
7583 where
7584 <___T as ::fidl_next::Transport>::SendBuffer:
7585 ::fidl_next::encoder::InternalHandleEncoder,
7586
7587 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7588 {
7589 self.dictionary_enumerate_with(DictionaryEnumerate { id, iterator })
7590 }
7591
7592 #[doc = " Enumerates the items (keys and values) in the dictionary with `id`.\n\n Creates a duplicate of each value (capability). If a value could not be duplicated,\n the value will be null.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7593 pub fn dictionary_enumerate_with<___R>(
7594 &self,
7595 request: ___R,
7596 ) -> Result<
7597 ::fidl_next::ResponseFuture<'_, super::DictionaryEnumerate, ___T>,
7598 ::fidl_next::EncodeError,
7599 >
7600 where
7601 ___R: ::fidl_next::Encode<
7602 <___T as ::fidl_next::Transport>::SendBuffer,
7603 Encoded = crate::WireCapabilityStoreDictionaryEnumerateRequest,
7604 >,
7605 {
7606 self.sender
7607 .send_two_way(964467096271472193, request)
7608 .map(::fidl_next::ResponseFuture::from_untyped)
7609 }
7610
7611 #[doc = " Removes all the entries in this dictionary, returning them in `contents` if provided.\n If `contents` is not provided, all the items are discarded without enumerating them.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7612 pub fn dictionary_drain(
7613 &self,
7614
7615 id: impl ::fidl_next::Encode<
7616 <___T as ::fidl_next::Transport>::SendBuffer,
7617 Encoded = ::fidl_next::WireU64,
7618 >,
7619
7620 iterator: impl ::fidl_next::Encode<
7621 <___T as ::fidl_next::Transport>::SendBuffer,
7622 Encoded = ::fidl_next::ServerEnd<
7623 crate::DictionaryDrainIterator,
7624 ::fidl_next::fuchsia::WireOptionalChannel,
7625 >,
7626 >,
7627 ) -> Result<
7628 ::fidl_next::ResponseFuture<'_, super::DictionaryDrain, ___T>,
7629 ::fidl_next::EncodeError,
7630 >
7631 where
7632 <___T as ::fidl_next::Transport>::SendBuffer:
7633 ::fidl_next::encoder::InternalHandleEncoder,
7634
7635 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
7636 {
7637 self.dictionary_drain_with(DictionaryDrain { id, iterator })
7638 }
7639
7640 #[doc = " Removes all the entries in this dictionary, returning them in `contents` if provided.\n If `contents` is not provided, all the items are discarded without enumerating them.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7641 pub fn dictionary_drain_with<___R>(
7642 &self,
7643 request: ___R,
7644 ) -> Result<
7645 ::fidl_next::ResponseFuture<'_, super::DictionaryDrain, ___T>,
7646 ::fidl_next::EncodeError,
7647 >
7648 where
7649 ___R: ::fidl_next::Encode<
7650 <___T as ::fidl_next::Transport>::SendBuffer,
7651 Encoded = crate::WireCapabilityStoreDictionaryDrainRequest,
7652 >,
7653 {
7654 self.sender
7655 .send_two_way(2928364469569621208, request)
7656 .map(::fidl_next::ResponseFuture::from_untyped)
7657 }
7658 }
7659
7660 #[repr(transparent)]
7662 pub struct CapabilityStoreServerSender<___T: ::fidl_next::Transport> {
7663 sender: ::fidl_next::protocol::ServerSender<___T>,
7664 }
7665
7666 impl<___T> CapabilityStoreServerSender<___T> where ___T: ::fidl_next::Transport {}
7667 }
7668}
7669
7670pub trait CapabilityStoreClientHandler<___T: ::fidl_next::Transport> {
7674 fn on_unknown_interaction(
7675 &mut self,
7676 sender: &::fidl_next::ClientSender<CapabilityStore, ___T>,
7677 ordinal: u64,
7678 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
7679 sender.close();
7680 ::core::future::ready(())
7681 }
7682}
7683
7684impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for CapabilityStore
7685where
7686 ___H: CapabilityStoreClientHandler<___T> + Send,
7687 ___T: ::fidl_next::Transport,
7688
7689 <capability_store::Duplicate as ::fidl_next::Method>::Response:
7690 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7691
7692 <capability_store::Drop as ::fidl_next::Method>::Response:
7693 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7694
7695 <capability_store::Export as ::fidl_next::Method>::Response:
7696 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7697
7698 <capability_store::Import as ::fidl_next::Method>::Response:
7699 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7700
7701 <capability_store::ConnectorCreate as ::fidl_next::Method>::Response:
7702 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7703
7704 <capability_store::ConnectorOpen as ::fidl_next::Method>::Response:
7705 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7706
7707 <capability_store::DirConnectorCreate as ::fidl_next::Method>::Response:
7708 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7709
7710 <capability_store::DirConnectorOpen as ::fidl_next::Method>::Response:
7711 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7712
7713 <capability_store::DictionaryCreate as ::fidl_next::Method>::Response:
7714 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7715
7716 <capability_store::DictionaryLegacyImport as ::fidl_next::Method>::Response:
7717 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7718
7719 <capability_store::DictionaryLegacyExport as ::fidl_next::Method>::Response:
7720 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7721
7722 <capability_store::DictionaryInsert as ::fidl_next::Method>::Response:
7723 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7724
7725 <capability_store::DictionaryGet as ::fidl_next::Method>::Response:
7726 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7727
7728 <capability_store::DictionaryRemove as ::fidl_next::Method>::Response:
7729 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7730
7731 <capability_store::DictionaryCopy as ::fidl_next::Method>::Response:
7732 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7733
7734 <capability_store::DictionaryKeys as ::fidl_next::Method>::Response:
7735 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7736
7737 <capability_store::DictionaryEnumerate as ::fidl_next::Method>::Response:
7738 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7739
7740 <capability_store::DictionaryDrain as ::fidl_next::Method>::Response:
7741 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7742{
7743 async fn on_event(
7744 handler: &mut ___H,
7745 sender: &::fidl_next::ClientSender<Self, ___T>,
7746 ordinal: u64,
7747 buffer: ___T::RecvBuffer,
7748 ) {
7749 match ordinal {
7750 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
7751 }
7752 }
7753}
7754
7755pub trait CapabilityStoreServerHandler<___T: ::fidl_next::Transport> {
7759 #[doc = " Duplicates the capability with `id` to `dest_id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `NOT_DUPLICATABLE` if `id` could not be duplicated.\n"]
7760 fn duplicate(
7761 &mut self,
7762 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7763
7764 request: ::fidl_next::Request<capability_store::Duplicate, ___T>,
7765
7766 responder: ::fidl_next::Responder<capability_store::Duplicate>,
7767 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7768
7769 #[doc = " Drops the capability with `id` from this [`CapabilityStore`].\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
7770 fn drop(
7771 &mut self,
7772 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7773
7774 request: ::fidl_next::Request<capability_store::Drop, ___T>,
7775
7776 responder: ::fidl_next::Responder<capability_store::Drop>,
7777 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7778
7779 #[doc = " Exports the capability with the client-assigned identifier `id` to\n `capability`. This operation removes the capability from the store. If\n this is not desired, [Duplicate] the capability first.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
7780 fn export(
7781 &mut self,
7782 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7783
7784 request: ::fidl_next::Request<capability_store::Export, ___T>,
7785
7786 responder: ::fidl_next::Responder<capability_store::Export>,
7787 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7788
7789 #[doc = " Imports `capability` into this store with the client-assigned `id`.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n - `BAD_CAPABILITY` if `capability` was not a valid [Capability].\n"]
7790 fn import(
7791 &mut self,
7792 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7793
7794 request: ::fidl_next::Request<capability_store::Import, ___T>,
7795
7796 responder: ::fidl_next::Responder<capability_store::Import>,
7797 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7798
7799 #[doc = " Creates a [Connector] from a [Receiver]. Incoming connections to the [Connector] will be\n dispatched to this [Receiver].\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7800 fn connector_create(
7801 &mut self,
7802 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7803
7804 request: ::fidl_next::Request<capability_store::ConnectorCreate, ___T>,
7805
7806 responder: ::fidl_next::Responder<capability_store::ConnectorCreate>,
7807 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7808
7809 #[doc = " Open a connection from the provided [Connector] capability that will be dispatched to\n the [Receiver] on the other end.\n\n If there is an error, it will be reported as a zx.Status epitaph on `server_end`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a connector capability.\n"]
7810 fn connector_open(
7811 &mut self,
7812 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7813
7814 request: ::fidl_next::Request<capability_store::ConnectorOpen, ___T>,
7815
7816 responder: ::fidl_next::Responder<capability_store::ConnectorOpen>,
7817 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7818
7819 #[doc = " Creates a [DirConnector] from a [DirReceiver]. Incoming connections to the [DirConnector]\n will be dispatched to this [DirReceiver].\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7820 fn dir_connector_create(
7821 &mut self,
7822 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7823
7824 request: ::fidl_next::Request<capability_store::DirConnectorCreate, ___T>,
7825
7826 responder: ::fidl_next::Responder<capability_store::DirConnectorCreate>,
7827 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7828
7829 #[doc = " Open a connection from the provided [DirConnector] capability that will be dispatched to\n the [DirReceiver] on the other end.\n\n This method does not take `Open`/`Open3` parameters such as `flags` or `path`.\n Clients that wish to specify these can get an initial connection from this method\n and call `fuchsia.io/Directory.Open` on it. See the [DirReceiver] documentation for\n more information about the expectations of the server side.\n\n If there was an error making the connection, it will be reported as a zx.Status\n epitaph on `server_end`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a connector capability.\n"]
7830 fn dir_connector_open(
7831 &mut self,
7832 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7833
7834 request: ::fidl_next::Request<capability_store::DirConnectorOpen, ___T>,
7835
7836 responder: ::fidl_next::Responder<capability_store::DirConnectorOpen>,
7837 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7838
7839 #[doc = " Creates a new empty dictionary in this [`CapabilityStore`] with client-assigned `id`.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n"]
7840 fn dictionary_create(
7841 &mut self,
7842 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7843
7844 request: ::fidl_next::Request<capability_store::DictionaryCreate, ___T>,
7845
7846 responder: ::fidl_next::Responder<capability_store::DictionaryCreate>,
7847 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7848
7849 #[doc = " Imports a dictionary in the form of a channel.\n\n This is a legacy API to support backward compatibility with APIs that take a [Dictionary]\n channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if a capability with `id` already exists in this store.\n - `BAD_CAPABILITY` if `client_end` was not a valid dictionary channel.\n"]
7850 fn dictionary_legacy_import(
7851 &mut self,
7852 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7853
7854 request: ::fidl_next::Request<capability_store::DictionaryLegacyImport, ___T>,
7855
7856 responder: ::fidl_next::Responder<capability_store::DictionaryLegacyImport>,
7857 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7858
7859 #[doc = " Binds a channel to the dictionary with `id`. The channel can\n be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].\n\n This is a legacy API to support backward compatibility with APIs that take a [Dictionary]\n channel.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n"]
7860 fn dictionary_legacy_export(
7861 &mut self,
7862 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7863
7864 request: ::fidl_next::Request<capability_store::DictionaryLegacyExport, ___T>,
7865
7866 responder: ::fidl_next::Responder<capability_store::DictionaryLegacyExport>,
7867 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7868
7869 #[doc = " Inserts `item` into the dictionary with `id`. `item.value` is moved into the dictionary and\n its id is released if this call succeeds.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `item.key` was invalid.\n - `ITEM_ALREADY_EXISTS` if the dictionary already contains an item with `item.key`.\n"]
7870 fn dictionary_insert(
7871 &mut self,
7872 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7873
7874 request: ::fidl_next::Request<capability_store::DictionaryInsert, ___T>,
7875
7876 responder: ::fidl_next::Responder<capability_store::DictionaryInsert>,
7877 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7878
7879 #[doc = " Get a duplicate of a capability from the dictionary with `id`, which is\n loaded into `dest_id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a recognized capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `item.key` was invalid.\n - `ITEM_NOT_FOUND` if the dictionary does not contain `key`.\n - `NOT_DUPLICATABLE` if the capability could not be duplicated.\n"]
7880 fn dictionary_get(
7881 &mut self,
7882 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7883
7884 request: ::fidl_next::Request<capability_store::DictionaryGet, ___T>,
7885
7886 responder: ::fidl_next::Responder<capability_store::DictionaryGet>,
7887 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7888
7889 #[doc = " Removes a key from the dictionary with `id`. If `dest_id` is present, loads the value\n into it, otherwise discards the value.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `INVALID_KEY` if `key` was invalid.\n - `ITEM_NOT_FOUND` if the dictionary does not contain the key.\n"]
7890 fn dictionary_remove(
7891 &mut self,
7892 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7893
7894 request: ::fidl_next::Request<capability_store::DictionaryRemove, ___T>,
7895
7896 responder: ::fidl_next::Responder<capability_store::DictionaryRemove>,
7897 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7898
7899 #[doc = " Create a new dictionary that contains a duplicate of all the entries in\n the dictionary with `id`, assigning `dest_id` to the new dictionary.\n The runtime of this method is linear in the number of top-level entries\n in the dictionary.\n\n For example, if the dictionary contains nested dictionaries, the newly\n created dictionary will contain references to those same nested\n dictionaries because the entries are duplicated rather than deep-copied.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `ID_ALREADY_EXISTS` if a capability with `dest_id` already exists in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n - `NOT_DUPLICATABLE` if one of the capabilities in `id` could not be duplicated.\n"]
7900 fn dictionary_copy(
7901 &mut self,
7902 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7903
7904 request: ::fidl_next::Request<capability_store::DictionaryCopy, ___T>,
7905
7906 responder: ::fidl_next::Responder<capability_store::DictionaryCopy>,
7907 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7908
7909 #[doc = " Enumerates the keys in the dictionary with `id`.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7910 fn dictionary_keys(
7911 &mut self,
7912 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7913
7914 request: ::fidl_next::Request<capability_store::DictionaryKeys, ___T>,
7915
7916 responder: ::fidl_next::Responder<capability_store::DictionaryKeys>,
7917 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7918
7919 #[doc = " Enumerates the items (keys and values) in the dictionary with `id`.\n\n Creates a duplicate of each value (capability). If a value could not be duplicated,\n the value will be null.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7920 fn dictionary_enumerate(
7921 &mut self,
7922 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7923
7924 request: ::fidl_next::Request<capability_store::DictionaryEnumerate, ___T>,
7925
7926 responder: ::fidl_next::Responder<capability_store::DictionaryEnumerate>,
7927 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7928
7929 #[doc = " Removes all the entries in this dictionary, returning them in `contents` if provided.\n If `contents` is not provided, all the items are discarded without enumerating them.\n\n Errors:\n\n - `ID_NOT_FOUND` if `id` was not a valid capability id in this store.\n - `WRONG_TYPE` if `id` was not a dictionary.\n"]
7930 fn dictionary_drain(
7931 &mut self,
7932 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7933
7934 request: ::fidl_next::Request<capability_store::DictionaryDrain, ___T>,
7935
7936 responder: ::fidl_next::Responder<capability_store::DictionaryDrain>,
7937 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7938
7939 fn on_unknown_interaction(
7940 &mut self,
7941 sender: &::fidl_next::ServerSender<CapabilityStore, ___T>,
7942 ordinal: u64,
7943 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
7944 sender.close();
7945 ::core::future::ready(())
7946 }
7947}
7948
7949impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for CapabilityStore
7950where
7951 ___H: CapabilityStoreServerHandler<___T> + Send,
7952 ___T: ::fidl_next::Transport,
7953
7954 <capability_store::Duplicate as ::fidl_next::Method>::Request:
7955 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7956
7957 <capability_store::Drop as ::fidl_next::Method>::Request:
7958 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7959
7960 <capability_store::Export as ::fidl_next::Method>::Request:
7961 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7962
7963 <capability_store::Import as ::fidl_next::Method>::Request:
7964 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7965
7966 <capability_store::ConnectorCreate as ::fidl_next::Method>::Request:
7967 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7968
7969 <capability_store::ConnectorOpen as ::fidl_next::Method>::Request:
7970 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7971
7972 <capability_store::DirConnectorCreate as ::fidl_next::Method>::Request:
7973 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7974
7975 <capability_store::DirConnectorOpen as ::fidl_next::Method>::Request:
7976 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7977
7978 <capability_store::DictionaryCreate as ::fidl_next::Method>::Request:
7979 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7980
7981 <capability_store::DictionaryLegacyImport as ::fidl_next::Method>::Request:
7982 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7983
7984 <capability_store::DictionaryLegacyExport as ::fidl_next::Method>::Request:
7985 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7986
7987 <capability_store::DictionaryInsert as ::fidl_next::Method>::Request:
7988 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7989
7990 <capability_store::DictionaryGet as ::fidl_next::Method>::Request:
7991 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7992
7993 <capability_store::DictionaryRemove as ::fidl_next::Method>::Request:
7994 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7995
7996 <capability_store::DictionaryCopy as ::fidl_next::Method>::Request:
7997 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7998
7999 <capability_store::DictionaryKeys as ::fidl_next::Method>::Request:
8000 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8001
8002 <capability_store::DictionaryEnumerate as ::fidl_next::Method>::Request:
8003 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8004
8005 <capability_store::DictionaryDrain as ::fidl_next::Method>::Request:
8006 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8007{
8008 async fn on_one_way(
8009 handler: &mut ___H,
8010 sender: &::fidl_next::ServerSender<Self, ___T>,
8011 ordinal: u64,
8012 buffer: ___T::RecvBuffer,
8013 ) {
8014 match ordinal {
8015 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
8016 }
8017 }
8018
8019 async fn on_two_way(
8020 handler: &mut ___H,
8021 sender: &::fidl_next::ServerSender<Self, ___T>,
8022 ordinal: u64,
8023 buffer: ___T::RecvBuffer,
8024 responder: ::fidl_next::protocol::Responder,
8025 ) {
8026 match ordinal {
8027 6727592627741008260 => {
8028 let responder = ::fidl_next::Responder::from_untyped(responder);
8029
8030 match ::fidl_next::DecoderExt::decode(buffer) {
8031 Ok(decoded) => handler.duplicate(sender, decoded, responder).await,
8032 Err(e) => {
8033 sender.close();
8034 }
8035 }
8036 }
8037
8038 753328233834620249 => {
8039 let responder = ::fidl_next::Responder::from_untyped(responder);
8040
8041 match ::fidl_next::DecoderExt::decode(buffer) {
8042 Ok(decoded) => handler.drop(sender, decoded, responder).await,
8043 Err(e) => {
8044 sender.close();
8045 }
8046 }
8047 }
8048
8049 226159162093533951 => {
8050 let responder = ::fidl_next::Responder::from_untyped(responder);
8051
8052 match ::fidl_next::DecoderExt::decode(buffer) {
8053 Ok(decoded) => handler.export(sender, decoded, responder).await,
8054 Err(e) => {
8055 sender.close();
8056 }
8057 }
8058 }
8059
8060 2276030276116435867 => {
8061 let responder = ::fidl_next::Responder::from_untyped(responder);
8062
8063 match ::fidl_next::DecoderExt::decode(buffer) {
8064 Ok(decoded) => handler.import(sender, decoded, responder).await,
8065 Err(e) => {
8066 sender.close();
8067 }
8068 }
8069 }
8070
8071 2979461408102095909 => {
8072 let responder = ::fidl_next::Responder::from_untyped(responder);
8073
8074 match ::fidl_next::DecoderExt::decode(buffer) {
8075 Ok(decoded) => handler.connector_create(sender, decoded, responder).await,
8076 Err(e) => {
8077 sender.close();
8078 }
8079 }
8080 }
8081
8082 6016362336453278623 => {
8083 let responder = ::fidl_next::Responder::from_untyped(responder);
8084
8085 match ::fidl_next::DecoderExt::decode(buffer) {
8086 Ok(decoded) => handler.connector_open(sender, decoded, responder).await,
8087 Err(e) => {
8088 sender.close();
8089 }
8090 }
8091 }
8092
8093 1756747594275428795 => {
8094 let responder = ::fidl_next::Responder::from_untyped(responder);
8095
8096 match ::fidl_next::DecoderExt::decode(buffer) {
8097 Ok(decoded) => handler.dir_connector_create(sender, decoded, responder).await,
8098 Err(e) => {
8099 sender.close();
8100 }
8101 }
8102 }
8103
8104 6219704004220369153 => {
8105 let responder = ::fidl_next::Responder::from_untyped(responder);
8106
8107 match ::fidl_next::DecoderExt::decode(buffer) {
8108 Ok(decoded) => handler.dir_connector_open(sender, decoded, responder).await,
8109 Err(e) => {
8110 sender.close();
8111 }
8112 }
8113 }
8114
8115 7608770958894948499 => {
8116 let responder = ::fidl_next::Responder::from_untyped(responder);
8117
8118 match ::fidl_next::DecoderExt::decode(buffer) {
8119 Ok(decoded) => handler.dictionary_create(sender, decoded, responder).await,
8120 Err(e) => {
8121 sender.close();
8122 }
8123 }
8124 }
8125
8126 8285893703432012383 => {
8127 let responder = ::fidl_next::Responder::from_untyped(responder);
8128
8129 match ::fidl_next::DecoderExt::decode(buffer) {
8130 Ok(decoded) => {
8131 handler.dictionary_legacy_import(sender, decoded, responder).await
8132 }
8133 Err(e) => {
8134 sender.close();
8135 }
8136 }
8137 }
8138
8139 4647175832683306445 => {
8140 let responder = ::fidl_next::Responder::from_untyped(responder);
8141
8142 match ::fidl_next::DecoderExt::decode(buffer) {
8143 Ok(decoded) => {
8144 handler.dictionary_legacy_export(sender, decoded, responder).await
8145 }
8146 Err(e) => {
8147 sender.close();
8148 }
8149 }
8150 }
8151
8152 8575443262986538023 => {
8153 let responder = ::fidl_next::Responder::from_untyped(responder);
8154
8155 match ::fidl_next::DecoderExt::decode(buffer) {
8156 Ok(decoded) => handler.dictionary_insert(sender, decoded, responder).await,
8157 Err(e) => {
8158 sender.close();
8159 }
8160 }
8161 }
8162
8163 5592951026866236882 => {
8164 let responder = ::fidl_next::Responder::from_untyped(responder);
8165
8166 match ::fidl_next::DecoderExt::decode(buffer) {
8167 Ok(decoded) => handler.dictionary_get(sender, decoded, responder).await,
8168 Err(e) => {
8169 sender.close();
8170 }
8171 }
8172 }
8173
8174 343892214579320051 => {
8175 let responder = ::fidl_next::Responder::from_untyped(responder);
8176
8177 match ::fidl_next::DecoderExt::decode(buffer) {
8178 Ok(decoded) => handler.dictionary_remove(sender, decoded, responder).await,
8179 Err(e) => {
8180 sender.close();
8181 }
8182 }
8183 }
8184
8185 3977783339739362383 => {
8186 let responder = ::fidl_next::Responder::from_untyped(responder);
8187
8188 match ::fidl_next::DecoderExt::decode(buffer) {
8189 Ok(decoded) => handler.dictionary_copy(sender, decoded, responder).await,
8190 Err(e) => {
8191 sender.close();
8192 }
8193 }
8194 }
8195
8196 597577248872787102 => {
8197 let responder = ::fidl_next::Responder::from_untyped(responder);
8198
8199 match ::fidl_next::DecoderExt::decode(buffer) {
8200 Ok(decoded) => handler.dictionary_keys(sender, decoded, responder).await,
8201 Err(e) => {
8202 sender.close();
8203 }
8204 }
8205 }
8206
8207 964467096271472193 => {
8208 let responder = ::fidl_next::Responder::from_untyped(responder);
8209
8210 match ::fidl_next::DecoderExt::decode(buffer) {
8211 Ok(decoded) => handler.dictionary_enumerate(sender, decoded, responder).await,
8212 Err(e) => {
8213 sender.close();
8214 }
8215 }
8216 }
8217
8218 2928364469569621208 => {
8219 let responder = ::fidl_next::Responder::from_untyped(responder);
8220
8221 match ::fidl_next::DecoderExt::decode(buffer) {
8222 Ok(decoded) => handler.dictionary_drain(sender, decoded, responder).await,
8223 Err(e) => {
8224 sender.close();
8225 }
8226 }
8227 }
8228
8229 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
8230 }
8231 }
8232}
8233
8234#[doc = " Represents an instance in the component tree, either a component\n instance or component manager\'s instance.\n"]
8235#[derive(Debug)]
8236#[repr(C)]
8237pub struct InstanceToken {
8238 pub token: ::fidl_next::fuchsia::zx::Handle,
8239}
8240
8241impl ::fidl_next::Encodable for InstanceToken {
8242 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireInstanceToken> = unsafe {
8243 ::fidl_next::CopyOptimization::enable_if(
8244 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
8245 .is_enabled(),
8246 )
8247 };
8248
8249 type Encoded = WireInstanceToken;
8250}
8251
8252unsafe impl<___E> ::fidl_next::Encode<___E> for InstanceToken
8253where
8254 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8255
8256 ___E: ::fidl_next::fuchsia::HandleEncoder,
8257{
8258 #[inline]
8259 fn encode(
8260 self,
8261 encoder: &mut ___E,
8262 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8263 ) -> Result<(), ::fidl_next::EncodeError> {
8264 ::fidl_next::munge! {
8265 let Self::Encoded {
8266 token,
8267
8268 } = out;
8269 }
8270
8271 ::fidl_next::Encode::encode(self.token, encoder, token)?;
8272
8273 Ok(())
8274 }
8275}
8276
8277impl ::fidl_next::EncodableOption for InstanceToken {
8278 type EncodedOption = ::fidl_next::WireBox<'static, WireInstanceToken>;
8279}
8280
8281unsafe impl<___E> ::fidl_next::EncodeOption<___E> for InstanceToken
8282where
8283 ___E: ::fidl_next::Encoder + ?Sized,
8284 InstanceToken: ::fidl_next::Encode<___E>,
8285{
8286 #[inline]
8287 fn encode_option(
8288 this: Option<Self>,
8289 encoder: &mut ___E,
8290 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8291 ) -> Result<(), ::fidl_next::EncodeError> {
8292 if let Some(inner) = this {
8293 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8294 ::fidl_next::WireBox::encode_present(out);
8295 } else {
8296 ::fidl_next::WireBox::encode_absent(out);
8297 }
8298
8299 Ok(())
8300 }
8301}
8302
8303impl ::fidl_next::FromWire<WireInstanceToken> for InstanceToken {
8304 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireInstanceToken, Self> = unsafe {
8305 ::fidl_next::CopyOptimization::enable_if(
8306 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
8307 ::fidl_next::fuchsia::WireHandle,
8308 >>::COPY_OPTIMIZATION
8309 .is_enabled(),
8310 )
8311 };
8312
8313 #[inline]
8314 fn from_wire(wire: WireInstanceToken) -> Self {
8315 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
8316 }
8317}
8318
8319#[derive(Debug)]
8321#[repr(C)]
8322pub struct WireInstanceToken {
8323 pub token: ::fidl_next::fuchsia::WireHandle,
8324}
8325
8326unsafe impl ::fidl_next::Wire for WireInstanceToken {
8327 type Decoded<'de> = WireInstanceToken;
8328
8329 #[inline]
8330 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
8331}
8332
8333unsafe impl<___D> ::fidl_next::Decode<___D> for WireInstanceToken
8334where
8335 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8336
8337 ___D: ::fidl_next::fuchsia::HandleDecoder,
8338{
8339 fn decode(
8340 slot: ::fidl_next::Slot<'_, Self>,
8341 decoder: &mut ___D,
8342 ) -> Result<(), ::fidl_next::DecodeError> {
8343 ::fidl_next::munge! {
8344 let Self {
8345 mut token,
8346
8347 } = slot;
8348 }
8349
8350 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
8351
8352 Ok(())
8353 }
8354}
8355
8356#[doc = " A request for a route.\n"]
8357#[derive(Debug, Default)]
8358pub struct RouteRequest {
8359 pub requesting: Option<crate::InstanceToken>,
8360
8361 pub metadata: Option<crate::DictionaryRef>,
8362}
8363
8364impl RouteRequest {
8365 fn __max_ordinal(&self) -> usize {
8366 if self.metadata.is_some() {
8367 return 2;
8368 }
8369
8370 if self.requesting.is_some() {
8371 return 1;
8372 }
8373
8374 0
8375 }
8376}
8377
8378impl ::fidl_next::Encodable for RouteRequest {
8379 type Encoded = WireRouteRequest<'static>;
8380}
8381
8382unsafe impl<___E> ::fidl_next::Encode<___E> for RouteRequest
8383where
8384 ___E: ::fidl_next::Encoder + ?Sized,
8385
8386 ___E: ::fidl_next::fuchsia::HandleEncoder,
8387{
8388 #[inline]
8389 fn encode(
8390 mut self,
8391 encoder: &mut ___E,
8392 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8393 ) -> Result<(), ::fidl_next::EncodeError> {
8394 ::fidl_next::munge!(let WireRouteRequest { table } = out);
8395
8396 let max_ord = self.__max_ordinal();
8397
8398 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8399 ::fidl_next::Wire::zero_padding(&mut out);
8400
8401 let mut preallocated =
8402 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8403
8404 for i in 1..=max_ord {
8405 match i {
8406 2 => {
8407 if let Some(metadata) = self.metadata.take() {
8408 ::fidl_next::WireEnvelope::encode_value(
8409 metadata,
8410 preallocated.encoder,
8411 &mut out,
8412 )?;
8413 } else {
8414 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8415 }
8416 }
8417
8418 1 => {
8419 if let Some(requesting) = self.requesting.take() {
8420 ::fidl_next::WireEnvelope::encode_value(
8421 requesting,
8422 preallocated.encoder,
8423 &mut out,
8424 )?;
8425 } else {
8426 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8427 }
8428 }
8429
8430 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8431 }
8432 unsafe {
8433 preallocated.write_next(out.assume_init_ref());
8434 }
8435 }
8436
8437 ::fidl_next::WireTable::encode_len(table, max_ord);
8438
8439 Ok(())
8440 }
8441}
8442
8443impl<'de> ::fidl_next::FromWire<WireRouteRequest<'de>> for RouteRequest {
8444 #[inline]
8445 fn from_wire(wire: WireRouteRequest<'de>) -> Self {
8446 let wire = ::core::mem::ManuallyDrop::new(wire);
8447
8448 let requesting = wire.table.get(1);
8449
8450 let metadata = wire.table.get(2);
8451
8452 Self {
8453 requesting: requesting.map(|envelope| {
8454 ::fidl_next::FromWire::from_wire(unsafe {
8455 envelope.read_unchecked::<crate::WireInstanceToken>()
8456 })
8457 }),
8458
8459 metadata: metadata.map(|envelope| {
8460 ::fidl_next::FromWire::from_wire(unsafe {
8461 envelope.read_unchecked::<crate::WireDictionaryRef>()
8462 })
8463 }),
8464 }
8465 }
8466}
8467
8468#[repr(C)]
8470pub struct WireRouteRequest<'de> {
8471 table: ::fidl_next::WireTable<'de>,
8472}
8473
8474impl<'de> Drop for WireRouteRequest<'de> {
8475 fn drop(&mut self) {
8476 let _ = self
8477 .table
8478 .get(1)
8479 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireInstanceToken>() });
8480
8481 let _ = self
8482 .table
8483 .get(2)
8484 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDictionaryRef>() });
8485 }
8486}
8487
8488unsafe impl ::fidl_next::Wire for WireRouteRequest<'static> {
8489 type Decoded<'de> = WireRouteRequest<'de>;
8490
8491 #[inline]
8492 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8493 ::fidl_next::munge!(let Self { table } = out);
8494 ::fidl_next::WireTable::zero_padding(table);
8495 }
8496}
8497
8498unsafe impl<___D> ::fidl_next::Decode<___D> for WireRouteRequest<'static>
8499where
8500 ___D: ::fidl_next::Decoder + ?Sized,
8501
8502 ___D: ::fidl_next::fuchsia::HandleDecoder,
8503{
8504 fn decode(
8505 slot: ::fidl_next::Slot<'_, Self>,
8506 decoder: &mut ___D,
8507 ) -> Result<(), ::fidl_next::DecodeError> {
8508 ::fidl_next::munge!(let Self { table } = slot);
8509
8510 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8511 match ordinal {
8512 0 => unsafe { ::core::hint::unreachable_unchecked() },
8513
8514 1 => {
8515 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireInstanceToken>(
8516 slot.as_mut(),
8517 decoder,
8518 )?;
8519
8520 Ok(())
8521 }
8522
8523 2 => {
8524 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDictionaryRef>(
8525 slot.as_mut(),
8526 decoder,
8527 )?;
8528
8529 Ok(())
8530 }
8531
8532 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8533 }
8534 })
8535 }
8536}
8537
8538impl<'de> WireRouteRequest<'de> {
8539 pub fn requesting(&self) -> Option<&crate::WireInstanceToken> {
8540 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8541 }
8542
8543 pub fn metadata(&self) -> Option<&crate::WireDictionaryRef> {
8544 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8545 }
8546}
8547
8548impl<'de> ::core::fmt::Debug for WireRouteRequest<'de> {
8549 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8550 f.debug_struct("RouteRequest")
8551 .field("requesting", &self.requesting())
8552 .field("metadata", &self.metadata())
8553 .finish()
8554 }
8555}
8556
8557#[derive(Debug)]
8558pub enum ConnectorRouterRouteResponse {
8559 Connector(crate::Connector),
8560
8561 Unavailable(crate::Unit),
8562}
8563
8564impl ::fidl_next::Encodable for ConnectorRouterRouteResponse {
8565 type Encoded = WireConnectorRouterRouteResponse;
8566}
8567
8568unsafe impl<___E> ::fidl_next::Encode<___E> for ConnectorRouterRouteResponse
8569where
8570 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8571
8572 ___E: ::fidl_next::fuchsia::HandleEncoder,
8573{
8574 #[inline]
8575 fn encode(
8576 self,
8577 encoder: &mut ___E,
8578 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8579 ) -> Result<(), ::fidl_next::EncodeError> {
8580 ::fidl_next::munge!(let WireConnectorRouterRouteResponse { raw, _phantom: _ } = out);
8581
8582 match self {
8583 Self::Connector(value) => ::fidl_next::RawWireUnion::encode_as_static::<
8584 ___E,
8585 crate::Connector,
8586 >(value, 1, encoder, raw)?,
8587
8588 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
8589 ___E,
8590 crate::Unit,
8591 >(value, 2, encoder, raw)?,
8592 }
8593
8594 Ok(())
8595 }
8596}
8597
8598impl ::fidl_next::EncodableOption for ConnectorRouterRouteResponse {
8599 type EncodedOption = WireOptionalConnectorRouterRouteResponse;
8600}
8601
8602unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConnectorRouterRouteResponse
8603where
8604 ___E: ?Sized,
8605 ConnectorRouterRouteResponse: ::fidl_next::Encode<___E>,
8606{
8607 #[inline]
8608 fn encode_option(
8609 this: Option<Self>,
8610 encoder: &mut ___E,
8611 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8612 ) -> Result<(), ::fidl_next::EncodeError> {
8613 ::fidl_next::munge!(let WireOptionalConnectorRouterRouteResponse { raw, _phantom: _ } = &mut *out);
8614
8615 if let Some(inner) = this {
8616 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
8617 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
8618 } else {
8619 ::fidl_next::RawWireUnion::encode_absent(raw);
8620 }
8621
8622 Ok(())
8623 }
8624}
8625
8626impl ::fidl_next::FromWire<WireConnectorRouterRouteResponse> for ConnectorRouterRouteResponse {
8627 #[inline]
8628 fn from_wire(wire: WireConnectorRouterRouteResponse) -> Self {
8629 let wire = ::core::mem::ManuallyDrop::new(wire);
8630 match wire.raw.ordinal() {
8631 1 => Self::Connector(::fidl_next::FromWire::from_wire(unsafe {
8632 wire.raw.get().read_unchecked::<crate::WireConnector>()
8633 })),
8634
8635 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
8636 wire.raw.get().read_unchecked::<crate::WireUnit>()
8637 })),
8638
8639 _ => unsafe { ::core::hint::unreachable_unchecked() },
8640 }
8641 }
8642}
8643
8644impl ::fidl_next::FromWireOption<WireOptionalConnectorRouterRouteResponse>
8645 for Box<ConnectorRouterRouteResponse>
8646{
8647 #[inline]
8648 fn from_wire_option(wire: WireOptionalConnectorRouterRouteResponse) -> Option<Self> {
8649 if let Some(inner) = wire.into_option() {
8650 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
8651 } else {
8652 None
8653 }
8654 }
8655}
8656
8657#[repr(transparent)]
8659pub struct WireConnectorRouterRouteResponse {
8660 raw: ::fidl_next::RawWireUnion,
8661 _phantom: ::core::marker::PhantomData<()>,
8662}
8663
8664impl Drop for WireConnectorRouterRouteResponse {
8665 fn drop(&mut self) {
8666 match self.raw.ordinal() {
8667 1 => {
8668 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireConnector>() };
8669 }
8670
8671 2 => {
8672 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
8673 }
8674
8675 _ => unsafe { ::core::hint::unreachable_unchecked() },
8676 }
8677 }
8678}
8679
8680unsafe impl ::fidl_next::Wire for WireConnectorRouterRouteResponse {
8681 type Decoded<'de> = WireConnectorRouterRouteResponse;
8682
8683 #[inline]
8684 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8685 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8686 ::fidl_next::RawWireUnion::zero_padding(raw);
8687 }
8688}
8689
8690pub mod connector_router_route_response {
8691 pub enum Ref<'de> {
8692 Connector(&'de crate::WireConnector),
8693
8694 Unavailable(&'de crate::WireUnit),
8695 }
8696}
8697
8698impl WireConnectorRouterRouteResponse {
8699 pub fn as_ref(&self) -> crate::connector_router_route_response::Ref<'_> {
8700 match self.raw.ordinal() {
8701 1 => crate::connector_router_route_response::Ref::Connector(unsafe {
8702 self.raw.get().deref_unchecked::<crate::WireConnector>()
8703 }),
8704
8705 2 => crate::connector_router_route_response::Ref::Unavailable(unsafe {
8706 self.raw.get().deref_unchecked::<crate::WireUnit>()
8707 }),
8708
8709 _ => unsafe { ::core::hint::unreachable_unchecked() },
8710 }
8711 }
8712}
8713
8714unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnectorRouterRouteResponse
8715where
8716 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8717
8718 ___D: ::fidl_next::fuchsia::HandleDecoder,
8719{
8720 fn decode(
8721 mut slot: ::fidl_next::Slot<'_, Self>,
8722 decoder: &mut ___D,
8723 ) -> Result<(), ::fidl_next::DecodeError> {
8724 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8725 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8726 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireConnector>(
8727 raw, decoder,
8728 )?,
8729
8730 2 => {
8731 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
8732 }
8733
8734 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
8735 }
8736
8737 Ok(())
8738 }
8739}
8740
8741impl ::core::fmt::Debug for WireConnectorRouterRouteResponse {
8742 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8743 match self.raw.ordinal() {
8744 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireConnector>().fmt(f) },
8745 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
8746 _ => unsafe { ::core::hint::unreachable_unchecked() },
8747 }
8748 }
8749}
8750
8751#[repr(transparent)]
8752pub struct WireOptionalConnectorRouterRouteResponse {
8753 raw: ::fidl_next::RawWireUnion,
8754 _phantom: ::core::marker::PhantomData<()>,
8755}
8756
8757unsafe impl ::fidl_next::Wire for WireOptionalConnectorRouterRouteResponse {
8758 type Decoded<'de> = WireOptionalConnectorRouterRouteResponse;
8759
8760 #[inline]
8761 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8762 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8763 ::fidl_next::RawWireUnion::zero_padding(raw);
8764 }
8765}
8766
8767impl WireOptionalConnectorRouterRouteResponse {
8768 pub fn is_some(&self) -> bool {
8769 self.raw.is_some()
8770 }
8771
8772 pub fn is_none(&self) -> bool {
8773 self.raw.is_none()
8774 }
8775
8776 pub fn as_ref(&self) -> Option<&WireConnectorRouterRouteResponse> {
8777 if self.is_some() {
8778 Some(unsafe { &*(self as *const Self).cast() })
8779 } else {
8780 None
8781 }
8782 }
8783
8784 pub fn into_option(self) -> Option<WireConnectorRouterRouteResponse> {
8785 if self.is_some() {
8786 Some(WireConnectorRouterRouteResponse {
8787 raw: self.raw,
8788 _phantom: ::core::marker::PhantomData,
8789 })
8790 } else {
8791 None
8792 }
8793 }
8794}
8795
8796unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConnectorRouterRouteResponse
8797where
8798 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8799
8800 ___D: ::fidl_next::fuchsia::HandleDecoder,
8801{
8802 fn decode(
8803 mut slot: ::fidl_next::Slot<'_, Self>,
8804 decoder: &mut ___D,
8805 ) -> Result<(), ::fidl_next::DecodeError> {
8806 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8807 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8808 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireConnector>(
8809 raw, decoder,
8810 )?,
8811
8812 2 => {
8813 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
8814 }
8815
8816 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
8817 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
8818 }
8819
8820 Ok(())
8821 }
8822}
8823
8824impl ::core::fmt::Debug for WireOptionalConnectorRouterRouteResponse {
8825 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8826 self.as_ref().fmt(f)
8827 }
8828}
8829
8830#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8831#[repr(u32)]
8832pub enum RouterError {
8833 NotFound = 1,
8834 InvalidArgs = 2,
8835 NotSupported = 3,
8836 Internal = 4,
8837 UnknownOrdinal_(u32),
8838}
8839
8840impl ::fidl_next::Encodable for RouterError {
8841 type Encoded = WireRouterError;
8842}
8843impl ::std::convert::From<u32> for RouterError {
8844 fn from(value: u32) -> Self {
8845 match value {
8846 1 => Self::NotFound,
8847 2 => Self::InvalidArgs,
8848 3 => Self::NotSupported,
8849 4 => Self::Internal,
8850
8851 _ => Self::UnknownOrdinal_(value),
8852 }
8853 }
8854}
8855
8856unsafe impl<___E> ::fidl_next::Encode<___E> for RouterError
8857where
8858 ___E: ?Sized,
8859{
8860 #[inline]
8861 fn encode(
8862 self,
8863 encoder: &mut ___E,
8864 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8865 ) -> Result<(), ::fidl_next::EncodeError> {
8866 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8867 }
8868}
8869
8870unsafe impl<___E> ::fidl_next::EncodeRef<___E> for RouterError
8871where
8872 ___E: ?Sized,
8873{
8874 #[inline]
8875 fn encode_ref(
8876 &self,
8877 encoder: &mut ___E,
8878 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8879 ) -> Result<(), ::fidl_next::EncodeError> {
8880 ::fidl_next::munge!(let WireRouterError { value } = out);
8881 let _ = value.write(::fidl_next::WireU32::from(match *self {
8882 Self::NotFound => 1,
8883
8884 Self::InvalidArgs => 2,
8885
8886 Self::NotSupported => 3,
8887
8888 Self::Internal => 4,
8889
8890 Self::UnknownOrdinal_(value) => value,
8891 }));
8892
8893 Ok(())
8894 }
8895}
8896
8897impl ::core::convert::From<WireRouterError> for RouterError {
8898 fn from(wire: WireRouterError) -> Self {
8899 match u32::from(wire.value) {
8900 1 => Self::NotFound,
8901
8902 2 => Self::InvalidArgs,
8903
8904 3 => Self::NotSupported,
8905
8906 4 => Self::Internal,
8907
8908 value => Self::UnknownOrdinal_(value),
8909 }
8910 }
8911}
8912
8913impl ::fidl_next::FromWire<WireRouterError> for RouterError {
8914 #[inline]
8915 fn from_wire(wire: WireRouterError) -> Self {
8916 Self::from(wire)
8917 }
8918}
8919
8920impl ::fidl_next::FromWireRef<WireRouterError> for RouterError {
8921 #[inline]
8922 fn from_wire_ref(wire: &WireRouterError) -> Self {
8923 Self::from(*wire)
8924 }
8925}
8926
8927#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8929#[repr(transparent)]
8930pub struct WireRouterError {
8931 value: ::fidl_next::WireU32,
8932}
8933
8934unsafe impl ::fidl_next::Wire for WireRouterError {
8935 type Decoded<'de> = Self;
8936
8937 #[inline]
8938 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8939 }
8941}
8942
8943impl WireRouterError {
8944 pub const NOT_FOUND: WireRouterError = WireRouterError { value: ::fidl_next::WireU32(1) };
8945
8946 pub const INVALID_ARGS: WireRouterError = WireRouterError { value: ::fidl_next::WireU32(2) };
8947
8948 pub const NOT_SUPPORTED: WireRouterError = WireRouterError { value: ::fidl_next::WireU32(3) };
8949
8950 pub const INTERNAL: WireRouterError = WireRouterError { value: ::fidl_next::WireU32(4) };
8951}
8952
8953unsafe impl<___D> ::fidl_next::Decode<___D> for WireRouterError
8954where
8955 ___D: ?Sized,
8956{
8957 fn decode(
8958 slot: ::fidl_next::Slot<'_, Self>,
8959 _: &mut ___D,
8960 ) -> Result<(), ::fidl_next::DecodeError> {
8961 Ok(())
8962 }
8963}
8964
8965impl ::core::convert::From<RouterError> for WireRouterError {
8966 fn from(natural: RouterError) -> Self {
8967 match natural {
8968 RouterError::NotFound => WireRouterError::NOT_FOUND,
8969
8970 RouterError::InvalidArgs => WireRouterError::INVALID_ARGS,
8971
8972 RouterError::NotSupported => WireRouterError::NOT_SUPPORTED,
8973
8974 RouterError::Internal => WireRouterError::INTERNAL,
8975
8976 RouterError::UnknownOrdinal_(value) => {
8977 WireRouterError { value: ::fidl_next::WireU32::from(value) }
8978 }
8979 }
8980 }
8981}
8982
8983#[derive(Debug)]
8985pub struct ConnectorRouter;
8986
8987impl ::fidl_next::Discoverable for ConnectorRouter {
8988 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
8989}
8990
8991pub mod connector_router {
8992 pub mod prelude {
8993 pub use crate::{
8994 connector_router, ConnectorRouter, ConnectorRouterClientHandler,
8995 ConnectorRouterServerHandler,
8996 };
8997
8998 pub use crate::ConnectorRouterRouteResponse;
8999
9000 pub use crate::RouteRequest;
9001
9002 pub use crate::RouterError;
9003 }
9004
9005 pub struct Route;
9006
9007 impl ::fidl_next::Method for Route {
9008 const ORDINAL: u64 = 8420527046218942310;
9009
9010 type Protocol = crate::ConnectorRouter;
9011
9012 type Request = crate::WireRouteRequest<'static>;
9013
9014 type Response = ::fidl_next::WireFlexibleResult<
9015 'static,
9016 crate::WireConnectorRouterRouteResponse,
9017 crate::WireRouterError,
9018 >;
9019 }
9020
9021 mod ___detail {
9022
9023 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::ConnectorRouter
9024 where
9025 ___T: ::fidl_next::Transport,
9026 {
9027 type ClientSender = ConnectorRouterClientSender<___T>;
9028 type ServerSender = ConnectorRouterServerSender<___T>;
9029 }
9030
9031 pub struct ConnectorRouterClientSender<___T: ::fidl_next::Transport> {
9033 #[allow(dead_code)]
9034 sender: ::fidl_next::protocol::ClientSender<___T>,
9035 }
9036
9037 impl<___T> ConnectorRouterClientSender<___T>
9038 where
9039 ___T: ::fidl_next::Transport,
9040 {
9041 pub fn route_with<___R>(
9042 &self,
9043 request: ___R,
9044 ) -> Result<::fidl_next::ResponseFuture<'_, super::Route, ___T>, ::fidl_next::EncodeError>
9045 where
9046 ___R: ::fidl_next::Encode<
9047 <___T as ::fidl_next::Transport>::SendBuffer,
9048 Encoded = crate::WireRouteRequest<'static>,
9049 >,
9050 {
9051 self.sender
9052 .send_two_way(8420527046218942310, request)
9053 .map(::fidl_next::ResponseFuture::from_untyped)
9054 }
9055 }
9056
9057 #[repr(transparent)]
9059 pub struct ConnectorRouterServerSender<___T: ::fidl_next::Transport> {
9060 sender: ::fidl_next::protocol::ServerSender<___T>,
9061 }
9062
9063 impl<___T> ConnectorRouterServerSender<___T> where ___T: ::fidl_next::Transport {}
9064 }
9065}
9066
9067pub trait ConnectorRouterClientHandler<___T: ::fidl_next::Transport> {
9071 fn on_unknown_interaction(
9072 &mut self,
9073 sender: &::fidl_next::ClientSender<ConnectorRouter, ___T>,
9074 ordinal: u64,
9075 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
9076 sender.close();
9077 ::core::future::ready(())
9078 }
9079}
9080
9081impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for ConnectorRouter
9082where
9083 ___H: ConnectorRouterClientHandler<___T> + Send,
9084 ___T: ::fidl_next::Transport,
9085
9086 <connector_router::Route as ::fidl_next::Method>::Response:
9087 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9088{
9089 async fn on_event(
9090 handler: &mut ___H,
9091 sender: &::fidl_next::ClientSender<Self, ___T>,
9092 ordinal: u64,
9093 buffer: ___T::RecvBuffer,
9094 ) {
9095 match ordinal {
9096 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9097 }
9098 }
9099}
9100
9101pub trait ConnectorRouterServerHandler<___T: ::fidl_next::Transport> {
9105 fn route(
9106 &mut self,
9107 sender: &::fidl_next::ServerSender<ConnectorRouter, ___T>,
9108
9109 request: ::fidl_next::Request<connector_router::Route, ___T>,
9110
9111 responder: ::fidl_next::Responder<connector_router::Route>,
9112 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
9113
9114 fn on_unknown_interaction(
9115 &mut self,
9116 sender: &::fidl_next::ServerSender<ConnectorRouter, ___T>,
9117 ordinal: u64,
9118 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
9119 sender.close();
9120 ::core::future::ready(())
9121 }
9122}
9123
9124impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for ConnectorRouter
9125where
9126 ___H: ConnectorRouterServerHandler<___T> + Send,
9127 ___T: ::fidl_next::Transport,
9128
9129 <connector_router::Route as ::fidl_next::Method>::Request:
9130 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9131{
9132 async fn on_one_way(
9133 handler: &mut ___H,
9134 sender: &::fidl_next::ServerSender<Self, ___T>,
9135 ordinal: u64,
9136 buffer: ___T::RecvBuffer,
9137 ) {
9138 match ordinal {
9139 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9140 }
9141 }
9142
9143 async fn on_two_way(
9144 handler: &mut ___H,
9145 sender: &::fidl_next::ServerSender<Self, ___T>,
9146 ordinal: u64,
9147 buffer: ___T::RecvBuffer,
9148 responder: ::fidl_next::protocol::Responder,
9149 ) {
9150 match ordinal {
9151 8420527046218942310 => {
9152 let responder = ::fidl_next::Responder::from_untyped(responder);
9153
9154 match ::fidl_next::DecoderExt::decode(buffer) {
9155 Ok(decoded) => handler.route(sender, decoded, responder).await,
9156 Err(e) => {
9157 sender.close();
9158 }
9159 }
9160 }
9161
9162 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9163 }
9164 }
9165}
9166
9167#[derive(Debug)]
9168pub enum DataRouterRouteResponse {
9169 Data(crate::Data),
9170
9171 Unavailable(crate::Unit),
9172}
9173
9174impl ::fidl_next::Encodable for DataRouterRouteResponse {
9175 type Encoded = WireDataRouterRouteResponse<'static>;
9176}
9177
9178unsafe impl<___E> ::fidl_next::Encode<___E> for DataRouterRouteResponse
9179where
9180 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9181
9182 ___E: ::fidl_next::Encoder,
9183
9184 ___E: ::fidl_next::fuchsia::HandleEncoder,
9185{
9186 #[inline]
9187 fn encode(
9188 self,
9189 encoder: &mut ___E,
9190 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9191 ) -> Result<(), ::fidl_next::EncodeError> {
9192 ::fidl_next::munge!(let WireDataRouterRouteResponse { raw, _phantom: _ } = out);
9193
9194 match self {
9195 Self::Data(value) => {
9196 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Data>(value, 1, encoder, raw)?
9197 }
9198
9199 Self::Unavailable(value) => {
9200 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Unit>(value, 2, encoder, raw)?
9201 }
9202 }
9203
9204 Ok(())
9205 }
9206}
9207
9208impl ::fidl_next::EncodableOption for DataRouterRouteResponse {
9209 type EncodedOption = WireOptionalDataRouterRouteResponse<'static>;
9210}
9211
9212unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DataRouterRouteResponse
9213where
9214 ___E: ?Sized,
9215 DataRouterRouteResponse: ::fidl_next::Encode<___E>,
9216{
9217 #[inline]
9218 fn encode_option(
9219 this: Option<Self>,
9220 encoder: &mut ___E,
9221 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9222 ) -> Result<(), ::fidl_next::EncodeError> {
9223 ::fidl_next::munge!(let WireOptionalDataRouterRouteResponse { raw, _phantom: _ } = &mut *out);
9224
9225 if let Some(inner) = this {
9226 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
9227 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
9228 } else {
9229 ::fidl_next::RawWireUnion::encode_absent(raw);
9230 }
9231
9232 Ok(())
9233 }
9234}
9235
9236impl<'de> ::fidl_next::FromWire<WireDataRouterRouteResponse<'de>> for DataRouterRouteResponse {
9237 #[inline]
9238 fn from_wire(wire: WireDataRouterRouteResponse<'de>) -> Self {
9239 let wire = ::core::mem::ManuallyDrop::new(wire);
9240 match wire.raw.ordinal() {
9241 1 => Self::Data(::fidl_next::FromWire::from_wire(unsafe {
9242 wire.raw.get().read_unchecked::<crate::WireData<'de>>()
9243 })),
9244
9245 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
9246 wire.raw.get().read_unchecked::<crate::WireUnit>()
9247 })),
9248
9249 _ => unsafe { ::core::hint::unreachable_unchecked() },
9250 }
9251 }
9252}
9253
9254impl<'de> ::fidl_next::FromWireOption<WireOptionalDataRouterRouteResponse<'de>>
9255 for Box<DataRouterRouteResponse>
9256{
9257 #[inline]
9258 fn from_wire_option(wire: WireOptionalDataRouterRouteResponse<'de>) -> Option<Self> {
9259 if let Some(inner) = wire.into_option() {
9260 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
9261 } else {
9262 None
9263 }
9264 }
9265}
9266
9267#[repr(transparent)]
9269pub struct WireDataRouterRouteResponse<'de> {
9270 raw: ::fidl_next::RawWireUnion,
9271 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
9272}
9273
9274impl<'de> Drop for WireDataRouterRouteResponse<'de> {
9275 fn drop(&mut self) {
9276 match self.raw.ordinal() {
9277 1 => {
9278 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireData<'de>>() };
9279 }
9280
9281 2 => {
9282 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
9283 }
9284
9285 _ => unsafe { ::core::hint::unreachable_unchecked() },
9286 }
9287 }
9288}
9289
9290unsafe impl ::fidl_next::Wire for WireDataRouterRouteResponse<'static> {
9291 type Decoded<'de> = WireDataRouterRouteResponse<'de>;
9292
9293 #[inline]
9294 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9295 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
9296 ::fidl_next::RawWireUnion::zero_padding(raw);
9297 }
9298}
9299
9300pub mod data_router_route_response {
9301 pub enum Ref<'de> {
9302 Data(&'de crate::WireData<'de>),
9303
9304 Unavailable(&'de crate::WireUnit),
9305 }
9306}
9307
9308impl<'de> WireDataRouterRouteResponse<'de> {
9309 pub fn as_ref(&self) -> crate::data_router_route_response::Ref<'_> {
9310 match self.raw.ordinal() {
9311 1 => crate::data_router_route_response::Ref::Data(unsafe {
9312 self.raw.get().deref_unchecked::<crate::WireData<'_>>()
9313 }),
9314
9315 2 => crate::data_router_route_response::Ref::Unavailable(unsafe {
9316 self.raw.get().deref_unchecked::<crate::WireUnit>()
9317 }),
9318
9319 _ => unsafe { ::core::hint::unreachable_unchecked() },
9320 }
9321 }
9322}
9323
9324unsafe impl<___D> ::fidl_next::Decode<___D> for WireDataRouterRouteResponse<'static>
9325where
9326 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9327
9328 ___D: ::fidl_next::Decoder,
9329
9330 ___D: ::fidl_next::fuchsia::HandleDecoder,
9331{
9332 fn decode(
9333 mut slot: ::fidl_next::Slot<'_, Self>,
9334 decoder: &mut ___D,
9335 ) -> Result<(), ::fidl_next::DecodeError> {
9336 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
9337 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
9338 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireData<'static>>(
9339 raw, decoder,
9340 )?,
9341
9342 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnit>(raw, decoder)?,
9343
9344 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
9345 }
9346
9347 Ok(())
9348 }
9349}
9350
9351impl<'de> ::core::fmt::Debug for WireDataRouterRouteResponse<'de> {
9352 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9353 match self.raw.ordinal() {
9354 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireData<'_>>().fmt(f) },
9355 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
9356 _ => unsafe { ::core::hint::unreachable_unchecked() },
9357 }
9358 }
9359}
9360
9361#[repr(transparent)]
9362pub struct WireOptionalDataRouterRouteResponse<'de> {
9363 raw: ::fidl_next::RawWireUnion,
9364 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
9365}
9366
9367unsafe impl ::fidl_next::Wire for WireOptionalDataRouterRouteResponse<'static> {
9368 type Decoded<'de> = WireOptionalDataRouterRouteResponse<'de>;
9369
9370 #[inline]
9371 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9372 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
9373 ::fidl_next::RawWireUnion::zero_padding(raw);
9374 }
9375}
9376
9377impl<'de> WireOptionalDataRouterRouteResponse<'de> {
9378 pub fn is_some(&self) -> bool {
9379 self.raw.is_some()
9380 }
9381
9382 pub fn is_none(&self) -> bool {
9383 self.raw.is_none()
9384 }
9385
9386 pub fn as_ref(&self) -> Option<&WireDataRouterRouteResponse<'de>> {
9387 if self.is_some() {
9388 Some(unsafe { &*(self as *const Self).cast() })
9389 } else {
9390 None
9391 }
9392 }
9393
9394 pub fn into_option(self) -> Option<WireDataRouterRouteResponse<'de>> {
9395 if self.is_some() {
9396 Some(WireDataRouterRouteResponse {
9397 raw: self.raw,
9398 _phantom: ::core::marker::PhantomData,
9399 })
9400 } else {
9401 None
9402 }
9403 }
9404}
9405
9406unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDataRouterRouteResponse<'static>
9407where
9408 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9409
9410 ___D: ::fidl_next::Decoder,
9411
9412 ___D: ::fidl_next::fuchsia::HandleDecoder,
9413{
9414 fn decode(
9415 mut slot: ::fidl_next::Slot<'_, Self>,
9416 decoder: &mut ___D,
9417 ) -> Result<(), ::fidl_next::DecodeError> {
9418 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
9419 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
9420 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireData<'static>>(
9421 raw, decoder,
9422 )?,
9423
9424 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnit>(raw, decoder)?,
9425
9426 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
9427 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
9428 }
9429
9430 Ok(())
9431 }
9432}
9433
9434impl<'de> ::core::fmt::Debug for WireOptionalDataRouterRouteResponse<'de> {
9435 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
9436 self.as_ref().fmt(f)
9437 }
9438}
9439
9440#[derive(Debug)]
9442pub struct DataRouter;
9443
9444impl ::fidl_next::Discoverable for DataRouter {
9445 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
9446}
9447
9448pub mod data_router {
9449 pub mod prelude {
9450 pub use crate::{
9451 data_router, DataRouter, DataRouterClientHandler, DataRouterServerHandler,
9452 };
9453
9454 pub use crate::DataRouterRouteResponse;
9455
9456 pub use crate::RouteRequest;
9457
9458 pub use crate::RouterError;
9459 }
9460
9461 pub struct Route;
9462
9463 impl ::fidl_next::Method for Route {
9464 const ORDINAL: u64 = 3352890635970754564;
9465
9466 type Protocol = crate::DataRouter;
9467
9468 type Request = crate::WireRouteRequest<'static>;
9469
9470 type Response = ::fidl_next::WireFlexibleResult<
9471 'static,
9472 crate::WireDataRouterRouteResponse<'static>,
9473 crate::WireRouterError,
9474 >;
9475 }
9476
9477 mod ___detail {
9478
9479 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DataRouter
9480 where
9481 ___T: ::fidl_next::Transport,
9482 {
9483 type ClientSender = DataRouterClientSender<___T>;
9484 type ServerSender = DataRouterServerSender<___T>;
9485 }
9486
9487 pub struct DataRouterClientSender<___T: ::fidl_next::Transport> {
9489 #[allow(dead_code)]
9490 sender: ::fidl_next::protocol::ClientSender<___T>,
9491 }
9492
9493 impl<___T> DataRouterClientSender<___T>
9494 where
9495 ___T: ::fidl_next::Transport,
9496 {
9497 pub fn route_with<___R>(
9498 &self,
9499 request: ___R,
9500 ) -> Result<::fidl_next::ResponseFuture<'_, super::Route, ___T>, ::fidl_next::EncodeError>
9501 where
9502 ___R: ::fidl_next::Encode<
9503 <___T as ::fidl_next::Transport>::SendBuffer,
9504 Encoded = crate::WireRouteRequest<'static>,
9505 >,
9506 {
9507 self.sender
9508 .send_two_way(3352890635970754564, request)
9509 .map(::fidl_next::ResponseFuture::from_untyped)
9510 }
9511 }
9512
9513 #[repr(transparent)]
9515 pub struct DataRouterServerSender<___T: ::fidl_next::Transport> {
9516 sender: ::fidl_next::protocol::ServerSender<___T>,
9517 }
9518
9519 impl<___T> DataRouterServerSender<___T> where ___T: ::fidl_next::Transport {}
9520 }
9521}
9522
9523pub trait DataRouterClientHandler<___T: ::fidl_next::Transport> {
9527 fn on_unknown_interaction(
9528 &mut self,
9529 sender: &::fidl_next::ClientSender<DataRouter, ___T>,
9530 ordinal: u64,
9531 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
9532 sender.close();
9533 ::core::future::ready(())
9534 }
9535}
9536
9537impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DataRouter
9538where
9539 ___H: DataRouterClientHandler<___T> + Send,
9540 ___T: ::fidl_next::Transport,
9541
9542 <data_router::Route as ::fidl_next::Method>::Response:
9543 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9544{
9545 async fn on_event(
9546 handler: &mut ___H,
9547 sender: &::fidl_next::ClientSender<Self, ___T>,
9548 ordinal: u64,
9549 buffer: ___T::RecvBuffer,
9550 ) {
9551 match ordinal {
9552 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9553 }
9554 }
9555}
9556
9557pub trait DataRouterServerHandler<___T: ::fidl_next::Transport> {
9561 fn route(
9562 &mut self,
9563 sender: &::fidl_next::ServerSender<DataRouter, ___T>,
9564
9565 request: ::fidl_next::Request<data_router::Route, ___T>,
9566
9567 responder: ::fidl_next::Responder<data_router::Route>,
9568 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
9569
9570 fn on_unknown_interaction(
9571 &mut self,
9572 sender: &::fidl_next::ServerSender<DataRouter, ___T>,
9573 ordinal: u64,
9574 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
9575 sender.close();
9576 ::core::future::ready(())
9577 }
9578}
9579
9580impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DataRouter
9581where
9582 ___H: DataRouterServerHandler<___T> + Send,
9583 ___T: ::fidl_next::Transport,
9584
9585 <data_router::Route as ::fidl_next::Method>::Request:
9586 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9587{
9588 async fn on_one_way(
9589 handler: &mut ___H,
9590 sender: &::fidl_next::ServerSender<Self, ___T>,
9591 ordinal: u64,
9592 buffer: ___T::RecvBuffer,
9593 ) {
9594 match ordinal {
9595 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9596 }
9597 }
9598
9599 async fn on_two_way(
9600 handler: &mut ___H,
9601 sender: &::fidl_next::ServerSender<Self, ___T>,
9602 ordinal: u64,
9603 buffer: ___T::RecvBuffer,
9604 responder: ::fidl_next::protocol::Responder,
9605 ) {
9606 match ordinal {
9607 3352890635970754564 => {
9608 let responder = ::fidl_next::Responder::from_untyped(responder);
9609
9610 match ::fidl_next::DecoderExt::decode(buffer) {
9611 Ok(decoded) => handler.route(sender, decoded, responder).await,
9612 Err(e) => {
9613 sender.close();
9614 }
9615 }
9616 }
9617
9618 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9619 }
9620 }
9621}
9622
9623#[derive(Debug)]
9625pub struct Dictionary;
9626
9627impl ::fidl_next::Discoverable for Dictionary {
9628 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
9629}
9630
9631pub mod dictionary {
9632 pub mod prelude {
9633 pub use crate::{dictionary, Dictionary, DictionaryClientHandler, DictionaryServerHandler};
9634 }
9635
9636 mod ___detail {
9637
9638 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Dictionary
9639 where
9640 ___T: ::fidl_next::Transport,
9641 {
9642 type ClientSender = DictionaryClientSender<___T>;
9643 type ServerSender = DictionaryServerSender<___T>;
9644 }
9645
9646 pub struct DictionaryClientSender<___T: ::fidl_next::Transport> {
9648 #[allow(dead_code)]
9649 sender: ::fidl_next::protocol::ClientSender<___T>,
9650 }
9651
9652 impl<___T> DictionaryClientSender<___T> where ___T: ::fidl_next::Transport {}
9653
9654 #[repr(transparent)]
9656 pub struct DictionaryServerSender<___T: ::fidl_next::Transport> {
9657 sender: ::fidl_next::protocol::ServerSender<___T>,
9658 }
9659
9660 impl<___T> DictionaryServerSender<___T> where ___T: ::fidl_next::Transport {}
9661 }
9662}
9663
9664pub trait DictionaryClientHandler<___T: ::fidl_next::Transport> {
9668 fn on_unknown_interaction(
9669 &mut self,
9670 sender: &::fidl_next::ClientSender<Dictionary, ___T>,
9671 ordinal: u64,
9672 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
9673 sender.close();
9674 ::core::future::ready(())
9675 }
9676}
9677
9678impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Dictionary
9679where
9680 ___H: DictionaryClientHandler<___T> + Send,
9681 ___T: ::fidl_next::Transport,
9682{
9683 async fn on_event(
9684 handler: &mut ___H,
9685 sender: &::fidl_next::ClientSender<Self, ___T>,
9686 ordinal: u64,
9687 buffer: ___T::RecvBuffer,
9688 ) {
9689 match ordinal {
9690 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9691 }
9692 }
9693}
9694
9695pub trait DictionaryServerHandler<___T: ::fidl_next::Transport> {
9699 fn on_unknown_interaction(
9700 &mut self,
9701 sender: &::fidl_next::ServerSender<Dictionary, ___T>,
9702 ordinal: u64,
9703 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
9704 sender.close();
9705 ::core::future::ready(())
9706 }
9707}
9708
9709impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Dictionary
9710where
9711 ___H: DictionaryServerHandler<___T> + Send,
9712 ___T: ::fidl_next::Transport,
9713{
9714 async fn on_one_way(
9715 handler: &mut ___H,
9716 sender: &::fidl_next::ServerSender<Self, ___T>,
9717 ordinal: u64,
9718 buffer: ___T::RecvBuffer,
9719 ) {
9720 match ordinal {
9721 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9722 }
9723 }
9724
9725 async fn on_two_way(
9726 handler: &mut ___H,
9727 sender: &::fidl_next::ServerSender<Self, ___T>,
9728 ordinal: u64,
9729 buffer: ___T::RecvBuffer,
9730 responder: ::fidl_next::protocol::Responder,
9731 ) {
9732 match ordinal {
9733 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
9734 }
9735 }
9736}
9737
9738#[derive(Clone, Debug)]
9739pub struct DictionaryDrainIteratorGetNextRequest {
9740 pub start_id: u64,
9741
9742 pub limit: u32,
9743}
9744
9745impl ::fidl_next::Encodable for DictionaryDrainIteratorGetNextRequest {
9746 type Encoded = WireDictionaryDrainIteratorGetNextRequest;
9747}
9748
9749unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryDrainIteratorGetNextRequest
9750where
9751 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9752{
9753 #[inline]
9754 fn encode(
9755 self,
9756 encoder: &mut ___E,
9757 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9758 ) -> Result<(), ::fidl_next::EncodeError> {
9759 ::fidl_next::munge! {
9760 let Self::Encoded {
9761 start_id,
9762 limit,
9763
9764 } = out;
9765 }
9766
9767 ::fidl_next::Encode::encode(self.start_id, encoder, start_id)?;
9768
9769 ::fidl_next::Encode::encode(self.limit, encoder, limit)?;
9770
9771 Ok(())
9772 }
9773}
9774
9775unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DictionaryDrainIteratorGetNextRequest
9776where
9777 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9778{
9779 #[inline]
9780 fn encode_ref(
9781 &self,
9782 encoder: &mut ___E,
9783 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9784 ) -> Result<(), ::fidl_next::EncodeError> {
9785 ::fidl_next::munge! {
9786 let Self::Encoded {
9787 start_id,
9788 limit,
9789
9790 } = out;
9791 }
9792
9793 ::fidl_next::EncodeRef::encode_ref(&self.start_id, encoder, start_id)?;
9794
9795 ::fidl_next::EncodeRef::encode_ref(&self.limit, encoder, limit)?;
9796
9797 Ok(())
9798 }
9799}
9800
9801impl ::fidl_next::EncodableOption for DictionaryDrainIteratorGetNextRequest {
9802 type EncodedOption = ::fidl_next::WireBox<'static, WireDictionaryDrainIteratorGetNextRequest>;
9803}
9804
9805unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryDrainIteratorGetNextRequest
9806where
9807 ___E: ::fidl_next::Encoder + ?Sized,
9808 DictionaryDrainIteratorGetNextRequest: ::fidl_next::Encode<___E>,
9809{
9810 #[inline]
9811 fn encode_option(
9812 this: Option<Self>,
9813 encoder: &mut ___E,
9814 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9815 ) -> Result<(), ::fidl_next::EncodeError> {
9816 if let Some(inner) = this {
9817 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9818 ::fidl_next::WireBox::encode_present(out);
9819 } else {
9820 ::fidl_next::WireBox::encode_absent(out);
9821 }
9822
9823 Ok(())
9824 }
9825}
9826
9827unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DictionaryDrainIteratorGetNextRequest
9828where
9829 ___E: ::fidl_next::Encoder + ?Sized,
9830 DictionaryDrainIteratorGetNextRequest: ::fidl_next::EncodeRef<___E>,
9831{
9832 #[inline]
9833 fn encode_option_ref(
9834 this: Option<&Self>,
9835 encoder: &mut ___E,
9836 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9837 ) -> Result<(), ::fidl_next::EncodeError> {
9838 if let Some(inner) = this {
9839 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9840 ::fidl_next::WireBox::encode_present(out);
9841 } else {
9842 ::fidl_next::WireBox::encode_absent(out);
9843 }
9844
9845 Ok(())
9846 }
9847}
9848
9849impl ::fidl_next::FromWire<WireDictionaryDrainIteratorGetNextRequest>
9850 for DictionaryDrainIteratorGetNextRequest
9851{
9852 #[inline]
9853 fn from_wire(wire: WireDictionaryDrainIteratorGetNextRequest) -> Self {
9854 Self {
9855 start_id: ::fidl_next::FromWire::from_wire(wire.start_id),
9856
9857 limit: ::fidl_next::FromWire::from_wire(wire.limit),
9858 }
9859 }
9860}
9861
9862impl ::fidl_next::FromWireRef<WireDictionaryDrainIteratorGetNextRequest>
9863 for DictionaryDrainIteratorGetNextRequest
9864{
9865 #[inline]
9866 fn from_wire_ref(wire: &WireDictionaryDrainIteratorGetNextRequest) -> Self {
9867 Self {
9868 start_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.start_id),
9869
9870 limit: ::fidl_next::FromWireRef::from_wire_ref(&wire.limit),
9871 }
9872 }
9873}
9874
9875#[derive(Clone, Debug)]
9877#[repr(C)]
9878pub struct WireDictionaryDrainIteratorGetNextRequest {
9879 pub start_id: ::fidl_next::WireU64,
9880
9881 pub limit: ::fidl_next::WireU32,
9882}
9883
9884unsafe impl ::fidl_next::Wire for WireDictionaryDrainIteratorGetNextRequest {
9885 type Decoded<'de> = WireDictionaryDrainIteratorGetNextRequest;
9886
9887 #[inline]
9888 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9889 unsafe {
9890 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
9891 }
9892 }
9893}
9894
9895unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryDrainIteratorGetNextRequest
9896where
9897 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9898{
9899 fn decode(
9900 slot: ::fidl_next::Slot<'_, Self>,
9901 decoder: &mut ___D,
9902 ) -> Result<(), ::fidl_next::DecodeError> {
9903 ::fidl_next::munge! {
9904 let Self {
9905 mut start_id,
9906 mut limit,
9907
9908 } = slot;
9909 }
9910
9911 ::fidl_next::Decode::decode(start_id.as_mut(), decoder)?;
9912
9913 ::fidl_next::Decode::decode(limit.as_mut(), decoder)?;
9914
9915 Ok(())
9916 }
9917}
9918
9919#[doc = " Maximum number of items returned by dictionary iterator.\n"]
9920pub const MAX_DICTIONARY_ITERATOR_CHUNK: u32 = 128;
9921
9922#[derive(Debug)]
9923pub struct DictionaryDrainIteratorGetNextResponse {
9924 pub items: Vec<crate::DictionaryItem>,
9925
9926 pub end_id: u64,
9927}
9928
9929impl ::fidl_next::Encodable for DictionaryDrainIteratorGetNextResponse {
9930 type Encoded = WireDictionaryDrainIteratorGetNextResponse<'static>;
9931}
9932
9933unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryDrainIteratorGetNextResponse
9934where
9935 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9936
9937 ___E: ::fidl_next::Encoder,
9938
9939 ___E: ::fidl_next::fuchsia::HandleEncoder,
9940{
9941 #[inline]
9942 fn encode(
9943 self,
9944 encoder: &mut ___E,
9945 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9946 ) -> Result<(), ::fidl_next::EncodeError> {
9947 ::fidl_next::munge! {
9948 let Self::Encoded {
9949 items,
9950 end_id,
9951
9952 } = out;
9953 }
9954
9955 ::fidl_next::Encode::encode(self.items, encoder, items)?;
9956
9957 ::fidl_next::Encode::encode(self.end_id, encoder, end_id)?;
9958
9959 Ok(())
9960 }
9961}
9962
9963impl ::fidl_next::EncodableOption for DictionaryDrainIteratorGetNextResponse {
9964 type EncodedOption =
9965 ::fidl_next::WireBox<'static, WireDictionaryDrainIteratorGetNextResponse<'static>>;
9966}
9967
9968unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryDrainIteratorGetNextResponse
9969where
9970 ___E: ::fidl_next::Encoder + ?Sized,
9971 DictionaryDrainIteratorGetNextResponse: ::fidl_next::Encode<___E>,
9972{
9973 #[inline]
9974 fn encode_option(
9975 this: Option<Self>,
9976 encoder: &mut ___E,
9977 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9978 ) -> Result<(), ::fidl_next::EncodeError> {
9979 if let Some(inner) = this {
9980 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9981 ::fidl_next::WireBox::encode_present(out);
9982 } else {
9983 ::fidl_next::WireBox::encode_absent(out);
9984 }
9985
9986 Ok(())
9987 }
9988}
9989
9990impl<'de> ::fidl_next::FromWire<WireDictionaryDrainIteratorGetNextResponse<'de>>
9991 for DictionaryDrainIteratorGetNextResponse
9992{
9993 #[inline]
9994 fn from_wire(wire: WireDictionaryDrainIteratorGetNextResponse<'de>) -> Self {
9995 Self {
9996 items: ::fidl_next::FromWire::from_wire(wire.items),
9997
9998 end_id: ::fidl_next::FromWire::from_wire(wire.end_id),
9999 }
10000 }
10001}
10002
10003#[derive(Debug)]
10005#[repr(C)]
10006pub struct WireDictionaryDrainIteratorGetNextResponse<'de> {
10007 pub items: ::fidl_next::WireVector<'de, crate::WireDictionaryItem<'de>>,
10008
10009 pub end_id: ::fidl_next::WireU64,
10010}
10011
10012unsafe impl ::fidl_next::Wire for WireDictionaryDrainIteratorGetNextResponse<'static> {
10013 type Decoded<'de> = WireDictionaryDrainIteratorGetNextResponse<'de>;
10014
10015 #[inline]
10016 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10017}
10018
10019unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryDrainIteratorGetNextResponse<'static>
10020where
10021 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10022
10023 ___D: ::fidl_next::Decoder,
10024
10025 ___D: ::fidl_next::fuchsia::HandleDecoder,
10026{
10027 fn decode(
10028 slot: ::fidl_next::Slot<'_, Self>,
10029 decoder: &mut ___D,
10030 ) -> Result<(), ::fidl_next::DecodeError> {
10031 ::fidl_next::munge! {
10032 let Self {
10033 mut items,
10034 mut end_id,
10035
10036 } = slot;
10037 }
10038
10039 ::fidl_next::Decode::decode(items.as_mut(), decoder)?;
10040
10041 let items = unsafe { items.deref_unchecked() };
10042
10043 if items.len() > 128 {
10044 return Err(::fidl_next::DecodeError::VectorTooLong {
10045 size: items.len() as u64,
10046 limit: 128,
10047 });
10048 }
10049
10050 ::fidl_next::Decode::decode(end_id.as_mut(), decoder)?;
10051
10052 Ok(())
10053 }
10054}
10055
10056#[derive(Debug)]
10058pub struct DictionaryDrainIterator;
10059
10060pub mod dictionary_drain_iterator {
10061 pub mod prelude {
10062 pub use crate::{
10063 dictionary_drain_iterator, DictionaryDrainIterator,
10064 DictionaryDrainIteratorClientHandler, DictionaryDrainIteratorServerHandler,
10065 };
10066
10067 pub use crate::CapabilityStoreError;
10068
10069 pub use crate::DictionaryDrainIteratorGetNextRequest;
10070
10071 pub use crate::DictionaryDrainIteratorGetNextResponse;
10072 }
10073
10074 pub struct GetNext;
10075
10076 impl ::fidl_next::Method for GetNext {
10077 const ORDINAL: u64 = 5728722530628427873;
10078
10079 type Protocol = crate::DictionaryDrainIterator;
10080
10081 type Request = crate::WireDictionaryDrainIteratorGetNextRequest;
10082
10083 type Response = ::fidl_next::WireFlexibleResult<
10084 'static,
10085 crate::WireDictionaryDrainIteratorGetNextResponse<'static>,
10086 crate::WireCapabilityStoreError,
10087 >;
10088 }
10089
10090 mod ___detail {
10091
10092 pub struct GetNext<T0, T1> {
10093 start_id: T0,
10094
10095 limit: T1,
10096 }
10097
10098 impl<T0, T1> ::fidl_next::Encodable for GetNext<T0, T1>
10099 where
10100 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
10101
10102 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU32>,
10103 {
10104 type Encoded = crate::WireDictionaryDrainIteratorGetNextRequest;
10105 }
10106
10107 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for GetNext<T0, T1>
10108 where
10109 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10110
10111 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
10112
10113 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU32>,
10114 {
10115 #[inline]
10116 fn encode(
10117 self,
10118 encoder: &mut ___E,
10119 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10120 ) -> Result<(), ::fidl_next::EncodeError> {
10121 ::fidl_next::munge! {
10122 let Self::Encoded {
10123 start_id,
10124 limit,
10125
10126 } = out;
10127 }
10128
10129 ::fidl_next::Encode::encode(self.start_id, encoder, start_id)?;
10130
10131 ::fidl_next::Encode::encode(self.limit, encoder, limit)?;
10132
10133 Ok(())
10134 }
10135 }
10136
10137 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DictionaryDrainIterator
10138 where
10139 ___T: ::fidl_next::Transport,
10140 {
10141 type ClientSender = DictionaryDrainIteratorClientSender<___T>;
10142 type ServerSender = DictionaryDrainIteratorServerSender<___T>;
10143 }
10144
10145 pub struct DictionaryDrainIteratorClientSender<___T: ::fidl_next::Transport> {
10147 #[allow(dead_code)]
10148 sender: ::fidl_next::protocol::ClientSender<___T>,
10149 }
10150
10151 impl<___T> DictionaryDrainIteratorClientSender<___T>
10152 where
10153 ___T: ::fidl_next::Transport,
10154 {
10155 #[doc = " Returns the next batch of results for a [Dictionary.Drain] call, returning up to\n `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].\n\n Each returned capability will be assigned a monotonically increasing [CapabilityId] starting\n from `start_id`.\n\n In addition to the `items`, returns `end_id`, which is one more than the highest id reserved\n by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].\n\n If [GetNext] returns an error, the server will also close the channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this\n store.\n - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.\n"]
10156 pub fn get_next(
10157 &self,
10158
10159 start_id: impl ::fidl_next::Encode<
10160 <___T as ::fidl_next::Transport>::SendBuffer,
10161 Encoded = ::fidl_next::WireU64,
10162 >,
10163
10164 limit: impl ::fidl_next::Encode<
10165 <___T as ::fidl_next::Transport>::SendBuffer,
10166 Encoded = ::fidl_next::WireU32,
10167 >,
10168 ) -> Result<
10169 ::fidl_next::ResponseFuture<'_, super::GetNext, ___T>,
10170 ::fidl_next::EncodeError,
10171 >
10172 where
10173 <___T as ::fidl_next::Transport>::SendBuffer:
10174 ::fidl_next::encoder::InternalHandleEncoder,
10175 {
10176 self.get_next_with(GetNext { start_id, limit })
10177 }
10178
10179 #[doc = " Returns the next batch of results for a [Dictionary.Drain] call, returning up to\n `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].\n\n Each returned capability will be assigned a monotonically increasing [CapabilityId] starting\n from `start_id`.\n\n In addition to the `items`, returns `end_id`, which is one more than the highest id reserved\n by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].\n\n If [GetNext] returns an error, the server will also close the channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this\n store.\n - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.\n"]
10180 pub fn get_next_with<___R>(
10181 &self,
10182 request: ___R,
10183 ) -> Result<
10184 ::fidl_next::ResponseFuture<'_, super::GetNext, ___T>,
10185 ::fidl_next::EncodeError,
10186 >
10187 where
10188 ___R: ::fidl_next::Encode<
10189 <___T as ::fidl_next::Transport>::SendBuffer,
10190 Encoded = crate::WireDictionaryDrainIteratorGetNextRequest,
10191 >,
10192 {
10193 self.sender
10194 .send_two_way(5728722530628427873, request)
10195 .map(::fidl_next::ResponseFuture::from_untyped)
10196 }
10197 }
10198
10199 #[repr(transparent)]
10201 pub struct DictionaryDrainIteratorServerSender<___T: ::fidl_next::Transport> {
10202 sender: ::fidl_next::protocol::ServerSender<___T>,
10203 }
10204
10205 impl<___T> DictionaryDrainIteratorServerSender<___T> where ___T: ::fidl_next::Transport {}
10206 }
10207}
10208
10209pub trait DictionaryDrainIteratorClientHandler<___T: ::fidl_next::Transport> {
10213 fn on_unknown_interaction(
10214 &mut self,
10215 sender: &::fidl_next::ClientSender<DictionaryDrainIterator, ___T>,
10216 ordinal: u64,
10217 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
10218 sender.close();
10219 ::core::future::ready(())
10220 }
10221}
10222
10223impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DictionaryDrainIterator
10224where
10225 ___H: DictionaryDrainIteratorClientHandler<___T> + Send,
10226 ___T: ::fidl_next::Transport,
10227
10228 <dictionary_drain_iterator::GetNext as ::fidl_next::Method>::Response:
10229 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10230{
10231 async fn on_event(
10232 handler: &mut ___H,
10233 sender: &::fidl_next::ClientSender<Self, ___T>,
10234 ordinal: u64,
10235 buffer: ___T::RecvBuffer,
10236 ) {
10237 match ordinal {
10238 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
10239 }
10240 }
10241}
10242
10243pub trait DictionaryDrainIteratorServerHandler<___T: ::fidl_next::Transport> {
10247 #[doc = " Returns the next batch of results for a [Dictionary.Drain] call, returning up to\n `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].\n\n Each returned capability will be assigned a monotonically increasing [CapabilityId] starting\n from `start_id`.\n\n In addition to the `items`, returns `end_id`, which is one more than the highest id reserved\n by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].\n\n If [GetNext] returns an error, the server will also close the channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this\n store.\n - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.\n"]
10248 fn get_next(
10249 &mut self,
10250 sender: &::fidl_next::ServerSender<DictionaryDrainIterator, ___T>,
10251
10252 request: ::fidl_next::Request<dictionary_drain_iterator::GetNext, ___T>,
10253
10254 responder: ::fidl_next::Responder<dictionary_drain_iterator::GetNext>,
10255 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
10256
10257 fn on_unknown_interaction(
10258 &mut self,
10259 sender: &::fidl_next::ServerSender<DictionaryDrainIterator, ___T>,
10260 ordinal: u64,
10261 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
10262 sender.close();
10263 ::core::future::ready(())
10264 }
10265}
10266
10267impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DictionaryDrainIterator
10268where
10269 ___H: DictionaryDrainIteratorServerHandler<___T> + Send,
10270 ___T: ::fidl_next::Transport,
10271
10272 <dictionary_drain_iterator::GetNext as ::fidl_next::Method>::Request:
10273 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10274{
10275 async fn on_one_way(
10276 handler: &mut ___H,
10277 sender: &::fidl_next::ServerSender<Self, ___T>,
10278 ordinal: u64,
10279 buffer: ___T::RecvBuffer,
10280 ) {
10281 match ordinal {
10282 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
10283 }
10284 }
10285
10286 async fn on_two_way(
10287 handler: &mut ___H,
10288 sender: &::fidl_next::ServerSender<Self, ___T>,
10289 ordinal: u64,
10290 buffer: ___T::RecvBuffer,
10291 responder: ::fidl_next::protocol::Responder,
10292 ) {
10293 match ordinal {
10294 5728722530628427873 => {
10295 let responder = ::fidl_next::Responder::from_untyped(responder);
10296
10297 match ::fidl_next::DecoderExt::decode(buffer) {
10298 Ok(decoded) => handler.get_next(sender, decoded, responder).await,
10299 Err(e) => {
10300 sender.close();
10301 }
10302 }
10303 }
10304
10305 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
10306 }
10307 }
10308}
10309
10310#[derive(Clone, Debug)]
10311pub struct DictionaryEnumerateIteratorGetNextRequest {
10312 pub start_id: u64,
10313
10314 pub limit: u32,
10315}
10316
10317impl ::fidl_next::Encodable for DictionaryEnumerateIteratorGetNextRequest {
10318 type Encoded = WireDictionaryEnumerateIteratorGetNextRequest;
10319}
10320
10321unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryEnumerateIteratorGetNextRequest
10322where
10323 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10324{
10325 #[inline]
10326 fn encode(
10327 self,
10328 encoder: &mut ___E,
10329 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10330 ) -> Result<(), ::fidl_next::EncodeError> {
10331 ::fidl_next::munge! {
10332 let Self::Encoded {
10333 start_id,
10334 limit,
10335
10336 } = out;
10337 }
10338
10339 ::fidl_next::Encode::encode(self.start_id, encoder, start_id)?;
10340
10341 ::fidl_next::Encode::encode(self.limit, encoder, limit)?;
10342
10343 Ok(())
10344 }
10345}
10346
10347unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DictionaryEnumerateIteratorGetNextRequest
10348where
10349 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10350{
10351 #[inline]
10352 fn encode_ref(
10353 &self,
10354 encoder: &mut ___E,
10355 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10356 ) -> Result<(), ::fidl_next::EncodeError> {
10357 ::fidl_next::munge! {
10358 let Self::Encoded {
10359 start_id,
10360 limit,
10361
10362 } = out;
10363 }
10364
10365 ::fidl_next::EncodeRef::encode_ref(&self.start_id, encoder, start_id)?;
10366
10367 ::fidl_next::EncodeRef::encode_ref(&self.limit, encoder, limit)?;
10368
10369 Ok(())
10370 }
10371}
10372
10373impl ::fidl_next::EncodableOption for DictionaryEnumerateIteratorGetNextRequest {
10374 type EncodedOption =
10375 ::fidl_next::WireBox<'static, WireDictionaryEnumerateIteratorGetNextRequest>;
10376}
10377
10378unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryEnumerateIteratorGetNextRequest
10379where
10380 ___E: ::fidl_next::Encoder + ?Sized,
10381 DictionaryEnumerateIteratorGetNextRequest: ::fidl_next::Encode<___E>,
10382{
10383 #[inline]
10384 fn encode_option(
10385 this: Option<Self>,
10386 encoder: &mut ___E,
10387 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10388 ) -> Result<(), ::fidl_next::EncodeError> {
10389 if let Some(inner) = this {
10390 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10391 ::fidl_next::WireBox::encode_present(out);
10392 } else {
10393 ::fidl_next::WireBox::encode_absent(out);
10394 }
10395
10396 Ok(())
10397 }
10398}
10399
10400unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DictionaryEnumerateIteratorGetNextRequest
10401where
10402 ___E: ::fidl_next::Encoder + ?Sized,
10403 DictionaryEnumerateIteratorGetNextRequest: ::fidl_next::EncodeRef<___E>,
10404{
10405 #[inline]
10406 fn encode_option_ref(
10407 this: Option<&Self>,
10408 encoder: &mut ___E,
10409 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10410 ) -> Result<(), ::fidl_next::EncodeError> {
10411 if let Some(inner) = this {
10412 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10413 ::fidl_next::WireBox::encode_present(out);
10414 } else {
10415 ::fidl_next::WireBox::encode_absent(out);
10416 }
10417
10418 Ok(())
10419 }
10420}
10421
10422impl ::fidl_next::FromWire<WireDictionaryEnumerateIteratorGetNextRequest>
10423 for DictionaryEnumerateIteratorGetNextRequest
10424{
10425 #[inline]
10426 fn from_wire(wire: WireDictionaryEnumerateIteratorGetNextRequest) -> Self {
10427 Self {
10428 start_id: ::fidl_next::FromWire::from_wire(wire.start_id),
10429
10430 limit: ::fidl_next::FromWire::from_wire(wire.limit),
10431 }
10432 }
10433}
10434
10435impl ::fidl_next::FromWireRef<WireDictionaryEnumerateIteratorGetNextRequest>
10436 for DictionaryEnumerateIteratorGetNextRequest
10437{
10438 #[inline]
10439 fn from_wire_ref(wire: &WireDictionaryEnumerateIteratorGetNextRequest) -> Self {
10440 Self {
10441 start_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.start_id),
10442
10443 limit: ::fidl_next::FromWireRef::from_wire_ref(&wire.limit),
10444 }
10445 }
10446}
10447
10448#[derive(Clone, Debug)]
10450#[repr(C)]
10451pub struct WireDictionaryEnumerateIteratorGetNextRequest {
10452 pub start_id: ::fidl_next::WireU64,
10453
10454 pub limit: ::fidl_next::WireU32,
10455}
10456
10457unsafe impl ::fidl_next::Wire for WireDictionaryEnumerateIteratorGetNextRequest {
10458 type Decoded<'de> = WireDictionaryEnumerateIteratorGetNextRequest;
10459
10460 #[inline]
10461 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10462 unsafe {
10463 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
10464 }
10465 }
10466}
10467
10468unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryEnumerateIteratorGetNextRequest
10469where
10470 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10471{
10472 fn decode(
10473 slot: ::fidl_next::Slot<'_, Self>,
10474 decoder: &mut ___D,
10475 ) -> Result<(), ::fidl_next::DecodeError> {
10476 ::fidl_next::munge! {
10477 let Self {
10478 mut start_id,
10479 mut limit,
10480
10481 } = slot;
10482 }
10483
10484 ::fidl_next::Decode::decode(start_id.as_mut(), decoder)?;
10485
10486 ::fidl_next::Decode::decode(limit.as_mut(), decoder)?;
10487
10488 Ok(())
10489 }
10490}
10491
10492#[doc = " A key-value pair in a [`DictionaryRef`], where the value may be elided.\n This is useful for APIs that may wish to omit the value, for example if it could not be\n duplicated.\n"]
10493#[derive(Debug)]
10494pub struct DictionaryOptionalItem {
10495 pub key: String,
10496
10497 pub value: Option<Box<crate::WrappedCapabilityId>>,
10498}
10499
10500impl ::fidl_next::Encodable for DictionaryOptionalItem {
10501 type Encoded = WireDictionaryOptionalItem<'static>;
10502}
10503
10504unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryOptionalItem
10505where
10506 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10507
10508 ___E: ::fidl_next::Encoder,
10509
10510 ___E: ::fidl_next::fuchsia::HandleEncoder,
10511{
10512 #[inline]
10513 fn encode(
10514 self,
10515 encoder: &mut ___E,
10516 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10517 ) -> Result<(), ::fidl_next::EncodeError> {
10518 ::fidl_next::munge! {
10519 let Self::Encoded {
10520 key,
10521 value,
10522
10523 } = out;
10524 }
10525
10526 ::fidl_next::Encode::encode(self.key, encoder, key)?;
10527
10528 ::fidl_next::Encode::encode(self.value, encoder, value)?;
10529
10530 Ok(())
10531 }
10532}
10533
10534impl ::fidl_next::EncodableOption for DictionaryOptionalItem {
10535 type EncodedOption = ::fidl_next::WireBox<'static, WireDictionaryOptionalItem<'static>>;
10536}
10537
10538unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryOptionalItem
10539where
10540 ___E: ::fidl_next::Encoder + ?Sized,
10541 DictionaryOptionalItem: ::fidl_next::Encode<___E>,
10542{
10543 #[inline]
10544 fn encode_option(
10545 this: Option<Self>,
10546 encoder: &mut ___E,
10547 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10548 ) -> Result<(), ::fidl_next::EncodeError> {
10549 if let Some(inner) = this {
10550 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10551 ::fidl_next::WireBox::encode_present(out);
10552 } else {
10553 ::fidl_next::WireBox::encode_absent(out);
10554 }
10555
10556 Ok(())
10557 }
10558}
10559
10560impl<'de> ::fidl_next::FromWire<WireDictionaryOptionalItem<'de>> for DictionaryOptionalItem {
10561 #[inline]
10562 fn from_wire(wire: WireDictionaryOptionalItem<'de>) -> Self {
10563 Self {
10564 key: ::fidl_next::FromWire::from_wire(wire.key),
10565
10566 value: ::fidl_next::FromWire::from_wire(wire.value),
10567 }
10568 }
10569}
10570
10571#[derive(Debug)]
10573#[repr(C)]
10574pub struct WireDictionaryOptionalItem<'de> {
10575 pub key: ::fidl_next::WireString<'de>,
10576
10577 pub value: ::fidl_next::WireBox<'de, crate::WireWrappedCapabilityId>,
10578}
10579
10580unsafe impl ::fidl_next::Wire for WireDictionaryOptionalItem<'static> {
10581 type Decoded<'de> = WireDictionaryOptionalItem<'de>;
10582
10583 #[inline]
10584 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10585}
10586
10587unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryOptionalItem<'static>
10588where
10589 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10590
10591 ___D: ::fidl_next::Decoder,
10592
10593 ___D: ::fidl_next::fuchsia::HandleDecoder,
10594{
10595 fn decode(
10596 slot: ::fidl_next::Slot<'_, Self>,
10597 decoder: &mut ___D,
10598 ) -> Result<(), ::fidl_next::DecodeError> {
10599 ::fidl_next::munge! {
10600 let Self {
10601 mut key,
10602 mut value,
10603
10604 } = slot;
10605 }
10606
10607 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
10608
10609 let key = unsafe { key.deref_unchecked() };
10610
10611 if key.len() > 255 {
10612 return Err(::fidl_next::DecodeError::VectorTooLong {
10613 size: key.len() as u64,
10614 limit: 255,
10615 });
10616 }
10617
10618 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
10619
10620 Ok(())
10621 }
10622}
10623
10624#[derive(Debug)]
10625pub struct DictionaryEnumerateIteratorGetNextResponse {
10626 pub items: Vec<crate::DictionaryOptionalItem>,
10627
10628 pub end_id: u64,
10629}
10630
10631impl ::fidl_next::Encodable for DictionaryEnumerateIteratorGetNextResponse {
10632 type Encoded = WireDictionaryEnumerateIteratorGetNextResponse<'static>;
10633}
10634
10635unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryEnumerateIteratorGetNextResponse
10636where
10637 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10638
10639 ___E: ::fidl_next::Encoder,
10640
10641 ___E: ::fidl_next::fuchsia::HandleEncoder,
10642{
10643 #[inline]
10644 fn encode(
10645 self,
10646 encoder: &mut ___E,
10647 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10648 ) -> Result<(), ::fidl_next::EncodeError> {
10649 ::fidl_next::munge! {
10650 let Self::Encoded {
10651 items,
10652 end_id,
10653
10654 } = out;
10655 }
10656
10657 ::fidl_next::Encode::encode(self.items, encoder, items)?;
10658
10659 ::fidl_next::Encode::encode(self.end_id, encoder, end_id)?;
10660
10661 Ok(())
10662 }
10663}
10664
10665impl ::fidl_next::EncodableOption for DictionaryEnumerateIteratorGetNextResponse {
10666 type EncodedOption =
10667 ::fidl_next::WireBox<'static, WireDictionaryEnumerateIteratorGetNextResponse<'static>>;
10668}
10669
10670unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryEnumerateIteratorGetNextResponse
10671where
10672 ___E: ::fidl_next::Encoder + ?Sized,
10673 DictionaryEnumerateIteratorGetNextResponse: ::fidl_next::Encode<___E>,
10674{
10675 #[inline]
10676 fn encode_option(
10677 this: Option<Self>,
10678 encoder: &mut ___E,
10679 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10680 ) -> Result<(), ::fidl_next::EncodeError> {
10681 if let Some(inner) = this {
10682 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10683 ::fidl_next::WireBox::encode_present(out);
10684 } else {
10685 ::fidl_next::WireBox::encode_absent(out);
10686 }
10687
10688 Ok(())
10689 }
10690}
10691
10692impl<'de> ::fidl_next::FromWire<WireDictionaryEnumerateIteratorGetNextResponse<'de>>
10693 for DictionaryEnumerateIteratorGetNextResponse
10694{
10695 #[inline]
10696 fn from_wire(wire: WireDictionaryEnumerateIteratorGetNextResponse<'de>) -> Self {
10697 Self {
10698 items: ::fidl_next::FromWire::from_wire(wire.items),
10699
10700 end_id: ::fidl_next::FromWire::from_wire(wire.end_id),
10701 }
10702 }
10703}
10704
10705#[derive(Debug)]
10707#[repr(C)]
10708pub struct WireDictionaryEnumerateIteratorGetNextResponse<'de> {
10709 pub items: ::fidl_next::WireVector<'de, crate::WireDictionaryOptionalItem<'de>>,
10710
10711 pub end_id: ::fidl_next::WireU64,
10712}
10713
10714unsafe impl ::fidl_next::Wire for WireDictionaryEnumerateIteratorGetNextResponse<'static> {
10715 type Decoded<'de> = WireDictionaryEnumerateIteratorGetNextResponse<'de>;
10716
10717 #[inline]
10718 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10719}
10720
10721unsafe impl<___D> ::fidl_next::Decode<___D>
10722 for WireDictionaryEnumerateIteratorGetNextResponse<'static>
10723where
10724 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10725
10726 ___D: ::fidl_next::Decoder,
10727
10728 ___D: ::fidl_next::fuchsia::HandleDecoder,
10729{
10730 fn decode(
10731 slot: ::fidl_next::Slot<'_, Self>,
10732 decoder: &mut ___D,
10733 ) -> Result<(), ::fidl_next::DecodeError> {
10734 ::fidl_next::munge! {
10735 let Self {
10736 mut items,
10737 mut end_id,
10738
10739 } = slot;
10740 }
10741
10742 ::fidl_next::Decode::decode(items.as_mut(), decoder)?;
10743
10744 let items = unsafe { items.deref_unchecked() };
10745
10746 if items.len() > 128 {
10747 return Err(::fidl_next::DecodeError::VectorTooLong {
10748 size: items.len() as u64,
10749 limit: 128,
10750 });
10751 }
10752
10753 ::fidl_next::Decode::decode(end_id.as_mut(), decoder)?;
10754
10755 Ok(())
10756 }
10757}
10758
10759#[derive(Debug)]
10761pub struct DictionaryEnumerateIterator;
10762
10763pub mod dictionary_enumerate_iterator {
10764 pub mod prelude {
10765 pub use crate::{
10766 dictionary_enumerate_iterator, DictionaryEnumerateIterator,
10767 DictionaryEnumerateIteratorClientHandler, DictionaryEnumerateIteratorServerHandler,
10768 };
10769
10770 pub use crate::CapabilityStoreError;
10771
10772 pub use crate::DictionaryEnumerateIteratorGetNextRequest;
10773
10774 pub use crate::DictionaryEnumerateIteratorGetNextResponse;
10775 }
10776
10777 pub struct GetNext;
10778
10779 impl ::fidl_next::Method for GetNext {
10780 const ORDINAL: u64 = 1511164556663256527;
10781
10782 type Protocol = crate::DictionaryEnumerateIterator;
10783
10784 type Request = crate::WireDictionaryEnumerateIteratorGetNextRequest;
10785
10786 type Response = ::fidl_next::WireFlexibleResult<
10787 'static,
10788 crate::WireDictionaryEnumerateIteratorGetNextResponse<'static>,
10789 crate::WireCapabilityStoreError,
10790 >;
10791 }
10792
10793 mod ___detail {
10794
10795 pub struct GetNext<T0, T1> {
10796 start_id: T0,
10797
10798 limit: T1,
10799 }
10800
10801 impl<T0, T1> ::fidl_next::Encodable for GetNext<T0, T1>
10802 where
10803 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU64>,
10804
10805 T1: ::fidl_next::Encodable<Encoded = ::fidl_next::WireU32>,
10806 {
10807 type Encoded = crate::WireDictionaryEnumerateIteratorGetNextRequest;
10808 }
10809
10810 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for GetNext<T0, T1>
10811 where
10812 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10813
10814 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU64>,
10815
10816 T1: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireU32>,
10817 {
10818 #[inline]
10819 fn encode(
10820 self,
10821 encoder: &mut ___E,
10822 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10823 ) -> Result<(), ::fidl_next::EncodeError> {
10824 ::fidl_next::munge! {
10825 let Self::Encoded {
10826 start_id,
10827 limit,
10828
10829 } = out;
10830 }
10831
10832 ::fidl_next::Encode::encode(self.start_id, encoder, start_id)?;
10833
10834 ::fidl_next::Encode::encode(self.limit, encoder, limit)?;
10835
10836 Ok(())
10837 }
10838 }
10839
10840 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DictionaryEnumerateIterator
10841 where
10842 ___T: ::fidl_next::Transport,
10843 {
10844 type ClientSender = DictionaryEnumerateIteratorClientSender<___T>;
10845 type ServerSender = DictionaryEnumerateIteratorServerSender<___T>;
10846 }
10847
10848 pub struct DictionaryEnumerateIteratorClientSender<___T: ::fidl_next::Transport> {
10850 #[allow(dead_code)]
10851 sender: ::fidl_next::protocol::ClientSender<___T>,
10852 }
10853
10854 impl<___T> DictionaryEnumerateIteratorClientSender<___T>
10855 where
10856 ___T: ::fidl_next::Transport,
10857 {
10858 #[doc = " Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to\n `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].\n\n The value of each of `items` is a duplicate of the original capability\n ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will\n be null.\n\n Each returned capability will be assigned a monotonically increasing [CapabilityId] starting\n from `start_id`.\n\n In addition to the `items`, returns `end_id`, which is one more than the highest id reserved\n by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].\n\n If [GetNext] returns an error, the server will also close the channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this\n store.\n - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.\n"]
10859 pub fn get_next(
10860 &self,
10861
10862 start_id: impl ::fidl_next::Encode<
10863 <___T as ::fidl_next::Transport>::SendBuffer,
10864 Encoded = ::fidl_next::WireU64,
10865 >,
10866
10867 limit: impl ::fidl_next::Encode<
10868 <___T as ::fidl_next::Transport>::SendBuffer,
10869 Encoded = ::fidl_next::WireU32,
10870 >,
10871 ) -> Result<
10872 ::fidl_next::ResponseFuture<'_, super::GetNext, ___T>,
10873 ::fidl_next::EncodeError,
10874 >
10875 where
10876 <___T as ::fidl_next::Transport>::SendBuffer:
10877 ::fidl_next::encoder::InternalHandleEncoder,
10878 {
10879 self.get_next_with(GetNext { start_id, limit })
10880 }
10881
10882 #[doc = " Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to\n `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].\n\n The value of each of `items` is a duplicate of the original capability\n ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will\n be null.\n\n Each returned capability will be assigned a monotonically increasing [CapabilityId] starting\n from `start_id`.\n\n In addition to the `items`, returns `end_id`, which is one more than the highest id reserved\n by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].\n\n If [GetNext] returns an error, the server will also close the channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this\n store.\n - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.\n"]
10883 pub fn get_next_with<___R>(
10884 &self,
10885 request: ___R,
10886 ) -> Result<
10887 ::fidl_next::ResponseFuture<'_, super::GetNext, ___T>,
10888 ::fidl_next::EncodeError,
10889 >
10890 where
10891 ___R: ::fidl_next::Encode<
10892 <___T as ::fidl_next::Transport>::SendBuffer,
10893 Encoded = crate::WireDictionaryEnumerateIteratorGetNextRequest,
10894 >,
10895 {
10896 self.sender
10897 .send_two_way(1511164556663256527, request)
10898 .map(::fidl_next::ResponseFuture::from_untyped)
10899 }
10900 }
10901
10902 #[repr(transparent)]
10904 pub struct DictionaryEnumerateIteratorServerSender<___T: ::fidl_next::Transport> {
10905 sender: ::fidl_next::protocol::ServerSender<___T>,
10906 }
10907
10908 impl<___T> DictionaryEnumerateIteratorServerSender<___T> where ___T: ::fidl_next::Transport {}
10909 }
10910}
10911
10912pub trait DictionaryEnumerateIteratorClientHandler<___T: ::fidl_next::Transport> {
10916 fn on_unknown_interaction(
10917 &mut self,
10918 sender: &::fidl_next::ClientSender<DictionaryEnumerateIterator, ___T>,
10919 ordinal: u64,
10920 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
10921 sender.close();
10922 ::core::future::ready(())
10923 }
10924}
10925
10926impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DictionaryEnumerateIterator
10927where
10928 ___H: DictionaryEnumerateIteratorClientHandler<___T> + Send,
10929 ___T: ::fidl_next::Transport,
10930
10931 <dictionary_enumerate_iterator::GetNext as ::fidl_next::Method>::Response:
10932 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10933{
10934 async fn on_event(
10935 handler: &mut ___H,
10936 sender: &::fidl_next::ClientSender<Self, ___T>,
10937 ordinal: u64,
10938 buffer: ___T::RecvBuffer,
10939 ) {
10940 match ordinal {
10941 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
10942 }
10943 }
10944}
10945
10946pub trait DictionaryEnumerateIteratorServerHandler<___T: ::fidl_next::Transport> {
10950 #[doc = " Returns the next batch of results for a [Dictionary.Enumerate] call, returning up to\n `limit` results. `limit` can be at most [MAX_DICTIONARY_ITERATOR_CHUNK].\n\n The value of each of `items` is a duplicate of the original capability\n ([CapabilityStore.Duplicate]), unless it could not be duplicated, it which case it will\n be null.\n\n Each returned capability will be assigned a monotonically increasing [CapabilityId] starting\n from `start_id`.\n\n In addition to the `items`, returns `end_id`, which is one more than the highest id reserved\n by [GetNext]. `end_id` can be used as the `start_id` for the next call to [GetNext].\n\n If [GetNext] returns an error, the server will also close the channel.\n\n Errors:\n\n - `ID_ALREADY_EXISTS` if some id in the range `[start_id, limit)` already exists in this\n store.\n - `INVALID_ARGS` if `limit` was `0` or greater than `MAX_DICTIONARY_ITERATOR_CHUNK`.\n"]
10951 fn get_next(
10952 &mut self,
10953 sender: &::fidl_next::ServerSender<DictionaryEnumerateIterator, ___T>,
10954
10955 request: ::fidl_next::Request<dictionary_enumerate_iterator::GetNext, ___T>,
10956
10957 responder: ::fidl_next::Responder<dictionary_enumerate_iterator::GetNext>,
10958 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
10959
10960 fn on_unknown_interaction(
10961 &mut self,
10962 sender: &::fidl_next::ServerSender<DictionaryEnumerateIterator, ___T>,
10963 ordinal: u64,
10964 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
10965 sender.close();
10966 ::core::future::ready(())
10967 }
10968}
10969
10970impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DictionaryEnumerateIterator
10971where
10972 ___H: DictionaryEnumerateIteratorServerHandler<___T> + Send,
10973 ___T: ::fidl_next::Transport,
10974
10975 <dictionary_enumerate_iterator::GetNext as ::fidl_next::Method>::Request:
10976 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10977{
10978 async fn on_one_way(
10979 handler: &mut ___H,
10980 sender: &::fidl_next::ServerSender<Self, ___T>,
10981 ordinal: u64,
10982 buffer: ___T::RecvBuffer,
10983 ) {
10984 match ordinal {
10985 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
10986 }
10987 }
10988
10989 async fn on_two_way(
10990 handler: &mut ___H,
10991 sender: &::fidl_next::ServerSender<Self, ___T>,
10992 ordinal: u64,
10993 buffer: ___T::RecvBuffer,
10994 responder: ::fidl_next::protocol::Responder,
10995 ) {
10996 match ordinal {
10997 1511164556663256527 => {
10998 let responder = ::fidl_next::Responder::from_untyped(responder);
10999
11000 match ::fidl_next::DecoderExt::decode(buffer) {
11001 Ok(decoded) => handler.get_next(sender, decoded, responder).await,
11002 Err(e) => {
11003 sender.close();
11004 }
11005 }
11006 }
11007
11008 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11009 }
11010 }
11011}
11012
11013#[doc = " Error returned from [CapabilityStore/Dictionary*] methods.\n"]
11014#[derive(Clone, Copy, Debug, PartialEq, Eq)]
11015#[repr(u32)]
11016pub enum DictionaryError {
11017 NotFound = 1,
11018 AlreadyExists = 2,
11019 BadCapability = 3,
11020 InvalidKey = 4,
11021 NotCloneable = 5,
11022 UnknownOrdinal_(u32),
11023}
11024
11025impl ::fidl_next::Encodable for DictionaryError {
11026 type Encoded = WireDictionaryError;
11027}
11028impl ::std::convert::From<u32> for DictionaryError {
11029 fn from(value: u32) -> Self {
11030 match value {
11031 1 => Self::NotFound,
11032 2 => Self::AlreadyExists,
11033 3 => Self::BadCapability,
11034 4 => Self::InvalidKey,
11035 5 => Self::NotCloneable,
11036
11037 _ => Self::UnknownOrdinal_(value),
11038 }
11039 }
11040}
11041
11042unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryError
11043where
11044 ___E: ?Sized,
11045{
11046 #[inline]
11047 fn encode(
11048 self,
11049 encoder: &mut ___E,
11050 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11051 ) -> Result<(), ::fidl_next::EncodeError> {
11052 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
11053 }
11054}
11055
11056unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DictionaryError
11057where
11058 ___E: ?Sized,
11059{
11060 #[inline]
11061 fn encode_ref(
11062 &self,
11063 encoder: &mut ___E,
11064 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11065 ) -> Result<(), ::fidl_next::EncodeError> {
11066 ::fidl_next::munge!(let WireDictionaryError { value } = out);
11067 let _ = value.write(::fidl_next::WireU32::from(match *self {
11068 Self::NotFound => 1,
11069
11070 Self::AlreadyExists => 2,
11071
11072 Self::BadCapability => 3,
11073
11074 Self::InvalidKey => 4,
11075
11076 Self::NotCloneable => 5,
11077
11078 Self::UnknownOrdinal_(value) => value,
11079 }));
11080
11081 Ok(())
11082 }
11083}
11084
11085impl ::core::convert::From<WireDictionaryError> for DictionaryError {
11086 fn from(wire: WireDictionaryError) -> Self {
11087 match u32::from(wire.value) {
11088 1 => Self::NotFound,
11089
11090 2 => Self::AlreadyExists,
11091
11092 3 => Self::BadCapability,
11093
11094 4 => Self::InvalidKey,
11095
11096 5 => Self::NotCloneable,
11097
11098 value => Self::UnknownOrdinal_(value),
11099 }
11100 }
11101}
11102
11103impl ::fidl_next::FromWire<WireDictionaryError> for DictionaryError {
11104 #[inline]
11105 fn from_wire(wire: WireDictionaryError) -> Self {
11106 Self::from(wire)
11107 }
11108}
11109
11110impl ::fidl_next::FromWireRef<WireDictionaryError> for DictionaryError {
11111 #[inline]
11112 fn from_wire_ref(wire: &WireDictionaryError) -> Self {
11113 Self::from(*wire)
11114 }
11115}
11116
11117#[derive(Clone, Copy, Debug, PartialEq, Eq)]
11119#[repr(transparent)]
11120pub struct WireDictionaryError {
11121 value: ::fidl_next::WireU32,
11122}
11123
11124unsafe impl ::fidl_next::Wire for WireDictionaryError {
11125 type Decoded<'de> = Self;
11126
11127 #[inline]
11128 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11129 }
11131}
11132
11133impl WireDictionaryError {
11134 pub const NOT_FOUND: WireDictionaryError =
11135 WireDictionaryError { value: ::fidl_next::WireU32(1) };
11136
11137 pub const ALREADY_EXISTS: WireDictionaryError =
11138 WireDictionaryError { value: ::fidl_next::WireU32(2) };
11139
11140 pub const BAD_CAPABILITY: WireDictionaryError =
11141 WireDictionaryError { value: ::fidl_next::WireU32(3) };
11142
11143 pub const INVALID_KEY: WireDictionaryError =
11144 WireDictionaryError { value: ::fidl_next::WireU32(4) };
11145
11146 pub const NOT_CLONEABLE: WireDictionaryError =
11147 WireDictionaryError { value: ::fidl_next::WireU32(5) };
11148}
11149
11150unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryError
11151where
11152 ___D: ?Sized,
11153{
11154 fn decode(
11155 slot: ::fidl_next::Slot<'_, Self>,
11156 _: &mut ___D,
11157 ) -> Result<(), ::fidl_next::DecodeError> {
11158 Ok(())
11159 }
11160}
11161
11162impl ::core::convert::From<DictionaryError> for WireDictionaryError {
11163 fn from(natural: DictionaryError) -> Self {
11164 match natural {
11165 DictionaryError::NotFound => WireDictionaryError::NOT_FOUND,
11166
11167 DictionaryError::AlreadyExists => WireDictionaryError::ALREADY_EXISTS,
11168
11169 DictionaryError::BadCapability => WireDictionaryError::BAD_CAPABILITY,
11170
11171 DictionaryError::InvalidKey => WireDictionaryError::INVALID_KEY,
11172
11173 DictionaryError::NotCloneable => WireDictionaryError::NOT_CLONEABLE,
11174
11175 DictionaryError::UnknownOrdinal_(value) => {
11176 WireDictionaryError { value: ::fidl_next::WireU32::from(value) }
11177 }
11178 }
11179 }
11180}
11181
11182#[derive(Debug)]
11183pub struct DictionaryKeysIteratorGetNextResponse {
11184 pub keys: Vec<String>,
11185}
11186
11187impl ::fidl_next::Encodable for DictionaryKeysIteratorGetNextResponse {
11188 type Encoded = WireDictionaryKeysIteratorGetNextResponse<'static>;
11189}
11190
11191unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryKeysIteratorGetNextResponse
11192where
11193 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11194
11195 ___E: ::fidl_next::Encoder,
11196
11197 ___E: ::fidl_next::fuchsia::HandleEncoder,
11198{
11199 #[inline]
11200 fn encode(
11201 self,
11202 encoder: &mut ___E,
11203 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11204 ) -> Result<(), ::fidl_next::EncodeError> {
11205 ::fidl_next::munge! {
11206 let Self::Encoded {
11207 keys,
11208
11209 } = out;
11210 }
11211
11212 ::fidl_next::Encode::encode(self.keys, encoder, keys)?;
11213
11214 Ok(())
11215 }
11216}
11217
11218impl ::fidl_next::EncodableOption for DictionaryKeysIteratorGetNextResponse {
11219 type EncodedOption =
11220 ::fidl_next::WireBox<'static, WireDictionaryKeysIteratorGetNextResponse<'static>>;
11221}
11222
11223unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryKeysIteratorGetNextResponse
11224where
11225 ___E: ::fidl_next::Encoder + ?Sized,
11226 DictionaryKeysIteratorGetNextResponse: ::fidl_next::Encode<___E>,
11227{
11228 #[inline]
11229 fn encode_option(
11230 this: Option<Self>,
11231 encoder: &mut ___E,
11232 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11233 ) -> Result<(), ::fidl_next::EncodeError> {
11234 if let Some(inner) = this {
11235 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11236 ::fidl_next::WireBox::encode_present(out);
11237 } else {
11238 ::fidl_next::WireBox::encode_absent(out);
11239 }
11240
11241 Ok(())
11242 }
11243}
11244
11245impl<'de> ::fidl_next::FromWire<WireDictionaryKeysIteratorGetNextResponse<'de>>
11246 for DictionaryKeysIteratorGetNextResponse
11247{
11248 #[inline]
11249 fn from_wire(wire: WireDictionaryKeysIteratorGetNextResponse<'de>) -> Self {
11250 Self { keys: ::fidl_next::FromWire::from_wire(wire.keys) }
11251 }
11252}
11253
11254#[derive(Debug)]
11256#[repr(C)]
11257pub struct WireDictionaryKeysIteratorGetNextResponse<'de> {
11258 pub keys: ::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>,
11259}
11260
11261unsafe impl ::fidl_next::Wire for WireDictionaryKeysIteratorGetNextResponse<'static> {
11262 type Decoded<'de> = WireDictionaryKeysIteratorGetNextResponse<'de>;
11263
11264 #[inline]
11265 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
11266}
11267
11268unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryKeysIteratorGetNextResponse<'static>
11269where
11270 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11271
11272 ___D: ::fidl_next::Decoder,
11273
11274 ___D: ::fidl_next::fuchsia::HandleDecoder,
11275{
11276 fn decode(
11277 slot: ::fidl_next::Slot<'_, Self>,
11278 decoder: &mut ___D,
11279 ) -> Result<(), ::fidl_next::DecodeError> {
11280 ::fidl_next::munge! {
11281 let Self {
11282 mut keys,
11283
11284 } = slot;
11285 }
11286
11287 ::fidl_next::Decode::decode(keys.as_mut(), decoder)?;
11288
11289 let keys = unsafe { keys.deref_unchecked() };
11290
11291 if keys.len() > 128 {
11292 return Err(::fidl_next::DecodeError::VectorTooLong {
11293 size: keys.len() as u64,
11294 limit: 128,
11295 });
11296 }
11297
11298 Ok(())
11299 }
11300}
11301
11302#[derive(Debug)]
11304pub struct DictionaryKeysIterator;
11305
11306pub mod dictionary_keys_iterator {
11307 pub mod prelude {
11308 pub use crate::{
11309 dictionary_keys_iterator, DictionaryKeysIterator, DictionaryKeysIteratorClientHandler,
11310 DictionaryKeysIteratorServerHandler,
11311 };
11312
11313 pub use crate::DictionaryKeysIteratorGetNextResponse;
11314 }
11315
11316 pub struct GetNext;
11317
11318 impl ::fidl_next::Method for GetNext {
11319 const ORDINAL: u64 = 4987781442555247955;
11320
11321 type Protocol = crate::DictionaryKeysIterator;
11322
11323 type Request = ();
11324
11325 type Response = ::fidl_next::WireFlexible<
11326 'static,
11327 crate::WireDictionaryKeysIteratorGetNextResponse<'static>,
11328 >;
11329 }
11330
11331 mod ___detail {
11332
11333 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DictionaryKeysIterator
11334 where
11335 ___T: ::fidl_next::Transport,
11336 {
11337 type ClientSender = DictionaryKeysIteratorClientSender<___T>;
11338 type ServerSender = DictionaryKeysIteratorServerSender<___T>;
11339 }
11340
11341 pub struct DictionaryKeysIteratorClientSender<___T: ::fidl_next::Transport> {
11343 #[allow(dead_code)]
11344 sender: ::fidl_next::protocol::ClientSender<___T>,
11345 }
11346
11347 impl<___T> DictionaryKeysIteratorClientSender<___T>
11348 where
11349 ___T: ::fidl_next::Transport,
11350 {
11351 pub fn get_next(
11352 &self,
11353 ) -> Result<
11354 ::fidl_next::ResponseFuture<'_, super::GetNext, ___T>,
11355 ::fidl_next::EncodeError,
11356 > {
11357 self.sender
11358 .send_two_way(4987781442555247955, ())
11359 .map(::fidl_next::ResponseFuture::from_untyped)
11360 }
11361 }
11362
11363 #[repr(transparent)]
11365 pub struct DictionaryKeysIteratorServerSender<___T: ::fidl_next::Transport> {
11366 sender: ::fidl_next::protocol::ServerSender<___T>,
11367 }
11368
11369 impl<___T> DictionaryKeysIteratorServerSender<___T> where ___T: ::fidl_next::Transport {}
11370 }
11371}
11372
11373pub trait DictionaryKeysIteratorClientHandler<___T: ::fidl_next::Transport> {
11377 fn on_unknown_interaction(
11378 &mut self,
11379 sender: &::fidl_next::ClientSender<DictionaryKeysIterator, ___T>,
11380 ordinal: u64,
11381 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
11382 sender.close();
11383 ::core::future::ready(())
11384 }
11385}
11386
11387impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DictionaryKeysIterator
11388where
11389 ___H: DictionaryKeysIteratorClientHandler<___T> + Send,
11390 ___T: ::fidl_next::Transport,
11391
11392 <dictionary_keys_iterator::GetNext as ::fidl_next::Method>::Response:
11393 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11394{
11395 async fn on_event(
11396 handler: &mut ___H,
11397 sender: &::fidl_next::ClientSender<Self, ___T>,
11398 ordinal: u64,
11399 buffer: ___T::RecvBuffer,
11400 ) {
11401 match ordinal {
11402 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11403 }
11404 }
11405}
11406
11407pub trait DictionaryKeysIteratorServerHandler<___T: ::fidl_next::Transport> {
11411 fn get_next(
11412 &mut self,
11413 sender: &::fidl_next::ServerSender<DictionaryKeysIterator, ___T>,
11414
11415 responder: ::fidl_next::Responder<dictionary_keys_iterator::GetNext>,
11416 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11417
11418 fn on_unknown_interaction(
11419 &mut self,
11420 sender: &::fidl_next::ServerSender<DictionaryKeysIterator, ___T>,
11421 ordinal: u64,
11422 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
11423 sender.close();
11424 ::core::future::ready(())
11425 }
11426}
11427
11428impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DictionaryKeysIterator
11429where
11430 ___H: DictionaryKeysIteratorServerHandler<___T> + Send,
11431 ___T: ::fidl_next::Transport,
11432{
11433 async fn on_one_way(
11434 handler: &mut ___H,
11435 sender: &::fidl_next::ServerSender<Self, ___T>,
11436 ordinal: u64,
11437 buffer: ___T::RecvBuffer,
11438 ) {
11439 match ordinal {
11440 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11441 }
11442 }
11443
11444 async fn on_two_way(
11445 handler: &mut ___H,
11446 sender: &::fidl_next::ServerSender<Self, ___T>,
11447 ordinal: u64,
11448 buffer: ___T::RecvBuffer,
11449 responder: ::fidl_next::protocol::Responder,
11450 ) {
11451 match ordinal {
11452 4987781442555247955 => {
11453 let responder = ::fidl_next::Responder::from_untyped(responder);
11454
11455 handler.get_next(sender, responder).await;
11456 }
11457
11458 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11459 }
11460 }
11461}
11462
11463#[derive(Debug)]
11464pub enum DictionaryRouterRouteResponse {
11465 Dictionary(crate::DictionaryRef),
11466
11467 Unavailable(crate::Unit),
11468}
11469
11470impl ::fidl_next::Encodable for DictionaryRouterRouteResponse {
11471 type Encoded = WireDictionaryRouterRouteResponse;
11472}
11473
11474unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryRouterRouteResponse
11475where
11476 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11477
11478 ___E: ::fidl_next::fuchsia::HandleEncoder,
11479{
11480 #[inline]
11481 fn encode(
11482 self,
11483 encoder: &mut ___E,
11484 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11485 ) -> Result<(), ::fidl_next::EncodeError> {
11486 ::fidl_next::munge!(let WireDictionaryRouterRouteResponse { raw, _phantom: _ } = out);
11487
11488 match self {
11489 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as_static::<
11490 ___E,
11491 crate::DictionaryRef,
11492 >(value, 1, encoder, raw)?,
11493
11494 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
11495 ___E,
11496 crate::Unit,
11497 >(value, 2, encoder, raw)?,
11498 }
11499
11500 Ok(())
11501 }
11502}
11503
11504impl ::fidl_next::EncodableOption for DictionaryRouterRouteResponse {
11505 type EncodedOption = WireOptionalDictionaryRouterRouteResponse;
11506}
11507
11508unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryRouterRouteResponse
11509where
11510 ___E: ?Sized,
11511 DictionaryRouterRouteResponse: ::fidl_next::Encode<___E>,
11512{
11513 #[inline]
11514 fn encode_option(
11515 this: Option<Self>,
11516 encoder: &mut ___E,
11517 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11518 ) -> Result<(), ::fidl_next::EncodeError> {
11519 ::fidl_next::munge!(let WireOptionalDictionaryRouterRouteResponse { raw, _phantom: _ } = &mut *out);
11520
11521 if let Some(inner) = this {
11522 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11523 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
11524 } else {
11525 ::fidl_next::RawWireUnion::encode_absent(raw);
11526 }
11527
11528 Ok(())
11529 }
11530}
11531
11532impl ::fidl_next::FromWire<WireDictionaryRouterRouteResponse> for DictionaryRouterRouteResponse {
11533 #[inline]
11534 fn from_wire(wire: WireDictionaryRouterRouteResponse) -> Self {
11535 let wire = ::core::mem::ManuallyDrop::new(wire);
11536 match wire.raw.ordinal() {
11537 1 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
11538 wire.raw.get().read_unchecked::<crate::WireDictionaryRef>()
11539 })),
11540
11541 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
11542 wire.raw.get().read_unchecked::<crate::WireUnit>()
11543 })),
11544
11545 _ => unsafe { ::core::hint::unreachable_unchecked() },
11546 }
11547 }
11548}
11549
11550impl ::fidl_next::FromWireOption<WireOptionalDictionaryRouterRouteResponse>
11551 for Box<DictionaryRouterRouteResponse>
11552{
11553 #[inline]
11554 fn from_wire_option(wire: WireOptionalDictionaryRouterRouteResponse) -> Option<Self> {
11555 if let Some(inner) = wire.into_option() {
11556 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
11557 } else {
11558 None
11559 }
11560 }
11561}
11562
11563#[repr(transparent)]
11565pub struct WireDictionaryRouterRouteResponse {
11566 raw: ::fidl_next::RawWireUnion,
11567 _phantom: ::core::marker::PhantomData<()>,
11568}
11569
11570impl Drop for WireDictionaryRouterRouteResponse {
11571 fn drop(&mut self) {
11572 match self.raw.ordinal() {
11573 1 => {
11574 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDictionaryRef>() };
11575 }
11576
11577 2 => {
11578 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
11579 }
11580
11581 _ => unsafe { ::core::hint::unreachable_unchecked() },
11582 }
11583 }
11584}
11585
11586unsafe impl ::fidl_next::Wire for WireDictionaryRouterRouteResponse {
11587 type Decoded<'de> = WireDictionaryRouterRouteResponse;
11588
11589 #[inline]
11590 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11591 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11592 ::fidl_next::RawWireUnion::zero_padding(raw);
11593 }
11594}
11595
11596pub mod dictionary_router_route_response {
11597 pub enum Ref<'de> {
11598 Dictionary(&'de crate::WireDictionaryRef),
11599
11600 Unavailable(&'de crate::WireUnit),
11601 }
11602}
11603
11604impl WireDictionaryRouterRouteResponse {
11605 pub fn as_ref(&self) -> crate::dictionary_router_route_response::Ref<'_> {
11606 match self.raw.ordinal() {
11607 1 => crate::dictionary_router_route_response::Ref::Dictionary(unsafe {
11608 self.raw.get().deref_unchecked::<crate::WireDictionaryRef>()
11609 }),
11610
11611 2 => crate::dictionary_router_route_response::Ref::Unavailable(unsafe {
11612 self.raw.get().deref_unchecked::<crate::WireUnit>()
11613 }),
11614
11615 _ => unsafe { ::core::hint::unreachable_unchecked() },
11616 }
11617 }
11618}
11619
11620unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryRouterRouteResponse
11621where
11622 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11623
11624 ___D: ::fidl_next::fuchsia::HandleDecoder,
11625{
11626 fn decode(
11627 mut slot: ::fidl_next::Slot<'_, Self>,
11628 decoder: &mut ___D,
11629 ) -> Result<(), ::fidl_next::DecodeError> {
11630 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11631 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11632 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDictionaryRef>(
11633 raw, decoder,
11634 )?,
11635
11636 2 => {
11637 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
11638 }
11639
11640 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
11641 }
11642
11643 Ok(())
11644 }
11645}
11646
11647impl ::core::fmt::Debug for WireDictionaryRouterRouteResponse {
11648 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11649 match self.raw.ordinal() {
11650 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireDictionaryRef>().fmt(f) },
11651 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
11652 _ => unsafe { ::core::hint::unreachable_unchecked() },
11653 }
11654 }
11655}
11656
11657#[repr(transparent)]
11658pub struct WireOptionalDictionaryRouterRouteResponse {
11659 raw: ::fidl_next::RawWireUnion,
11660 _phantom: ::core::marker::PhantomData<()>,
11661}
11662
11663unsafe impl ::fidl_next::Wire for WireOptionalDictionaryRouterRouteResponse {
11664 type Decoded<'de> = WireOptionalDictionaryRouterRouteResponse;
11665
11666 #[inline]
11667 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11668 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11669 ::fidl_next::RawWireUnion::zero_padding(raw);
11670 }
11671}
11672
11673impl WireOptionalDictionaryRouterRouteResponse {
11674 pub fn is_some(&self) -> bool {
11675 self.raw.is_some()
11676 }
11677
11678 pub fn is_none(&self) -> bool {
11679 self.raw.is_none()
11680 }
11681
11682 pub fn as_ref(&self) -> Option<&WireDictionaryRouterRouteResponse> {
11683 if self.is_some() {
11684 Some(unsafe { &*(self as *const Self).cast() })
11685 } else {
11686 None
11687 }
11688 }
11689
11690 pub fn into_option(self) -> Option<WireDictionaryRouterRouteResponse> {
11691 if self.is_some() {
11692 Some(WireDictionaryRouterRouteResponse {
11693 raw: self.raw,
11694 _phantom: ::core::marker::PhantomData,
11695 })
11696 } else {
11697 None
11698 }
11699 }
11700}
11701
11702unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDictionaryRouterRouteResponse
11703where
11704 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11705
11706 ___D: ::fidl_next::fuchsia::HandleDecoder,
11707{
11708 fn decode(
11709 mut slot: ::fidl_next::Slot<'_, Self>,
11710 decoder: &mut ___D,
11711 ) -> Result<(), ::fidl_next::DecodeError> {
11712 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11713 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11714 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDictionaryRef>(
11715 raw, decoder,
11716 )?,
11717
11718 2 => {
11719 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
11720 }
11721
11722 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
11723 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
11724 }
11725
11726 Ok(())
11727 }
11728}
11729
11730impl ::core::fmt::Debug for WireOptionalDictionaryRouterRouteResponse {
11731 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11732 self.as_ref().fmt(f)
11733 }
11734}
11735
11736#[derive(Debug)]
11738pub struct DictionaryRouter;
11739
11740impl ::fidl_next::Discoverable for DictionaryRouter {
11741 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
11742}
11743
11744pub mod dictionary_router {
11745 pub mod prelude {
11746 pub use crate::{
11747 dictionary_router, DictionaryRouter, DictionaryRouterClientHandler,
11748 DictionaryRouterServerHandler,
11749 };
11750
11751 pub use crate::DictionaryRouterRouteResponse;
11752
11753 pub use crate::RouteRequest;
11754
11755 pub use crate::RouterError;
11756 }
11757
11758 pub struct Route;
11759
11760 impl ::fidl_next::Method for Route {
11761 const ORDINAL: u64 = 8164012099375978399;
11762
11763 type Protocol = crate::DictionaryRouter;
11764
11765 type Request = crate::WireRouteRequest<'static>;
11766
11767 type Response = ::fidl_next::WireFlexibleResult<
11768 'static,
11769 crate::WireDictionaryRouterRouteResponse,
11770 crate::WireRouterError,
11771 >;
11772 }
11773
11774 mod ___detail {
11775
11776 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DictionaryRouter
11777 where
11778 ___T: ::fidl_next::Transport,
11779 {
11780 type ClientSender = DictionaryRouterClientSender<___T>;
11781 type ServerSender = DictionaryRouterServerSender<___T>;
11782 }
11783
11784 pub struct DictionaryRouterClientSender<___T: ::fidl_next::Transport> {
11786 #[allow(dead_code)]
11787 sender: ::fidl_next::protocol::ClientSender<___T>,
11788 }
11789
11790 impl<___T> DictionaryRouterClientSender<___T>
11791 where
11792 ___T: ::fidl_next::Transport,
11793 {
11794 pub fn route_with<___R>(
11795 &self,
11796 request: ___R,
11797 ) -> Result<::fidl_next::ResponseFuture<'_, super::Route, ___T>, ::fidl_next::EncodeError>
11798 where
11799 ___R: ::fidl_next::Encode<
11800 <___T as ::fidl_next::Transport>::SendBuffer,
11801 Encoded = crate::WireRouteRequest<'static>,
11802 >,
11803 {
11804 self.sender
11805 .send_two_way(8164012099375978399, request)
11806 .map(::fidl_next::ResponseFuture::from_untyped)
11807 }
11808 }
11809
11810 #[repr(transparent)]
11812 pub struct DictionaryRouterServerSender<___T: ::fidl_next::Transport> {
11813 sender: ::fidl_next::protocol::ServerSender<___T>,
11814 }
11815
11816 impl<___T> DictionaryRouterServerSender<___T> where ___T: ::fidl_next::Transport {}
11817 }
11818}
11819
11820pub trait DictionaryRouterClientHandler<___T: ::fidl_next::Transport> {
11824 fn on_unknown_interaction(
11825 &mut self,
11826 sender: &::fidl_next::ClientSender<DictionaryRouter, ___T>,
11827 ordinal: u64,
11828 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
11829 sender.close();
11830 ::core::future::ready(())
11831 }
11832}
11833
11834impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DictionaryRouter
11835where
11836 ___H: DictionaryRouterClientHandler<___T> + Send,
11837 ___T: ::fidl_next::Transport,
11838
11839 <dictionary_router::Route as ::fidl_next::Method>::Response:
11840 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11841{
11842 async fn on_event(
11843 handler: &mut ___H,
11844 sender: &::fidl_next::ClientSender<Self, ___T>,
11845 ordinal: u64,
11846 buffer: ___T::RecvBuffer,
11847 ) {
11848 match ordinal {
11849 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11850 }
11851 }
11852}
11853
11854pub trait DictionaryRouterServerHandler<___T: ::fidl_next::Transport> {
11858 fn route(
11859 &mut self,
11860 sender: &::fidl_next::ServerSender<DictionaryRouter, ___T>,
11861
11862 request: ::fidl_next::Request<dictionary_router::Route, ___T>,
11863
11864 responder: ::fidl_next::Responder<dictionary_router::Route>,
11865 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
11866
11867 fn on_unknown_interaction(
11868 &mut self,
11869 sender: &::fidl_next::ServerSender<DictionaryRouter, ___T>,
11870 ordinal: u64,
11871 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
11872 sender.close();
11873 ::core::future::ready(())
11874 }
11875}
11876
11877impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DictionaryRouter
11878where
11879 ___H: DictionaryRouterServerHandler<___T> + Send,
11880 ___T: ::fidl_next::Transport,
11881
11882 <dictionary_router::Route as ::fidl_next::Method>::Request:
11883 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11884{
11885 async fn on_one_way(
11886 handler: &mut ___H,
11887 sender: &::fidl_next::ServerSender<Self, ___T>,
11888 ordinal: u64,
11889 buffer: ___T::RecvBuffer,
11890 ) {
11891 match ordinal {
11892 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11893 }
11894 }
11895
11896 async fn on_two_way(
11897 handler: &mut ___H,
11898 sender: &::fidl_next::ServerSender<Self, ___T>,
11899 ordinal: u64,
11900 buffer: ___T::RecvBuffer,
11901 responder: ::fidl_next::protocol::Responder,
11902 ) {
11903 match ordinal {
11904 8164012099375978399 => {
11905 let responder = ::fidl_next::Responder::from_untyped(responder);
11906
11907 match ::fidl_next::DecoderExt::decode(buffer) {
11908 Ok(decoded) => handler.route(sender, decoded, responder).await,
11909 Err(e) => {
11910 sender.close();
11911 }
11912 }
11913 }
11914
11915 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
11916 }
11917 }
11918}
11919
11920#[derive(Debug)]
11921pub enum DirConnectorRouterRouteResponse {
11922 DirConnector(crate::DirConnector),
11923
11924 Unavailable(crate::Unit),
11925}
11926
11927impl ::fidl_next::Encodable for DirConnectorRouterRouteResponse {
11928 type Encoded = WireDirConnectorRouterRouteResponse;
11929}
11930
11931unsafe impl<___E> ::fidl_next::Encode<___E> for DirConnectorRouterRouteResponse
11932where
11933 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11934
11935 ___E: ::fidl_next::fuchsia::HandleEncoder,
11936{
11937 #[inline]
11938 fn encode(
11939 self,
11940 encoder: &mut ___E,
11941 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11942 ) -> Result<(), ::fidl_next::EncodeError> {
11943 ::fidl_next::munge!(let WireDirConnectorRouterRouteResponse { raw, _phantom: _ } = out);
11944
11945 match self {
11946 Self::DirConnector(value) => ::fidl_next::RawWireUnion::encode_as_static::<
11947 ___E,
11948 crate::DirConnector,
11949 >(value, 1, encoder, raw)?,
11950
11951 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
11952 ___E,
11953 crate::Unit,
11954 >(value, 2, encoder, raw)?,
11955 }
11956
11957 Ok(())
11958 }
11959}
11960
11961impl ::fidl_next::EncodableOption for DirConnectorRouterRouteResponse {
11962 type EncodedOption = WireOptionalDirConnectorRouterRouteResponse;
11963}
11964
11965unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirConnectorRouterRouteResponse
11966where
11967 ___E: ?Sized,
11968 DirConnectorRouterRouteResponse: ::fidl_next::Encode<___E>,
11969{
11970 #[inline]
11971 fn encode_option(
11972 this: Option<Self>,
11973 encoder: &mut ___E,
11974 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11975 ) -> Result<(), ::fidl_next::EncodeError> {
11976 ::fidl_next::munge!(let WireOptionalDirConnectorRouterRouteResponse { raw, _phantom: _ } = &mut *out);
11977
11978 if let Some(inner) = this {
11979 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11980 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
11981 } else {
11982 ::fidl_next::RawWireUnion::encode_absent(raw);
11983 }
11984
11985 Ok(())
11986 }
11987}
11988
11989impl ::fidl_next::FromWire<WireDirConnectorRouterRouteResponse>
11990 for DirConnectorRouterRouteResponse
11991{
11992 #[inline]
11993 fn from_wire(wire: WireDirConnectorRouterRouteResponse) -> Self {
11994 let wire = ::core::mem::ManuallyDrop::new(wire);
11995 match wire.raw.ordinal() {
11996 1 => Self::DirConnector(::fidl_next::FromWire::from_wire(unsafe {
11997 wire.raw.get().read_unchecked::<crate::WireDirConnector>()
11998 })),
11999
12000 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
12001 wire.raw.get().read_unchecked::<crate::WireUnit>()
12002 })),
12003
12004 _ => unsafe { ::core::hint::unreachable_unchecked() },
12005 }
12006 }
12007}
12008
12009impl ::fidl_next::FromWireOption<WireOptionalDirConnectorRouterRouteResponse>
12010 for Box<DirConnectorRouterRouteResponse>
12011{
12012 #[inline]
12013 fn from_wire_option(wire: WireOptionalDirConnectorRouterRouteResponse) -> Option<Self> {
12014 if let Some(inner) = wire.into_option() {
12015 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
12016 } else {
12017 None
12018 }
12019 }
12020}
12021
12022#[repr(transparent)]
12024pub struct WireDirConnectorRouterRouteResponse {
12025 raw: ::fidl_next::RawWireUnion,
12026 _phantom: ::core::marker::PhantomData<()>,
12027}
12028
12029impl Drop for WireDirConnectorRouterRouteResponse {
12030 fn drop(&mut self) {
12031 match self.raw.ordinal() {
12032 1 => {
12033 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirConnector>() };
12034 }
12035
12036 2 => {
12037 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
12038 }
12039
12040 _ => unsafe { ::core::hint::unreachable_unchecked() },
12041 }
12042 }
12043}
12044
12045unsafe impl ::fidl_next::Wire for WireDirConnectorRouterRouteResponse {
12046 type Decoded<'de> = WireDirConnectorRouterRouteResponse;
12047
12048 #[inline]
12049 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12050 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
12051 ::fidl_next::RawWireUnion::zero_padding(raw);
12052 }
12053}
12054
12055pub mod dir_connector_router_route_response {
12056 pub enum Ref<'de> {
12057 DirConnector(&'de crate::WireDirConnector),
12058
12059 Unavailable(&'de crate::WireUnit),
12060 }
12061}
12062
12063impl WireDirConnectorRouterRouteResponse {
12064 pub fn as_ref(&self) -> crate::dir_connector_router_route_response::Ref<'_> {
12065 match self.raw.ordinal() {
12066 1 => crate::dir_connector_router_route_response::Ref::DirConnector(unsafe {
12067 self.raw.get().deref_unchecked::<crate::WireDirConnector>()
12068 }),
12069
12070 2 => crate::dir_connector_router_route_response::Ref::Unavailable(unsafe {
12071 self.raw.get().deref_unchecked::<crate::WireUnit>()
12072 }),
12073
12074 _ => unsafe { ::core::hint::unreachable_unchecked() },
12075 }
12076 }
12077}
12078
12079unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirConnectorRouterRouteResponse
12080where
12081 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12082
12083 ___D: ::fidl_next::fuchsia::HandleDecoder,
12084{
12085 fn decode(
12086 mut slot: ::fidl_next::Slot<'_, Self>,
12087 decoder: &mut ___D,
12088 ) -> Result<(), ::fidl_next::DecodeError> {
12089 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
12090 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
12091 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDirConnector>(
12092 raw, decoder,
12093 )?,
12094
12095 2 => {
12096 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
12097 }
12098
12099 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
12100 }
12101
12102 Ok(())
12103 }
12104}
12105
12106impl ::core::fmt::Debug for WireDirConnectorRouterRouteResponse {
12107 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12108 match self.raw.ordinal() {
12109 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirConnector>().fmt(f) },
12110 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
12111 _ => unsafe { ::core::hint::unreachable_unchecked() },
12112 }
12113 }
12114}
12115
12116#[repr(transparent)]
12117pub struct WireOptionalDirConnectorRouterRouteResponse {
12118 raw: ::fidl_next::RawWireUnion,
12119 _phantom: ::core::marker::PhantomData<()>,
12120}
12121
12122unsafe impl ::fidl_next::Wire for WireOptionalDirConnectorRouterRouteResponse {
12123 type Decoded<'de> = WireOptionalDirConnectorRouterRouteResponse;
12124
12125 #[inline]
12126 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12127 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
12128 ::fidl_next::RawWireUnion::zero_padding(raw);
12129 }
12130}
12131
12132impl WireOptionalDirConnectorRouterRouteResponse {
12133 pub fn is_some(&self) -> bool {
12134 self.raw.is_some()
12135 }
12136
12137 pub fn is_none(&self) -> bool {
12138 self.raw.is_none()
12139 }
12140
12141 pub fn as_ref(&self) -> Option<&WireDirConnectorRouterRouteResponse> {
12142 if self.is_some() {
12143 Some(unsafe { &*(self as *const Self).cast() })
12144 } else {
12145 None
12146 }
12147 }
12148
12149 pub fn into_option(self) -> Option<WireDirConnectorRouterRouteResponse> {
12150 if self.is_some() {
12151 Some(WireDirConnectorRouterRouteResponse {
12152 raw: self.raw,
12153 _phantom: ::core::marker::PhantomData,
12154 })
12155 } else {
12156 None
12157 }
12158 }
12159}
12160
12161unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDirConnectorRouterRouteResponse
12162where
12163 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12164
12165 ___D: ::fidl_next::fuchsia::HandleDecoder,
12166{
12167 fn decode(
12168 mut slot: ::fidl_next::Slot<'_, Self>,
12169 decoder: &mut ___D,
12170 ) -> Result<(), ::fidl_next::DecodeError> {
12171 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
12172 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
12173 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDirConnector>(
12174 raw, decoder,
12175 )?,
12176
12177 2 => {
12178 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
12179 }
12180
12181 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
12182 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
12183 }
12184
12185 Ok(())
12186 }
12187}
12188
12189impl ::core::fmt::Debug for WireOptionalDirConnectorRouterRouteResponse {
12190 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12191 self.as_ref().fmt(f)
12192 }
12193}
12194
12195#[derive(Debug)]
12197pub struct DirConnectorRouter;
12198
12199impl ::fidl_next::Discoverable for DirConnectorRouter {
12200 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
12201}
12202
12203pub mod dir_connector_router {
12204 pub mod prelude {
12205 pub use crate::{
12206 dir_connector_router, DirConnectorRouter, DirConnectorRouterClientHandler,
12207 DirConnectorRouterServerHandler,
12208 };
12209
12210 pub use crate::DirConnectorRouterRouteResponse;
12211
12212 pub use crate::RouteRequest;
12213
12214 pub use crate::RouterError;
12215 }
12216
12217 pub struct Route;
12218
12219 impl ::fidl_next::Method for Route {
12220 const ORDINAL: u64 = 972231070188342848;
12221
12222 type Protocol = crate::DirConnectorRouter;
12223
12224 type Request = crate::WireRouteRequest<'static>;
12225
12226 type Response = ::fidl_next::WireFlexibleResult<
12227 'static,
12228 crate::WireDirConnectorRouterRouteResponse,
12229 crate::WireRouterError,
12230 >;
12231 }
12232
12233 mod ___detail {
12234
12235 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DirConnectorRouter
12236 where
12237 ___T: ::fidl_next::Transport,
12238 {
12239 type ClientSender = DirConnectorRouterClientSender<___T>;
12240 type ServerSender = DirConnectorRouterServerSender<___T>;
12241 }
12242
12243 pub struct DirConnectorRouterClientSender<___T: ::fidl_next::Transport> {
12245 #[allow(dead_code)]
12246 sender: ::fidl_next::protocol::ClientSender<___T>,
12247 }
12248
12249 impl<___T> DirConnectorRouterClientSender<___T>
12250 where
12251 ___T: ::fidl_next::Transport,
12252 {
12253 pub fn route_with<___R>(
12254 &self,
12255 request: ___R,
12256 ) -> Result<::fidl_next::ResponseFuture<'_, super::Route, ___T>, ::fidl_next::EncodeError>
12257 where
12258 ___R: ::fidl_next::Encode<
12259 <___T as ::fidl_next::Transport>::SendBuffer,
12260 Encoded = crate::WireRouteRequest<'static>,
12261 >,
12262 {
12263 self.sender
12264 .send_two_way(972231070188342848, request)
12265 .map(::fidl_next::ResponseFuture::from_untyped)
12266 }
12267 }
12268
12269 #[repr(transparent)]
12271 pub struct DirConnectorRouterServerSender<___T: ::fidl_next::Transport> {
12272 sender: ::fidl_next::protocol::ServerSender<___T>,
12273 }
12274
12275 impl<___T> DirConnectorRouterServerSender<___T> where ___T: ::fidl_next::Transport {}
12276 }
12277}
12278
12279pub trait DirConnectorRouterClientHandler<___T: ::fidl_next::Transport> {
12283 fn on_unknown_interaction(
12284 &mut self,
12285 sender: &::fidl_next::ClientSender<DirConnectorRouter, ___T>,
12286 ordinal: u64,
12287 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
12288 sender.close();
12289 ::core::future::ready(())
12290 }
12291}
12292
12293impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DirConnectorRouter
12294where
12295 ___H: DirConnectorRouterClientHandler<___T> + Send,
12296 ___T: ::fidl_next::Transport,
12297
12298 <dir_connector_router::Route as ::fidl_next::Method>::Response:
12299 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
12300{
12301 async fn on_event(
12302 handler: &mut ___H,
12303 sender: &::fidl_next::ClientSender<Self, ___T>,
12304 ordinal: u64,
12305 buffer: ___T::RecvBuffer,
12306 ) {
12307 match ordinal {
12308 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
12309 }
12310 }
12311}
12312
12313pub trait DirConnectorRouterServerHandler<___T: ::fidl_next::Transport> {
12317 fn route(
12318 &mut self,
12319 sender: &::fidl_next::ServerSender<DirConnectorRouter, ___T>,
12320
12321 request: ::fidl_next::Request<dir_connector_router::Route, ___T>,
12322
12323 responder: ::fidl_next::Responder<dir_connector_router::Route>,
12324 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
12325
12326 fn on_unknown_interaction(
12327 &mut self,
12328 sender: &::fidl_next::ServerSender<DirConnectorRouter, ___T>,
12329 ordinal: u64,
12330 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
12331 sender.close();
12332 ::core::future::ready(())
12333 }
12334}
12335
12336impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DirConnectorRouter
12337where
12338 ___H: DirConnectorRouterServerHandler<___T> + Send,
12339 ___T: ::fidl_next::Transport,
12340
12341 <dir_connector_router::Route as ::fidl_next::Method>::Request:
12342 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
12343{
12344 async fn on_one_way(
12345 handler: &mut ___H,
12346 sender: &::fidl_next::ServerSender<Self, ___T>,
12347 ordinal: u64,
12348 buffer: ___T::RecvBuffer,
12349 ) {
12350 match ordinal {
12351 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
12352 }
12353 }
12354
12355 async fn on_two_way(
12356 handler: &mut ___H,
12357 sender: &::fidl_next::ServerSender<Self, ___T>,
12358 ordinal: u64,
12359 buffer: ___T::RecvBuffer,
12360 responder: ::fidl_next::protocol::Responder,
12361 ) {
12362 match ordinal {
12363 972231070188342848 => {
12364 let responder = ::fidl_next::Responder::from_untyped(responder);
12365
12366 match ::fidl_next::DecoderExt::decode(buffer) {
12367 Ok(decoded) => handler.route(sender, decoded, responder).await,
12368 Err(e) => {
12369 sender.close();
12370 }
12371 }
12372 }
12373
12374 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
12375 }
12376 }
12377}
12378
12379#[derive(Debug)]
12380pub enum DirEntryRouterRouteResponse {
12381 DirEntry(crate::DirEntry),
12382
12383 Unavailable(crate::Unit),
12384}
12385
12386impl ::fidl_next::Encodable for DirEntryRouterRouteResponse {
12387 type Encoded = WireDirEntryRouterRouteResponse;
12388}
12389
12390unsafe impl<___E> ::fidl_next::Encode<___E> for DirEntryRouterRouteResponse
12391where
12392 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12393
12394 ___E: ::fidl_next::fuchsia::HandleEncoder,
12395{
12396 #[inline]
12397 fn encode(
12398 self,
12399 encoder: &mut ___E,
12400 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12401 ) -> Result<(), ::fidl_next::EncodeError> {
12402 ::fidl_next::munge!(let WireDirEntryRouterRouteResponse { raw, _phantom: _ } = out);
12403
12404 match self {
12405 Self::DirEntry(value) => ::fidl_next::RawWireUnion::encode_as_static::<
12406 ___E,
12407 crate::DirEntry,
12408 >(value, 1, encoder, raw)?,
12409
12410 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
12411 ___E,
12412 crate::Unit,
12413 >(value, 2, encoder, raw)?,
12414 }
12415
12416 Ok(())
12417 }
12418}
12419
12420impl ::fidl_next::EncodableOption for DirEntryRouterRouteResponse {
12421 type EncodedOption = WireOptionalDirEntryRouterRouteResponse;
12422}
12423
12424unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirEntryRouterRouteResponse
12425where
12426 ___E: ?Sized,
12427 DirEntryRouterRouteResponse: ::fidl_next::Encode<___E>,
12428{
12429 #[inline]
12430 fn encode_option(
12431 this: Option<Self>,
12432 encoder: &mut ___E,
12433 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12434 ) -> Result<(), ::fidl_next::EncodeError> {
12435 ::fidl_next::munge!(let WireOptionalDirEntryRouterRouteResponse { raw, _phantom: _ } = &mut *out);
12436
12437 if let Some(inner) = this {
12438 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
12439 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
12440 } else {
12441 ::fidl_next::RawWireUnion::encode_absent(raw);
12442 }
12443
12444 Ok(())
12445 }
12446}
12447
12448impl ::fidl_next::FromWire<WireDirEntryRouterRouteResponse> for DirEntryRouterRouteResponse {
12449 #[inline]
12450 fn from_wire(wire: WireDirEntryRouterRouteResponse) -> Self {
12451 let wire = ::core::mem::ManuallyDrop::new(wire);
12452 match wire.raw.ordinal() {
12453 1 => Self::DirEntry(::fidl_next::FromWire::from_wire(unsafe {
12454 wire.raw.get().read_unchecked::<crate::WireDirEntry>()
12455 })),
12456
12457 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
12458 wire.raw.get().read_unchecked::<crate::WireUnit>()
12459 })),
12460
12461 _ => unsafe { ::core::hint::unreachable_unchecked() },
12462 }
12463 }
12464}
12465
12466impl ::fidl_next::FromWireOption<WireOptionalDirEntryRouterRouteResponse>
12467 for Box<DirEntryRouterRouteResponse>
12468{
12469 #[inline]
12470 fn from_wire_option(wire: WireOptionalDirEntryRouterRouteResponse) -> Option<Self> {
12471 if let Some(inner) = wire.into_option() {
12472 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
12473 } else {
12474 None
12475 }
12476 }
12477}
12478
12479#[repr(transparent)]
12481pub struct WireDirEntryRouterRouteResponse {
12482 raw: ::fidl_next::RawWireUnion,
12483 _phantom: ::core::marker::PhantomData<()>,
12484}
12485
12486impl Drop for WireDirEntryRouterRouteResponse {
12487 fn drop(&mut self) {
12488 match self.raw.ordinal() {
12489 1 => {
12490 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirEntry>() };
12491 }
12492
12493 2 => {
12494 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
12495 }
12496
12497 _ => unsafe { ::core::hint::unreachable_unchecked() },
12498 }
12499 }
12500}
12501
12502unsafe impl ::fidl_next::Wire for WireDirEntryRouterRouteResponse {
12503 type Decoded<'de> = WireDirEntryRouterRouteResponse;
12504
12505 #[inline]
12506 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12507 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
12508 ::fidl_next::RawWireUnion::zero_padding(raw);
12509 }
12510}
12511
12512pub mod dir_entry_router_route_response {
12513 pub enum Ref<'de> {
12514 DirEntry(&'de crate::WireDirEntry),
12515
12516 Unavailable(&'de crate::WireUnit),
12517 }
12518}
12519
12520impl WireDirEntryRouterRouteResponse {
12521 pub fn as_ref(&self) -> crate::dir_entry_router_route_response::Ref<'_> {
12522 match self.raw.ordinal() {
12523 1 => crate::dir_entry_router_route_response::Ref::DirEntry(unsafe {
12524 self.raw.get().deref_unchecked::<crate::WireDirEntry>()
12525 }),
12526
12527 2 => crate::dir_entry_router_route_response::Ref::Unavailable(unsafe {
12528 self.raw.get().deref_unchecked::<crate::WireUnit>()
12529 }),
12530
12531 _ => unsafe { ::core::hint::unreachable_unchecked() },
12532 }
12533 }
12534}
12535
12536unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirEntryRouterRouteResponse
12537where
12538 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12539
12540 ___D: ::fidl_next::fuchsia::HandleDecoder,
12541{
12542 fn decode(
12543 mut slot: ::fidl_next::Slot<'_, Self>,
12544 decoder: &mut ___D,
12545 ) -> Result<(), ::fidl_next::DecodeError> {
12546 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
12547 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
12548 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDirEntry>(
12549 raw, decoder,
12550 )?,
12551
12552 2 => {
12553 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
12554 }
12555
12556 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
12557 }
12558
12559 Ok(())
12560 }
12561}
12562
12563impl ::core::fmt::Debug for WireDirEntryRouterRouteResponse {
12564 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12565 match self.raw.ordinal() {
12566 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirEntry>().fmt(f) },
12567 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
12568 _ => unsafe { ::core::hint::unreachable_unchecked() },
12569 }
12570 }
12571}
12572
12573#[repr(transparent)]
12574pub struct WireOptionalDirEntryRouterRouteResponse {
12575 raw: ::fidl_next::RawWireUnion,
12576 _phantom: ::core::marker::PhantomData<()>,
12577}
12578
12579unsafe impl ::fidl_next::Wire for WireOptionalDirEntryRouterRouteResponse {
12580 type Decoded<'de> = WireOptionalDirEntryRouterRouteResponse;
12581
12582 #[inline]
12583 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12584 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
12585 ::fidl_next::RawWireUnion::zero_padding(raw);
12586 }
12587}
12588
12589impl WireOptionalDirEntryRouterRouteResponse {
12590 pub fn is_some(&self) -> bool {
12591 self.raw.is_some()
12592 }
12593
12594 pub fn is_none(&self) -> bool {
12595 self.raw.is_none()
12596 }
12597
12598 pub fn as_ref(&self) -> Option<&WireDirEntryRouterRouteResponse> {
12599 if self.is_some() {
12600 Some(unsafe { &*(self as *const Self).cast() })
12601 } else {
12602 None
12603 }
12604 }
12605
12606 pub fn into_option(self) -> Option<WireDirEntryRouterRouteResponse> {
12607 if self.is_some() {
12608 Some(WireDirEntryRouterRouteResponse {
12609 raw: self.raw,
12610 _phantom: ::core::marker::PhantomData,
12611 })
12612 } else {
12613 None
12614 }
12615 }
12616}
12617
12618unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDirEntryRouterRouteResponse
12619where
12620 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12621
12622 ___D: ::fidl_next::fuchsia::HandleDecoder,
12623{
12624 fn decode(
12625 mut slot: ::fidl_next::Slot<'_, Self>,
12626 decoder: &mut ___D,
12627 ) -> Result<(), ::fidl_next::DecodeError> {
12628 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
12629 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
12630 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDirEntry>(
12631 raw, decoder,
12632 )?,
12633
12634 2 => {
12635 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
12636 }
12637
12638 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
12639 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
12640 }
12641
12642 Ok(())
12643 }
12644}
12645
12646impl ::core::fmt::Debug for WireOptionalDirEntryRouterRouteResponse {
12647 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12648 self.as_ref().fmt(f)
12649 }
12650}
12651
12652#[derive(Debug)]
12654pub struct DirEntryRouter;
12655
12656impl ::fidl_next::Discoverable for DirEntryRouter {
12657 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
12658}
12659
12660pub mod dir_entry_router {
12661 pub mod prelude {
12662 pub use crate::{
12663 dir_entry_router, DirEntryRouter, DirEntryRouterClientHandler,
12664 DirEntryRouterServerHandler,
12665 };
12666
12667 pub use crate::DirEntryRouterRouteResponse;
12668
12669 pub use crate::RouteRequest;
12670
12671 pub use crate::RouterError;
12672 }
12673
12674 pub struct Route;
12675
12676 impl ::fidl_next::Method for Route {
12677 const ORDINAL: u64 = 1929392218567642066;
12678
12679 type Protocol = crate::DirEntryRouter;
12680
12681 type Request = crate::WireRouteRequest<'static>;
12682
12683 type Response = ::fidl_next::WireFlexibleResult<
12684 'static,
12685 crate::WireDirEntryRouterRouteResponse,
12686 crate::WireRouterError,
12687 >;
12688 }
12689
12690 mod ___detail {
12691
12692 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DirEntryRouter
12693 where
12694 ___T: ::fidl_next::Transport,
12695 {
12696 type ClientSender = DirEntryRouterClientSender<___T>;
12697 type ServerSender = DirEntryRouterServerSender<___T>;
12698 }
12699
12700 pub struct DirEntryRouterClientSender<___T: ::fidl_next::Transport> {
12702 #[allow(dead_code)]
12703 sender: ::fidl_next::protocol::ClientSender<___T>,
12704 }
12705
12706 impl<___T> DirEntryRouterClientSender<___T>
12707 where
12708 ___T: ::fidl_next::Transport,
12709 {
12710 pub fn route_with<___R>(
12711 &self,
12712 request: ___R,
12713 ) -> Result<::fidl_next::ResponseFuture<'_, super::Route, ___T>, ::fidl_next::EncodeError>
12714 where
12715 ___R: ::fidl_next::Encode<
12716 <___T as ::fidl_next::Transport>::SendBuffer,
12717 Encoded = crate::WireRouteRequest<'static>,
12718 >,
12719 {
12720 self.sender
12721 .send_two_way(1929392218567642066, request)
12722 .map(::fidl_next::ResponseFuture::from_untyped)
12723 }
12724 }
12725
12726 #[repr(transparent)]
12728 pub struct DirEntryRouterServerSender<___T: ::fidl_next::Transport> {
12729 sender: ::fidl_next::protocol::ServerSender<___T>,
12730 }
12731
12732 impl<___T> DirEntryRouterServerSender<___T> where ___T: ::fidl_next::Transport {}
12733 }
12734}
12735
12736pub trait DirEntryRouterClientHandler<___T: ::fidl_next::Transport> {
12740 fn on_unknown_interaction(
12741 &mut self,
12742 sender: &::fidl_next::ClientSender<DirEntryRouter, ___T>,
12743 ordinal: u64,
12744 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
12745 sender.close();
12746 ::core::future::ready(())
12747 }
12748}
12749
12750impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DirEntryRouter
12751where
12752 ___H: DirEntryRouterClientHandler<___T> + Send,
12753 ___T: ::fidl_next::Transport,
12754
12755 <dir_entry_router::Route as ::fidl_next::Method>::Response:
12756 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
12757{
12758 async fn on_event(
12759 handler: &mut ___H,
12760 sender: &::fidl_next::ClientSender<Self, ___T>,
12761 ordinal: u64,
12762 buffer: ___T::RecvBuffer,
12763 ) {
12764 match ordinal {
12765 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
12766 }
12767 }
12768}
12769
12770pub trait DirEntryRouterServerHandler<___T: ::fidl_next::Transport> {
12774 fn route(
12775 &mut self,
12776 sender: &::fidl_next::ServerSender<DirEntryRouter, ___T>,
12777
12778 request: ::fidl_next::Request<dir_entry_router::Route, ___T>,
12779
12780 responder: ::fidl_next::Responder<dir_entry_router::Route>,
12781 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
12782
12783 fn on_unknown_interaction(
12784 &mut self,
12785 sender: &::fidl_next::ServerSender<DirEntryRouter, ___T>,
12786 ordinal: u64,
12787 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
12788 sender.close();
12789 ::core::future::ready(())
12790 }
12791}
12792
12793impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DirEntryRouter
12794where
12795 ___H: DirEntryRouterServerHandler<___T> + Send,
12796 ___T: ::fidl_next::Transport,
12797
12798 <dir_entry_router::Route as ::fidl_next::Method>::Request:
12799 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
12800{
12801 async fn on_one_way(
12802 handler: &mut ___H,
12803 sender: &::fidl_next::ServerSender<Self, ___T>,
12804 ordinal: u64,
12805 buffer: ___T::RecvBuffer,
12806 ) {
12807 match ordinal {
12808 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
12809 }
12810 }
12811
12812 async fn on_two_way(
12813 handler: &mut ___H,
12814 sender: &::fidl_next::ServerSender<Self, ___T>,
12815 ordinal: u64,
12816 buffer: ___T::RecvBuffer,
12817 responder: ::fidl_next::protocol::Responder,
12818 ) {
12819 match ordinal {
12820 1929392218567642066 => {
12821 let responder = ::fidl_next::Responder::from_untyped(responder);
12822
12823 match ::fidl_next::DecoderExt::decode(buffer) {
12824 Ok(decoded) => handler.route(sender, decoded, responder).await,
12825 Err(e) => {
12826 sender.close();
12827 }
12828 }
12829 }
12830
12831 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
12832 }
12833 }
12834}
12835
12836#[derive(Debug)]
12837#[repr(C)]
12838pub struct DirReceiverReceiveRequest {
12839 pub channel: ::fidl_next::ServerEnd<
12840 ::fidl_next_fuchsia_io::Directory,
12841 ::fidl_next::fuchsia::zx::Channel,
12842 >,
12843}
12844
12845impl ::fidl_next::Encodable for DirReceiverReceiveRequest {
12846 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirReceiverReceiveRequest> = unsafe {
12847 ::fidl_next::CopyOptimization::enable_if(
12848 true && <::fidl_next::ServerEnd<
12849 ::fidl_next_fuchsia_io::Directory,
12850 ::fidl_next::fuchsia::zx::Channel,
12851 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
12852 .is_enabled(),
12853 )
12854 };
12855
12856 type Encoded = WireDirReceiverReceiveRequest;
12857}
12858
12859unsafe impl<___E> ::fidl_next::Encode<___E> for DirReceiverReceiveRequest
12860where
12861 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12862
12863 ___E: ::fidl_next::fuchsia::HandleEncoder,
12864{
12865 #[inline]
12866 fn encode(
12867 self,
12868 encoder: &mut ___E,
12869 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12870 ) -> Result<(), ::fidl_next::EncodeError> {
12871 ::fidl_next::munge! {
12872 let Self::Encoded {
12873 channel,
12874
12875 } = out;
12876 }
12877
12878 ::fidl_next::Encode::encode(self.channel, encoder, channel)?;
12879
12880 Ok(())
12881 }
12882}
12883
12884impl ::fidl_next::EncodableOption for DirReceiverReceiveRequest {
12885 type EncodedOption = ::fidl_next::WireBox<'static, WireDirReceiverReceiveRequest>;
12886}
12887
12888unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirReceiverReceiveRequest
12889where
12890 ___E: ::fidl_next::Encoder + ?Sized,
12891 DirReceiverReceiveRequest: ::fidl_next::Encode<___E>,
12892{
12893 #[inline]
12894 fn encode_option(
12895 this: Option<Self>,
12896 encoder: &mut ___E,
12897 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12898 ) -> Result<(), ::fidl_next::EncodeError> {
12899 if let Some(inner) = this {
12900 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
12901 ::fidl_next::WireBox::encode_present(out);
12902 } else {
12903 ::fidl_next::WireBox::encode_absent(out);
12904 }
12905
12906 Ok(())
12907 }
12908}
12909
12910impl ::fidl_next::FromWire<WireDirReceiverReceiveRequest> for DirReceiverReceiveRequest {
12911 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirReceiverReceiveRequest, Self> = unsafe {
12912 ::fidl_next::CopyOptimization::enable_if(
12913 true && <::fidl_next::ServerEnd<
12914 ::fidl_next_fuchsia_io::Directory,
12915 ::fidl_next::fuchsia::zx::Channel,
12916 > as ::fidl_next::FromWire<
12917 ::fidl_next::ServerEnd<
12918 ::fidl_next_fuchsia_io::Directory,
12919 ::fidl_next::fuchsia::WireChannel,
12920 >,
12921 >>::COPY_OPTIMIZATION
12922 .is_enabled(),
12923 )
12924 };
12925
12926 #[inline]
12927 fn from_wire(wire: WireDirReceiverReceiveRequest) -> Self {
12928 Self { channel: ::fidl_next::FromWire::from_wire(wire.channel) }
12929 }
12930}
12931
12932#[derive(Debug)]
12934#[repr(C)]
12935pub struct WireDirReceiverReceiveRequest {
12936 pub channel: ::fidl_next::ServerEnd<
12937 ::fidl_next_fuchsia_io::Directory,
12938 ::fidl_next::fuchsia::WireChannel,
12939 >,
12940}
12941
12942unsafe impl ::fidl_next::Wire for WireDirReceiverReceiveRequest {
12943 type Decoded<'de> = WireDirReceiverReceiveRequest;
12944
12945 #[inline]
12946 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
12947}
12948
12949unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirReceiverReceiveRequest
12950where
12951 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12952
12953 ___D: ::fidl_next::fuchsia::HandleDecoder,
12954{
12955 fn decode(
12956 slot: ::fidl_next::Slot<'_, Self>,
12957 decoder: &mut ___D,
12958 ) -> Result<(), ::fidl_next::DecodeError> {
12959 ::fidl_next::munge! {
12960 let Self {
12961 mut channel,
12962
12963 } = slot;
12964 }
12965
12966 ::fidl_next::Decode::decode(channel.as_mut(), decoder)?;
12967
12968 Ok(())
12969 }
12970}
12971
12972#[doc = " A receiver is served by components and allows them to receive directory channels\n framework.\n"]
12974#[derive(Debug)]
12975pub struct DirReceiver;
12976
12977impl ::fidl_next::Discoverable for DirReceiver {
12978 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
12979}
12980
12981pub mod dir_receiver {
12982 pub mod prelude {
12983 pub use crate::{
12984 dir_receiver, DirReceiver, DirReceiverClientHandler, DirReceiverServerHandler,
12985 };
12986
12987 pub use crate::DirReceiverReceiveRequest;
12988 }
12989
12990 pub struct Receive;
12991
12992 impl ::fidl_next::Method for Receive {
12993 const ORDINAL: u64 = 926684461087488948;
12994
12995 type Protocol = crate::DirReceiver;
12996
12997 type Request = crate::WireDirReceiverReceiveRequest;
12998
12999 type Response = ::fidl_next::Never;
13000 }
13001
13002 mod ___detail {
13003
13004 pub struct Receive<T0> {
13005 channel: T0,
13006 }
13007
13008 impl<T0> ::fidl_next::Encodable for Receive<T0>
13009 where
13010 T0: ::fidl_next::Encodable<
13011 Encoded = ::fidl_next::ServerEnd<
13012 ::fidl_next_fuchsia_io::Directory,
13013 ::fidl_next::fuchsia::WireChannel,
13014 >,
13015 >,
13016 {
13017 type Encoded = crate::WireDirReceiverReceiveRequest;
13018 }
13019
13020 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Receive<T0>
13021 where
13022 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13023
13024 ___E: ::fidl_next::fuchsia::HandleEncoder,
13025
13026 T0: ::fidl_next::Encode<
13027 ___E,
13028 Encoded = ::fidl_next::ServerEnd<
13029 ::fidl_next_fuchsia_io::Directory,
13030 ::fidl_next::fuchsia::WireChannel,
13031 >,
13032 >,
13033 {
13034 #[inline]
13035 fn encode(
13036 self,
13037 encoder: &mut ___E,
13038 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13039 ) -> Result<(), ::fidl_next::EncodeError> {
13040 ::fidl_next::munge! {
13041 let Self::Encoded {
13042 channel,
13043
13044 } = out;
13045 }
13046
13047 ::fidl_next::Encode::encode(self.channel, encoder, channel)?;
13048
13049 Ok(())
13050 }
13051 }
13052
13053 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DirReceiver
13054 where
13055 ___T: ::fidl_next::Transport,
13056 {
13057 type ClientSender = DirReceiverClientSender<___T>;
13058 type ServerSender = DirReceiverServerSender<___T>;
13059 }
13060
13061 pub struct DirReceiverClientSender<___T: ::fidl_next::Transport> {
13063 #[allow(dead_code)]
13064 sender: ::fidl_next::protocol::ClientSender<___T>,
13065 }
13066
13067 impl<___T> DirReceiverClientSender<___T>
13068 where
13069 ___T: ::fidl_next::Transport,
13070 {
13071 #[doc = " Sends a directory channel to this receiver.\n\n The server should implement this method by forwarding `channel` to a vfs instance\n of the language appropriate `vfs` library. To keep this interface decoupled from\n `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and\n `path`. If a client wishes to specify these, they can obtain an initial\n [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.\n"]
13072 pub fn receive(
13073 &self,
13074
13075 channel: impl ::fidl_next::Encode<
13076 <___T as ::fidl_next::Transport>::SendBuffer,
13077 Encoded = ::fidl_next::ServerEnd<
13078 ::fidl_next_fuchsia_io::Directory,
13079 ::fidl_next::fuchsia::WireChannel,
13080 >,
13081 >,
13082 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13083 where
13084 <___T as ::fidl_next::Transport>::SendBuffer:
13085 ::fidl_next::encoder::InternalHandleEncoder,
13086
13087 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13088 {
13089 self.receive_with(Receive { channel })
13090 }
13091
13092 #[doc = " Sends a directory channel to this receiver.\n\n The server should implement this method by forwarding `channel` to a vfs instance\n of the language appropriate `vfs` library. To keep this interface decoupled from\n `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and\n `path`. If a client wishes to specify these, they can obtain an initial\n [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.\n"]
13093 pub fn receive_with<___R>(
13094 &self,
13095 request: ___R,
13096 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13097 where
13098 ___R: ::fidl_next::Encode<
13099 <___T as ::fidl_next::Transport>::SendBuffer,
13100 Encoded = crate::WireDirReceiverReceiveRequest,
13101 >,
13102 {
13103 self.sender.send_one_way(926684461087488948, request)
13104 }
13105 }
13106
13107 #[repr(transparent)]
13109 pub struct DirReceiverServerSender<___T: ::fidl_next::Transport> {
13110 sender: ::fidl_next::protocol::ServerSender<___T>,
13111 }
13112
13113 impl<___T> DirReceiverServerSender<___T> where ___T: ::fidl_next::Transport {}
13114 }
13115}
13116
13117pub trait DirReceiverClientHandler<___T: ::fidl_next::Transport> {
13121 fn on_unknown_interaction(
13122 &mut self,
13123 sender: &::fidl_next::ClientSender<DirReceiver, ___T>,
13124 ordinal: u64,
13125 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13126 sender.close();
13127 ::core::future::ready(())
13128 }
13129}
13130
13131impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DirReceiver
13132where
13133 ___H: DirReceiverClientHandler<___T> + Send,
13134 ___T: ::fidl_next::Transport,
13135{
13136 async fn on_event(
13137 handler: &mut ___H,
13138 sender: &::fidl_next::ClientSender<Self, ___T>,
13139 ordinal: u64,
13140 buffer: ___T::RecvBuffer,
13141 ) {
13142 match ordinal {
13143 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13144 }
13145 }
13146}
13147
13148pub trait DirReceiverServerHandler<___T: ::fidl_next::Transport> {
13152 #[doc = " Sends a directory channel to this receiver.\n\n The server should implement this method by forwarding `channel` to a vfs instance\n of the language appropriate `vfs` library. To keep this interface decoupled from\n `fuchsia.io`, it deliberately omits `Open`/`Open3` parameters such as `flags` and\n `path`. If a client wishes to specify these, they can obtain an initial\n [fuchsia.io/Directory] channel first and then call `Open`/`Open3` on it.\n"]
13153 fn receive(
13154 &mut self,
13155 sender: &::fidl_next::ServerSender<DirReceiver, ___T>,
13156
13157 request: ::fidl_next::Request<dir_receiver::Receive, ___T>,
13158 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13159
13160 fn on_unknown_interaction(
13161 &mut self,
13162 sender: &::fidl_next::ServerSender<DirReceiver, ___T>,
13163 ordinal: u64,
13164 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13165 sender.close();
13166 ::core::future::ready(())
13167 }
13168}
13169
13170impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DirReceiver
13171where
13172 ___H: DirReceiverServerHandler<___T> + Send,
13173 ___T: ::fidl_next::Transport,
13174
13175 <dir_receiver::Receive as ::fidl_next::Method>::Request:
13176 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13177{
13178 async fn on_one_way(
13179 handler: &mut ___H,
13180 sender: &::fidl_next::ServerSender<Self, ___T>,
13181 ordinal: u64,
13182 buffer: ___T::RecvBuffer,
13183 ) {
13184 match ordinal {
13185 926684461087488948 => match ::fidl_next::DecoderExt::decode(buffer) {
13186 Ok(decoded) => handler.receive(sender, decoded).await,
13187 Err(e) => {
13188 sender.close();
13189 }
13190 },
13191
13192 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13193 }
13194 }
13195
13196 async fn on_two_way(
13197 handler: &mut ___H,
13198 sender: &::fidl_next::ServerSender<Self, ___T>,
13199 ordinal: u64,
13200 buffer: ___T::RecvBuffer,
13201 responder: ::fidl_next::protocol::Responder,
13202 ) {
13203 match ordinal {
13204 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13205 }
13206 }
13207}
13208
13209#[derive(Debug)]
13210pub enum DirectoryRouterRouteResponse {
13211 Directory(
13212 ::fidl_next::ClientEnd<
13213 ::fidl_next_fuchsia_io::Directory,
13214 ::fidl_next::fuchsia::zx::Channel,
13215 >,
13216 ),
13217
13218 Unavailable(crate::Unit),
13219}
13220
13221impl ::fidl_next::Encodable for DirectoryRouterRouteResponse {
13222 type Encoded = WireDirectoryRouterRouteResponse;
13223}
13224
13225unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRouterRouteResponse
13226where
13227 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13228
13229 ___E: ::fidl_next::fuchsia::HandleEncoder,
13230{
13231 #[inline]
13232 fn encode(
13233 self,
13234 encoder: &mut ___E,
13235 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13236 ) -> Result<(), ::fidl_next::EncodeError> {
13237 ::fidl_next::munge!(let WireDirectoryRouterRouteResponse { raw, _phantom: _ } = out);
13238
13239 match self {
13240 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as_static::<
13241 ___E,
13242 ::fidl_next::ClientEnd<
13243 ::fidl_next_fuchsia_io::Directory,
13244 ::fidl_next::fuchsia::zx::Channel,
13245 >,
13246 >(value, 1, encoder, raw)?,
13247
13248 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
13249 ___E,
13250 crate::Unit,
13251 >(value, 2, encoder, raw)?,
13252 }
13253
13254 Ok(())
13255 }
13256}
13257
13258impl ::fidl_next::EncodableOption for DirectoryRouterRouteResponse {
13259 type EncodedOption = WireOptionalDirectoryRouterRouteResponse;
13260}
13261
13262unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryRouterRouteResponse
13263where
13264 ___E: ?Sized,
13265 DirectoryRouterRouteResponse: ::fidl_next::Encode<___E>,
13266{
13267 #[inline]
13268 fn encode_option(
13269 this: Option<Self>,
13270 encoder: &mut ___E,
13271 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
13272 ) -> Result<(), ::fidl_next::EncodeError> {
13273 ::fidl_next::munge!(let WireOptionalDirectoryRouterRouteResponse { raw, _phantom: _ } = &mut *out);
13274
13275 if let Some(inner) = this {
13276 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
13277 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
13278 } else {
13279 ::fidl_next::RawWireUnion::encode_absent(raw);
13280 }
13281
13282 Ok(())
13283 }
13284}
13285
13286impl ::fidl_next::FromWire<WireDirectoryRouterRouteResponse> for DirectoryRouterRouteResponse {
13287 #[inline]
13288 fn from_wire(wire: WireDirectoryRouterRouteResponse) -> Self {
13289 let wire = ::core::mem::ManuallyDrop::new(wire);
13290 match wire.raw.ordinal() {
13291 1 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
13292 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<
13293 ::fidl_next_fuchsia_io::Directory,
13294 ::fidl_next::fuchsia::WireChannel,
13295 >>()
13296 })),
13297
13298 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
13299 wire.raw.get().read_unchecked::<crate::WireUnit>()
13300 })),
13301
13302 _ => unsafe { ::core::hint::unreachable_unchecked() },
13303 }
13304 }
13305}
13306
13307impl ::fidl_next::FromWireOption<WireOptionalDirectoryRouterRouteResponse>
13308 for Box<DirectoryRouterRouteResponse>
13309{
13310 #[inline]
13311 fn from_wire_option(wire: WireOptionalDirectoryRouterRouteResponse) -> Option<Self> {
13312 if let Some(inner) = wire.into_option() {
13313 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
13314 } else {
13315 None
13316 }
13317 }
13318}
13319
13320#[repr(transparent)]
13322pub struct WireDirectoryRouterRouteResponse {
13323 raw: ::fidl_next::RawWireUnion,
13324 _phantom: ::core::marker::PhantomData<()>,
13325}
13326
13327impl Drop for WireDirectoryRouterRouteResponse {
13328 fn drop(&mut self) {
13329 match self.raw.ordinal() {
13330 1 => {
13331 let _ = unsafe {
13332 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
13333 ::fidl_next_fuchsia_io::Directory,
13334 ::fidl_next::fuchsia::WireChannel,
13335 >>()
13336 };
13337 }
13338
13339 2 => {
13340 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
13341 }
13342
13343 _ => unsafe { ::core::hint::unreachable_unchecked() },
13344 }
13345 }
13346}
13347
13348unsafe impl ::fidl_next::Wire for WireDirectoryRouterRouteResponse {
13349 type Decoded<'de> = WireDirectoryRouterRouteResponse;
13350
13351 #[inline]
13352 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13353 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
13354 ::fidl_next::RawWireUnion::zero_padding(raw);
13355 }
13356}
13357
13358pub mod directory_router_route_response {
13359 pub enum Ref<'de> {
13360 Directory(
13361 &'de ::fidl_next::ClientEnd<
13362 ::fidl_next_fuchsia_io::Directory,
13363 ::fidl_next::fuchsia::WireChannel,
13364 >,
13365 ),
13366
13367 Unavailable(&'de crate::WireUnit),
13368 }
13369}
13370
13371impl WireDirectoryRouterRouteResponse {
13372 pub fn as_ref(&self) -> crate::directory_router_route_response::Ref<'_> {
13373 match self.raw.ordinal() {
13374 1 => crate::directory_router_route_response::Ref::Directory(unsafe {
13375 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
13376 ::fidl_next_fuchsia_io::Directory,
13377 ::fidl_next::fuchsia::WireChannel,
13378 >>()
13379 }),
13380
13381 2 => crate::directory_router_route_response::Ref::Unavailable(unsafe {
13382 self.raw.get().deref_unchecked::<crate::WireUnit>()
13383 }),
13384
13385 _ => unsafe { ::core::hint::unreachable_unchecked() },
13386 }
13387 }
13388}
13389
13390unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRouterRouteResponse
13391where
13392 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13393
13394 ___D: ::fidl_next::fuchsia::HandleDecoder,
13395{
13396 fn decode(
13397 mut slot: ::fidl_next::Slot<'_, Self>,
13398 decoder: &mut ___D,
13399 ) -> Result<(), ::fidl_next::DecodeError> {
13400 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
13401 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
13402 1 => ::fidl_next::RawWireUnion::decode_as_static::<
13403 ___D,
13404 ::fidl_next::ClientEnd<
13405 ::fidl_next_fuchsia_io::Directory,
13406 ::fidl_next::fuchsia::WireChannel,
13407 >,
13408 >(raw, decoder)?,
13409
13410 2 => {
13411 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
13412 }
13413
13414 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
13415 }
13416
13417 Ok(())
13418 }
13419}
13420
13421impl ::core::fmt::Debug for WireDirectoryRouterRouteResponse {
13422 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13423 match self.raw.ordinal() {
13424 1 => unsafe {
13425 self.raw
13426 .get()
13427 .deref_unchecked::<::fidl_next::ClientEnd<
13428 ::fidl_next_fuchsia_io::Directory,
13429 ::fidl_next::fuchsia::WireChannel,
13430 >>()
13431 .fmt(f)
13432 },
13433 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
13434 _ => unsafe { ::core::hint::unreachable_unchecked() },
13435 }
13436 }
13437}
13438
13439#[repr(transparent)]
13440pub struct WireOptionalDirectoryRouterRouteResponse {
13441 raw: ::fidl_next::RawWireUnion,
13442 _phantom: ::core::marker::PhantomData<()>,
13443}
13444
13445unsafe impl ::fidl_next::Wire for WireOptionalDirectoryRouterRouteResponse {
13446 type Decoded<'de> = WireOptionalDirectoryRouterRouteResponse;
13447
13448 #[inline]
13449 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13450 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
13451 ::fidl_next::RawWireUnion::zero_padding(raw);
13452 }
13453}
13454
13455impl WireOptionalDirectoryRouterRouteResponse {
13456 pub fn is_some(&self) -> bool {
13457 self.raw.is_some()
13458 }
13459
13460 pub fn is_none(&self) -> bool {
13461 self.raw.is_none()
13462 }
13463
13464 pub fn as_ref(&self) -> Option<&WireDirectoryRouterRouteResponse> {
13465 if self.is_some() {
13466 Some(unsafe { &*(self as *const Self).cast() })
13467 } else {
13468 None
13469 }
13470 }
13471
13472 pub fn into_option(self) -> Option<WireDirectoryRouterRouteResponse> {
13473 if self.is_some() {
13474 Some(WireDirectoryRouterRouteResponse {
13475 raw: self.raw,
13476 _phantom: ::core::marker::PhantomData,
13477 })
13478 } else {
13479 None
13480 }
13481 }
13482}
13483
13484unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDirectoryRouterRouteResponse
13485where
13486 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13487
13488 ___D: ::fidl_next::fuchsia::HandleDecoder,
13489{
13490 fn decode(
13491 mut slot: ::fidl_next::Slot<'_, Self>,
13492 decoder: &mut ___D,
13493 ) -> Result<(), ::fidl_next::DecodeError> {
13494 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
13495 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
13496 1 => ::fidl_next::RawWireUnion::decode_as_static::<
13497 ___D,
13498 ::fidl_next::ClientEnd<
13499 ::fidl_next_fuchsia_io::Directory,
13500 ::fidl_next::fuchsia::WireChannel,
13501 >,
13502 >(raw, decoder)?,
13503
13504 2 => {
13505 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
13506 }
13507
13508 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
13509 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
13510 }
13511
13512 Ok(())
13513 }
13514}
13515
13516impl ::core::fmt::Debug for WireOptionalDirectoryRouterRouteResponse {
13517 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13518 self.as_ref().fmt(f)
13519 }
13520}
13521
13522#[derive(Debug)]
13524pub struct DirectoryRouter;
13525
13526impl ::fidl_next::Discoverable for DirectoryRouter {
13527 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
13528}
13529
13530pub mod directory_router {
13531 pub mod prelude {
13532 pub use crate::{
13533 directory_router, DirectoryRouter, DirectoryRouterClientHandler,
13534 DirectoryRouterServerHandler,
13535 };
13536
13537 pub use crate::DirectoryRouterRouteResponse;
13538
13539 pub use crate::RouteRequest;
13540
13541 pub use crate::RouterError;
13542 }
13543
13544 pub struct Route;
13545
13546 impl ::fidl_next::Method for Route {
13547 const ORDINAL: u64 = 7510716014181158689;
13548
13549 type Protocol = crate::DirectoryRouter;
13550
13551 type Request = crate::WireRouteRequest<'static>;
13552
13553 type Response = ::fidl_next::WireFlexibleResult<
13554 'static,
13555 crate::WireDirectoryRouterRouteResponse,
13556 crate::WireRouterError,
13557 >;
13558 }
13559
13560 mod ___detail {
13561
13562 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::DirectoryRouter
13563 where
13564 ___T: ::fidl_next::Transport,
13565 {
13566 type ClientSender = DirectoryRouterClientSender<___T>;
13567 type ServerSender = DirectoryRouterServerSender<___T>;
13568 }
13569
13570 pub struct DirectoryRouterClientSender<___T: ::fidl_next::Transport> {
13572 #[allow(dead_code)]
13573 sender: ::fidl_next::protocol::ClientSender<___T>,
13574 }
13575
13576 impl<___T> DirectoryRouterClientSender<___T>
13577 where
13578 ___T: ::fidl_next::Transport,
13579 {
13580 pub fn route_with<___R>(
13581 &self,
13582 request: ___R,
13583 ) -> Result<::fidl_next::ResponseFuture<'_, super::Route, ___T>, ::fidl_next::EncodeError>
13584 where
13585 ___R: ::fidl_next::Encode<
13586 <___T as ::fidl_next::Transport>::SendBuffer,
13587 Encoded = crate::WireRouteRequest<'static>,
13588 >,
13589 {
13590 self.sender
13591 .send_two_way(7510716014181158689, request)
13592 .map(::fidl_next::ResponseFuture::from_untyped)
13593 }
13594 }
13595
13596 #[repr(transparent)]
13598 pub struct DirectoryRouterServerSender<___T: ::fidl_next::Transport> {
13599 sender: ::fidl_next::protocol::ServerSender<___T>,
13600 }
13601
13602 impl<___T> DirectoryRouterServerSender<___T> where ___T: ::fidl_next::Transport {}
13603 }
13604}
13605
13606pub trait DirectoryRouterClientHandler<___T: ::fidl_next::Transport> {
13610 fn on_unknown_interaction(
13611 &mut self,
13612 sender: &::fidl_next::ClientSender<DirectoryRouter, ___T>,
13613 ordinal: u64,
13614 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13615 sender.close();
13616 ::core::future::ready(())
13617 }
13618}
13619
13620impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for DirectoryRouter
13621where
13622 ___H: DirectoryRouterClientHandler<___T> + Send,
13623 ___T: ::fidl_next::Transport,
13624
13625 <directory_router::Route as ::fidl_next::Method>::Response:
13626 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13627{
13628 async fn on_event(
13629 handler: &mut ___H,
13630 sender: &::fidl_next::ClientSender<Self, ___T>,
13631 ordinal: u64,
13632 buffer: ___T::RecvBuffer,
13633 ) {
13634 match ordinal {
13635 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13636 }
13637 }
13638}
13639
13640pub trait DirectoryRouterServerHandler<___T: ::fidl_next::Transport> {
13644 fn route(
13645 &mut self,
13646 sender: &::fidl_next::ServerSender<DirectoryRouter, ___T>,
13647
13648 request: ::fidl_next::Request<directory_router::Route, ___T>,
13649
13650 responder: ::fidl_next::Responder<directory_router::Route>,
13651 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13652
13653 fn on_unknown_interaction(
13654 &mut self,
13655 sender: &::fidl_next::ServerSender<DirectoryRouter, ___T>,
13656 ordinal: u64,
13657 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13658 sender.close();
13659 ::core::future::ready(())
13660 }
13661}
13662
13663impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for DirectoryRouter
13664where
13665 ___H: DirectoryRouterServerHandler<___T> + Send,
13666 ___T: ::fidl_next::Transport,
13667
13668 <directory_router::Route as ::fidl_next::Method>::Request:
13669 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
13670{
13671 async fn on_one_way(
13672 handler: &mut ___H,
13673 sender: &::fidl_next::ServerSender<Self, ___T>,
13674 ordinal: u64,
13675 buffer: ___T::RecvBuffer,
13676 ) {
13677 match ordinal {
13678 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13679 }
13680 }
13681
13682 async fn on_two_way(
13683 handler: &mut ___H,
13684 sender: &::fidl_next::ServerSender<Self, ___T>,
13685 ordinal: u64,
13686 buffer: ___T::RecvBuffer,
13687 responder: ::fidl_next::protocol::Responder,
13688 ) {
13689 match ordinal {
13690 7510716014181158689 => {
13691 let responder = ::fidl_next::Responder::from_untyped(responder);
13692
13693 match ::fidl_next::DecoderExt::decode(buffer) {
13694 Ok(decoded) => handler.route(sender, decoded, responder).await,
13695 Err(e) => {
13696 sender.close();
13697 }
13698 }
13699 }
13700
13701 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13702 }
13703 }
13704}
13705
13706#[doc = " Contains a protocol open request.\n"]
13707#[derive(Debug)]
13708#[repr(C)]
13709pub struct ProtocolPayload {
13710 pub channel: ::fidl_next::fuchsia::zx::Handle,
13711}
13712
13713impl ::fidl_next::Encodable for ProtocolPayload {
13714 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireProtocolPayload> = unsafe {
13715 ::fidl_next::CopyOptimization::enable_if(
13716 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
13717 .is_enabled(),
13718 )
13719 };
13720
13721 type Encoded = WireProtocolPayload;
13722}
13723
13724unsafe impl<___E> ::fidl_next::Encode<___E> for ProtocolPayload
13725where
13726 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13727
13728 ___E: ::fidl_next::fuchsia::HandleEncoder,
13729{
13730 #[inline]
13731 fn encode(
13732 self,
13733 encoder: &mut ___E,
13734 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13735 ) -> Result<(), ::fidl_next::EncodeError> {
13736 ::fidl_next::munge! {
13737 let Self::Encoded {
13738 channel,
13739
13740 } = out;
13741 }
13742
13743 ::fidl_next::Encode::encode(self.channel, encoder, channel)?;
13744
13745 Ok(())
13746 }
13747}
13748
13749impl ::fidl_next::EncodableOption for ProtocolPayload {
13750 type EncodedOption = ::fidl_next::WireBox<'static, WireProtocolPayload>;
13751}
13752
13753unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ProtocolPayload
13754where
13755 ___E: ::fidl_next::Encoder + ?Sized,
13756 ProtocolPayload: ::fidl_next::Encode<___E>,
13757{
13758 #[inline]
13759 fn encode_option(
13760 this: Option<Self>,
13761 encoder: &mut ___E,
13762 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
13763 ) -> Result<(), ::fidl_next::EncodeError> {
13764 if let Some(inner) = this {
13765 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
13766 ::fidl_next::WireBox::encode_present(out);
13767 } else {
13768 ::fidl_next::WireBox::encode_absent(out);
13769 }
13770
13771 Ok(())
13772 }
13773}
13774
13775impl ::fidl_next::FromWire<WireProtocolPayload> for ProtocolPayload {
13776 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireProtocolPayload, Self> = unsafe {
13777 ::fidl_next::CopyOptimization::enable_if(
13778 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
13779 ::fidl_next::fuchsia::WireHandle,
13780 >>::COPY_OPTIMIZATION
13781 .is_enabled(),
13782 )
13783 };
13784
13785 #[inline]
13786 fn from_wire(wire: WireProtocolPayload) -> Self {
13787 Self { channel: ::fidl_next::FromWire::from_wire(wire.channel) }
13788 }
13789}
13790
13791#[derive(Debug)]
13793#[repr(C)]
13794pub struct WireProtocolPayload {
13795 pub channel: ::fidl_next::fuchsia::WireHandle,
13796}
13797
13798unsafe impl ::fidl_next::Wire for WireProtocolPayload {
13799 type Decoded<'de> = WireProtocolPayload;
13800
13801 #[inline]
13802 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
13803}
13804
13805unsafe impl<___D> ::fidl_next::Decode<___D> for WireProtocolPayload
13806where
13807 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13808
13809 ___D: ::fidl_next::fuchsia::HandleDecoder,
13810{
13811 fn decode(
13812 slot: ::fidl_next::Slot<'_, Self>,
13813 decoder: &mut ___D,
13814 ) -> Result<(), ::fidl_next::DecodeError> {
13815 ::fidl_next::munge! {
13816 let Self {
13817 mut channel,
13818
13819 } = slot;
13820 }
13821
13822 ::fidl_next::Decode::decode(channel.as_mut(), decoder)?;
13823
13824 Ok(())
13825 }
13826}
13827
13828#[doc = " A receiver is served by components and allows them to receive channels\n from the framework.\n"]
13830#[derive(Debug)]
13831pub struct Receiver;
13832
13833impl ::fidl_next::Discoverable for Receiver {
13834 const PROTOCOL_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
13835}
13836
13837pub mod receiver {
13838 pub mod prelude {
13839 pub use crate::{receiver, Receiver, ReceiverClientHandler, ReceiverServerHandler};
13840
13841 pub use crate::ProtocolPayload;
13842 }
13843
13844 pub struct Receive;
13845
13846 impl ::fidl_next::Method for Receive {
13847 const ORDINAL: u64 = 340832707723008660;
13848
13849 type Protocol = crate::Receiver;
13850
13851 type Request = crate::WireProtocolPayload;
13852
13853 type Response = ::fidl_next::Never;
13854 }
13855
13856 mod ___detail {
13857
13858 pub struct Receive<T0> {
13859 channel: T0,
13860 }
13861
13862 impl<T0> ::fidl_next::Encodable for Receive<T0>
13863 where
13864 T0: ::fidl_next::Encodable<Encoded = ::fidl_next::fuchsia::WireHandle>,
13865 {
13866 type Encoded = crate::WireProtocolPayload;
13867 }
13868
13869 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Receive<T0>
13870 where
13871 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13872
13873 ___E: ::fidl_next::fuchsia::HandleEncoder,
13874
13875 T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::fuchsia::WireHandle>,
13876 {
13877 #[inline]
13878 fn encode(
13879 self,
13880 encoder: &mut ___E,
13881 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13882 ) -> Result<(), ::fidl_next::EncodeError> {
13883 ::fidl_next::munge! {
13884 let Self::Encoded {
13885 channel,
13886
13887 } = out;
13888 }
13889
13890 ::fidl_next::Encode::encode(self.channel, encoder, channel)?;
13891
13892 Ok(())
13893 }
13894 }
13895
13896 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Receiver
13897 where
13898 ___T: ::fidl_next::Transport,
13899 {
13900 type ClientSender = ReceiverClientSender<___T>;
13901 type ServerSender = ReceiverServerSender<___T>;
13902 }
13903
13904 pub struct ReceiverClientSender<___T: ::fidl_next::Transport> {
13906 #[allow(dead_code)]
13907 sender: ::fidl_next::protocol::ClientSender<___T>,
13908 }
13909
13910 impl<___T> ReceiverClientSender<___T>
13911 where
13912 ___T: ::fidl_next::Transport,
13913 {
13914 #[doc = " Sends a channel to this receiver.\n"]
13915 pub fn receive(
13916 &self,
13917
13918 channel: impl ::fidl_next::Encode<
13919 <___T as ::fidl_next::Transport>::SendBuffer,
13920 Encoded = ::fidl_next::fuchsia::WireHandle,
13921 >,
13922 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13923 where
13924 <___T as ::fidl_next::Transport>::SendBuffer:
13925 ::fidl_next::encoder::InternalHandleEncoder,
13926
13927 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
13928 {
13929 self.receive_with(Receive { channel })
13930 }
13931
13932 #[doc = " Sends a channel to this receiver.\n"]
13933 pub fn receive_with<___R>(
13934 &self,
13935 request: ___R,
13936 ) -> Result<::fidl_next::SendFuture<'_, ___T>, ::fidl_next::EncodeError>
13937 where
13938 ___R: ::fidl_next::Encode<
13939 <___T as ::fidl_next::Transport>::SendBuffer,
13940 Encoded = crate::WireProtocolPayload,
13941 >,
13942 {
13943 self.sender.send_one_way(340832707723008660, request)
13944 }
13945 }
13946
13947 #[repr(transparent)]
13949 pub struct ReceiverServerSender<___T: ::fidl_next::Transport> {
13950 sender: ::fidl_next::protocol::ServerSender<___T>,
13951 }
13952
13953 impl<___T> ReceiverServerSender<___T> where ___T: ::fidl_next::Transport {}
13954 }
13955}
13956
13957pub trait ReceiverClientHandler<___T: ::fidl_next::Transport> {
13961 fn on_unknown_interaction(
13962 &mut self,
13963 sender: &::fidl_next::ClientSender<Receiver, ___T>,
13964 ordinal: u64,
13965 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
13966 sender.close();
13967 ::core::future::ready(())
13968 }
13969}
13970
13971impl<___H, ___T> ::fidl_next::ClientProtocol<___H, ___T> for Receiver
13972where
13973 ___H: ReceiverClientHandler<___T> + Send,
13974 ___T: ::fidl_next::Transport,
13975{
13976 async fn on_event(
13977 handler: &mut ___H,
13978 sender: &::fidl_next::ClientSender<Self, ___T>,
13979 ordinal: u64,
13980 buffer: ___T::RecvBuffer,
13981 ) {
13982 match ordinal {
13983 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
13984 }
13985 }
13986}
13987
13988pub trait ReceiverServerHandler<___T: ::fidl_next::Transport> {
13992 #[doc = " Sends a channel to this receiver.\n"]
13993 fn receive(
13994 &mut self,
13995 sender: &::fidl_next::ServerSender<Receiver, ___T>,
13996
13997 request: ::fidl_next::Request<receiver::Receive, ___T>,
13998 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
13999
14000 fn on_unknown_interaction(
14001 &mut self,
14002 sender: &::fidl_next::ServerSender<Receiver, ___T>,
14003 ordinal: u64,
14004 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
14005 sender.close();
14006 ::core::future::ready(())
14007 }
14008}
14009
14010impl<___H, ___T> ::fidl_next::ServerProtocol<___H, ___T> for Receiver
14011where
14012 ___H: ReceiverServerHandler<___T> + Send,
14013 ___T: ::fidl_next::Transport,
14014
14015 <receiver::Receive as ::fidl_next::Method>::Request:
14016 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
14017{
14018 async fn on_one_way(
14019 handler: &mut ___H,
14020 sender: &::fidl_next::ServerSender<Self, ___T>,
14021 ordinal: u64,
14022 buffer: ___T::RecvBuffer,
14023 ) {
14024 match ordinal {
14025 340832707723008660 => match ::fidl_next::DecoderExt::decode(buffer) {
14026 Ok(decoded) => handler.receive(sender, decoded).await,
14027 Err(e) => {
14028 sender.close();
14029 }
14030 },
14031
14032 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
14033 }
14034 }
14035
14036 async fn on_two_way(
14037 handler: &mut ___H,
14038 sender: &::fidl_next::ServerSender<Self, ___T>,
14039 ordinal: u64,
14040 buffer: ___T::RecvBuffer,
14041 responder: ::fidl_next::protocol::Responder,
14042 ) {
14043 match ordinal {
14044 ordinal => handler.on_unknown_interaction(sender, ordinal).await,
14045 }
14046 }
14047}
14048
14049#[derive(Clone, Debug)]
14050#[repr(C)]
14051pub struct Unavailable {}
14052
14053impl ::fidl_next::Encodable for Unavailable {
14054 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireUnavailable> =
14055 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
14056
14057 type Encoded = WireUnavailable;
14058}
14059
14060unsafe impl<___E> ::fidl_next::Encode<___E> for Unavailable
14061where
14062 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14063{
14064 #[inline]
14065 fn encode(
14066 self,
14067 encoder: &mut ___E,
14068 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14069 ) -> Result<(), ::fidl_next::EncodeError> {
14070 ::fidl_next::munge! {
14071 let Self::Encoded {
14072
14073 } = out;
14074 }
14075
14076 Ok(())
14077 }
14078}
14079
14080unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Unavailable
14081where
14082 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14083{
14084 #[inline]
14085 fn encode_ref(
14086 &self,
14087 encoder: &mut ___E,
14088 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14089 ) -> Result<(), ::fidl_next::EncodeError> {
14090 ::fidl_next::munge! {
14091 let Self::Encoded {
14092
14093 } = out;
14094 }
14095
14096 Ok(())
14097 }
14098}
14099
14100impl ::fidl_next::EncodableOption for Unavailable {
14101 type EncodedOption = ::fidl_next::WireBox<'static, WireUnavailable>;
14102}
14103
14104unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Unavailable
14105where
14106 ___E: ::fidl_next::Encoder + ?Sized,
14107 Unavailable: ::fidl_next::Encode<___E>,
14108{
14109 #[inline]
14110 fn encode_option(
14111 this: Option<Self>,
14112 encoder: &mut ___E,
14113 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
14114 ) -> Result<(), ::fidl_next::EncodeError> {
14115 if let Some(inner) = this {
14116 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
14117 ::fidl_next::WireBox::encode_present(out);
14118 } else {
14119 ::fidl_next::WireBox::encode_absent(out);
14120 }
14121
14122 Ok(())
14123 }
14124}
14125
14126unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Unavailable
14127where
14128 ___E: ::fidl_next::Encoder + ?Sized,
14129 Unavailable: ::fidl_next::EncodeRef<___E>,
14130{
14131 #[inline]
14132 fn encode_option_ref(
14133 this: Option<&Self>,
14134 encoder: &mut ___E,
14135 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
14136 ) -> Result<(), ::fidl_next::EncodeError> {
14137 if let Some(inner) = this {
14138 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
14139 ::fidl_next::WireBox::encode_present(out);
14140 } else {
14141 ::fidl_next::WireBox::encode_absent(out);
14142 }
14143
14144 Ok(())
14145 }
14146}
14147
14148impl ::fidl_next::FromWire<WireUnavailable> for Unavailable {
14149 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireUnavailable, Self> =
14150 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
14151
14152 #[inline]
14153 fn from_wire(wire: WireUnavailable) -> Self {
14154 Self {}
14155 }
14156}
14157
14158impl ::fidl_next::FromWireRef<WireUnavailable> for Unavailable {
14159 #[inline]
14160 fn from_wire_ref(wire: &WireUnavailable) -> Self {
14161 Self {}
14162 }
14163}
14164
14165#[derive(Clone, Debug)]
14167#[repr(C)]
14168pub struct WireUnavailable {}
14169
14170unsafe impl ::fidl_next::Wire for WireUnavailable {
14171 type Decoded<'de> = WireUnavailable;
14172
14173 #[inline]
14174 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
14175}
14176
14177unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnavailable
14178where
14179 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
14180{
14181 fn decode(
14182 slot: ::fidl_next::Slot<'_, Self>,
14183 decoder: &mut ___D,
14184 ) -> Result<(), ::fidl_next::DecodeError> {
14185 ::fidl_next::munge! {
14186 let Self {
14187
14188 } = slot;
14189 }
14190
14191 Ok(())
14192 }
14193}
14194
14195pub mod compat {
14197
14198 impl ::core::convert::From<crate::Availability> for ::fidl_fuchsia_component_sandbox::Availability {
14199 #[inline]
14200 fn from(from: crate::Availability) -> Self {
14201 match crate::Availability::from(from) {
14202 crate::Availability::Required => Self::Required,
14203
14204 crate::Availability::Optional => Self::Optional,
14205
14206 crate::Availability::SameAsTarget => Self::SameAsTarget,
14207
14208 crate::Availability::Transitional => Self::Transitional,
14209 }
14210 }
14211 }
14212
14213 impl ::core::convert::From<crate::CapabilityStoreError>
14214 for ::fidl_fuchsia_component_sandbox::CapabilityStoreError
14215 {
14216 #[inline]
14217 fn from(from: crate::CapabilityStoreError) -> Self {
14218 match crate::CapabilityStoreError::from(from) {
14219 crate::CapabilityStoreError::IdNotFound => Self::IdNotFound,
14220
14221 crate::CapabilityStoreError::IdAlreadyExists => Self::IdAlreadyExists,
14222
14223 crate::CapabilityStoreError::BadCapability => Self::BadCapability,
14224
14225 crate::CapabilityStoreError::WrongType => Self::WrongType,
14226
14227 crate::CapabilityStoreError::NotDuplicatable => Self::NotDuplicatable,
14228
14229 crate::CapabilityStoreError::ItemNotFound => Self::ItemNotFound,
14230
14231 crate::CapabilityStoreError::ItemAlreadyExists => Self::ItemAlreadyExists,
14232
14233 crate::CapabilityStoreError::InvalidKey => Self::InvalidKey,
14234
14235 crate::CapabilityStoreError::InvalidArgs => Self::InvalidArgs,
14236
14237 crate::CapabilityStoreError::UnknownOrdinal_(value) => {
14238 Self::__SourceBreaking { unknown_ordinal: value }
14239 }
14240 }
14241 }
14242 }
14243
14244 #[cfg(target_os = "fuchsia")]
14245 pub type CapabilityStoreProxy =
14248 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::CapabilityStore>;
14249
14250 impl ::core::convert::From<crate::CapabilityStore>
14251 for ::fidl_fuchsia_component_sandbox::CapabilityStoreMarker
14252 {
14253 #[inline]
14254 fn from(_: crate::CapabilityStore) -> Self {
14255 Self
14256 }
14257 }
14258
14259 impl ::core::convert::From<crate::RouterError> for ::fidl_fuchsia_component_sandbox::RouterError {
14260 #[inline]
14261 fn from(from: crate::RouterError) -> Self {
14262 match crate::RouterError::from(from) {
14263 crate::RouterError::NotFound => Self::NotFound,
14264
14265 crate::RouterError::InvalidArgs => Self::InvalidArgs,
14266
14267 crate::RouterError::NotSupported => Self::NotSupported,
14268
14269 crate::RouterError::Internal => Self::Internal,
14270
14271 crate::RouterError::UnknownOrdinal_(value) => {
14272 Self::__SourceBreaking { unknown_ordinal: value }
14273 }
14274 }
14275 }
14276 }
14277
14278 #[cfg(target_os = "fuchsia")]
14279 pub type ConnectorRouterProxy =
14282 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::ConnectorRouter>;
14283
14284 impl ::core::convert::From<crate::ConnectorRouter>
14285 for ::fidl_fuchsia_component_sandbox::ConnectorRouterMarker
14286 {
14287 #[inline]
14288 fn from(_: crate::ConnectorRouter) -> Self {
14289 Self
14290 }
14291 }
14292
14293 #[cfg(target_os = "fuchsia")]
14294 pub type DataRouterProxy =
14297 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DataRouter>;
14298
14299 impl ::core::convert::From<crate::DataRouter>
14300 for ::fidl_fuchsia_component_sandbox::DataRouterMarker
14301 {
14302 #[inline]
14303 fn from(_: crate::DataRouter) -> Self {
14304 Self
14305 }
14306 }
14307
14308 #[cfg(target_os = "fuchsia")]
14309 pub type DictionaryProxy =
14312 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Dictionary>;
14313
14314 impl ::core::convert::From<crate::Dictionary>
14315 for ::fidl_fuchsia_component_sandbox::DictionaryMarker
14316 {
14317 #[inline]
14318 fn from(_: crate::Dictionary) -> Self {
14319 Self
14320 }
14321 }
14322
14323 #[cfg(target_os = "fuchsia")]
14324 pub type DictionaryDrainIteratorProxy = ::fidl_next::ClientSender<
14327 ::fidl_next::fuchsia::zx::Channel,
14328 crate::DictionaryDrainIterator,
14329 >;
14330
14331 impl ::core::convert::From<crate::DictionaryDrainIterator>
14332 for ::fidl_fuchsia_component_sandbox::DictionaryDrainIteratorMarker
14333 {
14334 #[inline]
14335 fn from(_: crate::DictionaryDrainIterator) -> Self {
14336 Self
14337 }
14338 }
14339
14340 #[cfg(target_os = "fuchsia")]
14341 pub type DictionaryEnumerateIteratorProxy = ::fidl_next::ClientSender<
14344 ::fidl_next::fuchsia::zx::Channel,
14345 crate::DictionaryEnumerateIterator,
14346 >;
14347
14348 impl ::core::convert::From<crate::DictionaryEnumerateIterator>
14349 for ::fidl_fuchsia_component_sandbox::DictionaryEnumerateIteratorMarker
14350 {
14351 #[inline]
14352 fn from(_: crate::DictionaryEnumerateIterator) -> Self {
14353 Self
14354 }
14355 }
14356
14357 impl ::core::convert::From<crate::DictionaryError>
14358 for ::fidl_fuchsia_component_sandbox::DictionaryError
14359 {
14360 #[inline]
14361 fn from(from: crate::DictionaryError) -> Self {
14362 match crate::DictionaryError::from(from) {
14363 crate::DictionaryError::NotFound => Self::NotFound,
14364
14365 crate::DictionaryError::AlreadyExists => Self::AlreadyExists,
14366
14367 crate::DictionaryError::BadCapability => Self::BadCapability,
14368
14369 crate::DictionaryError::InvalidKey => Self::InvalidKey,
14370
14371 crate::DictionaryError::NotCloneable => Self::NotCloneable,
14372
14373 crate::DictionaryError::UnknownOrdinal_(value) => {
14374 Self::__SourceBreaking { unknown_ordinal: value }
14375 }
14376 }
14377 }
14378 }
14379
14380 #[cfg(target_os = "fuchsia")]
14381 pub type DictionaryKeysIteratorProxy =
14384 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DictionaryKeysIterator>;
14385
14386 impl ::core::convert::From<crate::DictionaryKeysIterator>
14387 for ::fidl_fuchsia_component_sandbox::DictionaryKeysIteratorMarker
14388 {
14389 #[inline]
14390 fn from(_: crate::DictionaryKeysIterator) -> Self {
14391 Self
14392 }
14393 }
14394
14395 #[cfg(target_os = "fuchsia")]
14396 pub type DictionaryRouterProxy =
14399 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DictionaryRouter>;
14400
14401 impl ::core::convert::From<crate::DictionaryRouter>
14402 for ::fidl_fuchsia_component_sandbox::DictionaryRouterMarker
14403 {
14404 #[inline]
14405 fn from(_: crate::DictionaryRouter) -> Self {
14406 Self
14407 }
14408 }
14409
14410 #[cfg(target_os = "fuchsia")]
14411 pub type DirConnectorRouterProxy =
14414 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirConnectorRouter>;
14415
14416 impl ::core::convert::From<crate::DirConnectorRouter>
14417 for ::fidl_fuchsia_component_sandbox::DirConnectorRouterMarker
14418 {
14419 #[inline]
14420 fn from(_: crate::DirConnectorRouter) -> Self {
14421 Self
14422 }
14423 }
14424
14425 #[cfg(target_os = "fuchsia")]
14426 pub type DirEntryRouterProxy =
14429 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirEntryRouter>;
14430
14431 impl ::core::convert::From<crate::DirEntryRouter>
14432 for ::fidl_fuchsia_component_sandbox::DirEntryRouterMarker
14433 {
14434 #[inline]
14435 fn from(_: crate::DirEntryRouter) -> Self {
14436 Self
14437 }
14438 }
14439
14440 #[cfg(target_os = "fuchsia")]
14441 pub type DirReceiverProxy =
14444 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirReceiver>;
14445
14446 impl ::core::convert::From<crate::DirReceiver>
14447 for ::fidl_fuchsia_component_sandbox::DirReceiverMarker
14448 {
14449 #[inline]
14450 fn from(_: crate::DirReceiver) -> Self {
14451 Self
14452 }
14453 }
14454
14455 #[cfg(target_os = "fuchsia")]
14456 pub type DirectoryRouterProxy =
14459 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirectoryRouter>;
14460
14461 impl ::core::convert::From<crate::DirectoryRouter>
14462 for ::fidl_fuchsia_component_sandbox::DirectoryRouterMarker
14463 {
14464 #[inline]
14465 fn from(_: crate::DirectoryRouter) -> Self {
14466 Self
14467 }
14468 }
14469
14470 #[cfg(target_os = "fuchsia")]
14471 pub type ReceiverProxy =
14474 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Receiver>;
14475
14476 impl ::core::convert::From<crate::Receiver> for ::fidl_fuchsia_component_sandbox::ReceiverMarker {
14477 #[inline]
14478 fn from(_: crate::Receiver) -> Self {
14479 Self
14480 }
14481 }
14482}