Skip to main content

fidl_next_fuchsia_hardware_inlineencryption/
fidl_next_fuchsia_hardware_inlineencryption.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7    pub use fidl_next_common_fuchsia_hardware_inlineencryption::natural::*;
8
9    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10    pub struct DeviceProgramKeyRequest {
11        pub wrapped_key: ::std::vec::Vec<u8>,
12
13        pub data_unit_size: u32,
14    }
15
16    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceProgramKeyRequest<'static>, ___E>
17        for DeviceProgramKeyRequest
18    where
19        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20        ___E: ::fidl_next::Encoder,
21        ___E: ::fidl_next::fuchsia::HandleEncoder,
22    {
23        #[inline]
24        fn encode(
25            self,
26            encoder_: &mut ___E,
27            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceProgramKeyRequest<'static>>,
28            _: (),
29        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30            ::fidl_next::munge! {
31                let crate::wire::DeviceProgramKeyRequest {
32                    wrapped_key,
33                    data_unit_size,
34
35                } = out_;
36            }
37
38            ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
39
40            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(wrapped_key.as_mut_ptr()) };
41            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
42
43            ::fidl_next::Encode::encode(self.data_unit_size, encoder_, data_unit_size, ())?;
44
45            let mut _field =
46                unsafe { ::fidl_next::Slot::new_unchecked(data_unit_size.as_mut_ptr()) };
47
48            Ok(())
49        }
50    }
51
52    unsafe impl<___E>
53        ::fidl_next::EncodeOption<
54            ::fidl_next::wire::Box<'static, crate::wire::DeviceProgramKeyRequest<'static>>,
55            ___E,
56        > for DeviceProgramKeyRequest
57    where
58        ___E: ::fidl_next::Encoder + ?Sized,
59        DeviceProgramKeyRequest:
60            ::fidl_next::Encode<crate::wire::DeviceProgramKeyRequest<'static>, ___E>,
61    {
62        #[inline]
63        fn encode_option(
64            this: ::core::option::Option<Self>,
65            encoder: &mut ___E,
66            out: &mut ::core::mem::MaybeUninit<
67                ::fidl_next::wire::Box<'static, crate::wire::DeviceProgramKeyRequest<'static>>,
68            >,
69            _: (),
70        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
71            if let Some(inner) = this {
72                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
73                ::fidl_next::wire::Box::encode_present(out);
74            } else {
75                ::fidl_next::wire::Box::encode_absent(out);
76            }
77
78            Ok(())
79        }
80    }
81
82    impl<'de> ::fidl_next::FromWire<crate::wire::DeviceProgramKeyRequest<'de>>
83        for DeviceProgramKeyRequest
84    {
85        #[inline]
86        fn from_wire(wire: crate::wire::DeviceProgramKeyRequest<'de>) -> Self {
87            Self {
88                wrapped_key: ::fidl_next::FromWire::from_wire(wire.wrapped_key),
89
90                data_unit_size: ::fidl_next::FromWire::from_wire(wire.data_unit_size),
91            }
92        }
93    }
94
95    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
96    pub struct DeviceDeriveRawSecretRequest {
97        pub wrapped_key: ::std::vec::Vec<u8>,
98    }
99
100    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretRequest<'static>, ___E>
101        for DeviceDeriveRawSecretRequest
102    where
103        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
104        ___E: ::fidl_next::Encoder,
105        ___E: ::fidl_next::fuchsia::HandleEncoder,
106    {
107        #[inline]
108        fn encode(
109            self,
110            encoder_: &mut ___E,
111            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceDeriveRawSecretRequest<'static>>,
112            _: (),
113        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
114            ::fidl_next::munge! {
115                let crate::wire::DeviceDeriveRawSecretRequest {
116                    wrapped_key,
117
118                } = out_;
119            }
120
121            ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
122
123            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(wrapped_key.as_mut_ptr()) };
124            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
125
126            Ok(())
127        }
128    }
129
130    unsafe impl<___E>
131        ::fidl_next::EncodeOption<
132            ::fidl_next::wire::Box<'static, crate::wire::DeviceDeriveRawSecretRequest<'static>>,
133            ___E,
134        > for DeviceDeriveRawSecretRequest
135    where
136        ___E: ::fidl_next::Encoder + ?Sized,
137        DeviceDeriveRawSecretRequest:
138            ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretRequest<'static>, ___E>,
139    {
140        #[inline]
141        fn encode_option(
142            this: ::core::option::Option<Self>,
143            encoder: &mut ___E,
144            out: &mut ::core::mem::MaybeUninit<
145                ::fidl_next::wire::Box<'static, crate::wire::DeviceDeriveRawSecretRequest<'static>>,
146            >,
147            _: (),
148        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
149            if let Some(inner) = this {
150                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
151                ::fidl_next::wire::Box::encode_present(out);
152            } else {
153                ::fidl_next::wire::Box::encode_absent(out);
154            }
155
156            Ok(())
157        }
158    }
159
160    impl<'de> ::fidl_next::FromWire<crate::wire::DeviceDeriveRawSecretRequest<'de>>
161        for DeviceDeriveRawSecretRequest
162    {
163        #[inline]
164        fn from_wire(wire: crate::wire::DeviceDeriveRawSecretRequest<'de>) -> Self {
165            Self { wrapped_key: ::fidl_next::FromWire::from_wire(wire.wrapped_key) }
166        }
167    }
168
169    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
170    pub struct DeviceDeriveRawSecretResponse {
171        pub secret: ::std::vec::Vec<u8>,
172    }
173
174    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretResponse<'static>, ___E>
175        for DeviceDeriveRawSecretResponse
176    where
177        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
178        ___E: ::fidl_next::Encoder,
179        ___E: ::fidl_next::fuchsia::HandleEncoder,
180    {
181        #[inline]
182        fn encode(
183            self,
184            encoder_: &mut ___E,
185            out_: &mut ::core::mem::MaybeUninit<
186                crate::wire::DeviceDeriveRawSecretResponse<'static>,
187            >,
188            _: (),
189        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
190            ::fidl_next::munge! {
191                let crate::wire::DeviceDeriveRawSecretResponse {
192                    secret,
193
194                } = out_;
195            }
196
197            ::fidl_next::Encode::encode(self.secret, encoder_, secret, (4294967295, ()))?;
198
199            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(secret.as_mut_ptr()) };
200            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
201
202            Ok(())
203        }
204    }
205
206    unsafe impl<___E>
207        ::fidl_next::EncodeOption<
208            ::fidl_next::wire::Box<'static, crate::wire::DeviceDeriveRawSecretResponse<'static>>,
209            ___E,
210        > for DeviceDeriveRawSecretResponse
211    where
212        ___E: ::fidl_next::Encoder + ?Sized,
213        DeviceDeriveRawSecretResponse:
214            ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretResponse<'static>, ___E>,
215    {
216        #[inline]
217        fn encode_option(
218            this: ::core::option::Option<Self>,
219            encoder: &mut ___E,
220            out: &mut ::core::mem::MaybeUninit<
221                ::fidl_next::wire::Box<
222                    'static,
223                    crate::wire::DeviceDeriveRawSecretResponse<'static>,
224                >,
225            >,
226            _: (),
227        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
228            if let Some(inner) = this {
229                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
230                ::fidl_next::wire::Box::encode_present(out);
231            } else {
232                ::fidl_next::wire::Box::encode_absent(out);
233            }
234
235            Ok(())
236        }
237    }
238
239    impl<'de> ::fidl_next::FromWire<crate::wire::DeviceDeriveRawSecretResponse<'de>>
240        for DeviceDeriveRawSecretResponse
241    {
242        #[inline]
243        fn from_wire(wire: crate::wire::DeviceDeriveRawSecretResponse<'de>) -> Self {
244            Self { secret: ::fidl_next::FromWire::from_wire(wire.secret) }
245        }
246    }
247}
248
249pub mod wire {
250
251    pub use fidl_next_common_fuchsia_hardware_inlineencryption::wire::*;
252
253    /// The wire type corresponding to [`DeviceProgramKeyRequest`].
254    #[derive(Debug)]
255    #[repr(C)]
256    pub struct DeviceProgramKeyRequest<'de> {
257        pub wrapped_key: ::fidl_next::wire::Vector<'de, u8>,
258
259        pub data_unit_size: ::fidl_next::wire::Uint32,
260    }
261
262    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceProgramKeyRequest<'_>>(), 24);
263    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceProgramKeyRequest<'_>>(), 8);
264
265    static_assertions::const_assert_eq!(
266        std::mem::offset_of!(DeviceProgramKeyRequest<'_>, wrapped_key),
267        0
268    );
269
270    static_assertions::const_assert_eq!(
271        std::mem::offset_of!(DeviceProgramKeyRequest<'_>, data_unit_size),
272        16
273    );
274
275    impl ::fidl_next::Constrained for DeviceProgramKeyRequest<'_> {
276        type Constraint = ();
277
278        fn validate(
279            _: ::fidl_next::Slot<'_, Self>,
280            _: Self::Constraint,
281        ) -> Result<(), ::fidl_next::ValidationError> {
282            Ok(())
283        }
284    }
285
286    unsafe impl ::fidl_next::Wire for DeviceProgramKeyRequest<'static> {
287        type Narrowed<'de> = DeviceProgramKeyRequest<'de>;
288
289        #[inline]
290        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
291            ::fidl_next::munge! {
292                let Self {
293                    wrapped_key,
294                    data_unit_size,
295
296                } = &mut *out_;
297            }
298
299            ::fidl_next::Wire::zero_padding(wrapped_key);
300
301            ::fidl_next::Wire::zero_padding(data_unit_size);
302
303            unsafe {
304                out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
305            }
306        }
307    }
308
309    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceProgramKeyRequest<'de>
310    where
311        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
312        ___D: ::fidl_next::Decoder<'de>,
313        ___D: ::fidl_next::fuchsia::HandleDecoder,
314    {
315        fn decode(
316            slot_: ::fidl_next::Slot<'_, Self>,
317            decoder_: &mut ___D,
318            _: (),
319        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
320            if slot_.as_bytes()[20..24] != [0u8; 4] {
321                return Err(::fidl_next::DecodeError::InvalidPadding);
322            }
323
324            ::fidl_next::munge! {
325                let Self {
326                    mut wrapped_key,
327                    mut data_unit_size,
328
329                } = slot_;
330            }
331
332            let _field = wrapped_key.as_mut();
333            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
334            ::fidl_next::Decode::decode(wrapped_key.as_mut(), decoder_, (4294967295, ()))?;
335
336            let _field = data_unit_size.as_mut();
337
338            ::fidl_next::Decode::decode(data_unit_size.as_mut(), decoder_, ())?;
339
340            Ok(())
341        }
342    }
343
344    impl<'de> ::fidl_next::IntoNatural for DeviceProgramKeyRequest<'de> {
345        type Natural = crate::natural::DeviceProgramKeyRequest;
346    }
347
348    /// The wire type corresponding to [`DeviceDeriveRawSecretRequest`].
349    #[derive(Debug)]
350    #[repr(C)]
351    pub struct DeviceDeriveRawSecretRequest<'de> {
352        pub wrapped_key: ::fidl_next::wire::Vector<'de, u8>,
353    }
354
355    static_assertions::const_assert_eq!(
356        std::mem::size_of::<DeviceDeriveRawSecretRequest<'_>>(),
357        16
358    );
359    static_assertions::const_assert_eq!(
360        std::mem::align_of::<DeviceDeriveRawSecretRequest<'_>>(),
361        8
362    );
363
364    static_assertions::const_assert_eq!(
365        std::mem::offset_of!(DeviceDeriveRawSecretRequest<'_>, wrapped_key),
366        0
367    );
368
369    impl ::fidl_next::Constrained for DeviceDeriveRawSecretRequest<'_> {
370        type Constraint = ();
371
372        fn validate(
373            _: ::fidl_next::Slot<'_, Self>,
374            _: Self::Constraint,
375        ) -> Result<(), ::fidl_next::ValidationError> {
376            Ok(())
377        }
378    }
379
380    unsafe impl ::fidl_next::Wire for DeviceDeriveRawSecretRequest<'static> {
381        type Narrowed<'de> = DeviceDeriveRawSecretRequest<'de>;
382
383        #[inline]
384        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
385            ::fidl_next::munge! {
386                let Self {
387                    wrapped_key,
388
389                } = &mut *out_;
390            }
391
392            ::fidl_next::Wire::zero_padding(wrapped_key);
393        }
394    }
395
396    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceDeriveRawSecretRequest<'de>
397    where
398        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
399        ___D: ::fidl_next::Decoder<'de>,
400        ___D: ::fidl_next::fuchsia::HandleDecoder,
401    {
402        fn decode(
403            slot_: ::fidl_next::Slot<'_, Self>,
404            decoder_: &mut ___D,
405            _: (),
406        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
407            ::fidl_next::munge! {
408                let Self {
409                    mut wrapped_key,
410
411                } = slot_;
412            }
413
414            let _field = wrapped_key.as_mut();
415            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
416            ::fidl_next::Decode::decode(wrapped_key.as_mut(), decoder_, (4294967295, ()))?;
417
418            Ok(())
419        }
420    }
421
422    impl<'de> ::fidl_next::IntoNatural for DeviceDeriveRawSecretRequest<'de> {
423        type Natural = crate::natural::DeviceDeriveRawSecretRequest;
424    }
425
426    /// The wire type corresponding to [`DeviceDeriveRawSecretResponse`].
427    #[derive(Debug)]
428    #[repr(C)]
429    pub struct DeviceDeriveRawSecretResponse<'de> {
430        pub secret: ::fidl_next::wire::Vector<'de, u8>,
431    }
432
433    static_assertions::const_assert_eq!(
434        std::mem::size_of::<DeviceDeriveRawSecretResponse<'_>>(),
435        16
436    );
437    static_assertions::const_assert_eq!(
438        std::mem::align_of::<DeviceDeriveRawSecretResponse<'_>>(),
439        8
440    );
441
442    static_assertions::const_assert_eq!(
443        std::mem::offset_of!(DeviceDeriveRawSecretResponse<'_>, secret),
444        0
445    );
446
447    impl ::fidl_next::Constrained for DeviceDeriveRawSecretResponse<'_> {
448        type Constraint = ();
449
450        fn validate(
451            _: ::fidl_next::Slot<'_, Self>,
452            _: Self::Constraint,
453        ) -> Result<(), ::fidl_next::ValidationError> {
454            Ok(())
455        }
456    }
457
458    unsafe impl ::fidl_next::Wire for DeviceDeriveRawSecretResponse<'static> {
459        type Narrowed<'de> = DeviceDeriveRawSecretResponse<'de>;
460
461        #[inline]
462        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
463            ::fidl_next::munge! {
464                let Self {
465                    secret,
466
467                } = &mut *out_;
468            }
469
470            ::fidl_next::Wire::zero_padding(secret);
471        }
472    }
473
474    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceDeriveRawSecretResponse<'de>
475    where
476        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
477        ___D: ::fidl_next::Decoder<'de>,
478        ___D: ::fidl_next::fuchsia::HandleDecoder,
479    {
480        fn decode(
481            slot_: ::fidl_next::Slot<'_, Self>,
482            decoder_: &mut ___D,
483            _: (),
484        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
485            ::fidl_next::munge! {
486                let Self {
487                    mut secret,
488
489                } = slot_;
490            }
491
492            let _field = secret.as_mut();
493            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
494            ::fidl_next::Decode::decode(secret.as_mut(), decoder_, (4294967295, ()))?;
495
496            Ok(())
497        }
498    }
499
500    impl<'de> ::fidl_next::IntoNatural for DeviceDeriveRawSecretResponse<'de> {
501        type Natural = crate::natural::DeviceDeriveRawSecretResponse;
502    }
503}
504
505pub mod wire_optional {
506
507    pub use fidl_next_common_fuchsia_hardware_inlineencryption::wire_optional::*;
508}
509
510pub mod generic {
511
512    pub use fidl_next_common_fuchsia_hardware_inlineencryption::generic::*;
513
514    /// The generic type corresponding to [`DeviceProgramKeyRequest`].
515    pub struct DeviceProgramKeyRequest<T0, T1> {
516        pub wrapped_key: T0,
517
518        pub data_unit_size: T1,
519    }
520
521    unsafe impl<___E, T0, T1>
522        ::fidl_next::Encode<crate::wire::DeviceProgramKeyRequest<'static>, ___E>
523        for DeviceProgramKeyRequest<T0, T1>
524    where
525        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
526        ___E: ::fidl_next::Encoder,
527        ___E: ::fidl_next::fuchsia::HandleEncoder,
528        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
529        T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
530    {
531        #[inline]
532        fn encode(
533            self,
534            encoder_: &mut ___E,
535            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceProgramKeyRequest<'static>>,
536            _: (),
537        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
538            ::fidl_next::munge! {
539                let crate::wire::DeviceProgramKeyRequest {
540                    wrapped_key,
541                    data_unit_size,
542
543                } = out_;
544            }
545
546            ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
547
548            ::fidl_next::Encode::encode(self.data_unit_size, encoder_, data_unit_size, ())?;
549
550            Ok(())
551        }
552    }
553
554    /// The generic type corresponding to [`DeviceDeriveRawSecretRequest`].
555    pub struct DeviceDeriveRawSecretRequest<T0> {
556        pub wrapped_key: T0,
557    }
558
559    unsafe impl<___E, T0>
560        ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretRequest<'static>, ___E>
561        for DeviceDeriveRawSecretRequest<T0>
562    where
563        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
564        ___E: ::fidl_next::Encoder,
565        ___E: ::fidl_next::fuchsia::HandleEncoder,
566        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
567    {
568        #[inline]
569        fn encode(
570            self,
571            encoder_: &mut ___E,
572            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceDeriveRawSecretRequest<'static>>,
573            _: (),
574        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
575            ::fidl_next::munge! {
576                let crate::wire::DeviceDeriveRawSecretRequest {
577                    wrapped_key,
578
579                } = out_;
580            }
581
582            ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
583
584            Ok(())
585        }
586    }
587
588    /// The generic type corresponding to [`DeviceDeriveRawSecretResponse`].
589    pub struct DeviceDeriveRawSecretResponse<T0> {
590        pub secret: T0,
591    }
592
593    unsafe impl<___E, T0>
594        ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretResponse<'static>, ___E>
595        for DeviceDeriveRawSecretResponse<T0>
596    where
597        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
598        ___E: ::fidl_next::Encoder,
599        ___E: ::fidl_next::fuchsia::HandleEncoder,
600        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
601    {
602        #[inline]
603        fn encode(
604            self,
605            encoder_: &mut ___E,
606            out_: &mut ::core::mem::MaybeUninit<
607                crate::wire::DeviceDeriveRawSecretResponse<'static>,
608            >,
609            _: (),
610        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
611            ::fidl_next::munge! {
612                let crate::wire::DeviceDeriveRawSecretResponse {
613                    secret,
614
615                } = out_;
616            }
617
618            ::fidl_next::Encode::encode(self.secret, encoder_, secret, (4294967295, ()))?;
619
620            Ok(())
621        }
622    }
623}
624
625pub use self::natural::*;
626
627/// The type corresponding to the Device protocol.
628#[derive(PartialEq, Debug)]
629pub struct Device;
630
631impl ::fidl_next::Discoverable for Device {
632    const PROTOCOL_NAME: &'static str = "fuchsia.hardware.inlineencryption.Device";
633}
634
635#[cfg(target_os = "fuchsia")]
636impl ::fidl_next::HasTransport for Device {
637    type Transport = ::fidl_next::fuchsia::zx::Channel;
638}
639
640pub mod device {
641    pub mod prelude {
642        pub use crate::{
643            Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
644            DeviceServerHandler, device,
645        };
646
647        pub use crate::natural::DeviceDeriveRawSecretRequest;
648
649        pub use crate::natural::DeviceProgramKeyRequest;
650
651        pub use crate::natural::DeviceDeriveRawSecretResponse;
652
653        pub use crate::natural::DeviceProgramKeyResponse;
654    }
655
656    pub struct ProgramKey;
657
658    impl ::fidl_next::Method for ProgramKey {
659        const ORDINAL: u64 = 3476811648835288272;
660        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
661            ::fidl_next::protocol::Flexibility::Strict;
662
663        type Protocol = crate::Device;
664
665        type Request = crate::wire::DeviceProgramKeyRequest<'static>;
666    }
667
668    impl ::fidl_next::TwoWayMethod for ProgramKey {
669        type Response = ::fidl_next::wire::Result<
670            'static,
671            crate::wire::DeviceProgramKeyResponse,
672            ::fidl_next::wire::Int32,
673        >;
674    }
675
676    impl<___R> ::fidl_next::Respond<___R> for ProgramKey {
677        type Output = ::core::result::Result<
678            crate::generic::DeviceProgramKeyResponse<___R>,
679            ::fidl_next::util::Never,
680        >;
681
682        fn respond(response: ___R) -> Self::Output {
683            ::core::result::Result::Ok(crate::generic::DeviceProgramKeyResponse { slot: response })
684        }
685    }
686
687    impl<___R> ::fidl_next::RespondErr<___R> for ProgramKey {
688        type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
689
690        fn respond_err(response: ___R) -> Self::Output {
691            ::core::result::Result::Err(response)
692        }
693    }
694
695    pub struct DeriveRawSecret;
696
697    impl ::fidl_next::Method for DeriveRawSecret {
698        const ORDINAL: u64 = 6941052927753550292;
699        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
700            ::fidl_next::protocol::Flexibility::Strict;
701
702        type Protocol = crate::Device;
703
704        type Request = crate::wire::DeviceDeriveRawSecretRequest<'static>;
705    }
706
707    impl ::fidl_next::TwoWayMethod for DeriveRawSecret {
708        type Response = ::fidl_next::wire::Result<
709            'static,
710            crate::wire::DeviceDeriveRawSecretResponse<'static>,
711            ::fidl_next::wire::Int32,
712        >;
713    }
714
715    impl<___R> ::fidl_next::Respond<___R> for DeriveRawSecret {
716        type Output = ::core::result::Result<
717            crate::generic::DeviceDeriveRawSecretResponse<___R>,
718            ::fidl_next::util::Never,
719        >;
720
721        fn respond(response: ___R) -> Self::Output {
722            ::core::result::Result::Ok(crate::generic::DeviceDeriveRawSecretResponse {
723                secret: response,
724            })
725        }
726    }
727
728    impl<___R> ::fidl_next::RespondErr<___R> for DeriveRawSecret {
729        type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
730
731        fn respond_err(response: ___R) -> Self::Output {
732            ::core::result::Result::Err(response)
733        }
734    }
735
736    mod ___detail {
737        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
738        where
739            ___T: ::fidl_next::Transport,
740        {
741            type Client = DeviceClient<___T>;
742            type Server = DeviceServer<___T>;
743        }
744
745        /// The client for the `Device` protocol.
746        #[repr(transparent)]
747        pub struct DeviceClient<___T: ::fidl_next::Transport> {
748            #[allow(dead_code)]
749            client: ::fidl_next::protocol::Client<___T>,
750        }
751
752        impl<___T> DeviceClient<___T>
753        where
754            ___T: ::fidl_next::Transport,
755        {
756            #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available `slot`. All slots programmed via the connection this method is called on\n will be evicted once the connection is dropped. It is not possible to evict individual keys\n (not for any technical reasons; a need for this has not yet arisen). `wrapped_key` must be\n a key wrapped by the inline encryption hardware (in the same session/boot) via a separate\n mechanism to this protocol.\n\n Returns\n - ZX_ERR_NO_RESOURCES if there are no available key slots.\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
757            pub fn program_key(
758                &self,
759
760                wrapped_key: impl ::fidl_next::Encode<
761                    ::fidl_next::wire::Vector<'static, u8>,
762                    <___T as ::fidl_next::Transport>::SendBuffer,
763                >,
764
765                data_unit_size: impl ::fidl_next::Encode<
766                    ::fidl_next::wire::Uint32,
767                    <___T as ::fidl_next::Transport>::SendBuffer,
768                >,
769            ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKey, ___T>
770            where
771                <___T as ::fidl_next::Transport>::SendBuffer:
772                    ::fidl_next::encoder::InternalHandleEncoder,
773                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
774                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
775            {
776                self.program_key_with(crate::generic::DeviceProgramKeyRequest {
777                    wrapped_key,
778
779                    data_unit_size,
780                })
781            }
782
783            #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available `slot`. All slots programmed via the connection this method is called on\n will be evicted once the connection is dropped. It is not possible to evict individual keys\n (not for any technical reasons; a need for this has not yet arisen). `wrapped_key` must be\n a key wrapped by the inline encryption hardware (in the same session/boot) via a separate\n mechanism to this protocol.\n\n Returns\n - ZX_ERR_NO_RESOURCES if there are no available key slots.\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
784            pub fn program_key_with<___R>(
785                &self,
786                request: ___R,
787            ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKey, ___T>
788            where
789                ___R: ::fidl_next::Encode<
790                        crate::wire::DeviceProgramKeyRequest<'static>,
791                        <___T as ::fidl_next::Transport>::SendBuffer,
792                    >,
793            {
794                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
795                    3476811648835288272,
796                    <super::ProgramKey as ::fidl_next::Method>::FLEXIBILITY,
797                    request,
798                ))
799            }
800
801            #[doc = " Derives a raw software secret from the ephemerally wrapped `wrapped_key`. `wrapped_key`\n must be a key wrapped by the inline encryption hardware (in the same session/boot) via a\n separate mechanism to this protocol. The returned secret can be used for non-inline\n cryptographic operations e.g. it can be used for encrypting filesystem metadata not covered\n by inline encryption.\n Returns\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
802            pub fn derive_raw_secret(
803                &self,
804
805                wrapped_key: impl ::fidl_next::Encode<
806                    ::fidl_next::wire::Vector<'static, u8>,
807                    <___T as ::fidl_next::Transport>::SendBuffer,
808                >,
809            ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
810            where
811                <___T as ::fidl_next::Transport>::SendBuffer:
812                    ::fidl_next::encoder::InternalHandleEncoder,
813                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
814                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
815            {
816                self.derive_raw_secret_with(crate::generic::DeviceDeriveRawSecretRequest {
817                    wrapped_key,
818                })
819            }
820
821            #[doc = " Derives a raw software secret from the ephemerally wrapped `wrapped_key`. `wrapped_key`\n must be a key wrapped by the inline encryption hardware (in the same session/boot) via a\n separate mechanism to this protocol. The returned secret can be used for non-inline\n cryptographic operations e.g. it can be used for encrypting filesystem metadata not covered\n by inline encryption.\n Returns\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
822            pub fn derive_raw_secret_with<___R>(
823                &self,
824                request: ___R,
825            ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
826            where
827                ___R: ::fidl_next::Encode<
828                        crate::wire::DeviceDeriveRawSecretRequest<'static>,
829                        <___T as ::fidl_next::Transport>::SendBuffer,
830                    >,
831            {
832                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
833                    6941052927753550292,
834                    <super::DeriveRawSecret as ::fidl_next::Method>::FLEXIBILITY,
835                    request,
836                ))
837            }
838        }
839
840        /// The server for the `Device` protocol.
841        #[repr(transparent)]
842        pub struct DeviceServer<___T: ::fidl_next::Transport> {
843            server: ::fidl_next::protocol::Server<___T>,
844        }
845
846        impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
847    }
848}
849
850#[diagnostic::on_unimplemented(
851    note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
852)]
853
854/// A client handler for the Device protocol.
855///
856/// See [`Device`] for more details.
857pub trait DeviceLocalClientHandler<
858    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
859    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
860>
861{
862}
863
864impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
865where
866    ___H: DeviceLocalClientHandler<___T>,
867    ___T: ::fidl_next::Transport,
868{
869    async fn on_event(
870        handler: &mut ___H,
871        ordinal: u64,
872        flexibility: ::fidl_next::protocol::Flexibility,
873        body: ::fidl_next::Body<___T>,
874    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
875        match ordinal {
876            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
877        }
878    }
879}
880
881#[diagnostic::on_unimplemented(
882    note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
883)]
884
885/// A server handler for the Device protocol.
886///
887/// See [`Device`] for more details.
888pub trait DeviceLocalServerHandler<
889    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
890    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
891>
892{
893    #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available `slot`. All slots programmed via the connection this method is called on\n will be evicted once the connection is dropped. It is not possible to evict individual keys\n (not for any technical reasons; a need for this has not yet arisen). `wrapped_key` must be\n a key wrapped by the inline encryption hardware (in the same session/boot) via a separate\n mechanism to this protocol.\n\n Returns\n - ZX_ERR_NO_RESOURCES if there are no available key slots.\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
894    fn program_key(
895        &mut self,
896
897        request: ::fidl_next::Request<device::ProgramKey, ___T>,
898
899        responder: ::fidl_next::Responder<device::ProgramKey, ___T>,
900    ) -> impl ::core::future::Future<Output = ()>;
901
902    #[doc = " Derives a raw software secret from the ephemerally wrapped `wrapped_key`. `wrapped_key`\n must be a key wrapped by the inline encryption hardware (in the same session/boot) via a\n separate mechanism to this protocol. The returned secret can be used for non-inline\n cryptographic operations e.g. it can be used for encrypting filesystem metadata not covered\n by inline encryption.\n Returns\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
903    fn derive_raw_secret(
904        &mut self,
905
906        request: ::fidl_next::Request<device::DeriveRawSecret, ___T>,
907
908        responder: ::fidl_next::Responder<device::DeriveRawSecret, ___T>,
909    ) -> impl ::core::future::Future<Output = ()>;
910}
911
912impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
913where
914    ___H: DeviceLocalServerHandler<___T>,
915    ___T: ::fidl_next::Transport,
916    for<'de> crate::wire::DeviceProgramKeyRequest<'de>: ::fidl_next::Decode<
917            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
918            Constraint = (),
919        >,
920    for<'de> crate::wire::DeviceDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
921            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
922            Constraint = (),
923        >,
924{
925    async fn on_one_way(
926        handler: &mut ___H,
927        ordinal: u64,
928        flexibility: ::fidl_next::protocol::Flexibility,
929        body: ::fidl_next::Body<___T>,
930    ) -> ::core::result::Result<
931        (),
932        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
933    > {
934        match ordinal {
935            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
936        }
937    }
938
939    async fn on_two_way(
940        handler: &mut ___H,
941        ordinal: u64,
942        flexibility: ::fidl_next::protocol::Flexibility,
943        body: ::fidl_next::Body<___T>,
944        responder: ::fidl_next::protocol::Responder<___T>,
945    ) -> ::core::result::Result<
946        (),
947        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
948    > {
949        match ordinal {
950            3476811648835288272 => {
951                let responder = ::fidl_next::Responder::from_untyped(responder);
952
953                match ::fidl_next::AsDecoderExt::into_decoded(body) {
954                    Ok(decoded) => {
955                        handler
956                            .program_key(::fidl_next::Request::from_decoded(decoded), responder)
957                            .await;
958                        Ok(())
959                    }
960                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
961                        ordinal: 3476811648835288272,
962                        error,
963                    }),
964                }
965            }
966
967            6941052927753550292 => {
968                let responder = ::fidl_next::Responder::from_untyped(responder);
969
970                match ::fidl_next::AsDecoderExt::into_decoded(body) {
971                    Ok(decoded) => {
972                        handler
973                            .derive_raw_secret(
974                                ::fidl_next::Request::from_decoded(decoded),
975                                responder,
976                            )
977                            .await;
978                        Ok(())
979                    }
980                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
981                        ordinal: 6941052927753550292,
982                        error,
983                    }),
984                }
985            }
986
987            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
988        }
989    }
990}
991
992/// A client handler for the Device protocol.
993///
994/// See [`Device`] for more details.
995pub trait DeviceClientHandler<
996    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
997    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
998>
999{
1000}
1001
1002impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
1003where
1004    ___H: DeviceClientHandler<___T> + ::core::marker::Send,
1005    ___T: ::fidl_next::Transport,
1006{
1007    async fn on_event(
1008        handler: &mut ___H,
1009        ordinal: u64,
1010        flexibility: ::fidl_next::protocol::Flexibility,
1011        body: ::fidl_next::Body<___T>,
1012    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1013        match ordinal {
1014            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1015        }
1016    }
1017}
1018
1019/// A server handler for the Device protocol.
1020///
1021/// See [`Device`] for more details.
1022pub trait DeviceServerHandler<
1023    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1024    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1025>
1026{
1027    #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available `slot`. All slots programmed via the connection this method is called on\n will be evicted once the connection is dropped. It is not possible to evict individual keys\n (not for any technical reasons; a need for this has not yet arisen). `wrapped_key` must be\n a key wrapped by the inline encryption hardware (in the same session/boot) via a separate\n mechanism to this protocol.\n\n Returns\n - ZX_ERR_NO_RESOURCES if there are no available key slots.\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1028    fn program_key(
1029        &mut self,
1030
1031        request: ::fidl_next::Request<device::ProgramKey, ___T>,
1032
1033        responder: ::fidl_next::Responder<device::ProgramKey, ___T>,
1034    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1035
1036    #[doc = " Derives a raw software secret from the ephemerally wrapped `wrapped_key`. `wrapped_key`\n must be a key wrapped by the inline encryption hardware (in the same session/boot) via a\n separate mechanism to this protocol. The returned secret can be used for non-inline\n cryptographic operations e.g. it can be used for encrypting filesystem metadata not covered\n by inline encryption.\n Returns\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1037    fn derive_raw_secret(
1038        &mut self,
1039
1040        request: ::fidl_next::Request<device::DeriveRawSecret, ___T>,
1041
1042        responder: ::fidl_next::Responder<device::DeriveRawSecret, ___T>,
1043    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1044}
1045
1046impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
1047where
1048    ___H: DeviceServerHandler<___T> + ::core::marker::Send,
1049    ___T: ::fidl_next::Transport,
1050    for<'de> crate::wire::DeviceProgramKeyRequest<'de>: ::fidl_next::Decode<
1051            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1052            Constraint = (),
1053        >,
1054    for<'de> crate::wire::DeviceDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
1055            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1056            Constraint = (),
1057        >,
1058{
1059    async fn on_one_way(
1060        handler: &mut ___H,
1061        ordinal: u64,
1062        flexibility: ::fidl_next::protocol::Flexibility,
1063        body: ::fidl_next::Body<___T>,
1064    ) -> ::core::result::Result<
1065        (),
1066        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1067    > {
1068        match ordinal {
1069            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1070        }
1071    }
1072
1073    async fn on_two_way(
1074        handler: &mut ___H,
1075        ordinal: u64,
1076        flexibility: ::fidl_next::protocol::Flexibility,
1077        body: ::fidl_next::Body<___T>,
1078        responder: ::fidl_next::protocol::Responder<___T>,
1079    ) -> ::core::result::Result<
1080        (),
1081        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1082    > {
1083        match ordinal {
1084            3476811648835288272 => {
1085                let responder = ::fidl_next::Responder::from_untyped(responder);
1086
1087                match ::fidl_next::AsDecoderExt::into_decoded(body) {
1088                    Ok(decoded) => {
1089                        handler
1090                            .program_key(::fidl_next::Request::from_decoded(decoded), responder)
1091                            .await;
1092                        Ok(())
1093                    }
1094                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1095                        ordinal: 3476811648835288272,
1096                        error,
1097                    }),
1098                }
1099            }
1100
1101            6941052927753550292 => {
1102                let responder = ::fidl_next::Responder::from_untyped(responder);
1103
1104                match ::fidl_next::AsDecoderExt::into_decoded(body) {
1105                    Ok(decoded) => {
1106                        handler
1107                            .derive_raw_secret(
1108                                ::fidl_next::Request::from_decoded(decoded),
1109                                responder,
1110                            )
1111                            .await;
1112                        Ok(())
1113                    }
1114                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1115                        ordinal: 6941052927753550292,
1116                        error,
1117                    }),
1118                }
1119            }
1120
1121            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1122        }
1123    }
1124}
1125
1126impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
1127{}
1128
1129impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
1130where
1131    ___H: DeviceClientHandler<___T>,
1132    ___T: ::fidl_next::Transport,
1133{
1134}
1135
1136impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
1137where
1138    ___H: DeviceServerHandler<___T>,
1139    ___T: ::fidl_next::Transport,
1140{
1141    async fn program_key(
1142        &mut self,
1143
1144        request: ::fidl_next::Request<device::ProgramKey, ___T>,
1145
1146        responder: ::fidl_next::Responder<device::ProgramKey, ___T>,
1147    ) {
1148        ___H::program_key(&mut self.0, request, responder).await
1149    }
1150
1151    async fn derive_raw_secret(
1152        &mut self,
1153
1154        request: ::fidl_next::Request<device::DeriveRawSecret, ___T>,
1155
1156        responder: ::fidl_next::Responder<device::DeriveRawSecret, ___T>,
1157    ) {
1158        ___H::derive_raw_secret(&mut self.0, request, responder).await
1159    }
1160}
1161
1162/// The type corresponding to the DriverDevice protocol.
1163#[doc = " A driver transport variant of the `Device` protocol.\n"]
1164#[derive(PartialEq, Debug)]
1165pub struct DriverDevice;
1166
1167impl ::fidl_next::Discoverable for DriverDevice {
1168    const PROTOCOL_NAME: &'static str = "fuchsia.hardware.inlineencryption.DriverDevice";
1169}
1170
1171#[cfg(feature = "driver")]
1172impl ::fidl_next::HasTransport for DriverDevice {
1173    type Transport = ::fdf_fidl::DriverChannel;
1174}
1175
1176pub mod driver_device {
1177    pub mod prelude {
1178        pub use crate::{
1179            DriverDevice, DriverDeviceClientHandler, DriverDeviceLocalClientHandler,
1180            DriverDeviceLocalServerHandler, DriverDeviceServerHandler, driver_device,
1181        };
1182
1183        pub use crate::natural::DeviceDeriveRawSecretRequest;
1184
1185        pub use crate::natural::DeviceProgramKeyRequest;
1186
1187        pub use crate::natural::DeviceDeriveRawSecretResponse;
1188
1189        pub use crate::natural::DeviceProgramKeyResponse;
1190    }
1191
1192    pub struct ProgramKey;
1193
1194    impl ::fidl_next::Method for ProgramKey {
1195        const ORDINAL: u64 = 3476811648835288272;
1196        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1197            ::fidl_next::protocol::Flexibility::Strict;
1198
1199        type Protocol = crate::DriverDevice;
1200
1201        type Request = crate::wire::DeviceProgramKeyRequest<'static>;
1202    }
1203
1204    impl ::fidl_next::TwoWayMethod for ProgramKey {
1205        type Response = ::fidl_next::wire::Result<
1206            'static,
1207            crate::wire::DeviceProgramKeyResponse,
1208            ::fidl_next::wire::Int32,
1209        >;
1210    }
1211
1212    impl<___R> ::fidl_next::Respond<___R> for ProgramKey {
1213        type Output = ::core::result::Result<
1214            crate::generic::DeviceProgramKeyResponse<___R>,
1215            ::fidl_next::util::Never,
1216        >;
1217
1218        fn respond(response: ___R) -> Self::Output {
1219            ::core::result::Result::Ok(crate::generic::DeviceProgramKeyResponse { slot: response })
1220        }
1221    }
1222
1223    impl<___R> ::fidl_next::RespondErr<___R> for ProgramKey {
1224        type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
1225
1226        fn respond_err(response: ___R) -> Self::Output {
1227            ::core::result::Result::Err(response)
1228        }
1229    }
1230
1231    pub struct DeriveRawSecret;
1232
1233    impl ::fidl_next::Method for DeriveRawSecret {
1234        const ORDINAL: u64 = 6941052927753550292;
1235        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1236            ::fidl_next::protocol::Flexibility::Strict;
1237
1238        type Protocol = crate::DriverDevice;
1239
1240        type Request = crate::wire::DeviceDeriveRawSecretRequest<'static>;
1241    }
1242
1243    impl ::fidl_next::TwoWayMethod for DeriveRawSecret {
1244        type Response = ::fidl_next::wire::Result<
1245            'static,
1246            crate::wire::DeviceDeriveRawSecretResponse<'static>,
1247            ::fidl_next::wire::Int32,
1248        >;
1249    }
1250
1251    impl<___R> ::fidl_next::Respond<___R> for DeriveRawSecret {
1252        type Output = ::core::result::Result<
1253            crate::generic::DeviceDeriveRawSecretResponse<___R>,
1254            ::fidl_next::util::Never,
1255        >;
1256
1257        fn respond(response: ___R) -> Self::Output {
1258            ::core::result::Result::Ok(crate::generic::DeviceDeriveRawSecretResponse {
1259                secret: response,
1260            })
1261        }
1262    }
1263
1264    impl<___R> ::fidl_next::RespondErr<___R> for DeriveRawSecret {
1265        type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
1266
1267        fn respond_err(response: ___R) -> Self::Output {
1268            ::core::result::Result::Err(response)
1269        }
1270    }
1271
1272    mod ___detail {
1273        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::DriverDevice
1274        where
1275            ___T: ::fidl_next::Transport,
1276        {
1277            type Client = DriverDeviceClient<___T>;
1278            type Server = DriverDeviceServer<___T>;
1279        }
1280
1281        /// The client for the `DriverDevice` protocol.
1282        #[repr(transparent)]
1283        pub struct DriverDeviceClient<___T: ::fidl_next::Transport> {
1284            #[allow(dead_code)]
1285            client: ::fidl_next::protocol::Client<___T>,
1286        }
1287
1288        impl<___T> DriverDeviceClient<___T>
1289        where
1290            ___T: ::fidl_next::Transport,
1291        {
1292            #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available `slot`. All slots programmed via the connection this method is called on\n will be evicted once the connection is dropped. It is not possible to evict individual keys\n (not for any technical reasons; a need for this has not yet arisen). `wrapped_key` must be\n a key wrapped by the inline encryption hardware (in the same session/boot) via a separate\n mechanism to this protocol.\n\n Returns\n - ZX_ERR_NO_RESOURCES if there are no available key slots.\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1293            pub fn program_key(
1294                &self,
1295
1296                wrapped_key: impl ::fidl_next::Encode<
1297                    ::fidl_next::wire::Vector<'static, u8>,
1298                    <___T as ::fidl_next::Transport>::SendBuffer,
1299                >,
1300
1301                data_unit_size: impl ::fidl_next::Encode<
1302                    ::fidl_next::wire::Uint32,
1303                    <___T as ::fidl_next::Transport>::SendBuffer,
1304                >,
1305            ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKey, ___T>
1306            where
1307                <___T as ::fidl_next::Transport>::SendBuffer:
1308                    ::fidl_next::encoder::InternalHandleEncoder,
1309                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1310                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1311            {
1312                self.program_key_with(crate::generic::DeviceProgramKeyRequest {
1313                    wrapped_key,
1314
1315                    data_unit_size,
1316                })
1317            }
1318
1319            #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available `slot`. All slots programmed via the connection this method is called on\n will be evicted once the connection is dropped. It is not possible to evict individual keys\n (not for any technical reasons; a need for this has not yet arisen). `wrapped_key` must be\n a key wrapped by the inline encryption hardware (in the same session/boot) via a separate\n mechanism to this protocol.\n\n Returns\n - ZX_ERR_NO_RESOURCES if there are no available key slots.\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1320            pub fn program_key_with<___R>(
1321                &self,
1322                request: ___R,
1323            ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKey, ___T>
1324            where
1325                ___R: ::fidl_next::Encode<
1326                        crate::wire::DeviceProgramKeyRequest<'static>,
1327                        <___T as ::fidl_next::Transport>::SendBuffer,
1328                    >,
1329            {
1330                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1331                    3476811648835288272,
1332                    <super::ProgramKey as ::fidl_next::Method>::FLEXIBILITY,
1333                    request,
1334                ))
1335            }
1336
1337            #[doc = " Derives a raw software secret from the ephemerally wrapped `wrapped_key`. `wrapped_key`\n must be a key wrapped by the inline encryption hardware (in the same session/boot) via a\n separate mechanism to this protocol. The returned secret can be used for non-inline\n cryptographic operations e.g. it can be used for encrypting filesystem metadata not covered\n by inline encryption.\n Returns\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1338            pub fn derive_raw_secret(
1339                &self,
1340
1341                wrapped_key: impl ::fidl_next::Encode<
1342                    ::fidl_next::wire::Vector<'static, u8>,
1343                    <___T as ::fidl_next::Transport>::SendBuffer,
1344                >,
1345            ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
1346            where
1347                <___T as ::fidl_next::Transport>::SendBuffer:
1348                    ::fidl_next::encoder::InternalHandleEncoder,
1349                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1350                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1351            {
1352                self.derive_raw_secret_with(crate::generic::DeviceDeriveRawSecretRequest {
1353                    wrapped_key,
1354                })
1355            }
1356
1357            #[doc = " Derives a raw software secret from the ephemerally wrapped `wrapped_key`. `wrapped_key`\n must be a key wrapped by the inline encryption hardware (in the same session/boot) via a\n separate mechanism to this protocol. The returned secret can be used for non-inline\n cryptographic operations e.g. it can be used for encrypting filesystem metadata not covered\n by inline encryption.\n Returns\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1358            pub fn derive_raw_secret_with<___R>(
1359                &self,
1360                request: ___R,
1361            ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
1362            where
1363                ___R: ::fidl_next::Encode<
1364                        crate::wire::DeviceDeriveRawSecretRequest<'static>,
1365                        <___T as ::fidl_next::Transport>::SendBuffer,
1366                    >,
1367            {
1368                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1369                    6941052927753550292,
1370                    <super::DeriveRawSecret as ::fidl_next::Method>::FLEXIBILITY,
1371                    request,
1372                ))
1373            }
1374        }
1375
1376        /// The server for the `DriverDevice` protocol.
1377        #[repr(transparent)]
1378        pub struct DriverDeviceServer<___T: ::fidl_next::Transport> {
1379            server: ::fidl_next::protocol::Server<___T>,
1380        }
1381
1382        impl<___T> DriverDeviceServer<___T> where ___T: ::fidl_next::Transport {}
1383    }
1384}
1385
1386#[diagnostic::on_unimplemented(
1387    note = "If {Self} implements the non-local DriverDeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1388)]
1389
1390/// A client handler for the DriverDevice protocol.
1391///
1392/// See [`DriverDevice`] for more details.
1393pub trait DriverDeviceLocalClientHandler<
1394    #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
1395    #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
1396>
1397{
1398}
1399
1400impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for DriverDevice
1401where
1402    ___H: DriverDeviceLocalClientHandler<___T>,
1403    ___T: ::fidl_next::Transport,
1404{
1405    async fn on_event(
1406        handler: &mut ___H,
1407        ordinal: u64,
1408        flexibility: ::fidl_next::protocol::Flexibility,
1409        body: ::fidl_next::Body<___T>,
1410    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1411        match ordinal {
1412            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1413        }
1414    }
1415}
1416
1417#[diagnostic::on_unimplemented(
1418    note = "If {Self} implements the non-local DriverDeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1419)]
1420
1421/// A server handler for the DriverDevice protocol.
1422///
1423/// See [`DriverDevice`] for more details.
1424pub trait DriverDeviceLocalServerHandler<
1425    #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
1426    #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
1427>
1428{
1429    #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available `slot`. All slots programmed via the connection this method is called on\n will be evicted once the connection is dropped. It is not possible to evict individual keys\n (not for any technical reasons; a need for this has not yet arisen). `wrapped_key` must be\n a key wrapped by the inline encryption hardware (in the same session/boot) via a separate\n mechanism to this protocol.\n\n Returns\n - ZX_ERR_NO_RESOURCES if there are no available key slots.\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1430    fn program_key(
1431        &mut self,
1432
1433        request: ::fidl_next::Request<driver_device::ProgramKey, ___T>,
1434
1435        responder: ::fidl_next::Responder<driver_device::ProgramKey, ___T>,
1436    ) -> impl ::core::future::Future<Output = ()>;
1437
1438    #[doc = " Derives a raw software secret from the ephemerally wrapped `wrapped_key`. `wrapped_key`\n must be a key wrapped by the inline encryption hardware (in the same session/boot) via a\n separate mechanism to this protocol. The returned secret can be used for non-inline\n cryptographic operations e.g. it can be used for encrypting filesystem metadata not covered\n by inline encryption.\n Returns\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1439    fn derive_raw_secret(
1440        &mut self,
1441
1442        request: ::fidl_next::Request<driver_device::DeriveRawSecret, ___T>,
1443
1444        responder: ::fidl_next::Responder<driver_device::DeriveRawSecret, ___T>,
1445    ) -> impl ::core::future::Future<Output = ()>;
1446}
1447
1448impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for DriverDevice
1449where
1450    ___H: DriverDeviceLocalServerHandler<___T>,
1451    ___T: ::fidl_next::Transport,
1452    for<'de> crate::wire::DeviceProgramKeyRequest<'de>: ::fidl_next::Decode<
1453            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1454            Constraint = (),
1455        >,
1456    for<'de> crate::wire::DeviceDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
1457            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1458            Constraint = (),
1459        >,
1460{
1461    async fn on_one_way(
1462        handler: &mut ___H,
1463        ordinal: u64,
1464        flexibility: ::fidl_next::protocol::Flexibility,
1465        body: ::fidl_next::Body<___T>,
1466    ) -> ::core::result::Result<
1467        (),
1468        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1469    > {
1470        match ordinal {
1471            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1472        }
1473    }
1474
1475    async fn on_two_way(
1476        handler: &mut ___H,
1477        ordinal: u64,
1478        flexibility: ::fidl_next::protocol::Flexibility,
1479        body: ::fidl_next::Body<___T>,
1480        responder: ::fidl_next::protocol::Responder<___T>,
1481    ) -> ::core::result::Result<
1482        (),
1483        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1484    > {
1485        match ordinal {
1486            3476811648835288272 => {
1487                let responder = ::fidl_next::Responder::from_untyped(responder);
1488
1489                match ::fidl_next::AsDecoderExt::into_decoded(body) {
1490                    Ok(decoded) => {
1491                        handler
1492                            .program_key(::fidl_next::Request::from_decoded(decoded), responder)
1493                            .await;
1494                        Ok(())
1495                    }
1496                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1497                        ordinal: 3476811648835288272,
1498                        error,
1499                    }),
1500                }
1501            }
1502
1503            6941052927753550292 => {
1504                let responder = ::fidl_next::Responder::from_untyped(responder);
1505
1506                match ::fidl_next::AsDecoderExt::into_decoded(body) {
1507                    Ok(decoded) => {
1508                        handler
1509                            .derive_raw_secret(
1510                                ::fidl_next::Request::from_decoded(decoded),
1511                                responder,
1512                            )
1513                            .await;
1514                        Ok(())
1515                    }
1516                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1517                        ordinal: 6941052927753550292,
1518                        error,
1519                    }),
1520                }
1521            }
1522
1523            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1524        }
1525    }
1526}
1527
1528/// A client handler for the DriverDevice protocol.
1529///
1530/// See [`DriverDevice`] for more details.
1531pub trait DriverDeviceClientHandler<
1532    #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
1533    #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
1534>
1535{
1536}
1537
1538impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for DriverDevice
1539where
1540    ___H: DriverDeviceClientHandler<___T> + ::core::marker::Send,
1541    ___T: ::fidl_next::Transport,
1542{
1543    async fn on_event(
1544        handler: &mut ___H,
1545        ordinal: u64,
1546        flexibility: ::fidl_next::protocol::Flexibility,
1547        body: ::fidl_next::Body<___T>,
1548    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1549        match ordinal {
1550            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1551        }
1552    }
1553}
1554
1555/// A server handler for the DriverDevice protocol.
1556///
1557/// See [`DriverDevice`] for more details.
1558pub trait DriverDeviceServerHandler<
1559    #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
1560    #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
1561>
1562{
1563    #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available `slot`. All slots programmed via the connection this method is called on\n will be evicted once the connection is dropped. It is not possible to evict individual keys\n (not for any technical reasons; a need for this has not yet arisen). `wrapped_key` must be\n a key wrapped by the inline encryption hardware (in the same session/boot) via a separate\n mechanism to this protocol.\n\n Returns\n - ZX_ERR_NO_RESOURCES if there are no available key slots.\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1564    fn program_key(
1565        &mut self,
1566
1567        request: ::fidl_next::Request<driver_device::ProgramKey, ___T>,
1568
1569        responder: ::fidl_next::Responder<driver_device::ProgramKey, ___T>,
1570    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1571
1572    #[doc = " Derives a raw software secret from the ephemerally wrapped `wrapped_key`. `wrapped_key`\n must be a key wrapped by the inline encryption hardware (in the same session/boot) via a\n separate mechanism to this protocol. The returned secret can be used for non-inline\n cryptographic operations e.g. it can be used for encrypting filesystem metadata not covered\n by inline encryption.\n Returns\n - ZX_ERR_INVALID_ARGS if `wrapped_key` is not the expected size or if the `wrapped_key`\n   fails authentication (e.g. wrapped_key is from a previous boot).\n - ZX_ERR_TIMED_OUT if the operation times out.\n - ZX_ERR_INTERNAL if the operation failed for any other reason.\n"]
1573    fn derive_raw_secret(
1574        &mut self,
1575
1576        request: ::fidl_next::Request<driver_device::DeriveRawSecret, ___T>,
1577
1578        responder: ::fidl_next::Responder<driver_device::DeriveRawSecret, ___T>,
1579    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1580}
1581
1582impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for DriverDevice
1583where
1584    ___H: DriverDeviceServerHandler<___T> + ::core::marker::Send,
1585    ___T: ::fidl_next::Transport,
1586    for<'de> crate::wire::DeviceProgramKeyRequest<'de>: ::fidl_next::Decode<
1587            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1588            Constraint = (),
1589        >,
1590    for<'de> crate::wire::DeviceDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
1591            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1592            Constraint = (),
1593        >,
1594{
1595    async fn on_one_way(
1596        handler: &mut ___H,
1597        ordinal: u64,
1598        flexibility: ::fidl_next::protocol::Flexibility,
1599        body: ::fidl_next::Body<___T>,
1600    ) -> ::core::result::Result<
1601        (),
1602        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1603    > {
1604        match ordinal {
1605            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1606        }
1607    }
1608
1609    async fn on_two_way(
1610        handler: &mut ___H,
1611        ordinal: u64,
1612        flexibility: ::fidl_next::protocol::Flexibility,
1613        body: ::fidl_next::Body<___T>,
1614        responder: ::fidl_next::protocol::Responder<___T>,
1615    ) -> ::core::result::Result<
1616        (),
1617        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1618    > {
1619        match ordinal {
1620            3476811648835288272 => {
1621                let responder = ::fidl_next::Responder::from_untyped(responder);
1622
1623                match ::fidl_next::AsDecoderExt::into_decoded(body) {
1624                    Ok(decoded) => {
1625                        handler
1626                            .program_key(::fidl_next::Request::from_decoded(decoded), responder)
1627                            .await;
1628                        Ok(())
1629                    }
1630                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1631                        ordinal: 3476811648835288272,
1632                        error,
1633                    }),
1634                }
1635            }
1636
1637            6941052927753550292 => {
1638                let responder = ::fidl_next::Responder::from_untyped(responder);
1639
1640                match ::fidl_next::AsDecoderExt::into_decoded(body) {
1641                    Ok(decoded) => {
1642                        handler
1643                            .derive_raw_secret(
1644                                ::fidl_next::Request::from_decoded(decoded),
1645                                responder,
1646                            )
1647                            .await;
1648                        Ok(())
1649                    }
1650                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1651                        ordinal: 6941052927753550292,
1652                        error,
1653                    }),
1654                }
1655            }
1656
1657            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1658        }
1659    }
1660}
1661
1662impl<___T> DriverDeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where
1663    ___T: ::fidl_next::Transport
1664{
1665}
1666
1667impl<___H, ___T> DriverDeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
1668where
1669    ___H: DriverDeviceClientHandler<___T>,
1670    ___T: ::fidl_next::Transport,
1671{
1672}
1673
1674impl<___H, ___T> DriverDeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
1675where
1676    ___H: DriverDeviceServerHandler<___T>,
1677    ___T: ::fidl_next::Transport,
1678{
1679    async fn program_key(
1680        &mut self,
1681
1682        request: ::fidl_next::Request<driver_device::ProgramKey, ___T>,
1683
1684        responder: ::fidl_next::Responder<driver_device::ProgramKey, ___T>,
1685    ) {
1686        ___H::program_key(&mut self.0, request, responder).await
1687    }
1688
1689    async fn derive_raw_secret(
1690        &mut self,
1691
1692        request: ::fidl_next::Request<driver_device::DeriveRawSecret, ___T>,
1693
1694        responder: ::fidl_next::Responder<driver_device::DeriveRawSecret, ___T>,
1695    ) {
1696        ___H::derive_raw_secret(&mut self.0, request, responder).await
1697    }
1698}
1699
1700pub use fidl_next_common_fuchsia_hardware_inlineencryption::*;