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::zx::Channel,
1248 ::fidl_next_fuchsia_io::Directory,
1249 >,
1250 ),
1251
1252 DirEntry(crate::DirEntry),
1253
1254 ConnectorRouter(
1255 ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::ConnectorRouter>,
1256 ),
1257
1258 DictionaryRouter(
1259 ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::DictionaryRouter>,
1260 ),
1261
1262 DirEntryRouter(
1263 ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::DirEntryRouter>,
1264 ),
1265
1266 DataRouter(::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::DataRouter>),
1267
1268 DirConnectorRouter(
1269 ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::DirConnectorRouter>,
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::zx::Channel,
1329 ::fidl_next_fuchsia_io::Directory,
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<::fidl_next::fuchsia::zx::Channel, crate::ConnectorRouter>,
1340 >(value, 9, encoder, raw)?,
1341
1342 Self::DictionaryRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1343 ___E,
1344 ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::DictionaryRouter>,
1345 >(value, 10, encoder, raw)?,
1346
1347 Self::DirEntryRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1348 ___E,
1349 ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::DirEntryRouter>,
1350 >(value, 11, encoder, raw)?,
1351
1352 Self::DataRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1353 ___E,
1354 ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::DataRouter>,
1355 >(value, 12, encoder, raw)?,
1356
1357 Self::DirConnectorRouter(value) => ::fidl_next::RawWireUnion::encode_as::<
1358 ___E,
1359 ::fidl_next::ClientEnd<
1360 ::fidl_next::fuchsia::zx::Channel,
1361 crate::DirConnectorRouter,
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::WireChannel,
1434 ::fidl_next_fuchsia_io::Directory,
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 ::fidl_next::fuchsia::WireChannel,
1445 crate::ConnectorRouter,
1446 >>()
1447 })),
1448
1449 10 => Self::DictionaryRouter(::fidl_next::FromWire::from_wire(unsafe {
1450 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1451 ::fidl_next::fuchsia::WireChannel,
1452 crate::DictionaryRouter,
1453 >>()
1454 })),
1455
1456 11 => Self::DirEntryRouter(::fidl_next::FromWire::from_wire(unsafe {
1457 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel,crate::DirEntryRouter,
1458 >>()
1459 })),
1460
1461 12 => Self::DataRouter(::fidl_next::FromWire::from_wire(unsafe {
1462 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel,crate::DataRouter,
1463 >>()
1464 })),
1465
1466 13 => Self::DirConnectorRouter(::fidl_next::FromWire::from_wire(unsafe {
1467 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1468 ::fidl_next::fuchsia::WireChannel,
1469 crate::DirConnectorRouter,
1470 >>()
1471 })),
1472
1473 _ => unsafe { ::core::hint::unreachable_unchecked() },
1474 }
1475 }
1476}
1477
1478impl<'de> ::fidl_next::FromWireOption<WireOptionalCapability<'de>> for Box<Capability> {
1479 #[inline]
1480 fn from_wire_option(wire: WireOptionalCapability<'de>) -> Option<Self> {
1481 if let Some(inner) = wire.into_option() {
1482 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
1483 } else {
1484 None
1485 }
1486 }
1487}
1488
1489#[repr(transparent)]
1491pub struct WireCapability<'de> {
1492 raw: ::fidl_next::RawWireUnion,
1493 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1494}
1495
1496impl<'de> Drop for WireCapability<'de> {
1497 fn drop(&mut self) {
1498 match self.raw.ordinal() {
1499 1 => {
1500 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
1501 }
1502
1503 2 => {
1504 let _ =
1505 unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireHandle>() };
1506 }
1507
1508 3 => {
1509 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireData<'de>>() };
1510 }
1511
1512 4 => {
1513 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDictionaryRef>() };
1514 }
1515
1516 5 => {
1517 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireConnector>() };
1518 }
1519
1520 6 => {
1521 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirConnector>() };
1522 }
1523
1524 7 => {
1525 let _ = unsafe {
1526 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1527 ::fidl_next::fuchsia::WireChannel,
1528 ::fidl_next_fuchsia_io::Directory,
1529 >>()
1530 };
1531 }
1532
1533 8 => {
1534 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirEntry>() };
1535 }
1536
1537 9 => {
1538 let _ = unsafe {
1539 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1540 ::fidl_next::fuchsia::WireChannel,
1541 crate::ConnectorRouter,
1542 >>()
1543 };
1544 }
1545
1546 10 => {
1547 let _ = unsafe {
1548 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1549 ::fidl_next::fuchsia::WireChannel,
1550 crate::DictionaryRouter,
1551 >>()
1552 };
1553 }
1554
1555 11 => {
1556 let _ = unsafe {
1557 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1558 ::fidl_next::fuchsia::WireChannel,
1559 crate::DirEntryRouter,
1560 >>()
1561 };
1562 }
1563
1564 12 => {
1565 let _ = unsafe {
1566 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel,crate::DataRouter,
1567 >>()
1568 };
1569 }
1570
1571 13 => {
1572 let _ = unsafe {
1573 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
1574 ::fidl_next::fuchsia::WireChannel,
1575 crate::DirConnectorRouter,
1576 >>()
1577 };
1578 }
1579
1580 _ => (),
1581 }
1582 }
1583}
1584
1585unsafe impl ::fidl_next::Wire for WireCapability<'static> {
1586 type Decoded<'de> = WireCapability<'de>;
1587
1588 #[inline]
1589 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1590 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1591 ::fidl_next::RawWireUnion::zero_padding(raw);
1592 }
1593}
1594
1595pub mod capability {
1596 pub enum Ref<'de> {
1597 Unit(&'de crate::WireUnit),
1598
1599 Handle(&'de ::fidl_next::fuchsia::WireHandle),
1600
1601 Data(&'de crate::WireData<'de>),
1602
1603 Dictionary(&'de crate::WireDictionaryRef),
1604
1605 Connector(&'de crate::WireConnector),
1606
1607 DirConnector(&'de crate::WireDirConnector),
1608
1609 Directory(
1610 &'de ::fidl_next::ClientEnd<
1611 ::fidl_next::fuchsia::WireChannel,
1612 ::fidl_next_fuchsia_io::Directory,
1613 >,
1614 ),
1615
1616 DirEntry(&'de crate::WireDirEntry),
1617
1618 ConnectorRouter(
1619 &'de ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::ConnectorRouter>,
1620 ),
1621
1622 DictionaryRouter(
1623 &'de ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DictionaryRouter>,
1624 ),
1625
1626 DirEntryRouter(
1627 &'de ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DirEntryRouter>,
1628 ),
1629
1630 DataRouter(
1631 &'de ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DataRouter>,
1632 ),
1633
1634 DirConnectorRouter(
1635 &'de ::fidl_next::ClientEnd<
1636 ::fidl_next::fuchsia::WireChannel,
1637 crate::DirConnectorRouter,
1638 >,
1639 ),
1640
1641 UnknownOrdinal_(u64),
1642 }
1643}
1644
1645impl<'de> WireCapability<'de> {
1646 pub fn as_ref(&self) -> crate::capability::Ref<'_> {
1647 match self.raw.ordinal() {
1648 1 => crate::capability::Ref::Unit(unsafe {
1649 self.raw.get().deref_unchecked::<crate::WireUnit>()
1650 }),
1651
1652 2 => crate::capability::Ref::Handle(unsafe {
1653 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>()
1654 }),
1655
1656 3 => crate::capability::Ref::Data(unsafe {
1657 self.raw.get().deref_unchecked::<crate::WireData<'_>>()
1658 }),
1659
1660 4 => crate::capability::Ref::Dictionary(unsafe {
1661 self.raw.get().deref_unchecked::<crate::WireDictionaryRef>()
1662 }),
1663
1664 5 => crate::capability::Ref::Connector(unsafe {
1665 self.raw.get().deref_unchecked::<crate::WireConnector>()
1666 }),
1667
1668 6 => crate::capability::Ref::DirConnector(unsafe {
1669 self.raw.get().deref_unchecked::<crate::WireDirConnector>()
1670 }),
1671
1672 7 => crate::capability::Ref::Directory(unsafe {
1673 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
1674 ::fidl_next::fuchsia::WireChannel,
1675 ::fidl_next_fuchsia_io::Directory,
1676 >>()
1677 }),
1678
1679 8 => crate::capability::Ref::DirEntry(unsafe {
1680 self.raw.get().deref_unchecked::<crate::WireDirEntry>()
1681 }),
1682
1683 9 => crate::capability::Ref::ConnectorRouter(unsafe {
1684 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
1685 ::fidl_next::fuchsia::WireChannel,
1686 crate::ConnectorRouter,
1687 >>()
1688 }),
1689
1690 10 => crate::capability::Ref::DictionaryRouter(unsafe {
1691 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
1692 ::fidl_next::fuchsia::WireChannel,
1693 crate::DictionaryRouter,
1694 >>()
1695 }),
1696
1697 11 => crate::capability::Ref::DirEntryRouter(unsafe {
1698 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel,crate::DirEntryRouter,
1699 >>()
1700 }),
1701
1702 12 => crate::capability::Ref::DataRouter(unsafe {
1703 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel,crate::DataRouter,
1704 >>()
1705 }),
1706
1707 13 => crate::capability::Ref::DirConnectorRouter(unsafe {
1708 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
1709 ::fidl_next::fuchsia::WireChannel,
1710 crate::DirConnectorRouter,
1711 >>()
1712 }),
1713
1714 unknown => crate::capability::Ref::UnknownOrdinal_(unknown),
1715 }
1716 }
1717}
1718
1719unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapability<'static>
1720where
1721 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1722
1723 ___D: ::fidl_next::Decoder,
1724
1725 ___D: ::fidl_next::fuchsia::HandleDecoder,
1726{
1727 fn decode(
1728 mut slot: ::fidl_next::Slot<'_, Self>,
1729 decoder: &mut ___D,
1730 ) -> Result<(), ::fidl_next::DecodeError> {
1731 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1732 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1733 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnit>(raw, decoder)?,
1734
1735 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
1736 raw, decoder,
1737 )?,
1738
1739 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireData<'static>>(
1740 raw, decoder,
1741 )?,
1742
1743 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionaryRef>(
1744 raw, decoder,
1745 )?,
1746
1747 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConnector>(raw, decoder)?,
1748
1749 6 => {
1750 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirConnector>(raw, decoder)?
1751 }
1752
1753 7 => ::fidl_next::RawWireUnion::decode_as::<
1754 ___D,
1755 ::fidl_next::ClientEnd<
1756 ::fidl_next::fuchsia::WireChannel,
1757 ::fidl_next_fuchsia_io::Directory,
1758 >,
1759 >(raw, decoder)?,
1760
1761 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirEntry>(raw, decoder)?,
1762
1763 9 => ::fidl_next::RawWireUnion::decode_as::<
1764 ___D,
1765 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::ConnectorRouter>,
1766 >(raw, decoder)?,
1767
1768 10 => ::fidl_next::RawWireUnion::decode_as::<
1769 ___D,
1770 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DictionaryRouter>,
1771 >(raw, decoder)?,
1772
1773 11 => ::fidl_next::RawWireUnion::decode_as::<
1774 ___D,
1775 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DirEntryRouter>,
1776 >(raw, decoder)?,
1777
1778 12 => ::fidl_next::RawWireUnion::decode_as::<
1779 ___D,
1780 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DataRouter>,
1781 >(raw, decoder)?,
1782
1783 13 => ::fidl_next::RawWireUnion::decode_as::<
1784 ___D,
1785 ::fidl_next::ClientEnd<
1786 ::fidl_next::fuchsia::WireChannel,
1787 crate::DirConnectorRouter,
1788 >,
1789 >(raw, decoder)?,
1790
1791 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
1792 }
1793
1794 Ok(())
1795 }
1796}
1797
1798impl<'de> ::core::fmt::Debug for WireCapability<'de> {
1799 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1800 match self.raw.ordinal() {
1801 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
1802 2 => unsafe {
1803 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireHandle>().fmt(f)
1804 },
1805 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireData<'_>>().fmt(f) },
1806 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireDictionaryRef>().fmt(f) },
1807 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireConnector>().fmt(f) },
1808 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirConnector>().fmt(f) },
1809 7 => unsafe {
1810 self.raw
1811 .get()
1812 .deref_unchecked::<::fidl_next::ClientEnd<
1813 ::fidl_next::fuchsia::WireChannel,
1814 ::fidl_next_fuchsia_io::Directory,
1815 >>()
1816 .fmt(f)
1817 },
1818 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirEntry>().fmt(f) },
1819 9 => unsafe {
1820 self.raw
1821 .get()
1822 .deref_unchecked::<::fidl_next::ClientEnd<
1823 ::fidl_next::fuchsia::WireChannel,
1824 crate::ConnectorRouter,
1825 >>()
1826 .fmt(f)
1827 },
1828 10 => unsafe {
1829 self.raw
1830 .get()
1831 .deref_unchecked::<::fidl_next::ClientEnd<
1832 ::fidl_next::fuchsia::WireChannel,
1833 crate::DictionaryRouter,
1834 >>()
1835 .fmt(f)
1836 },
1837 11 => unsafe {
1838 self.raw.get().deref_unchecked::<
1839 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel,crate::DirEntryRouter,
1840 >
1841 >().fmt(f)
1842 },
1843 12 => unsafe {
1844 self.raw.get().deref_unchecked::<
1845 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel,crate::DataRouter,
1846 >
1847 >().fmt(f)
1848 },
1849 13 => unsafe {
1850 self.raw
1851 .get()
1852 .deref_unchecked::<::fidl_next::ClientEnd<
1853 ::fidl_next::fuchsia::WireChannel,
1854 crate::DirConnectorRouter,
1855 >>()
1856 .fmt(f)
1857 },
1858 _ => unsafe { ::core::hint::unreachable_unchecked() },
1859 }
1860 }
1861}
1862
1863#[repr(transparent)]
1864pub struct WireOptionalCapability<'de> {
1865 raw: ::fidl_next::RawWireUnion,
1866 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1867}
1868
1869unsafe impl ::fidl_next::Wire for WireOptionalCapability<'static> {
1870 type Decoded<'de> = WireOptionalCapability<'de>;
1871
1872 #[inline]
1873 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1874 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1875 ::fidl_next::RawWireUnion::zero_padding(raw);
1876 }
1877}
1878
1879impl<'de> WireOptionalCapability<'de> {
1880 pub fn is_some(&self) -> bool {
1881 self.raw.is_some()
1882 }
1883
1884 pub fn is_none(&self) -> bool {
1885 self.raw.is_none()
1886 }
1887
1888 pub fn as_ref(&self) -> Option<&WireCapability<'de>> {
1889 if self.is_some() {
1890 Some(unsafe { &*(self as *const Self).cast() })
1891 } else {
1892 None
1893 }
1894 }
1895
1896 pub fn into_option(self) -> Option<WireCapability<'de>> {
1897 if self.is_some() {
1898 Some(WireCapability { raw: self.raw, _phantom: ::core::marker::PhantomData })
1899 } else {
1900 None
1901 }
1902 }
1903}
1904
1905unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalCapability<'static>
1906where
1907 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1908
1909 ___D: ::fidl_next::Decoder,
1910
1911 ___D: ::fidl_next::fuchsia::HandleDecoder,
1912{
1913 fn decode(
1914 mut slot: ::fidl_next::Slot<'_, Self>,
1915 decoder: &mut ___D,
1916 ) -> Result<(), ::fidl_next::DecodeError> {
1917 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1918 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1919 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnit>(raw, decoder)?,
1920
1921 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
1922 raw, decoder,
1923 )?,
1924
1925 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireData<'static>>(
1926 raw, decoder,
1927 )?,
1928
1929 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionaryRef>(
1930 raw, decoder,
1931 )?,
1932
1933 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConnector>(raw, decoder)?,
1934
1935 6 => {
1936 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirConnector>(raw, decoder)?
1937 }
1938
1939 7 => ::fidl_next::RawWireUnion::decode_as::<
1940 ___D,
1941 ::fidl_next::ClientEnd<
1942 ::fidl_next::fuchsia::WireChannel,
1943 ::fidl_next_fuchsia_io::Directory,
1944 >,
1945 >(raw, decoder)?,
1946
1947 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirEntry>(raw, decoder)?,
1948
1949 9 => ::fidl_next::RawWireUnion::decode_as::<
1950 ___D,
1951 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::ConnectorRouter>,
1952 >(raw, decoder)?,
1953
1954 10 => ::fidl_next::RawWireUnion::decode_as::<
1955 ___D,
1956 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DictionaryRouter>,
1957 >(raw, decoder)?,
1958
1959 11 => ::fidl_next::RawWireUnion::decode_as::<
1960 ___D,
1961 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DirEntryRouter>,
1962 >(raw, decoder)?,
1963
1964 12 => ::fidl_next::RawWireUnion::decode_as::<
1965 ___D,
1966 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DataRouter>,
1967 >(raw, decoder)?,
1968
1969 13 => ::fidl_next::RawWireUnion::decode_as::<
1970 ___D,
1971 ::fidl_next::ClientEnd<
1972 ::fidl_next::fuchsia::WireChannel,
1973 crate::DirConnectorRouter,
1974 >,
1975 >(raw, decoder)?,
1976
1977 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
1978 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
1979 }
1980
1981 Ok(())
1982 }
1983}
1984
1985impl<'de> ::core::fmt::Debug for WireOptionalCapability<'de> {
1986 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1987 self.as_ref().fmt(f)
1988 }
1989}
1990
1991#[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"]
1992pub type CapabilityId = u64;
1993
1994pub type WireCapabilityId = ::fidl_next::WireU64;
1996
1997#[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"]
1998pub type NewCapabilityId = u64;
1999
2000pub type WireNewCapabilityId = ::fidl_next::WireU64;
2002
2003#[derive(Clone, Debug)]
2004#[repr(C)]
2005pub struct CapabilityStoreDuplicateRequest {
2006 pub id: u64,
2007
2008 pub dest_id: u64,
2009}
2010
2011impl ::fidl_next::Encodable for CapabilityStoreDuplicateRequest {
2012 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2013 Self,
2014 WireCapabilityStoreDuplicateRequest,
2015 > = unsafe {
2016 ::fidl_next::CopyOptimization::enable_if(
2017 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
2018 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2019 )
2020 };
2021
2022 type Encoded = WireCapabilityStoreDuplicateRequest;
2023}
2024
2025unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDuplicateRequest
2026where
2027 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2028{
2029 #[inline]
2030 fn encode(
2031 self,
2032 encoder: &mut ___E,
2033 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2034 ) -> Result<(), ::fidl_next::EncodeError> {
2035 ::fidl_next::munge! {
2036 let Self::Encoded {
2037 id,
2038 dest_id,
2039
2040 } = out;
2041 }
2042
2043 ::fidl_next::Encode::encode(self.id, encoder, id)?;
2044
2045 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
2046
2047 Ok(())
2048 }
2049}
2050
2051unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDuplicateRequest
2052where
2053 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2054{
2055 #[inline]
2056 fn encode_ref(
2057 &self,
2058 encoder: &mut ___E,
2059 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2060 ) -> Result<(), ::fidl_next::EncodeError> {
2061 ::fidl_next::munge! {
2062 let Self::Encoded {
2063 id,
2064 dest_id,
2065
2066 } = out;
2067 }
2068
2069 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
2070
2071 ::fidl_next::EncodeRef::encode_ref(&self.dest_id, encoder, dest_id)?;
2072
2073 Ok(())
2074 }
2075}
2076
2077impl ::fidl_next::EncodableOption for CapabilityStoreDuplicateRequest {
2078 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDuplicateRequest>;
2079}
2080
2081unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDuplicateRequest
2082where
2083 ___E: ::fidl_next::Encoder + ?Sized,
2084 CapabilityStoreDuplicateRequest: ::fidl_next::Encode<___E>,
2085{
2086 #[inline]
2087 fn encode_option(
2088 this: Option<Self>,
2089 encoder: &mut ___E,
2090 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2091 ) -> Result<(), ::fidl_next::EncodeError> {
2092 if let Some(inner) = this {
2093 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2094 ::fidl_next::WireBox::encode_present(out);
2095 } else {
2096 ::fidl_next::WireBox::encode_absent(out);
2097 }
2098
2099 Ok(())
2100 }
2101}
2102
2103unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDuplicateRequest
2104where
2105 ___E: ::fidl_next::Encoder + ?Sized,
2106 CapabilityStoreDuplicateRequest: ::fidl_next::EncodeRef<___E>,
2107{
2108 #[inline]
2109 fn encode_option_ref(
2110 this: Option<&Self>,
2111 encoder: &mut ___E,
2112 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2113 ) -> Result<(), ::fidl_next::EncodeError> {
2114 if let Some(inner) = this {
2115 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2116 ::fidl_next::WireBox::encode_present(out);
2117 } else {
2118 ::fidl_next::WireBox::encode_absent(out);
2119 }
2120
2121 Ok(())
2122 }
2123}
2124
2125impl ::fidl_next::FromWire<WireCapabilityStoreDuplicateRequest>
2126 for CapabilityStoreDuplicateRequest
2127{
2128 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2129 WireCapabilityStoreDuplicateRequest,
2130 Self,
2131 > = unsafe {
2132 ::fidl_next::CopyOptimization::enable_if(
2133 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2134 .is_enabled()
2135 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2136 .is_enabled(),
2137 )
2138 };
2139
2140 #[inline]
2141 fn from_wire(wire: WireCapabilityStoreDuplicateRequest) -> Self {
2142 Self {
2143 id: ::fidl_next::FromWire::from_wire(wire.id),
2144
2145 dest_id: ::fidl_next::FromWire::from_wire(wire.dest_id),
2146 }
2147 }
2148}
2149
2150impl ::fidl_next::FromWireRef<WireCapabilityStoreDuplicateRequest>
2151 for CapabilityStoreDuplicateRequest
2152{
2153 #[inline]
2154 fn from_wire_ref(wire: &WireCapabilityStoreDuplicateRequest) -> Self {
2155 Self {
2156 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
2157
2158 dest_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.dest_id),
2159 }
2160 }
2161}
2162
2163#[derive(Clone, Debug)]
2165#[repr(C)]
2166pub struct WireCapabilityStoreDuplicateRequest {
2167 pub id: ::fidl_next::WireU64,
2168
2169 pub dest_id: ::fidl_next::WireU64,
2170}
2171
2172unsafe impl ::fidl_next::Wire for WireCapabilityStoreDuplicateRequest {
2173 type Decoded<'de> = WireCapabilityStoreDuplicateRequest;
2174
2175 #[inline]
2176 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2177}
2178
2179unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDuplicateRequest
2180where
2181 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2182{
2183 fn decode(
2184 slot: ::fidl_next::Slot<'_, Self>,
2185 decoder: &mut ___D,
2186 ) -> Result<(), ::fidl_next::DecodeError> {
2187 ::fidl_next::munge! {
2188 let Self {
2189 mut id,
2190 mut dest_id,
2191
2192 } = slot;
2193 }
2194
2195 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
2196
2197 ::fidl_next::Decode::decode(dest_id.as_mut(), decoder)?;
2198
2199 Ok(())
2200 }
2201}
2202
2203pub type CapabilityStoreDuplicateResponse = ();
2204
2205pub type WireCapabilityStoreDuplicateResponse = ();
2207
2208#[doc = " Error returned from methods in [CapabilityStore].\n"]
2209#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2210#[repr(u32)]
2211pub enum CapabilityStoreError {
2212 IdNotFound = 1,
2213 IdAlreadyExists = 2,
2214 BadCapability = 3,
2215 WrongType = 4,
2216 NotDuplicatable = 5,
2217 ItemNotFound = 6,
2218 ItemAlreadyExists = 7,
2219 InvalidKey = 8,
2220 InvalidArgs = 9,
2221 UnknownOrdinal_(u32),
2222}
2223
2224impl ::fidl_next::Encodable for CapabilityStoreError {
2225 type Encoded = WireCapabilityStoreError;
2226}
2227impl ::std::convert::From<u32> for CapabilityStoreError {
2228 fn from(value: u32) -> Self {
2229 match value {
2230 1 => Self::IdNotFound,
2231 2 => Self::IdAlreadyExists,
2232 3 => Self::BadCapability,
2233 4 => Self::WrongType,
2234 5 => Self::NotDuplicatable,
2235 6 => Self::ItemNotFound,
2236 7 => Self::ItemAlreadyExists,
2237 8 => Self::InvalidKey,
2238 9 => Self::InvalidArgs,
2239
2240 _ => Self::UnknownOrdinal_(value),
2241 }
2242 }
2243}
2244
2245unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreError
2246where
2247 ___E: ?Sized,
2248{
2249 #[inline]
2250 fn encode(
2251 self,
2252 encoder: &mut ___E,
2253 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2254 ) -> Result<(), ::fidl_next::EncodeError> {
2255 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2256 }
2257}
2258
2259unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreError
2260where
2261 ___E: ?Sized,
2262{
2263 #[inline]
2264 fn encode_ref(
2265 &self,
2266 encoder: &mut ___E,
2267 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2268 ) -> Result<(), ::fidl_next::EncodeError> {
2269 ::fidl_next::munge!(let WireCapabilityStoreError { value } = out);
2270 let _ = value.write(::fidl_next::WireU32::from(match *self {
2271 Self::IdNotFound => 1,
2272
2273 Self::IdAlreadyExists => 2,
2274
2275 Self::BadCapability => 3,
2276
2277 Self::WrongType => 4,
2278
2279 Self::NotDuplicatable => 5,
2280
2281 Self::ItemNotFound => 6,
2282
2283 Self::ItemAlreadyExists => 7,
2284
2285 Self::InvalidKey => 8,
2286
2287 Self::InvalidArgs => 9,
2288
2289 Self::UnknownOrdinal_(value) => value,
2290 }));
2291
2292 Ok(())
2293 }
2294}
2295
2296impl ::core::convert::From<WireCapabilityStoreError> for CapabilityStoreError {
2297 fn from(wire: WireCapabilityStoreError) -> Self {
2298 match u32::from(wire.value) {
2299 1 => Self::IdNotFound,
2300
2301 2 => Self::IdAlreadyExists,
2302
2303 3 => Self::BadCapability,
2304
2305 4 => Self::WrongType,
2306
2307 5 => Self::NotDuplicatable,
2308
2309 6 => Self::ItemNotFound,
2310
2311 7 => Self::ItemAlreadyExists,
2312
2313 8 => Self::InvalidKey,
2314
2315 9 => Self::InvalidArgs,
2316
2317 value => Self::UnknownOrdinal_(value),
2318 }
2319 }
2320}
2321
2322impl ::fidl_next::FromWire<WireCapabilityStoreError> for CapabilityStoreError {
2323 #[inline]
2324 fn from_wire(wire: WireCapabilityStoreError) -> Self {
2325 Self::from(wire)
2326 }
2327}
2328
2329impl ::fidl_next::FromWireRef<WireCapabilityStoreError> for CapabilityStoreError {
2330 #[inline]
2331 fn from_wire_ref(wire: &WireCapabilityStoreError) -> Self {
2332 Self::from(*wire)
2333 }
2334}
2335
2336#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2338#[repr(transparent)]
2339pub struct WireCapabilityStoreError {
2340 value: ::fidl_next::WireU32,
2341}
2342
2343unsafe impl ::fidl_next::Wire for WireCapabilityStoreError {
2344 type Decoded<'de> = Self;
2345
2346 #[inline]
2347 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2348 }
2350}
2351
2352impl WireCapabilityStoreError {
2353 pub const ID_NOT_FOUND: WireCapabilityStoreError =
2354 WireCapabilityStoreError { value: ::fidl_next::WireU32(1) };
2355
2356 pub const ID_ALREADY_EXISTS: WireCapabilityStoreError =
2357 WireCapabilityStoreError { value: ::fidl_next::WireU32(2) };
2358
2359 pub const BAD_CAPABILITY: WireCapabilityStoreError =
2360 WireCapabilityStoreError { value: ::fidl_next::WireU32(3) };
2361
2362 pub const WRONG_TYPE: WireCapabilityStoreError =
2363 WireCapabilityStoreError { value: ::fidl_next::WireU32(4) };
2364
2365 pub const NOT_DUPLICATABLE: WireCapabilityStoreError =
2366 WireCapabilityStoreError { value: ::fidl_next::WireU32(5) };
2367
2368 pub const ITEM_NOT_FOUND: WireCapabilityStoreError =
2369 WireCapabilityStoreError { value: ::fidl_next::WireU32(6) };
2370
2371 pub const ITEM_ALREADY_EXISTS: WireCapabilityStoreError =
2372 WireCapabilityStoreError { value: ::fidl_next::WireU32(7) };
2373
2374 pub const INVALID_KEY: WireCapabilityStoreError =
2375 WireCapabilityStoreError { value: ::fidl_next::WireU32(8) };
2376
2377 pub const INVALID_ARGS: WireCapabilityStoreError =
2378 WireCapabilityStoreError { value: ::fidl_next::WireU32(9) };
2379}
2380
2381unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreError
2382where
2383 ___D: ?Sized,
2384{
2385 fn decode(
2386 slot: ::fidl_next::Slot<'_, Self>,
2387 _: &mut ___D,
2388 ) -> Result<(), ::fidl_next::DecodeError> {
2389 Ok(())
2390 }
2391}
2392
2393impl ::core::convert::From<CapabilityStoreError> for WireCapabilityStoreError {
2394 fn from(natural: CapabilityStoreError) -> Self {
2395 match natural {
2396 CapabilityStoreError::IdNotFound => WireCapabilityStoreError::ID_NOT_FOUND,
2397
2398 CapabilityStoreError::IdAlreadyExists => WireCapabilityStoreError::ID_ALREADY_EXISTS,
2399
2400 CapabilityStoreError::BadCapability => WireCapabilityStoreError::BAD_CAPABILITY,
2401
2402 CapabilityStoreError::WrongType => WireCapabilityStoreError::WRONG_TYPE,
2403
2404 CapabilityStoreError::NotDuplicatable => WireCapabilityStoreError::NOT_DUPLICATABLE,
2405
2406 CapabilityStoreError::ItemNotFound => WireCapabilityStoreError::ITEM_NOT_FOUND,
2407
2408 CapabilityStoreError::ItemAlreadyExists => {
2409 WireCapabilityStoreError::ITEM_ALREADY_EXISTS
2410 }
2411
2412 CapabilityStoreError::InvalidKey => WireCapabilityStoreError::INVALID_KEY,
2413
2414 CapabilityStoreError::InvalidArgs => WireCapabilityStoreError::INVALID_ARGS,
2415
2416 CapabilityStoreError::UnknownOrdinal_(value) => {
2417 WireCapabilityStoreError { value: ::fidl_next::WireU32::from(value) }
2418 }
2419 }
2420 }
2421}
2422
2423#[derive(Clone, Debug)]
2424#[repr(C)]
2425pub struct CapabilityStoreDropRequest {
2426 pub id: u64,
2427}
2428
2429impl ::fidl_next::Encodable for CapabilityStoreDropRequest {
2430 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCapabilityStoreDropRequest> = unsafe {
2431 ::fidl_next::CopyOptimization::enable_if(
2432 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2433 )
2434 };
2435
2436 type Encoded = WireCapabilityStoreDropRequest;
2437}
2438
2439unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDropRequest
2440where
2441 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2442{
2443 #[inline]
2444 fn encode(
2445 self,
2446 encoder: &mut ___E,
2447 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2448 ) -> Result<(), ::fidl_next::EncodeError> {
2449 ::fidl_next::munge! {
2450 let Self::Encoded {
2451 id,
2452
2453 } = out;
2454 }
2455
2456 ::fidl_next::Encode::encode(self.id, encoder, id)?;
2457
2458 Ok(())
2459 }
2460}
2461
2462unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDropRequest
2463where
2464 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2465{
2466 #[inline]
2467 fn encode_ref(
2468 &self,
2469 encoder: &mut ___E,
2470 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2471 ) -> Result<(), ::fidl_next::EncodeError> {
2472 ::fidl_next::munge! {
2473 let Self::Encoded {
2474 id,
2475
2476 } = out;
2477 }
2478
2479 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
2480
2481 Ok(())
2482 }
2483}
2484
2485impl ::fidl_next::EncodableOption for CapabilityStoreDropRequest {
2486 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDropRequest>;
2487}
2488
2489unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDropRequest
2490where
2491 ___E: ::fidl_next::Encoder + ?Sized,
2492 CapabilityStoreDropRequest: ::fidl_next::Encode<___E>,
2493{
2494 #[inline]
2495 fn encode_option(
2496 this: Option<Self>,
2497 encoder: &mut ___E,
2498 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2499 ) -> Result<(), ::fidl_next::EncodeError> {
2500 if let Some(inner) = this {
2501 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2502 ::fidl_next::WireBox::encode_present(out);
2503 } else {
2504 ::fidl_next::WireBox::encode_absent(out);
2505 }
2506
2507 Ok(())
2508 }
2509}
2510
2511unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDropRequest
2512where
2513 ___E: ::fidl_next::Encoder + ?Sized,
2514 CapabilityStoreDropRequest: ::fidl_next::EncodeRef<___E>,
2515{
2516 #[inline]
2517 fn encode_option_ref(
2518 this: Option<&Self>,
2519 encoder: &mut ___E,
2520 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2521 ) -> Result<(), ::fidl_next::EncodeError> {
2522 if let Some(inner) = this {
2523 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2524 ::fidl_next::WireBox::encode_present(out);
2525 } else {
2526 ::fidl_next::WireBox::encode_absent(out);
2527 }
2528
2529 Ok(())
2530 }
2531}
2532
2533impl ::fidl_next::FromWire<WireCapabilityStoreDropRequest> for CapabilityStoreDropRequest {
2534 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCapabilityStoreDropRequest, Self> = unsafe {
2535 ::fidl_next::CopyOptimization::enable_if(
2536 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2537 .is_enabled(),
2538 )
2539 };
2540
2541 #[inline]
2542 fn from_wire(wire: WireCapabilityStoreDropRequest) -> Self {
2543 Self { id: ::fidl_next::FromWire::from_wire(wire.id) }
2544 }
2545}
2546
2547impl ::fidl_next::FromWireRef<WireCapabilityStoreDropRequest> for CapabilityStoreDropRequest {
2548 #[inline]
2549 fn from_wire_ref(wire: &WireCapabilityStoreDropRequest) -> Self {
2550 Self { id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id) }
2551 }
2552}
2553
2554#[derive(Clone, Debug)]
2556#[repr(C)]
2557pub struct WireCapabilityStoreDropRequest {
2558 pub id: ::fidl_next::WireU64,
2559}
2560
2561unsafe impl ::fidl_next::Wire for WireCapabilityStoreDropRequest {
2562 type Decoded<'de> = WireCapabilityStoreDropRequest;
2563
2564 #[inline]
2565 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2566}
2567
2568unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDropRequest
2569where
2570 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2571{
2572 fn decode(
2573 slot: ::fidl_next::Slot<'_, Self>,
2574 decoder: &mut ___D,
2575 ) -> Result<(), ::fidl_next::DecodeError> {
2576 ::fidl_next::munge! {
2577 let Self {
2578 mut id,
2579
2580 } = slot;
2581 }
2582
2583 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
2584
2585 Ok(())
2586 }
2587}
2588
2589pub type CapabilityStoreDropResponse = ();
2590
2591pub type WireCapabilityStoreDropResponse = ();
2593
2594#[derive(Clone, Debug)]
2595#[repr(C)]
2596pub struct CapabilityStoreExportRequest {
2597 pub id: u64,
2598}
2599
2600impl ::fidl_next::Encodable for CapabilityStoreExportRequest {
2601 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCapabilityStoreExportRequest> = unsafe {
2602 ::fidl_next::CopyOptimization::enable_if(
2603 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
2604 )
2605 };
2606
2607 type Encoded = WireCapabilityStoreExportRequest;
2608}
2609
2610unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreExportRequest
2611where
2612 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2613{
2614 #[inline]
2615 fn encode(
2616 self,
2617 encoder: &mut ___E,
2618 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2619 ) -> Result<(), ::fidl_next::EncodeError> {
2620 ::fidl_next::munge! {
2621 let Self::Encoded {
2622 id,
2623
2624 } = out;
2625 }
2626
2627 ::fidl_next::Encode::encode(self.id, encoder, id)?;
2628
2629 Ok(())
2630 }
2631}
2632
2633unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreExportRequest
2634where
2635 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2636{
2637 #[inline]
2638 fn encode_ref(
2639 &self,
2640 encoder: &mut ___E,
2641 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2642 ) -> Result<(), ::fidl_next::EncodeError> {
2643 ::fidl_next::munge! {
2644 let Self::Encoded {
2645 id,
2646
2647 } = out;
2648 }
2649
2650 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
2651
2652 Ok(())
2653 }
2654}
2655
2656impl ::fidl_next::EncodableOption for CapabilityStoreExportRequest {
2657 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreExportRequest>;
2658}
2659
2660unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreExportRequest
2661where
2662 ___E: ::fidl_next::Encoder + ?Sized,
2663 CapabilityStoreExportRequest: ::fidl_next::Encode<___E>,
2664{
2665 #[inline]
2666 fn encode_option(
2667 this: Option<Self>,
2668 encoder: &mut ___E,
2669 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2670 ) -> Result<(), ::fidl_next::EncodeError> {
2671 if let Some(inner) = this {
2672 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2673 ::fidl_next::WireBox::encode_present(out);
2674 } else {
2675 ::fidl_next::WireBox::encode_absent(out);
2676 }
2677
2678 Ok(())
2679 }
2680}
2681
2682unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreExportRequest
2683where
2684 ___E: ::fidl_next::Encoder + ?Sized,
2685 CapabilityStoreExportRequest: ::fidl_next::EncodeRef<___E>,
2686{
2687 #[inline]
2688 fn encode_option_ref(
2689 this: Option<&Self>,
2690 encoder: &mut ___E,
2691 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2692 ) -> Result<(), ::fidl_next::EncodeError> {
2693 if let Some(inner) = this {
2694 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2695 ::fidl_next::WireBox::encode_present(out);
2696 } else {
2697 ::fidl_next::WireBox::encode_absent(out);
2698 }
2699
2700 Ok(())
2701 }
2702}
2703
2704impl ::fidl_next::FromWire<WireCapabilityStoreExportRequest> for CapabilityStoreExportRequest {
2705 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCapabilityStoreExportRequest, Self> = unsafe {
2706 ::fidl_next::CopyOptimization::enable_if(
2707 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
2708 .is_enabled(),
2709 )
2710 };
2711
2712 #[inline]
2713 fn from_wire(wire: WireCapabilityStoreExportRequest) -> Self {
2714 Self { id: ::fidl_next::FromWire::from_wire(wire.id) }
2715 }
2716}
2717
2718impl ::fidl_next::FromWireRef<WireCapabilityStoreExportRequest> for CapabilityStoreExportRequest {
2719 #[inline]
2720 fn from_wire_ref(wire: &WireCapabilityStoreExportRequest) -> Self {
2721 Self { id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id) }
2722 }
2723}
2724
2725#[derive(Clone, Debug)]
2727#[repr(C)]
2728pub struct WireCapabilityStoreExportRequest {
2729 pub id: ::fidl_next::WireU64,
2730}
2731
2732unsafe impl ::fidl_next::Wire for WireCapabilityStoreExportRequest {
2733 type Decoded<'de> = WireCapabilityStoreExportRequest;
2734
2735 #[inline]
2736 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2737}
2738
2739unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreExportRequest
2740where
2741 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2742{
2743 fn decode(
2744 slot: ::fidl_next::Slot<'_, Self>,
2745 decoder: &mut ___D,
2746 ) -> Result<(), ::fidl_next::DecodeError> {
2747 ::fidl_next::munge! {
2748 let Self {
2749 mut id,
2750
2751 } = slot;
2752 }
2753
2754 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
2755
2756 Ok(())
2757 }
2758}
2759
2760#[derive(Debug)]
2761pub struct CapabilityStoreExportResponse {
2762 pub capability: crate::Capability,
2763}
2764
2765impl ::fidl_next::Encodable for CapabilityStoreExportResponse {
2766 type Encoded = WireCapabilityStoreExportResponse<'static>;
2767}
2768
2769unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreExportResponse
2770where
2771 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2772
2773 ___E: ::fidl_next::Encoder,
2774
2775 ___E: ::fidl_next::fuchsia::HandleEncoder,
2776{
2777 #[inline]
2778 fn encode(
2779 self,
2780 encoder: &mut ___E,
2781 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2782 ) -> Result<(), ::fidl_next::EncodeError> {
2783 ::fidl_next::munge! {
2784 let Self::Encoded {
2785 capability,
2786
2787 } = out;
2788 }
2789
2790 ::fidl_next::Encode::encode(self.capability, encoder, capability)?;
2791
2792 Ok(())
2793 }
2794}
2795
2796impl ::fidl_next::EncodableOption for CapabilityStoreExportResponse {
2797 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreExportResponse<'static>>;
2798}
2799
2800unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreExportResponse
2801where
2802 ___E: ::fidl_next::Encoder + ?Sized,
2803 CapabilityStoreExportResponse: ::fidl_next::Encode<___E>,
2804{
2805 #[inline]
2806 fn encode_option(
2807 this: Option<Self>,
2808 encoder: &mut ___E,
2809 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2810 ) -> Result<(), ::fidl_next::EncodeError> {
2811 if let Some(inner) = this {
2812 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2813 ::fidl_next::WireBox::encode_present(out);
2814 } else {
2815 ::fidl_next::WireBox::encode_absent(out);
2816 }
2817
2818 Ok(())
2819 }
2820}
2821
2822impl<'de> ::fidl_next::FromWire<WireCapabilityStoreExportResponse<'de>>
2823 for CapabilityStoreExportResponse
2824{
2825 #[inline]
2826 fn from_wire(wire: WireCapabilityStoreExportResponse<'de>) -> Self {
2827 Self { capability: ::fidl_next::FromWire::from_wire(wire.capability) }
2828 }
2829}
2830
2831#[derive(Debug)]
2833#[repr(C)]
2834pub struct WireCapabilityStoreExportResponse<'de> {
2835 pub capability: crate::WireCapability<'de>,
2836}
2837
2838unsafe impl ::fidl_next::Wire for WireCapabilityStoreExportResponse<'static> {
2839 type Decoded<'de> = WireCapabilityStoreExportResponse<'de>;
2840
2841 #[inline]
2842 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2843}
2844
2845unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreExportResponse<'static>
2846where
2847 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2848
2849 ___D: ::fidl_next::Decoder,
2850
2851 ___D: ::fidl_next::fuchsia::HandleDecoder,
2852{
2853 fn decode(
2854 slot: ::fidl_next::Slot<'_, Self>,
2855 decoder: &mut ___D,
2856 ) -> Result<(), ::fidl_next::DecodeError> {
2857 ::fidl_next::munge! {
2858 let Self {
2859 mut capability,
2860
2861 } = slot;
2862 }
2863
2864 ::fidl_next::Decode::decode(capability.as_mut(), decoder)?;
2865
2866 Ok(())
2867 }
2868}
2869
2870#[derive(Debug)]
2871pub struct CapabilityStoreImportRequest {
2872 pub id: u64,
2873
2874 pub capability: crate::Capability,
2875}
2876
2877impl ::fidl_next::Encodable for CapabilityStoreImportRequest {
2878 type Encoded = WireCapabilityStoreImportRequest<'static>;
2879}
2880
2881unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreImportRequest
2882where
2883 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2884
2885 ___E: ::fidl_next::Encoder,
2886
2887 ___E: ::fidl_next::fuchsia::HandleEncoder,
2888{
2889 #[inline]
2890 fn encode(
2891 self,
2892 encoder: &mut ___E,
2893 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2894 ) -> Result<(), ::fidl_next::EncodeError> {
2895 ::fidl_next::munge! {
2896 let Self::Encoded {
2897 id,
2898 capability,
2899
2900 } = out;
2901 }
2902
2903 ::fidl_next::Encode::encode(self.id, encoder, id)?;
2904
2905 ::fidl_next::Encode::encode(self.capability, encoder, capability)?;
2906
2907 Ok(())
2908 }
2909}
2910
2911impl ::fidl_next::EncodableOption for CapabilityStoreImportRequest {
2912 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreImportRequest<'static>>;
2913}
2914
2915unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreImportRequest
2916where
2917 ___E: ::fidl_next::Encoder + ?Sized,
2918 CapabilityStoreImportRequest: ::fidl_next::Encode<___E>,
2919{
2920 #[inline]
2921 fn encode_option(
2922 this: Option<Self>,
2923 encoder: &mut ___E,
2924 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2925 ) -> Result<(), ::fidl_next::EncodeError> {
2926 if let Some(inner) = this {
2927 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2928 ::fidl_next::WireBox::encode_present(out);
2929 } else {
2930 ::fidl_next::WireBox::encode_absent(out);
2931 }
2932
2933 Ok(())
2934 }
2935}
2936
2937impl<'de> ::fidl_next::FromWire<WireCapabilityStoreImportRequest<'de>>
2938 for CapabilityStoreImportRequest
2939{
2940 #[inline]
2941 fn from_wire(wire: WireCapabilityStoreImportRequest<'de>) -> Self {
2942 Self {
2943 id: ::fidl_next::FromWire::from_wire(wire.id),
2944
2945 capability: ::fidl_next::FromWire::from_wire(wire.capability),
2946 }
2947 }
2948}
2949
2950#[derive(Debug)]
2952#[repr(C)]
2953pub struct WireCapabilityStoreImportRequest<'de> {
2954 pub id: ::fidl_next::WireU64,
2955
2956 pub capability: crate::WireCapability<'de>,
2957}
2958
2959unsafe impl ::fidl_next::Wire for WireCapabilityStoreImportRequest<'static> {
2960 type Decoded<'de> = WireCapabilityStoreImportRequest<'de>;
2961
2962 #[inline]
2963 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2964}
2965
2966unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreImportRequest<'static>
2967where
2968 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2969
2970 ___D: ::fidl_next::Decoder,
2971
2972 ___D: ::fidl_next::fuchsia::HandleDecoder,
2973{
2974 fn decode(
2975 slot: ::fidl_next::Slot<'_, Self>,
2976 decoder: &mut ___D,
2977 ) -> Result<(), ::fidl_next::DecodeError> {
2978 ::fidl_next::munge! {
2979 let Self {
2980 mut id,
2981 mut capability,
2982
2983 } = slot;
2984 }
2985
2986 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
2987
2988 ::fidl_next::Decode::decode(capability.as_mut(), decoder)?;
2989
2990 Ok(())
2991 }
2992}
2993
2994pub type CapabilityStoreImportResponse = ();
2995
2996pub type WireCapabilityStoreImportResponse = ();
2998
2999#[derive(Debug)]
3000pub struct CapabilityStoreConnectorCreateRequest {
3001 pub id: u64,
3002
3003 pub receiver: ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::Receiver>,
3004}
3005
3006impl ::fidl_next::Encodable for CapabilityStoreConnectorCreateRequest {
3007 type Encoded = WireCapabilityStoreConnectorCreateRequest;
3008}
3009
3010unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreConnectorCreateRequest
3011where
3012 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3013
3014 ___E: ::fidl_next::fuchsia::HandleEncoder,
3015{
3016 #[inline]
3017 fn encode(
3018 self,
3019 encoder: &mut ___E,
3020 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3021 ) -> Result<(), ::fidl_next::EncodeError> {
3022 ::fidl_next::munge! {
3023 let Self::Encoded {
3024 id,
3025 receiver,
3026
3027 } = out;
3028 }
3029
3030 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3031
3032 ::fidl_next::Encode::encode(self.receiver, encoder, receiver)?;
3033
3034 Ok(())
3035 }
3036}
3037
3038impl ::fidl_next::EncodableOption for CapabilityStoreConnectorCreateRequest {
3039 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreConnectorCreateRequest>;
3040}
3041
3042unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreConnectorCreateRequest
3043where
3044 ___E: ::fidl_next::Encoder + ?Sized,
3045 CapabilityStoreConnectorCreateRequest: ::fidl_next::Encode<___E>,
3046{
3047 #[inline]
3048 fn encode_option(
3049 this: Option<Self>,
3050 encoder: &mut ___E,
3051 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3052 ) -> Result<(), ::fidl_next::EncodeError> {
3053 if let Some(inner) = this {
3054 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3055 ::fidl_next::WireBox::encode_present(out);
3056 } else {
3057 ::fidl_next::WireBox::encode_absent(out);
3058 }
3059
3060 Ok(())
3061 }
3062}
3063
3064impl ::fidl_next::FromWire<WireCapabilityStoreConnectorCreateRequest>
3065 for CapabilityStoreConnectorCreateRequest
3066{
3067 #[inline]
3068 fn from_wire(wire: WireCapabilityStoreConnectorCreateRequest) -> Self {
3069 Self {
3070 id: ::fidl_next::FromWire::from_wire(wire.id),
3071
3072 receiver: ::fidl_next::FromWire::from_wire(wire.receiver),
3073 }
3074 }
3075}
3076
3077#[derive(Debug)]
3079#[repr(C)]
3080pub struct WireCapabilityStoreConnectorCreateRequest {
3081 pub id: ::fidl_next::WireU64,
3082
3083 pub receiver: ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::Receiver>,
3084}
3085
3086unsafe impl ::fidl_next::Wire for WireCapabilityStoreConnectorCreateRequest {
3087 type Decoded<'de> = WireCapabilityStoreConnectorCreateRequest;
3088
3089 #[inline]
3090 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3091 unsafe {
3092 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3093 }
3094 }
3095}
3096
3097unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreConnectorCreateRequest
3098where
3099 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3100
3101 ___D: ::fidl_next::fuchsia::HandleDecoder,
3102{
3103 fn decode(
3104 slot: ::fidl_next::Slot<'_, Self>,
3105 decoder: &mut ___D,
3106 ) -> Result<(), ::fidl_next::DecodeError> {
3107 ::fidl_next::munge! {
3108 let Self {
3109 mut id,
3110 mut receiver,
3111
3112 } = slot;
3113 }
3114
3115 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3116
3117 ::fidl_next::Decode::decode(receiver.as_mut(), decoder)?;
3118
3119 Ok(())
3120 }
3121}
3122
3123pub type CapabilityStoreConnectorCreateResponse = ();
3124
3125pub type WireCapabilityStoreConnectorCreateResponse = ();
3127
3128#[derive(Debug)]
3129pub struct CapabilityStoreConnectorOpenRequest {
3130 pub id: u64,
3131
3132 pub server_end: ::fidl_next::fuchsia::zx::Handle,
3133}
3134
3135impl ::fidl_next::Encodable for CapabilityStoreConnectorOpenRequest {
3136 type Encoded = WireCapabilityStoreConnectorOpenRequest;
3137}
3138
3139unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreConnectorOpenRequest
3140where
3141 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3142
3143 ___E: ::fidl_next::fuchsia::HandleEncoder,
3144{
3145 #[inline]
3146 fn encode(
3147 self,
3148 encoder: &mut ___E,
3149 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3150 ) -> Result<(), ::fidl_next::EncodeError> {
3151 ::fidl_next::munge! {
3152 let Self::Encoded {
3153 id,
3154 server_end,
3155
3156 } = out;
3157 }
3158
3159 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3160
3161 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
3162
3163 Ok(())
3164 }
3165}
3166
3167impl ::fidl_next::EncodableOption for CapabilityStoreConnectorOpenRequest {
3168 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreConnectorOpenRequest>;
3169}
3170
3171unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreConnectorOpenRequest
3172where
3173 ___E: ::fidl_next::Encoder + ?Sized,
3174 CapabilityStoreConnectorOpenRequest: ::fidl_next::Encode<___E>,
3175{
3176 #[inline]
3177 fn encode_option(
3178 this: Option<Self>,
3179 encoder: &mut ___E,
3180 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3181 ) -> Result<(), ::fidl_next::EncodeError> {
3182 if let Some(inner) = this {
3183 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3184 ::fidl_next::WireBox::encode_present(out);
3185 } else {
3186 ::fidl_next::WireBox::encode_absent(out);
3187 }
3188
3189 Ok(())
3190 }
3191}
3192
3193impl ::fidl_next::FromWire<WireCapabilityStoreConnectorOpenRequest>
3194 for CapabilityStoreConnectorOpenRequest
3195{
3196 #[inline]
3197 fn from_wire(wire: WireCapabilityStoreConnectorOpenRequest) -> Self {
3198 Self {
3199 id: ::fidl_next::FromWire::from_wire(wire.id),
3200
3201 server_end: ::fidl_next::FromWire::from_wire(wire.server_end),
3202 }
3203 }
3204}
3205
3206#[derive(Debug)]
3208#[repr(C)]
3209pub struct WireCapabilityStoreConnectorOpenRequest {
3210 pub id: ::fidl_next::WireU64,
3211
3212 pub server_end: ::fidl_next::fuchsia::WireHandle,
3213}
3214
3215unsafe impl ::fidl_next::Wire for WireCapabilityStoreConnectorOpenRequest {
3216 type Decoded<'de> = WireCapabilityStoreConnectorOpenRequest;
3217
3218 #[inline]
3219 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3220 unsafe {
3221 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3222 }
3223 }
3224}
3225
3226unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreConnectorOpenRequest
3227where
3228 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3229
3230 ___D: ::fidl_next::fuchsia::HandleDecoder,
3231{
3232 fn decode(
3233 slot: ::fidl_next::Slot<'_, Self>,
3234 decoder: &mut ___D,
3235 ) -> Result<(), ::fidl_next::DecodeError> {
3236 ::fidl_next::munge! {
3237 let Self {
3238 mut id,
3239 mut server_end,
3240
3241 } = slot;
3242 }
3243
3244 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3245
3246 ::fidl_next::Decode::decode(server_end.as_mut(), decoder)?;
3247
3248 Ok(())
3249 }
3250}
3251
3252pub type CapabilityStoreConnectorOpenResponse = ();
3253
3254pub type WireCapabilityStoreConnectorOpenResponse = ();
3256
3257#[derive(Debug)]
3258pub struct CapabilityStoreDirConnectorCreateRequest {
3259 pub id: u64,
3260
3261 pub receiver: ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::DirReceiver>,
3262}
3263
3264impl ::fidl_next::Encodable for CapabilityStoreDirConnectorCreateRequest {
3265 type Encoded = WireCapabilityStoreDirConnectorCreateRequest;
3266}
3267
3268unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDirConnectorCreateRequest
3269where
3270 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3271
3272 ___E: ::fidl_next::fuchsia::HandleEncoder,
3273{
3274 #[inline]
3275 fn encode(
3276 self,
3277 encoder: &mut ___E,
3278 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3279 ) -> Result<(), ::fidl_next::EncodeError> {
3280 ::fidl_next::munge! {
3281 let Self::Encoded {
3282 id,
3283 receiver,
3284
3285 } = out;
3286 }
3287
3288 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3289
3290 ::fidl_next::Encode::encode(self.receiver, encoder, receiver)?;
3291
3292 Ok(())
3293 }
3294}
3295
3296impl ::fidl_next::EncodableOption for CapabilityStoreDirConnectorCreateRequest {
3297 type EncodedOption =
3298 ::fidl_next::WireBox<'static, WireCapabilityStoreDirConnectorCreateRequest>;
3299}
3300
3301unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDirConnectorCreateRequest
3302where
3303 ___E: ::fidl_next::Encoder + ?Sized,
3304 CapabilityStoreDirConnectorCreateRequest: ::fidl_next::Encode<___E>,
3305{
3306 #[inline]
3307 fn encode_option(
3308 this: Option<Self>,
3309 encoder: &mut ___E,
3310 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3311 ) -> Result<(), ::fidl_next::EncodeError> {
3312 if let Some(inner) = this {
3313 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3314 ::fidl_next::WireBox::encode_present(out);
3315 } else {
3316 ::fidl_next::WireBox::encode_absent(out);
3317 }
3318
3319 Ok(())
3320 }
3321}
3322
3323impl ::fidl_next::FromWire<WireCapabilityStoreDirConnectorCreateRequest>
3324 for CapabilityStoreDirConnectorCreateRequest
3325{
3326 #[inline]
3327 fn from_wire(wire: WireCapabilityStoreDirConnectorCreateRequest) -> Self {
3328 Self {
3329 id: ::fidl_next::FromWire::from_wire(wire.id),
3330
3331 receiver: ::fidl_next::FromWire::from_wire(wire.receiver),
3332 }
3333 }
3334}
3335
3336#[derive(Debug)]
3338#[repr(C)]
3339pub struct WireCapabilityStoreDirConnectorCreateRequest {
3340 pub id: ::fidl_next::WireU64,
3341
3342 pub receiver: ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::DirReceiver>,
3343}
3344
3345unsafe impl ::fidl_next::Wire for WireCapabilityStoreDirConnectorCreateRequest {
3346 type Decoded<'de> = WireCapabilityStoreDirConnectorCreateRequest;
3347
3348 #[inline]
3349 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3350 unsafe {
3351 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3352 }
3353 }
3354}
3355
3356unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDirConnectorCreateRequest
3357where
3358 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3359
3360 ___D: ::fidl_next::fuchsia::HandleDecoder,
3361{
3362 fn decode(
3363 slot: ::fidl_next::Slot<'_, Self>,
3364 decoder: &mut ___D,
3365 ) -> Result<(), ::fidl_next::DecodeError> {
3366 ::fidl_next::munge! {
3367 let Self {
3368 mut id,
3369 mut receiver,
3370
3371 } = slot;
3372 }
3373
3374 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3375
3376 ::fidl_next::Decode::decode(receiver.as_mut(), decoder)?;
3377
3378 Ok(())
3379 }
3380}
3381
3382pub type CapabilityStoreDirConnectorCreateResponse = ();
3383
3384pub type WireCapabilityStoreDirConnectorCreateResponse = ();
3386
3387#[derive(Debug)]
3388pub struct CapabilityStoreDirConnectorOpenRequest {
3389 pub id: u64,
3390
3391 pub server_end: ::fidl_next::ServerEnd<
3392 ::fidl_next::fuchsia::zx::Channel,
3393 ::fidl_next_fuchsia_io::Directory,
3394 >,
3395}
3396
3397impl ::fidl_next::Encodable for CapabilityStoreDirConnectorOpenRequest {
3398 type Encoded = WireCapabilityStoreDirConnectorOpenRequest;
3399}
3400
3401unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDirConnectorOpenRequest
3402where
3403 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3404
3405 ___E: ::fidl_next::fuchsia::HandleEncoder,
3406{
3407 #[inline]
3408 fn encode(
3409 self,
3410 encoder: &mut ___E,
3411 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3412 ) -> Result<(), ::fidl_next::EncodeError> {
3413 ::fidl_next::munge! {
3414 let Self::Encoded {
3415 id,
3416 server_end,
3417
3418 } = out;
3419 }
3420
3421 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3422
3423 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
3424
3425 Ok(())
3426 }
3427}
3428
3429impl ::fidl_next::EncodableOption for CapabilityStoreDirConnectorOpenRequest {
3430 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDirConnectorOpenRequest>;
3431}
3432
3433unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDirConnectorOpenRequest
3434where
3435 ___E: ::fidl_next::Encoder + ?Sized,
3436 CapabilityStoreDirConnectorOpenRequest: ::fidl_next::Encode<___E>,
3437{
3438 #[inline]
3439 fn encode_option(
3440 this: Option<Self>,
3441 encoder: &mut ___E,
3442 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3443 ) -> Result<(), ::fidl_next::EncodeError> {
3444 if let Some(inner) = this {
3445 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3446 ::fidl_next::WireBox::encode_present(out);
3447 } else {
3448 ::fidl_next::WireBox::encode_absent(out);
3449 }
3450
3451 Ok(())
3452 }
3453}
3454
3455impl ::fidl_next::FromWire<WireCapabilityStoreDirConnectorOpenRequest>
3456 for CapabilityStoreDirConnectorOpenRequest
3457{
3458 #[inline]
3459 fn from_wire(wire: WireCapabilityStoreDirConnectorOpenRequest) -> Self {
3460 Self {
3461 id: ::fidl_next::FromWire::from_wire(wire.id),
3462
3463 server_end: ::fidl_next::FromWire::from_wire(wire.server_end),
3464 }
3465 }
3466}
3467
3468#[derive(Debug)]
3470#[repr(C)]
3471pub struct WireCapabilityStoreDirConnectorOpenRequest {
3472 pub id: ::fidl_next::WireU64,
3473
3474 pub server_end: ::fidl_next::ServerEnd<
3475 ::fidl_next::fuchsia::WireChannel,
3476 ::fidl_next_fuchsia_io::Directory,
3477 >,
3478}
3479
3480unsafe impl ::fidl_next::Wire for WireCapabilityStoreDirConnectorOpenRequest {
3481 type Decoded<'de> = WireCapabilityStoreDirConnectorOpenRequest;
3482
3483 #[inline]
3484 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3485 unsafe {
3486 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3487 }
3488 }
3489}
3490
3491unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDirConnectorOpenRequest
3492where
3493 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3494
3495 ___D: ::fidl_next::fuchsia::HandleDecoder,
3496{
3497 fn decode(
3498 slot: ::fidl_next::Slot<'_, Self>,
3499 decoder: &mut ___D,
3500 ) -> Result<(), ::fidl_next::DecodeError> {
3501 ::fidl_next::munge! {
3502 let Self {
3503 mut id,
3504 mut server_end,
3505
3506 } = slot;
3507 }
3508
3509 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3510
3511 ::fidl_next::Decode::decode(server_end.as_mut(), decoder)?;
3512
3513 Ok(())
3514 }
3515}
3516
3517pub type CapabilityStoreDirConnectorOpenResponse = ();
3518
3519pub type WireCapabilityStoreDirConnectorOpenResponse = ();
3521
3522#[derive(Clone, Debug)]
3523#[repr(C)]
3524pub struct CapabilityStoreDictionaryCreateRequest {
3525 pub id: u64,
3526}
3527
3528impl ::fidl_next::Encodable for CapabilityStoreDictionaryCreateRequest {
3529 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3530 Self,
3531 WireCapabilityStoreDictionaryCreateRequest,
3532 > = unsafe {
3533 ::fidl_next::CopyOptimization::enable_if(
3534 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
3535 )
3536 };
3537
3538 type Encoded = WireCapabilityStoreDictionaryCreateRequest;
3539}
3540
3541unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryCreateRequest
3542where
3543 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3544{
3545 #[inline]
3546 fn encode(
3547 self,
3548 encoder: &mut ___E,
3549 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3550 ) -> Result<(), ::fidl_next::EncodeError> {
3551 ::fidl_next::munge! {
3552 let Self::Encoded {
3553 id,
3554
3555 } = out;
3556 }
3557
3558 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3559
3560 Ok(())
3561 }
3562}
3563
3564unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryCreateRequest
3565where
3566 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3567{
3568 #[inline]
3569 fn encode_ref(
3570 &self,
3571 encoder: &mut ___E,
3572 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3573 ) -> Result<(), ::fidl_next::EncodeError> {
3574 ::fidl_next::munge! {
3575 let Self::Encoded {
3576 id,
3577
3578 } = out;
3579 }
3580
3581 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
3582
3583 Ok(())
3584 }
3585}
3586
3587impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryCreateRequest {
3588 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryCreateRequest>;
3589}
3590
3591unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryCreateRequest
3592where
3593 ___E: ::fidl_next::Encoder + ?Sized,
3594 CapabilityStoreDictionaryCreateRequest: ::fidl_next::Encode<___E>,
3595{
3596 #[inline]
3597 fn encode_option(
3598 this: Option<Self>,
3599 encoder: &mut ___E,
3600 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3601 ) -> Result<(), ::fidl_next::EncodeError> {
3602 if let Some(inner) = this {
3603 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3604 ::fidl_next::WireBox::encode_present(out);
3605 } else {
3606 ::fidl_next::WireBox::encode_absent(out);
3607 }
3608
3609 Ok(())
3610 }
3611}
3612
3613unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryCreateRequest
3614where
3615 ___E: ::fidl_next::Encoder + ?Sized,
3616 CapabilityStoreDictionaryCreateRequest: ::fidl_next::EncodeRef<___E>,
3617{
3618 #[inline]
3619 fn encode_option_ref(
3620 this: Option<&Self>,
3621 encoder: &mut ___E,
3622 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3623 ) -> Result<(), ::fidl_next::EncodeError> {
3624 if let Some(inner) = this {
3625 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3626 ::fidl_next::WireBox::encode_present(out);
3627 } else {
3628 ::fidl_next::WireBox::encode_absent(out);
3629 }
3630
3631 Ok(())
3632 }
3633}
3634
3635impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryCreateRequest>
3636 for CapabilityStoreDictionaryCreateRequest
3637{
3638 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3639 WireCapabilityStoreDictionaryCreateRequest,
3640 Self,
3641 > = unsafe {
3642 ::fidl_next::CopyOptimization::enable_if(
3643 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
3644 .is_enabled(),
3645 )
3646 };
3647
3648 #[inline]
3649 fn from_wire(wire: WireCapabilityStoreDictionaryCreateRequest) -> Self {
3650 Self { id: ::fidl_next::FromWire::from_wire(wire.id) }
3651 }
3652}
3653
3654impl ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryCreateRequest>
3655 for CapabilityStoreDictionaryCreateRequest
3656{
3657 #[inline]
3658 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryCreateRequest) -> Self {
3659 Self { id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id) }
3660 }
3661}
3662
3663#[derive(Clone, Debug)]
3665#[repr(C)]
3666pub struct WireCapabilityStoreDictionaryCreateRequest {
3667 pub id: ::fidl_next::WireU64,
3668}
3669
3670unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryCreateRequest {
3671 type Decoded<'de> = WireCapabilityStoreDictionaryCreateRequest;
3672
3673 #[inline]
3674 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3675}
3676
3677unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryCreateRequest
3678where
3679 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3680{
3681 fn decode(
3682 slot: ::fidl_next::Slot<'_, Self>,
3683 decoder: &mut ___D,
3684 ) -> Result<(), ::fidl_next::DecodeError> {
3685 ::fidl_next::munge! {
3686 let Self {
3687 mut id,
3688
3689 } = slot;
3690 }
3691
3692 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3693
3694 Ok(())
3695 }
3696}
3697
3698pub type CapabilityStoreDictionaryCreateResponse = ();
3699
3700pub type WireCapabilityStoreDictionaryCreateResponse = ();
3702
3703#[derive(Debug)]
3704pub struct CapabilityStoreDictionaryLegacyImportRequest {
3705 pub id: u64,
3706
3707 pub client_end: ::fidl_next::fuchsia::zx::Handle,
3708}
3709
3710impl ::fidl_next::Encodable for CapabilityStoreDictionaryLegacyImportRequest {
3711 type Encoded = WireCapabilityStoreDictionaryLegacyImportRequest;
3712}
3713
3714unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryLegacyImportRequest
3715where
3716 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3717
3718 ___E: ::fidl_next::fuchsia::HandleEncoder,
3719{
3720 #[inline]
3721 fn encode(
3722 self,
3723 encoder: &mut ___E,
3724 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3725 ) -> Result<(), ::fidl_next::EncodeError> {
3726 ::fidl_next::munge! {
3727 let Self::Encoded {
3728 id,
3729 client_end,
3730
3731 } = out;
3732 }
3733
3734 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3735
3736 ::fidl_next::Encode::encode(self.client_end, encoder, client_end)?;
3737
3738 Ok(())
3739 }
3740}
3741
3742impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryLegacyImportRequest {
3743 type EncodedOption =
3744 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryLegacyImportRequest>;
3745}
3746
3747unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryLegacyImportRequest
3748where
3749 ___E: ::fidl_next::Encoder + ?Sized,
3750 CapabilityStoreDictionaryLegacyImportRequest: ::fidl_next::Encode<___E>,
3751{
3752 #[inline]
3753 fn encode_option(
3754 this: Option<Self>,
3755 encoder: &mut ___E,
3756 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3757 ) -> Result<(), ::fidl_next::EncodeError> {
3758 if let Some(inner) = this {
3759 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3760 ::fidl_next::WireBox::encode_present(out);
3761 } else {
3762 ::fidl_next::WireBox::encode_absent(out);
3763 }
3764
3765 Ok(())
3766 }
3767}
3768
3769impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryLegacyImportRequest>
3770 for CapabilityStoreDictionaryLegacyImportRequest
3771{
3772 #[inline]
3773 fn from_wire(wire: WireCapabilityStoreDictionaryLegacyImportRequest) -> Self {
3774 Self {
3775 id: ::fidl_next::FromWire::from_wire(wire.id),
3776
3777 client_end: ::fidl_next::FromWire::from_wire(wire.client_end),
3778 }
3779 }
3780}
3781
3782#[derive(Debug)]
3784#[repr(C)]
3785pub struct WireCapabilityStoreDictionaryLegacyImportRequest {
3786 pub id: ::fidl_next::WireU64,
3787
3788 pub client_end: ::fidl_next::fuchsia::WireHandle,
3789}
3790
3791unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryLegacyImportRequest {
3792 type Decoded<'de> = WireCapabilityStoreDictionaryLegacyImportRequest;
3793
3794 #[inline]
3795 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3796 unsafe {
3797 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3798 }
3799 }
3800}
3801
3802unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryLegacyImportRequest
3803where
3804 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3805
3806 ___D: ::fidl_next::fuchsia::HandleDecoder,
3807{
3808 fn decode(
3809 slot: ::fidl_next::Slot<'_, Self>,
3810 decoder: &mut ___D,
3811 ) -> Result<(), ::fidl_next::DecodeError> {
3812 ::fidl_next::munge! {
3813 let Self {
3814 mut id,
3815 mut client_end,
3816
3817 } = slot;
3818 }
3819
3820 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3821
3822 ::fidl_next::Decode::decode(client_end.as_mut(), decoder)?;
3823
3824 Ok(())
3825 }
3826}
3827
3828pub type CapabilityStoreDictionaryLegacyImportResponse = ();
3829
3830pub type WireCapabilityStoreDictionaryLegacyImportResponse = ();
3832
3833#[derive(Debug)]
3834pub struct CapabilityStoreDictionaryLegacyExportRequest {
3835 pub id: u64,
3836
3837 pub server_end: ::fidl_next::fuchsia::zx::Handle,
3838}
3839
3840impl ::fidl_next::Encodable for CapabilityStoreDictionaryLegacyExportRequest {
3841 type Encoded = WireCapabilityStoreDictionaryLegacyExportRequest;
3842}
3843
3844unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryLegacyExportRequest
3845where
3846 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3847
3848 ___E: ::fidl_next::fuchsia::HandleEncoder,
3849{
3850 #[inline]
3851 fn encode(
3852 self,
3853 encoder: &mut ___E,
3854 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3855 ) -> Result<(), ::fidl_next::EncodeError> {
3856 ::fidl_next::munge! {
3857 let Self::Encoded {
3858 id,
3859 server_end,
3860
3861 } = out;
3862 }
3863
3864 ::fidl_next::Encode::encode(self.id, encoder, id)?;
3865
3866 ::fidl_next::Encode::encode(self.server_end, encoder, server_end)?;
3867
3868 Ok(())
3869 }
3870}
3871
3872impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryLegacyExportRequest {
3873 type EncodedOption =
3874 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryLegacyExportRequest>;
3875}
3876
3877unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryLegacyExportRequest
3878where
3879 ___E: ::fidl_next::Encoder + ?Sized,
3880 CapabilityStoreDictionaryLegacyExportRequest: ::fidl_next::Encode<___E>,
3881{
3882 #[inline]
3883 fn encode_option(
3884 this: Option<Self>,
3885 encoder: &mut ___E,
3886 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3887 ) -> Result<(), ::fidl_next::EncodeError> {
3888 if let Some(inner) = this {
3889 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3890 ::fidl_next::WireBox::encode_present(out);
3891 } else {
3892 ::fidl_next::WireBox::encode_absent(out);
3893 }
3894
3895 Ok(())
3896 }
3897}
3898
3899impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryLegacyExportRequest>
3900 for CapabilityStoreDictionaryLegacyExportRequest
3901{
3902 #[inline]
3903 fn from_wire(wire: WireCapabilityStoreDictionaryLegacyExportRequest) -> Self {
3904 Self {
3905 id: ::fidl_next::FromWire::from_wire(wire.id),
3906
3907 server_end: ::fidl_next::FromWire::from_wire(wire.server_end),
3908 }
3909 }
3910}
3911
3912#[derive(Debug)]
3914#[repr(C)]
3915pub struct WireCapabilityStoreDictionaryLegacyExportRequest {
3916 pub id: ::fidl_next::WireU64,
3917
3918 pub server_end: ::fidl_next::fuchsia::WireHandle,
3919}
3920
3921unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryLegacyExportRequest {
3922 type Decoded<'de> = WireCapabilityStoreDictionaryLegacyExportRequest;
3923
3924 #[inline]
3925 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3926 unsafe {
3927 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
3928 }
3929 }
3930}
3931
3932unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryLegacyExportRequest
3933where
3934 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3935
3936 ___D: ::fidl_next::fuchsia::HandleDecoder,
3937{
3938 fn decode(
3939 slot: ::fidl_next::Slot<'_, Self>,
3940 decoder: &mut ___D,
3941 ) -> Result<(), ::fidl_next::DecodeError> {
3942 ::fidl_next::munge! {
3943 let Self {
3944 mut id,
3945 mut server_end,
3946
3947 } = slot;
3948 }
3949
3950 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
3951
3952 ::fidl_next::Decode::decode(server_end.as_mut(), decoder)?;
3953
3954 Ok(())
3955 }
3956}
3957
3958pub type CapabilityStoreDictionaryLegacyExportResponse = ();
3959
3960pub type WireCapabilityStoreDictionaryLegacyExportResponse = ();
3962
3963#[doc = " The maximum length of a dictionary key. This should coincide with\n fuchsia.component.MAX_NAME_LENGTH.\n"]
3964pub const MAX_NAME_LENGTH: u64 = 255;
3965
3966#[doc = " The key of a [`DictionaryItem`]. The constraints for valid keys are documented at\n https://fuchsia.dev/reference/cml#names.\n"]
3967pub type DictionaryKey = String;
3968
3969pub type WireDictionaryKey<'de> = ::fidl_next::WireString<'de>;
3971
3972#[doc = " A key-value pair in a [`DictionaryRef`].\n"]
3973#[derive(Clone, Debug)]
3974pub struct DictionaryItem {
3975 pub key: String,
3976
3977 pub value: u64,
3978}
3979
3980impl ::fidl_next::Encodable for DictionaryItem {
3981 type Encoded = WireDictionaryItem<'static>;
3982}
3983
3984unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryItem
3985where
3986 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3987
3988 ___E: ::fidl_next::Encoder,
3989{
3990 #[inline]
3991 fn encode(
3992 self,
3993 encoder: &mut ___E,
3994 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3995 ) -> Result<(), ::fidl_next::EncodeError> {
3996 ::fidl_next::munge! {
3997 let Self::Encoded {
3998 key,
3999 value,
4000
4001 } = out;
4002 }
4003
4004 ::fidl_next::Encode::encode(self.key, encoder, key)?;
4005
4006 ::fidl_next::Encode::encode(self.value, encoder, value)?;
4007
4008 Ok(())
4009 }
4010}
4011
4012unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DictionaryItem
4013where
4014 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4015
4016 ___E: ::fidl_next::Encoder,
4017{
4018 #[inline]
4019 fn encode_ref(
4020 &self,
4021 encoder: &mut ___E,
4022 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4023 ) -> Result<(), ::fidl_next::EncodeError> {
4024 ::fidl_next::munge! {
4025 let Self::Encoded {
4026 key,
4027 value,
4028
4029 } = out;
4030 }
4031
4032 ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
4033
4034 ::fidl_next::EncodeRef::encode_ref(&self.value, encoder, value)?;
4035
4036 Ok(())
4037 }
4038}
4039
4040impl ::fidl_next::EncodableOption for DictionaryItem {
4041 type EncodedOption = ::fidl_next::WireBox<'static, WireDictionaryItem<'static>>;
4042}
4043
4044unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryItem
4045where
4046 ___E: ::fidl_next::Encoder + ?Sized,
4047 DictionaryItem: ::fidl_next::Encode<___E>,
4048{
4049 #[inline]
4050 fn encode_option(
4051 this: Option<Self>,
4052 encoder: &mut ___E,
4053 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4054 ) -> Result<(), ::fidl_next::EncodeError> {
4055 if let Some(inner) = this {
4056 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4057 ::fidl_next::WireBox::encode_present(out);
4058 } else {
4059 ::fidl_next::WireBox::encode_absent(out);
4060 }
4061
4062 Ok(())
4063 }
4064}
4065
4066unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DictionaryItem
4067where
4068 ___E: ::fidl_next::Encoder + ?Sized,
4069 DictionaryItem: ::fidl_next::EncodeRef<___E>,
4070{
4071 #[inline]
4072 fn encode_option_ref(
4073 this: Option<&Self>,
4074 encoder: &mut ___E,
4075 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4076 ) -> Result<(), ::fidl_next::EncodeError> {
4077 if let Some(inner) = this {
4078 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4079 ::fidl_next::WireBox::encode_present(out);
4080 } else {
4081 ::fidl_next::WireBox::encode_absent(out);
4082 }
4083
4084 Ok(())
4085 }
4086}
4087
4088impl<'de> ::fidl_next::FromWire<WireDictionaryItem<'de>> for DictionaryItem {
4089 #[inline]
4090 fn from_wire(wire: WireDictionaryItem<'de>) -> Self {
4091 Self {
4092 key: ::fidl_next::FromWire::from_wire(wire.key),
4093
4094 value: ::fidl_next::FromWire::from_wire(wire.value),
4095 }
4096 }
4097}
4098
4099impl<'de> ::fidl_next::FromWireRef<WireDictionaryItem<'de>> for DictionaryItem {
4100 #[inline]
4101 fn from_wire_ref(wire: &WireDictionaryItem<'de>) -> Self {
4102 Self {
4103 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4104
4105 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
4106 }
4107 }
4108}
4109
4110#[derive(Debug)]
4112#[repr(C)]
4113pub struct WireDictionaryItem<'de> {
4114 pub key: ::fidl_next::WireString<'de>,
4115
4116 pub value: ::fidl_next::WireU64,
4117}
4118
4119unsafe impl ::fidl_next::Wire for WireDictionaryItem<'static> {
4120 type Decoded<'de> = WireDictionaryItem<'de>;
4121
4122 #[inline]
4123 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4124}
4125
4126unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryItem<'static>
4127where
4128 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4129
4130 ___D: ::fidl_next::Decoder,
4131{
4132 fn decode(
4133 slot: ::fidl_next::Slot<'_, Self>,
4134 decoder: &mut ___D,
4135 ) -> Result<(), ::fidl_next::DecodeError> {
4136 ::fidl_next::munge! {
4137 let Self {
4138 mut key,
4139 mut value,
4140
4141 } = slot;
4142 }
4143
4144 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
4145
4146 let key = unsafe { key.deref_unchecked() };
4147
4148 if key.len() > 255 {
4149 return Err(::fidl_next::DecodeError::VectorTooLong {
4150 size: key.len() as u64,
4151 limit: 255,
4152 });
4153 }
4154
4155 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
4156
4157 Ok(())
4158 }
4159}
4160
4161#[derive(Clone, Debug)]
4162pub struct CapabilityStoreDictionaryInsertRequest {
4163 pub id: u64,
4164
4165 pub item: crate::DictionaryItem,
4166}
4167
4168impl ::fidl_next::Encodable for CapabilityStoreDictionaryInsertRequest {
4169 type Encoded = WireCapabilityStoreDictionaryInsertRequest<'static>;
4170}
4171
4172unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryInsertRequest
4173where
4174 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4175
4176 ___E: ::fidl_next::Encoder,
4177{
4178 #[inline]
4179 fn encode(
4180 self,
4181 encoder: &mut ___E,
4182 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4183 ) -> Result<(), ::fidl_next::EncodeError> {
4184 ::fidl_next::munge! {
4185 let Self::Encoded {
4186 id,
4187 item,
4188
4189 } = out;
4190 }
4191
4192 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4193
4194 ::fidl_next::Encode::encode(self.item, encoder, item)?;
4195
4196 Ok(())
4197 }
4198}
4199
4200unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryInsertRequest
4201where
4202 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4203
4204 ___E: ::fidl_next::Encoder,
4205{
4206 #[inline]
4207 fn encode_ref(
4208 &self,
4209 encoder: &mut ___E,
4210 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4211 ) -> Result<(), ::fidl_next::EncodeError> {
4212 ::fidl_next::munge! {
4213 let Self::Encoded {
4214 id,
4215 item,
4216
4217 } = out;
4218 }
4219
4220 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
4221
4222 ::fidl_next::EncodeRef::encode_ref(&self.item, encoder, item)?;
4223
4224 Ok(())
4225 }
4226}
4227
4228impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryInsertRequest {
4229 type EncodedOption =
4230 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryInsertRequest<'static>>;
4231}
4232
4233unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryInsertRequest
4234where
4235 ___E: ::fidl_next::Encoder + ?Sized,
4236 CapabilityStoreDictionaryInsertRequest: ::fidl_next::Encode<___E>,
4237{
4238 #[inline]
4239 fn encode_option(
4240 this: Option<Self>,
4241 encoder: &mut ___E,
4242 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4243 ) -> Result<(), ::fidl_next::EncodeError> {
4244 if let Some(inner) = this {
4245 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4246 ::fidl_next::WireBox::encode_present(out);
4247 } else {
4248 ::fidl_next::WireBox::encode_absent(out);
4249 }
4250
4251 Ok(())
4252 }
4253}
4254
4255unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryInsertRequest
4256where
4257 ___E: ::fidl_next::Encoder + ?Sized,
4258 CapabilityStoreDictionaryInsertRequest: ::fidl_next::EncodeRef<___E>,
4259{
4260 #[inline]
4261 fn encode_option_ref(
4262 this: Option<&Self>,
4263 encoder: &mut ___E,
4264 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4265 ) -> Result<(), ::fidl_next::EncodeError> {
4266 if let Some(inner) = this {
4267 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4268 ::fidl_next::WireBox::encode_present(out);
4269 } else {
4270 ::fidl_next::WireBox::encode_absent(out);
4271 }
4272
4273 Ok(())
4274 }
4275}
4276
4277impl<'de> ::fidl_next::FromWire<WireCapabilityStoreDictionaryInsertRequest<'de>>
4278 for CapabilityStoreDictionaryInsertRequest
4279{
4280 #[inline]
4281 fn from_wire(wire: WireCapabilityStoreDictionaryInsertRequest<'de>) -> Self {
4282 Self {
4283 id: ::fidl_next::FromWire::from_wire(wire.id),
4284
4285 item: ::fidl_next::FromWire::from_wire(wire.item),
4286 }
4287 }
4288}
4289
4290impl<'de> ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryInsertRequest<'de>>
4291 for CapabilityStoreDictionaryInsertRequest
4292{
4293 #[inline]
4294 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryInsertRequest<'de>) -> Self {
4295 Self {
4296 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
4297
4298 item: ::fidl_next::FromWireRef::from_wire_ref(&wire.item),
4299 }
4300 }
4301}
4302
4303#[derive(Debug)]
4305#[repr(C)]
4306pub struct WireCapabilityStoreDictionaryInsertRequest<'de> {
4307 pub id: ::fidl_next::WireU64,
4308
4309 pub item: crate::WireDictionaryItem<'de>,
4310}
4311
4312unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryInsertRequest<'static> {
4313 type Decoded<'de> = WireCapabilityStoreDictionaryInsertRequest<'de>;
4314
4315 #[inline]
4316 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4317}
4318
4319unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryInsertRequest<'static>
4320where
4321 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4322
4323 ___D: ::fidl_next::Decoder,
4324{
4325 fn decode(
4326 slot: ::fidl_next::Slot<'_, Self>,
4327 decoder: &mut ___D,
4328 ) -> Result<(), ::fidl_next::DecodeError> {
4329 ::fidl_next::munge! {
4330 let Self {
4331 mut id,
4332 mut item,
4333
4334 } = slot;
4335 }
4336
4337 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
4338
4339 ::fidl_next::Decode::decode(item.as_mut(), decoder)?;
4340
4341 Ok(())
4342 }
4343}
4344
4345pub type CapabilityStoreDictionaryInsertResponse = ();
4346
4347pub type WireCapabilityStoreDictionaryInsertResponse = ();
4349
4350#[derive(Clone, Debug)]
4351pub struct CapabilityStoreDictionaryGetRequest {
4352 pub id: u64,
4353
4354 pub key: String,
4355
4356 pub dest_id: u64,
4357}
4358
4359impl ::fidl_next::Encodable for CapabilityStoreDictionaryGetRequest {
4360 type Encoded = WireCapabilityStoreDictionaryGetRequest<'static>;
4361}
4362
4363unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryGetRequest
4364where
4365 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4366
4367 ___E: ::fidl_next::Encoder,
4368{
4369 #[inline]
4370 fn encode(
4371 self,
4372 encoder: &mut ___E,
4373 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4374 ) -> Result<(), ::fidl_next::EncodeError> {
4375 ::fidl_next::munge! {
4376 let Self::Encoded {
4377 id,
4378 key,
4379 dest_id,
4380
4381 } = out;
4382 }
4383
4384 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4385
4386 ::fidl_next::Encode::encode(self.key, encoder, key)?;
4387
4388 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
4389
4390 Ok(())
4391 }
4392}
4393
4394unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryGetRequest
4395where
4396 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4397
4398 ___E: ::fidl_next::Encoder,
4399{
4400 #[inline]
4401 fn encode_ref(
4402 &self,
4403 encoder: &mut ___E,
4404 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4405 ) -> Result<(), ::fidl_next::EncodeError> {
4406 ::fidl_next::munge! {
4407 let Self::Encoded {
4408 id,
4409 key,
4410 dest_id,
4411
4412 } = out;
4413 }
4414
4415 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
4416
4417 ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
4418
4419 ::fidl_next::EncodeRef::encode_ref(&self.dest_id, encoder, dest_id)?;
4420
4421 Ok(())
4422 }
4423}
4424
4425impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryGetRequest {
4426 type EncodedOption =
4427 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryGetRequest<'static>>;
4428}
4429
4430unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryGetRequest
4431where
4432 ___E: ::fidl_next::Encoder + ?Sized,
4433 CapabilityStoreDictionaryGetRequest: ::fidl_next::Encode<___E>,
4434{
4435 #[inline]
4436 fn encode_option(
4437 this: Option<Self>,
4438 encoder: &mut ___E,
4439 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4440 ) -> Result<(), ::fidl_next::EncodeError> {
4441 if let Some(inner) = this {
4442 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4443 ::fidl_next::WireBox::encode_present(out);
4444 } else {
4445 ::fidl_next::WireBox::encode_absent(out);
4446 }
4447
4448 Ok(())
4449 }
4450}
4451
4452unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryGetRequest
4453where
4454 ___E: ::fidl_next::Encoder + ?Sized,
4455 CapabilityStoreDictionaryGetRequest: ::fidl_next::EncodeRef<___E>,
4456{
4457 #[inline]
4458 fn encode_option_ref(
4459 this: Option<&Self>,
4460 encoder: &mut ___E,
4461 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4462 ) -> Result<(), ::fidl_next::EncodeError> {
4463 if let Some(inner) = this {
4464 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4465 ::fidl_next::WireBox::encode_present(out);
4466 } else {
4467 ::fidl_next::WireBox::encode_absent(out);
4468 }
4469
4470 Ok(())
4471 }
4472}
4473
4474impl<'de> ::fidl_next::FromWire<WireCapabilityStoreDictionaryGetRequest<'de>>
4475 for CapabilityStoreDictionaryGetRequest
4476{
4477 #[inline]
4478 fn from_wire(wire: WireCapabilityStoreDictionaryGetRequest<'de>) -> Self {
4479 Self {
4480 id: ::fidl_next::FromWire::from_wire(wire.id),
4481
4482 key: ::fidl_next::FromWire::from_wire(wire.key),
4483
4484 dest_id: ::fidl_next::FromWire::from_wire(wire.dest_id),
4485 }
4486 }
4487}
4488
4489impl<'de> ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryGetRequest<'de>>
4490 for CapabilityStoreDictionaryGetRequest
4491{
4492 #[inline]
4493 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryGetRequest<'de>) -> Self {
4494 Self {
4495 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
4496
4497 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4498
4499 dest_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.dest_id),
4500 }
4501 }
4502}
4503
4504#[derive(Debug)]
4506#[repr(C)]
4507pub struct WireCapabilityStoreDictionaryGetRequest<'de> {
4508 pub id: ::fidl_next::WireU64,
4509
4510 pub key: ::fidl_next::WireString<'de>,
4511
4512 pub dest_id: ::fidl_next::WireU64,
4513}
4514
4515unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryGetRequest<'static> {
4516 type Decoded<'de> = WireCapabilityStoreDictionaryGetRequest<'de>;
4517
4518 #[inline]
4519 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4520}
4521
4522unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryGetRequest<'static>
4523where
4524 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4525
4526 ___D: ::fidl_next::Decoder,
4527{
4528 fn decode(
4529 slot: ::fidl_next::Slot<'_, Self>,
4530 decoder: &mut ___D,
4531 ) -> Result<(), ::fidl_next::DecodeError> {
4532 ::fidl_next::munge! {
4533 let Self {
4534 mut id,
4535 mut key,
4536 mut dest_id,
4537
4538 } = slot;
4539 }
4540
4541 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
4542
4543 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
4544
4545 let key = unsafe { key.deref_unchecked() };
4546
4547 if key.len() > 255 {
4548 return Err(::fidl_next::DecodeError::VectorTooLong {
4549 size: key.len() as u64,
4550 limit: 255,
4551 });
4552 }
4553
4554 ::fidl_next::Decode::decode(dest_id.as_mut(), decoder)?;
4555
4556 Ok(())
4557 }
4558}
4559
4560pub type CapabilityStoreDictionaryGetResponse = ();
4561
4562pub type WireCapabilityStoreDictionaryGetResponse = ();
4564
4565#[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"]
4566#[derive(Clone, Debug)]
4567#[repr(C)]
4568pub struct WrappedCapabilityId {
4569 pub id: u64,
4570}
4571
4572impl ::fidl_next::Encodable for WrappedCapabilityId {
4573 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireWrappedCapabilityId> = unsafe {
4574 ::fidl_next::CopyOptimization::enable_if(
4575 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4576 )
4577 };
4578
4579 type Encoded = WireWrappedCapabilityId;
4580}
4581
4582unsafe impl<___E> ::fidl_next::Encode<___E> for WrappedCapabilityId
4583where
4584 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4585{
4586 #[inline]
4587 fn encode(
4588 self,
4589 encoder: &mut ___E,
4590 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4591 ) -> Result<(), ::fidl_next::EncodeError> {
4592 ::fidl_next::munge! {
4593 let Self::Encoded {
4594 id,
4595
4596 } = out;
4597 }
4598
4599 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4600
4601 Ok(())
4602 }
4603}
4604
4605unsafe impl<___E> ::fidl_next::EncodeRef<___E> for WrappedCapabilityId
4606where
4607 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4608{
4609 #[inline]
4610 fn encode_ref(
4611 &self,
4612 encoder: &mut ___E,
4613 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4614 ) -> Result<(), ::fidl_next::EncodeError> {
4615 ::fidl_next::munge! {
4616 let Self::Encoded {
4617 id,
4618
4619 } = out;
4620 }
4621
4622 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
4623
4624 Ok(())
4625 }
4626}
4627
4628impl ::fidl_next::EncodableOption for WrappedCapabilityId {
4629 type EncodedOption = ::fidl_next::WireBox<'static, WireWrappedCapabilityId>;
4630}
4631
4632unsafe impl<___E> ::fidl_next::EncodeOption<___E> for WrappedCapabilityId
4633where
4634 ___E: ::fidl_next::Encoder + ?Sized,
4635 WrappedCapabilityId: ::fidl_next::Encode<___E>,
4636{
4637 #[inline]
4638 fn encode_option(
4639 this: Option<Self>,
4640 encoder: &mut ___E,
4641 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4642 ) -> Result<(), ::fidl_next::EncodeError> {
4643 if let Some(inner) = this {
4644 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4645 ::fidl_next::WireBox::encode_present(out);
4646 } else {
4647 ::fidl_next::WireBox::encode_absent(out);
4648 }
4649
4650 Ok(())
4651 }
4652}
4653
4654unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for WrappedCapabilityId
4655where
4656 ___E: ::fidl_next::Encoder + ?Sized,
4657 WrappedCapabilityId: ::fidl_next::EncodeRef<___E>,
4658{
4659 #[inline]
4660 fn encode_option_ref(
4661 this: Option<&Self>,
4662 encoder: &mut ___E,
4663 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4664 ) -> Result<(), ::fidl_next::EncodeError> {
4665 if let Some(inner) = this {
4666 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4667 ::fidl_next::WireBox::encode_present(out);
4668 } else {
4669 ::fidl_next::WireBox::encode_absent(out);
4670 }
4671
4672 Ok(())
4673 }
4674}
4675
4676impl ::fidl_next::FromWire<WireWrappedCapabilityId> for WrappedCapabilityId {
4677 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireWrappedCapabilityId, Self> = unsafe {
4678 ::fidl_next::CopyOptimization::enable_if(
4679 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
4680 .is_enabled(),
4681 )
4682 };
4683
4684 #[inline]
4685 fn from_wire(wire: WireWrappedCapabilityId) -> Self {
4686 Self { id: ::fidl_next::FromWire::from_wire(wire.id) }
4687 }
4688}
4689
4690impl ::fidl_next::FromWireRef<WireWrappedCapabilityId> for WrappedCapabilityId {
4691 #[inline]
4692 fn from_wire_ref(wire: &WireWrappedCapabilityId) -> Self {
4693 Self { id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id) }
4694 }
4695}
4696
4697#[derive(Clone, Debug)]
4699#[repr(C)]
4700pub struct WireWrappedCapabilityId {
4701 pub id: ::fidl_next::WireU64,
4702}
4703
4704unsafe impl ::fidl_next::Wire for WireWrappedCapabilityId {
4705 type Decoded<'de> = WireWrappedCapabilityId;
4706
4707 #[inline]
4708 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4709}
4710
4711unsafe impl<___D> ::fidl_next::Decode<___D> for WireWrappedCapabilityId
4712where
4713 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4714{
4715 fn decode(
4716 slot: ::fidl_next::Slot<'_, Self>,
4717 decoder: &mut ___D,
4718 ) -> Result<(), ::fidl_next::DecodeError> {
4719 ::fidl_next::munge! {
4720 let Self {
4721 mut id,
4722
4723 } = slot;
4724 }
4725
4726 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
4727
4728 Ok(())
4729 }
4730}
4731
4732pub type WrappedNewCapabilityId = crate::WrappedCapabilityId;
4733
4734pub type WireWrappedNewCapabilityId = crate::WireWrappedCapabilityId;
4736
4737#[derive(Clone, Debug)]
4738pub struct CapabilityStoreDictionaryRemoveRequest {
4739 pub id: u64,
4740
4741 pub key: String,
4742
4743 pub dest_id: Option<Box<crate::WrappedCapabilityId>>,
4744}
4745
4746impl ::fidl_next::Encodable for CapabilityStoreDictionaryRemoveRequest {
4747 type Encoded = WireCapabilityStoreDictionaryRemoveRequest<'static>;
4748}
4749
4750unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryRemoveRequest
4751where
4752 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4753
4754 ___E: ::fidl_next::Encoder,
4755{
4756 #[inline]
4757 fn encode(
4758 self,
4759 encoder: &mut ___E,
4760 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4761 ) -> Result<(), ::fidl_next::EncodeError> {
4762 ::fidl_next::munge! {
4763 let Self::Encoded {
4764 id,
4765 key,
4766 dest_id,
4767
4768 } = out;
4769 }
4770
4771 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4772
4773 ::fidl_next::Encode::encode(self.key, encoder, key)?;
4774
4775 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
4776
4777 Ok(())
4778 }
4779}
4780
4781unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryRemoveRequest
4782where
4783 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4784
4785 ___E: ::fidl_next::Encoder,
4786{
4787 #[inline]
4788 fn encode_ref(
4789 &self,
4790 encoder: &mut ___E,
4791 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4792 ) -> Result<(), ::fidl_next::EncodeError> {
4793 ::fidl_next::munge! {
4794 let Self::Encoded {
4795 id,
4796 key,
4797 dest_id,
4798
4799 } = out;
4800 }
4801
4802 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
4803
4804 ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
4805
4806 ::fidl_next::EncodeRef::encode_ref(&self.dest_id, encoder, dest_id)?;
4807
4808 Ok(())
4809 }
4810}
4811
4812impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryRemoveRequest {
4813 type EncodedOption =
4814 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryRemoveRequest<'static>>;
4815}
4816
4817unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryRemoveRequest
4818where
4819 ___E: ::fidl_next::Encoder + ?Sized,
4820 CapabilityStoreDictionaryRemoveRequest: ::fidl_next::Encode<___E>,
4821{
4822 #[inline]
4823 fn encode_option(
4824 this: Option<Self>,
4825 encoder: &mut ___E,
4826 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4827 ) -> Result<(), ::fidl_next::EncodeError> {
4828 if let Some(inner) = this {
4829 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4830 ::fidl_next::WireBox::encode_present(out);
4831 } else {
4832 ::fidl_next::WireBox::encode_absent(out);
4833 }
4834
4835 Ok(())
4836 }
4837}
4838
4839unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryRemoveRequest
4840where
4841 ___E: ::fidl_next::Encoder + ?Sized,
4842 CapabilityStoreDictionaryRemoveRequest: ::fidl_next::EncodeRef<___E>,
4843{
4844 #[inline]
4845 fn encode_option_ref(
4846 this: Option<&Self>,
4847 encoder: &mut ___E,
4848 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4849 ) -> Result<(), ::fidl_next::EncodeError> {
4850 if let Some(inner) = this {
4851 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
4852 ::fidl_next::WireBox::encode_present(out);
4853 } else {
4854 ::fidl_next::WireBox::encode_absent(out);
4855 }
4856
4857 Ok(())
4858 }
4859}
4860
4861impl<'de> ::fidl_next::FromWire<WireCapabilityStoreDictionaryRemoveRequest<'de>>
4862 for CapabilityStoreDictionaryRemoveRequest
4863{
4864 #[inline]
4865 fn from_wire(wire: WireCapabilityStoreDictionaryRemoveRequest<'de>) -> Self {
4866 Self {
4867 id: ::fidl_next::FromWire::from_wire(wire.id),
4868
4869 key: ::fidl_next::FromWire::from_wire(wire.key),
4870
4871 dest_id: ::fidl_next::FromWire::from_wire(wire.dest_id),
4872 }
4873 }
4874}
4875
4876impl<'de> ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryRemoveRequest<'de>>
4877 for CapabilityStoreDictionaryRemoveRequest
4878{
4879 #[inline]
4880 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryRemoveRequest<'de>) -> Self {
4881 Self {
4882 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
4883
4884 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
4885
4886 dest_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.dest_id),
4887 }
4888 }
4889}
4890
4891#[derive(Debug)]
4893#[repr(C)]
4894pub struct WireCapabilityStoreDictionaryRemoveRequest<'de> {
4895 pub id: ::fidl_next::WireU64,
4896
4897 pub key: ::fidl_next::WireString<'de>,
4898
4899 pub dest_id: ::fidl_next::WireBox<'de, crate::WireWrappedCapabilityId>,
4900}
4901
4902unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryRemoveRequest<'static> {
4903 type Decoded<'de> = WireCapabilityStoreDictionaryRemoveRequest<'de>;
4904
4905 #[inline]
4906 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
4907}
4908
4909unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryRemoveRequest<'static>
4910where
4911 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4912
4913 ___D: ::fidl_next::Decoder,
4914{
4915 fn decode(
4916 slot: ::fidl_next::Slot<'_, Self>,
4917 decoder: &mut ___D,
4918 ) -> Result<(), ::fidl_next::DecodeError> {
4919 ::fidl_next::munge! {
4920 let Self {
4921 mut id,
4922 mut key,
4923 mut dest_id,
4924
4925 } = slot;
4926 }
4927
4928 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
4929
4930 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
4931
4932 let key = unsafe { key.deref_unchecked() };
4933
4934 if key.len() > 255 {
4935 return Err(::fidl_next::DecodeError::VectorTooLong {
4936 size: key.len() as u64,
4937 limit: 255,
4938 });
4939 }
4940
4941 ::fidl_next::Decode::decode(dest_id.as_mut(), decoder)?;
4942
4943 Ok(())
4944 }
4945}
4946
4947pub type CapabilityStoreDictionaryRemoveResponse = ();
4948
4949pub type WireCapabilityStoreDictionaryRemoveResponse = ();
4951
4952#[derive(Clone, Debug)]
4953#[repr(C)]
4954pub struct CapabilityStoreDictionaryCopyRequest {
4955 pub id: u64,
4956
4957 pub dest_id: u64,
4958}
4959
4960impl ::fidl_next::Encodable for CapabilityStoreDictionaryCopyRequest {
4961 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
4962 Self,
4963 WireCapabilityStoreDictionaryCopyRequest,
4964 > = unsafe {
4965 ::fidl_next::CopyOptimization::enable_if(
4966 true && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
4967 && <u64 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
4968 )
4969 };
4970
4971 type Encoded = WireCapabilityStoreDictionaryCopyRequest;
4972}
4973
4974unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryCopyRequest
4975where
4976 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4977{
4978 #[inline]
4979 fn encode(
4980 self,
4981 encoder: &mut ___E,
4982 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4983 ) -> Result<(), ::fidl_next::EncodeError> {
4984 ::fidl_next::munge! {
4985 let Self::Encoded {
4986 id,
4987 dest_id,
4988
4989 } = out;
4990 }
4991
4992 ::fidl_next::Encode::encode(self.id, encoder, id)?;
4993
4994 ::fidl_next::Encode::encode(self.dest_id, encoder, dest_id)?;
4995
4996 Ok(())
4997 }
4998}
4999
5000unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityStoreDictionaryCopyRequest
5001where
5002 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5003{
5004 #[inline]
5005 fn encode_ref(
5006 &self,
5007 encoder: &mut ___E,
5008 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5009 ) -> Result<(), ::fidl_next::EncodeError> {
5010 ::fidl_next::munge! {
5011 let Self::Encoded {
5012 id,
5013 dest_id,
5014
5015 } = out;
5016 }
5017
5018 ::fidl_next::EncodeRef::encode_ref(&self.id, encoder, id)?;
5019
5020 ::fidl_next::EncodeRef::encode_ref(&self.dest_id, encoder, dest_id)?;
5021
5022 Ok(())
5023 }
5024}
5025
5026impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryCopyRequest {
5027 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryCopyRequest>;
5028}
5029
5030unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryCopyRequest
5031where
5032 ___E: ::fidl_next::Encoder + ?Sized,
5033 CapabilityStoreDictionaryCopyRequest: ::fidl_next::Encode<___E>,
5034{
5035 #[inline]
5036 fn encode_option(
5037 this: Option<Self>,
5038 encoder: &mut ___E,
5039 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5040 ) -> Result<(), ::fidl_next::EncodeError> {
5041 if let Some(inner) = this {
5042 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5043 ::fidl_next::WireBox::encode_present(out);
5044 } else {
5045 ::fidl_next::WireBox::encode_absent(out);
5046 }
5047
5048 Ok(())
5049 }
5050}
5051
5052unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityStoreDictionaryCopyRequest
5053where
5054 ___E: ::fidl_next::Encoder + ?Sized,
5055 CapabilityStoreDictionaryCopyRequest: ::fidl_next::EncodeRef<___E>,
5056{
5057 #[inline]
5058 fn encode_option_ref(
5059 this: Option<&Self>,
5060 encoder: &mut ___E,
5061 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5062 ) -> Result<(), ::fidl_next::EncodeError> {
5063 if let Some(inner) = this {
5064 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5065 ::fidl_next::WireBox::encode_present(out);
5066 } else {
5067 ::fidl_next::WireBox::encode_absent(out);
5068 }
5069
5070 Ok(())
5071 }
5072}
5073
5074impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryCopyRequest>
5075 for CapabilityStoreDictionaryCopyRequest
5076{
5077 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
5078 WireCapabilityStoreDictionaryCopyRequest,
5079 Self,
5080 > = unsafe {
5081 ::fidl_next::CopyOptimization::enable_if(
5082 true && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
5083 .is_enabled()
5084 && <u64 as ::fidl_next::FromWire<::fidl_next::WireU64>>::COPY_OPTIMIZATION
5085 .is_enabled(),
5086 )
5087 };
5088
5089 #[inline]
5090 fn from_wire(wire: WireCapabilityStoreDictionaryCopyRequest) -> Self {
5091 Self {
5092 id: ::fidl_next::FromWire::from_wire(wire.id),
5093
5094 dest_id: ::fidl_next::FromWire::from_wire(wire.dest_id),
5095 }
5096 }
5097}
5098
5099impl ::fidl_next::FromWireRef<WireCapabilityStoreDictionaryCopyRequest>
5100 for CapabilityStoreDictionaryCopyRequest
5101{
5102 #[inline]
5103 fn from_wire_ref(wire: &WireCapabilityStoreDictionaryCopyRequest) -> Self {
5104 Self {
5105 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
5106
5107 dest_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.dest_id),
5108 }
5109 }
5110}
5111
5112#[derive(Clone, Debug)]
5114#[repr(C)]
5115pub struct WireCapabilityStoreDictionaryCopyRequest {
5116 pub id: ::fidl_next::WireU64,
5117
5118 pub dest_id: ::fidl_next::WireU64,
5119}
5120
5121unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryCopyRequest {
5122 type Decoded<'de> = WireCapabilityStoreDictionaryCopyRequest;
5123
5124 #[inline]
5125 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5126}
5127
5128unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryCopyRequest
5129where
5130 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5131{
5132 fn decode(
5133 slot: ::fidl_next::Slot<'_, Self>,
5134 decoder: &mut ___D,
5135 ) -> Result<(), ::fidl_next::DecodeError> {
5136 ::fidl_next::munge! {
5137 let Self {
5138 mut id,
5139 mut dest_id,
5140
5141 } = slot;
5142 }
5143
5144 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
5145
5146 ::fidl_next::Decode::decode(dest_id.as_mut(), decoder)?;
5147
5148 Ok(())
5149 }
5150}
5151
5152pub type CapabilityStoreDictionaryCopyResponse = ();
5153
5154pub type WireCapabilityStoreDictionaryCopyResponse = ();
5156
5157#[derive(Debug)]
5158pub struct CapabilityStoreDictionaryKeysRequest {
5159 pub id: u64,
5160
5161 pub iterator:
5162 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::DictionaryKeysIterator>,
5163}
5164
5165impl ::fidl_next::Encodable for CapabilityStoreDictionaryKeysRequest {
5166 type Encoded = WireCapabilityStoreDictionaryKeysRequest;
5167}
5168
5169unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryKeysRequest
5170where
5171 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5172
5173 ___E: ::fidl_next::fuchsia::HandleEncoder,
5174{
5175 #[inline]
5176 fn encode(
5177 self,
5178 encoder: &mut ___E,
5179 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5180 ) -> Result<(), ::fidl_next::EncodeError> {
5181 ::fidl_next::munge! {
5182 let Self::Encoded {
5183 id,
5184 iterator,
5185
5186 } = out;
5187 }
5188
5189 ::fidl_next::Encode::encode(self.id, encoder, id)?;
5190
5191 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
5192
5193 Ok(())
5194 }
5195}
5196
5197impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryKeysRequest {
5198 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryKeysRequest>;
5199}
5200
5201unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryKeysRequest
5202where
5203 ___E: ::fidl_next::Encoder + ?Sized,
5204 CapabilityStoreDictionaryKeysRequest: ::fidl_next::Encode<___E>,
5205{
5206 #[inline]
5207 fn encode_option(
5208 this: Option<Self>,
5209 encoder: &mut ___E,
5210 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5211 ) -> Result<(), ::fidl_next::EncodeError> {
5212 if let Some(inner) = this {
5213 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5214 ::fidl_next::WireBox::encode_present(out);
5215 } else {
5216 ::fidl_next::WireBox::encode_absent(out);
5217 }
5218
5219 Ok(())
5220 }
5221}
5222
5223impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryKeysRequest>
5224 for CapabilityStoreDictionaryKeysRequest
5225{
5226 #[inline]
5227 fn from_wire(wire: WireCapabilityStoreDictionaryKeysRequest) -> Self {
5228 Self {
5229 id: ::fidl_next::FromWire::from_wire(wire.id),
5230
5231 iterator: ::fidl_next::FromWire::from_wire(wire.iterator),
5232 }
5233 }
5234}
5235
5236#[derive(Debug)]
5238#[repr(C)]
5239pub struct WireCapabilityStoreDictionaryKeysRequest {
5240 pub id: ::fidl_next::WireU64,
5241
5242 pub iterator:
5243 ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::DictionaryKeysIterator>,
5244}
5245
5246unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryKeysRequest {
5247 type Decoded<'de> = WireCapabilityStoreDictionaryKeysRequest;
5248
5249 #[inline]
5250 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5251 unsafe {
5252 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
5253 }
5254 }
5255}
5256
5257unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryKeysRequest
5258where
5259 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5260
5261 ___D: ::fidl_next::fuchsia::HandleDecoder,
5262{
5263 fn decode(
5264 slot: ::fidl_next::Slot<'_, Self>,
5265 decoder: &mut ___D,
5266 ) -> Result<(), ::fidl_next::DecodeError> {
5267 ::fidl_next::munge! {
5268 let Self {
5269 mut id,
5270 mut iterator,
5271
5272 } = slot;
5273 }
5274
5275 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
5276
5277 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
5278
5279 Ok(())
5280 }
5281}
5282
5283pub type CapabilityStoreDictionaryKeysResponse = ();
5284
5285pub type WireCapabilityStoreDictionaryKeysResponse = ();
5287
5288#[derive(Debug)]
5289pub struct CapabilityStoreDictionaryEnumerateRequest {
5290 pub id: u64,
5291
5292 pub iterator: ::fidl_next::ServerEnd<
5293 ::fidl_next::fuchsia::zx::Channel,
5294 crate::DictionaryEnumerateIterator,
5295 >,
5296}
5297
5298impl ::fidl_next::Encodable for CapabilityStoreDictionaryEnumerateRequest {
5299 type Encoded = WireCapabilityStoreDictionaryEnumerateRequest;
5300}
5301
5302unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryEnumerateRequest
5303where
5304 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5305
5306 ___E: ::fidl_next::fuchsia::HandleEncoder,
5307{
5308 #[inline]
5309 fn encode(
5310 self,
5311 encoder: &mut ___E,
5312 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5313 ) -> Result<(), ::fidl_next::EncodeError> {
5314 ::fidl_next::munge! {
5315 let Self::Encoded {
5316 id,
5317 iterator,
5318
5319 } = out;
5320 }
5321
5322 ::fidl_next::Encode::encode(self.id, encoder, id)?;
5323
5324 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
5325
5326 Ok(())
5327 }
5328}
5329
5330impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryEnumerateRequest {
5331 type EncodedOption =
5332 ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryEnumerateRequest>;
5333}
5334
5335unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryEnumerateRequest
5336where
5337 ___E: ::fidl_next::Encoder + ?Sized,
5338 CapabilityStoreDictionaryEnumerateRequest: ::fidl_next::Encode<___E>,
5339{
5340 #[inline]
5341 fn encode_option(
5342 this: Option<Self>,
5343 encoder: &mut ___E,
5344 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5345 ) -> Result<(), ::fidl_next::EncodeError> {
5346 if let Some(inner) = this {
5347 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5348 ::fidl_next::WireBox::encode_present(out);
5349 } else {
5350 ::fidl_next::WireBox::encode_absent(out);
5351 }
5352
5353 Ok(())
5354 }
5355}
5356
5357impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryEnumerateRequest>
5358 for CapabilityStoreDictionaryEnumerateRequest
5359{
5360 #[inline]
5361 fn from_wire(wire: WireCapabilityStoreDictionaryEnumerateRequest) -> Self {
5362 Self {
5363 id: ::fidl_next::FromWire::from_wire(wire.id),
5364
5365 iterator: ::fidl_next::FromWire::from_wire(wire.iterator),
5366 }
5367 }
5368}
5369
5370#[derive(Debug)]
5372#[repr(C)]
5373pub struct WireCapabilityStoreDictionaryEnumerateRequest {
5374 pub id: ::fidl_next::WireU64,
5375
5376 pub iterator: ::fidl_next::ServerEnd<
5377 ::fidl_next::fuchsia::WireChannel,
5378 crate::DictionaryEnumerateIterator,
5379 >,
5380}
5381
5382unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryEnumerateRequest {
5383 type Decoded<'de> = WireCapabilityStoreDictionaryEnumerateRequest;
5384
5385 #[inline]
5386 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5387 unsafe {
5388 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
5389 }
5390 }
5391}
5392
5393unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryEnumerateRequest
5394where
5395 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5396
5397 ___D: ::fidl_next::fuchsia::HandleDecoder,
5398{
5399 fn decode(
5400 slot: ::fidl_next::Slot<'_, Self>,
5401 decoder: &mut ___D,
5402 ) -> Result<(), ::fidl_next::DecodeError> {
5403 ::fidl_next::munge! {
5404 let Self {
5405 mut id,
5406 mut iterator,
5407
5408 } = slot;
5409 }
5410
5411 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
5412
5413 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
5414
5415 Ok(())
5416 }
5417}
5418
5419pub type CapabilityStoreDictionaryEnumerateResponse = ();
5420
5421pub type WireCapabilityStoreDictionaryEnumerateResponse = ();
5423
5424#[derive(Debug)]
5425pub struct CapabilityStoreDictionaryDrainRequest {
5426 pub id: u64,
5427
5428 pub iterator: ::fidl_next::ServerEnd<
5429 Option<::fidl_next::fuchsia::zx::Channel>,
5430 crate::DictionaryDrainIterator,
5431 >,
5432}
5433
5434impl ::fidl_next::Encodable for CapabilityStoreDictionaryDrainRequest {
5435 type Encoded = WireCapabilityStoreDictionaryDrainRequest;
5436}
5437
5438unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityStoreDictionaryDrainRequest
5439where
5440 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5441
5442 ___E: ::fidl_next::fuchsia::HandleEncoder,
5443{
5444 #[inline]
5445 fn encode(
5446 self,
5447 encoder: &mut ___E,
5448 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5449 ) -> Result<(), ::fidl_next::EncodeError> {
5450 ::fidl_next::munge! {
5451 let Self::Encoded {
5452 id,
5453 iterator,
5454
5455 } = out;
5456 }
5457
5458 ::fidl_next::Encode::encode(self.id, encoder, id)?;
5459
5460 ::fidl_next::Encode::encode(self.iterator, encoder, iterator)?;
5461
5462 Ok(())
5463 }
5464}
5465
5466impl ::fidl_next::EncodableOption for CapabilityStoreDictionaryDrainRequest {
5467 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityStoreDictionaryDrainRequest>;
5468}
5469
5470unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityStoreDictionaryDrainRequest
5471where
5472 ___E: ::fidl_next::Encoder + ?Sized,
5473 CapabilityStoreDictionaryDrainRequest: ::fidl_next::Encode<___E>,
5474{
5475 #[inline]
5476 fn encode_option(
5477 this: Option<Self>,
5478 encoder: &mut ___E,
5479 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5480 ) -> Result<(), ::fidl_next::EncodeError> {
5481 if let Some(inner) = this {
5482 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5483 ::fidl_next::WireBox::encode_present(out);
5484 } else {
5485 ::fidl_next::WireBox::encode_absent(out);
5486 }
5487
5488 Ok(())
5489 }
5490}
5491
5492impl ::fidl_next::FromWire<WireCapabilityStoreDictionaryDrainRequest>
5493 for CapabilityStoreDictionaryDrainRequest
5494{
5495 #[inline]
5496 fn from_wire(wire: WireCapabilityStoreDictionaryDrainRequest) -> Self {
5497 Self {
5498 id: ::fidl_next::FromWire::from_wire(wire.id),
5499
5500 iterator: ::fidl_next::FromWire::from_wire(wire.iterator),
5501 }
5502 }
5503}
5504
5505#[derive(Debug)]
5507#[repr(C)]
5508pub struct WireCapabilityStoreDictionaryDrainRequest {
5509 pub id: ::fidl_next::WireU64,
5510
5511 pub iterator: ::fidl_next::ServerEnd<
5512 ::fidl_next::fuchsia::WireOptionalChannel,
5513 crate::DictionaryDrainIterator,
5514 >,
5515}
5516
5517unsafe impl ::fidl_next::Wire for WireCapabilityStoreDictionaryDrainRequest {
5518 type Decoded<'de> = WireCapabilityStoreDictionaryDrainRequest;
5519
5520 #[inline]
5521 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5522 unsafe {
5523 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
5524 }
5525 }
5526}
5527
5528unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityStoreDictionaryDrainRequest
5529where
5530 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5531
5532 ___D: ::fidl_next::fuchsia::HandleDecoder,
5533{
5534 fn decode(
5535 slot: ::fidl_next::Slot<'_, Self>,
5536 decoder: &mut ___D,
5537 ) -> Result<(), ::fidl_next::DecodeError> {
5538 ::fidl_next::munge! {
5539 let Self {
5540 mut id,
5541 mut iterator,
5542
5543 } = slot;
5544 }
5545
5546 ::fidl_next::Decode::decode(id.as_mut(), decoder)?;
5547
5548 ::fidl_next::Decode::decode(iterator.as_mut(), decoder)?;
5549
5550 Ok(())
5551 }
5552}
5553
5554pub type CapabilityStoreDictionaryDrainResponse = ();
5555
5556pub type WireCapabilityStoreDictionaryDrainResponse = ();
5558
5559#[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"]
5561#[derive(Debug)]
5562pub struct CapabilityStore;
5563
5564impl ::fidl_next::Discoverable for CapabilityStore {
5565 const PROTOCOL_NAME: &'static str = "capability_store";
5566}
5567
5568pub mod capability_store {
5569 pub mod prelude {
5570 pub use crate::{
5571 capability_store, CapabilityStore, CapabilityStoreClientHandler,
5572 CapabilityStoreClientSender, CapabilityStoreServerHandler, CapabilityStoreServerSender,
5573 };
5574
5575 pub use crate::CapabilityStoreConnectorCreateRequest;
5576
5577 pub use crate::CapabilityStoreConnectorOpenRequest;
5578
5579 pub use crate::CapabilityStoreDictionaryCopyRequest;
5580
5581 pub use crate::CapabilityStoreDictionaryCreateRequest;
5582
5583 pub use crate::CapabilityStoreDictionaryDrainRequest;
5584
5585 pub use crate::CapabilityStoreDictionaryEnumerateRequest;
5586
5587 pub use crate::CapabilityStoreDictionaryGetRequest;
5588
5589 pub use crate::CapabilityStoreDictionaryInsertRequest;
5590
5591 pub use crate::CapabilityStoreDictionaryKeysRequest;
5592
5593 pub use crate::CapabilityStoreDictionaryLegacyExportRequest;
5594
5595 pub use crate::CapabilityStoreDictionaryLegacyImportRequest;
5596
5597 pub use crate::CapabilityStoreDictionaryRemoveRequest;
5598
5599 pub use crate::CapabilityStoreDirConnectorCreateRequest;
5600
5601 pub use crate::CapabilityStoreDirConnectorOpenRequest;
5602
5603 pub use crate::CapabilityStoreDropRequest;
5604
5605 pub use crate::CapabilityStoreDuplicateRequest;
5606
5607 pub use crate::CapabilityStoreError;
5608
5609 pub use crate::CapabilityStoreExportRequest;
5610
5611 pub use crate::CapabilityStoreImportRequest;
5612
5613 pub use crate::CapabilityStoreConnectorCreateResponse;
5614
5615 pub use crate::CapabilityStoreConnectorOpenResponse;
5616
5617 pub use crate::CapabilityStoreDictionaryCopyResponse;
5618
5619 pub use crate::CapabilityStoreDictionaryCreateResponse;
5620
5621 pub use crate::CapabilityStoreDictionaryDrainResponse;
5622
5623 pub use crate::CapabilityStoreDictionaryEnumerateResponse;
5624
5625 pub use crate::CapabilityStoreDictionaryGetResponse;
5626
5627 pub use crate::CapabilityStoreDictionaryInsertResponse;
5628
5629 pub use crate::CapabilityStoreDictionaryKeysResponse;
5630
5631 pub use crate::CapabilityStoreDictionaryLegacyExportResponse;
5632
5633 pub use crate::CapabilityStoreDictionaryLegacyImportResponse;
5634
5635 pub use crate::CapabilityStoreDictionaryRemoveResponse;
5636
5637 pub use crate::CapabilityStoreDirConnectorCreateResponse;
5638
5639 pub use crate::CapabilityStoreDirConnectorOpenResponse;
5640
5641 pub use crate::CapabilityStoreDropResponse;
5642
5643 pub use crate::CapabilityStoreDuplicateResponse;
5644
5645 pub use crate::CapabilityStoreExportResponse;
5646
5647 pub use crate::CapabilityStoreImportResponse;
5648 }
5649
5650 pub struct Duplicate;
5651
5652 impl ::fidl_next::Method for Duplicate {
5653 const ORDINAL: u64 = 6727592627741008260;
5654
5655 type Protocol = crate::CapabilityStore;
5656
5657 type Request = crate::WireCapabilityStoreDuplicateRequest;
5658
5659 type Response = ::fidl_next::WireFlexibleResult<
5660 'static,
5661 crate::WireCapabilityStoreDuplicateResponse,
5662 crate::WireCapabilityStoreError,
5663 >;
5664 }
5665
5666 pub struct Drop;
5667
5668 impl ::fidl_next::Method for Drop {
5669 const ORDINAL: u64 = 753328233834620249;
5670
5671 type Protocol = crate::CapabilityStore;
5672
5673 type Request = crate::WireCapabilityStoreDropRequest;
5674
5675 type Response = ::fidl_next::WireFlexibleResult<
5676 'static,
5677 crate::WireCapabilityStoreDropResponse,
5678 crate::WireCapabilityStoreError,
5679 >;
5680 }
5681
5682 pub struct Export;
5683
5684 impl ::fidl_next::Method for Export {
5685 const ORDINAL: u64 = 226159162093533951;
5686
5687 type Protocol = crate::CapabilityStore;
5688
5689 type Request = crate::WireCapabilityStoreExportRequest;
5690
5691 type Response = ::fidl_next::WireFlexibleResult<
5692 'static,
5693 crate::WireCapabilityStoreExportResponse<'static>,
5694 crate::WireCapabilityStoreError,
5695 >;
5696 }
5697
5698 pub struct Import;
5699
5700 impl ::fidl_next::Method for Import {
5701 const ORDINAL: u64 = 2276030276116435867;
5702
5703 type Protocol = crate::CapabilityStore;
5704
5705 type Request = crate::WireCapabilityStoreImportRequest<'static>;
5706
5707 type Response = ::fidl_next::WireFlexibleResult<
5708 'static,
5709 crate::WireCapabilityStoreImportResponse,
5710 crate::WireCapabilityStoreError,
5711 >;
5712 }
5713
5714 pub struct ConnectorCreate;
5715
5716 impl ::fidl_next::Method for ConnectorCreate {
5717 const ORDINAL: u64 = 2979461408102095909;
5718
5719 type Protocol = crate::CapabilityStore;
5720
5721 type Request = crate::WireCapabilityStoreConnectorCreateRequest;
5722
5723 type Response = ::fidl_next::WireFlexibleResult<
5724 'static,
5725 crate::WireCapabilityStoreConnectorCreateResponse,
5726 crate::WireCapabilityStoreError,
5727 >;
5728 }
5729
5730 pub struct ConnectorOpen;
5731
5732 impl ::fidl_next::Method for ConnectorOpen {
5733 const ORDINAL: u64 = 6016362336453278623;
5734
5735 type Protocol = crate::CapabilityStore;
5736
5737 type Request = crate::WireCapabilityStoreConnectorOpenRequest;
5738
5739 type Response = ::fidl_next::WireFlexibleResult<
5740 'static,
5741 crate::WireCapabilityStoreConnectorOpenResponse,
5742 crate::WireCapabilityStoreError,
5743 >;
5744 }
5745
5746 pub struct DirConnectorCreate;
5747
5748 impl ::fidl_next::Method for DirConnectorCreate {
5749 const ORDINAL: u64 = 1756747594275428795;
5750
5751 type Protocol = crate::CapabilityStore;
5752
5753 type Request = crate::WireCapabilityStoreDirConnectorCreateRequest;
5754
5755 type Response = ::fidl_next::WireFlexibleResult<
5756 'static,
5757 crate::WireCapabilityStoreDirConnectorCreateResponse,
5758 crate::WireCapabilityStoreError,
5759 >;
5760 }
5761
5762 pub struct DirConnectorOpen;
5763
5764 impl ::fidl_next::Method for DirConnectorOpen {
5765 const ORDINAL: u64 = 6219704004220369153;
5766
5767 type Protocol = crate::CapabilityStore;
5768
5769 type Request = crate::WireCapabilityStoreDirConnectorOpenRequest;
5770
5771 type Response = ::fidl_next::WireFlexibleResult<
5772 'static,
5773 crate::WireCapabilityStoreDirConnectorOpenResponse,
5774 crate::WireCapabilityStoreError,
5775 >;
5776 }
5777
5778 pub struct DictionaryCreate;
5779
5780 impl ::fidl_next::Method for DictionaryCreate {
5781 const ORDINAL: u64 = 7608770958894948499;
5782
5783 type Protocol = crate::CapabilityStore;
5784
5785 type Request = crate::WireCapabilityStoreDictionaryCreateRequest;
5786
5787 type Response = ::fidl_next::WireFlexibleResult<
5788 'static,
5789 crate::WireCapabilityStoreDictionaryCreateResponse,
5790 crate::WireCapabilityStoreError,
5791 >;
5792 }
5793
5794 pub struct DictionaryLegacyImport;
5795
5796 impl ::fidl_next::Method for DictionaryLegacyImport {
5797 const ORDINAL: u64 = 8285893703432012383;
5798
5799 type Protocol = crate::CapabilityStore;
5800
5801 type Request = crate::WireCapabilityStoreDictionaryLegacyImportRequest;
5802
5803 type Response = ::fidl_next::WireFlexibleResult<
5804 'static,
5805 crate::WireCapabilityStoreDictionaryLegacyImportResponse,
5806 crate::WireCapabilityStoreError,
5807 >;
5808 }
5809
5810 pub struct DictionaryLegacyExport;
5811
5812 impl ::fidl_next::Method for DictionaryLegacyExport {
5813 const ORDINAL: u64 = 4647175832683306445;
5814
5815 type Protocol = crate::CapabilityStore;
5816
5817 type Request = crate::WireCapabilityStoreDictionaryLegacyExportRequest;
5818
5819 type Response = ::fidl_next::WireFlexibleResult<
5820 'static,
5821 crate::WireCapabilityStoreDictionaryLegacyExportResponse,
5822 crate::WireCapabilityStoreError,
5823 >;
5824 }
5825
5826 pub struct DictionaryInsert;
5827
5828 impl ::fidl_next::Method for DictionaryInsert {
5829 const ORDINAL: u64 = 8575443262986538023;
5830
5831 type Protocol = crate::CapabilityStore;
5832
5833 type Request = crate::WireCapabilityStoreDictionaryInsertRequest<'static>;
5834
5835 type Response = ::fidl_next::WireFlexibleResult<
5836 'static,
5837 crate::WireCapabilityStoreDictionaryInsertResponse,
5838 crate::WireCapabilityStoreError,
5839 >;
5840 }
5841
5842 pub struct DictionaryGet;
5843
5844 impl ::fidl_next::Method for DictionaryGet {
5845 const ORDINAL: u64 = 5592951026866236882;
5846
5847 type Protocol = crate::CapabilityStore;
5848
5849 type Request = crate::WireCapabilityStoreDictionaryGetRequest<'static>;
5850
5851 type Response = ::fidl_next::WireFlexibleResult<
5852 'static,
5853 crate::WireCapabilityStoreDictionaryGetResponse,
5854 crate::WireCapabilityStoreError,
5855 >;
5856 }
5857
5858 pub struct DictionaryRemove;
5859
5860 impl ::fidl_next::Method for DictionaryRemove {
5861 const ORDINAL: u64 = 343892214579320051;
5862
5863 type Protocol = crate::CapabilityStore;
5864
5865 type Request = crate::WireCapabilityStoreDictionaryRemoveRequest<'static>;
5866
5867 type Response = ::fidl_next::WireFlexibleResult<
5868 'static,
5869 crate::WireCapabilityStoreDictionaryRemoveResponse,
5870 crate::WireCapabilityStoreError,
5871 >;
5872 }
5873
5874 pub struct DictionaryCopy;
5875
5876 impl ::fidl_next::Method for DictionaryCopy {
5877 const ORDINAL: u64 = 3977783339739362383;
5878
5879 type Protocol = crate::CapabilityStore;
5880
5881 type Request = crate::WireCapabilityStoreDictionaryCopyRequest;
5882
5883 type Response = ::fidl_next::WireFlexibleResult<
5884 'static,
5885 crate::WireCapabilityStoreDictionaryCopyResponse,
5886 crate::WireCapabilityStoreError,
5887 >;
5888 }
5889
5890 pub struct DictionaryKeys;
5891
5892 impl ::fidl_next::Method for DictionaryKeys {
5893 const ORDINAL: u64 = 597577248872787102;
5894
5895 type Protocol = crate::CapabilityStore;
5896
5897 type Request = crate::WireCapabilityStoreDictionaryKeysRequest;
5898
5899 type Response = ::fidl_next::WireFlexibleResult<
5900 'static,
5901 crate::WireCapabilityStoreDictionaryKeysResponse,
5902 crate::WireCapabilityStoreError,
5903 >;
5904 }
5905
5906 pub struct DictionaryEnumerate;
5907
5908 impl ::fidl_next::Method for DictionaryEnumerate {
5909 const ORDINAL: u64 = 964467096271472193;
5910
5911 type Protocol = crate::CapabilityStore;
5912
5913 type Request = crate::WireCapabilityStoreDictionaryEnumerateRequest;
5914
5915 type Response = ::fidl_next::WireFlexibleResult<
5916 'static,
5917 crate::WireCapabilityStoreDictionaryEnumerateResponse,
5918 crate::WireCapabilityStoreError,
5919 >;
5920 }
5921
5922 pub struct DictionaryDrain;
5923
5924 impl ::fidl_next::Method for DictionaryDrain {
5925 const ORDINAL: u64 = 2928364469569621208;
5926
5927 type Protocol = crate::CapabilityStore;
5928
5929 type Request = crate::WireCapabilityStoreDictionaryDrainRequest;
5930
5931 type Response = ::fidl_next::WireFlexibleResult<
5932 'static,
5933 crate::WireCapabilityStoreDictionaryDrainResponse,
5934 crate::WireCapabilityStoreError,
5935 >;
5936 }
5937}
5938
5939pub trait CapabilityStoreClientSender {
5941 type Transport: ::fidl_next::Transport;
5942
5943 #[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"]
5944 fn duplicate<___R>(
5945 &self,
5946 request: ___R,
5947 ) -> Result<
5948 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::Duplicate>,
5949 ::fidl_next::EncodeError,
5950 >
5951 where
5952 ___R: ::fidl_next::Encode<
5953 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
5954 Encoded = crate::WireCapabilityStoreDuplicateRequest,
5955 >;
5956
5957 #[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"]
5958 fn drop<___R>(
5959 &self,
5960 request: ___R,
5961 ) -> Result<
5962 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::Drop>,
5963 ::fidl_next::EncodeError,
5964 >
5965 where
5966 ___R: ::fidl_next::Encode<
5967 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
5968 Encoded = crate::WireCapabilityStoreDropRequest,
5969 >;
5970
5971 #[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"]
5972 fn export<___R>(
5973 &self,
5974 request: ___R,
5975 ) -> Result<
5976 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::Export>,
5977 ::fidl_next::EncodeError,
5978 >
5979 where
5980 ___R: ::fidl_next::Encode<
5981 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
5982 Encoded = crate::WireCapabilityStoreExportRequest,
5983 >;
5984
5985 #[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"]
5986 fn import<___R>(
5987 &self,
5988 request: ___R,
5989 ) -> Result<
5990 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::Import>,
5991 ::fidl_next::EncodeError,
5992 >
5993 where
5994 ___R: ::fidl_next::Encode<
5995 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
5996 Encoded = crate::WireCapabilityStoreImportRequest<'static>,
5997 >;
5998
5999 #[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"]
6000 fn connector_create<___R>(
6001 &self,
6002 request: ___R,
6003 ) -> Result<
6004 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::ConnectorCreate>,
6005 ::fidl_next::EncodeError,
6006 >
6007 where
6008 ___R: ::fidl_next::Encode<
6009 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6010 Encoded = crate::WireCapabilityStoreConnectorCreateRequest,
6011 >;
6012
6013 #[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"]
6014 fn connector_open<___R>(
6015 &self,
6016 request: ___R,
6017 ) -> Result<
6018 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::ConnectorOpen>,
6019 ::fidl_next::EncodeError,
6020 >
6021 where
6022 ___R: ::fidl_next::Encode<
6023 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6024 Encoded = crate::WireCapabilityStoreConnectorOpenRequest,
6025 >;
6026
6027 #[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"]
6028 fn dir_connector_create<___R>(
6029 &self,
6030 request: ___R,
6031 ) -> Result<
6032 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DirConnectorCreate>,
6033 ::fidl_next::EncodeError,
6034 >
6035 where
6036 ___R: ::fidl_next::Encode<
6037 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6038 Encoded = crate::WireCapabilityStoreDirConnectorCreateRequest,
6039 >;
6040
6041 #[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"]
6042 fn dir_connector_open<___R>(
6043 &self,
6044 request: ___R,
6045 ) -> Result<
6046 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DirConnectorOpen>,
6047 ::fidl_next::EncodeError,
6048 >
6049 where
6050 ___R: ::fidl_next::Encode<
6051 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6052 Encoded = crate::WireCapabilityStoreDirConnectorOpenRequest,
6053 >;
6054
6055 #[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"]
6056 fn dictionary_create<___R>(
6057 &self,
6058 request: ___R,
6059 ) -> Result<
6060 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryCreate>,
6061 ::fidl_next::EncodeError,
6062 >
6063 where
6064 ___R: ::fidl_next::Encode<
6065 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6066 Encoded = crate::WireCapabilityStoreDictionaryCreateRequest,
6067 >;
6068
6069 #[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"]
6070 fn dictionary_legacy_import<___R>(
6071 &self,
6072 request: ___R,
6073 ) -> Result<
6074 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryLegacyImport>,
6075 ::fidl_next::EncodeError,
6076 >
6077 where
6078 ___R: ::fidl_next::Encode<
6079 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6080 Encoded = crate::WireCapabilityStoreDictionaryLegacyImportRequest,
6081 >;
6082
6083 #[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"]
6084 fn dictionary_legacy_export<___R>(
6085 &self,
6086 request: ___R,
6087 ) -> Result<
6088 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryLegacyExport>,
6089 ::fidl_next::EncodeError,
6090 >
6091 where
6092 ___R: ::fidl_next::Encode<
6093 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6094 Encoded = crate::WireCapabilityStoreDictionaryLegacyExportRequest,
6095 >;
6096
6097 #[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"]
6098 fn dictionary_insert<___R>(
6099 &self,
6100 request: ___R,
6101 ) -> Result<
6102 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryInsert>,
6103 ::fidl_next::EncodeError,
6104 >
6105 where
6106 ___R: ::fidl_next::Encode<
6107 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6108 Encoded = crate::WireCapabilityStoreDictionaryInsertRequest<'static>,
6109 >;
6110
6111 #[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"]
6112 fn dictionary_get<___R>(
6113 &self,
6114 request: ___R,
6115 ) -> Result<
6116 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryGet>,
6117 ::fidl_next::EncodeError,
6118 >
6119 where
6120 ___R: ::fidl_next::Encode<
6121 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6122 Encoded = crate::WireCapabilityStoreDictionaryGetRequest<'static>,
6123 >;
6124
6125 #[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"]
6126 fn dictionary_remove<___R>(
6127 &self,
6128 request: ___R,
6129 ) -> Result<
6130 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryRemove>,
6131 ::fidl_next::EncodeError,
6132 >
6133 where
6134 ___R: ::fidl_next::Encode<
6135 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6136 Encoded = crate::WireCapabilityStoreDictionaryRemoveRequest<'static>,
6137 >;
6138
6139 #[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"]
6140 fn dictionary_copy<___R>(
6141 &self,
6142 request: ___R,
6143 ) -> Result<
6144 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryCopy>,
6145 ::fidl_next::EncodeError,
6146 >
6147 where
6148 ___R: ::fidl_next::Encode<
6149 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6150 Encoded = crate::WireCapabilityStoreDictionaryCopyRequest,
6151 >;
6152
6153 #[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"]
6154 fn dictionary_keys<___R>(
6155 &self,
6156 request: ___R,
6157 ) -> Result<
6158 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryKeys>,
6159 ::fidl_next::EncodeError,
6160 >
6161 where
6162 ___R: ::fidl_next::Encode<
6163 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6164 Encoded = crate::WireCapabilityStoreDictionaryKeysRequest,
6165 >;
6166
6167 #[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"]
6168 fn dictionary_enumerate<___R>(
6169 &self,
6170 request: ___R,
6171 ) -> Result<
6172 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryEnumerate>,
6173 ::fidl_next::EncodeError,
6174 >
6175 where
6176 ___R: ::fidl_next::Encode<
6177 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6178 Encoded = crate::WireCapabilityStoreDictionaryEnumerateRequest,
6179 >;
6180
6181 #[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"]
6182 fn dictionary_drain<___R>(
6183 &self,
6184 request: ___R,
6185 ) -> Result<
6186 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryDrain>,
6187 ::fidl_next::EncodeError,
6188 >
6189 where
6190 ___R: ::fidl_next::Encode<
6191 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6192 Encoded = crate::WireCapabilityStoreDictionaryDrainRequest,
6193 >;
6194}
6195
6196impl<___T> CapabilityStoreClientSender for ::fidl_next::ClientSender<___T, CapabilityStore>
6197where
6198 ___T: ::fidl_next::Transport,
6199{
6200 type Transport = ___T;
6201
6202 #[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"]
6203 fn duplicate<___R>(
6204 &self,
6205 request: ___R,
6206 ) -> Result<
6207 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::Duplicate>,
6208 ::fidl_next::EncodeError,
6209 >
6210 where
6211 ___R: ::fidl_next::Encode<
6212 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6213 Encoded = crate::WireCapabilityStoreDuplicateRequest,
6214 >,
6215 {
6216 self.as_untyped()
6217 .send_two_way(6727592627741008260, request)
6218 .map(::fidl_next::ResponseFuture::from_untyped)
6219 }
6220
6221 #[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"]
6222 fn drop<___R>(
6223 &self,
6224 request: ___R,
6225 ) -> Result<
6226 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::Drop>,
6227 ::fidl_next::EncodeError,
6228 >
6229 where
6230 ___R: ::fidl_next::Encode<
6231 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6232 Encoded = crate::WireCapabilityStoreDropRequest,
6233 >,
6234 {
6235 self.as_untyped()
6236 .send_two_way(753328233834620249, request)
6237 .map(::fidl_next::ResponseFuture::from_untyped)
6238 }
6239
6240 #[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"]
6241 fn export<___R>(
6242 &self,
6243 request: ___R,
6244 ) -> Result<
6245 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::Export>,
6246 ::fidl_next::EncodeError,
6247 >
6248 where
6249 ___R: ::fidl_next::Encode<
6250 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6251 Encoded = crate::WireCapabilityStoreExportRequest,
6252 >,
6253 {
6254 self.as_untyped()
6255 .send_two_way(226159162093533951, request)
6256 .map(::fidl_next::ResponseFuture::from_untyped)
6257 }
6258
6259 #[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"]
6260 fn import<___R>(
6261 &self,
6262 request: ___R,
6263 ) -> Result<
6264 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::Import>,
6265 ::fidl_next::EncodeError,
6266 >
6267 where
6268 ___R: ::fidl_next::Encode<
6269 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6270 Encoded = crate::WireCapabilityStoreImportRequest<'static>,
6271 >,
6272 {
6273 self.as_untyped()
6274 .send_two_way(2276030276116435867, request)
6275 .map(::fidl_next::ResponseFuture::from_untyped)
6276 }
6277
6278 #[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"]
6279 fn connector_create<___R>(
6280 &self,
6281 request: ___R,
6282 ) -> Result<
6283 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::ConnectorCreate>,
6284 ::fidl_next::EncodeError,
6285 >
6286 where
6287 ___R: ::fidl_next::Encode<
6288 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6289 Encoded = crate::WireCapabilityStoreConnectorCreateRequest,
6290 >,
6291 {
6292 self.as_untyped()
6293 .send_two_way(2979461408102095909, request)
6294 .map(::fidl_next::ResponseFuture::from_untyped)
6295 }
6296
6297 #[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"]
6298 fn connector_open<___R>(
6299 &self,
6300 request: ___R,
6301 ) -> Result<
6302 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::ConnectorOpen>,
6303 ::fidl_next::EncodeError,
6304 >
6305 where
6306 ___R: ::fidl_next::Encode<
6307 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6308 Encoded = crate::WireCapabilityStoreConnectorOpenRequest,
6309 >,
6310 {
6311 self.as_untyped()
6312 .send_two_way(6016362336453278623, request)
6313 .map(::fidl_next::ResponseFuture::from_untyped)
6314 }
6315
6316 #[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"]
6317 fn dir_connector_create<___R>(
6318 &self,
6319 request: ___R,
6320 ) -> Result<
6321 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DirConnectorCreate>,
6322 ::fidl_next::EncodeError,
6323 >
6324 where
6325 ___R: ::fidl_next::Encode<
6326 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6327 Encoded = crate::WireCapabilityStoreDirConnectorCreateRequest,
6328 >,
6329 {
6330 self.as_untyped()
6331 .send_two_way(1756747594275428795, request)
6332 .map(::fidl_next::ResponseFuture::from_untyped)
6333 }
6334
6335 #[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"]
6336 fn dir_connector_open<___R>(
6337 &self,
6338 request: ___R,
6339 ) -> Result<
6340 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DirConnectorOpen>,
6341 ::fidl_next::EncodeError,
6342 >
6343 where
6344 ___R: ::fidl_next::Encode<
6345 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6346 Encoded = crate::WireCapabilityStoreDirConnectorOpenRequest,
6347 >,
6348 {
6349 self.as_untyped()
6350 .send_two_way(6219704004220369153, request)
6351 .map(::fidl_next::ResponseFuture::from_untyped)
6352 }
6353
6354 #[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"]
6355 fn dictionary_create<___R>(
6356 &self,
6357 request: ___R,
6358 ) -> Result<
6359 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryCreate>,
6360 ::fidl_next::EncodeError,
6361 >
6362 where
6363 ___R: ::fidl_next::Encode<
6364 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6365 Encoded = crate::WireCapabilityStoreDictionaryCreateRequest,
6366 >,
6367 {
6368 self.as_untyped()
6369 .send_two_way(7608770958894948499, request)
6370 .map(::fidl_next::ResponseFuture::from_untyped)
6371 }
6372
6373 #[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"]
6374 fn dictionary_legacy_import<___R>(
6375 &self,
6376 request: ___R,
6377 ) -> Result<
6378 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryLegacyImport>,
6379 ::fidl_next::EncodeError,
6380 >
6381 where
6382 ___R: ::fidl_next::Encode<
6383 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6384 Encoded = crate::WireCapabilityStoreDictionaryLegacyImportRequest,
6385 >,
6386 {
6387 self.as_untyped()
6388 .send_two_way(8285893703432012383, request)
6389 .map(::fidl_next::ResponseFuture::from_untyped)
6390 }
6391
6392 #[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"]
6393 fn dictionary_legacy_export<___R>(
6394 &self,
6395 request: ___R,
6396 ) -> Result<
6397 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryLegacyExport>,
6398 ::fidl_next::EncodeError,
6399 >
6400 where
6401 ___R: ::fidl_next::Encode<
6402 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6403 Encoded = crate::WireCapabilityStoreDictionaryLegacyExportRequest,
6404 >,
6405 {
6406 self.as_untyped()
6407 .send_two_way(4647175832683306445, request)
6408 .map(::fidl_next::ResponseFuture::from_untyped)
6409 }
6410
6411 #[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"]
6412 fn dictionary_insert<___R>(
6413 &self,
6414 request: ___R,
6415 ) -> Result<
6416 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryInsert>,
6417 ::fidl_next::EncodeError,
6418 >
6419 where
6420 ___R: ::fidl_next::Encode<
6421 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6422 Encoded = crate::WireCapabilityStoreDictionaryInsertRequest<'static>,
6423 >,
6424 {
6425 self.as_untyped()
6426 .send_two_way(8575443262986538023, request)
6427 .map(::fidl_next::ResponseFuture::from_untyped)
6428 }
6429
6430 #[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"]
6431 fn dictionary_get<___R>(
6432 &self,
6433 request: ___R,
6434 ) -> Result<
6435 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryGet>,
6436 ::fidl_next::EncodeError,
6437 >
6438 where
6439 ___R: ::fidl_next::Encode<
6440 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6441 Encoded = crate::WireCapabilityStoreDictionaryGetRequest<'static>,
6442 >,
6443 {
6444 self.as_untyped()
6445 .send_two_way(5592951026866236882, request)
6446 .map(::fidl_next::ResponseFuture::from_untyped)
6447 }
6448
6449 #[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"]
6450 fn dictionary_remove<___R>(
6451 &self,
6452 request: ___R,
6453 ) -> Result<
6454 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryRemove>,
6455 ::fidl_next::EncodeError,
6456 >
6457 where
6458 ___R: ::fidl_next::Encode<
6459 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6460 Encoded = crate::WireCapabilityStoreDictionaryRemoveRequest<'static>,
6461 >,
6462 {
6463 self.as_untyped()
6464 .send_two_way(343892214579320051, request)
6465 .map(::fidl_next::ResponseFuture::from_untyped)
6466 }
6467
6468 #[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"]
6469 fn dictionary_copy<___R>(
6470 &self,
6471 request: ___R,
6472 ) -> Result<
6473 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryCopy>,
6474 ::fidl_next::EncodeError,
6475 >
6476 where
6477 ___R: ::fidl_next::Encode<
6478 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6479 Encoded = crate::WireCapabilityStoreDictionaryCopyRequest,
6480 >,
6481 {
6482 self.as_untyped()
6483 .send_two_way(3977783339739362383, request)
6484 .map(::fidl_next::ResponseFuture::from_untyped)
6485 }
6486
6487 #[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"]
6488 fn dictionary_keys<___R>(
6489 &self,
6490 request: ___R,
6491 ) -> Result<
6492 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryKeys>,
6493 ::fidl_next::EncodeError,
6494 >
6495 where
6496 ___R: ::fidl_next::Encode<
6497 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6498 Encoded = crate::WireCapabilityStoreDictionaryKeysRequest,
6499 >,
6500 {
6501 self.as_untyped()
6502 .send_two_way(597577248872787102, request)
6503 .map(::fidl_next::ResponseFuture::from_untyped)
6504 }
6505
6506 #[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"]
6507 fn dictionary_enumerate<___R>(
6508 &self,
6509 request: ___R,
6510 ) -> Result<
6511 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryEnumerate>,
6512 ::fidl_next::EncodeError,
6513 >
6514 where
6515 ___R: ::fidl_next::Encode<
6516 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6517 Encoded = crate::WireCapabilityStoreDictionaryEnumerateRequest,
6518 >,
6519 {
6520 self.as_untyped()
6521 .send_two_way(964467096271472193, request)
6522 .map(::fidl_next::ResponseFuture::from_untyped)
6523 }
6524
6525 #[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"]
6526 fn dictionary_drain<___R>(
6527 &self,
6528 request: ___R,
6529 ) -> Result<
6530 ::fidl_next::ResponseFuture<'_, Self::Transport, capability_store::DictionaryDrain>,
6531 ::fidl_next::EncodeError,
6532 >
6533 where
6534 ___R: ::fidl_next::Encode<
6535 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6536 Encoded = crate::WireCapabilityStoreDictionaryDrainRequest,
6537 >,
6538 {
6539 self.as_untyped()
6540 .send_two_way(2928364469569621208, request)
6541 .map(::fidl_next::ResponseFuture::from_untyped)
6542 }
6543}
6544
6545pub trait CapabilityStoreClientHandler<___T: ::fidl_next::Transport> {
6549 fn on_unknown_interaction(
6550 &mut self,
6551 sender: &::fidl_next::ClientSender<___T, CapabilityStore>,
6552 ordinal: u64,
6553 ) {
6554 sender.close();
6555 }
6556}
6557
6558impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for CapabilityStore
6559where
6560 ___T: ::fidl_next::Transport,
6561 ___H: CapabilityStoreClientHandler<___T>,
6562
6563 <capability_store::Duplicate as ::fidl_next::Method>::Response:
6564 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6565
6566 <capability_store::Drop as ::fidl_next::Method>::Response:
6567 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6568
6569 <capability_store::Export as ::fidl_next::Method>::Response:
6570 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6571
6572 <capability_store::Import as ::fidl_next::Method>::Response:
6573 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6574
6575 <capability_store::ConnectorCreate as ::fidl_next::Method>::Response:
6576 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6577
6578 <capability_store::ConnectorOpen as ::fidl_next::Method>::Response:
6579 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6580
6581 <capability_store::DirConnectorCreate as ::fidl_next::Method>::Response:
6582 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6583
6584 <capability_store::DirConnectorOpen as ::fidl_next::Method>::Response:
6585 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6586
6587 <capability_store::DictionaryCreate as ::fidl_next::Method>::Response:
6588 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6589
6590 <capability_store::DictionaryLegacyImport as ::fidl_next::Method>::Response:
6591 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6592
6593 <capability_store::DictionaryLegacyExport as ::fidl_next::Method>::Response:
6594 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6595
6596 <capability_store::DictionaryInsert as ::fidl_next::Method>::Response:
6597 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6598
6599 <capability_store::DictionaryGet as ::fidl_next::Method>::Response:
6600 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6601
6602 <capability_store::DictionaryRemove as ::fidl_next::Method>::Response:
6603 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6604
6605 <capability_store::DictionaryCopy as ::fidl_next::Method>::Response:
6606 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6607
6608 <capability_store::DictionaryKeys as ::fidl_next::Method>::Response:
6609 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6610
6611 <capability_store::DictionaryEnumerate as ::fidl_next::Method>::Response:
6612 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6613
6614 <capability_store::DictionaryDrain as ::fidl_next::Method>::Response:
6615 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6616{
6617 fn on_event(
6618 handler: &mut ___H,
6619 sender: &::fidl_next::ClientSender<___T, Self>,
6620 ordinal: u64,
6621 buffer: ___T::RecvBuffer,
6622 ) {
6623 match ordinal {
6624 ordinal => handler.on_unknown_interaction(sender, ordinal),
6625 }
6626 }
6627}
6628
6629pub trait CapabilityStoreServerSender {
6631 type Transport: ::fidl_next::Transport;
6632}
6633
6634impl<___T> CapabilityStoreServerSender for ::fidl_next::ServerSender<___T, CapabilityStore>
6635where
6636 ___T: ::fidl_next::Transport,
6637{
6638 type Transport = ___T;
6639}
6640
6641pub trait CapabilityStoreServerHandler<___T: ::fidl_next::Transport> {
6645 #[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"]
6646 fn duplicate(
6647 &mut self,
6648 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6649
6650 request: ::fidl_next::Request<___T, capability_store::Duplicate>,
6651
6652 responder: ::fidl_next::Responder<capability_store::Duplicate>,
6653 );
6654
6655 #[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"]
6656 fn drop(
6657 &mut self,
6658 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6659
6660 request: ::fidl_next::Request<___T, capability_store::Drop>,
6661
6662 responder: ::fidl_next::Responder<capability_store::Drop>,
6663 );
6664
6665 #[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"]
6666 fn export(
6667 &mut self,
6668 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6669
6670 request: ::fidl_next::Request<___T, capability_store::Export>,
6671
6672 responder: ::fidl_next::Responder<capability_store::Export>,
6673 );
6674
6675 #[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"]
6676 fn import(
6677 &mut self,
6678 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6679
6680 request: ::fidl_next::Request<___T, capability_store::Import>,
6681
6682 responder: ::fidl_next::Responder<capability_store::Import>,
6683 );
6684
6685 #[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"]
6686 fn connector_create(
6687 &mut self,
6688 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6689
6690 request: ::fidl_next::Request<___T, capability_store::ConnectorCreate>,
6691
6692 responder: ::fidl_next::Responder<capability_store::ConnectorCreate>,
6693 );
6694
6695 #[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"]
6696 fn connector_open(
6697 &mut self,
6698 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6699
6700 request: ::fidl_next::Request<___T, capability_store::ConnectorOpen>,
6701
6702 responder: ::fidl_next::Responder<capability_store::ConnectorOpen>,
6703 );
6704
6705 #[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"]
6706 fn dir_connector_create(
6707 &mut self,
6708 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6709
6710 request: ::fidl_next::Request<___T, capability_store::DirConnectorCreate>,
6711
6712 responder: ::fidl_next::Responder<capability_store::DirConnectorCreate>,
6713 );
6714
6715 #[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"]
6716 fn dir_connector_open(
6717 &mut self,
6718 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6719
6720 request: ::fidl_next::Request<___T, capability_store::DirConnectorOpen>,
6721
6722 responder: ::fidl_next::Responder<capability_store::DirConnectorOpen>,
6723 );
6724
6725 #[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"]
6726 fn dictionary_create(
6727 &mut self,
6728 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6729
6730 request: ::fidl_next::Request<___T, capability_store::DictionaryCreate>,
6731
6732 responder: ::fidl_next::Responder<capability_store::DictionaryCreate>,
6733 );
6734
6735 #[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"]
6736 fn dictionary_legacy_import(
6737 &mut self,
6738 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6739
6740 request: ::fidl_next::Request<___T, capability_store::DictionaryLegacyImport>,
6741
6742 responder: ::fidl_next::Responder<capability_store::DictionaryLegacyImport>,
6743 );
6744
6745 #[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"]
6746 fn dictionary_legacy_export(
6747 &mut self,
6748 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6749
6750 request: ::fidl_next::Request<___T, capability_store::DictionaryLegacyExport>,
6751
6752 responder: ::fidl_next::Responder<capability_store::DictionaryLegacyExport>,
6753 );
6754
6755 #[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"]
6756 fn dictionary_insert(
6757 &mut self,
6758 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6759
6760 request: ::fidl_next::Request<___T, capability_store::DictionaryInsert>,
6761
6762 responder: ::fidl_next::Responder<capability_store::DictionaryInsert>,
6763 );
6764
6765 #[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"]
6766 fn dictionary_get(
6767 &mut self,
6768 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6769
6770 request: ::fidl_next::Request<___T, capability_store::DictionaryGet>,
6771
6772 responder: ::fidl_next::Responder<capability_store::DictionaryGet>,
6773 );
6774
6775 #[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"]
6776 fn dictionary_remove(
6777 &mut self,
6778 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6779
6780 request: ::fidl_next::Request<___T, capability_store::DictionaryRemove>,
6781
6782 responder: ::fidl_next::Responder<capability_store::DictionaryRemove>,
6783 );
6784
6785 #[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"]
6786 fn dictionary_copy(
6787 &mut self,
6788 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6789
6790 request: ::fidl_next::Request<___T, capability_store::DictionaryCopy>,
6791
6792 responder: ::fidl_next::Responder<capability_store::DictionaryCopy>,
6793 );
6794
6795 #[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"]
6796 fn dictionary_keys(
6797 &mut self,
6798 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6799
6800 request: ::fidl_next::Request<___T, capability_store::DictionaryKeys>,
6801
6802 responder: ::fidl_next::Responder<capability_store::DictionaryKeys>,
6803 );
6804
6805 #[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"]
6806 fn dictionary_enumerate(
6807 &mut self,
6808 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6809
6810 request: ::fidl_next::Request<___T, capability_store::DictionaryEnumerate>,
6811
6812 responder: ::fidl_next::Responder<capability_store::DictionaryEnumerate>,
6813 );
6814
6815 #[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"]
6816 fn dictionary_drain(
6817 &mut self,
6818 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6819
6820 request: ::fidl_next::Request<___T, capability_store::DictionaryDrain>,
6821
6822 responder: ::fidl_next::Responder<capability_store::DictionaryDrain>,
6823 );
6824
6825 fn on_unknown_interaction(
6826 &mut self,
6827 sender: &::fidl_next::ServerSender<___T, CapabilityStore>,
6828 ordinal: u64,
6829 ) {
6830 sender.close();
6831 }
6832}
6833
6834impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for CapabilityStore
6835where
6836 ___T: ::fidl_next::Transport,
6837 ___H: CapabilityStoreServerHandler<___T>,
6838
6839 <capability_store::Duplicate as ::fidl_next::Method>::Request:
6840 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6841
6842 <capability_store::Drop as ::fidl_next::Method>::Request:
6843 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6844
6845 <capability_store::Export as ::fidl_next::Method>::Request:
6846 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6847
6848 <capability_store::Import as ::fidl_next::Method>::Request:
6849 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6850
6851 <capability_store::ConnectorCreate as ::fidl_next::Method>::Request:
6852 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6853
6854 <capability_store::ConnectorOpen as ::fidl_next::Method>::Request:
6855 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6856
6857 <capability_store::DirConnectorCreate as ::fidl_next::Method>::Request:
6858 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6859
6860 <capability_store::DirConnectorOpen as ::fidl_next::Method>::Request:
6861 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6862
6863 <capability_store::DictionaryCreate as ::fidl_next::Method>::Request:
6864 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6865
6866 <capability_store::DictionaryLegacyImport as ::fidl_next::Method>::Request:
6867 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6868
6869 <capability_store::DictionaryLegacyExport as ::fidl_next::Method>::Request:
6870 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6871
6872 <capability_store::DictionaryInsert as ::fidl_next::Method>::Request:
6873 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6874
6875 <capability_store::DictionaryGet as ::fidl_next::Method>::Request:
6876 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6877
6878 <capability_store::DictionaryRemove as ::fidl_next::Method>::Request:
6879 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6880
6881 <capability_store::DictionaryCopy as ::fidl_next::Method>::Request:
6882 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6883
6884 <capability_store::DictionaryKeys as ::fidl_next::Method>::Request:
6885 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6886
6887 <capability_store::DictionaryEnumerate as ::fidl_next::Method>::Request:
6888 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6889
6890 <capability_store::DictionaryDrain as ::fidl_next::Method>::Request:
6891 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6892{
6893 fn on_one_way(
6894 handler: &mut ___H,
6895 sender: &::fidl_next::ServerSender<___T, Self>,
6896 ordinal: u64,
6897 buffer: ___T::RecvBuffer,
6898 ) {
6899 match ordinal {
6900 ordinal => handler.on_unknown_interaction(sender, ordinal),
6901 }
6902 }
6903
6904 fn on_two_way(
6905 handler: &mut ___H,
6906 sender: &::fidl_next::ServerSender<___T, Self>,
6907 ordinal: u64,
6908 buffer: ___T::RecvBuffer,
6909 responder: ::fidl_next::protocol::Responder,
6910 ) {
6911 match ordinal {
6912 6727592627741008260 => {
6913 let responder = ::fidl_next::Responder::from_untyped(responder);
6914
6915 match ::fidl_next::DecoderExt::decode(buffer) {
6916 Ok(decoded) => handler.duplicate(sender, decoded, responder),
6917 Err(e) => {
6918 sender.close();
6919 }
6920 }
6921 }
6922
6923 753328233834620249 => {
6924 let responder = ::fidl_next::Responder::from_untyped(responder);
6925
6926 match ::fidl_next::DecoderExt::decode(buffer) {
6927 Ok(decoded) => handler.drop(sender, decoded, responder),
6928 Err(e) => {
6929 sender.close();
6930 }
6931 }
6932 }
6933
6934 226159162093533951 => {
6935 let responder = ::fidl_next::Responder::from_untyped(responder);
6936
6937 match ::fidl_next::DecoderExt::decode(buffer) {
6938 Ok(decoded) => handler.export(sender, decoded, responder),
6939 Err(e) => {
6940 sender.close();
6941 }
6942 }
6943 }
6944
6945 2276030276116435867 => {
6946 let responder = ::fidl_next::Responder::from_untyped(responder);
6947
6948 match ::fidl_next::DecoderExt::decode(buffer) {
6949 Ok(decoded) => handler.import(sender, decoded, responder),
6950 Err(e) => {
6951 sender.close();
6952 }
6953 }
6954 }
6955
6956 2979461408102095909 => {
6957 let responder = ::fidl_next::Responder::from_untyped(responder);
6958
6959 match ::fidl_next::DecoderExt::decode(buffer) {
6960 Ok(decoded) => handler.connector_create(sender, decoded, responder),
6961 Err(e) => {
6962 sender.close();
6963 }
6964 }
6965 }
6966
6967 6016362336453278623 => {
6968 let responder = ::fidl_next::Responder::from_untyped(responder);
6969
6970 match ::fidl_next::DecoderExt::decode(buffer) {
6971 Ok(decoded) => handler.connector_open(sender, decoded, responder),
6972 Err(e) => {
6973 sender.close();
6974 }
6975 }
6976 }
6977
6978 1756747594275428795 => {
6979 let responder = ::fidl_next::Responder::from_untyped(responder);
6980
6981 match ::fidl_next::DecoderExt::decode(buffer) {
6982 Ok(decoded) => handler.dir_connector_create(sender, decoded, responder),
6983 Err(e) => {
6984 sender.close();
6985 }
6986 }
6987 }
6988
6989 6219704004220369153 => {
6990 let responder = ::fidl_next::Responder::from_untyped(responder);
6991
6992 match ::fidl_next::DecoderExt::decode(buffer) {
6993 Ok(decoded) => handler.dir_connector_open(sender, decoded, responder),
6994 Err(e) => {
6995 sender.close();
6996 }
6997 }
6998 }
6999
7000 7608770958894948499 => {
7001 let responder = ::fidl_next::Responder::from_untyped(responder);
7002
7003 match ::fidl_next::DecoderExt::decode(buffer) {
7004 Ok(decoded) => handler.dictionary_create(sender, decoded, responder),
7005 Err(e) => {
7006 sender.close();
7007 }
7008 }
7009 }
7010
7011 8285893703432012383 => {
7012 let responder = ::fidl_next::Responder::from_untyped(responder);
7013
7014 match ::fidl_next::DecoderExt::decode(buffer) {
7015 Ok(decoded) => handler.dictionary_legacy_import(sender, decoded, responder),
7016 Err(e) => {
7017 sender.close();
7018 }
7019 }
7020 }
7021
7022 4647175832683306445 => {
7023 let responder = ::fidl_next::Responder::from_untyped(responder);
7024
7025 match ::fidl_next::DecoderExt::decode(buffer) {
7026 Ok(decoded) => handler.dictionary_legacy_export(sender, decoded, responder),
7027 Err(e) => {
7028 sender.close();
7029 }
7030 }
7031 }
7032
7033 8575443262986538023 => {
7034 let responder = ::fidl_next::Responder::from_untyped(responder);
7035
7036 match ::fidl_next::DecoderExt::decode(buffer) {
7037 Ok(decoded) => handler.dictionary_insert(sender, decoded, responder),
7038 Err(e) => {
7039 sender.close();
7040 }
7041 }
7042 }
7043
7044 5592951026866236882 => {
7045 let responder = ::fidl_next::Responder::from_untyped(responder);
7046
7047 match ::fidl_next::DecoderExt::decode(buffer) {
7048 Ok(decoded) => handler.dictionary_get(sender, decoded, responder),
7049 Err(e) => {
7050 sender.close();
7051 }
7052 }
7053 }
7054
7055 343892214579320051 => {
7056 let responder = ::fidl_next::Responder::from_untyped(responder);
7057
7058 match ::fidl_next::DecoderExt::decode(buffer) {
7059 Ok(decoded) => handler.dictionary_remove(sender, decoded, responder),
7060 Err(e) => {
7061 sender.close();
7062 }
7063 }
7064 }
7065
7066 3977783339739362383 => {
7067 let responder = ::fidl_next::Responder::from_untyped(responder);
7068
7069 match ::fidl_next::DecoderExt::decode(buffer) {
7070 Ok(decoded) => handler.dictionary_copy(sender, decoded, responder),
7071 Err(e) => {
7072 sender.close();
7073 }
7074 }
7075 }
7076
7077 597577248872787102 => {
7078 let responder = ::fidl_next::Responder::from_untyped(responder);
7079
7080 match ::fidl_next::DecoderExt::decode(buffer) {
7081 Ok(decoded) => handler.dictionary_keys(sender, decoded, responder),
7082 Err(e) => {
7083 sender.close();
7084 }
7085 }
7086 }
7087
7088 964467096271472193 => {
7089 let responder = ::fidl_next::Responder::from_untyped(responder);
7090
7091 match ::fidl_next::DecoderExt::decode(buffer) {
7092 Ok(decoded) => handler.dictionary_enumerate(sender, decoded, responder),
7093 Err(e) => {
7094 sender.close();
7095 }
7096 }
7097 }
7098
7099 2928364469569621208 => {
7100 let responder = ::fidl_next::Responder::from_untyped(responder);
7101
7102 match ::fidl_next::DecoderExt::decode(buffer) {
7103 Ok(decoded) => handler.dictionary_drain(sender, decoded, responder),
7104 Err(e) => {
7105 sender.close();
7106 }
7107 }
7108 }
7109
7110 ordinal => handler.on_unknown_interaction(sender, ordinal),
7111 }
7112 }
7113}
7114
7115#[doc = " Represents an instance in the component tree, either a component\n instance or component manager\'s instance.\n"]
7116#[derive(Debug)]
7117#[repr(C)]
7118pub struct InstanceToken {
7119 pub token: ::fidl_next::fuchsia::zx::Handle,
7120}
7121
7122impl ::fidl_next::Encodable for InstanceToken {
7123 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireInstanceToken> = unsafe {
7124 ::fidl_next::CopyOptimization::enable_if(
7125 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
7126 .is_enabled(),
7127 )
7128 };
7129
7130 type Encoded = WireInstanceToken;
7131}
7132
7133unsafe impl<___E> ::fidl_next::Encode<___E> for InstanceToken
7134where
7135 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7136
7137 ___E: ::fidl_next::fuchsia::HandleEncoder,
7138{
7139 #[inline]
7140 fn encode(
7141 self,
7142 encoder: &mut ___E,
7143 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7144 ) -> Result<(), ::fidl_next::EncodeError> {
7145 ::fidl_next::munge! {
7146 let Self::Encoded {
7147 token,
7148
7149 } = out;
7150 }
7151
7152 ::fidl_next::Encode::encode(self.token, encoder, token)?;
7153
7154 Ok(())
7155 }
7156}
7157
7158impl ::fidl_next::EncodableOption for InstanceToken {
7159 type EncodedOption = ::fidl_next::WireBox<'static, WireInstanceToken>;
7160}
7161
7162unsafe impl<___E> ::fidl_next::EncodeOption<___E> for InstanceToken
7163where
7164 ___E: ::fidl_next::Encoder + ?Sized,
7165 InstanceToken: ::fidl_next::Encode<___E>,
7166{
7167 #[inline]
7168 fn encode_option(
7169 this: Option<Self>,
7170 encoder: &mut ___E,
7171 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7172 ) -> Result<(), ::fidl_next::EncodeError> {
7173 if let Some(inner) = this {
7174 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7175 ::fidl_next::WireBox::encode_present(out);
7176 } else {
7177 ::fidl_next::WireBox::encode_absent(out);
7178 }
7179
7180 Ok(())
7181 }
7182}
7183
7184impl ::fidl_next::FromWire<WireInstanceToken> for InstanceToken {
7185 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireInstanceToken, Self> = unsafe {
7186 ::fidl_next::CopyOptimization::enable_if(
7187 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
7188 ::fidl_next::fuchsia::WireHandle,
7189 >>::COPY_OPTIMIZATION
7190 .is_enabled(),
7191 )
7192 };
7193
7194 #[inline]
7195 fn from_wire(wire: WireInstanceToken) -> Self {
7196 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
7197 }
7198}
7199
7200#[derive(Debug)]
7202#[repr(C)]
7203pub struct WireInstanceToken {
7204 pub token: ::fidl_next::fuchsia::WireHandle,
7205}
7206
7207unsafe impl ::fidl_next::Wire for WireInstanceToken {
7208 type Decoded<'de> = WireInstanceToken;
7209
7210 #[inline]
7211 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7212}
7213
7214unsafe impl<___D> ::fidl_next::Decode<___D> for WireInstanceToken
7215where
7216 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7217
7218 ___D: ::fidl_next::fuchsia::HandleDecoder,
7219{
7220 fn decode(
7221 slot: ::fidl_next::Slot<'_, Self>,
7222 decoder: &mut ___D,
7223 ) -> Result<(), ::fidl_next::DecodeError> {
7224 ::fidl_next::munge! {
7225 let Self {
7226 mut token,
7227
7228 } = slot;
7229 }
7230
7231 ::fidl_next::Decode::decode(token.as_mut(), decoder)?;
7232
7233 Ok(())
7234 }
7235}
7236
7237#[doc = " A request for a route.\n"]
7238#[derive(Debug, Default)]
7239pub struct RouteRequest {
7240 pub requesting: Option<crate::InstanceToken>,
7241
7242 pub metadata: Option<crate::DictionaryRef>,
7243}
7244
7245impl RouteRequest {
7246 fn __max_ordinal(&self) -> usize {
7247 if self.requesting.is_some() {
7248 return 1;
7249 }
7250
7251 if self.metadata.is_some() {
7252 return 2;
7253 }
7254
7255 0
7256 }
7257}
7258
7259impl ::fidl_next::Encodable for RouteRequest {
7260 type Encoded = WireRouteRequest<'static>;
7261}
7262
7263unsafe impl<___E> ::fidl_next::Encode<___E> for RouteRequest
7264where
7265 ___E: ::fidl_next::Encoder + ?Sized,
7266
7267 ___E: ::fidl_next::fuchsia::HandleEncoder,
7268{
7269 #[inline]
7270 fn encode(
7271 mut self,
7272 encoder: &mut ___E,
7273 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7274 ) -> Result<(), ::fidl_next::EncodeError> {
7275 ::fidl_next::munge!(let WireRouteRequest { table } = out);
7276
7277 let max_ord = self.__max_ordinal();
7278
7279 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7280 ::fidl_next::Wire::zero_padding(&mut out);
7281
7282 let mut preallocated =
7283 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7284
7285 for i in 1..=max_ord {
7286 match i {
7287 2 => {
7288 if let Some(metadata) = self.metadata.take() {
7289 ::fidl_next::WireEnvelope::encode_value(
7290 metadata,
7291 preallocated.encoder,
7292 &mut out,
7293 )?;
7294 } else {
7295 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7296 }
7297 }
7298
7299 1 => {
7300 if let Some(requesting) = self.requesting.take() {
7301 ::fidl_next::WireEnvelope::encode_value(
7302 requesting,
7303 preallocated.encoder,
7304 &mut out,
7305 )?;
7306 } else {
7307 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7308 }
7309 }
7310
7311 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7312 }
7313 unsafe {
7314 preallocated.write_next(out.assume_init_ref());
7315 }
7316 }
7317
7318 ::fidl_next::WireTable::encode_len(table, max_ord);
7319
7320 Ok(())
7321 }
7322}
7323
7324impl<'de> ::fidl_next::FromWire<WireRouteRequest<'de>> for RouteRequest {
7325 #[inline]
7326 fn from_wire(wire: WireRouteRequest<'de>) -> Self {
7327 let wire = ::core::mem::ManuallyDrop::new(wire);
7328
7329 let requesting = wire.table.get(1);
7330
7331 let metadata = wire.table.get(2);
7332
7333 Self {
7334 requesting: requesting.map(|envelope| {
7335 ::fidl_next::FromWire::from_wire(unsafe {
7336 envelope.read_unchecked::<crate::WireInstanceToken>()
7337 })
7338 }),
7339
7340 metadata: metadata.map(|envelope| {
7341 ::fidl_next::FromWire::from_wire(unsafe {
7342 envelope.read_unchecked::<crate::WireDictionaryRef>()
7343 })
7344 }),
7345 }
7346 }
7347}
7348
7349#[repr(C)]
7351pub struct WireRouteRequest<'de> {
7352 table: ::fidl_next::WireTable<'de>,
7353}
7354
7355impl<'de> Drop for WireRouteRequest<'de> {
7356 fn drop(&mut self) {
7357 let _ = self
7358 .table
7359 .get(1)
7360 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireInstanceToken>() });
7361
7362 let _ = self
7363 .table
7364 .get(2)
7365 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDictionaryRef>() });
7366 }
7367}
7368
7369unsafe impl ::fidl_next::Wire for WireRouteRequest<'static> {
7370 type Decoded<'de> = WireRouteRequest<'de>;
7371
7372 #[inline]
7373 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7374 ::fidl_next::munge!(let Self { table } = out);
7375 ::fidl_next::WireTable::zero_padding(table);
7376 }
7377}
7378
7379unsafe impl<___D> ::fidl_next::Decode<___D> for WireRouteRequest<'static>
7380where
7381 ___D: ::fidl_next::Decoder + ?Sized,
7382
7383 ___D: ::fidl_next::fuchsia::HandleDecoder,
7384{
7385 fn decode(
7386 slot: ::fidl_next::Slot<'_, Self>,
7387 decoder: &mut ___D,
7388 ) -> Result<(), ::fidl_next::DecodeError> {
7389 ::fidl_next::munge!(let Self { table } = slot);
7390
7391 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7392 match ordinal {
7393 0 => unsafe { ::core::hint::unreachable_unchecked() },
7394
7395 1 => {
7396 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireInstanceToken>(
7397 slot.as_mut(),
7398 decoder,
7399 )?;
7400
7401 Ok(())
7402 }
7403
7404 2 => {
7405 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDictionaryRef>(
7406 slot.as_mut(),
7407 decoder,
7408 )?;
7409
7410 Ok(())
7411 }
7412
7413 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7414 }
7415 })
7416 }
7417}
7418
7419impl<'de> WireRouteRequest<'de> {
7420 pub fn requesting(&self) -> Option<&crate::WireInstanceToken> {
7421 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7422 }
7423
7424 pub fn metadata(&self) -> Option<&crate::WireDictionaryRef> {
7425 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7426 }
7427}
7428
7429impl<'de> ::core::fmt::Debug for WireRouteRequest<'de> {
7430 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
7431 f.debug_struct("RouteRequest")
7432 .field("requesting", &self.requesting())
7433 .field("metadata", &self.metadata())
7434 .finish()
7435 }
7436}
7437
7438#[derive(Debug)]
7439pub enum ConnectorRouterRouteResponse {
7440 Connector(crate::Connector),
7441
7442 Unavailable(crate::Unit),
7443}
7444
7445impl ::fidl_next::Encodable for ConnectorRouterRouteResponse {
7446 type Encoded = WireConnectorRouterRouteResponse;
7447}
7448
7449unsafe impl<___E> ::fidl_next::Encode<___E> for ConnectorRouterRouteResponse
7450where
7451 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7452
7453 ___E: ::fidl_next::fuchsia::HandleEncoder,
7454{
7455 #[inline]
7456 fn encode(
7457 self,
7458 encoder: &mut ___E,
7459 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7460 ) -> Result<(), ::fidl_next::EncodeError> {
7461 ::fidl_next::munge!(let WireConnectorRouterRouteResponse { raw, _phantom: _ } = out);
7462
7463 match self {
7464 Self::Connector(value) => ::fidl_next::RawWireUnion::encode_as_static::<
7465 ___E,
7466 crate::Connector,
7467 >(value, 1, encoder, raw)?,
7468
7469 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
7470 ___E,
7471 crate::Unit,
7472 >(value, 2, encoder, raw)?,
7473 }
7474
7475 Ok(())
7476 }
7477}
7478
7479impl ::fidl_next::EncodableOption for ConnectorRouterRouteResponse {
7480 type EncodedOption = WireOptionalConnectorRouterRouteResponse;
7481}
7482
7483unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConnectorRouterRouteResponse
7484where
7485 ___E: ?Sized,
7486 ConnectorRouterRouteResponse: ::fidl_next::Encode<___E>,
7487{
7488 #[inline]
7489 fn encode_option(
7490 this: Option<Self>,
7491 encoder: &mut ___E,
7492 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7493 ) -> Result<(), ::fidl_next::EncodeError> {
7494 ::fidl_next::munge!(let WireOptionalConnectorRouterRouteResponse { raw, _phantom: _ } = &mut *out);
7495
7496 if let Some(inner) = this {
7497 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7498 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
7499 } else {
7500 ::fidl_next::RawWireUnion::encode_absent(raw);
7501 }
7502
7503 Ok(())
7504 }
7505}
7506
7507impl ::fidl_next::FromWire<WireConnectorRouterRouteResponse> for ConnectorRouterRouteResponse {
7508 #[inline]
7509 fn from_wire(wire: WireConnectorRouterRouteResponse) -> Self {
7510 let wire = ::core::mem::ManuallyDrop::new(wire);
7511 match wire.raw.ordinal() {
7512 1 => Self::Connector(::fidl_next::FromWire::from_wire(unsafe {
7513 wire.raw.get().read_unchecked::<crate::WireConnector>()
7514 })),
7515
7516 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
7517 wire.raw.get().read_unchecked::<crate::WireUnit>()
7518 })),
7519
7520 _ => unsafe { ::core::hint::unreachable_unchecked() },
7521 }
7522 }
7523}
7524
7525impl ::fidl_next::FromWireOption<WireOptionalConnectorRouterRouteResponse>
7526 for Box<ConnectorRouterRouteResponse>
7527{
7528 #[inline]
7529 fn from_wire_option(wire: WireOptionalConnectorRouterRouteResponse) -> Option<Self> {
7530 if let Some(inner) = wire.into_option() {
7531 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
7532 } else {
7533 None
7534 }
7535 }
7536}
7537
7538#[repr(transparent)]
7540pub struct WireConnectorRouterRouteResponse {
7541 raw: ::fidl_next::RawWireUnion,
7542 _phantom: ::core::marker::PhantomData<()>,
7543}
7544
7545impl Drop for WireConnectorRouterRouteResponse {
7546 fn drop(&mut self) {
7547 match self.raw.ordinal() {
7548 1 => {
7549 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireConnector>() };
7550 }
7551
7552 2 => {
7553 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
7554 }
7555
7556 _ => unsafe { ::core::hint::unreachable_unchecked() },
7557 }
7558 }
7559}
7560
7561unsafe impl ::fidl_next::Wire for WireConnectorRouterRouteResponse {
7562 type Decoded<'de> = WireConnectorRouterRouteResponse;
7563
7564 #[inline]
7565 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7566 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7567 ::fidl_next::RawWireUnion::zero_padding(raw);
7568 }
7569}
7570
7571pub mod connector_router_route_response {
7572 pub enum Ref<'de> {
7573 Connector(&'de crate::WireConnector),
7574
7575 Unavailable(&'de crate::WireUnit),
7576 }
7577}
7578
7579impl WireConnectorRouterRouteResponse {
7580 pub fn as_ref(&self) -> crate::connector_router_route_response::Ref<'_> {
7581 match self.raw.ordinal() {
7582 1 => crate::connector_router_route_response::Ref::Connector(unsafe {
7583 self.raw.get().deref_unchecked::<crate::WireConnector>()
7584 }),
7585
7586 2 => crate::connector_router_route_response::Ref::Unavailable(unsafe {
7587 self.raw.get().deref_unchecked::<crate::WireUnit>()
7588 }),
7589
7590 _ => unsafe { ::core::hint::unreachable_unchecked() },
7591 }
7592 }
7593}
7594
7595unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnectorRouterRouteResponse
7596where
7597 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7598
7599 ___D: ::fidl_next::fuchsia::HandleDecoder,
7600{
7601 fn decode(
7602 mut slot: ::fidl_next::Slot<'_, Self>,
7603 decoder: &mut ___D,
7604 ) -> Result<(), ::fidl_next::DecodeError> {
7605 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7606 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7607 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireConnector>(
7608 raw, decoder,
7609 )?,
7610
7611 2 => {
7612 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
7613 }
7614
7615 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
7616 }
7617
7618 Ok(())
7619 }
7620}
7621
7622impl ::core::fmt::Debug for WireConnectorRouterRouteResponse {
7623 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7624 match self.raw.ordinal() {
7625 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireConnector>().fmt(f) },
7626 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
7627 _ => unsafe { ::core::hint::unreachable_unchecked() },
7628 }
7629 }
7630}
7631
7632#[repr(transparent)]
7633pub struct WireOptionalConnectorRouterRouteResponse {
7634 raw: ::fidl_next::RawWireUnion,
7635 _phantom: ::core::marker::PhantomData<()>,
7636}
7637
7638unsafe impl ::fidl_next::Wire for WireOptionalConnectorRouterRouteResponse {
7639 type Decoded<'de> = WireOptionalConnectorRouterRouteResponse;
7640
7641 #[inline]
7642 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7643 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7644 ::fidl_next::RawWireUnion::zero_padding(raw);
7645 }
7646}
7647
7648impl WireOptionalConnectorRouterRouteResponse {
7649 pub fn is_some(&self) -> bool {
7650 self.raw.is_some()
7651 }
7652
7653 pub fn is_none(&self) -> bool {
7654 self.raw.is_none()
7655 }
7656
7657 pub fn as_ref(&self) -> Option<&WireConnectorRouterRouteResponse> {
7658 if self.is_some() {
7659 Some(unsafe { &*(self as *const Self).cast() })
7660 } else {
7661 None
7662 }
7663 }
7664
7665 pub fn into_option(self) -> Option<WireConnectorRouterRouteResponse> {
7666 if self.is_some() {
7667 Some(WireConnectorRouterRouteResponse {
7668 raw: self.raw,
7669 _phantom: ::core::marker::PhantomData,
7670 })
7671 } else {
7672 None
7673 }
7674 }
7675}
7676
7677unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConnectorRouterRouteResponse
7678where
7679 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7680
7681 ___D: ::fidl_next::fuchsia::HandleDecoder,
7682{
7683 fn decode(
7684 mut slot: ::fidl_next::Slot<'_, Self>,
7685 decoder: &mut ___D,
7686 ) -> Result<(), ::fidl_next::DecodeError> {
7687 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7688 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7689 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireConnector>(
7690 raw, decoder,
7691 )?,
7692
7693 2 => {
7694 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
7695 }
7696
7697 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
7698 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
7699 }
7700
7701 Ok(())
7702 }
7703}
7704
7705impl ::core::fmt::Debug for WireOptionalConnectorRouterRouteResponse {
7706 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7707 self.as_ref().fmt(f)
7708 }
7709}
7710
7711#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7712#[repr(u32)]
7713pub enum RouterError {
7714 NotFound = 1,
7715 InvalidArgs = 2,
7716 NotSupported = 3,
7717 Internal = 4,
7718 UnknownOrdinal_(u32),
7719}
7720
7721impl ::fidl_next::Encodable for RouterError {
7722 type Encoded = WireRouterError;
7723}
7724impl ::std::convert::From<u32> for RouterError {
7725 fn from(value: u32) -> Self {
7726 match value {
7727 1 => Self::NotFound,
7728 2 => Self::InvalidArgs,
7729 3 => Self::NotSupported,
7730 4 => Self::Internal,
7731
7732 _ => Self::UnknownOrdinal_(value),
7733 }
7734 }
7735}
7736
7737unsafe impl<___E> ::fidl_next::Encode<___E> for RouterError
7738where
7739 ___E: ?Sized,
7740{
7741 #[inline]
7742 fn encode(
7743 self,
7744 encoder: &mut ___E,
7745 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7746 ) -> Result<(), ::fidl_next::EncodeError> {
7747 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
7748 }
7749}
7750
7751unsafe impl<___E> ::fidl_next::EncodeRef<___E> for RouterError
7752where
7753 ___E: ?Sized,
7754{
7755 #[inline]
7756 fn encode_ref(
7757 &self,
7758 encoder: &mut ___E,
7759 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7760 ) -> Result<(), ::fidl_next::EncodeError> {
7761 ::fidl_next::munge!(let WireRouterError { value } = out);
7762 let _ = value.write(::fidl_next::WireU32::from(match *self {
7763 Self::NotFound => 1,
7764
7765 Self::InvalidArgs => 2,
7766
7767 Self::NotSupported => 3,
7768
7769 Self::Internal => 4,
7770
7771 Self::UnknownOrdinal_(value) => value,
7772 }));
7773
7774 Ok(())
7775 }
7776}
7777
7778impl ::core::convert::From<WireRouterError> for RouterError {
7779 fn from(wire: WireRouterError) -> Self {
7780 match u32::from(wire.value) {
7781 1 => Self::NotFound,
7782
7783 2 => Self::InvalidArgs,
7784
7785 3 => Self::NotSupported,
7786
7787 4 => Self::Internal,
7788
7789 value => Self::UnknownOrdinal_(value),
7790 }
7791 }
7792}
7793
7794impl ::fidl_next::FromWire<WireRouterError> for RouterError {
7795 #[inline]
7796 fn from_wire(wire: WireRouterError) -> Self {
7797 Self::from(wire)
7798 }
7799}
7800
7801impl ::fidl_next::FromWireRef<WireRouterError> for RouterError {
7802 #[inline]
7803 fn from_wire_ref(wire: &WireRouterError) -> Self {
7804 Self::from(*wire)
7805 }
7806}
7807
7808#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7810#[repr(transparent)]
7811pub struct WireRouterError {
7812 value: ::fidl_next::WireU32,
7813}
7814
7815unsafe impl ::fidl_next::Wire for WireRouterError {
7816 type Decoded<'de> = Self;
7817
7818 #[inline]
7819 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
7820 }
7822}
7823
7824impl WireRouterError {
7825 pub const NOT_FOUND: WireRouterError = WireRouterError { value: ::fidl_next::WireU32(1) };
7826
7827 pub const INVALID_ARGS: WireRouterError = WireRouterError { value: ::fidl_next::WireU32(2) };
7828
7829 pub const NOT_SUPPORTED: WireRouterError = WireRouterError { value: ::fidl_next::WireU32(3) };
7830
7831 pub const INTERNAL: WireRouterError = WireRouterError { value: ::fidl_next::WireU32(4) };
7832}
7833
7834unsafe impl<___D> ::fidl_next::Decode<___D> for WireRouterError
7835where
7836 ___D: ?Sized,
7837{
7838 fn decode(
7839 slot: ::fidl_next::Slot<'_, Self>,
7840 _: &mut ___D,
7841 ) -> Result<(), ::fidl_next::DecodeError> {
7842 Ok(())
7843 }
7844}
7845
7846impl ::core::convert::From<RouterError> for WireRouterError {
7847 fn from(natural: RouterError) -> Self {
7848 match natural {
7849 RouterError::NotFound => WireRouterError::NOT_FOUND,
7850
7851 RouterError::InvalidArgs => WireRouterError::INVALID_ARGS,
7852
7853 RouterError::NotSupported => WireRouterError::NOT_SUPPORTED,
7854
7855 RouterError::Internal => WireRouterError::INTERNAL,
7856
7857 RouterError::UnknownOrdinal_(value) => {
7858 WireRouterError { value: ::fidl_next::WireU32::from(value) }
7859 }
7860 }
7861 }
7862}
7863
7864#[derive(Debug)]
7866pub struct ConnectorRouter;
7867
7868impl ::fidl_next::Discoverable for ConnectorRouter {
7869 const PROTOCOL_NAME: &'static str = "connector_router";
7870}
7871
7872pub mod connector_router {
7873 pub mod prelude {
7874 pub use crate::{
7875 connector_router, ConnectorRouter, ConnectorRouterClientHandler,
7876 ConnectorRouterClientSender, ConnectorRouterServerHandler, ConnectorRouterServerSender,
7877 };
7878
7879 pub use crate::ConnectorRouterRouteResponse;
7880
7881 pub use crate::RouteRequest;
7882
7883 pub use crate::RouterError;
7884 }
7885
7886 pub struct Route;
7887
7888 impl ::fidl_next::Method for Route {
7889 const ORDINAL: u64 = 8420527046218942310;
7890
7891 type Protocol = crate::ConnectorRouter;
7892
7893 type Request = crate::WireRouteRequest<'static>;
7894
7895 type Response = ::fidl_next::WireFlexibleResult<
7896 'static,
7897 crate::WireConnectorRouterRouteResponse,
7898 crate::WireRouterError,
7899 >;
7900 }
7901}
7902
7903pub trait ConnectorRouterClientSender {
7905 type Transport: ::fidl_next::Transport;
7906
7907 fn route<___R>(
7908 &self,
7909 request: ___R,
7910 ) -> Result<
7911 ::fidl_next::ResponseFuture<'_, Self::Transport, connector_router::Route>,
7912 ::fidl_next::EncodeError,
7913 >
7914 where
7915 ___R: ::fidl_next::Encode<
7916 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7917 Encoded = crate::WireRouteRequest<'static>,
7918 >;
7919}
7920
7921impl<___T> ConnectorRouterClientSender for ::fidl_next::ClientSender<___T, ConnectorRouter>
7922where
7923 ___T: ::fidl_next::Transport,
7924{
7925 type Transport = ___T;
7926
7927 fn route<___R>(
7928 &self,
7929 request: ___R,
7930 ) -> Result<
7931 ::fidl_next::ResponseFuture<'_, Self::Transport, connector_router::Route>,
7932 ::fidl_next::EncodeError,
7933 >
7934 where
7935 ___R: ::fidl_next::Encode<
7936 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7937 Encoded = crate::WireRouteRequest<'static>,
7938 >,
7939 {
7940 self.as_untyped()
7941 .send_two_way(8420527046218942310, request)
7942 .map(::fidl_next::ResponseFuture::from_untyped)
7943 }
7944}
7945
7946pub trait ConnectorRouterClientHandler<___T: ::fidl_next::Transport> {
7950 fn on_unknown_interaction(
7951 &mut self,
7952 sender: &::fidl_next::ClientSender<___T, ConnectorRouter>,
7953 ordinal: u64,
7954 ) {
7955 sender.close();
7956 }
7957}
7958
7959impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for ConnectorRouter
7960where
7961 ___T: ::fidl_next::Transport,
7962 ___H: ConnectorRouterClientHandler<___T>,
7963
7964 <connector_router::Route as ::fidl_next::Method>::Response:
7965 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7966{
7967 fn on_event(
7968 handler: &mut ___H,
7969 sender: &::fidl_next::ClientSender<___T, Self>,
7970 ordinal: u64,
7971 buffer: ___T::RecvBuffer,
7972 ) {
7973 match ordinal {
7974 ordinal => handler.on_unknown_interaction(sender, ordinal),
7975 }
7976 }
7977}
7978
7979pub trait ConnectorRouterServerSender {
7981 type Transport: ::fidl_next::Transport;
7982}
7983
7984impl<___T> ConnectorRouterServerSender for ::fidl_next::ServerSender<___T, ConnectorRouter>
7985where
7986 ___T: ::fidl_next::Transport,
7987{
7988 type Transport = ___T;
7989}
7990
7991pub trait ConnectorRouterServerHandler<___T: ::fidl_next::Transport> {
7995 fn route(
7996 &mut self,
7997 sender: &::fidl_next::ServerSender<___T, ConnectorRouter>,
7998
7999 request: ::fidl_next::Request<___T, connector_router::Route>,
8000
8001 responder: ::fidl_next::Responder<connector_router::Route>,
8002 );
8003
8004 fn on_unknown_interaction(
8005 &mut self,
8006 sender: &::fidl_next::ServerSender<___T, ConnectorRouter>,
8007 ordinal: u64,
8008 ) {
8009 sender.close();
8010 }
8011}
8012
8013impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for ConnectorRouter
8014where
8015 ___T: ::fidl_next::Transport,
8016 ___H: ConnectorRouterServerHandler<___T>,
8017
8018 <connector_router::Route as ::fidl_next::Method>::Request:
8019 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8020{
8021 fn on_one_way(
8022 handler: &mut ___H,
8023 sender: &::fidl_next::ServerSender<___T, Self>,
8024 ordinal: u64,
8025 buffer: ___T::RecvBuffer,
8026 ) {
8027 match ordinal {
8028 ordinal => handler.on_unknown_interaction(sender, ordinal),
8029 }
8030 }
8031
8032 fn on_two_way(
8033 handler: &mut ___H,
8034 sender: &::fidl_next::ServerSender<___T, Self>,
8035 ordinal: u64,
8036 buffer: ___T::RecvBuffer,
8037 responder: ::fidl_next::protocol::Responder,
8038 ) {
8039 match ordinal {
8040 8420527046218942310 => {
8041 let responder = ::fidl_next::Responder::from_untyped(responder);
8042
8043 match ::fidl_next::DecoderExt::decode(buffer) {
8044 Ok(decoded) => handler.route(sender, decoded, responder),
8045 Err(e) => {
8046 sender.close();
8047 }
8048 }
8049 }
8050
8051 ordinal => handler.on_unknown_interaction(sender, ordinal),
8052 }
8053 }
8054}
8055
8056#[derive(Debug)]
8057pub enum DataRouterRouteResponse {
8058 Data(crate::Data),
8059
8060 Unavailable(crate::Unit),
8061}
8062
8063impl ::fidl_next::Encodable for DataRouterRouteResponse {
8064 type Encoded = WireDataRouterRouteResponse<'static>;
8065}
8066
8067unsafe impl<___E> ::fidl_next::Encode<___E> for DataRouterRouteResponse
8068where
8069 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8070
8071 ___E: ::fidl_next::Encoder,
8072
8073 ___E: ::fidl_next::fuchsia::HandleEncoder,
8074{
8075 #[inline]
8076 fn encode(
8077 self,
8078 encoder: &mut ___E,
8079 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8080 ) -> Result<(), ::fidl_next::EncodeError> {
8081 ::fidl_next::munge!(let WireDataRouterRouteResponse { raw, _phantom: _ } = out);
8082
8083 match self {
8084 Self::Data(value) => {
8085 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Data>(value, 1, encoder, raw)?
8086 }
8087
8088 Self::Unavailable(value) => {
8089 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Unit>(value, 2, encoder, raw)?
8090 }
8091 }
8092
8093 Ok(())
8094 }
8095}
8096
8097impl ::fidl_next::EncodableOption for DataRouterRouteResponse {
8098 type EncodedOption = WireOptionalDataRouterRouteResponse<'static>;
8099}
8100
8101unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DataRouterRouteResponse
8102where
8103 ___E: ?Sized,
8104 DataRouterRouteResponse: ::fidl_next::Encode<___E>,
8105{
8106 #[inline]
8107 fn encode_option(
8108 this: Option<Self>,
8109 encoder: &mut ___E,
8110 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8111 ) -> Result<(), ::fidl_next::EncodeError> {
8112 ::fidl_next::munge!(let WireOptionalDataRouterRouteResponse { raw, _phantom: _ } = &mut *out);
8113
8114 if let Some(inner) = this {
8115 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
8116 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
8117 } else {
8118 ::fidl_next::RawWireUnion::encode_absent(raw);
8119 }
8120
8121 Ok(())
8122 }
8123}
8124
8125impl<'de> ::fidl_next::FromWire<WireDataRouterRouteResponse<'de>> for DataRouterRouteResponse {
8126 #[inline]
8127 fn from_wire(wire: WireDataRouterRouteResponse<'de>) -> Self {
8128 let wire = ::core::mem::ManuallyDrop::new(wire);
8129 match wire.raw.ordinal() {
8130 1 => Self::Data(::fidl_next::FromWire::from_wire(unsafe {
8131 wire.raw.get().read_unchecked::<crate::WireData<'de>>()
8132 })),
8133
8134 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
8135 wire.raw.get().read_unchecked::<crate::WireUnit>()
8136 })),
8137
8138 _ => unsafe { ::core::hint::unreachable_unchecked() },
8139 }
8140 }
8141}
8142
8143impl<'de> ::fidl_next::FromWireOption<WireOptionalDataRouterRouteResponse<'de>>
8144 for Box<DataRouterRouteResponse>
8145{
8146 #[inline]
8147 fn from_wire_option(wire: WireOptionalDataRouterRouteResponse<'de>) -> Option<Self> {
8148 if let Some(inner) = wire.into_option() {
8149 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
8150 } else {
8151 None
8152 }
8153 }
8154}
8155
8156#[repr(transparent)]
8158pub struct WireDataRouterRouteResponse<'de> {
8159 raw: ::fidl_next::RawWireUnion,
8160 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
8161}
8162
8163impl<'de> Drop for WireDataRouterRouteResponse<'de> {
8164 fn drop(&mut self) {
8165 match self.raw.ordinal() {
8166 1 => {
8167 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireData<'de>>() };
8168 }
8169
8170 2 => {
8171 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
8172 }
8173
8174 _ => unsafe { ::core::hint::unreachable_unchecked() },
8175 }
8176 }
8177}
8178
8179unsafe impl ::fidl_next::Wire for WireDataRouterRouteResponse<'static> {
8180 type Decoded<'de> = WireDataRouterRouteResponse<'de>;
8181
8182 #[inline]
8183 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8184 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8185 ::fidl_next::RawWireUnion::zero_padding(raw);
8186 }
8187}
8188
8189pub mod data_router_route_response {
8190 pub enum Ref<'de> {
8191 Data(&'de crate::WireData<'de>),
8192
8193 Unavailable(&'de crate::WireUnit),
8194 }
8195}
8196
8197impl<'de> WireDataRouterRouteResponse<'de> {
8198 pub fn as_ref(&self) -> crate::data_router_route_response::Ref<'_> {
8199 match self.raw.ordinal() {
8200 1 => crate::data_router_route_response::Ref::Data(unsafe {
8201 self.raw.get().deref_unchecked::<crate::WireData<'_>>()
8202 }),
8203
8204 2 => crate::data_router_route_response::Ref::Unavailable(unsafe {
8205 self.raw.get().deref_unchecked::<crate::WireUnit>()
8206 }),
8207
8208 _ => unsafe { ::core::hint::unreachable_unchecked() },
8209 }
8210 }
8211}
8212
8213unsafe impl<___D> ::fidl_next::Decode<___D> for WireDataRouterRouteResponse<'static>
8214where
8215 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8216
8217 ___D: ::fidl_next::Decoder,
8218
8219 ___D: ::fidl_next::fuchsia::HandleDecoder,
8220{
8221 fn decode(
8222 mut slot: ::fidl_next::Slot<'_, Self>,
8223 decoder: &mut ___D,
8224 ) -> Result<(), ::fidl_next::DecodeError> {
8225 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8226 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8227 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireData<'static>>(
8228 raw, decoder,
8229 )?,
8230
8231 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnit>(raw, decoder)?,
8232
8233 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
8234 }
8235
8236 Ok(())
8237 }
8238}
8239
8240impl<'de> ::core::fmt::Debug for WireDataRouterRouteResponse<'de> {
8241 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8242 match self.raw.ordinal() {
8243 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireData<'_>>().fmt(f) },
8244 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
8245 _ => unsafe { ::core::hint::unreachable_unchecked() },
8246 }
8247 }
8248}
8249
8250#[repr(transparent)]
8251pub struct WireOptionalDataRouterRouteResponse<'de> {
8252 raw: ::fidl_next::RawWireUnion,
8253 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
8254}
8255
8256unsafe impl ::fidl_next::Wire for WireOptionalDataRouterRouteResponse<'static> {
8257 type Decoded<'de> = WireOptionalDataRouterRouteResponse<'de>;
8258
8259 #[inline]
8260 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8261 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8262 ::fidl_next::RawWireUnion::zero_padding(raw);
8263 }
8264}
8265
8266impl<'de> WireOptionalDataRouterRouteResponse<'de> {
8267 pub fn is_some(&self) -> bool {
8268 self.raw.is_some()
8269 }
8270
8271 pub fn is_none(&self) -> bool {
8272 self.raw.is_none()
8273 }
8274
8275 pub fn as_ref(&self) -> Option<&WireDataRouterRouteResponse<'de>> {
8276 if self.is_some() {
8277 Some(unsafe { &*(self as *const Self).cast() })
8278 } else {
8279 None
8280 }
8281 }
8282
8283 pub fn into_option(self) -> Option<WireDataRouterRouteResponse<'de>> {
8284 if self.is_some() {
8285 Some(WireDataRouterRouteResponse {
8286 raw: self.raw,
8287 _phantom: ::core::marker::PhantomData,
8288 })
8289 } else {
8290 None
8291 }
8292 }
8293}
8294
8295unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDataRouterRouteResponse<'static>
8296where
8297 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8298
8299 ___D: ::fidl_next::Decoder,
8300
8301 ___D: ::fidl_next::fuchsia::HandleDecoder,
8302{
8303 fn decode(
8304 mut slot: ::fidl_next::Slot<'_, Self>,
8305 decoder: &mut ___D,
8306 ) -> Result<(), ::fidl_next::DecodeError> {
8307 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8308 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8309 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireData<'static>>(
8310 raw, decoder,
8311 )?,
8312
8313 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUnit>(raw, decoder)?,
8314
8315 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
8316 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
8317 }
8318
8319 Ok(())
8320 }
8321}
8322
8323impl<'de> ::core::fmt::Debug for WireOptionalDataRouterRouteResponse<'de> {
8324 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8325 self.as_ref().fmt(f)
8326 }
8327}
8328
8329#[derive(Debug)]
8331pub struct DataRouter;
8332
8333impl ::fidl_next::Discoverable for DataRouter {
8334 const PROTOCOL_NAME: &'static str = "data_router";
8335}
8336
8337pub mod data_router {
8338 pub mod prelude {
8339 pub use crate::{
8340 data_router, DataRouter, DataRouterClientHandler, DataRouterClientSender,
8341 DataRouterServerHandler, DataRouterServerSender,
8342 };
8343
8344 pub use crate::DataRouterRouteResponse;
8345
8346 pub use crate::RouteRequest;
8347
8348 pub use crate::RouterError;
8349 }
8350
8351 pub struct Route;
8352
8353 impl ::fidl_next::Method for Route {
8354 const ORDINAL: u64 = 3352890635970754564;
8355
8356 type Protocol = crate::DataRouter;
8357
8358 type Request = crate::WireRouteRequest<'static>;
8359
8360 type Response = ::fidl_next::WireFlexibleResult<
8361 'static,
8362 crate::WireDataRouterRouteResponse<'static>,
8363 crate::WireRouterError,
8364 >;
8365 }
8366}
8367
8368pub trait DataRouterClientSender {
8370 type Transport: ::fidl_next::Transport;
8371
8372 fn route<___R>(
8373 &self,
8374 request: ___R,
8375 ) -> Result<
8376 ::fidl_next::ResponseFuture<'_, Self::Transport, data_router::Route>,
8377 ::fidl_next::EncodeError,
8378 >
8379 where
8380 ___R: ::fidl_next::Encode<
8381 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8382 Encoded = crate::WireRouteRequest<'static>,
8383 >;
8384}
8385
8386impl<___T> DataRouterClientSender for ::fidl_next::ClientSender<___T, DataRouter>
8387where
8388 ___T: ::fidl_next::Transport,
8389{
8390 type Transport = ___T;
8391
8392 fn route<___R>(
8393 &self,
8394 request: ___R,
8395 ) -> Result<
8396 ::fidl_next::ResponseFuture<'_, Self::Transport, data_router::Route>,
8397 ::fidl_next::EncodeError,
8398 >
8399 where
8400 ___R: ::fidl_next::Encode<
8401 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8402 Encoded = crate::WireRouteRequest<'static>,
8403 >,
8404 {
8405 self.as_untyped()
8406 .send_two_way(3352890635970754564, request)
8407 .map(::fidl_next::ResponseFuture::from_untyped)
8408 }
8409}
8410
8411pub trait DataRouterClientHandler<___T: ::fidl_next::Transport> {
8415 fn on_unknown_interaction(
8416 &mut self,
8417 sender: &::fidl_next::ClientSender<___T, DataRouter>,
8418 ordinal: u64,
8419 ) {
8420 sender.close();
8421 }
8422}
8423
8424impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DataRouter
8425where
8426 ___T: ::fidl_next::Transport,
8427 ___H: DataRouterClientHandler<___T>,
8428
8429 <data_router::Route as ::fidl_next::Method>::Response:
8430 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8431{
8432 fn on_event(
8433 handler: &mut ___H,
8434 sender: &::fidl_next::ClientSender<___T, Self>,
8435 ordinal: u64,
8436 buffer: ___T::RecvBuffer,
8437 ) {
8438 match ordinal {
8439 ordinal => handler.on_unknown_interaction(sender, ordinal),
8440 }
8441 }
8442}
8443
8444pub trait DataRouterServerSender {
8446 type Transport: ::fidl_next::Transport;
8447}
8448
8449impl<___T> DataRouterServerSender for ::fidl_next::ServerSender<___T, DataRouter>
8450where
8451 ___T: ::fidl_next::Transport,
8452{
8453 type Transport = ___T;
8454}
8455
8456pub trait DataRouterServerHandler<___T: ::fidl_next::Transport> {
8460 fn route(
8461 &mut self,
8462 sender: &::fidl_next::ServerSender<___T, DataRouter>,
8463
8464 request: ::fidl_next::Request<___T, data_router::Route>,
8465
8466 responder: ::fidl_next::Responder<data_router::Route>,
8467 );
8468
8469 fn on_unknown_interaction(
8470 &mut self,
8471 sender: &::fidl_next::ServerSender<___T, DataRouter>,
8472 ordinal: u64,
8473 ) {
8474 sender.close();
8475 }
8476}
8477
8478impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DataRouter
8479where
8480 ___T: ::fidl_next::Transport,
8481 ___H: DataRouterServerHandler<___T>,
8482
8483 <data_router::Route as ::fidl_next::Method>::Request:
8484 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8485{
8486 fn on_one_way(
8487 handler: &mut ___H,
8488 sender: &::fidl_next::ServerSender<___T, Self>,
8489 ordinal: u64,
8490 buffer: ___T::RecvBuffer,
8491 ) {
8492 match ordinal {
8493 ordinal => handler.on_unknown_interaction(sender, ordinal),
8494 }
8495 }
8496
8497 fn on_two_way(
8498 handler: &mut ___H,
8499 sender: &::fidl_next::ServerSender<___T, Self>,
8500 ordinal: u64,
8501 buffer: ___T::RecvBuffer,
8502 responder: ::fidl_next::protocol::Responder,
8503 ) {
8504 match ordinal {
8505 3352890635970754564 => {
8506 let responder = ::fidl_next::Responder::from_untyped(responder);
8507
8508 match ::fidl_next::DecoderExt::decode(buffer) {
8509 Ok(decoded) => handler.route(sender, decoded, responder),
8510 Err(e) => {
8511 sender.close();
8512 }
8513 }
8514 }
8515
8516 ordinal => handler.on_unknown_interaction(sender, ordinal),
8517 }
8518 }
8519}
8520
8521#[derive(Debug)]
8523pub struct Dictionary;
8524
8525impl ::fidl_next::Discoverable for Dictionary {
8526 const PROTOCOL_NAME: &'static str = "dictionary";
8527}
8528
8529pub mod dictionary {
8530 pub mod prelude {
8531 pub use crate::{
8532 dictionary, Dictionary, DictionaryClientHandler, DictionaryClientSender,
8533 DictionaryServerHandler, DictionaryServerSender,
8534 };
8535 }
8536}
8537
8538pub trait DictionaryClientSender {
8540 type Transport: ::fidl_next::Transport;
8541}
8542
8543impl<___T> DictionaryClientSender for ::fidl_next::ClientSender<___T, Dictionary>
8544where
8545 ___T: ::fidl_next::Transport,
8546{
8547 type Transport = ___T;
8548}
8549
8550pub trait DictionaryClientHandler<___T: ::fidl_next::Transport> {
8554 fn on_unknown_interaction(
8555 &mut self,
8556 sender: &::fidl_next::ClientSender<___T, Dictionary>,
8557 ordinal: u64,
8558 ) {
8559 sender.close();
8560 }
8561}
8562
8563impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Dictionary
8564where
8565 ___T: ::fidl_next::Transport,
8566 ___H: DictionaryClientHandler<___T>,
8567{
8568 fn on_event(
8569 handler: &mut ___H,
8570 sender: &::fidl_next::ClientSender<___T, Self>,
8571 ordinal: u64,
8572 buffer: ___T::RecvBuffer,
8573 ) {
8574 match ordinal {
8575 ordinal => handler.on_unknown_interaction(sender, ordinal),
8576 }
8577 }
8578}
8579
8580pub trait DictionaryServerSender {
8582 type Transport: ::fidl_next::Transport;
8583}
8584
8585impl<___T> DictionaryServerSender for ::fidl_next::ServerSender<___T, Dictionary>
8586where
8587 ___T: ::fidl_next::Transport,
8588{
8589 type Transport = ___T;
8590}
8591
8592pub trait DictionaryServerHandler<___T: ::fidl_next::Transport> {
8596 fn on_unknown_interaction(
8597 &mut self,
8598 sender: &::fidl_next::ServerSender<___T, Dictionary>,
8599 ordinal: u64,
8600 ) {
8601 sender.close();
8602 }
8603}
8604
8605impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Dictionary
8606where
8607 ___T: ::fidl_next::Transport,
8608 ___H: DictionaryServerHandler<___T>,
8609{
8610 fn on_one_way(
8611 handler: &mut ___H,
8612 sender: &::fidl_next::ServerSender<___T, Self>,
8613 ordinal: u64,
8614 buffer: ___T::RecvBuffer,
8615 ) {
8616 match ordinal {
8617 ordinal => handler.on_unknown_interaction(sender, ordinal),
8618 }
8619 }
8620
8621 fn on_two_way(
8622 handler: &mut ___H,
8623 sender: &::fidl_next::ServerSender<___T, Self>,
8624 ordinal: u64,
8625 buffer: ___T::RecvBuffer,
8626 responder: ::fidl_next::protocol::Responder,
8627 ) {
8628 match ordinal {
8629 ordinal => handler.on_unknown_interaction(sender, ordinal),
8630 }
8631 }
8632}
8633
8634#[derive(Clone, Debug)]
8635pub struct DictionaryDrainIteratorGetNextRequest {
8636 pub start_id: u64,
8637
8638 pub limit: u32,
8639}
8640
8641impl ::fidl_next::Encodable for DictionaryDrainIteratorGetNextRequest {
8642 type Encoded = WireDictionaryDrainIteratorGetNextRequest;
8643}
8644
8645unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryDrainIteratorGetNextRequest
8646where
8647 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8648{
8649 #[inline]
8650 fn encode(
8651 self,
8652 encoder: &mut ___E,
8653 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8654 ) -> Result<(), ::fidl_next::EncodeError> {
8655 ::fidl_next::munge! {
8656 let Self::Encoded {
8657 start_id,
8658 limit,
8659
8660 } = out;
8661 }
8662
8663 ::fidl_next::Encode::encode(self.start_id, encoder, start_id)?;
8664
8665 ::fidl_next::Encode::encode(self.limit, encoder, limit)?;
8666
8667 Ok(())
8668 }
8669}
8670
8671unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DictionaryDrainIteratorGetNextRequest
8672where
8673 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8674{
8675 #[inline]
8676 fn encode_ref(
8677 &self,
8678 encoder: &mut ___E,
8679 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8680 ) -> Result<(), ::fidl_next::EncodeError> {
8681 ::fidl_next::munge! {
8682 let Self::Encoded {
8683 start_id,
8684 limit,
8685
8686 } = out;
8687 }
8688
8689 ::fidl_next::EncodeRef::encode_ref(&self.start_id, encoder, start_id)?;
8690
8691 ::fidl_next::EncodeRef::encode_ref(&self.limit, encoder, limit)?;
8692
8693 Ok(())
8694 }
8695}
8696
8697impl ::fidl_next::EncodableOption for DictionaryDrainIteratorGetNextRequest {
8698 type EncodedOption = ::fidl_next::WireBox<'static, WireDictionaryDrainIteratorGetNextRequest>;
8699}
8700
8701unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryDrainIteratorGetNextRequest
8702where
8703 ___E: ::fidl_next::Encoder + ?Sized,
8704 DictionaryDrainIteratorGetNextRequest: ::fidl_next::Encode<___E>,
8705{
8706 #[inline]
8707 fn encode_option(
8708 this: Option<Self>,
8709 encoder: &mut ___E,
8710 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8711 ) -> Result<(), ::fidl_next::EncodeError> {
8712 if let Some(inner) = this {
8713 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8714 ::fidl_next::WireBox::encode_present(out);
8715 } else {
8716 ::fidl_next::WireBox::encode_absent(out);
8717 }
8718
8719 Ok(())
8720 }
8721}
8722
8723unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DictionaryDrainIteratorGetNextRequest
8724where
8725 ___E: ::fidl_next::Encoder + ?Sized,
8726 DictionaryDrainIteratorGetNextRequest: ::fidl_next::EncodeRef<___E>,
8727{
8728 #[inline]
8729 fn encode_option_ref(
8730 this: Option<&Self>,
8731 encoder: &mut ___E,
8732 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8733 ) -> Result<(), ::fidl_next::EncodeError> {
8734 if let Some(inner) = this {
8735 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8736 ::fidl_next::WireBox::encode_present(out);
8737 } else {
8738 ::fidl_next::WireBox::encode_absent(out);
8739 }
8740
8741 Ok(())
8742 }
8743}
8744
8745impl ::fidl_next::FromWire<WireDictionaryDrainIteratorGetNextRequest>
8746 for DictionaryDrainIteratorGetNextRequest
8747{
8748 #[inline]
8749 fn from_wire(wire: WireDictionaryDrainIteratorGetNextRequest) -> Self {
8750 Self {
8751 start_id: ::fidl_next::FromWire::from_wire(wire.start_id),
8752
8753 limit: ::fidl_next::FromWire::from_wire(wire.limit),
8754 }
8755 }
8756}
8757
8758impl ::fidl_next::FromWireRef<WireDictionaryDrainIteratorGetNextRequest>
8759 for DictionaryDrainIteratorGetNextRequest
8760{
8761 #[inline]
8762 fn from_wire_ref(wire: &WireDictionaryDrainIteratorGetNextRequest) -> Self {
8763 Self {
8764 start_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.start_id),
8765
8766 limit: ::fidl_next::FromWireRef::from_wire_ref(&wire.limit),
8767 }
8768 }
8769}
8770
8771#[derive(Clone, Debug)]
8773#[repr(C)]
8774pub struct WireDictionaryDrainIteratorGetNextRequest {
8775 pub start_id: ::fidl_next::WireU64,
8776
8777 pub limit: ::fidl_next::WireU32,
8778}
8779
8780unsafe impl ::fidl_next::Wire for WireDictionaryDrainIteratorGetNextRequest {
8781 type Decoded<'de> = WireDictionaryDrainIteratorGetNextRequest;
8782
8783 #[inline]
8784 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8785 unsafe {
8786 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
8787 }
8788 }
8789}
8790
8791unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryDrainIteratorGetNextRequest
8792where
8793 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8794{
8795 fn decode(
8796 slot: ::fidl_next::Slot<'_, Self>,
8797 decoder: &mut ___D,
8798 ) -> Result<(), ::fidl_next::DecodeError> {
8799 ::fidl_next::munge! {
8800 let Self {
8801 mut start_id,
8802 mut limit,
8803
8804 } = slot;
8805 }
8806
8807 ::fidl_next::Decode::decode(start_id.as_mut(), decoder)?;
8808
8809 ::fidl_next::Decode::decode(limit.as_mut(), decoder)?;
8810
8811 Ok(())
8812 }
8813}
8814
8815#[doc = " Maximum number of items returned by dictionary iterator.\n"]
8816pub const MAX_DICTIONARY_ITERATOR_CHUNK: u32 = 128;
8817
8818#[derive(Debug)]
8819pub struct DictionaryDrainIteratorGetNextResponse {
8820 pub items: Vec<crate::DictionaryItem>,
8821
8822 pub end_id: u64,
8823}
8824
8825impl ::fidl_next::Encodable for DictionaryDrainIteratorGetNextResponse {
8826 type Encoded = WireDictionaryDrainIteratorGetNextResponse<'static>;
8827}
8828
8829unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryDrainIteratorGetNextResponse
8830where
8831 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8832
8833 ___E: ::fidl_next::Encoder,
8834
8835 ___E: ::fidl_next::fuchsia::HandleEncoder,
8836{
8837 #[inline]
8838 fn encode(
8839 self,
8840 encoder: &mut ___E,
8841 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8842 ) -> Result<(), ::fidl_next::EncodeError> {
8843 ::fidl_next::munge! {
8844 let Self::Encoded {
8845 items,
8846 end_id,
8847
8848 } = out;
8849 }
8850
8851 ::fidl_next::Encode::encode(self.items, encoder, items)?;
8852
8853 ::fidl_next::Encode::encode(self.end_id, encoder, end_id)?;
8854
8855 Ok(())
8856 }
8857}
8858
8859impl ::fidl_next::EncodableOption for DictionaryDrainIteratorGetNextResponse {
8860 type EncodedOption =
8861 ::fidl_next::WireBox<'static, WireDictionaryDrainIteratorGetNextResponse<'static>>;
8862}
8863
8864unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryDrainIteratorGetNextResponse
8865where
8866 ___E: ::fidl_next::Encoder + ?Sized,
8867 DictionaryDrainIteratorGetNextResponse: ::fidl_next::Encode<___E>,
8868{
8869 #[inline]
8870 fn encode_option(
8871 this: Option<Self>,
8872 encoder: &mut ___E,
8873 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8874 ) -> Result<(), ::fidl_next::EncodeError> {
8875 if let Some(inner) = this {
8876 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8877 ::fidl_next::WireBox::encode_present(out);
8878 } else {
8879 ::fidl_next::WireBox::encode_absent(out);
8880 }
8881
8882 Ok(())
8883 }
8884}
8885
8886impl<'de> ::fidl_next::FromWire<WireDictionaryDrainIteratorGetNextResponse<'de>>
8887 for DictionaryDrainIteratorGetNextResponse
8888{
8889 #[inline]
8890 fn from_wire(wire: WireDictionaryDrainIteratorGetNextResponse<'de>) -> Self {
8891 Self {
8892 items: ::fidl_next::FromWire::from_wire(wire.items),
8893
8894 end_id: ::fidl_next::FromWire::from_wire(wire.end_id),
8895 }
8896 }
8897}
8898
8899#[derive(Debug)]
8901#[repr(C)]
8902pub struct WireDictionaryDrainIteratorGetNextResponse<'de> {
8903 pub items: ::fidl_next::WireVector<'de, crate::WireDictionaryItem<'de>>,
8904
8905 pub end_id: ::fidl_next::WireU64,
8906}
8907
8908unsafe impl ::fidl_next::Wire for WireDictionaryDrainIteratorGetNextResponse<'static> {
8909 type Decoded<'de> = WireDictionaryDrainIteratorGetNextResponse<'de>;
8910
8911 #[inline]
8912 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
8913}
8914
8915unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryDrainIteratorGetNextResponse<'static>
8916where
8917 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8918
8919 ___D: ::fidl_next::Decoder,
8920
8921 ___D: ::fidl_next::fuchsia::HandleDecoder,
8922{
8923 fn decode(
8924 slot: ::fidl_next::Slot<'_, Self>,
8925 decoder: &mut ___D,
8926 ) -> Result<(), ::fidl_next::DecodeError> {
8927 ::fidl_next::munge! {
8928 let Self {
8929 mut items,
8930 mut end_id,
8931
8932 } = slot;
8933 }
8934
8935 ::fidl_next::Decode::decode(items.as_mut(), decoder)?;
8936
8937 let items = unsafe { items.deref_unchecked() };
8938
8939 if items.len() > 128 {
8940 return Err(::fidl_next::DecodeError::VectorTooLong {
8941 size: items.len() as u64,
8942 limit: 128,
8943 });
8944 }
8945
8946 ::fidl_next::Decode::decode(end_id.as_mut(), decoder)?;
8947
8948 Ok(())
8949 }
8950}
8951
8952#[derive(Debug)]
8954pub struct DictionaryDrainIterator;
8955
8956pub mod dictionary_drain_iterator {
8957 pub mod prelude {
8958 pub use crate::{
8959 dictionary_drain_iterator, DictionaryDrainIterator,
8960 DictionaryDrainIteratorClientHandler, DictionaryDrainIteratorClientSender,
8961 DictionaryDrainIteratorServerHandler, DictionaryDrainIteratorServerSender,
8962 };
8963
8964 pub use crate::CapabilityStoreError;
8965
8966 pub use crate::DictionaryDrainIteratorGetNextRequest;
8967
8968 pub use crate::DictionaryDrainIteratorGetNextResponse;
8969 }
8970
8971 pub struct GetNext;
8972
8973 impl ::fidl_next::Method for GetNext {
8974 const ORDINAL: u64 = 5728722530628427873;
8975
8976 type Protocol = crate::DictionaryDrainIterator;
8977
8978 type Request = crate::WireDictionaryDrainIteratorGetNextRequest;
8979
8980 type Response = ::fidl_next::WireFlexibleResult<
8981 'static,
8982 crate::WireDictionaryDrainIteratorGetNextResponse<'static>,
8983 crate::WireCapabilityStoreError,
8984 >;
8985 }
8986}
8987
8988pub trait DictionaryDrainIteratorClientSender {
8990 type Transport: ::fidl_next::Transport;
8991
8992 #[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"]
8993 fn get_next<___R>(
8994 &self,
8995 request: ___R,
8996 ) -> Result<
8997 ::fidl_next::ResponseFuture<'_, Self::Transport, dictionary_drain_iterator::GetNext>,
8998 ::fidl_next::EncodeError,
8999 >
9000 where
9001 ___R: ::fidl_next::Encode<
9002 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
9003 Encoded = crate::WireDictionaryDrainIteratorGetNextRequest,
9004 >;
9005}
9006
9007impl<___T> DictionaryDrainIteratorClientSender
9008 for ::fidl_next::ClientSender<___T, DictionaryDrainIterator>
9009where
9010 ___T: ::fidl_next::Transport,
9011{
9012 type Transport = ___T;
9013
9014 #[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"]
9015 fn get_next<___R>(
9016 &self,
9017 request: ___R,
9018 ) -> Result<
9019 ::fidl_next::ResponseFuture<'_, Self::Transport, dictionary_drain_iterator::GetNext>,
9020 ::fidl_next::EncodeError,
9021 >
9022 where
9023 ___R: ::fidl_next::Encode<
9024 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
9025 Encoded = crate::WireDictionaryDrainIteratorGetNextRequest,
9026 >,
9027 {
9028 self.as_untyped()
9029 .send_two_way(5728722530628427873, request)
9030 .map(::fidl_next::ResponseFuture::from_untyped)
9031 }
9032}
9033
9034pub trait DictionaryDrainIteratorClientHandler<___T: ::fidl_next::Transport> {
9038 fn on_unknown_interaction(
9039 &mut self,
9040 sender: &::fidl_next::ClientSender<___T, DictionaryDrainIterator>,
9041 ordinal: u64,
9042 ) {
9043 sender.close();
9044 }
9045}
9046
9047impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DictionaryDrainIterator
9048where
9049 ___T: ::fidl_next::Transport,
9050 ___H: DictionaryDrainIteratorClientHandler<___T>,
9051
9052 <dictionary_drain_iterator::GetNext as ::fidl_next::Method>::Response:
9053 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9054{
9055 fn on_event(
9056 handler: &mut ___H,
9057 sender: &::fidl_next::ClientSender<___T, Self>,
9058 ordinal: u64,
9059 buffer: ___T::RecvBuffer,
9060 ) {
9061 match ordinal {
9062 ordinal => handler.on_unknown_interaction(sender, ordinal),
9063 }
9064 }
9065}
9066
9067pub trait DictionaryDrainIteratorServerSender {
9069 type Transport: ::fidl_next::Transport;
9070}
9071
9072impl<___T> DictionaryDrainIteratorServerSender
9073 for ::fidl_next::ServerSender<___T, DictionaryDrainIterator>
9074where
9075 ___T: ::fidl_next::Transport,
9076{
9077 type Transport = ___T;
9078}
9079
9080pub trait DictionaryDrainIteratorServerHandler<___T: ::fidl_next::Transport> {
9084 #[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"]
9085 fn get_next(
9086 &mut self,
9087 sender: &::fidl_next::ServerSender<___T, DictionaryDrainIterator>,
9088
9089 request: ::fidl_next::Request<___T, dictionary_drain_iterator::GetNext>,
9090
9091 responder: ::fidl_next::Responder<dictionary_drain_iterator::GetNext>,
9092 );
9093
9094 fn on_unknown_interaction(
9095 &mut self,
9096 sender: &::fidl_next::ServerSender<___T, DictionaryDrainIterator>,
9097 ordinal: u64,
9098 ) {
9099 sender.close();
9100 }
9101}
9102
9103impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DictionaryDrainIterator
9104where
9105 ___T: ::fidl_next::Transport,
9106 ___H: DictionaryDrainIteratorServerHandler<___T>,
9107
9108 <dictionary_drain_iterator::GetNext as ::fidl_next::Method>::Request:
9109 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9110{
9111 fn on_one_way(
9112 handler: &mut ___H,
9113 sender: &::fidl_next::ServerSender<___T, Self>,
9114 ordinal: u64,
9115 buffer: ___T::RecvBuffer,
9116 ) {
9117 match ordinal {
9118 ordinal => handler.on_unknown_interaction(sender, ordinal),
9119 }
9120 }
9121
9122 fn on_two_way(
9123 handler: &mut ___H,
9124 sender: &::fidl_next::ServerSender<___T, Self>,
9125 ordinal: u64,
9126 buffer: ___T::RecvBuffer,
9127 responder: ::fidl_next::protocol::Responder,
9128 ) {
9129 match ordinal {
9130 5728722530628427873 => {
9131 let responder = ::fidl_next::Responder::from_untyped(responder);
9132
9133 match ::fidl_next::DecoderExt::decode(buffer) {
9134 Ok(decoded) => handler.get_next(sender, decoded, responder),
9135 Err(e) => {
9136 sender.close();
9137 }
9138 }
9139 }
9140
9141 ordinal => handler.on_unknown_interaction(sender, ordinal),
9142 }
9143 }
9144}
9145
9146#[derive(Clone, Debug)]
9147pub struct DictionaryEnumerateIteratorGetNextRequest {
9148 pub start_id: u64,
9149
9150 pub limit: u32,
9151}
9152
9153impl ::fidl_next::Encodable for DictionaryEnumerateIteratorGetNextRequest {
9154 type Encoded = WireDictionaryEnumerateIteratorGetNextRequest;
9155}
9156
9157unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryEnumerateIteratorGetNextRequest
9158where
9159 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9160{
9161 #[inline]
9162 fn encode(
9163 self,
9164 encoder: &mut ___E,
9165 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9166 ) -> Result<(), ::fidl_next::EncodeError> {
9167 ::fidl_next::munge! {
9168 let Self::Encoded {
9169 start_id,
9170 limit,
9171
9172 } = out;
9173 }
9174
9175 ::fidl_next::Encode::encode(self.start_id, encoder, start_id)?;
9176
9177 ::fidl_next::Encode::encode(self.limit, encoder, limit)?;
9178
9179 Ok(())
9180 }
9181}
9182
9183unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DictionaryEnumerateIteratorGetNextRequest
9184where
9185 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9186{
9187 #[inline]
9188 fn encode_ref(
9189 &self,
9190 encoder: &mut ___E,
9191 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9192 ) -> Result<(), ::fidl_next::EncodeError> {
9193 ::fidl_next::munge! {
9194 let Self::Encoded {
9195 start_id,
9196 limit,
9197
9198 } = out;
9199 }
9200
9201 ::fidl_next::EncodeRef::encode_ref(&self.start_id, encoder, start_id)?;
9202
9203 ::fidl_next::EncodeRef::encode_ref(&self.limit, encoder, limit)?;
9204
9205 Ok(())
9206 }
9207}
9208
9209impl ::fidl_next::EncodableOption for DictionaryEnumerateIteratorGetNextRequest {
9210 type EncodedOption =
9211 ::fidl_next::WireBox<'static, WireDictionaryEnumerateIteratorGetNextRequest>;
9212}
9213
9214unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryEnumerateIteratorGetNextRequest
9215where
9216 ___E: ::fidl_next::Encoder + ?Sized,
9217 DictionaryEnumerateIteratorGetNextRequest: ::fidl_next::Encode<___E>,
9218{
9219 #[inline]
9220 fn encode_option(
9221 this: Option<Self>,
9222 encoder: &mut ___E,
9223 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9224 ) -> Result<(), ::fidl_next::EncodeError> {
9225 if let Some(inner) = this {
9226 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9227 ::fidl_next::WireBox::encode_present(out);
9228 } else {
9229 ::fidl_next::WireBox::encode_absent(out);
9230 }
9231
9232 Ok(())
9233 }
9234}
9235
9236unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DictionaryEnumerateIteratorGetNextRequest
9237where
9238 ___E: ::fidl_next::Encoder + ?Sized,
9239 DictionaryEnumerateIteratorGetNextRequest: ::fidl_next::EncodeRef<___E>,
9240{
9241 #[inline]
9242 fn encode_option_ref(
9243 this: Option<&Self>,
9244 encoder: &mut ___E,
9245 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9246 ) -> Result<(), ::fidl_next::EncodeError> {
9247 if let Some(inner) = this {
9248 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9249 ::fidl_next::WireBox::encode_present(out);
9250 } else {
9251 ::fidl_next::WireBox::encode_absent(out);
9252 }
9253
9254 Ok(())
9255 }
9256}
9257
9258impl ::fidl_next::FromWire<WireDictionaryEnumerateIteratorGetNextRequest>
9259 for DictionaryEnumerateIteratorGetNextRequest
9260{
9261 #[inline]
9262 fn from_wire(wire: WireDictionaryEnumerateIteratorGetNextRequest) -> Self {
9263 Self {
9264 start_id: ::fidl_next::FromWire::from_wire(wire.start_id),
9265
9266 limit: ::fidl_next::FromWire::from_wire(wire.limit),
9267 }
9268 }
9269}
9270
9271impl ::fidl_next::FromWireRef<WireDictionaryEnumerateIteratorGetNextRequest>
9272 for DictionaryEnumerateIteratorGetNextRequest
9273{
9274 #[inline]
9275 fn from_wire_ref(wire: &WireDictionaryEnumerateIteratorGetNextRequest) -> Self {
9276 Self {
9277 start_id: ::fidl_next::FromWireRef::from_wire_ref(&wire.start_id),
9278
9279 limit: ::fidl_next::FromWireRef::from_wire_ref(&wire.limit),
9280 }
9281 }
9282}
9283
9284#[derive(Clone, Debug)]
9286#[repr(C)]
9287pub struct WireDictionaryEnumerateIteratorGetNextRequest {
9288 pub start_id: ::fidl_next::WireU64,
9289
9290 pub limit: ::fidl_next::WireU32,
9291}
9292
9293unsafe impl ::fidl_next::Wire for WireDictionaryEnumerateIteratorGetNextRequest {
9294 type Decoded<'de> = WireDictionaryEnumerateIteratorGetNextRequest;
9295
9296 #[inline]
9297 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9298 unsafe {
9299 out.as_mut_ptr().cast::<u8>().add(12).write_bytes(0, 4);
9300 }
9301 }
9302}
9303
9304unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryEnumerateIteratorGetNextRequest
9305where
9306 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9307{
9308 fn decode(
9309 slot: ::fidl_next::Slot<'_, Self>,
9310 decoder: &mut ___D,
9311 ) -> Result<(), ::fidl_next::DecodeError> {
9312 ::fidl_next::munge! {
9313 let Self {
9314 mut start_id,
9315 mut limit,
9316
9317 } = slot;
9318 }
9319
9320 ::fidl_next::Decode::decode(start_id.as_mut(), decoder)?;
9321
9322 ::fidl_next::Decode::decode(limit.as_mut(), decoder)?;
9323
9324 Ok(())
9325 }
9326}
9327
9328#[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"]
9329#[derive(Debug)]
9330pub struct DictionaryOptionalItem {
9331 pub key: String,
9332
9333 pub value: Option<Box<crate::WrappedCapabilityId>>,
9334}
9335
9336impl ::fidl_next::Encodable for DictionaryOptionalItem {
9337 type Encoded = WireDictionaryOptionalItem<'static>;
9338}
9339
9340unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryOptionalItem
9341where
9342 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9343
9344 ___E: ::fidl_next::Encoder,
9345
9346 ___E: ::fidl_next::fuchsia::HandleEncoder,
9347{
9348 #[inline]
9349 fn encode(
9350 self,
9351 encoder: &mut ___E,
9352 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9353 ) -> Result<(), ::fidl_next::EncodeError> {
9354 ::fidl_next::munge! {
9355 let Self::Encoded {
9356 key,
9357 value,
9358
9359 } = out;
9360 }
9361
9362 ::fidl_next::Encode::encode(self.key, encoder, key)?;
9363
9364 ::fidl_next::Encode::encode(self.value, encoder, value)?;
9365
9366 Ok(())
9367 }
9368}
9369
9370impl ::fidl_next::EncodableOption for DictionaryOptionalItem {
9371 type EncodedOption = ::fidl_next::WireBox<'static, WireDictionaryOptionalItem<'static>>;
9372}
9373
9374unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryOptionalItem
9375where
9376 ___E: ::fidl_next::Encoder + ?Sized,
9377 DictionaryOptionalItem: ::fidl_next::Encode<___E>,
9378{
9379 #[inline]
9380 fn encode_option(
9381 this: Option<Self>,
9382 encoder: &mut ___E,
9383 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9384 ) -> Result<(), ::fidl_next::EncodeError> {
9385 if let Some(inner) = this {
9386 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9387 ::fidl_next::WireBox::encode_present(out);
9388 } else {
9389 ::fidl_next::WireBox::encode_absent(out);
9390 }
9391
9392 Ok(())
9393 }
9394}
9395
9396impl<'de> ::fidl_next::FromWire<WireDictionaryOptionalItem<'de>> for DictionaryOptionalItem {
9397 #[inline]
9398 fn from_wire(wire: WireDictionaryOptionalItem<'de>) -> Self {
9399 Self {
9400 key: ::fidl_next::FromWire::from_wire(wire.key),
9401
9402 value: ::fidl_next::FromWire::from_wire(wire.value),
9403 }
9404 }
9405}
9406
9407#[derive(Debug)]
9409#[repr(C)]
9410pub struct WireDictionaryOptionalItem<'de> {
9411 pub key: ::fidl_next::WireString<'de>,
9412
9413 pub value: ::fidl_next::WireBox<'de, crate::WireWrappedCapabilityId>,
9414}
9415
9416unsafe impl ::fidl_next::Wire for WireDictionaryOptionalItem<'static> {
9417 type Decoded<'de> = WireDictionaryOptionalItem<'de>;
9418
9419 #[inline]
9420 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
9421}
9422
9423unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryOptionalItem<'static>
9424where
9425 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9426
9427 ___D: ::fidl_next::Decoder,
9428
9429 ___D: ::fidl_next::fuchsia::HandleDecoder,
9430{
9431 fn decode(
9432 slot: ::fidl_next::Slot<'_, Self>,
9433 decoder: &mut ___D,
9434 ) -> Result<(), ::fidl_next::DecodeError> {
9435 ::fidl_next::munge! {
9436 let Self {
9437 mut key,
9438 mut value,
9439
9440 } = slot;
9441 }
9442
9443 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
9444
9445 let key = unsafe { key.deref_unchecked() };
9446
9447 if key.len() > 255 {
9448 return Err(::fidl_next::DecodeError::VectorTooLong {
9449 size: key.len() as u64,
9450 limit: 255,
9451 });
9452 }
9453
9454 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
9455
9456 Ok(())
9457 }
9458}
9459
9460#[derive(Debug)]
9461pub struct DictionaryEnumerateIteratorGetNextResponse {
9462 pub items: Vec<crate::DictionaryOptionalItem>,
9463
9464 pub end_id: u64,
9465}
9466
9467impl ::fidl_next::Encodable for DictionaryEnumerateIteratorGetNextResponse {
9468 type Encoded = WireDictionaryEnumerateIteratorGetNextResponse<'static>;
9469}
9470
9471unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryEnumerateIteratorGetNextResponse
9472where
9473 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9474
9475 ___E: ::fidl_next::Encoder,
9476
9477 ___E: ::fidl_next::fuchsia::HandleEncoder,
9478{
9479 #[inline]
9480 fn encode(
9481 self,
9482 encoder: &mut ___E,
9483 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9484 ) -> Result<(), ::fidl_next::EncodeError> {
9485 ::fidl_next::munge! {
9486 let Self::Encoded {
9487 items,
9488 end_id,
9489
9490 } = out;
9491 }
9492
9493 ::fidl_next::Encode::encode(self.items, encoder, items)?;
9494
9495 ::fidl_next::Encode::encode(self.end_id, encoder, end_id)?;
9496
9497 Ok(())
9498 }
9499}
9500
9501impl ::fidl_next::EncodableOption for DictionaryEnumerateIteratorGetNextResponse {
9502 type EncodedOption =
9503 ::fidl_next::WireBox<'static, WireDictionaryEnumerateIteratorGetNextResponse<'static>>;
9504}
9505
9506unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryEnumerateIteratorGetNextResponse
9507where
9508 ___E: ::fidl_next::Encoder + ?Sized,
9509 DictionaryEnumerateIteratorGetNextResponse: ::fidl_next::Encode<___E>,
9510{
9511 #[inline]
9512 fn encode_option(
9513 this: Option<Self>,
9514 encoder: &mut ___E,
9515 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
9516 ) -> Result<(), ::fidl_next::EncodeError> {
9517 if let Some(inner) = this {
9518 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
9519 ::fidl_next::WireBox::encode_present(out);
9520 } else {
9521 ::fidl_next::WireBox::encode_absent(out);
9522 }
9523
9524 Ok(())
9525 }
9526}
9527
9528impl<'de> ::fidl_next::FromWire<WireDictionaryEnumerateIteratorGetNextResponse<'de>>
9529 for DictionaryEnumerateIteratorGetNextResponse
9530{
9531 #[inline]
9532 fn from_wire(wire: WireDictionaryEnumerateIteratorGetNextResponse<'de>) -> Self {
9533 Self {
9534 items: ::fidl_next::FromWire::from_wire(wire.items),
9535
9536 end_id: ::fidl_next::FromWire::from_wire(wire.end_id),
9537 }
9538 }
9539}
9540
9541#[derive(Debug)]
9543#[repr(C)]
9544pub struct WireDictionaryEnumerateIteratorGetNextResponse<'de> {
9545 pub items: ::fidl_next::WireVector<'de, crate::WireDictionaryOptionalItem<'de>>,
9546
9547 pub end_id: ::fidl_next::WireU64,
9548}
9549
9550unsafe impl ::fidl_next::Wire for WireDictionaryEnumerateIteratorGetNextResponse<'static> {
9551 type Decoded<'de> = WireDictionaryEnumerateIteratorGetNextResponse<'de>;
9552
9553 #[inline]
9554 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
9555}
9556
9557unsafe impl<___D> ::fidl_next::Decode<___D>
9558 for WireDictionaryEnumerateIteratorGetNextResponse<'static>
9559where
9560 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
9561
9562 ___D: ::fidl_next::Decoder,
9563
9564 ___D: ::fidl_next::fuchsia::HandleDecoder,
9565{
9566 fn decode(
9567 slot: ::fidl_next::Slot<'_, Self>,
9568 decoder: &mut ___D,
9569 ) -> Result<(), ::fidl_next::DecodeError> {
9570 ::fidl_next::munge! {
9571 let Self {
9572 mut items,
9573 mut end_id,
9574
9575 } = slot;
9576 }
9577
9578 ::fidl_next::Decode::decode(items.as_mut(), decoder)?;
9579
9580 let items = unsafe { items.deref_unchecked() };
9581
9582 if items.len() > 128 {
9583 return Err(::fidl_next::DecodeError::VectorTooLong {
9584 size: items.len() as u64,
9585 limit: 128,
9586 });
9587 }
9588
9589 ::fidl_next::Decode::decode(end_id.as_mut(), decoder)?;
9590
9591 Ok(())
9592 }
9593}
9594
9595#[derive(Debug)]
9597pub struct DictionaryEnumerateIterator;
9598
9599pub mod dictionary_enumerate_iterator {
9600 pub mod prelude {
9601 pub use crate::{
9602 dictionary_enumerate_iterator, DictionaryEnumerateIterator,
9603 DictionaryEnumerateIteratorClientHandler, DictionaryEnumerateIteratorClientSender,
9604 DictionaryEnumerateIteratorServerHandler, DictionaryEnumerateIteratorServerSender,
9605 };
9606
9607 pub use crate::CapabilityStoreError;
9608
9609 pub use crate::DictionaryEnumerateIteratorGetNextRequest;
9610
9611 pub use crate::DictionaryEnumerateIteratorGetNextResponse;
9612 }
9613
9614 pub struct GetNext;
9615
9616 impl ::fidl_next::Method for GetNext {
9617 const ORDINAL: u64 = 1511164556663256527;
9618
9619 type Protocol = crate::DictionaryEnumerateIterator;
9620
9621 type Request = crate::WireDictionaryEnumerateIteratorGetNextRequest;
9622
9623 type Response = ::fidl_next::WireFlexibleResult<
9624 'static,
9625 crate::WireDictionaryEnumerateIteratorGetNextResponse<'static>,
9626 crate::WireCapabilityStoreError,
9627 >;
9628 }
9629}
9630
9631pub trait DictionaryEnumerateIteratorClientSender {
9633 type Transport: ::fidl_next::Transport;
9634
9635 #[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"]
9636 fn get_next<___R>(
9637 &self,
9638 request: ___R,
9639 ) -> Result<
9640 ::fidl_next::ResponseFuture<'_, Self::Transport, dictionary_enumerate_iterator::GetNext>,
9641 ::fidl_next::EncodeError,
9642 >
9643 where
9644 ___R: ::fidl_next::Encode<
9645 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
9646 Encoded = crate::WireDictionaryEnumerateIteratorGetNextRequest,
9647 >;
9648}
9649
9650impl<___T> DictionaryEnumerateIteratorClientSender
9651 for ::fidl_next::ClientSender<___T, DictionaryEnumerateIterator>
9652where
9653 ___T: ::fidl_next::Transport,
9654{
9655 type Transport = ___T;
9656
9657 #[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"]
9658 fn get_next<___R>(
9659 &self,
9660 request: ___R,
9661 ) -> Result<
9662 ::fidl_next::ResponseFuture<'_, Self::Transport, dictionary_enumerate_iterator::GetNext>,
9663 ::fidl_next::EncodeError,
9664 >
9665 where
9666 ___R: ::fidl_next::Encode<
9667 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
9668 Encoded = crate::WireDictionaryEnumerateIteratorGetNextRequest,
9669 >,
9670 {
9671 self.as_untyped()
9672 .send_two_way(1511164556663256527, request)
9673 .map(::fidl_next::ResponseFuture::from_untyped)
9674 }
9675}
9676
9677pub trait DictionaryEnumerateIteratorClientHandler<___T: ::fidl_next::Transport> {
9681 fn on_unknown_interaction(
9682 &mut self,
9683 sender: &::fidl_next::ClientSender<___T, DictionaryEnumerateIterator>,
9684 ordinal: u64,
9685 ) {
9686 sender.close();
9687 }
9688}
9689
9690impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DictionaryEnumerateIterator
9691where
9692 ___T: ::fidl_next::Transport,
9693 ___H: DictionaryEnumerateIteratorClientHandler<___T>,
9694
9695 <dictionary_enumerate_iterator::GetNext as ::fidl_next::Method>::Response:
9696 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9697{
9698 fn on_event(
9699 handler: &mut ___H,
9700 sender: &::fidl_next::ClientSender<___T, Self>,
9701 ordinal: u64,
9702 buffer: ___T::RecvBuffer,
9703 ) {
9704 match ordinal {
9705 ordinal => handler.on_unknown_interaction(sender, ordinal),
9706 }
9707 }
9708}
9709
9710pub trait DictionaryEnumerateIteratorServerSender {
9712 type Transport: ::fidl_next::Transport;
9713}
9714
9715impl<___T> DictionaryEnumerateIteratorServerSender
9716 for ::fidl_next::ServerSender<___T, DictionaryEnumerateIterator>
9717where
9718 ___T: ::fidl_next::Transport,
9719{
9720 type Transport = ___T;
9721}
9722
9723pub trait DictionaryEnumerateIteratorServerHandler<___T: ::fidl_next::Transport> {
9727 #[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"]
9728 fn get_next(
9729 &mut self,
9730 sender: &::fidl_next::ServerSender<___T, DictionaryEnumerateIterator>,
9731
9732 request: ::fidl_next::Request<___T, dictionary_enumerate_iterator::GetNext>,
9733
9734 responder: ::fidl_next::Responder<dictionary_enumerate_iterator::GetNext>,
9735 );
9736
9737 fn on_unknown_interaction(
9738 &mut self,
9739 sender: &::fidl_next::ServerSender<___T, DictionaryEnumerateIterator>,
9740 ordinal: u64,
9741 ) {
9742 sender.close();
9743 }
9744}
9745
9746impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DictionaryEnumerateIterator
9747where
9748 ___T: ::fidl_next::Transport,
9749 ___H: DictionaryEnumerateIteratorServerHandler<___T>,
9750
9751 <dictionary_enumerate_iterator::GetNext as ::fidl_next::Method>::Request:
9752 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9753{
9754 fn on_one_way(
9755 handler: &mut ___H,
9756 sender: &::fidl_next::ServerSender<___T, Self>,
9757 ordinal: u64,
9758 buffer: ___T::RecvBuffer,
9759 ) {
9760 match ordinal {
9761 ordinal => handler.on_unknown_interaction(sender, ordinal),
9762 }
9763 }
9764
9765 fn on_two_way(
9766 handler: &mut ___H,
9767 sender: &::fidl_next::ServerSender<___T, Self>,
9768 ordinal: u64,
9769 buffer: ___T::RecvBuffer,
9770 responder: ::fidl_next::protocol::Responder,
9771 ) {
9772 match ordinal {
9773 1511164556663256527 => {
9774 let responder = ::fidl_next::Responder::from_untyped(responder);
9775
9776 match ::fidl_next::DecoderExt::decode(buffer) {
9777 Ok(decoded) => handler.get_next(sender, decoded, responder),
9778 Err(e) => {
9779 sender.close();
9780 }
9781 }
9782 }
9783
9784 ordinal => handler.on_unknown_interaction(sender, ordinal),
9785 }
9786 }
9787}
9788
9789#[doc = " Error returned from [CapabilityStore/Dictionary*] methods.\n"]
9790#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9791#[repr(u32)]
9792pub enum DictionaryError {
9793 NotFound = 1,
9794 AlreadyExists = 2,
9795 BadCapability = 3,
9796 InvalidKey = 4,
9797 NotCloneable = 5,
9798 UnknownOrdinal_(u32),
9799}
9800
9801impl ::fidl_next::Encodable for DictionaryError {
9802 type Encoded = WireDictionaryError;
9803}
9804impl ::std::convert::From<u32> for DictionaryError {
9805 fn from(value: u32) -> Self {
9806 match value {
9807 1 => Self::NotFound,
9808 2 => Self::AlreadyExists,
9809 3 => Self::BadCapability,
9810 4 => Self::InvalidKey,
9811 5 => Self::NotCloneable,
9812
9813 _ => Self::UnknownOrdinal_(value),
9814 }
9815 }
9816}
9817
9818unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryError
9819where
9820 ___E: ?Sized,
9821{
9822 #[inline]
9823 fn encode(
9824 self,
9825 encoder: &mut ___E,
9826 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9827 ) -> Result<(), ::fidl_next::EncodeError> {
9828 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
9829 }
9830}
9831
9832unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DictionaryError
9833where
9834 ___E: ?Sized,
9835{
9836 #[inline]
9837 fn encode_ref(
9838 &self,
9839 encoder: &mut ___E,
9840 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9841 ) -> Result<(), ::fidl_next::EncodeError> {
9842 ::fidl_next::munge!(let WireDictionaryError { value } = out);
9843 let _ = value.write(::fidl_next::WireU32::from(match *self {
9844 Self::NotFound => 1,
9845
9846 Self::AlreadyExists => 2,
9847
9848 Self::BadCapability => 3,
9849
9850 Self::InvalidKey => 4,
9851
9852 Self::NotCloneable => 5,
9853
9854 Self::UnknownOrdinal_(value) => value,
9855 }));
9856
9857 Ok(())
9858 }
9859}
9860
9861impl ::core::convert::From<WireDictionaryError> for DictionaryError {
9862 fn from(wire: WireDictionaryError) -> Self {
9863 match u32::from(wire.value) {
9864 1 => Self::NotFound,
9865
9866 2 => Self::AlreadyExists,
9867
9868 3 => Self::BadCapability,
9869
9870 4 => Self::InvalidKey,
9871
9872 5 => Self::NotCloneable,
9873
9874 value => Self::UnknownOrdinal_(value),
9875 }
9876 }
9877}
9878
9879impl ::fidl_next::FromWire<WireDictionaryError> for DictionaryError {
9880 #[inline]
9881 fn from_wire(wire: WireDictionaryError) -> Self {
9882 Self::from(wire)
9883 }
9884}
9885
9886impl ::fidl_next::FromWireRef<WireDictionaryError> for DictionaryError {
9887 #[inline]
9888 fn from_wire_ref(wire: &WireDictionaryError) -> Self {
9889 Self::from(*wire)
9890 }
9891}
9892
9893#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9895#[repr(transparent)]
9896pub struct WireDictionaryError {
9897 value: ::fidl_next::WireU32,
9898}
9899
9900unsafe impl ::fidl_next::Wire for WireDictionaryError {
9901 type Decoded<'de> = Self;
9902
9903 #[inline]
9904 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
9905 }
9907}
9908
9909impl WireDictionaryError {
9910 pub const NOT_FOUND: WireDictionaryError =
9911 WireDictionaryError { value: ::fidl_next::WireU32(1) };
9912
9913 pub const ALREADY_EXISTS: WireDictionaryError =
9914 WireDictionaryError { value: ::fidl_next::WireU32(2) };
9915
9916 pub const BAD_CAPABILITY: WireDictionaryError =
9917 WireDictionaryError { value: ::fidl_next::WireU32(3) };
9918
9919 pub const INVALID_KEY: WireDictionaryError =
9920 WireDictionaryError { value: ::fidl_next::WireU32(4) };
9921
9922 pub const NOT_CLONEABLE: WireDictionaryError =
9923 WireDictionaryError { value: ::fidl_next::WireU32(5) };
9924}
9925
9926unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryError
9927where
9928 ___D: ?Sized,
9929{
9930 fn decode(
9931 slot: ::fidl_next::Slot<'_, Self>,
9932 _: &mut ___D,
9933 ) -> Result<(), ::fidl_next::DecodeError> {
9934 Ok(())
9935 }
9936}
9937
9938impl ::core::convert::From<DictionaryError> for WireDictionaryError {
9939 fn from(natural: DictionaryError) -> Self {
9940 match natural {
9941 DictionaryError::NotFound => WireDictionaryError::NOT_FOUND,
9942
9943 DictionaryError::AlreadyExists => WireDictionaryError::ALREADY_EXISTS,
9944
9945 DictionaryError::BadCapability => WireDictionaryError::BAD_CAPABILITY,
9946
9947 DictionaryError::InvalidKey => WireDictionaryError::INVALID_KEY,
9948
9949 DictionaryError::NotCloneable => WireDictionaryError::NOT_CLONEABLE,
9950
9951 DictionaryError::UnknownOrdinal_(value) => {
9952 WireDictionaryError { value: ::fidl_next::WireU32::from(value) }
9953 }
9954 }
9955 }
9956}
9957
9958#[derive(Debug)]
9959pub struct DictionaryKeysIteratorGetNextResponse {
9960 pub keys: Vec<String>,
9961}
9962
9963impl ::fidl_next::Encodable for DictionaryKeysIteratorGetNextResponse {
9964 type Encoded = WireDictionaryKeysIteratorGetNextResponse<'static>;
9965}
9966
9967unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryKeysIteratorGetNextResponse
9968where
9969 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9970
9971 ___E: ::fidl_next::Encoder,
9972
9973 ___E: ::fidl_next::fuchsia::HandleEncoder,
9974{
9975 #[inline]
9976 fn encode(
9977 self,
9978 encoder: &mut ___E,
9979 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9980 ) -> Result<(), ::fidl_next::EncodeError> {
9981 ::fidl_next::munge! {
9982 let Self::Encoded {
9983 keys,
9984
9985 } = out;
9986 }
9987
9988 ::fidl_next::Encode::encode(self.keys, encoder, keys)?;
9989
9990 Ok(())
9991 }
9992}
9993
9994impl ::fidl_next::EncodableOption for DictionaryKeysIteratorGetNextResponse {
9995 type EncodedOption =
9996 ::fidl_next::WireBox<'static, WireDictionaryKeysIteratorGetNextResponse<'static>>;
9997}
9998
9999unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryKeysIteratorGetNextResponse
10000where
10001 ___E: ::fidl_next::Encoder + ?Sized,
10002 DictionaryKeysIteratorGetNextResponse: ::fidl_next::Encode<___E>,
10003{
10004 #[inline]
10005 fn encode_option(
10006 this: Option<Self>,
10007 encoder: &mut ___E,
10008 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10009 ) -> Result<(), ::fidl_next::EncodeError> {
10010 if let Some(inner) = this {
10011 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10012 ::fidl_next::WireBox::encode_present(out);
10013 } else {
10014 ::fidl_next::WireBox::encode_absent(out);
10015 }
10016
10017 Ok(())
10018 }
10019}
10020
10021impl<'de> ::fidl_next::FromWire<WireDictionaryKeysIteratorGetNextResponse<'de>>
10022 for DictionaryKeysIteratorGetNextResponse
10023{
10024 #[inline]
10025 fn from_wire(wire: WireDictionaryKeysIteratorGetNextResponse<'de>) -> Self {
10026 Self { keys: ::fidl_next::FromWire::from_wire(wire.keys) }
10027 }
10028}
10029
10030#[derive(Debug)]
10032#[repr(C)]
10033pub struct WireDictionaryKeysIteratorGetNextResponse<'de> {
10034 pub keys: ::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>,
10035}
10036
10037unsafe impl ::fidl_next::Wire for WireDictionaryKeysIteratorGetNextResponse<'static> {
10038 type Decoded<'de> = WireDictionaryKeysIteratorGetNextResponse<'de>;
10039
10040 #[inline]
10041 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10042}
10043
10044unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryKeysIteratorGetNextResponse<'static>
10045where
10046 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10047
10048 ___D: ::fidl_next::Decoder,
10049
10050 ___D: ::fidl_next::fuchsia::HandleDecoder,
10051{
10052 fn decode(
10053 slot: ::fidl_next::Slot<'_, Self>,
10054 decoder: &mut ___D,
10055 ) -> Result<(), ::fidl_next::DecodeError> {
10056 ::fidl_next::munge! {
10057 let Self {
10058 mut keys,
10059
10060 } = slot;
10061 }
10062
10063 ::fidl_next::Decode::decode(keys.as_mut(), decoder)?;
10064
10065 let keys = unsafe { keys.deref_unchecked() };
10066
10067 if keys.len() > 128 {
10068 return Err(::fidl_next::DecodeError::VectorTooLong {
10069 size: keys.len() as u64,
10070 limit: 128,
10071 });
10072 }
10073
10074 Ok(())
10075 }
10076}
10077
10078#[derive(Debug)]
10080pub struct DictionaryKeysIterator;
10081
10082pub mod dictionary_keys_iterator {
10083 pub mod prelude {
10084 pub use crate::{
10085 dictionary_keys_iterator, DictionaryKeysIterator, DictionaryKeysIteratorClientHandler,
10086 DictionaryKeysIteratorClientSender, DictionaryKeysIteratorServerHandler,
10087 DictionaryKeysIteratorServerSender,
10088 };
10089
10090 pub use crate::DictionaryKeysIteratorGetNextResponse;
10091 }
10092
10093 pub struct GetNext;
10094
10095 impl ::fidl_next::Method for GetNext {
10096 const ORDINAL: u64 = 4987781442555247955;
10097
10098 type Protocol = crate::DictionaryKeysIterator;
10099
10100 type Request = ();
10101
10102 type Response = ::fidl_next::WireFlexible<
10103 'static,
10104 crate::WireDictionaryKeysIteratorGetNextResponse<'static>,
10105 >;
10106 }
10107}
10108
10109pub trait DictionaryKeysIteratorClientSender {
10111 type Transport: ::fidl_next::Transport;
10112
10113 fn get_next(
10114 &self,
10115 ) -> Result<
10116 ::fidl_next::ResponseFuture<'_, Self::Transport, dictionary_keys_iterator::GetNext>,
10117 ::fidl_next::EncodeError,
10118 >;
10119}
10120
10121impl<___T> DictionaryKeysIteratorClientSender
10122 for ::fidl_next::ClientSender<___T, DictionaryKeysIterator>
10123where
10124 ___T: ::fidl_next::Transport,
10125{
10126 type Transport = ___T;
10127
10128 fn get_next(
10129 &self,
10130 ) -> Result<
10131 ::fidl_next::ResponseFuture<'_, Self::Transport, dictionary_keys_iterator::GetNext>,
10132 ::fidl_next::EncodeError,
10133 > {
10134 self.as_untyped()
10135 .send_two_way(4987781442555247955, ())
10136 .map(::fidl_next::ResponseFuture::from_untyped)
10137 }
10138}
10139
10140pub trait DictionaryKeysIteratorClientHandler<___T: ::fidl_next::Transport> {
10144 fn on_unknown_interaction(
10145 &mut self,
10146 sender: &::fidl_next::ClientSender<___T, DictionaryKeysIterator>,
10147 ordinal: u64,
10148 ) {
10149 sender.close();
10150 }
10151}
10152
10153impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DictionaryKeysIterator
10154where
10155 ___T: ::fidl_next::Transport,
10156 ___H: DictionaryKeysIteratorClientHandler<___T>,
10157
10158 <dictionary_keys_iterator::GetNext as ::fidl_next::Method>::Response:
10159 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10160{
10161 fn on_event(
10162 handler: &mut ___H,
10163 sender: &::fidl_next::ClientSender<___T, Self>,
10164 ordinal: u64,
10165 buffer: ___T::RecvBuffer,
10166 ) {
10167 match ordinal {
10168 ordinal => handler.on_unknown_interaction(sender, ordinal),
10169 }
10170 }
10171}
10172
10173pub trait DictionaryKeysIteratorServerSender {
10175 type Transport: ::fidl_next::Transport;
10176}
10177
10178impl<___T> DictionaryKeysIteratorServerSender
10179 for ::fidl_next::ServerSender<___T, DictionaryKeysIterator>
10180where
10181 ___T: ::fidl_next::Transport,
10182{
10183 type Transport = ___T;
10184}
10185
10186pub trait DictionaryKeysIteratorServerHandler<___T: ::fidl_next::Transport> {
10190 fn get_next(
10191 &mut self,
10192 sender: &::fidl_next::ServerSender<___T, DictionaryKeysIterator>,
10193
10194 responder: ::fidl_next::Responder<dictionary_keys_iterator::GetNext>,
10195 );
10196
10197 fn on_unknown_interaction(
10198 &mut self,
10199 sender: &::fidl_next::ServerSender<___T, DictionaryKeysIterator>,
10200 ordinal: u64,
10201 ) {
10202 sender.close();
10203 }
10204}
10205
10206impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DictionaryKeysIterator
10207where
10208 ___T: ::fidl_next::Transport,
10209 ___H: DictionaryKeysIteratorServerHandler<___T>,
10210{
10211 fn on_one_way(
10212 handler: &mut ___H,
10213 sender: &::fidl_next::ServerSender<___T, Self>,
10214 ordinal: u64,
10215 buffer: ___T::RecvBuffer,
10216 ) {
10217 match ordinal {
10218 ordinal => handler.on_unknown_interaction(sender, ordinal),
10219 }
10220 }
10221
10222 fn on_two_way(
10223 handler: &mut ___H,
10224 sender: &::fidl_next::ServerSender<___T, Self>,
10225 ordinal: u64,
10226 buffer: ___T::RecvBuffer,
10227 responder: ::fidl_next::protocol::Responder,
10228 ) {
10229 match ordinal {
10230 4987781442555247955 => {
10231 let responder = ::fidl_next::Responder::from_untyped(responder);
10232
10233 handler.get_next(sender, responder);
10234 }
10235
10236 ordinal => handler.on_unknown_interaction(sender, ordinal),
10237 }
10238 }
10239}
10240
10241#[derive(Debug)]
10242pub enum DictionaryRouterRouteResponse {
10243 Dictionary(crate::DictionaryRef),
10244
10245 Unavailable(crate::Unit),
10246}
10247
10248impl ::fidl_next::Encodable for DictionaryRouterRouteResponse {
10249 type Encoded = WireDictionaryRouterRouteResponse;
10250}
10251
10252unsafe impl<___E> ::fidl_next::Encode<___E> for DictionaryRouterRouteResponse
10253where
10254 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10255
10256 ___E: ::fidl_next::fuchsia::HandleEncoder,
10257{
10258 #[inline]
10259 fn encode(
10260 self,
10261 encoder: &mut ___E,
10262 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10263 ) -> Result<(), ::fidl_next::EncodeError> {
10264 ::fidl_next::munge!(let WireDictionaryRouterRouteResponse { raw, _phantom: _ } = out);
10265
10266 match self {
10267 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as_static::<
10268 ___E,
10269 crate::DictionaryRef,
10270 >(value, 1, encoder, raw)?,
10271
10272 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
10273 ___E,
10274 crate::Unit,
10275 >(value, 2, encoder, raw)?,
10276 }
10277
10278 Ok(())
10279 }
10280}
10281
10282impl ::fidl_next::EncodableOption for DictionaryRouterRouteResponse {
10283 type EncodedOption = WireOptionalDictionaryRouterRouteResponse;
10284}
10285
10286unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DictionaryRouterRouteResponse
10287where
10288 ___E: ?Sized,
10289 DictionaryRouterRouteResponse: ::fidl_next::Encode<___E>,
10290{
10291 #[inline]
10292 fn encode_option(
10293 this: Option<Self>,
10294 encoder: &mut ___E,
10295 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10296 ) -> Result<(), ::fidl_next::EncodeError> {
10297 ::fidl_next::munge!(let WireOptionalDictionaryRouterRouteResponse { raw, _phantom: _ } = &mut *out);
10298
10299 if let Some(inner) = this {
10300 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
10301 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
10302 } else {
10303 ::fidl_next::RawWireUnion::encode_absent(raw);
10304 }
10305
10306 Ok(())
10307 }
10308}
10309
10310impl ::fidl_next::FromWire<WireDictionaryRouterRouteResponse> for DictionaryRouterRouteResponse {
10311 #[inline]
10312 fn from_wire(wire: WireDictionaryRouterRouteResponse) -> Self {
10313 let wire = ::core::mem::ManuallyDrop::new(wire);
10314 match wire.raw.ordinal() {
10315 1 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
10316 wire.raw.get().read_unchecked::<crate::WireDictionaryRef>()
10317 })),
10318
10319 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
10320 wire.raw.get().read_unchecked::<crate::WireUnit>()
10321 })),
10322
10323 _ => unsafe { ::core::hint::unreachable_unchecked() },
10324 }
10325 }
10326}
10327
10328impl ::fidl_next::FromWireOption<WireOptionalDictionaryRouterRouteResponse>
10329 for Box<DictionaryRouterRouteResponse>
10330{
10331 #[inline]
10332 fn from_wire_option(wire: WireOptionalDictionaryRouterRouteResponse) -> Option<Self> {
10333 if let Some(inner) = wire.into_option() {
10334 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
10335 } else {
10336 None
10337 }
10338 }
10339}
10340
10341#[repr(transparent)]
10343pub struct WireDictionaryRouterRouteResponse {
10344 raw: ::fidl_next::RawWireUnion,
10345 _phantom: ::core::marker::PhantomData<()>,
10346}
10347
10348impl Drop for WireDictionaryRouterRouteResponse {
10349 fn drop(&mut self) {
10350 match self.raw.ordinal() {
10351 1 => {
10352 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDictionaryRef>() };
10353 }
10354
10355 2 => {
10356 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
10357 }
10358
10359 _ => unsafe { ::core::hint::unreachable_unchecked() },
10360 }
10361 }
10362}
10363
10364unsafe impl ::fidl_next::Wire for WireDictionaryRouterRouteResponse {
10365 type Decoded<'de> = WireDictionaryRouterRouteResponse;
10366
10367 #[inline]
10368 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10369 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
10370 ::fidl_next::RawWireUnion::zero_padding(raw);
10371 }
10372}
10373
10374pub mod dictionary_router_route_response {
10375 pub enum Ref<'de> {
10376 Dictionary(&'de crate::WireDictionaryRef),
10377
10378 Unavailable(&'de crate::WireUnit),
10379 }
10380}
10381
10382impl WireDictionaryRouterRouteResponse {
10383 pub fn as_ref(&self) -> crate::dictionary_router_route_response::Ref<'_> {
10384 match self.raw.ordinal() {
10385 1 => crate::dictionary_router_route_response::Ref::Dictionary(unsafe {
10386 self.raw.get().deref_unchecked::<crate::WireDictionaryRef>()
10387 }),
10388
10389 2 => crate::dictionary_router_route_response::Ref::Unavailable(unsafe {
10390 self.raw.get().deref_unchecked::<crate::WireUnit>()
10391 }),
10392
10393 _ => unsafe { ::core::hint::unreachable_unchecked() },
10394 }
10395 }
10396}
10397
10398unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionaryRouterRouteResponse
10399where
10400 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10401
10402 ___D: ::fidl_next::fuchsia::HandleDecoder,
10403{
10404 fn decode(
10405 mut slot: ::fidl_next::Slot<'_, Self>,
10406 decoder: &mut ___D,
10407 ) -> Result<(), ::fidl_next::DecodeError> {
10408 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
10409 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10410 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDictionaryRef>(
10411 raw, decoder,
10412 )?,
10413
10414 2 => {
10415 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
10416 }
10417
10418 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
10419 }
10420
10421 Ok(())
10422 }
10423}
10424
10425impl ::core::fmt::Debug for WireDictionaryRouterRouteResponse {
10426 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10427 match self.raw.ordinal() {
10428 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireDictionaryRef>().fmt(f) },
10429 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
10430 _ => unsafe { ::core::hint::unreachable_unchecked() },
10431 }
10432 }
10433}
10434
10435#[repr(transparent)]
10436pub struct WireOptionalDictionaryRouterRouteResponse {
10437 raw: ::fidl_next::RawWireUnion,
10438 _phantom: ::core::marker::PhantomData<()>,
10439}
10440
10441unsafe impl ::fidl_next::Wire for WireOptionalDictionaryRouterRouteResponse {
10442 type Decoded<'de> = WireOptionalDictionaryRouterRouteResponse;
10443
10444 #[inline]
10445 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10446 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
10447 ::fidl_next::RawWireUnion::zero_padding(raw);
10448 }
10449}
10450
10451impl WireOptionalDictionaryRouterRouteResponse {
10452 pub fn is_some(&self) -> bool {
10453 self.raw.is_some()
10454 }
10455
10456 pub fn is_none(&self) -> bool {
10457 self.raw.is_none()
10458 }
10459
10460 pub fn as_ref(&self) -> Option<&WireDictionaryRouterRouteResponse> {
10461 if self.is_some() {
10462 Some(unsafe { &*(self as *const Self).cast() })
10463 } else {
10464 None
10465 }
10466 }
10467
10468 pub fn into_option(self) -> Option<WireDictionaryRouterRouteResponse> {
10469 if self.is_some() {
10470 Some(WireDictionaryRouterRouteResponse {
10471 raw: self.raw,
10472 _phantom: ::core::marker::PhantomData,
10473 })
10474 } else {
10475 None
10476 }
10477 }
10478}
10479
10480unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDictionaryRouterRouteResponse
10481where
10482 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10483
10484 ___D: ::fidl_next::fuchsia::HandleDecoder,
10485{
10486 fn decode(
10487 mut slot: ::fidl_next::Slot<'_, Self>,
10488 decoder: &mut ___D,
10489 ) -> Result<(), ::fidl_next::DecodeError> {
10490 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
10491 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10492 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDictionaryRef>(
10493 raw, decoder,
10494 )?,
10495
10496 2 => {
10497 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
10498 }
10499
10500 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
10501 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
10502 }
10503
10504 Ok(())
10505 }
10506}
10507
10508impl ::core::fmt::Debug for WireOptionalDictionaryRouterRouteResponse {
10509 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10510 self.as_ref().fmt(f)
10511 }
10512}
10513
10514#[derive(Debug)]
10516pub struct DictionaryRouter;
10517
10518impl ::fidl_next::Discoverable for DictionaryRouter {
10519 const PROTOCOL_NAME: &'static str = "dictionary_router";
10520}
10521
10522pub mod dictionary_router {
10523 pub mod prelude {
10524 pub use crate::{
10525 dictionary_router, DictionaryRouter, DictionaryRouterClientHandler,
10526 DictionaryRouterClientSender, DictionaryRouterServerHandler,
10527 DictionaryRouterServerSender,
10528 };
10529
10530 pub use crate::DictionaryRouterRouteResponse;
10531
10532 pub use crate::RouteRequest;
10533
10534 pub use crate::RouterError;
10535 }
10536
10537 pub struct Route;
10538
10539 impl ::fidl_next::Method for Route {
10540 const ORDINAL: u64 = 8164012099375978399;
10541
10542 type Protocol = crate::DictionaryRouter;
10543
10544 type Request = crate::WireRouteRequest<'static>;
10545
10546 type Response = ::fidl_next::WireFlexibleResult<
10547 'static,
10548 crate::WireDictionaryRouterRouteResponse,
10549 crate::WireRouterError,
10550 >;
10551 }
10552}
10553
10554pub trait DictionaryRouterClientSender {
10556 type Transport: ::fidl_next::Transport;
10557
10558 fn route<___R>(
10559 &self,
10560 request: ___R,
10561 ) -> Result<
10562 ::fidl_next::ResponseFuture<'_, Self::Transport, dictionary_router::Route>,
10563 ::fidl_next::EncodeError,
10564 >
10565 where
10566 ___R: ::fidl_next::Encode<
10567 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10568 Encoded = crate::WireRouteRequest<'static>,
10569 >;
10570}
10571
10572impl<___T> DictionaryRouterClientSender for ::fidl_next::ClientSender<___T, DictionaryRouter>
10573where
10574 ___T: ::fidl_next::Transport,
10575{
10576 type Transport = ___T;
10577
10578 fn route<___R>(
10579 &self,
10580 request: ___R,
10581 ) -> Result<
10582 ::fidl_next::ResponseFuture<'_, Self::Transport, dictionary_router::Route>,
10583 ::fidl_next::EncodeError,
10584 >
10585 where
10586 ___R: ::fidl_next::Encode<
10587 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
10588 Encoded = crate::WireRouteRequest<'static>,
10589 >,
10590 {
10591 self.as_untyped()
10592 .send_two_way(8164012099375978399, request)
10593 .map(::fidl_next::ResponseFuture::from_untyped)
10594 }
10595}
10596
10597pub trait DictionaryRouterClientHandler<___T: ::fidl_next::Transport> {
10601 fn on_unknown_interaction(
10602 &mut self,
10603 sender: &::fidl_next::ClientSender<___T, DictionaryRouter>,
10604 ordinal: u64,
10605 ) {
10606 sender.close();
10607 }
10608}
10609
10610impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DictionaryRouter
10611where
10612 ___T: ::fidl_next::Transport,
10613 ___H: DictionaryRouterClientHandler<___T>,
10614
10615 <dictionary_router::Route as ::fidl_next::Method>::Response:
10616 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10617{
10618 fn on_event(
10619 handler: &mut ___H,
10620 sender: &::fidl_next::ClientSender<___T, Self>,
10621 ordinal: u64,
10622 buffer: ___T::RecvBuffer,
10623 ) {
10624 match ordinal {
10625 ordinal => handler.on_unknown_interaction(sender, ordinal),
10626 }
10627 }
10628}
10629
10630pub trait DictionaryRouterServerSender {
10632 type Transport: ::fidl_next::Transport;
10633}
10634
10635impl<___T> DictionaryRouterServerSender for ::fidl_next::ServerSender<___T, DictionaryRouter>
10636where
10637 ___T: ::fidl_next::Transport,
10638{
10639 type Transport = ___T;
10640}
10641
10642pub trait DictionaryRouterServerHandler<___T: ::fidl_next::Transport> {
10646 fn route(
10647 &mut self,
10648 sender: &::fidl_next::ServerSender<___T, DictionaryRouter>,
10649
10650 request: ::fidl_next::Request<___T, dictionary_router::Route>,
10651
10652 responder: ::fidl_next::Responder<dictionary_router::Route>,
10653 );
10654
10655 fn on_unknown_interaction(
10656 &mut self,
10657 sender: &::fidl_next::ServerSender<___T, DictionaryRouter>,
10658 ordinal: u64,
10659 ) {
10660 sender.close();
10661 }
10662}
10663
10664impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DictionaryRouter
10665where
10666 ___T: ::fidl_next::Transport,
10667 ___H: DictionaryRouterServerHandler<___T>,
10668
10669 <dictionary_router::Route as ::fidl_next::Method>::Request:
10670 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
10671{
10672 fn on_one_way(
10673 handler: &mut ___H,
10674 sender: &::fidl_next::ServerSender<___T, Self>,
10675 ordinal: u64,
10676 buffer: ___T::RecvBuffer,
10677 ) {
10678 match ordinal {
10679 ordinal => handler.on_unknown_interaction(sender, ordinal),
10680 }
10681 }
10682
10683 fn on_two_way(
10684 handler: &mut ___H,
10685 sender: &::fidl_next::ServerSender<___T, Self>,
10686 ordinal: u64,
10687 buffer: ___T::RecvBuffer,
10688 responder: ::fidl_next::protocol::Responder,
10689 ) {
10690 match ordinal {
10691 8164012099375978399 => {
10692 let responder = ::fidl_next::Responder::from_untyped(responder);
10693
10694 match ::fidl_next::DecoderExt::decode(buffer) {
10695 Ok(decoded) => handler.route(sender, decoded, responder),
10696 Err(e) => {
10697 sender.close();
10698 }
10699 }
10700 }
10701
10702 ordinal => handler.on_unknown_interaction(sender, ordinal),
10703 }
10704 }
10705}
10706
10707#[derive(Debug)]
10708pub enum DirConnectorRouterRouteResponse {
10709 DirConnector(crate::DirConnector),
10710
10711 Unavailable(crate::Unit),
10712}
10713
10714impl ::fidl_next::Encodable for DirConnectorRouterRouteResponse {
10715 type Encoded = WireDirConnectorRouterRouteResponse;
10716}
10717
10718unsafe impl<___E> ::fidl_next::Encode<___E> for DirConnectorRouterRouteResponse
10719where
10720 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10721
10722 ___E: ::fidl_next::fuchsia::HandleEncoder,
10723{
10724 #[inline]
10725 fn encode(
10726 self,
10727 encoder: &mut ___E,
10728 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10729 ) -> Result<(), ::fidl_next::EncodeError> {
10730 ::fidl_next::munge!(let WireDirConnectorRouterRouteResponse { raw, _phantom: _ } = out);
10731
10732 match self {
10733 Self::DirConnector(value) => ::fidl_next::RawWireUnion::encode_as_static::<
10734 ___E,
10735 crate::DirConnector,
10736 >(value, 1, encoder, raw)?,
10737
10738 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
10739 ___E,
10740 crate::Unit,
10741 >(value, 2, encoder, raw)?,
10742 }
10743
10744 Ok(())
10745 }
10746}
10747
10748impl ::fidl_next::EncodableOption for DirConnectorRouterRouteResponse {
10749 type EncodedOption = WireOptionalDirConnectorRouterRouteResponse;
10750}
10751
10752unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirConnectorRouterRouteResponse
10753where
10754 ___E: ?Sized,
10755 DirConnectorRouterRouteResponse: ::fidl_next::Encode<___E>,
10756{
10757 #[inline]
10758 fn encode_option(
10759 this: Option<Self>,
10760 encoder: &mut ___E,
10761 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10762 ) -> Result<(), ::fidl_next::EncodeError> {
10763 ::fidl_next::munge!(let WireOptionalDirConnectorRouterRouteResponse { raw, _phantom: _ } = &mut *out);
10764
10765 if let Some(inner) = this {
10766 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
10767 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
10768 } else {
10769 ::fidl_next::RawWireUnion::encode_absent(raw);
10770 }
10771
10772 Ok(())
10773 }
10774}
10775
10776impl ::fidl_next::FromWire<WireDirConnectorRouterRouteResponse>
10777 for DirConnectorRouterRouteResponse
10778{
10779 #[inline]
10780 fn from_wire(wire: WireDirConnectorRouterRouteResponse) -> Self {
10781 let wire = ::core::mem::ManuallyDrop::new(wire);
10782 match wire.raw.ordinal() {
10783 1 => Self::DirConnector(::fidl_next::FromWire::from_wire(unsafe {
10784 wire.raw.get().read_unchecked::<crate::WireDirConnector>()
10785 })),
10786
10787 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
10788 wire.raw.get().read_unchecked::<crate::WireUnit>()
10789 })),
10790
10791 _ => unsafe { ::core::hint::unreachable_unchecked() },
10792 }
10793 }
10794}
10795
10796impl ::fidl_next::FromWireOption<WireOptionalDirConnectorRouterRouteResponse>
10797 for Box<DirConnectorRouterRouteResponse>
10798{
10799 #[inline]
10800 fn from_wire_option(wire: WireOptionalDirConnectorRouterRouteResponse) -> Option<Self> {
10801 if let Some(inner) = wire.into_option() {
10802 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
10803 } else {
10804 None
10805 }
10806 }
10807}
10808
10809#[repr(transparent)]
10811pub struct WireDirConnectorRouterRouteResponse {
10812 raw: ::fidl_next::RawWireUnion,
10813 _phantom: ::core::marker::PhantomData<()>,
10814}
10815
10816impl Drop for WireDirConnectorRouterRouteResponse {
10817 fn drop(&mut self) {
10818 match self.raw.ordinal() {
10819 1 => {
10820 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirConnector>() };
10821 }
10822
10823 2 => {
10824 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
10825 }
10826
10827 _ => unsafe { ::core::hint::unreachable_unchecked() },
10828 }
10829 }
10830}
10831
10832unsafe impl ::fidl_next::Wire for WireDirConnectorRouterRouteResponse {
10833 type Decoded<'de> = WireDirConnectorRouterRouteResponse;
10834
10835 #[inline]
10836 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10837 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
10838 ::fidl_next::RawWireUnion::zero_padding(raw);
10839 }
10840}
10841
10842pub mod dir_connector_router_route_response {
10843 pub enum Ref<'de> {
10844 DirConnector(&'de crate::WireDirConnector),
10845
10846 Unavailable(&'de crate::WireUnit),
10847 }
10848}
10849
10850impl WireDirConnectorRouterRouteResponse {
10851 pub fn as_ref(&self) -> crate::dir_connector_router_route_response::Ref<'_> {
10852 match self.raw.ordinal() {
10853 1 => crate::dir_connector_router_route_response::Ref::DirConnector(unsafe {
10854 self.raw.get().deref_unchecked::<crate::WireDirConnector>()
10855 }),
10856
10857 2 => crate::dir_connector_router_route_response::Ref::Unavailable(unsafe {
10858 self.raw.get().deref_unchecked::<crate::WireUnit>()
10859 }),
10860
10861 _ => unsafe { ::core::hint::unreachable_unchecked() },
10862 }
10863 }
10864}
10865
10866unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirConnectorRouterRouteResponse
10867where
10868 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10869
10870 ___D: ::fidl_next::fuchsia::HandleDecoder,
10871{
10872 fn decode(
10873 mut slot: ::fidl_next::Slot<'_, Self>,
10874 decoder: &mut ___D,
10875 ) -> Result<(), ::fidl_next::DecodeError> {
10876 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
10877 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10878 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDirConnector>(
10879 raw, decoder,
10880 )?,
10881
10882 2 => {
10883 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
10884 }
10885
10886 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
10887 }
10888
10889 Ok(())
10890 }
10891}
10892
10893impl ::core::fmt::Debug for WireDirConnectorRouterRouteResponse {
10894 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10895 match self.raw.ordinal() {
10896 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirConnector>().fmt(f) },
10897 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
10898 _ => unsafe { ::core::hint::unreachable_unchecked() },
10899 }
10900 }
10901}
10902
10903#[repr(transparent)]
10904pub struct WireOptionalDirConnectorRouterRouteResponse {
10905 raw: ::fidl_next::RawWireUnion,
10906 _phantom: ::core::marker::PhantomData<()>,
10907}
10908
10909unsafe impl ::fidl_next::Wire for WireOptionalDirConnectorRouterRouteResponse {
10910 type Decoded<'de> = WireOptionalDirConnectorRouterRouteResponse;
10911
10912 #[inline]
10913 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10914 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
10915 ::fidl_next::RawWireUnion::zero_padding(raw);
10916 }
10917}
10918
10919impl WireOptionalDirConnectorRouterRouteResponse {
10920 pub fn is_some(&self) -> bool {
10921 self.raw.is_some()
10922 }
10923
10924 pub fn is_none(&self) -> bool {
10925 self.raw.is_none()
10926 }
10927
10928 pub fn as_ref(&self) -> Option<&WireDirConnectorRouterRouteResponse> {
10929 if self.is_some() {
10930 Some(unsafe { &*(self as *const Self).cast() })
10931 } else {
10932 None
10933 }
10934 }
10935
10936 pub fn into_option(self) -> Option<WireDirConnectorRouterRouteResponse> {
10937 if self.is_some() {
10938 Some(WireDirConnectorRouterRouteResponse {
10939 raw: self.raw,
10940 _phantom: ::core::marker::PhantomData,
10941 })
10942 } else {
10943 None
10944 }
10945 }
10946}
10947
10948unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDirConnectorRouterRouteResponse
10949where
10950 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10951
10952 ___D: ::fidl_next::fuchsia::HandleDecoder,
10953{
10954 fn decode(
10955 mut slot: ::fidl_next::Slot<'_, Self>,
10956 decoder: &mut ___D,
10957 ) -> Result<(), ::fidl_next::DecodeError> {
10958 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
10959 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10960 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDirConnector>(
10961 raw, decoder,
10962 )?,
10963
10964 2 => {
10965 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
10966 }
10967
10968 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
10969 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
10970 }
10971
10972 Ok(())
10973 }
10974}
10975
10976impl ::core::fmt::Debug for WireOptionalDirConnectorRouterRouteResponse {
10977 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10978 self.as_ref().fmt(f)
10979 }
10980}
10981
10982#[derive(Debug)]
10984pub struct DirConnectorRouter;
10985
10986impl ::fidl_next::Discoverable for DirConnectorRouter {
10987 const PROTOCOL_NAME: &'static str = "dir_connector_router";
10988}
10989
10990pub mod dir_connector_router {
10991 pub mod prelude {
10992 pub use crate::{
10993 dir_connector_router, DirConnectorRouter, DirConnectorRouterClientHandler,
10994 DirConnectorRouterClientSender, DirConnectorRouterServerHandler,
10995 DirConnectorRouterServerSender,
10996 };
10997
10998 pub use crate::DirConnectorRouterRouteResponse;
10999
11000 pub use crate::RouteRequest;
11001
11002 pub use crate::RouterError;
11003 }
11004
11005 pub struct Route;
11006
11007 impl ::fidl_next::Method for Route {
11008 const ORDINAL: u64 = 972231070188342848;
11009
11010 type Protocol = crate::DirConnectorRouter;
11011
11012 type Request = crate::WireRouteRequest<'static>;
11013
11014 type Response = ::fidl_next::WireFlexibleResult<
11015 'static,
11016 crate::WireDirConnectorRouterRouteResponse,
11017 crate::WireRouterError,
11018 >;
11019 }
11020}
11021
11022pub trait DirConnectorRouterClientSender {
11024 type Transport: ::fidl_next::Transport;
11025
11026 fn route<___R>(
11027 &self,
11028 request: ___R,
11029 ) -> Result<
11030 ::fidl_next::ResponseFuture<'_, Self::Transport, dir_connector_router::Route>,
11031 ::fidl_next::EncodeError,
11032 >
11033 where
11034 ___R: ::fidl_next::Encode<
11035 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11036 Encoded = crate::WireRouteRequest<'static>,
11037 >;
11038}
11039
11040impl<___T> DirConnectorRouterClientSender for ::fidl_next::ClientSender<___T, DirConnectorRouter>
11041where
11042 ___T: ::fidl_next::Transport,
11043{
11044 type Transport = ___T;
11045
11046 fn route<___R>(
11047 &self,
11048 request: ___R,
11049 ) -> Result<
11050 ::fidl_next::ResponseFuture<'_, Self::Transport, dir_connector_router::Route>,
11051 ::fidl_next::EncodeError,
11052 >
11053 where
11054 ___R: ::fidl_next::Encode<
11055 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11056 Encoded = crate::WireRouteRequest<'static>,
11057 >,
11058 {
11059 self.as_untyped()
11060 .send_two_way(972231070188342848, request)
11061 .map(::fidl_next::ResponseFuture::from_untyped)
11062 }
11063}
11064
11065pub trait DirConnectorRouterClientHandler<___T: ::fidl_next::Transport> {
11069 fn on_unknown_interaction(
11070 &mut self,
11071 sender: &::fidl_next::ClientSender<___T, DirConnectorRouter>,
11072 ordinal: u64,
11073 ) {
11074 sender.close();
11075 }
11076}
11077
11078impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DirConnectorRouter
11079where
11080 ___T: ::fidl_next::Transport,
11081 ___H: DirConnectorRouterClientHandler<___T>,
11082
11083 <dir_connector_router::Route as ::fidl_next::Method>::Response:
11084 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11085{
11086 fn on_event(
11087 handler: &mut ___H,
11088 sender: &::fidl_next::ClientSender<___T, Self>,
11089 ordinal: u64,
11090 buffer: ___T::RecvBuffer,
11091 ) {
11092 match ordinal {
11093 ordinal => handler.on_unknown_interaction(sender, ordinal),
11094 }
11095 }
11096}
11097
11098pub trait DirConnectorRouterServerSender {
11100 type Transport: ::fidl_next::Transport;
11101}
11102
11103impl<___T> DirConnectorRouterServerSender for ::fidl_next::ServerSender<___T, DirConnectorRouter>
11104where
11105 ___T: ::fidl_next::Transport,
11106{
11107 type Transport = ___T;
11108}
11109
11110pub trait DirConnectorRouterServerHandler<___T: ::fidl_next::Transport> {
11114 fn route(
11115 &mut self,
11116 sender: &::fidl_next::ServerSender<___T, DirConnectorRouter>,
11117
11118 request: ::fidl_next::Request<___T, dir_connector_router::Route>,
11119
11120 responder: ::fidl_next::Responder<dir_connector_router::Route>,
11121 );
11122
11123 fn on_unknown_interaction(
11124 &mut self,
11125 sender: &::fidl_next::ServerSender<___T, DirConnectorRouter>,
11126 ordinal: u64,
11127 ) {
11128 sender.close();
11129 }
11130}
11131
11132impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DirConnectorRouter
11133where
11134 ___T: ::fidl_next::Transport,
11135 ___H: DirConnectorRouterServerHandler<___T>,
11136
11137 <dir_connector_router::Route as ::fidl_next::Method>::Request:
11138 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11139{
11140 fn on_one_way(
11141 handler: &mut ___H,
11142 sender: &::fidl_next::ServerSender<___T, Self>,
11143 ordinal: u64,
11144 buffer: ___T::RecvBuffer,
11145 ) {
11146 match ordinal {
11147 ordinal => handler.on_unknown_interaction(sender, ordinal),
11148 }
11149 }
11150
11151 fn on_two_way(
11152 handler: &mut ___H,
11153 sender: &::fidl_next::ServerSender<___T, Self>,
11154 ordinal: u64,
11155 buffer: ___T::RecvBuffer,
11156 responder: ::fidl_next::protocol::Responder,
11157 ) {
11158 match ordinal {
11159 972231070188342848 => {
11160 let responder = ::fidl_next::Responder::from_untyped(responder);
11161
11162 match ::fidl_next::DecoderExt::decode(buffer) {
11163 Ok(decoded) => handler.route(sender, decoded, responder),
11164 Err(e) => {
11165 sender.close();
11166 }
11167 }
11168 }
11169
11170 ordinal => handler.on_unknown_interaction(sender, ordinal),
11171 }
11172 }
11173}
11174
11175#[derive(Debug)]
11176pub enum DirEntryRouterRouteResponse {
11177 DirEntry(crate::DirEntry),
11178
11179 Unavailable(crate::Unit),
11180}
11181
11182impl ::fidl_next::Encodable for DirEntryRouterRouteResponse {
11183 type Encoded = WireDirEntryRouterRouteResponse;
11184}
11185
11186unsafe impl<___E> ::fidl_next::Encode<___E> for DirEntryRouterRouteResponse
11187where
11188 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11189
11190 ___E: ::fidl_next::fuchsia::HandleEncoder,
11191{
11192 #[inline]
11193 fn encode(
11194 self,
11195 encoder: &mut ___E,
11196 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11197 ) -> Result<(), ::fidl_next::EncodeError> {
11198 ::fidl_next::munge!(let WireDirEntryRouterRouteResponse { raw, _phantom: _ } = out);
11199
11200 match self {
11201 Self::DirEntry(value) => ::fidl_next::RawWireUnion::encode_as_static::<
11202 ___E,
11203 crate::DirEntry,
11204 >(value, 1, encoder, raw)?,
11205
11206 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
11207 ___E,
11208 crate::Unit,
11209 >(value, 2, encoder, raw)?,
11210 }
11211
11212 Ok(())
11213 }
11214}
11215
11216impl ::fidl_next::EncodableOption for DirEntryRouterRouteResponse {
11217 type EncodedOption = WireOptionalDirEntryRouterRouteResponse;
11218}
11219
11220unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirEntryRouterRouteResponse
11221where
11222 ___E: ?Sized,
11223 DirEntryRouterRouteResponse: ::fidl_next::Encode<___E>,
11224{
11225 #[inline]
11226 fn encode_option(
11227 this: Option<Self>,
11228 encoder: &mut ___E,
11229 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11230 ) -> Result<(), ::fidl_next::EncodeError> {
11231 ::fidl_next::munge!(let WireOptionalDirEntryRouterRouteResponse { raw, _phantom: _ } = &mut *out);
11232
11233 if let Some(inner) = this {
11234 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11235 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
11236 } else {
11237 ::fidl_next::RawWireUnion::encode_absent(raw);
11238 }
11239
11240 Ok(())
11241 }
11242}
11243
11244impl ::fidl_next::FromWire<WireDirEntryRouterRouteResponse> for DirEntryRouterRouteResponse {
11245 #[inline]
11246 fn from_wire(wire: WireDirEntryRouterRouteResponse) -> Self {
11247 let wire = ::core::mem::ManuallyDrop::new(wire);
11248 match wire.raw.ordinal() {
11249 1 => Self::DirEntry(::fidl_next::FromWire::from_wire(unsafe {
11250 wire.raw.get().read_unchecked::<crate::WireDirEntry>()
11251 })),
11252
11253 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
11254 wire.raw.get().read_unchecked::<crate::WireUnit>()
11255 })),
11256
11257 _ => unsafe { ::core::hint::unreachable_unchecked() },
11258 }
11259 }
11260}
11261
11262impl ::fidl_next::FromWireOption<WireOptionalDirEntryRouterRouteResponse>
11263 for Box<DirEntryRouterRouteResponse>
11264{
11265 #[inline]
11266 fn from_wire_option(wire: WireOptionalDirEntryRouterRouteResponse) -> Option<Self> {
11267 if let Some(inner) = wire.into_option() {
11268 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
11269 } else {
11270 None
11271 }
11272 }
11273}
11274
11275#[repr(transparent)]
11277pub struct WireDirEntryRouterRouteResponse {
11278 raw: ::fidl_next::RawWireUnion,
11279 _phantom: ::core::marker::PhantomData<()>,
11280}
11281
11282impl Drop for WireDirEntryRouterRouteResponse {
11283 fn drop(&mut self) {
11284 match self.raw.ordinal() {
11285 1 => {
11286 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirEntry>() };
11287 }
11288
11289 2 => {
11290 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
11291 }
11292
11293 _ => unsafe { ::core::hint::unreachable_unchecked() },
11294 }
11295 }
11296}
11297
11298unsafe impl ::fidl_next::Wire for WireDirEntryRouterRouteResponse {
11299 type Decoded<'de> = WireDirEntryRouterRouteResponse;
11300
11301 #[inline]
11302 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11303 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11304 ::fidl_next::RawWireUnion::zero_padding(raw);
11305 }
11306}
11307
11308pub mod dir_entry_router_route_response {
11309 pub enum Ref<'de> {
11310 DirEntry(&'de crate::WireDirEntry),
11311
11312 Unavailable(&'de crate::WireUnit),
11313 }
11314}
11315
11316impl WireDirEntryRouterRouteResponse {
11317 pub fn as_ref(&self) -> crate::dir_entry_router_route_response::Ref<'_> {
11318 match self.raw.ordinal() {
11319 1 => crate::dir_entry_router_route_response::Ref::DirEntry(unsafe {
11320 self.raw.get().deref_unchecked::<crate::WireDirEntry>()
11321 }),
11322
11323 2 => crate::dir_entry_router_route_response::Ref::Unavailable(unsafe {
11324 self.raw.get().deref_unchecked::<crate::WireUnit>()
11325 }),
11326
11327 _ => unsafe { ::core::hint::unreachable_unchecked() },
11328 }
11329 }
11330}
11331
11332unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirEntryRouterRouteResponse
11333where
11334 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11335
11336 ___D: ::fidl_next::fuchsia::HandleDecoder,
11337{
11338 fn decode(
11339 mut slot: ::fidl_next::Slot<'_, Self>,
11340 decoder: &mut ___D,
11341 ) -> Result<(), ::fidl_next::DecodeError> {
11342 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11343 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11344 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDirEntry>(
11345 raw, decoder,
11346 )?,
11347
11348 2 => {
11349 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
11350 }
11351
11352 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
11353 }
11354
11355 Ok(())
11356 }
11357}
11358
11359impl ::core::fmt::Debug for WireDirEntryRouterRouteResponse {
11360 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11361 match self.raw.ordinal() {
11362 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirEntry>().fmt(f) },
11363 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
11364 _ => unsafe { ::core::hint::unreachable_unchecked() },
11365 }
11366 }
11367}
11368
11369#[repr(transparent)]
11370pub struct WireOptionalDirEntryRouterRouteResponse {
11371 raw: ::fidl_next::RawWireUnion,
11372 _phantom: ::core::marker::PhantomData<()>,
11373}
11374
11375unsafe impl ::fidl_next::Wire for WireOptionalDirEntryRouterRouteResponse {
11376 type Decoded<'de> = WireOptionalDirEntryRouterRouteResponse;
11377
11378 #[inline]
11379 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11380 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11381 ::fidl_next::RawWireUnion::zero_padding(raw);
11382 }
11383}
11384
11385impl WireOptionalDirEntryRouterRouteResponse {
11386 pub fn is_some(&self) -> bool {
11387 self.raw.is_some()
11388 }
11389
11390 pub fn is_none(&self) -> bool {
11391 self.raw.is_none()
11392 }
11393
11394 pub fn as_ref(&self) -> Option<&WireDirEntryRouterRouteResponse> {
11395 if self.is_some() {
11396 Some(unsafe { &*(self as *const Self).cast() })
11397 } else {
11398 None
11399 }
11400 }
11401
11402 pub fn into_option(self) -> Option<WireDirEntryRouterRouteResponse> {
11403 if self.is_some() {
11404 Some(WireDirEntryRouterRouteResponse {
11405 raw: self.raw,
11406 _phantom: ::core::marker::PhantomData,
11407 })
11408 } else {
11409 None
11410 }
11411 }
11412}
11413
11414unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDirEntryRouterRouteResponse
11415where
11416 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11417
11418 ___D: ::fidl_next::fuchsia::HandleDecoder,
11419{
11420 fn decode(
11421 mut slot: ::fidl_next::Slot<'_, Self>,
11422 decoder: &mut ___D,
11423 ) -> Result<(), ::fidl_next::DecodeError> {
11424 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11425 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11426 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireDirEntry>(
11427 raw, decoder,
11428 )?,
11429
11430 2 => {
11431 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
11432 }
11433
11434 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
11435 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
11436 }
11437
11438 Ok(())
11439 }
11440}
11441
11442impl ::core::fmt::Debug for WireOptionalDirEntryRouterRouteResponse {
11443 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11444 self.as_ref().fmt(f)
11445 }
11446}
11447
11448#[derive(Debug)]
11450pub struct DirEntryRouter;
11451
11452impl ::fidl_next::Discoverable for DirEntryRouter {
11453 const PROTOCOL_NAME: &'static str = "dir_entry_router";
11454}
11455
11456pub mod dir_entry_router {
11457 pub mod prelude {
11458 pub use crate::{
11459 dir_entry_router, DirEntryRouter, DirEntryRouterClientHandler,
11460 DirEntryRouterClientSender, DirEntryRouterServerHandler, DirEntryRouterServerSender,
11461 };
11462
11463 pub use crate::DirEntryRouterRouteResponse;
11464
11465 pub use crate::RouteRequest;
11466
11467 pub use crate::RouterError;
11468 }
11469
11470 pub struct Route;
11471
11472 impl ::fidl_next::Method for Route {
11473 const ORDINAL: u64 = 1929392218567642066;
11474
11475 type Protocol = crate::DirEntryRouter;
11476
11477 type Request = crate::WireRouteRequest<'static>;
11478
11479 type Response = ::fidl_next::WireFlexibleResult<
11480 'static,
11481 crate::WireDirEntryRouterRouteResponse,
11482 crate::WireRouterError,
11483 >;
11484 }
11485}
11486
11487pub trait DirEntryRouterClientSender {
11489 type Transport: ::fidl_next::Transport;
11490
11491 fn route<___R>(
11492 &self,
11493 request: ___R,
11494 ) -> Result<
11495 ::fidl_next::ResponseFuture<'_, Self::Transport, dir_entry_router::Route>,
11496 ::fidl_next::EncodeError,
11497 >
11498 where
11499 ___R: ::fidl_next::Encode<
11500 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11501 Encoded = crate::WireRouteRequest<'static>,
11502 >;
11503}
11504
11505impl<___T> DirEntryRouterClientSender for ::fidl_next::ClientSender<___T, DirEntryRouter>
11506where
11507 ___T: ::fidl_next::Transport,
11508{
11509 type Transport = ___T;
11510
11511 fn route<___R>(
11512 &self,
11513 request: ___R,
11514 ) -> Result<
11515 ::fidl_next::ResponseFuture<'_, Self::Transport, dir_entry_router::Route>,
11516 ::fidl_next::EncodeError,
11517 >
11518 where
11519 ___R: ::fidl_next::Encode<
11520 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11521 Encoded = crate::WireRouteRequest<'static>,
11522 >,
11523 {
11524 self.as_untyped()
11525 .send_two_way(1929392218567642066, request)
11526 .map(::fidl_next::ResponseFuture::from_untyped)
11527 }
11528}
11529
11530pub trait DirEntryRouterClientHandler<___T: ::fidl_next::Transport> {
11534 fn on_unknown_interaction(
11535 &mut self,
11536 sender: &::fidl_next::ClientSender<___T, DirEntryRouter>,
11537 ordinal: u64,
11538 ) {
11539 sender.close();
11540 }
11541}
11542
11543impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DirEntryRouter
11544where
11545 ___T: ::fidl_next::Transport,
11546 ___H: DirEntryRouterClientHandler<___T>,
11547
11548 <dir_entry_router::Route as ::fidl_next::Method>::Response:
11549 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11550{
11551 fn on_event(
11552 handler: &mut ___H,
11553 sender: &::fidl_next::ClientSender<___T, Self>,
11554 ordinal: u64,
11555 buffer: ___T::RecvBuffer,
11556 ) {
11557 match ordinal {
11558 ordinal => handler.on_unknown_interaction(sender, ordinal),
11559 }
11560 }
11561}
11562
11563pub trait DirEntryRouterServerSender {
11565 type Transport: ::fidl_next::Transport;
11566}
11567
11568impl<___T> DirEntryRouterServerSender for ::fidl_next::ServerSender<___T, DirEntryRouter>
11569where
11570 ___T: ::fidl_next::Transport,
11571{
11572 type Transport = ___T;
11573}
11574
11575pub trait DirEntryRouterServerHandler<___T: ::fidl_next::Transport> {
11579 fn route(
11580 &mut self,
11581 sender: &::fidl_next::ServerSender<___T, DirEntryRouter>,
11582
11583 request: ::fidl_next::Request<___T, dir_entry_router::Route>,
11584
11585 responder: ::fidl_next::Responder<dir_entry_router::Route>,
11586 );
11587
11588 fn on_unknown_interaction(
11589 &mut self,
11590 sender: &::fidl_next::ServerSender<___T, DirEntryRouter>,
11591 ordinal: u64,
11592 ) {
11593 sender.close();
11594 }
11595}
11596
11597impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DirEntryRouter
11598where
11599 ___T: ::fidl_next::Transport,
11600 ___H: DirEntryRouterServerHandler<___T>,
11601
11602 <dir_entry_router::Route as ::fidl_next::Method>::Request:
11603 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11604{
11605 fn on_one_way(
11606 handler: &mut ___H,
11607 sender: &::fidl_next::ServerSender<___T, Self>,
11608 ordinal: u64,
11609 buffer: ___T::RecvBuffer,
11610 ) {
11611 match ordinal {
11612 ordinal => handler.on_unknown_interaction(sender, ordinal),
11613 }
11614 }
11615
11616 fn on_two_way(
11617 handler: &mut ___H,
11618 sender: &::fidl_next::ServerSender<___T, Self>,
11619 ordinal: u64,
11620 buffer: ___T::RecvBuffer,
11621 responder: ::fidl_next::protocol::Responder,
11622 ) {
11623 match ordinal {
11624 1929392218567642066 => {
11625 let responder = ::fidl_next::Responder::from_untyped(responder);
11626
11627 match ::fidl_next::DecoderExt::decode(buffer) {
11628 Ok(decoded) => handler.route(sender, decoded, responder),
11629 Err(e) => {
11630 sender.close();
11631 }
11632 }
11633 }
11634
11635 ordinal => handler.on_unknown_interaction(sender, ordinal),
11636 }
11637 }
11638}
11639
11640#[derive(Debug)]
11641#[repr(C)]
11642pub struct DirReceiverReceiveRequest {
11643 pub channel: ::fidl_next::ServerEnd<
11644 ::fidl_next::fuchsia::zx::Channel,
11645 ::fidl_next_fuchsia_io::Directory,
11646 >,
11647}
11648
11649impl ::fidl_next::Encodable for DirReceiverReceiveRequest {
11650 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDirReceiverReceiveRequest> = unsafe {
11651 ::fidl_next::CopyOptimization::enable_if(
11652 true && <::fidl_next::ServerEnd<
11653 ::fidl_next::fuchsia::zx::Channel,
11654 ::fidl_next_fuchsia_io::Directory,
11655 > as ::fidl_next::Encodable>::COPY_OPTIMIZATION
11656 .is_enabled(),
11657 )
11658 };
11659
11660 type Encoded = WireDirReceiverReceiveRequest;
11661}
11662
11663unsafe impl<___E> ::fidl_next::Encode<___E> for DirReceiverReceiveRequest
11664where
11665 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11666
11667 ___E: ::fidl_next::fuchsia::HandleEncoder,
11668{
11669 #[inline]
11670 fn encode(
11671 self,
11672 encoder: &mut ___E,
11673 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11674 ) -> Result<(), ::fidl_next::EncodeError> {
11675 ::fidl_next::munge! {
11676 let Self::Encoded {
11677 channel,
11678
11679 } = out;
11680 }
11681
11682 ::fidl_next::Encode::encode(self.channel, encoder, channel)?;
11683
11684 Ok(())
11685 }
11686}
11687
11688impl ::fidl_next::EncodableOption for DirReceiverReceiveRequest {
11689 type EncodedOption = ::fidl_next::WireBox<'static, WireDirReceiverReceiveRequest>;
11690}
11691
11692unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirReceiverReceiveRequest
11693where
11694 ___E: ::fidl_next::Encoder + ?Sized,
11695 DirReceiverReceiveRequest: ::fidl_next::Encode<___E>,
11696{
11697 #[inline]
11698 fn encode_option(
11699 this: Option<Self>,
11700 encoder: &mut ___E,
11701 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11702 ) -> Result<(), ::fidl_next::EncodeError> {
11703 if let Some(inner) = this {
11704 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11705 ::fidl_next::WireBox::encode_present(out);
11706 } else {
11707 ::fidl_next::WireBox::encode_absent(out);
11708 }
11709
11710 Ok(())
11711 }
11712}
11713
11714impl ::fidl_next::FromWire<WireDirReceiverReceiveRequest> for DirReceiverReceiveRequest {
11715 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDirReceiverReceiveRequest, Self> = unsafe {
11716 ::fidl_next::CopyOptimization::enable_if(
11717 true && <::fidl_next::ServerEnd<
11718 ::fidl_next::fuchsia::zx::Channel,
11719 ::fidl_next_fuchsia_io::Directory,
11720 > as ::fidl_next::FromWire<
11721 ::fidl_next::ServerEnd<
11722 ::fidl_next::fuchsia::WireChannel,
11723 ::fidl_next_fuchsia_io::Directory,
11724 >,
11725 >>::COPY_OPTIMIZATION
11726 .is_enabled(),
11727 )
11728 };
11729
11730 #[inline]
11731 fn from_wire(wire: WireDirReceiverReceiveRequest) -> Self {
11732 Self { channel: ::fidl_next::FromWire::from_wire(wire.channel) }
11733 }
11734}
11735
11736#[derive(Debug)]
11738#[repr(C)]
11739pub struct WireDirReceiverReceiveRequest {
11740 pub channel: ::fidl_next::ServerEnd<
11741 ::fidl_next::fuchsia::WireChannel,
11742 ::fidl_next_fuchsia_io::Directory,
11743 >,
11744}
11745
11746unsafe impl ::fidl_next::Wire for WireDirReceiverReceiveRequest {
11747 type Decoded<'de> = WireDirReceiverReceiveRequest;
11748
11749 #[inline]
11750 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
11751}
11752
11753unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirReceiverReceiveRequest
11754where
11755 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11756
11757 ___D: ::fidl_next::fuchsia::HandleDecoder,
11758{
11759 fn decode(
11760 slot: ::fidl_next::Slot<'_, Self>,
11761 decoder: &mut ___D,
11762 ) -> Result<(), ::fidl_next::DecodeError> {
11763 ::fidl_next::munge! {
11764 let Self {
11765 mut channel,
11766
11767 } = slot;
11768 }
11769
11770 ::fidl_next::Decode::decode(channel.as_mut(), decoder)?;
11771
11772 Ok(())
11773 }
11774}
11775
11776#[doc = " A receiver is served by components and allows them to receive directory channels\n framework.\n"]
11778#[derive(Debug)]
11779pub struct DirReceiver;
11780
11781impl ::fidl_next::Discoverable for DirReceiver {
11782 const PROTOCOL_NAME: &'static str = "dir_receiver";
11783}
11784
11785pub mod dir_receiver {
11786 pub mod prelude {
11787 pub use crate::{
11788 dir_receiver, DirReceiver, DirReceiverClientHandler, DirReceiverClientSender,
11789 DirReceiverServerHandler, DirReceiverServerSender,
11790 };
11791
11792 pub use crate::DirReceiverReceiveRequest;
11793 }
11794
11795 pub struct Receive;
11796
11797 impl ::fidl_next::Method for Receive {
11798 const ORDINAL: u64 = 926684461087488948;
11799
11800 type Protocol = crate::DirReceiver;
11801
11802 type Request = crate::WireDirReceiverReceiveRequest;
11803
11804 type Response = ::fidl_next::Never;
11805 }
11806}
11807
11808pub trait DirReceiverClientSender {
11810 type Transport: ::fidl_next::Transport;
11811
11812 #[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"]
11813 fn receive<___R>(
11814 &self,
11815 request: ___R,
11816 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11817 where
11818 ___R: ::fidl_next::Encode<
11819 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11820 Encoded = crate::WireDirReceiverReceiveRequest,
11821 >;
11822}
11823
11824impl<___T> DirReceiverClientSender for ::fidl_next::ClientSender<___T, DirReceiver>
11825where
11826 ___T: ::fidl_next::Transport,
11827{
11828 type Transport = ___T;
11829
11830 #[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"]
11831 fn receive<___R>(
11832 &self,
11833 request: ___R,
11834 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
11835 where
11836 ___R: ::fidl_next::Encode<
11837 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
11838 Encoded = crate::WireDirReceiverReceiveRequest,
11839 >,
11840 {
11841 self.as_untyped().send_one_way(926684461087488948, request)
11842 }
11843}
11844
11845pub trait DirReceiverClientHandler<___T: ::fidl_next::Transport> {
11849 fn on_unknown_interaction(
11850 &mut self,
11851 sender: &::fidl_next::ClientSender<___T, DirReceiver>,
11852 ordinal: u64,
11853 ) {
11854 sender.close();
11855 }
11856}
11857
11858impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DirReceiver
11859where
11860 ___T: ::fidl_next::Transport,
11861 ___H: DirReceiverClientHandler<___T>,
11862{
11863 fn on_event(
11864 handler: &mut ___H,
11865 sender: &::fidl_next::ClientSender<___T, Self>,
11866 ordinal: u64,
11867 buffer: ___T::RecvBuffer,
11868 ) {
11869 match ordinal {
11870 ordinal => handler.on_unknown_interaction(sender, ordinal),
11871 }
11872 }
11873}
11874
11875pub trait DirReceiverServerSender {
11877 type Transport: ::fidl_next::Transport;
11878}
11879
11880impl<___T> DirReceiverServerSender for ::fidl_next::ServerSender<___T, DirReceiver>
11881where
11882 ___T: ::fidl_next::Transport,
11883{
11884 type Transport = ___T;
11885}
11886
11887pub trait DirReceiverServerHandler<___T: ::fidl_next::Transport> {
11891 #[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"]
11892 fn receive(
11893 &mut self,
11894 sender: &::fidl_next::ServerSender<___T, DirReceiver>,
11895
11896 request: ::fidl_next::Request<___T, dir_receiver::Receive>,
11897 );
11898
11899 fn on_unknown_interaction(
11900 &mut self,
11901 sender: &::fidl_next::ServerSender<___T, DirReceiver>,
11902 ordinal: u64,
11903 ) {
11904 sender.close();
11905 }
11906}
11907
11908impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DirReceiver
11909where
11910 ___T: ::fidl_next::Transport,
11911 ___H: DirReceiverServerHandler<___T>,
11912
11913 <dir_receiver::Receive as ::fidl_next::Method>::Request:
11914 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
11915{
11916 fn on_one_way(
11917 handler: &mut ___H,
11918 sender: &::fidl_next::ServerSender<___T, Self>,
11919 ordinal: u64,
11920 buffer: ___T::RecvBuffer,
11921 ) {
11922 match ordinal {
11923 926684461087488948 => match ::fidl_next::DecoderExt::decode(buffer) {
11924 Ok(decoded) => handler.receive(sender, decoded),
11925 Err(e) => {
11926 sender.close();
11927 }
11928 },
11929
11930 ordinal => handler.on_unknown_interaction(sender, ordinal),
11931 }
11932 }
11933
11934 fn on_two_way(
11935 handler: &mut ___H,
11936 sender: &::fidl_next::ServerSender<___T, Self>,
11937 ordinal: u64,
11938 buffer: ___T::RecvBuffer,
11939 responder: ::fidl_next::protocol::Responder,
11940 ) {
11941 match ordinal {
11942 ordinal => handler.on_unknown_interaction(sender, ordinal),
11943 }
11944 }
11945}
11946
11947#[derive(Debug)]
11948pub enum DirectoryRouterRouteResponse {
11949 Directory(
11950 ::fidl_next::ClientEnd<
11951 ::fidl_next::fuchsia::zx::Channel,
11952 ::fidl_next_fuchsia_io::Directory,
11953 >,
11954 ),
11955
11956 Unavailable(crate::Unit),
11957}
11958
11959impl ::fidl_next::Encodable for DirectoryRouterRouteResponse {
11960 type Encoded = WireDirectoryRouterRouteResponse;
11961}
11962
11963unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryRouterRouteResponse
11964where
11965 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11966
11967 ___E: ::fidl_next::fuchsia::HandleEncoder,
11968{
11969 #[inline]
11970 fn encode(
11971 self,
11972 encoder: &mut ___E,
11973 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11974 ) -> Result<(), ::fidl_next::EncodeError> {
11975 ::fidl_next::munge!(let WireDirectoryRouterRouteResponse { raw, _phantom: _ } = out);
11976
11977 match self {
11978 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as_static::<
11979 ___E,
11980 ::fidl_next::ClientEnd<
11981 ::fidl_next::fuchsia::zx::Channel,
11982 ::fidl_next_fuchsia_io::Directory,
11983 >,
11984 >(value, 1, encoder, raw)?,
11985
11986 Self::Unavailable(value) => ::fidl_next::RawWireUnion::encode_as_static::<
11987 ___E,
11988 crate::Unit,
11989 >(value, 2, encoder, raw)?,
11990 }
11991
11992 Ok(())
11993 }
11994}
11995
11996impl ::fidl_next::EncodableOption for DirectoryRouterRouteResponse {
11997 type EncodedOption = WireOptionalDirectoryRouterRouteResponse;
11998}
11999
12000unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DirectoryRouterRouteResponse
12001where
12002 ___E: ?Sized,
12003 DirectoryRouterRouteResponse: ::fidl_next::Encode<___E>,
12004{
12005 #[inline]
12006 fn encode_option(
12007 this: Option<Self>,
12008 encoder: &mut ___E,
12009 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12010 ) -> Result<(), ::fidl_next::EncodeError> {
12011 ::fidl_next::munge!(let WireOptionalDirectoryRouterRouteResponse { raw, _phantom: _ } = &mut *out);
12012
12013 if let Some(inner) = this {
12014 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
12015 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
12016 } else {
12017 ::fidl_next::RawWireUnion::encode_absent(raw);
12018 }
12019
12020 Ok(())
12021 }
12022}
12023
12024impl ::fidl_next::FromWire<WireDirectoryRouterRouteResponse> for DirectoryRouterRouteResponse {
12025 #[inline]
12026 fn from_wire(wire: WireDirectoryRouterRouteResponse) -> Self {
12027 let wire = ::core::mem::ManuallyDrop::new(wire);
12028 match wire.raw.ordinal() {
12029 1 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
12030 wire.raw.get().read_unchecked::<::fidl_next::ClientEnd<
12031 ::fidl_next::fuchsia::WireChannel,
12032 ::fidl_next_fuchsia_io::Directory,
12033 >>()
12034 })),
12035
12036 2 => Self::Unavailable(::fidl_next::FromWire::from_wire(unsafe {
12037 wire.raw.get().read_unchecked::<crate::WireUnit>()
12038 })),
12039
12040 _ => unsafe { ::core::hint::unreachable_unchecked() },
12041 }
12042 }
12043}
12044
12045impl ::fidl_next::FromWireOption<WireOptionalDirectoryRouterRouteResponse>
12046 for Box<DirectoryRouterRouteResponse>
12047{
12048 #[inline]
12049 fn from_wire_option(wire: WireOptionalDirectoryRouterRouteResponse) -> Option<Self> {
12050 if let Some(inner) = wire.into_option() {
12051 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
12052 } else {
12053 None
12054 }
12055 }
12056}
12057
12058#[repr(transparent)]
12060pub struct WireDirectoryRouterRouteResponse {
12061 raw: ::fidl_next::RawWireUnion,
12062 _phantom: ::core::marker::PhantomData<()>,
12063}
12064
12065impl Drop for WireDirectoryRouterRouteResponse {
12066 fn drop(&mut self) {
12067 match self.raw.ordinal() {
12068 1 => {
12069 let _ = unsafe {
12070 self.raw.get().read_unchecked::<::fidl_next::ClientEnd<
12071 ::fidl_next::fuchsia::WireChannel,
12072 ::fidl_next_fuchsia_io::Directory,
12073 >>()
12074 };
12075 }
12076
12077 2 => {
12078 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUnit>() };
12079 }
12080
12081 _ => unsafe { ::core::hint::unreachable_unchecked() },
12082 }
12083 }
12084}
12085
12086unsafe impl ::fidl_next::Wire for WireDirectoryRouterRouteResponse {
12087 type Decoded<'de> = WireDirectoryRouterRouteResponse;
12088
12089 #[inline]
12090 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12091 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
12092 ::fidl_next::RawWireUnion::zero_padding(raw);
12093 }
12094}
12095
12096pub mod directory_router_route_response {
12097 pub enum Ref<'de> {
12098 Directory(
12099 &'de ::fidl_next::ClientEnd<
12100 ::fidl_next::fuchsia::WireChannel,
12101 ::fidl_next_fuchsia_io::Directory,
12102 >,
12103 ),
12104
12105 Unavailable(&'de crate::WireUnit),
12106 }
12107}
12108
12109impl WireDirectoryRouterRouteResponse {
12110 pub fn as_ref(&self) -> crate::directory_router_route_response::Ref<'_> {
12111 match self.raw.ordinal() {
12112 1 => crate::directory_router_route_response::Ref::Directory(unsafe {
12113 self.raw.get().deref_unchecked::<::fidl_next::ClientEnd<
12114 ::fidl_next::fuchsia::WireChannel,
12115 ::fidl_next_fuchsia_io::Directory,
12116 >>()
12117 }),
12118
12119 2 => crate::directory_router_route_response::Ref::Unavailable(unsafe {
12120 self.raw.get().deref_unchecked::<crate::WireUnit>()
12121 }),
12122
12123 _ => unsafe { ::core::hint::unreachable_unchecked() },
12124 }
12125 }
12126}
12127
12128unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryRouterRouteResponse
12129where
12130 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12131
12132 ___D: ::fidl_next::fuchsia::HandleDecoder,
12133{
12134 fn decode(
12135 mut slot: ::fidl_next::Slot<'_, Self>,
12136 decoder: &mut ___D,
12137 ) -> Result<(), ::fidl_next::DecodeError> {
12138 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
12139 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
12140 1 => ::fidl_next::RawWireUnion::decode_as_static::<
12141 ___D,
12142 ::fidl_next::ClientEnd<
12143 ::fidl_next::fuchsia::WireChannel,
12144 ::fidl_next_fuchsia_io::Directory,
12145 >,
12146 >(raw, decoder)?,
12147
12148 2 => {
12149 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
12150 }
12151
12152 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
12153 }
12154
12155 Ok(())
12156 }
12157}
12158
12159impl ::core::fmt::Debug for WireDirectoryRouterRouteResponse {
12160 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12161 match self.raw.ordinal() {
12162 1 => unsafe {
12163 self.raw
12164 .get()
12165 .deref_unchecked::<::fidl_next::ClientEnd<
12166 ::fidl_next::fuchsia::WireChannel,
12167 ::fidl_next_fuchsia_io::Directory,
12168 >>()
12169 .fmt(f)
12170 },
12171 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUnit>().fmt(f) },
12172 _ => unsafe { ::core::hint::unreachable_unchecked() },
12173 }
12174 }
12175}
12176
12177#[repr(transparent)]
12178pub struct WireOptionalDirectoryRouterRouteResponse {
12179 raw: ::fidl_next::RawWireUnion,
12180 _phantom: ::core::marker::PhantomData<()>,
12181}
12182
12183unsafe impl ::fidl_next::Wire for WireOptionalDirectoryRouterRouteResponse {
12184 type Decoded<'de> = WireOptionalDirectoryRouterRouteResponse;
12185
12186 #[inline]
12187 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12188 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
12189 ::fidl_next::RawWireUnion::zero_padding(raw);
12190 }
12191}
12192
12193impl WireOptionalDirectoryRouterRouteResponse {
12194 pub fn is_some(&self) -> bool {
12195 self.raw.is_some()
12196 }
12197
12198 pub fn is_none(&self) -> bool {
12199 self.raw.is_none()
12200 }
12201
12202 pub fn as_ref(&self) -> Option<&WireDirectoryRouterRouteResponse> {
12203 if self.is_some() {
12204 Some(unsafe { &*(self as *const Self).cast() })
12205 } else {
12206 None
12207 }
12208 }
12209
12210 pub fn into_option(self) -> Option<WireDirectoryRouterRouteResponse> {
12211 if self.is_some() {
12212 Some(WireDirectoryRouterRouteResponse {
12213 raw: self.raw,
12214 _phantom: ::core::marker::PhantomData,
12215 })
12216 } else {
12217 None
12218 }
12219 }
12220}
12221
12222unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDirectoryRouterRouteResponse
12223where
12224 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12225
12226 ___D: ::fidl_next::fuchsia::HandleDecoder,
12227{
12228 fn decode(
12229 mut slot: ::fidl_next::Slot<'_, Self>,
12230 decoder: &mut ___D,
12231 ) -> Result<(), ::fidl_next::DecodeError> {
12232 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
12233 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
12234 1 => ::fidl_next::RawWireUnion::decode_as_static::<
12235 ___D,
12236 ::fidl_next::ClientEnd<
12237 ::fidl_next::fuchsia::WireChannel,
12238 ::fidl_next_fuchsia_io::Directory,
12239 >,
12240 >(raw, decoder)?,
12241
12242 2 => {
12243 ::fidl_next::RawWireUnion::decode_as_static::<___D, crate::WireUnit>(raw, decoder)?
12244 }
12245
12246 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
12247 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
12248 }
12249
12250 Ok(())
12251 }
12252}
12253
12254impl ::core::fmt::Debug for WireOptionalDirectoryRouterRouteResponse {
12255 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
12256 self.as_ref().fmt(f)
12257 }
12258}
12259
12260#[derive(Debug)]
12262pub struct DirectoryRouter;
12263
12264impl ::fidl_next::Discoverable for DirectoryRouter {
12265 const PROTOCOL_NAME: &'static str = "directory_router";
12266}
12267
12268pub mod directory_router {
12269 pub mod prelude {
12270 pub use crate::{
12271 directory_router, DirectoryRouter, DirectoryRouterClientHandler,
12272 DirectoryRouterClientSender, DirectoryRouterServerHandler, DirectoryRouterServerSender,
12273 };
12274
12275 pub use crate::DirectoryRouterRouteResponse;
12276
12277 pub use crate::RouteRequest;
12278
12279 pub use crate::RouterError;
12280 }
12281
12282 pub struct Route;
12283
12284 impl ::fidl_next::Method for Route {
12285 const ORDINAL: u64 = 7510716014181158689;
12286
12287 type Protocol = crate::DirectoryRouter;
12288
12289 type Request = crate::WireRouteRequest<'static>;
12290
12291 type Response = ::fidl_next::WireFlexibleResult<
12292 'static,
12293 crate::WireDirectoryRouterRouteResponse,
12294 crate::WireRouterError,
12295 >;
12296 }
12297}
12298
12299pub trait DirectoryRouterClientSender {
12301 type Transport: ::fidl_next::Transport;
12302
12303 fn route<___R>(
12304 &self,
12305 request: ___R,
12306 ) -> Result<
12307 ::fidl_next::ResponseFuture<'_, Self::Transport, directory_router::Route>,
12308 ::fidl_next::EncodeError,
12309 >
12310 where
12311 ___R: ::fidl_next::Encode<
12312 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
12313 Encoded = crate::WireRouteRequest<'static>,
12314 >;
12315}
12316
12317impl<___T> DirectoryRouterClientSender for ::fidl_next::ClientSender<___T, DirectoryRouter>
12318where
12319 ___T: ::fidl_next::Transport,
12320{
12321 type Transport = ___T;
12322
12323 fn route<___R>(
12324 &self,
12325 request: ___R,
12326 ) -> Result<
12327 ::fidl_next::ResponseFuture<'_, Self::Transport, directory_router::Route>,
12328 ::fidl_next::EncodeError,
12329 >
12330 where
12331 ___R: ::fidl_next::Encode<
12332 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
12333 Encoded = crate::WireRouteRequest<'static>,
12334 >,
12335 {
12336 self.as_untyped()
12337 .send_two_way(7510716014181158689, request)
12338 .map(::fidl_next::ResponseFuture::from_untyped)
12339 }
12340}
12341
12342pub trait DirectoryRouterClientHandler<___T: ::fidl_next::Transport> {
12346 fn on_unknown_interaction(
12347 &mut self,
12348 sender: &::fidl_next::ClientSender<___T, DirectoryRouter>,
12349 ordinal: u64,
12350 ) {
12351 sender.close();
12352 }
12353}
12354
12355impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for DirectoryRouter
12356where
12357 ___T: ::fidl_next::Transport,
12358 ___H: DirectoryRouterClientHandler<___T>,
12359
12360 <directory_router::Route as ::fidl_next::Method>::Response:
12361 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
12362{
12363 fn on_event(
12364 handler: &mut ___H,
12365 sender: &::fidl_next::ClientSender<___T, Self>,
12366 ordinal: u64,
12367 buffer: ___T::RecvBuffer,
12368 ) {
12369 match ordinal {
12370 ordinal => handler.on_unknown_interaction(sender, ordinal),
12371 }
12372 }
12373}
12374
12375pub trait DirectoryRouterServerSender {
12377 type Transport: ::fidl_next::Transport;
12378}
12379
12380impl<___T> DirectoryRouterServerSender for ::fidl_next::ServerSender<___T, DirectoryRouter>
12381where
12382 ___T: ::fidl_next::Transport,
12383{
12384 type Transport = ___T;
12385}
12386
12387pub trait DirectoryRouterServerHandler<___T: ::fidl_next::Transport> {
12391 fn route(
12392 &mut self,
12393 sender: &::fidl_next::ServerSender<___T, DirectoryRouter>,
12394
12395 request: ::fidl_next::Request<___T, directory_router::Route>,
12396
12397 responder: ::fidl_next::Responder<directory_router::Route>,
12398 );
12399
12400 fn on_unknown_interaction(
12401 &mut self,
12402 sender: &::fidl_next::ServerSender<___T, DirectoryRouter>,
12403 ordinal: u64,
12404 ) {
12405 sender.close();
12406 }
12407}
12408
12409impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for DirectoryRouter
12410where
12411 ___T: ::fidl_next::Transport,
12412 ___H: DirectoryRouterServerHandler<___T>,
12413
12414 <directory_router::Route as ::fidl_next::Method>::Request:
12415 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
12416{
12417 fn on_one_way(
12418 handler: &mut ___H,
12419 sender: &::fidl_next::ServerSender<___T, Self>,
12420 ordinal: u64,
12421 buffer: ___T::RecvBuffer,
12422 ) {
12423 match ordinal {
12424 ordinal => handler.on_unknown_interaction(sender, ordinal),
12425 }
12426 }
12427
12428 fn on_two_way(
12429 handler: &mut ___H,
12430 sender: &::fidl_next::ServerSender<___T, Self>,
12431 ordinal: u64,
12432 buffer: ___T::RecvBuffer,
12433 responder: ::fidl_next::protocol::Responder,
12434 ) {
12435 match ordinal {
12436 7510716014181158689 => {
12437 let responder = ::fidl_next::Responder::from_untyped(responder);
12438
12439 match ::fidl_next::DecoderExt::decode(buffer) {
12440 Ok(decoded) => handler.route(sender, decoded, responder),
12441 Err(e) => {
12442 sender.close();
12443 }
12444 }
12445 }
12446
12447 ordinal => handler.on_unknown_interaction(sender, ordinal),
12448 }
12449 }
12450}
12451
12452#[doc = " Contains a protocol open request.\n"]
12453#[derive(Debug)]
12454#[repr(C)]
12455pub struct ProtocolPayload {
12456 pub channel: ::fidl_next::fuchsia::zx::Handle,
12457}
12458
12459impl ::fidl_next::Encodable for ProtocolPayload {
12460 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireProtocolPayload> = unsafe {
12461 ::fidl_next::CopyOptimization::enable_if(
12462 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
12463 .is_enabled(),
12464 )
12465 };
12466
12467 type Encoded = WireProtocolPayload;
12468}
12469
12470unsafe impl<___E> ::fidl_next::Encode<___E> for ProtocolPayload
12471where
12472 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12473
12474 ___E: ::fidl_next::fuchsia::HandleEncoder,
12475{
12476 #[inline]
12477 fn encode(
12478 self,
12479 encoder: &mut ___E,
12480 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12481 ) -> Result<(), ::fidl_next::EncodeError> {
12482 ::fidl_next::munge! {
12483 let Self::Encoded {
12484 channel,
12485
12486 } = out;
12487 }
12488
12489 ::fidl_next::Encode::encode(self.channel, encoder, channel)?;
12490
12491 Ok(())
12492 }
12493}
12494
12495impl ::fidl_next::EncodableOption for ProtocolPayload {
12496 type EncodedOption = ::fidl_next::WireBox<'static, WireProtocolPayload>;
12497}
12498
12499unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ProtocolPayload
12500where
12501 ___E: ::fidl_next::Encoder + ?Sized,
12502 ProtocolPayload: ::fidl_next::Encode<___E>,
12503{
12504 #[inline]
12505 fn encode_option(
12506 this: Option<Self>,
12507 encoder: &mut ___E,
12508 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12509 ) -> Result<(), ::fidl_next::EncodeError> {
12510 if let Some(inner) = this {
12511 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
12512 ::fidl_next::WireBox::encode_present(out);
12513 } else {
12514 ::fidl_next::WireBox::encode_absent(out);
12515 }
12516
12517 Ok(())
12518 }
12519}
12520
12521impl ::fidl_next::FromWire<WireProtocolPayload> for ProtocolPayload {
12522 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireProtocolPayload, Self> = unsafe {
12523 ::fidl_next::CopyOptimization::enable_if(
12524 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
12525 ::fidl_next::fuchsia::WireHandle,
12526 >>::COPY_OPTIMIZATION
12527 .is_enabled(),
12528 )
12529 };
12530
12531 #[inline]
12532 fn from_wire(wire: WireProtocolPayload) -> Self {
12533 Self { channel: ::fidl_next::FromWire::from_wire(wire.channel) }
12534 }
12535}
12536
12537#[derive(Debug)]
12539#[repr(C)]
12540pub struct WireProtocolPayload {
12541 pub channel: ::fidl_next::fuchsia::WireHandle,
12542}
12543
12544unsafe impl ::fidl_next::Wire for WireProtocolPayload {
12545 type Decoded<'de> = WireProtocolPayload;
12546
12547 #[inline]
12548 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
12549}
12550
12551unsafe impl<___D> ::fidl_next::Decode<___D> for WireProtocolPayload
12552where
12553 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12554
12555 ___D: ::fidl_next::fuchsia::HandleDecoder,
12556{
12557 fn decode(
12558 slot: ::fidl_next::Slot<'_, Self>,
12559 decoder: &mut ___D,
12560 ) -> Result<(), ::fidl_next::DecodeError> {
12561 ::fidl_next::munge! {
12562 let Self {
12563 mut channel,
12564
12565 } = slot;
12566 }
12567
12568 ::fidl_next::Decode::decode(channel.as_mut(), decoder)?;
12569
12570 Ok(())
12571 }
12572}
12573
12574#[doc = " A receiver is served by components and allows them to receive channels\n from the framework.\n"]
12576#[derive(Debug)]
12577pub struct Receiver;
12578
12579impl ::fidl_next::Discoverable for Receiver {
12580 const PROTOCOL_NAME: &'static str = "receiver";
12581}
12582
12583pub mod receiver {
12584 pub mod prelude {
12585 pub use crate::{
12586 receiver, Receiver, ReceiverClientHandler, ReceiverClientSender, ReceiverServerHandler,
12587 ReceiverServerSender,
12588 };
12589
12590 pub use crate::ProtocolPayload;
12591 }
12592
12593 pub struct Receive;
12594
12595 impl ::fidl_next::Method for Receive {
12596 const ORDINAL: u64 = 340832707723008660;
12597
12598 type Protocol = crate::Receiver;
12599
12600 type Request = crate::WireProtocolPayload;
12601
12602 type Response = ::fidl_next::Never;
12603 }
12604}
12605
12606pub trait ReceiverClientSender {
12608 type Transport: ::fidl_next::Transport;
12609
12610 #[doc = " Sends a channel to this receiver.\n"]
12611 fn receive<___R>(
12612 &self,
12613 request: ___R,
12614 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
12615 where
12616 ___R: ::fidl_next::Encode<
12617 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
12618 Encoded = crate::WireProtocolPayload,
12619 >;
12620}
12621
12622impl<___T> ReceiverClientSender for ::fidl_next::ClientSender<___T, Receiver>
12623where
12624 ___T: ::fidl_next::Transport,
12625{
12626 type Transport = ___T;
12627
12628 #[doc = " Sends a channel to this receiver.\n"]
12629 fn receive<___R>(
12630 &self,
12631 request: ___R,
12632 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
12633 where
12634 ___R: ::fidl_next::Encode<
12635 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
12636 Encoded = crate::WireProtocolPayload,
12637 >,
12638 {
12639 self.as_untyped().send_one_way(340832707723008660, request)
12640 }
12641}
12642
12643pub trait ReceiverClientHandler<___T: ::fidl_next::Transport> {
12647 fn on_unknown_interaction(
12648 &mut self,
12649 sender: &::fidl_next::ClientSender<___T, Receiver>,
12650 ordinal: u64,
12651 ) {
12652 sender.close();
12653 }
12654}
12655
12656impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Receiver
12657where
12658 ___T: ::fidl_next::Transport,
12659 ___H: ReceiverClientHandler<___T>,
12660{
12661 fn on_event(
12662 handler: &mut ___H,
12663 sender: &::fidl_next::ClientSender<___T, Self>,
12664 ordinal: u64,
12665 buffer: ___T::RecvBuffer,
12666 ) {
12667 match ordinal {
12668 ordinal => handler.on_unknown_interaction(sender, ordinal),
12669 }
12670 }
12671}
12672
12673pub trait ReceiverServerSender {
12675 type Transport: ::fidl_next::Transport;
12676}
12677
12678impl<___T> ReceiverServerSender for ::fidl_next::ServerSender<___T, Receiver>
12679where
12680 ___T: ::fidl_next::Transport,
12681{
12682 type Transport = ___T;
12683}
12684
12685pub trait ReceiverServerHandler<___T: ::fidl_next::Transport> {
12689 #[doc = " Sends a channel to this receiver.\n"]
12690 fn receive(
12691 &mut self,
12692 sender: &::fidl_next::ServerSender<___T, Receiver>,
12693
12694 request: ::fidl_next::Request<___T, receiver::Receive>,
12695 );
12696
12697 fn on_unknown_interaction(
12698 &mut self,
12699 sender: &::fidl_next::ServerSender<___T, Receiver>,
12700 ordinal: u64,
12701 ) {
12702 sender.close();
12703 }
12704}
12705
12706impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Receiver
12707where
12708 ___T: ::fidl_next::Transport,
12709 ___H: ReceiverServerHandler<___T>,
12710
12711 <receiver::Receive as ::fidl_next::Method>::Request:
12712 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
12713{
12714 fn on_one_way(
12715 handler: &mut ___H,
12716 sender: &::fidl_next::ServerSender<___T, Self>,
12717 ordinal: u64,
12718 buffer: ___T::RecvBuffer,
12719 ) {
12720 match ordinal {
12721 340832707723008660 => match ::fidl_next::DecoderExt::decode(buffer) {
12722 Ok(decoded) => handler.receive(sender, decoded),
12723 Err(e) => {
12724 sender.close();
12725 }
12726 },
12727
12728 ordinal => handler.on_unknown_interaction(sender, ordinal),
12729 }
12730 }
12731
12732 fn on_two_way(
12733 handler: &mut ___H,
12734 sender: &::fidl_next::ServerSender<___T, Self>,
12735 ordinal: u64,
12736 buffer: ___T::RecvBuffer,
12737 responder: ::fidl_next::protocol::Responder,
12738 ) {
12739 match ordinal {
12740 ordinal => handler.on_unknown_interaction(sender, ordinal),
12741 }
12742 }
12743}
12744
12745#[derive(Clone, Debug)]
12746#[repr(C)]
12747pub struct Unavailable {}
12748
12749impl ::fidl_next::Encodable for Unavailable {
12750 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireUnavailable> =
12751 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
12752
12753 type Encoded = WireUnavailable;
12754}
12755
12756unsafe impl<___E> ::fidl_next::Encode<___E> for Unavailable
12757where
12758 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12759{
12760 #[inline]
12761 fn encode(
12762 self,
12763 encoder: &mut ___E,
12764 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12765 ) -> Result<(), ::fidl_next::EncodeError> {
12766 ::fidl_next::munge! {
12767 let Self::Encoded {
12768
12769 } = out;
12770 }
12771
12772 Ok(())
12773 }
12774}
12775
12776unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Unavailable
12777where
12778 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12779{
12780 #[inline]
12781 fn encode_ref(
12782 &self,
12783 encoder: &mut ___E,
12784 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12785 ) -> Result<(), ::fidl_next::EncodeError> {
12786 ::fidl_next::munge! {
12787 let Self::Encoded {
12788
12789 } = out;
12790 }
12791
12792 Ok(())
12793 }
12794}
12795
12796impl ::fidl_next::EncodableOption for Unavailable {
12797 type EncodedOption = ::fidl_next::WireBox<'static, WireUnavailable>;
12798}
12799
12800unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Unavailable
12801where
12802 ___E: ::fidl_next::Encoder + ?Sized,
12803 Unavailable: ::fidl_next::Encode<___E>,
12804{
12805 #[inline]
12806 fn encode_option(
12807 this: Option<Self>,
12808 encoder: &mut ___E,
12809 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12810 ) -> Result<(), ::fidl_next::EncodeError> {
12811 if let Some(inner) = this {
12812 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
12813 ::fidl_next::WireBox::encode_present(out);
12814 } else {
12815 ::fidl_next::WireBox::encode_absent(out);
12816 }
12817
12818 Ok(())
12819 }
12820}
12821
12822unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Unavailable
12823where
12824 ___E: ::fidl_next::Encoder + ?Sized,
12825 Unavailable: ::fidl_next::EncodeRef<___E>,
12826{
12827 #[inline]
12828 fn encode_option_ref(
12829 this: Option<&Self>,
12830 encoder: &mut ___E,
12831 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
12832 ) -> Result<(), ::fidl_next::EncodeError> {
12833 if let Some(inner) = this {
12834 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
12835 ::fidl_next::WireBox::encode_present(out);
12836 } else {
12837 ::fidl_next::WireBox::encode_absent(out);
12838 }
12839
12840 Ok(())
12841 }
12842}
12843
12844impl ::fidl_next::FromWire<WireUnavailable> for Unavailable {
12845 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireUnavailable, Self> =
12846 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
12847
12848 #[inline]
12849 fn from_wire(wire: WireUnavailable) -> Self {
12850 Self {}
12851 }
12852}
12853
12854impl ::fidl_next::FromWireRef<WireUnavailable> for Unavailable {
12855 #[inline]
12856 fn from_wire_ref(wire: &WireUnavailable) -> Self {
12857 Self {}
12858 }
12859}
12860
12861#[derive(Clone, Debug)]
12863#[repr(C)]
12864pub struct WireUnavailable {}
12865
12866unsafe impl ::fidl_next::Wire for WireUnavailable {
12867 type Decoded<'de> = WireUnavailable;
12868
12869 #[inline]
12870 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
12871}
12872
12873unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnavailable
12874where
12875 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
12876{
12877 fn decode(
12878 slot: ::fidl_next::Slot<'_, Self>,
12879 decoder: &mut ___D,
12880 ) -> Result<(), ::fidl_next::DecodeError> {
12881 ::fidl_next::munge! {
12882 let Self {
12883
12884 } = slot;
12885 }
12886
12887 Ok(())
12888 }
12889}
12890
12891pub mod compat {
12893
12894 impl ::core::convert::From<crate::Availability> for ::fidl_fuchsia_component_sandbox::Availability {
12895 #[inline]
12896 fn from(from: crate::Availability) -> Self {
12897 match crate::Availability::from(from) {
12898 crate::Availability::Required => Self::Required,
12899
12900 crate::Availability::Optional => Self::Optional,
12901
12902 crate::Availability::SameAsTarget => Self::SameAsTarget,
12903
12904 crate::Availability::Transitional => Self::Transitional,
12905 }
12906 }
12907 }
12908
12909 impl ::core::convert::From<crate::CapabilityStoreError>
12910 for ::fidl_fuchsia_component_sandbox::CapabilityStoreError
12911 {
12912 #[inline]
12913 fn from(from: crate::CapabilityStoreError) -> Self {
12914 match crate::CapabilityStoreError::from(from) {
12915 crate::CapabilityStoreError::IdNotFound => Self::IdNotFound,
12916
12917 crate::CapabilityStoreError::IdAlreadyExists => Self::IdAlreadyExists,
12918
12919 crate::CapabilityStoreError::BadCapability => Self::BadCapability,
12920
12921 crate::CapabilityStoreError::WrongType => Self::WrongType,
12922
12923 crate::CapabilityStoreError::NotDuplicatable => Self::NotDuplicatable,
12924
12925 crate::CapabilityStoreError::ItemNotFound => Self::ItemNotFound,
12926
12927 crate::CapabilityStoreError::ItemAlreadyExists => Self::ItemAlreadyExists,
12928
12929 crate::CapabilityStoreError::InvalidKey => Self::InvalidKey,
12930
12931 crate::CapabilityStoreError::InvalidArgs => Self::InvalidArgs,
12932
12933 crate::CapabilityStoreError::UnknownOrdinal_(value) => {
12934 Self::__SourceBreaking { unknown_ordinal: value }
12935 }
12936 }
12937 }
12938 }
12939
12940 #[cfg(target_os = "fuchsia")]
12941 pub type CapabilityStoreProxy =
12944 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::CapabilityStore>;
12945
12946 impl ::core::convert::From<crate::CapabilityStore>
12947 for ::fidl_fuchsia_component_sandbox::CapabilityStoreMarker
12948 {
12949 #[inline]
12950 fn from(_: crate::CapabilityStore) -> Self {
12951 Self
12952 }
12953 }
12954
12955 impl ::core::convert::From<crate::RouterError> for ::fidl_fuchsia_component_sandbox::RouterError {
12956 #[inline]
12957 fn from(from: crate::RouterError) -> Self {
12958 match crate::RouterError::from(from) {
12959 crate::RouterError::NotFound => Self::NotFound,
12960
12961 crate::RouterError::InvalidArgs => Self::InvalidArgs,
12962
12963 crate::RouterError::NotSupported => Self::NotSupported,
12964
12965 crate::RouterError::Internal => Self::Internal,
12966
12967 crate::RouterError::UnknownOrdinal_(value) => {
12968 Self::__SourceBreaking { unknown_ordinal: value }
12969 }
12970 }
12971 }
12972 }
12973
12974 #[cfg(target_os = "fuchsia")]
12975 pub type ConnectorRouterProxy =
12978 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::ConnectorRouter>;
12979
12980 impl ::core::convert::From<crate::ConnectorRouter>
12981 for ::fidl_fuchsia_component_sandbox::ConnectorRouterMarker
12982 {
12983 #[inline]
12984 fn from(_: crate::ConnectorRouter) -> Self {
12985 Self
12986 }
12987 }
12988
12989 #[cfg(target_os = "fuchsia")]
12990 pub type DataRouterProxy =
12993 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DataRouter>;
12994
12995 impl ::core::convert::From<crate::DataRouter>
12996 for ::fidl_fuchsia_component_sandbox::DataRouterMarker
12997 {
12998 #[inline]
12999 fn from(_: crate::DataRouter) -> Self {
13000 Self
13001 }
13002 }
13003
13004 #[cfg(target_os = "fuchsia")]
13005 pub type DictionaryProxy =
13008 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Dictionary>;
13009
13010 impl ::core::convert::From<crate::Dictionary>
13011 for ::fidl_fuchsia_component_sandbox::DictionaryMarker
13012 {
13013 #[inline]
13014 fn from(_: crate::Dictionary) -> Self {
13015 Self
13016 }
13017 }
13018
13019 #[cfg(target_os = "fuchsia")]
13020 pub type DictionaryDrainIteratorProxy = ::fidl_next::ClientSender<
13023 ::fidl_next::fuchsia::zx::Channel,
13024 crate::DictionaryDrainIterator,
13025 >;
13026
13027 impl ::core::convert::From<crate::DictionaryDrainIterator>
13028 for ::fidl_fuchsia_component_sandbox::DictionaryDrainIteratorMarker
13029 {
13030 #[inline]
13031 fn from(_: crate::DictionaryDrainIterator) -> Self {
13032 Self
13033 }
13034 }
13035
13036 #[cfg(target_os = "fuchsia")]
13037 pub type DictionaryEnumerateIteratorProxy = ::fidl_next::ClientSender<
13040 ::fidl_next::fuchsia::zx::Channel,
13041 crate::DictionaryEnumerateIterator,
13042 >;
13043
13044 impl ::core::convert::From<crate::DictionaryEnumerateIterator>
13045 for ::fidl_fuchsia_component_sandbox::DictionaryEnumerateIteratorMarker
13046 {
13047 #[inline]
13048 fn from(_: crate::DictionaryEnumerateIterator) -> Self {
13049 Self
13050 }
13051 }
13052
13053 impl ::core::convert::From<crate::DictionaryError>
13054 for ::fidl_fuchsia_component_sandbox::DictionaryError
13055 {
13056 #[inline]
13057 fn from(from: crate::DictionaryError) -> Self {
13058 match crate::DictionaryError::from(from) {
13059 crate::DictionaryError::NotFound => Self::NotFound,
13060
13061 crate::DictionaryError::AlreadyExists => Self::AlreadyExists,
13062
13063 crate::DictionaryError::BadCapability => Self::BadCapability,
13064
13065 crate::DictionaryError::InvalidKey => Self::InvalidKey,
13066
13067 crate::DictionaryError::NotCloneable => Self::NotCloneable,
13068
13069 crate::DictionaryError::UnknownOrdinal_(value) => {
13070 Self::__SourceBreaking { unknown_ordinal: value }
13071 }
13072 }
13073 }
13074 }
13075
13076 #[cfg(target_os = "fuchsia")]
13077 pub type DictionaryKeysIteratorProxy =
13080 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DictionaryKeysIterator>;
13081
13082 impl ::core::convert::From<crate::DictionaryKeysIterator>
13083 for ::fidl_fuchsia_component_sandbox::DictionaryKeysIteratorMarker
13084 {
13085 #[inline]
13086 fn from(_: crate::DictionaryKeysIterator) -> Self {
13087 Self
13088 }
13089 }
13090
13091 #[cfg(target_os = "fuchsia")]
13092 pub type DictionaryRouterProxy =
13095 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DictionaryRouter>;
13096
13097 impl ::core::convert::From<crate::DictionaryRouter>
13098 for ::fidl_fuchsia_component_sandbox::DictionaryRouterMarker
13099 {
13100 #[inline]
13101 fn from(_: crate::DictionaryRouter) -> Self {
13102 Self
13103 }
13104 }
13105
13106 #[cfg(target_os = "fuchsia")]
13107 pub type DirConnectorRouterProxy =
13110 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirConnectorRouter>;
13111
13112 impl ::core::convert::From<crate::DirConnectorRouter>
13113 for ::fidl_fuchsia_component_sandbox::DirConnectorRouterMarker
13114 {
13115 #[inline]
13116 fn from(_: crate::DirConnectorRouter) -> Self {
13117 Self
13118 }
13119 }
13120
13121 #[cfg(target_os = "fuchsia")]
13122 pub type DirEntryRouterProxy =
13125 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirEntryRouter>;
13126
13127 impl ::core::convert::From<crate::DirEntryRouter>
13128 for ::fidl_fuchsia_component_sandbox::DirEntryRouterMarker
13129 {
13130 #[inline]
13131 fn from(_: crate::DirEntryRouter) -> Self {
13132 Self
13133 }
13134 }
13135
13136 #[cfg(target_os = "fuchsia")]
13137 pub type DirReceiverProxy =
13140 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirReceiver>;
13141
13142 impl ::core::convert::From<crate::DirReceiver>
13143 for ::fidl_fuchsia_component_sandbox::DirReceiverMarker
13144 {
13145 #[inline]
13146 fn from(_: crate::DirReceiver) -> Self {
13147 Self
13148 }
13149 }
13150
13151 #[cfg(target_os = "fuchsia")]
13152 pub type DirectoryRouterProxy =
13155 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::DirectoryRouter>;
13156
13157 impl ::core::convert::From<crate::DirectoryRouter>
13158 for ::fidl_fuchsia_component_sandbox::DirectoryRouterMarker
13159 {
13160 #[inline]
13161 fn from(_: crate::DirectoryRouter) -> Self {
13162 Self
13163 }
13164 }
13165
13166 #[cfg(target_os = "fuchsia")]
13167 pub type ReceiverProxy =
13170 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Receiver>;
13171
13172 impl ::core::convert::From<crate::Receiver> for ::fidl_fuchsia_component_sandbox::ReceiverMarker {
13173 #[inline]
13174 fn from(_: crate::Receiver) -> Self {
13175 Self
13176 }
13177 }
13178}