1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub use fidl_next_common_fuchsia_hardware_inlineencryption::natural::*;
8
9 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10 pub struct ControllerProgramKeySlotRequest {
11 pub wrapped_key: ::std::vec::Vec<u8>,
12
13 pub data_unit_size: u32,
14 }
15
16 unsafe impl<___E>
17 ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotRequest<'static>, ___E>
18 for ControllerProgramKeySlotRequest
19 where
20 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21 ___E: ::fidl_next::Encoder,
22 ___E: ::fidl_next::fuchsia::HandleEncoder,
23 {
24 #[inline]
25 fn encode(
26 self,
27 encoder_: &mut ___E,
28 out_: &mut ::core::mem::MaybeUninit<
29 crate::wire::ControllerProgramKeySlotRequest<'static>,
30 >,
31 _: (),
32 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33 ::fidl_next::munge! {
34 let crate::wire::ControllerProgramKeySlotRequest {
35 wrapped_key,
36 data_unit_size,
37
38 } = out_;
39 }
40
41 ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
42
43 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(wrapped_key.as_mut_ptr()) };
44 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
45
46 ::fidl_next::Encode::encode(self.data_unit_size, encoder_, data_unit_size, ())?;
47
48 let mut _field =
49 unsafe { ::fidl_next::Slot::new_unchecked(data_unit_size.as_mut_ptr()) };
50
51 Ok(())
52 }
53 }
54
55 unsafe impl<___E>
56 ::fidl_next::EncodeOption<
57 ::fidl_next::wire::Box<'static, crate::wire::ControllerProgramKeySlotRequest<'static>>,
58 ___E,
59 > for ControllerProgramKeySlotRequest
60 where
61 ___E: ::fidl_next::Encoder + ?Sized,
62 ControllerProgramKeySlotRequest:
63 ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotRequest<'static>, ___E>,
64 {
65 #[inline]
66 fn encode_option(
67 this: ::core::option::Option<Self>,
68 encoder: &mut ___E,
69 out: &mut ::core::mem::MaybeUninit<
70 ::fidl_next::wire::Box<
71 'static,
72 crate::wire::ControllerProgramKeySlotRequest<'static>,
73 >,
74 >,
75 _: (),
76 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
77 if let Some(inner) = this {
78 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
79 ::fidl_next::wire::Box::encode_present(out);
80 } else {
81 ::fidl_next::wire::Box::encode_absent(out);
82 }
83
84 Ok(())
85 }
86 }
87
88 impl<'de> ::fidl_next::FromWire<crate::wire::ControllerProgramKeySlotRequest<'de>>
89 for ControllerProgramKeySlotRequest
90 {
91 #[inline]
92 fn from_wire(wire: crate::wire::ControllerProgramKeySlotRequest<'de>) -> Self {
93 Self {
94 wrapped_key: ::fidl_next::FromWire::from_wire(wire.wrapped_key),
95
96 data_unit_size: ::fidl_next::FromWire::from_wire(wire.data_unit_size),
97 }
98 }
99 }
100
101 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
102 pub struct ControllerDeriveRawSecretRequest {
103 pub wrapped_key: ::std::vec::Vec<u8>,
104 }
105
106 unsafe impl<___E>
107 ::fidl_next::Encode<crate::wire::ControllerDeriveRawSecretRequest<'static>, ___E>
108 for ControllerDeriveRawSecretRequest
109 where
110 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
111 ___E: ::fidl_next::Encoder,
112 ___E: ::fidl_next::fuchsia::HandleEncoder,
113 {
114 #[inline]
115 fn encode(
116 self,
117 encoder_: &mut ___E,
118 out_: &mut ::core::mem::MaybeUninit<
119 crate::wire::ControllerDeriveRawSecretRequest<'static>,
120 >,
121 _: (),
122 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
123 ::fidl_next::munge! {
124 let crate::wire::ControllerDeriveRawSecretRequest {
125 wrapped_key,
126
127 } = out_;
128 }
129
130 ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
131
132 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(wrapped_key.as_mut_ptr()) };
133 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
134
135 Ok(())
136 }
137 }
138
139 unsafe impl<___E>
140 ::fidl_next::EncodeOption<
141 ::fidl_next::wire::Box<'static, crate::wire::ControllerDeriveRawSecretRequest<'static>>,
142 ___E,
143 > for ControllerDeriveRawSecretRequest
144 where
145 ___E: ::fidl_next::Encoder + ?Sized,
146 ControllerDeriveRawSecretRequest:
147 ::fidl_next::Encode<crate::wire::ControllerDeriveRawSecretRequest<'static>, ___E>,
148 {
149 #[inline]
150 fn encode_option(
151 this: ::core::option::Option<Self>,
152 encoder: &mut ___E,
153 out: &mut ::core::mem::MaybeUninit<
154 ::fidl_next::wire::Box<
155 'static,
156 crate::wire::ControllerDeriveRawSecretRequest<'static>,
157 >,
158 >,
159 _: (),
160 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
161 if let Some(inner) = this {
162 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
163 ::fidl_next::wire::Box::encode_present(out);
164 } else {
165 ::fidl_next::wire::Box::encode_absent(out);
166 }
167
168 Ok(())
169 }
170 }
171
172 impl<'de> ::fidl_next::FromWire<crate::wire::ControllerDeriveRawSecretRequest<'de>>
173 for ControllerDeriveRawSecretRequest
174 {
175 #[inline]
176 fn from_wire(wire: crate::wire::ControllerDeriveRawSecretRequest<'de>) -> Self {
177 Self { wrapped_key: ::fidl_next::FromWire::from_wire(wire.wrapped_key) }
178 }
179 }
180
181 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
182 pub struct ControllerDeriveRawSecretResponse {
183 pub secret: ::std::vec::Vec<u8>,
184 }
185
186 unsafe impl<___E>
187 ::fidl_next::Encode<crate::wire::ControllerDeriveRawSecretResponse<'static>, ___E>
188 for ControllerDeriveRawSecretResponse
189 where
190 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
191 ___E: ::fidl_next::Encoder,
192 ___E: ::fidl_next::fuchsia::HandleEncoder,
193 {
194 #[inline]
195 fn encode(
196 self,
197 encoder_: &mut ___E,
198 out_: &mut ::core::mem::MaybeUninit<
199 crate::wire::ControllerDeriveRawSecretResponse<'static>,
200 >,
201 _: (),
202 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
203 ::fidl_next::munge! {
204 let crate::wire::ControllerDeriveRawSecretResponse {
205 secret,
206
207 } = out_;
208 }
209
210 ::fidl_next::Encode::encode(self.secret, encoder_, secret, (4294967295, ()))?;
211
212 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(secret.as_mut_ptr()) };
213 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
214
215 Ok(())
216 }
217 }
218
219 unsafe impl<___E>
220 ::fidl_next::EncodeOption<
221 ::fidl_next::wire::Box<
222 'static,
223 crate::wire::ControllerDeriveRawSecretResponse<'static>,
224 >,
225 ___E,
226 > for ControllerDeriveRawSecretResponse
227 where
228 ___E: ::fidl_next::Encoder + ?Sized,
229 ControllerDeriveRawSecretResponse:
230 ::fidl_next::Encode<crate::wire::ControllerDeriveRawSecretResponse<'static>, ___E>,
231 {
232 #[inline]
233 fn encode_option(
234 this: ::core::option::Option<Self>,
235 encoder: &mut ___E,
236 out: &mut ::core::mem::MaybeUninit<
237 ::fidl_next::wire::Box<
238 'static,
239 crate::wire::ControllerDeriveRawSecretResponse<'static>,
240 >,
241 >,
242 _: (),
243 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
244 if let Some(inner) = this {
245 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
246 ::fidl_next::wire::Box::encode_present(out);
247 } else {
248 ::fidl_next::wire::Box::encode_absent(out);
249 }
250
251 Ok(())
252 }
253 }
254
255 impl<'de> ::fidl_next::FromWire<crate::wire::ControllerDeriveRawSecretResponse<'de>>
256 for ControllerDeriveRawSecretResponse
257 {
258 #[inline]
259 fn from_wire(wire: crate::wire::ControllerDeriveRawSecretResponse<'de>) -> Self {
260 Self { secret: ::fidl_next::FromWire::from_wire(wire.secret) }
261 }
262 }
263
264 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
265 pub struct DeviceProgramKeyRequest {
266 pub wrapped_key: ::std::vec::Vec<u8>,
267
268 pub data_unit_size: u32,
269 }
270
271 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceProgramKeyRequest<'static>, ___E>
272 for DeviceProgramKeyRequest
273 where
274 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
275 ___E: ::fidl_next::Encoder,
276 ___E: ::fidl_next::fuchsia::HandleEncoder,
277 {
278 #[inline]
279 fn encode(
280 self,
281 encoder_: &mut ___E,
282 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceProgramKeyRequest<'static>>,
283 _: (),
284 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
285 ::fidl_next::munge! {
286 let crate::wire::DeviceProgramKeyRequest {
287 wrapped_key,
288 data_unit_size,
289
290 } = out_;
291 }
292
293 ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
294
295 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(wrapped_key.as_mut_ptr()) };
296 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
297
298 ::fidl_next::Encode::encode(self.data_unit_size, encoder_, data_unit_size, ())?;
299
300 let mut _field =
301 unsafe { ::fidl_next::Slot::new_unchecked(data_unit_size.as_mut_ptr()) };
302
303 Ok(())
304 }
305 }
306
307 unsafe impl<___E>
308 ::fidl_next::EncodeOption<
309 ::fidl_next::wire::Box<'static, crate::wire::DeviceProgramKeyRequest<'static>>,
310 ___E,
311 > for DeviceProgramKeyRequest
312 where
313 ___E: ::fidl_next::Encoder + ?Sized,
314 DeviceProgramKeyRequest:
315 ::fidl_next::Encode<crate::wire::DeviceProgramKeyRequest<'static>, ___E>,
316 {
317 #[inline]
318 fn encode_option(
319 this: ::core::option::Option<Self>,
320 encoder: &mut ___E,
321 out: &mut ::core::mem::MaybeUninit<
322 ::fidl_next::wire::Box<'static, crate::wire::DeviceProgramKeyRequest<'static>>,
323 >,
324 _: (),
325 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
326 if let Some(inner) = this {
327 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
328 ::fidl_next::wire::Box::encode_present(out);
329 } else {
330 ::fidl_next::wire::Box::encode_absent(out);
331 }
332
333 Ok(())
334 }
335 }
336
337 impl<'de> ::fidl_next::FromWire<crate::wire::DeviceProgramKeyRequest<'de>>
338 for DeviceProgramKeyRequest
339 {
340 #[inline]
341 fn from_wire(wire: crate::wire::DeviceProgramKeyRequest<'de>) -> Self {
342 Self {
343 wrapped_key: ::fidl_next::FromWire::from_wire(wire.wrapped_key),
344
345 data_unit_size: ::fidl_next::FromWire::from_wire(wire.data_unit_size),
346 }
347 }
348 }
349
350 #[derive(Debug, PartialEq)]
351 #[repr(C)]
352 pub struct DeviceProgramKeyResponse {
353 pub key_token: ::fidl_next::fuchsia::zx::EventPair,
354 }
355
356 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceProgramKeyResponse, ___E>
357 for DeviceProgramKeyResponse
358 where
359 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
360 ___E: ::fidl_next::fuchsia::HandleEncoder,
361 {
362 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
363 Self,
364 crate::wire::DeviceProgramKeyResponse,
365 > = unsafe {
366 ::fidl_next::CopyOptimization::enable_if(
367 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
368 ::fidl_next::wire::fuchsia::EventPair,
369 ___E,
370 >>::COPY_OPTIMIZATION
371 .is_enabled(),
372 )
373 };
374
375 #[inline]
376 fn encode(
377 self,
378 encoder_: &mut ___E,
379 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceProgramKeyResponse>,
380 _: (),
381 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
382 ::fidl_next::munge! {
383 let crate::wire::DeviceProgramKeyResponse {
384 key_token,
385
386 } = out_;
387 }
388
389 ::fidl_next::Encode::encode(self.key_token, encoder_, key_token, ())?;
390
391 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key_token.as_mut_ptr()) };
392
393 Ok(())
394 }
395 }
396
397 unsafe impl<___E>
398 ::fidl_next::EncodeOption<
399 ::fidl_next::wire::Box<'static, crate::wire::DeviceProgramKeyResponse>,
400 ___E,
401 > for DeviceProgramKeyResponse
402 where
403 ___E: ::fidl_next::Encoder + ?Sized,
404 DeviceProgramKeyResponse: ::fidl_next::Encode<crate::wire::DeviceProgramKeyResponse, ___E>,
405 {
406 #[inline]
407 fn encode_option(
408 this: ::core::option::Option<Self>,
409 encoder: &mut ___E,
410 out: &mut ::core::mem::MaybeUninit<
411 ::fidl_next::wire::Box<'static, crate::wire::DeviceProgramKeyResponse>,
412 >,
413 _: (),
414 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
415 if let Some(inner) = this {
416 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
417 ::fidl_next::wire::Box::encode_present(out);
418 } else {
419 ::fidl_next::wire::Box::encode_absent(out);
420 }
421
422 Ok(())
423 }
424 }
425
426 impl ::fidl_next::FromWire<crate::wire::DeviceProgramKeyResponse> for DeviceProgramKeyResponse {
427 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
428 crate::wire::DeviceProgramKeyResponse,
429 Self,
430 > = unsafe {
431 ::fidl_next::CopyOptimization::enable_if(
432 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
433 ::fidl_next::wire::fuchsia::EventPair,
434 >>::COPY_OPTIMIZATION
435 .is_enabled(),
436 )
437 };
438
439 #[inline]
440 fn from_wire(wire: crate::wire::DeviceProgramKeyResponse) -> Self {
441 Self { key_token: ::fidl_next::FromWire::from_wire(wire.key_token) }
442 }
443 }
444
445 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
446 pub struct DeviceDeriveRawSecretRequest {
447 pub wrapped_key: ::std::vec::Vec<u8>,
448 }
449
450 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretRequest<'static>, ___E>
451 for DeviceDeriveRawSecretRequest
452 where
453 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
454 ___E: ::fidl_next::Encoder,
455 ___E: ::fidl_next::fuchsia::HandleEncoder,
456 {
457 #[inline]
458 fn encode(
459 self,
460 encoder_: &mut ___E,
461 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceDeriveRawSecretRequest<'static>>,
462 _: (),
463 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
464 ::fidl_next::munge! {
465 let crate::wire::DeviceDeriveRawSecretRequest {
466 wrapped_key,
467
468 } = out_;
469 }
470
471 ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
472
473 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(wrapped_key.as_mut_ptr()) };
474 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
475
476 Ok(())
477 }
478 }
479
480 unsafe impl<___E>
481 ::fidl_next::EncodeOption<
482 ::fidl_next::wire::Box<'static, crate::wire::DeviceDeriveRawSecretRequest<'static>>,
483 ___E,
484 > for DeviceDeriveRawSecretRequest
485 where
486 ___E: ::fidl_next::Encoder + ?Sized,
487 DeviceDeriveRawSecretRequest:
488 ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretRequest<'static>, ___E>,
489 {
490 #[inline]
491 fn encode_option(
492 this: ::core::option::Option<Self>,
493 encoder: &mut ___E,
494 out: &mut ::core::mem::MaybeUninit<
495 ::fidl_next::wire::Box<'static, crate::wire::DeviceDeriveRawSecretRequest<'static>>,
496 >,
497 _: (),
498 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
499 if let Some(inner) = this {
500 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
501 ::fidl_next::wire::Box::encode_present(out);
502 } else {
503 ::fidl_next::wire::Box::encode_absent(out);
504 }
505
506 Ok(())
507 }
508 }
509
510 impl<'de> ::fidl_next::FromWire<crate::wire::DeviceDeriveRawSecretRequest<'de>>
511 for DeviceDeriveRawSecretRequest
512 {
513 #[inline]
514 fn from_wire(wire: crate::wire::DeviceDeriveRawSecretRequest<'de>) -> Self {
515 Self { wrapped_key: ::fidl_next::FromWire::from_wire(wire.wrapped_key) }
516 }
517 }
518
519 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
520 pub struct DeviceDeriveRawSecretResponse {
521 pub secret: ::std::vec::Vec<u8>,
522 }
523
524 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretResponse<'static>, ___E>
525 for DeviceDeriveRawSecretResponse
526 where
527 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
528 ___E: ::fidl_next::Encoder,
529 ___E: ::fidl_next::fuchsia::HandleEncoder,
530 {
531 #[inline]
532 fn encode(
533 self,
534 encoder_: &mut ___E,
535 out_: &mut ::core::mem::MaybeUninit<
536 crate::wire::DeviceDeriveRawSecretResponse<'static>,
537 >,
538 _: (),
539 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
540 ::fidl_next::munge! {
541 let crate::wire::DeviceDeriveRawSecretResponse {
542 secret,
543
544 } = out_;
545 }
546
547 ::fidl_next::Encode::encode(self.secret, encoder_, secret, (4294967295, ()))?;
548
549 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(secret.as_mut_ptr()) };
550 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
551
552 Ok(())
553 }
554 }
555
556 unsafe impl<___E>
557 ::fidl_next::EncodeOption<
558 ::fidl_next::wire::Box<'static, crate::wire::DeviceDeriveRawSecretResponse<'static>>,
559 ___E,
560 > for DeviceDeriveRawSecretResponse
561 where
562 ___E: ::fidl_next::Encoder + ?Sized,
563 DeviceDeriveRawSecretResponse:
564 ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretResponse<'static>, ___E>,
565 {
566 #[inline]
567 fn encode_option(
568 this: ::core::option::Option<Self>,
569 encoder: &mut ___E,
570 out: &mut ::core::mem::MaybeUninit<
571 ::fidl_next::wire::Box<
572 'static,
573 crate::wire::DeviceDeriveRawSecretResponse<'static>,
574 >,
575 >,
576 _: (),
577 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
578 if let Some(inner) = this {
579 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
580 ::fidl_next::wire::Box::encode_present(out);
581 } else {
582 ::fidl_next::wire::Box::encode_absent(out);
583 }
584
585 Ok(())
586 }
587 }
588
589 impl<'de> ::fidl_next::FromWire<crate::wire::DeviceDeriveRawSecretResponse<'de>>
590 for DeviceDeriveRawSecretResponse
591 {
592 #[inline]
593 fn from_wire(wire: crate::wire::DeviceDeriveRawSecretResponse<'de>) -> Self {
594 Self { secret: ::fidl_next::FromWire::from_wire(wire.secret) }
595 }
596 }
597}
598
599pub mod wire {
600
601 pub use fidl_next_common_fuchsia_hardware_inlineencryption::wire::*;
602
603 #[derive(Debug)]
605 #[repr(C)]
606 pub struct ControllerProgramKeySlotRequest<'de> {
607 pub wrapped_key: ::fidl_next::wire::Vector<'de, u8>,
608
609 pub data_unit_size: ::fidl_next::wire::Uint32,
610 }
611
612 static_assertions::const_assert_eq!(
613 std::mem::size_of::<ControllerProgramKeySlotRequest<'_>>(),
614 24
615 );
616 static_assertions::const_assert_eq!(
617 std::mem::align_of::<ControllerProgramKeySlotRequest<'_>>(),
618 8
619 );
620
621 static_assertions::const_assert_eq!(
622 std::mem::offset_of!(ControllerProgramKeySlotRequest<'_>, wrapped_key),
623 0
624 );
625
626 static_assertions::const_assert_eq!(
627 std::mem::offset_of!(ControllerProgramKeySlotRequest<'_>, data_unit_size),
628 16
629 );
630
631 impl ::fidl_next::Constrained for ControllerProgramKeySlotRequest<'_> {
632 type Constraint = ();
633
634 fn validate(
635 _: ::fidl_next::Slot<'_, Self>,
636 _: Self::Constraint,
637 ) -> Result<(), ::fidl_next::ValidationError> {
638 Ok(())
639 }
640 }
641
642 unsafe impl ::fidl_next::Wire for ControllerProgramKeySlotRequest<'static> {
643 type Narrowed<'de> = ControllerProgramKeySlotRequest<'de>;
644
645 #[inline]
646 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
647 ::fidl_next::munge! {
648 let Self {
649 wrapped_key,
650 data_unit_size,
651
652 } = &mut *out_;
653 }
654
655 ::fidl_next::Wire::zero_padding(wrapped_key);
656
657 ::fidl_next::Wire::zero_padding(data_unit_size);
658
659 unsafe {
660 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
661 }
662 }
663 }
664
665 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ControllerProgramKeySlotRequest<'de>
666 where
667 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
668 ___D: ::fidl_next::Decoder<'de>,
669 ___D: ::fidl_next::fuchsia::HandleDecoder,
670 {
671 fn decode(
672 slot_: ::fidl_next::Slot<'_, Self>,
673 decoder_: &mut ___D,
674 _: (),
675 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
676 if slot_.as_bytes()[20..24] != [0u8; 4] {
677 return Err(::fidl_next::DecodeError::InvalidPadding);
678 }
679
680 ::fidl_next::munge! {
681 let Self {
682 mut wrapped_key,
683 mut data_unit_size,
684
685 } = slot_;
686 }
687
688 let _field = wrapped_key.as_mut();
689 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
690 ::fidl_next::Decode::decode(wrapped_key.as_mut(), decoder_, (4294967295, ()))?;
691
692 let _field = data_unit_size.as_mut();
693
694 ::fidl_next::Decode::decode(data_unit_size.as_mut(), decoder_, ())?;
695
696 Ok(())
697 }
698 }
699
700 impl<'de> ::fidl_next::IntoNatural for ControllerProgramKeySlotRequest<'de> {
701 type Natural = crate::natural::ControllerProgramKeySlotRequest;
702 }
703
704 #[derive(Debug)]
706 #[repr(C)]
707 pub struct ControllerDeriveRawSecretRequest<'de> {
708 pub wrapped_key: ::fidl_next::wire::Vector<'de, u8>,
709 }
710
711 static_assertions::const_assert_eq!(
712 std::mem::size_of::<ControllerDeriveRawSecretRequest<'_>>(),
713 16
714 );
715 static_assertions::const_assert_eq!(
716 std::mem::align_of::<ControllerDeriveRawSecretRequest<'_>>(),
717 8
718 );
719
720 static_assertions::const_assert_eq!(
721 std::mem::offset_of!(ControllerDeriveRawSecretRequest<'_>, wrapped_key),
722 0
723 );
724
725 impl ::fidl_next::Constrained for ControllerDeriveRawSecretRequest<'_> {
726 type Constraint = ();
727
728 fn validate(
729 _: ::fidl_next::Slot<'_, Self>,
730 _: Self::Constraint,
731 ) -> Result<(), ::fidl_next::ValidationError> {
732 Ok(())
733 }
734 }
735
736 unsafe impl ::fidl_next::Wire for ControllerDeriveRawSecretRequest<'static> {
737 type Narrowed<'de> = ControllerDeriveRawSecretRequest<'de>;
738
739 #[inline]
740 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
741 ::fidl_next::munge! {
742 let Self {
743 wrapped_key,
744
745 } = &mut *out_;
746 }
747
748 ::fidl_next::Wire::zero_padding(wrapped_key);
749 }
750 }
751
752 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ControllerDeriveRawSecretRequest<'de>
753 where
754 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
755 ___D: ::fidl_next::Decoder<'de>,
756 ___D: ::fidl_next::fuchsia::HandleDecoder,
757 {
758 fn decode(
759 slot_: ::fidl_next::Slot<'_, Self>,
760 decoder_: &mut ___D,
761 _: (),
762 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
763 ::fidl_next::munge! {
764 let Self {
765 mut wrapped_key,
766
767 } = slot_;
768 }
769
770 let _field = wrapped_key.as_mut();
771 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
772 ::fidl_next::Decode::decode(wrapped_key.as_mut(), decoder_, (4294967295, ()))?;
773
774 Ok(())
775 }
776 }
777
778 impl<'de> ::fidl_next::IntoNatural for ControllerDeriveRawSecretRequest<'de> {
779 type Natural = crate::natural::ControllerDeriveRawSecretRequest;
780 }
781
782 #[derive(Debug)]
784 #[repr(C)]
785 pub struct ControllerDeriveRawSecretResponse<'de> {
786 pub secret: ::fidl_next::wire::Vector<'de, u8>,
787 }
788
789 static_assertions::const_assert_eq!(
790 std::mem::size_of::<ControllerDeriveRawSecretResponse<'_>>(),
791 16
792 );
793 static_assertions::const_assert_eq!(
794 std::mem::align_of::<ControllerDeriveRawSecretResponse<'_>>(),
795 8
796 );
797
798 static_assertions::const_assert_eq!(
799 std::mem::offset_of!(ControllerDeriveRawSecretResponse<'_>, secret),
800 0
801 );
802
803 impl ::fidl_next::Constrained for ControllerDeriveRawSecretResponse<'_> {
804 type Constraint = ();
805
806 fn validate(
807 _: ::fidl_next::Slot<'_, Self>,
808 _: Self::Constraint,
809 ) -> Result<(), ::fidl_next::ValidationError> {
810 Ok(())
811 }
812 }
813
814 unsafe impl ::fidl_next::Wire for ControllerDeriveRawSecretResponse<'static> {
815 type Narrowed<'de> = ControllerDeriveRawSecretResponse<'de>;
816
817 #[inline]
818 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
819 ::fidl_next::munge! {
820 let Self {
821 secret,
822
823 } = &mut *out_;
824 }
825
826 ::fidl_next::Wire::zero_padding(secret);
827 }
828 }
829
830 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ControllerDeriveRawSecretResponse<'de>
831 where
832 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
833 ___D: ::fidl_next::Decoder<'de>,
834 ___D: ::fidl_next::fuchsia::HandleDecoder,
835 {
836 fn decode(
837 slot_: ::fidl_next::Slot<'_, Self>,
838 decoder_: &mut ___D,
839 _: (),
840 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
841 ::fidl_next::munge! {
842 let Self {
843 mut secret,
844
845 } = slot_;
846 }
847
848 let _field = secret.as_mut();
849 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
850 ::fidl_next::Decode::decode(secret.as_mut(), decoder_, (4294967295, ()))?;
851
852 Ok(())
853 }
854 }
855
856 impl<'de> ::fidl_next::IntoNatural for ControllerDeriveRawSecretResponse<'de> {
857 type Natural = crate::natural::ControllerDeriveRawSecretResponse;
858 }
859
860 #[derive(Debug)]
862 #[repr(C)]
863 pub struct DeviceProgramKeyRequest<'de> {
864 pub wrapped_key: ::fidl_next::wire::Vector<'de, u8>,
865
866 pub data_unit_size: ::fidl_next::wire::Uint32,
867 }
868
869 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceProgramKeyRequest<'_>>(), 24);
870 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceProgramKeyRequest<'_>>(), 8);
871
872 static_assertions::const_assert_eq!(
873 std::mem::offset_of!(DeviceProgramKeyRequest<'_>, wrapped_key),
874 0
875 );
876
877 static_assertions::const_assert_eq!(
878 std::mem::offset_of!(DeviceProgramKeyRequest<'_>, data_unit_size),
879 16
880 );
881
882 impl ::fidl_next::Constrained for DeviceProgramKeyRequest<'_> {
883 type Constraint = ();
884
885 fn validate(
886 _: ::fidl_next::Slot<'_, Self>,
887 _: Self::Constraint,
888 ) -> Result<(), ::fidl_next::ValidationError> {
889 Ok(())
890 }
891 }
892
893 unsafe impl ::fidl_next::Wire for DeviceProgramKeyRequest<'static> {
894 type Narrowed<'de> = DeviceProgramKeyRequest<'de>;
895
896 #[inline]
897 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
898 ::fidl_next::munge! {
899 let Self {
900 wrapped_key,
901 data_unit_size,
902
903 } = &mut *out_;
904 }
905
906 ::fidl_next::Wire::zero_padding(wrapped_key);
907
908 ::fidl_next::Wire::zero_padding(data_unit_size);
909
910 unsafe {
911 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
912 }
913 }
914 }
915
916 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceProgramKeyRequest<'de>
917 where
918 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
919 ___D: ::fidl_next::Decoder<'de>,
920 ___D: ::fidl_next::fuchsia::HandleDecoder,
921 {
922 fn decode(
923 slot_: ::fidl_next::Slot<'_, Self>,
924 decoder_: &mut ___D,
925 _: (),
926 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
927 if slot_.as_bytes()[20..24] != [0u8; 4] {
928 return Err(::fidl_next::DecodeError::InvalidPadding);
929 }
930
931 ::fidl_next::munge! {
932 let Self {
933 mut wrapped_key,
934 mut data_unit_size,
935
936 } = slot_;
937 }
938
939 let _field = wrapped_key.as_mut();
940 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
941 ::fidl_next::Decode::decode(wrapped_key.as_mut(), decoder_, (4294967295, ()))?;
942
943 let _field = data_unit_size.as_mut();
944
945 ::fidl_next::Decode::decode(data_unit_size.as_mut(), decoder_, ())?;
946
947 Ok(())
948 }
949 }
950
951 impl<'de> ::fidl_next::IntoNatural for DeviceProgramKeyRequest<'de> {
952 type Natural = crate::natural::DeviceProgramKeyRequest;
953 }
954
955 #[derive(Debug)]
957 #[repr(C)]
958 pub struct DeviceProgramKeyResponse {
959 pub key_token: ::fidl_next::wire::fuchsia::EventPair,
960 }
961
962 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceProgramKeyResponse>(), 4);
963 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceProgramKeyResponse>(), 4);
964
965 static_assertions::const_assert_eq!(
966 std::mem::offset_of!(DeviceProgramKeyResponse, key_token),
967 0
968 );
969
970 impl ::fidl_next::Constrained for DeviceProgramKeyResponse {
971 type Constraint = ();
972
973 fn validate(
974 _: ::fidl_next::Slot<'_, Self>,
975 _: Self::Constraint,
976 ) -> Result<(), ::fidl_next::ValidationError> {
977 Ok(())
978 }
979 }
980
981 unsafe impl ::fidl_next::Wire for DeviceProgramKeyResponse {
982 type Narrowed<'de> = DeviceProgramKeyResponse;
983
984 #[inline]
985 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
986 ::fidl_next::munge! {
987 let Self {
988 key_token,
989
990 } = &mut *out_;
991 }
992
993 ::fidl_next::Wire::zero_padding(key_token);
994 }
995 }
996
997 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceProgramKeyResponse
998 where
999 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1000 ___D: ::fidl_next::fuchsia::HandleDecoder,
1001 {
1002 fn decode(
1003 slot_: ::fidl_next::Slot<'_, Self>,
1004 decoder_: &mut ___D,
1005 _: (),
1006 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1007 ::fidl_next::munge! {
1008 let Self {
1009 mut key_token,
1010
1011 } = slot_;
1012 }
1013
1014 let _field = key_token.as_mut();
1015
1016 ::fidl_next::Decode::decode(key_token.as_mut(), decoder_, ())?;
1017
1018 Ok(())
1019 }
1020 }
1021
1022 impl ::fidl_next::IntoNatural for DeviceProgramKeyResponse {
1023 type Natural = crate::natural::DeviceProgramKeyResponse;
1024 }
1025
1026 #[derive(Debug)]
1028 #[repr(C)]
1029 pub struct DeviceDeriveRawSecretRequest<'de> {
1030 pub wrapped_key: ::fidl_next::wire::Vector<'de, u8>,
1031 }
1032
1033 static_assertions::const_assert_eq!(
1034 std::mem::size_of::<DeviceDeriveRawSecretRequest<'_>>(),
1035 16
1036 );
1037 static_assertions::const_assert_eq!(
1038 std::mem::align_of::<DeviceDeriveRawSecretRequest<'_>>(),
1039 8
1040 );
1041
1042 static_assertions::const_assert_eq!(
1043 std::mem::offset_of!(DeviceDeriveRawSecretRequest<'_>, wrapped_key),
1044 0
1045 );
1046
1047 impl ::fidl_next::Constrained for DeviceDeriveRawSecretRequest<'_> {
1048 type Constraint = ();
1049
1050 fn validate(
1051 _: ::fidl_next::Slot<'_, Self>,
1052 _: Self::Constraint,
1053 ) -> Result<(), ::fidl_next::ValidationError> {
1054 Ok(())
1055 }
1056 }
1057
1058 unsafe impl ::fidl_next::Wire for DeviceDeriveRawSecretRequest<'static> {
1059 type Narrowed<'de> = DeviceDeriveRawSecretRequest<'de>;
1060
1061 #[inline]
1062 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1063 ::fidl_next::munge! {
1064 let Self {
1065 wrapped_key,
1066
1067 } = &mut *out_;
1068 }
1069
1070 ::fidl_next::Wire::zero_padding(wrapped_key);
1071 }
1072 }
1073
1074 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceDeriveRawSecretRequest<'de>
1075 where
1076 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1077 ___D: ::fidl_next::Decoder<'de>,
1078 ___D: ::fidl_next::fuchsia::HandleDecoder,
1079 {
1080 fn decode(
1081 slot_: ::fidl_next::Slot<'_, Self>,
1082 decoder_: &mut ___D,
1083 _: (),
1084 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1085 ::fidl_next::munge! {
1086 let Self {
1087 mut wrapped_key,
1088
1089 } = slot_;
1090 }
1091
1092 let _field = wrapped_key.as_mut();
1093 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1094 ::fidl_next::Decode::decode(wrapped_key.as_mut(), decoder_, (4294967295, ()))?;
1095
1096 Ok(())
1097 }
1098 }
1099
1100 impl<'de> ::fidl_next::IntoNatural for DeviceDeriveRawSecretRequest<'de> {
1101 type Natural = crate::natural::DeviceDeriveRawSecretRequest;
1102 }
1103
1104 #[derive(Debug)]
1106 #[repr(C)]
1107 pub struct DeviceDeriveRawSecretResponse<'de> {
1108 pub secret: ::fidl_next::wire::Vector<'de, u8>,
1109 }
1110
1111 static_assertions::const_assert_eq!(
1112 std::mem::size_of::<DeviceDeriveRawSecretResponse<'_>>(),
1113 16
1114 );
1115 static_assertions::const_assert_eq!(
1116 std::mem::align_of::<DeviceDeriveRawSecretResponse<'_>>(),
1117 8
1118 );
1119
1120 static_assertions::const_assert_eq!(
1121 std::mem::offset_of!(DeviceDeriveRawSecretResponse<'_>, secret),
1122 0
1123 );
1124
1125 impl ::fidl_next::Constrained for DeviceDeriveRawSecretResponse<'_> {
1126 type Constraint = ();
1127
1128 fn validate(
1129 _: ::fidl_next::Slot<'_, Self>,
1130 _: Self::Constraint,
1131 ) -> Result<(), ::fidl_next::ValidationError> {
1132 Ok(())
1133 }
1134 }
1135
1136 unsafe impl ::fidl_next::Wire for DeviceDeriveRawSecretResponse<'static> {
1137 type Narrowed<'de> = DeviceDeriveRawSecretResponse<'de>;
1138
1139 #[inline]
1140 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1141 ::fidl_next::munge! {
1142 let Self {
1143 secret,
1144
1145 } = &mut *out_;
1146 }
1147
1148 ::fidl_next::Wire::zero_padding(secret);
1149 }
1150 }
1151
1152 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceDeriveRawSecretResponse<'de>
1153 where
1154 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1155 ___D: ::fidl_next::Decoder<'de>,
1156 ___D: ::fidl_next::fuchsia::HandleDecoder,
1157 {
1158 fn decode(
1159 slot_: ::fidl_next::Slot<'_, Self>,
1160 decoder_: &mut ___D,
1161 _: (),
1162 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1163 ::fidl_next::munge! {
1164 let Self {
1165 mut secret,
1166
1167 } = slot_;
1168 }
1169
1170 let _field = secret.as_mut();
1171 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1172 ::fidl_next::Decode::decode(secret.as_mut(), decoder_, (4294967295, ()))?;
1173
1174 Ok(())
1175 }
1176 }
1177
1178 impl<'de> ::fidl_next::IntoNatural for DeviceDeriveRawSecretResponse<'de> {
1179 type Natural = crate::natural::DeviceDeriveRawSecretResponse;
1180 }
1181}
1182
1183pub mod wire_optional {
1184
1185 pub use fidl_next_common_fuchsia_hardware_inlineencryption::wire_optional::*;
1186}
1187
1188pub mod generic {
1189
1190 pub use fidl_next_common_fuchsia_hardware_inlineencryption::generic::*;
1191
1192 pub struct ControllerProgramKeySlotRequest<T0, T1> {
1194 pub wrapped_key: T0,
1195
1196 pub data_unit_size: T1,
1197 }
1198
1199 unsafe impl<___E, T0, T1>
1200 ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotRequest<'static>, ___E>
1201 for ControllerProgramKeySlotRequest<T0, T1>
1202 where
1203 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1204 ___E: ::fidl_next::Encoder,
1205 ___E: ::fidl_next::fuchsia::HandleEncoder,
1206 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1207 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
1208 {
1209 #[inline]
1210 fn encode(
1211 self,
1212 encoder_: &mut ___E,
1213 out_: &mut ::core::mem::MaybeUninit<
1214 crate::wire::ControllerProgramKeySlotRequest<'static>,
1215 >,
1216 _: (),
1217 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1218 ::fidl_next::munge! {
1219 let crate::wire::ControllerProgramKeySlotRequest {
1220 wrapped_key,
1221 data_unit_size,
1222
1223 } = out_;
1224 }
1225
1226 ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
1227
1228 ::fidl_next::Encode::encode(self.data_unit_size, encoder_, data_unit_size, ())?;
1229
1230 Ok(())
1231 }
1232 }
1233
1234 unsafe impl<'a, ___E, T0, T1>
1235 ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotRequest<'static>, ___E>
1236 for &'a ControllerProgramKeySlotRequest<T0, T1>
1237 where
1238 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1239 ___E: ::fidl_next::Encoder,
1240 ___E: ::fidl_next::fuchsia::HandleEncoder,
1241 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1242 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
1243 {
1244 #[inline]
1245 fn encode(
1246 self,
1247 encoder_: &mut ___E,
1248 out_: &mut ::core::mem::MaybeUninit<
1249 crate::wire::ControllerProgramKeySlotRequest<'static>,
1250 >,
1251 _: (),
1252 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1253 ::fidl_next::munge! {
1254 let crate::wire::ControllerProgramKeySlotRequest {
1255 wrapped_key,
1256 data_unit_size,
1257
1258 } = out_;
1259 }
1260
1261 ::fidl_next::Encode::encode(
1262 &self.wrapped_key,
1263 encoder_,
1264 wrapped_key,
1265 (4294967295, ()),
1266 )?;
1267
1268 ::fidl_next::Encode::encode(&self.data_unit_size, encoder_, data_unit_size, ())?;
1269
1270 Ok(())
1271 }
1272 }
1273
1274 pub struct ControllerDeriveRawSecretRequest<T0> {
1276 pub wrapped_key: T0,
1277 }
1278
1279 unsafe impl<___E, T0>
1280 ::fidl_next::Encode<crate::wire::ControllerDeriveRawSecretRequest<'static>, ___E>
1281 for ControllerDeriveRawSecretRequest<T0>
1282 where
1283 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1284 ___E: ::fidl_next::Encoder,
1285 ___E: ::fidl_next::fuchsia::HandleEncoder,
1286 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1287 {
1288 #[inline]
1289 fn encode(
1290 self,
1291 encoder_: &mut ___E,
1292 out_: &mut ::core::mem::MaybeUninit<
1293 crate::wire::ControllerDeriveRawSecretRequest<'static>,
1294 >,
1295 _: (),
1296 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1297 ::fidl_next::munge! {
1298 let crate::wire::ControllerDeriveRawSecretRequest {
1299 wrapped_key,
1300
1301 } = out_;
1302 }
1303
1304 ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
1305
1306 Ok(())
1307 }
1308 }
1309
1310 unsafe impl<'a, ___E, T0>
1311 ::fidl_next::Encode<crate::wire::ControllerDeriveRawSecretRequest<'static>, ___E>
1312 for &'a ControllerDeriveRawSecretRequest<T0>
1313 where
1314 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1315 ___E: ::fidl_next::Encoder,
1316 ___E: ::fidl_next::fuchsia::HandleEncoder,
1317 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1318 {
1319 #[inline]
1320 fn encode(
1321 self,
1322 encoder_: &mut ___E,
1323 out_: &mut ::core::mem::MaybeUninit<
1324 crate::wire::ControllerDeriveRawSecretRequest<'static>,
1325 >,
1326 _: (),
1327 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1328 ::fidl_next::munge! {
1329 let crate::wire::ControllerDeriveRawSecretRequest {
1330 wrapped_key,
1331
1332 } = out_;
1333 }
1334
1335 ::fidl_next::Encode::encode(
1336 &self.wrapped_key,
1337 encoder_,
1338 wrapped_key,
1339 (4294967295, ()),
1340 )?;
1341
1342 Ok(())
1343 }
1344 }
1345
1346 pub struct ControllerDeriveRawSecretResponse<T0> {
1348 pub secret: T0,
1349 }
1350
1351 unsafe impl<___E, T0>
1352 ::fidl_next::Encode<crate::wire::ControllerDeriveRawSecretResponse<'static>, ___E>
1353 for ControllerDeriveRawSecretResponse<T0>
1354 where
1355 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1356 ___E: ::fidl_next::Encoder,
1357 ___E: ::fidl_next::fuchsia::HandleEncoder,
1358 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1359 {
1360 #[inline]
1361 fn encode(
1362 self,
1363 encoder_: &mut ___E,
1364 out_: &mut ::core::mem::MaybeUninit<
1365 crate::wire::ControllerDeriveRawSecretResponse<'static>,
1366 >,
1367 _: (),
1368 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1369 ::fidl_next::munge! {
1370 let crate::wire::ControllerDeriveRawSecretResponse {
1371 secret,
1372
1373 } = out_;
1374 }
1375
1376 ::fidl_next::Encode::encode(self.secret, encoder_, secret, (4294967295, ()))?;
1377
1378 Ok(())
1379 }
1380 }
1381
1382 unsafe impl<'a, ___E, T0>
1383 ::fidl_next::Encode<crate::wire::ControllerDeriveRawSecretResponse<'static>, ___E>
1384 for &'a ControllerDeriveRawSecretResponse<T0>
1385 where
1386 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1387 ___E: ::fidl_next::Encoder,
1388 ___E: ::fidl_next::fuchsia::HandleEncoder,
1389 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1390 {
1391 #[inline]
1392 fn encode(
1393 self,
1394 encoder_: &mut ___E,
1395 out_: &mut ::core::mem::MaybeUninit<
1396 crate::wire::ControllerDeriveRawSecretResponse<'static>,
1397 >,
1398 _: (),
1399 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1400 ::fidl_next::munge! {
1401 let crate::wire::ControllerDeriveRawSecretResponse {
1402 secret,
1403
1404 } = out_;
1405 }
1406
1407 ::fidl_next::Encode::encode(&self.secret, encoder_, secret, (4294967295, ()))?;
1408
1409 Ok(())
1410 }
1411 }
1412
1413 pub struct DeviceProgramKeyRequest<T0, T1> {
1415 pub wrapped_key: T0,
1416
1417 pub data_unit_size: T1,
1418 }
1419
1420 unsafe impl<___E, T0, T1>
1421 ::fidl_next::Encode<crate::wire::DeviceProgramKeyRequest<'static>, ___E>
1422 for DeviceProgramKeyRequest<T0, T1>
1423 where
1424 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1425 ___E: ::fidl_next::Encoder,
1426 ___E: ::fidl_next::fuchsia::HandleEncoder,
1427 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1428 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
1429 {
1430 #[inline]
1431 fn encode(
1432 self,
1433 encoder_: &mut ___E,
1434 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceProgramKeyRequest<'static>>,
1435 _: (),
1436 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1437 ::fidl_next::munge! {
1438 let crate::wire::DeviceProgramKeyRequest {
1439 wrapped_key,
1440 data_unit_size,
1441
1442 } = out_;
1443 }
1444
1445 ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
1446
1447 ::fidl_next::Encode::encode(self.data_unit_size, encoder_, data_unit_size, ())?;
1448
1449 Ok(())
1450 }
1451 }
1452
1453 unsafe impl<'a, ___E, T0, T1>
1454 ::fidl_next::Encode<crate::wire::DeviceProgramKeyRequest<'static>, ___E>
1455 for &'a DeviceProgramKeyRequest<T0, T1>
1456 where
1457 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1458 ___E: ::fidl_next::Encoder,
1459 ___E: ::fidl_next::fuchsia::HandleEncoder,
1460 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1461 &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
1462 {
1463 #[inline]
1464 fn encode(
1465 self,
1466 encoder_: &mut ___E,
1467 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceProgramKeyRequest<'static>>,
1468 _: (),
1469 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1470 ::fidl_next::munge! {
1471 let crate::wire::DeviceProgramKeyRequest {
1472 wrapped_key,
1473 data_unit_size,
1474
1475 } = out_;
1476 }
1477
1478 ::fidl_next::Encode::encode(
1479 &self.wrapped_key,
1480 encoder_,
1481 wrapped_key,
1482 (4294967295, ()),
1483 )?;
1484
1485 ::fidl_next::Encode::encode(&self.data_unit_size, encoder_, data_unit_size, ())?;
1486
1487 Ok(())
1488 }
1489 }
1490
1491 pub struct DeviceProgramKeyResponse<T0> {
1493 pub key_token: T0,
1494 }
1495
1496 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceProgramKeyResponse, ___E>
1497 for DeviceProgramKeyResponse<T0>
1498 where
1499 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1500 ___E: ::fidl_next::fuchsia::HandleEncoder,
1501 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
1502 {
1503 #[inline]
1504 fn encode(
1505 self,
1506 encoder_: &mut ___E,
1507 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceProgramKeyResponse>,
1508 _: (),
1509 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1510 ::fidl_next::munge! {
1511 let crate::wire::DeviceProgramKeyResponse {
1512 key_token,
1513
1514 } = out_;
1515 }
1516
1517 ::fidl_next::Encode::encode(self.key_token, encoder_, key_token, ())?;
1518
1519 Ok(())
1520 }
1521 }
1522
1523 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::DeviceProgramKeyResponse, ___E>
1524 for &'a DeviceProgramKeyResponse<T0>
1525 where
1526 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1527 ___E: ::fidl_next::fuchsia::HandleEncoder,
1528 &'a T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
1529 {
1530 #[inline]
1531 fn encode(
1532 self,
1533 encoder_: &mut ___E,
1534 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceProgramKeyResponse>,
1535 _: (),
1536 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1537 ::fidl_next::munge! {
1538 let crate::wire::DeviceProgramKeyResponse {
1539 key_token,
1540
1541 } = out_;
1542 }
1543
1544 ::fidl_next::Encode::encode(&self.key_token, encoder_, key_token, ())?;
1545
1546 Ok(())
1547 }
1548 }
1549
1550 pub struct DeviceDeriveRawSecretRequest<T0> {
1552 pub wrapped_key: T0,
1553 }
1554
1555 unsafe impl<___E, T0>
1556 ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretRequest<'static>, ___E>
1557 for DeviceDeriveRawSecretRequest<T0>
1558 where
1559 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1560 ___E: ::fidl_next::Encoder,
1561 ___E: ::fidl_next::fuchsia::HandleEncoder,
1562 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1563 {
1564 #[inline]
1565 fn encode(
1566 self,
1567 encoder_: &mut ___E,
1568 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceDeriveRawSecretRequest<'static>>,
1569 _: (),
1570 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1571 ::fidl_next::munge! {
1572 let crate::wire::DeviceDeriveRawSecretRequest {
1573 wrapped_key,
1574
1575 } = out_;
1576 }
1577
1578 ::fidl_next::Encode::encode(self.wrapped_key, encoder_, wrapped_key, (4294967295, ()))?;
1579
1580 Ok(())
1581 }
1582 }
1583
1584 unsafe impl<'a, ___E, T0>
1585 ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretRequest<'static>, ___E>
1586 for &'a DeviceDeriveRawSecretRequest<T0>
1587 where
1588 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1589 ___E: ::fidl_next::Encoder,
1590 ___E: ::fidl_next::fuchsia::HandleEncoder,
1591 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1592 {
1593 #[inline]
1594 fn encode(
1595 self,
1596 encoder_: &mut ___E,
1597 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceDeriveRawSecretRequest<'static>>,
1598 _: (),
1599 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1600 ::fidl_next::munge! {
1601 let crate::wire::DeviceDeriveRawSecretRequest {
1602 wrapped_key,
1603
1604 } = out_;
1605 }
1606
1607 ::fidl_next::Encode::encode(
1608 &self.wrapped_key,
1609 encoder_,
1610 wrapped_key,
1611 (4294967295, ()),
1612 )?;
1613
1614 Ok(())
1615 }
1616 }
1617
1618 pub struct DeviceDeriveRawSecretResponse<T0> {
1620 pub secret: T0,
1621 }
1622
1623 unsafe impl<___E, T0>
1624 ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretResponse<'static>, ___E>
1625 for DeviceDeriveRawSecretResponse<T0>
1626 where
1627 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1628 ___E: ::fidl_next::Encoder,
1629 ___E: ::fidl_next::fuchsia::HandleEncoder,
1630 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1631 {
1632 #[inline]
1633 fn encode(
1634 self,
1635 encoder_: &mut ___E,
1636 out_: &mut ::core::mem::MaybeUninit<
1637 crate::wire::DeviceDeriveRawSecretResponse<'static>,
1638 >,
1639 _: (),
1640 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1641 ::fidl_next::munge! {
1642 let crate::wire::DeviceDeriveRawSecretResponse {
1643 secret,
1644
1645 } = out_;
1646 }
1647
1648 ::fidl_next::Encode::encode(self.secret, encoder_, secret, (4294967295, ()))?;
1649
1650 Ok(())
1651 }
1652 }
1653
1654 unsafe impl<'a, ___E, T0>
1655 ::fidl_next::Encode<crate::wire::DeviceDeriveRawSecretResponse<'static>, ___E>
1656 for &'a DeviceDeriveRawSecretResponse<T0>
1657 where
1658 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1659 ___E: ::fidl_next::Encoder,
1660 ___E: ::fidl_next::fuchsia::HandleEncoder,
1661 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1662 {
1663 #[inline]
1664 fn encode(
1665 self,
1666 encoder_: &mut ___E,
1667 out_: &mut ::core::mem::MaybeUninit<
1668 crate::wire::DeviceDeriveRawSecretResponse<'static>,
1669 >,
1670 _: (),
1671 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1672 ::fidl_next::munge! {
1673 let crate::wire::DeviceDeriveRawSecretResponse {
1674 secret,
1675
1676 } = out_;
1677 }
1678
1679 ::fidl_next::Encode::encode(&self.secret, encoder_, secret, (4294967295, ()))?;
1680
1681 Ok(())
1682 }
1683 }
1684}
1685
1686pub use self::natural::*;
1687
1688#[doc = " Protocol used between block drivers and hardware inline encryption controllers.\n"]
1690#[derive(PartialEq, Debug)]
1691pub struct Controller;
1692
1693impl ::fidl_next::Discoverable for Controller {
1694 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.inlineencryption.Controller";
1695}
1696
1697#[cfg(target_os = "fuchsia")]
1698impl ::fidl_next::HasTransport for Controller {
1699 type Transport = ::fidl_next::fuchsia::zx::Channel;
1700}
1701
1702pub mod controller {
1703 pub mod prelude {
1704 pub use crate::{
1705 Controller, ControllerClientHandler, ControllerLocalClientHandler,
1706 ControllerLocalServerHandler, ControllerServerHandler, controller,
1707 };
1708
1709 pub use crate::natural::ControllerDeriveRawSecretRequest;
1710
1711 pub use crate::natural::ControllerProgramKeySlotRequest;
1712
1713 pub use crate::natural::ControllerDeriveRawSecretResponse;
1714
1715 pub use crate::natural::ControllerProgramKeySlotResponse;
1716 }
1717
1718 pub struct ProgramKeySlot;
1719
1720 impl ::fidl_next::Method for ProgramKeySlot {
1721 const ORDINAL: u64 = 779001281904595687;
1722 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1723 ::fidl_next::protocol::Flexibility::Strict;
1724
1725 type Protocol = crate::Controller;
1726
1727 type Request = crate::wire::ControllerProgramKeySlotRequest<'static>;
1728 }
1729
1730 impl ::fidl_next::TwoWayMethod for ProgramKeySlot {
1731 type Response = ::fidl_next::wire::Result<
1732 'static,
1733 crate::wire::ControllerProgramKeySlotResponse,
1734 ::fidl_next::wire::fuchsia::Status,
1735 >;
1736 }
1737
1738 impl<___R> ::fidl_next::Respond<___R> for ProgramKeySlot {
1739 type Output = ::core::result::Result<
1740 crate::generic::ControllerProgramKeySlotResponse<___R>,
1741 ::fidl_next::never::Never,
1742 >;
1743
1744 fn respond(response: ___R) -> Self::Output {
1745 ::core::result::Result::Ok(crate::generic::ControllerProgramKeySlotResponse {
1746 slot: response,
1747 })
1748 }
1749 }
1750
1751 impl<___R> ::fidl_next::RespondErr<___R> for ProgramKeySlot {
1752 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1753
1754 fn respond_err(response: ___R) -> Self::Output {
1755 ::core::result::Result::Err(response)
1756 }
1757 }
1758
1759 pub struct DeriveRawSecret;
1760
1761 impl ::fidl_next::Method for DeriveRawSecret {
1762 const ORDINAL: u64 = 8161000000921549988;
1763 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1764 ::fidl_next::protocol::Flexibility::Strict;
1765
1766 type Protocol = crate::Controller;
1767
1768 type Request = crate::wire::ControllerDeriveRawSecretRequest<'static>;
1769 }
1770
1771 impl ::fidl_next::TwoWayMethod for DeriveRawSecret {
1772 type Response = ::fidl_next::wire::Result<
1773 'static,
1774 crate::wire::ControllerDeriveRawSecretResponse<'static>,
1775 ::fidl_next::wire::fuchsia::Status,
1776 >;
1777 }
1778
1779 impl<___R> ::fidl_next::Respond<___R> for DeriveRawSecret {
1780 type Output = ::core::result::Result<
1781 crate::generic::ControllerDeriveRawSecretResponse<___R>,
1782 ::fidl_next::never::Never,
1783 >;
1784
1785 fn respond(response: ___R) -> Self::Output {
1786 ::core::result::Result::Ok(crate::generic::ControllerDeriveRawSecretResponse {
1787 secret: response,
1788 })
1789 }
1790 }
1791
1792 impl<___R> ::fidl_next::RespondErr<___R> for DeriveRawSecret {
1793 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1794
1795 fn respond_err(response: ___R) -> Self::Output {
1796 ::core::result::Result::Err(response)
1797 }
1798 }
1799
1800 mod ___detail {
1801 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Controller
1802 where
1803 ___T: ::fidl_next::Transport,
1804 {
1805 type Client = ControllerClient<___T>;
1806 type Server = ControllerServer<___T>;
1807 }
1808
1809 #[repr(transparent)]
1811 pub struct ControllerClient<___T: ::fidl_next::Transport> {
1812 #[allow(dead_code)]
1813 client: ::fidl_next::protocol::Client<___T>,
1814 }
1815
1816 impl<___T> ControllerClient<___T>
1817 where
1818 ___T: ::fidl_next::Transport,
1819 {
1820 pub fn program_key_slot(
1821 &self,
1822
1823 wrapped_key: impl ::fidl_next::Encode<
1824 ::fidl_next::wire::Vector<'static, u8>,
1825 <___T as ::fidl_next::Transport>::SendBuffer,
1826 >,
1827
1828 data_unit_size: impl ::fidl_next::Encode<
1829 ::fidl_next::wire::Uint32,
1830 <___T as ::fidl_next::Transport>::SendBuffer,
1831 >,
1832 ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKeySlot, ___T>
1833 where
1834 <___T as ::fidl_next::Transport>::SendBuffer:
1835 ::fidl_next::encoder::InternalHandleEncoder,
1836 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1837 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1838 {
1839 self.program_key_slot_with(crate::generic::ControllerProgramKeySlotRequest {
1840 wrapped_key,
1841
1842 data_unit_size,
1843 })
1844 }
1845
1846 pub fn program_key_slot_with<___R>(
1847 &self,
1848 request: ___R,
1849 ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKeySlot, ___T>
1850 where
1851 ___R: ::fidl_next::Encode<
1852 crate::wire::ControllerProgramKeySlotRequest<'static>,
1853 <___T as ::fidl_next::Transport>::SendBuffer,
1854 >,
1855 {
1856 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1857 779001281904595687,
1858 <super::ProgramKeySlot as ::fidl_next::Method>::FLEXIBILITY,
1859 request,
1860 ))
1861 }
1862
1863 pub fn derive_raw_secret(
1864 &self,
1865
1866 wrapped_key: impl ::fidl_next::Encode<
1867 ::fidl_next::wire::Vector<'static, u8>,
1868 <___T as ::fidl_next::Transport>::SendBuffer,
1869 >,
1870 ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
1871 where
1872 <___T as ::fidl_next::Transport>::SendBuffer:
1873 ::fidl_next::encoder::InternalHandleEncoder,
1874 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1875 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1876 {
1877 self.derive_raw_secret_with(crate::generic::ControllerDeriveRawSecretRequest {
1878 wrapped_key,
1879 })
1880 }
1881
1882 pub fn derive_raw_secret_with<___R>(
1883 &self,
1884 request: ___R,
1885 ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
1886 where
1887 ___R: ::fidl_next::Encode<
1888 crate::wire::ControllerDeriveRawSecretRequest<'static>,
1889 <___T as ::fidl_next::Transport>::SendBuffer,
1890 >,
1891 {
1892 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1893 8161000000921549988,
1894 <super::DeriveRawSecret as ::fidl_next::Method>::FLEXIBILITY,
1895 request,
1896 ))
1897 }
1898 }
1899
1900 #[repr(transparent)]
1902 pub struct ControllerServer<___T: ::fidl_next::Transport> {
1903 server: ::fidl_next::protocol::Server<___T>,
1904 }
1905
1906 impl<___T> ControllerServer<___T> where ___T: ::fidl_next::Transport {}
1907 }
1908}
1909
1910#[diagnostic::on_unimplemented(
1911 note = "If {Self} implements the non-local ControllerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1912)]
1913
1914pub trait ControllerLocalClientHandler<
1918 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1919 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1920>
1921{
1922}
1923
1924impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Controller
1925where
1926 ___H: ControllerLocalClientHandler<___T>,
1927 ___T: ::fidl_next::Transport,
1928{
1929 async fn on_event(
1930 handler: &mut ___H,
1931 mut message: ::fidl_next::Message<___T>,
1932 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1933 match *message.header().ordinal {
1934 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1935 }
1936 }
1937}
1938
1939#[diagnostic::on_unimplemented(
1940 note = "If {Self} implements the non-local ControllerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1941)]
1942
1943pub trait ControllerLocalServerHandler<
1947 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1948 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1949>
1950{
1951 fn program_key_slot(
1952 &mut self,
1953
1954 request: ::fidl_next::Request<controller::ProgramKeySlot, ___T>,
1955
1956 responder: ::fidl_next::Responder<controller::ProgramKeySlot, ___T>,
1957 ) -> impl ::core::future::Future<Output = ()>;
1958
1959 fn derive_raw_secret(
1960 &mut self,
1961
1962 request: ::fidl_next::Request<controller::DeriveRawSecret, ___T>,
1963
1964 responder: ::fidl_next::Responder<controller::DeriveRawSecret, ___T>,
1965 ) -> impl ::core::future::Future<Output = ()>;
1966}
1967
1968impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Controller
1969where
1970 ___H: ControllerLocalServerHandler<___T>,
1971 ___T: ::fidl_next::Transport,
1972 for<'de> crate::wire::ControllerProgramKeySlotRequest<'de>: ::fidl_next::Decode<
1973 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1974 Constraint = (),
1975 >,
1976 for<'de> crate::wire::ControllerDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
1977 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1978 Constraint = (),
1979 >,
1980{
1981 async fn on_one_way(
1982 handler: &mut ___H,
1983 mut message: ::fidl_next::Message<___T>,
1984 ) -> ::core::result::Result<
1985 (),
1986 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1987 > {
1988 match *message.header().ordinal {
1989 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1990 }
1991 }
1992
1993 async fn on_two_way(
1994 handler: &mut ___H,
1995 mut message: ::fidl_next::Message<___T>,
1996 responder: ::fidl_next::protocol::Responder<___T>,
1997 ) -> ::core::result::Result<
1998 (),
1999 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2000 > {
2001 match *message.header().ordinal {
2002 779001281904595687 => {
2003 let responder = ::fidl_next::Responder::from_untyped(responder);
2004
2005 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2006 Ok(decoded) => {
2007 handler
2008 .program_key_slot(
2009 ::fidl_next::Request::from_decoded(decoded),
2010 responder,
2011 )
2012 .await;
2013 Ok(())
2014 }
2015 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2016 ordinal: 779001281904595687,
2017 error,
2018 }),
2019 }
2020 }
2021
2022 8161000000921549988 => {
2023 let responder = ::fidl_next::Responder::from_untyped(responder);
2024
2025 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2026 Ok(decoded) => {
2027 handler
2028 .derive_raw_secret(
2029 ::fidl_next::Request::from_decoded(decoded),
2030 responder,
2031 )
2032 .await;
2033 Ok(())
2034 }
2035 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2036 ordinal: 8161000000921549988,
2037 error,
2038 }),
2039 }
2040 }
2041
2042 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2043 }
2044 }
2045}
2046
2047pub trait ControllerClientHandler<
2051 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2052 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2053>
2054{
2055}
2056
2057impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Controller
2058where
2059 ___H: ControllerClientHandler<___T> + ::core::marker::Send,
2060 ___T: ::fidl_next::Transport,
2061{
2062 async fn on_event(
2063 handler: &mut ___H,
2064 mut message: ::fidl_next::Message<___T>,
2065 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2066 match *message.header().ordinal {
2067 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2068 }
2069 }
2070}
2071
2072pub trait ControllerServerHandler<
2076 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2077 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2078>
2079{
2080 fn program_key_slot(
2081 &mut self,
2082
2083 request: ::fidl_next::Request<controller::ProgramKeySlot, ___T>,
2084
2085 responder: ::fidl_next::Responder<controller::ProgramKeySlot, ___T>,
2086 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2087
2088 fn derive_raw_secret(
2089 &mut self,
2090
2091 request: ::fidl_next::Request<controller::DeriveRawSecret, ___T>,
2092
2093 responder: ::fidl_next::Responder<controller::DeriveRawSecret, ___T>,
2094 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2095}
2096
2097impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Controller
2098where
2099 ___H: ControllerServerHandler<___T> + ::core::marker::Send,
2100 ___T: ::fidl_next::Transport,
2101 for<'de> crate::wire::ControllerProgramKeySlotRequest<'de>: ::fidl_next::Decode<
2102 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2103 Constraint = (),
2104 >,
2105 for<'de> crate::wire::ControllerDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
2106 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2107 Constraint = (),
2108 >,
2109{
2110 async fn on_one_way(
2111 handler: &mut ___H,
2112 mut message: ::fidl_next::Message<___T>,
2113 ) -> ::core::result::Result<
2114 (),
2115 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2116 > {
2117 match *message.header().ordinal {
2118 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2119 }
2120 }
2121
2122 async fn on_two_way(
2123 handler: &mut ___H,
2124 mut message: ::fidl_next::Message<___T>,
2125 responder: ::fidl_next::protocol::Responder<___T>,
2126 ) -> ::core::result::Result<
2127 (),
2128 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2129 > {
2130 match *message.header().ordinal {
2131 779001281904595687 => {
2132 let responder = ::fidl_next::Responder::from_untyped(responder);
2133
2134 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2135 Ok(decoded) => {
2136 handler
2137 .program_key_slot(
2138 ::fidl_next::Request::from_decoded(decoded),
2139 responder,
2140 )
2141 .await;
2142 Ok(())
2143 }
2144 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2145 ordinal: 779001281904595687,
2146 error,
2147 }),
2148 }
2149 }
2150
2151 8161000000921549988 => {
2152 let responder = ::fidl_next::Responder::from_untyped(responder);
2153
2154 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2155 Ok(decoded) => {
2156 handler
2157 .derive_raw_secret(
2158 ::fidl_next::Request::from_decoded(decoded),
2159 responder,
2160 )
2161 .await;
2162 Ok(())
2163 }
2164 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2165 ordinal: 8161000000921549988,
2166 error,
2167 }),
2168 }
2169 }
2170
2171 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2172 }
2173 }
2174}
2175
2176impl<___T> ControllerClientHandler<___T> for ::fidl_next::IgnoreEvents where
2177 ___T: ::fidl_next::Transport
2178{
2179}
2180
2181impl<___H, ___T> ControllerLocalClientHandler<___T> for ::fidl_next::Local<___H>
2182where
2183 ___H: ControllerClientHandler<___T>,
2184 ___T: ::fidl_next::Transport,
2185{
2186}
2187
2188impl<___H, ___T> ControllerLocalServerHandler<___T> for ::fidl_next::Local<___H>
2189where
2190 ___H: ControllerServerHandler<___T>,
2191 ___T: ::fidl_next::Transport,
2192{
2193 async fn program_key_slot(
2194 &mut self,
2195
2196 request: ::fidl_next::Request<controller::ProgramKeySlot, ___T>,
2197
2198 responder: ::fidl_next::Responder<controller::ProgramKeySlot, ___T>,
2199 ) {
2200 ___H::program_key_slot(&mut self.0, request, responder).await
2201 }
2202
2203 async fn derive_raw_secret(
2204 &mut self,
2205
2206 request: ::fidl_next::Request<controller::DeriveRawSecret, ___T>,
2207
2208 responder: ::fidl_next::Responder<controller::DeriveRawSecret, ___T>,
2209 ) {
2210 ___H::derive_raw_secret(&mut self.0, request, responder).await
2211 }
2212}
2213
2214#[derive(PartialEq, Debug)]
2216pub struct Device;
2217
2218impl ::fidl_next::Discoverable for Device {
2219 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.inlineencryption.Device";
2220}
2221
2222#[cfg(target_os = "fuchsia")]
2223impl ::fidl_next::HasTransport for Device {
2224 type Transport = ::fidl_next::fuchsia::zx::Channel;
2225}
2226
2227pub mod device {
2228 pub mod prelude {
2229 pub use crate::{
2230 Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
2231 DeviceServerHandler, device,
2232 };
2233
2234 pub use crate::natural::DeviceDeriveRawSecretRequest;
2235
2236 pub use crate::natural::DeviceProgramKeyRequest;
2237
2238 pub use crate::natural::DeviceDeriveRawSecretResponse;
2239
2240 pub use crate::natural::DeviceProgramKeyResponse;
2241 }
2242
2243 pub struct ProgramKey;
2244
2245 impl ::fidl_next::Method for ProgramKey {
2246 const ORDINAL: u64 = 3476811648835288272;
2247 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2248 ::fidl_next::protocol::Flexibility::Strict;
2249
2250 type Protocol = crate::Device;
2251
2252 type Request = crate::wire::DeviceProgramKeyRequest<'static>;
2253 }
2254
2255 impl ::fidl_next::TwoWayMethod for ProgramKey {
2256 type Response = ::fidl_next::wire::Result<
2257 'static,
2258 crate::wire::DeviceProgramKeyResponse,
2259 ::fidl_next::wire::fuchsia::Status,
2260 >;
2261 }
2262
2263 impl<___R> ::fidl_next::Respond<___R> for ProgramKey {
2264 type Output = ::core::result::Result<
2265 crate::generic::DeviceProgramKeyResponse<___R>,
2266 ::fidl_next::never::Never,
2267 >;
2268
2269 fn respond(response: ___R) -> Self::Output {
2270 ::core::result::Result::Ok(crate::generic::DeviceProgramKeyResponse {
2271 key_token: response,
2272 })
2273 }
2274 }
2275
2276 impl<___R> ::fidl_next::RespondErr<___R> for ProgramKey {
2277 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2278
2279 fn respond_err(response: ___R) -> Self::Output {
2280 ::core::result::Result::Err(response)
2281 }
2282 }
2283
2284 pub struct DeriveRawSecret;
2285
2286 impl ::fidl_next::Method for DeriveRawSecret {
2287 const ORDINAL: u64 = 6941052927753550292;
2288 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2289 ::fidl_next::protocol::Flexibility::Strict;
2290
2291 type Protocol = crate::Device;
2292
2293 type Request = crate::wire::DeviceDeriveRawSecretRequest<'static>;
2294 }
2295
2296 impl ::fidl_next::TwoWayMethod for DeriveRawSecret {
2297 type Response = ::fidl_next::wire::Result<
2298 'static,
2299 crate::wire::DeviceDeriveRawSecretResponse<'static>,
2300 ::fidl_next::wire::fuchsia::Status,
2301 >;
2302 }
2303
2304 impl<___R> ::fidl_next::Respond<___R> for DeriveRawSecret {
2305 type Output = ::core::result::Result<
2306 crate::generic::DeviceDeriveRawSecretResponse<___R>,
2307 ::fidl_next::never::Never,
2308 >;
2309
2310 fn respond(response: ___R) -> Self::Output {
2311 ::core::result::Result::Ok(crate::generic::DeviceDeriveRawSecretResponse {
2312 secret: response,
2313 })
2314 }
2315 }
2316
2317 impl<___R> ::fidl_next::RespondErr<___R> for DeriveRawSecret {
2318 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2319
2320 fn respond_err(response: ___R) -> Self::Output {
2321 ::core::result::Result::Err(response)
2322 }
2323 }
2324
2325 mod ___detail {
2326 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
2327 where
2328 ___T: ::fidl_next::Transport,
2329 {
2330 type Client = DeviceClient<___T>;
2331 type Server = DeviceServer<___T>;
2332 }
2333
2334 #[repr(transparent)]
2336 pub struct DeviceClient<___T: ::fidl_next::Transport> {
2337 #[allow(dead_code)]
2338 client: ::fidl_next::protocol::Client<___T>,
2339 }
2340
2341 impl<___T> DeviceClient<___T>
2342 where
2343 ___T: ::fidl_next::Transport,
2344 {
2345 #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available slot and returns a `key_token` capability representing that slot. The\n returned `key_token` must be registered with a block session via\n `fuchsia.storage.block/Session.RegisterKey` before the slot can be used in block I/O\n requests. All slots programmed via the connection this method is called on will be evicted\n once the connection is dropped. It is not possible to evict individual keys (not for any\n technical reasons; a need for this has not yet arisen). `wrapped_key` must be a key wrapped\n by the inline encryption hardware (in the same session/boot) via a separate mechanism to\n 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"]
2346 pub fn program_key(
2347 &self,
2348
2349 wrapped_key: impl ::fidl_next::Encode<
2350 ::fidl_next::wire::Vector<'static, u8>,
2351 <___T as ::fidl_next::Transport>::SendBuffer,
2352 >,
2353
2354 data_unit_size: impl ::fidl_next::Encode<
2355 ::fidl_next::wire::Uint32,
2356 <___T as ::fidl_next::Transport>::SendBuffer,
2357 >,
2358 ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKey, ___T>
2359 where
2360 <___T as ::fidl_next::Transport>::SendBuffer:
2361 ::fidl_next::encoder::InternalHandleEncoder,
2362 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2363 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2364 {
2365 self.program_key_with(crate::generic::DeviceProgramKeyRequest {
2366 wrapped_key,
2367
2368 data_unit_size,
2369 })
2370 }
2371
2372 #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available slot and returns a `key_token` capability representing that slot. The\n returned `key_token` must be registered with a block session via\n `fuchsia.storage.block/Session.RegisterKey` before the slot can be used in block I/O\n requests. All slots programmed via the connection this method is called on will be evicted\n once the connection is dropped. It is not possible to evict individual keys (not for any\n technical reasons; a need for this has not yet arisen). `wrapped_key` must be a key wrapped\n by the inline encryption hardware (in the same session/boot) via a separate mechanism to\n 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"]
2373 pub fn program_key_with<___R>(
2374 &self,
2375 request: ___R,
2376 ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKey, ___T>
2377 where
2378 ___R: ::fidl_next::Encode<
2379 crate::wire::DeviceProgramKeyRequest<'static>,
2380 <___T as ::fidl_next::Transport>::SendBuffer,
2381 >,
2382 {
2383 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2384 3476811648835288272,
2385 <super::ProgramKey as ::fidl_next::Method>::FLEXIBILITY,
2386 request,
2387 ))
2388 }
2389
2390 #[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"]
2391 pub fn derive_raw_secret(
2392 &self,
2393
2394 wrapped_key: impl ::fidl_next::Encode<
2395 ::fidl_next::wire::Vector<'static, u8>,
2396 <___T as ::fidl_next::Transport>::SendBuffer,
2397 >,
2398 ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
2399 where
2400 <___T as ::fidl_next::Transport>::SendBuffer:
2401 ::fidl_next::encoder::InternalHandleEncoder,
2402 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2403 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2404 {
2405 self.derive_raw_secret_with(crate::generic::DeviceDeriveRawSecretRequest {
2406 wrapped_key,
2407 })
2408 }
2409
2410 #[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"]
2411 pub fn derive_raw_secret_with<___R>(
2412 &self,
2413 request: ___R,
2414 ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
2415 where
2416 ___R: ::fidl_next::Encode<
2417 crate::wire::DeviceDeriveRawSecretRequest<'static>,
2418 <___T as ::fidl_next::Transport>::SendBuffer,
2419 >,
2420 {
2421 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2422 6941052927753550292,
2423 <super::DeriveRawSecret as ::fidl_next::Method>::FLEXIBILITY,
2424 request,
2425 ))
2426 }
2427 }
2428
2429 #[repr(transparent)]
2431 pub struct DeviceServer<___T: ::fidl_next::Transport> {
2432 server: ::fidl_next::protocol::Server<___T>,
2433 }
2434
2435 impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
2436 }
2437}
2438
2439#[diagnostic::on_unimplemented(
2440 note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2441)]
2442
2443pub trait DeviceLocalClientHandler<
2447 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2448 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2449>
2450{
2451}
2452
2453impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
2454where
2455 ___H: DeviceLocalClientHandler<___T>,
2456 ___T: ::fidl_next::Transport,
2457{
2458 async fn on_event(
2459 handler: &mut ___H,
2460 mut message: ::fidl_next::Message<___T>,
2461 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2462 match *message.header().ordinal {
2463 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2464 }
2465 }
2466}
2467
2468#[diagnostic::on_unimplemented(
2469 note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2470)]
2471
2472pub trait DeviceLocalServerHandler<
2476 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2477 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2478>
2479{
2480 #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available slot and returns a `key_token` capability representing that slot. The\n returned `key_token` must be registered with a block session via\n `fuchsia.storage.block/Session.RegisterKey` before the slot can be used in block I/O\n requests. All slots programmed via the connection this method is called on will be evicted\n once the connection is dropped. It is not possible to evict individual keys (not for any\n technical reasons; a need for this has not yet arisen). `wrapped_key` must be a key wrapped\n by the inline encryption hardware (in the same session/boot) via a separate mechanism to\n 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"]
2481 fn program_key(
2482 &mut self,
2483
2484 request: ::fidl_next::Request<device::ProgramKey, ___T>,
2485
2486 responder: ::fidl_next::Responder<device::ProgramKey, ___T>,
2487 ) -> impl ::core::future::Future<Output = ()>;
2488
2489 #[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"]
2490 fn derive_raw_secret(
2491 &mut self,
2492
2493 request: ::fidl_next::Request<device::DeriveRawSecret, ___T>,
2494
2495 responder: ::fidl_next::Responder<device::DeriveRawSecret, ___T>,
2496 ) -> impl ::core::future::Future<Output = ()>;
2497}
2498
2499impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
2500where
2501 ___H: DeviceLocalServerHandler<___T>,
2502 ___T: ::fidl_next::Transport,
2503 for<'de> crate::wire::DeviceProgramKeyRequest<'de>: ::fidl_next::Decode<
2504 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2505 Constraint = (),
2506 >,
2507 for<'de> crate::wire::DeviceDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
2508 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2509 Constraint = (),
2510 >,
2511{
2512 async fn on_one_way(
2513 handler: &mut ___H,
2514 mut message: ::fidl_next::Message<___T>,
2515 ) -> ::core::result::Result<
2516 (),
2517 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2518 > {
2519 match *message.header().ordinal {
2520 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2521 }
2522 }
2523
2524 async fn on_two_way(
2525 handler: &mut ___H,
2526 mut message: ::fidl_next::Message<___T>,
2527 responder: ::fidl_next::protocol::Responder<___T>,
2528 ) -> ::core::result::Result<
2529 (),
2530 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2531 > {
2532 match *message.header().ordinal {
2533 3476811648835288272 => {
2534 let responder = ::fidl_next::Responder::from_untyped(responder);
2535
2536 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2537 Ok(decoded) => {
2538 handler
2539 .program_key(::fidl_next::Request::from_decoded(decoded), responder)
2540 .await;
2541 Ok(())
2542 }
2543 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2544 ordinal: 3476811648835288272,
2545 error,
2546 }),
2547 }
2548 }
2549
2550 6941052927753550292 => {
2551 let responder = ::fidl_next::Responder::from_untyped(responder);
2552
2553 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2554 Ok(decoded) => {
2555 handler
2556 .derive_raw_secret(
2557 ::fidl_next::Request::from_decoded(decoded),
2558 responder,
2559 )
2560 .await;
2561 Ok(())
2562 }
2563 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2564 ordinal: 6941052927753550292,
2565 error,
2566 }),
2567 }
2568 }
2569
2570 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2571 }
2572 }
2573}
2574
2575pub trait DeviceClientHandler<
2579 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2580 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2581>
2582{
2583}
2584
2585impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
2586where
2587 ___H: DeviceClientHandler<___T> + ::core::marker::Send,
2588 ___T: ::fidl_next::Transport,
2589{
2590 async fn on_event(
2591 handler: &mut ___H,
2592 mut message: ::fidl_next::Message<___T>,
2593 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2594 match *message.header().ordinal {
2595 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2596 }
2597 }
2598}
2599
2600pub trait DeviceServerHandler<
2604 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2605 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2606>
2607{
2608 #[doc = " Programs the ephemerally wrapped `wrapped_key` into the inline encryption hardware in the\n next available slot and returns a `key_token` capability representing that slot. The\n returned `key_token` must be registered with a block session via\n `fuchsia.storage.block/Session.RegisterKey` before the slot can be used in block I/O\n requests. All slots programmed via the connection this method is called on will be evicted\n once the connection is dropped. It is not possible to evict individual keys (not for any\n technical reasons; a need for this has not yet arisen). `wrapped_key` must be a key wrapped\n by the inline encryption hardware (in the same session/boot) via a separate mechanism to\n 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"]
2609 fn program_key(
2610 &mut self,
2611
2612 request: ::fidl_next::Request<device::ProgramKey, ___T>,
2613
2614 responder: ::fidl_next::Responder<device::ProgramKey, ___T>,
2615 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2616
2617 #[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"]
2618 fn derive_raw_secret(
2619 &mut self,
2620
2621 request: ::fidl_next::Request<device::DeriveRawSecret, ___T>,
2622
2623 responder: ::fidl_next::Responder<device::DeriveRawSecret, ___T>,
2624 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2625}
2626
2627impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
2628where
2629 ___H: DeviceServerHandler<___T> + ::core::marker::Send,
2630 ___T: ::fidl_next::Transport,
2631 for<'de> crate::wire::DeviceProgramKeyRequest<'de>: ::fidl_next::Decode<
2632 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2633 Constraint = (),
2634 >,
2635 for<'de> crate::wire::DeviceDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
2636 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2637 Constraint = (),
2638 >,
2639{
2640 async fn on_one_way(
2641 handler: &mut ___H,
2642 mut message: ::fidl_next::Message<___T>,
2643 ) -> ::core::result::Result<
2644 (),
2645 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2646 > {
2647 match *message.header().ordinal {
2648 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2649 }
2650 }
2651
2652 async fn on_two_way(
2653 handler: &mut ___H,
2654 mut message: ::fidl_next::Message<___T>,
2655 responder: ::fidl_next::protocol::Responder<___T>,
2656 ) -> ::core::result::Result<
2657 (),
2658 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2659 > {
2660 match *message.header().ordinal {
2661 3476811648835288272 => {
2662 let responder = ::fidl_next::Responder::from_untyped(responder);
2663
2664 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2665 Ok(decoded) => {
2666 handler
2667 .program_key(::fidl_next::Request::from_decoded(decoded), responder)
2668 .await;
2669 Ok(())
2670 }
2671 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2672 ordinal: 3476811648835288272,
2673 error,
2674 }),
2675 }
2676 }
2677
2678 6941052927753550292 => {
2679 let responder = ::fidl_next::Responder::from_untyped(responder);
2680
2681 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2682 Ok(decoded) => {
2683 handler
2684 .derive_raw_secret(
2685 ::fidl_next::Request::from_decoded(decoded),
2686 responder,
2687 )
2688 .await;
2689 Ok(())
2690 }
2691 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2692 ordinal: 6941052927753550292,
2693 error,
2694 }),
2695 }
2696 }
2697
2698 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2699 }
2700 }
2701}
2702
2703impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
2704{}
2705
2706impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
2707where
2708 ___H: DeviceClientHandler<___T>,
2709 ___T: ::fidl_next::Transport,
2710{
2711}
2712
2713impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
2714where
2715 ___H: DeviceServerHandler<___T>,
2716 ___T: ::fidl_next::Transport,
2717{
2718 async fn program_key(
2719 &mut self,
2720
2721 request: ::fidl_next::Request<device::ProgramKey, ___T>,
2722
2723 responder: ::fidl_next::Responder<device::ProgramKey, ___T>,
2724 ) {
2725 ___H::program_key(&mut self.0, request, responder).await
2726 }
2727
2728 async fn derive_raw_secret(
2729 &mut self,
2730
2731 request: ::fidl_next::Request<device::DeriveRawSecret, ___T>,
2732
2733 responder: ::fidl_next::Responder<device::DeriveRawSecret, ___T>,
2734 ) {
2735 ___H::derive_raw_secret(&mut self.0, request, responder).await
2736 }
2737}
2738
2739#[doc = " A driver transport variant of the `Controller` protocol.\n"]
2741#[derive(PartialEq, Debug)]
2742pub struct DriverDevice;
2743
2744impl ::fidl_next::Discoverable for DriverDevice {
2745 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.inlineencryption.DriverDevice";
2746}
2747
2748#[cfg(feature = "driver")]
2749impl ::fidl_next::HasTransport for DriverDevice {
2750 type Transport = ::fdf_fidl::DriverChannel;
2751}
2752
2753pub mod driver_device {
2754 pub mod prelude {
2755 pub use crate::{
2756 DriverDevice, DriverDeviceClientHandler, DriverDeviceLocalClientHandler,
2757 DriverDeviceLocalServerHandler, DriverDeviceServerHandler, driver_device,
2758 };
2759
2760 pub use crate::natural::ControllerDeriveRawSecretRequest;
2761
2762 pub use crate::natural::ControllerProgramKeySlotRequest;
2763
2764 pub use crate::natural::ControllerDeriveRawSecretResponse;
2765
2766 pub use crate::natural::ControllerProgramKeySlotResponse;
2767 }
2768
2769 pub struct ProgramKeySlot;
2770
2771 impl ::fidl_next::Method for ProgramKeySlot {
2772 const ORDINAL: u64 = 779001281904595687;
2773 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2774 ::fidl_next::protocol::Flexibility::Strict;
2775
2776 type Protocol = crate::DriverDevice;
2777
2778 type Request = crate::wire::ControllerProgramKeySlotRequest<'static>;
2779 }
2780
2781 impl ::fidl_next::TwoWayMethod for ProgramKeySlot {
2782 type Response = ::fidl_next::wire::Result<
2783 'static,
2784 crate::wire::ControllerProgramKeySlotResponse,
2785 ::fidl_next::wire::fuchsia::Status,
2786 >;
2787 }
2788
2789 impl<___R> ::fidl_next::Respond<___R> for ProgramKeySlot {
2790 type Output = ::core::result::Result<
2791 crate::generic::ControllerProgramKeySlotResponse<___R>,
2792 ::fidl_next::never::Never,
2793 >;
2794
2795 fn respond(response: ___R) -> Self::Output {
2796 ::core::result::Result::Ok(crate::generic::ControllerProgramKeySlotResponse {
2797 slot: response,
2798 })
2799 }
2800 }
2801
2802 impl<___R> ::fidl_next::RespondErr<___R> for ProgramKeySlot {
2803 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2804
2805 fn respond_err(response: ___R) -> Self::Output {
2806 ::core::result::Result::Err(response)
2807 }
2808 }
2809
2810 pub struct DeriveRawSecret;
2811
2812 impl ::fidl_next::Method for DeriveRawSecret {
2813 const ORDINAL: u64 = 8161000000921549988;
2814 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2815 ::fidl_next::protocol::Flexibility::Strict;
2816
2817 type Protocol = crate::DriverDevice;
2818
2819 type Request = crate::wire::ControllerDeriveRawSecretRequest<'static>;
2820 }
2821
2822 impl ::fidl_next::TwoWayMethod for DeriveRawSecret {
2823 type Response = ::fidl_next::wire::Result<
2824 'static,
2825 crate::wire::ControllerDeriveRawSecretResponse<'static>,
2826 ::fidl_next::wire::fuchsia::Status,
2827 >;
2828 }
2829
2830 impl<___R> ::fidl_next::Respond<___R> for DeriveRawSecret {
2831 type Output = ::core::result::Result<
2832 crate::generic::ControllerDeriveRawSecretResponse<___R>,
2833 ::fidl_next::never::Never,
2834 >;
2835
2836 fn respond(response: ___R) -> Self::Output {
2837 ::core::result::Result::Ok(crate::generic::ControllerDeriveRawSecretResponse {
2838 secret: response,
2839 })
2840 }
2841 }
2842
2843 impl<___R> ::fidl_next::RespondErr<___R> for DeriveRawSecret {
2844 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2845
2846 fn respond_err(response: ___R) -> Self::Output {
2847 ::core::result::Result::Err(response)
2848 }
2849 }
2850
2851 mod ___detail {
2852 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::DriverDevice
2853 where
2854 ___T: ::fidl_next::Transport,
2855 {
2856 type Client = DriverDeviceClient<___T>;
2857 type Server = DriverDeviceServer<___T>;
2858 }
2859
2860 #[repr(transparent)]
2862 pub struct DriverDeviceClient<___T: ::fidl_next::Transport> {
2863 #[allow(dead_code)]
2864 client: ::fidl_next::protocol::Client<___T>,
2865 }
2866
2867 impl<___T> DriverDeviceClient<___T>
2868 where
2869 ___T: ::fidl_next::Transport,
2870 {
2871 pub fn program_key_slot(
2872 &self,
2873
2874 wrapped_key: impl ::fidl_next::Encode<
2875 ::fidl_next::wire::Vector<'static, u8>,
2876 <___T as ::fidl_next::Transport>::SendBuffer,
2877 >,
2878
2879 data_unit_size: impl ::fidl_next::Encode<
2880 ::fidl_next::wire::Uint32,
2881 <___T as ::fidl_next::Transport>::SendBuffer,
2882 >,
2883 ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKeySlot, ___T>
2884 where
2885 <___T as ::fidl_next::Transport>::SendBuffer:
2886 ::fidl_next::encoder::InternalHandleEncoder,
2887 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2888 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2889 {
2890 self.program_key_slot_with(crate::generic::ControllerProgramKeySlotRequest {
2891 wrapped_key,
2892
2893 data_unit_size,
2894 })
2895 }
2896
2897 pub fn program_key_slot_with<___R>(
2898 &self,
2899 request: ___R,
2900 ) -> ::fidl_next::TwoWayFuture<'_, super::ProgramKeySlot, ___T>
2901 where
2902 ___R: ::fidl_next::Encode<
2903 crate::wire::ControllerProgramKeySlotRequest<'static>,
2904 <___T as ::fidl_next::Transport>::SendBuffer,
2905 >,
2906 {
2907 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2908 779001281904595687,
2909 <super::ProgramKeySlot as ::fidl_next::Method>::FLEXIBILITY,
2910 request,
2911 ))
2912 }
2913
2914 pub fn derive_raw_secret(
2915 &self,
2916
2917 wrapped_key: impl ::fidl_next::Encode<
2918 ::fidl_next::wire::Vector<'static, u8>,
2919 <___T as ::fidl_next::Transport>::SendBuffer,
2920 >,
2921 ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
2922 where
2923 <___T as ::fidl_next::Transport>::SendBuffer:
2924 ::fidl_next::encoder::InternalHandleEncoder,
2925 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2926 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2927 {
2928 self.derive_raw_secret_with(crate::generic::ControllerDeriveRawSecretRequest {
2929 wrapped_key,
2930 })
2931 }
2932
2933 pub fn derive_raw_secret_with<___R>(
2934 &self,
2935 request: ___R,
2936 ) -> ::fidl_next::TwoWayFuture<'_, super::DeriveRawSecret, ___T>
2937 where
2938 ___R: ::fidl_next::Encode<
2939 crate::wire::ControllerDeriveRawSecretRequest<'static>,
2940 <___T as ::fidl_next::Transport>::SendBuffer,
2941 >,
2942 {
2943 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2944 8161000000921549988,
2945 <super::DeriveRawSecret as ::fidl_next::Method>::FLEXIBILITY,
2946 request,
2947 ))
2948 }
2949 }
2950
2951 #[repr(transparent)]
2953 pub struct DriverDeviceServer<___T: ::fidl_next::Transport> {
2954 server: ::fidl_next::protocol::Server<___T>,
2955 }
2956
2957 impl<___T> DriverDeviceServer<___T> where ___T: ::fidl_next::Transport {}
2958 }
2959}
2960
2961#[diagnostic::on_unimplemented(
2962 note = "If {Self} implements the non-local DriverDeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2963)]
2964
2965pub trait DriverDeviceLocalClientHandler<
2969 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
2970 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
2971>
2972{
2973}
2974
2975impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for DriverDevice
2976where
2977 ___H: DriverDeviceLocalClientHandler<___T>,
2978 ___T: ::fidl_next::Transport,
2979{
2980 async fn on_event(
2981 handler: &mut ___H,
2982 mut message: ::fidl_next::Message<___T>,
2983 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2984 match *message.header().ordinal {
2985 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2986 }
2987 }
2988}
2989
2990#[diagnostic::on_unimplemented(
2991 note = "If {Self} implements the non-local DriverDeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2992)]
2993
2994pub trait DriverDeviceLocalServerHandler<
2998 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
2999 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3000>
3001{
3002 fn program_key_slot(
3003 &mut self,
3004
3005 request: ::fidl_next::Request<driver_device::ProgramKeySlot, ___T>,
3006
3007 responder: ::fidl_next::Responder<driver_device::ProgramKeySlot, ___T>,
3008 ) -> impl ::core::future::Future<Output = ()>;
3009
3010 fn derive_raw_secret(
3011 &mut self,
3012
3013 request: ::fidl_next::Request<driver_device::DeriveRawSecret, ___T>,
3014
3015 responder: ::fidl_next::Responder<driver_device::DeriveRawSecret, ___T>,
3016 ) -> impl ::core::future::Future<Output = ()>;
3017}
3018
3019impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for DriverDevice
3020where
3021 ___H: DriverDeviceLocalServerHandler<___T>,
3022 ___T: ::fidl_next::Transport,
3023 for<'de> crate::wire::ControllerProgramKeySlotRequest<'de>: ::fidl_next::Decode<
3024 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3025 Constraint = (),
3026 >,
3027 for<'de> crate::wire::ControllerDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
3028 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3029 Constraint = (),
3030 >,
3031{
3032 async fn on_one_way(
3033 handler: &mut ___H,
3034 mut message: ::fidl_next::Message<___T>,
3035 ) -> ::core::result::Result<
3036 (),
3037 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3038 > {
3039 match *message.header().ordinal {
3040 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3041 }
3042 }
3043
3044 async fn on_two_way(
3045 handler: &mut ___H,
3046 mut message: ::fidl_next::Message<___T>,
3047 responder: ::fidl_next::protocol::Responder<___T>,
3048 ) -> ::core::result::Result<
3049 (),
3050 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3051 > {
3052 match *message.header().ordinal {
3053 779001281904595687 => {
3054 let responder = ::fidl_next::Responder::from_untyped(responder);
3055
3056 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3057 Ok(decoded) => {
3058 handler
3059 .program_key_slot(
3060 ::fidl_next::Request::from_decoded(decoded),
3061 responder,
3062 )
3063 .await;
3064 Ok(())
3065 }
3066 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3067 ordinal: 779001281904595687,
3068 error,
3069 }),
3070 }
3071 }
3072
3073 8161000000921549988 => {
3074 let responder = ::fidl_next::Responder::from_untyped(responder);
3075
3076 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3077 Ok(decoded) => {
3078 handler
3079 .derive_raw_secret(
3080 ::fidl_next::Request::from_decoded(decoded),
3081 responder,
3082 )
3083 .await;
3084 Ok(())
3085 }
3086 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3087 ordinal: 8161000000921549988,
3088 error,
3089 }),
3090 }
3091 }
3092
3093 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3094 }
3095 }
3096}
3097
3098pub trait DriverDeviceClientHandler<
3102 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
3103 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3104>
3105{
3106}
3107
3108impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for DriverDevice
3109where
3110 ___H: DriverDeviceClientHandler<___T> + ::core::marker::Send,
3111 ___T: ::fidl_next::Transport,
3112{
3113 async fn on_event(
3114 handler: &mut ___H,
3115 mut message: ::fidl_next::Message<___T>,
3116 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3117 match *message.header().ordinal {
3118 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3119 }
3120 }
3121}
3122
3123pub trait DriverDeviceServerHandler<
3127 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
3128 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
3129>
3130{
3131 fn program_key_slot(
3132 &mut self,
3133
3134 request: ::fidl_next::Request<driver_device::ProgramKeySlot, ___T>,
3135
3136 responder: ::fidl_next::Responder<driver_device::ProgramKeySlot, ___T>,
3137 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3138
3139 fn derive_raw_secret(
3140 &mut self,
3141
3142 request: ::fidl_next::Request<driver_device::DeriveRawSecret, ___T>,
3143
3144 responder: ::fidl_next::Responder<driver_device::DeriveRawSecret, ___T>,
3145 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3146}
3147
3148impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for DriverDevice
3149where
3150 ___H: DriverDeviceServerHandler<___T> + ::core::marker::Send,
3151 ___T: ::fidl_next::Transport,
3152 for<'de> crate::wire::ControllerProgramKeySlotRequest<'de>: ::fidl_next::Decode<
3153 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3154 Constraint = (),
3155 >,
3156 for<'de> crate::wire::ControllerDeriveRawSecretRequest<'de>: ::fidl_next::Decode<
3157 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3158 Constraint = (),
3159 >,
3160{
3161 async fn on_one_way(
3162 handler: &mut ___H,
3163 mut message: ::fidl_next::Message<___T>,
3164 ) -> ::core::result::Result<
3165 (),
3166 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3167 > {
3168 match *message.header().ordinal {
3169 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3170 }
3171 }
3172
3173 async fn on_two_way(
3174 handler: &mut ___H,
3175 mut message: ::fidl_next::Message<___T>,
3176 responder: ::fidl_next::protocol::Responder<___T>,
3177 ) -> ::core::result::Result<
3178 (),
3179 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3180 > {
3181 match *message.header().ordinal {
3182 779001281904595687 => {
3183 let responder = ::fidl_next::Responder::from_untyped(responder);
3184
3185 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3186 Ok(decoded) => {
3187 handler
3188 .program_key_slot(
3189 ::fidl_next::Request::from_decoded(decoded),
3190 responder,
3191 )
3192 .await;
3193 Ok(())
3194 }
3195 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3196 ordinal: 779001281904595687,
3197 error,
3198 }),
3199 }
3200 }
3201
3202 8161000000921549988 => {
3203 let responder = ::fidl_next::Responder::from_untyped(responder);
3204
3205 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3206 Ok(decoded) => {
3207 handler
3208 .derive_raw_secret(
3209 ::fidl_next::Request::from_decoded(decoded),
3210 responder,
3211 )
3212 .await;
3213 Ok(())
3214 }
3215 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3216 ordinal: 8161000000921549988,
3217 error,
3218 }),
3219 }
3220 }
3221
3222 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3223 }
3224 }
3225}
3226
3227impl<___T> DriverDeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where
3228 ___T: ::fidl_next::Transport
3229{
3230}
3231
3232impl<___H, ___T> DriverDeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
3233where
3234 ___H: DriverDeviceClientHandler<___T>,
3235 ___T: ::fidl_next::Transport,
3236{
3237}
3238
3239impl<___H, ___T> DriverDeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
3240where
3241 ___H: DriverDeviceServerHandler<___T>,
3242 ___T: ::fidl_next::Transport,
3243{
3244 async fn program_key_slot(
3245 &mut self,
3246
3247 request: ::fidl_next::Request<driver_device::ProgramKeySlot, ___T>,
3248
3249 responder: ::fidl_next::Responder<driver_device::ProgramKeySlot, ___T>,
3250 ) {
3251 ___H::program_key_slot(&mut self.0, request, responder).await
3252 }
3253
3254 async fn derive_raw_secret(
3255 &mut self,
3256
3257 request: ::fidl_next::Request<driver_device::DeriveRawSecret, ___T>,
3258
3259 responder: ::fidl_next::Responder<driver_device::DeriveRawSecret, ___T>,
3260 ) {
3261 ___H::derive_raw_secret(&mut self.0, request, responder).await
3262 }
3263}
3264
3265pub use fidl_next_common_fuchsia_hardware_inlineencryption::*;