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_rpmb::natural::*;
8
9 #[doc = " Represents an RPMB operation, which consists of sending one or more frames then receiving zero\n or more frames. The tx_frames and rx_frames VMOs will be transferred to the protocol\n implementation, so clients should keep duplicates of them if access is needed after the call to\n Request().\n The request will be aborted as soon as an error is encountered, meaning the read operation will\n not be performed if the write operation failed. Invalid parameters passed through tx_frames or\n rx_frames will cause an error to be returned immediately, without either operation having been\n performed.\n"]
10 #[derive(Debug, PartialEq)]
11 pub struct Request {
12 pub tx_frames: ::fidl_next_fuchsia_mem::natural::Range,
13
14 pub rx_frames:
15 ::core::option::Option<::std::boxed::Box<::fidl_next_fuchsia_mem::natural::Range>>,
16 }
17
18 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Request<'static>, ___E> for Request
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<crate::wire::Request<'static>>,
29 _: (),
30 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
31 ::fidl_next::munge! {
32 let crate::wire::Request {
33 tx_frames,
34 rx_frames,
35
36 } = out_;
37 }
38
39 ::fidl_next::Encode::encode(self.tx_frames, encoder_, tx_frames, ())?;
40
41 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(tx_frames.as_mut_ptr()) };
42
43 ::fidl_next::Encode::encode(self.rx_frames, encoder_, rx_frames, ())?;
44
45 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rx_frames.as_mut_ptr()) };
46
47 Ok(())
48 }
49 }
50
51 unsafe impl<___E>
52 ::fidl_next::EncodeOption<
53 ::fidl_next::wire::Box<'static, crate::wire::Request<'static>>,
54 ___E,
55 > for Request
56 where
57 ___E: ::fidl_next::Encoder + ?Sized,
58 Request: ::fidl_next::Encode<crate::wire::Request<'static>, ___E>,
59 {
60 #[inline]
61 fn encode_option(
62 this: ::core::option::Option<Self>,
63 encoder: &mut ___E,
64 out: &mut ::core::mem::MaybeUninit<
65 ::fidl_next::wire::Box<'static, crate::wire::Request<'static>>,
66 >,
67 _: (),
68 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
69 if let Some(inner) = this {
70 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
71 ::fidl_next::wire::Box::encode_present(out);
72 } else {
73 ::fidl_next::wire::Box::encode_absent(out);
74 }
75
76 Ok(())
77 }
78 }
79
80 impl<'de> ::fidl_next::FromWire<crate::wire::Request<'de>> for Request {
81 #[inline]
82 fn from_wire(wire: crate::wire::Request<'de>) -> Self {
83 Self {
84 tx_frames: ::fidl_next::FromWire::from_wire(wire.tx_frames),
85
86 rx_frames: ::fidl_next::FromWire::from_wire(wire.rx_frames),
87 }
88 }
89 }
90
91 #[derive(Debug, PartialEq)]
92 pub struct RpmbRequestRequest {
93 pub request: crate::natural::Request,
94 }
95
96 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RpmbRequestRequest<'static>, ___E>
97 for RpmbRequestRequest
98 where
99 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
100 ___E: ::fidl_next::Encoder,
101 ___E: ::fidl_next::fuchsia::HandleEncoder,
102 {
103 #[inline]
104 fn encode(
105 self,
106 encoder_: &mut ___E,
107 out_: &mut ::core::mem::MaybeUninit<crate::wire::RpmbRequestRequest<'static>>,
108 _: (),
109 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
110 ::fidl_next::munge! {
111 let crate::wire::RpmbRequestRequest {
112 request,
113
114 } = out_;
115 }
116
117 ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
118
119 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(request.as_mut_ptr()) };
120
121 Ok(())
122 }
123 }
124
125 unsafe impl<___E>
126 ::fidl_next::EncodeOption<
127 ::fidl_next::wire::Box<'static, crate::wire::RpmbRequestRequest<'static>>,
128 ___E,
129 > for RpmbRequestRequest
130 where
131 ___E: ::fidl_next::Encoder + ?Sized,
132 RpmbRequestRequest: ::fidl_next::Encode<crate::wire::RpmbRequestRequest<'static>, ___E>,
133 {
134 #[inline]
135 fn encode_option(
136 this: ::core::option::Option<Self>,
137 encoder: &mut ___E,
138 out: &mut ::core::mem::MaybeUninit<
139 ::fidl_next::wire::Box<'static, crate::wire::RpmbRequestRequest<'static>>,
140 >,
141 _: (),
142 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
143 if let Some(inner) = this {
144 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
145 ::fidl_next::wire::Box::encode_present(out);
146 } else {
147 ::fidl_next::wire::Box::encode_absent(out);
148 }
149
150 Ok(())
151 }
152 }
153
154 impl<'de> ::fidl_next::FromWire<crate::wire::RpmbRequestRequest<'de>> for RpmbRequestRequest {
155 #[inline]
156 fn from_wire(wire: crate::wire::RpmbRequestRequest<'de>) -> Self {
157 Self { request: ::fidl_next::FromWire::from_wire(wire.request) }
158 }
159 }
160}
161
162pub mod wire {
163
164 pub use fidl_next_common_fuchsia_hardware_rpmb::wire::*;
165
166 #[derive(Debug)]
168 #[repr(C)]
169 pub struct Request<'de> {
170 pub tx_frames: ::fidl_next_fuchsia_mem::wire::Range,
171
172 pub rx_frames: ::fidl_next::wire::Box<'de, ::fidl_next_fuchsia_mem::wire::Range>,
173 }
174
175 static_assertions::const_assert_eq!(std::mem::size_of::<Request<'_>>(), 32);
176 static_assertions::const_assert_eq!(std::mem::align_of::<Request<'_>>(), 8);
177
178 static_assertions::const_assert_eq!(std::mem::offset_of!(Request<'_>, tx_frames), 0);
179
180 static_assertions::const_assert_eq!(std::mem::offset_of!(Request<'_>, rx_frames), 24);
181
182 impl ::fidl_next::Constrained for Request<'_> {
183 type Constraint = ();
184
185 fn validate(
186 _: ::fidl_next::Slot<'_, Self>,
187 _: Self::Constraint,
188 ) -> Result<(), ::fidl_next::ValidationError> {
189 Ok(())
190 }
191 }
192
193 unsafe impl ::fidl_next::Wire for Request<'static> {
194 type Narrowed<'de> = Request<'de>;
195
196 #[inline]
197 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
198 ::fidl_next::munge! {
199 let Self {
200 tx_frames,
201 rx_frames,
202
203 } = &mut *out_;
204 }
205
206 ::fidl_next::Wire::zero_padding(tx_frames);
207
208 ::fidl_next::Wire::zero_padding(rx_frames);
209 }
210 }
211
212 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Request<'de>
213 where
214 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
215 ___D: ::fidl_next::Decoder<'de>,
216 ___D: ::fidl_next::fuchsia::HandleDecoder,
217 {
218 fn decode(
219 slot_: ::fidl_next::Slot<'_, Self>,
220 decoder_: &mut ___D,
221 _: (),
222 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
223 ::fidl_next::munge! {
224 let Self {
225 mut tx_frames,
226 mut rx_frames,
227
228 } = slot_;
229 }
230
231 let _field = tx_frames.as_mut();
232
233 ::fidl_next::Decode::decode(tx_frames.as_mut(), decoder_, ())?;
234
235 let _field = rx_frames.as_mut();
236
237 ::fidl_next::Decode::decode(rx_frames.as_mut(), decoder_, ())?;
238
239 Ok(())
240 }
241 }
242
243 impl<'de> ::fidl_next::IntoNatural for Request<'de> {
244 type Natural = crate::natural::Request;
245 }
246
247 #[derive(Debug)]
249 #[repr(C)]
250 pub struct RpmbRequestRequest<'de> {
251 pub request: crate::wire::Request<'de>,
252 }
253
254 static_assertions::const_assert_eq!(std::mem::size_of::<RpmbRequestRequest<'_>>(), 32);
255 static_assertions::const_assert_eq!(std::mem::align_of::<RpmbRequestRequest<'_>>(), 8);
256
257 static_assertions::const_assert_eq!(std::mem::offset_of!(RpmbRequestRequest<'_>, request), 0);
258
259 impl ::fidl_next::Constrained for RpmbRequestRequest<'_> {
260 type Constraint = ();
261
262 fn validate(
263 _: ::fidl_next::Slot<'_, Self>,
264 _: Self::Constraint,
265 ) -> Result<(), ::fidl_next::ValidationError> {
266 Ok(())
267 }
268 }
269
270 unsafe impl ::fidl_next::Wire for RpmbRequestRequest<'static> {
271 type Narrowed<'de> = RpmbRequestRequest<'de>;
272
273 #[inline]
274 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
275 ::fidl_next::munge! {
276 let Self {
277 request,
278
279 } = &mut *out_;
280 }
281
282 ::fidl_next::Wire::zero_padding(request);
283 }
284 }
285
286 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for RpmbRequestRequest<'de>
287 where
288 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
289 ___D: ::fidl_next::Decoder<'de>,
290 ___D: ::fidl_next::fuchsia::HandleDecoder,
291 {
292 fn decode(
293 slot_: ::fidl_next::Slot<'_, Self>,
294 decoder_: &mut ___D,
295 _: (),
296 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
297 ::fidl_next::munge! {
298 let Self {
299 mut request,
300
301 } = slot_;
302 }
303
304 let _field = request.as_mut();
305
306 ::fidl_next::Decode::decode(request.as_mut(), decoder_, ())?;
307
308 Ok(())
309 }
310 }
311
312 impl<'de> ::fidl_next::IntoNatural for RpmbRequestRequest<'de> {
313 type Natural = crate::natural::RpmbRequestRequest;
314 }
315}
316
317pub mod wire_optional {
318
319 pub use fidl_next_common_fuchsia_hardware_rpmb::wire_optional::*;
320}
321
322pub mod generic {
323
324 pub use fidl_next_common_fuchsia_hardware_rpmb::generic::*;
325
326 pub struct Request<T0, T1> {
328 pub tx_frames: T0,
329
330 pub rx_frames: T1,
331 }
332
333 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Request<'static>, ___E>
334 for Request<T0, T1>
335 where
336 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
337 ___E: ::fidl_next::Encoder,
338 ___E: ::fidl_next::fuchsia::HandleEncoder,
339 T0: ::fidl_next::Encode<::fidl_next_fuchsia_mem::wire::Range, ___E>,
340 T1: ::fidl_next::Encode<
341 ::fidl_next::wire::Box<'static, ::fidl_next_fuchsia_mem::wire::Range>,
342 ___E,
343 >,
344 {
345 #[inline]
346 fn encode(
347 self,
348 encoder_: &mut ___E,
349 out_: &mut ::core::mem::MaybeUninit<crate::wire::Request<'static>>,
350 _: (),
351 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
352 ::fidl_next::munge! {
353 let crate::wire::Request {
354 tx_frames,
355 rx_frames,
356
357 } = out_;
358 }
359
360 ::fidl_next::Encode::encode(self.tx_frames, encoder_, tx_frames, ())?;
361
362 ::fidl_next::Encode::encode(self.rx_frames, encoder_, rx_frames, ())?;
363
364 Ok(())
365 }
366 }
367
368 pub struct RpmbRequestRequest<T0> {
370 pub request: T0,
371 }
372
373 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::RpmbRequestRequest<'static>, ___E>
374 for RpmbRequestRequest<T0>
375 where
376 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
377 ___E: ::fidl_next::Encoder,
378 ___E: ::fidl_next::fuchsia::HandleEncoder,
379 T0: ::fidl_next::Encode<crate::wire::Request<'static>, ___E>,
380 {
381 #[inline]
382 fn encode(
383 self,
384 encoder_: &mut ___E,
385 out_: &mut ::core::mem::MaybeUninit<crate::wire::RpmbRequestRequest<'static>>,
386 _: (),
387 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
388 ::fidl_next::munge! {
389 let crate::wire::RpmbRequestRequest {
390 request,
391
392 } = out_;
393 }
394
395 ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
396
397 Ok(())
398 }
399 }
400}
401
402pub use self::natural::*;
403
404#[derive(PartialEq, Debug)]
406pub struct Rpmb;
407
408impl ::fidl_next::Discoverable for Rpmb {
409 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.rpmb.Rpmb";
410}
411
412#[cfg(target_os = "fuchsia")]
413impl ::fidl_next::HasTransport for Rpmb {
414 type Transport = ::fidl_next::fuchsia::zx::Channel;
415}
416
417pub mod rpmb {
418 pub mod prelude {
419 pub use crate::{
420 Rpmb, RpmbClientHandler, RpmbLocalClientHandler, RpmbLocalServerHandler,
421 RpmbServerHandler, rpmb,
422 };
423
424 pub use crate::natural::RpmbGetDeviceInfoResponse;
425
426 pub use crate::natural::RpmbRequestRequest;
427
428 pub use crate::natural::RpmbRequestResponse;
429 }
430
431 pub struct GetDeviceInfo;
432
433 impl ::fidl_next::Method for GetDeviceInfo {
434 const ORDINAL: u64 = 6399474108337708832;
435 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
436 ::fidl_next::protocol::Flexibility::Strict;
437
438 type Protocol = crate::Rpmb;
439
440 type Request = ::fidl_next::wire::EmptyMessageBody;
441 }
442
443 impl ::fidl_next::TwoWayMethod for GetDeviceInfo {
444 type Response = crate::wire::RpmbGetDeviceInfoResponse<'static>;
445 }
446
447 impl<___R> ::fidl_next::Respond<___R> for GetDeviceInfo {
448 type Output = crate::generic::RpmbGetDeviceInfoResponse<___R>;
449
450 fn respond(response: ___R) -> Self::Output {
451 crate::generic::RpmbGetDeviceInfoResponse { info: response }
452 }
453 }
454
455 pub struct Request;
456
457 impl ::fidl_next::Method for Request {
458 const ORDINAL: u64 = 2199356259956099574;
459 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
460 ::fidl_next::protocol::Flexibility::Strict;
461
462 type Protocol = crate::Rpmb;
463
464 type Request = crate::wire::RpmbRequestRequest<'static>;
465 }
466
467 impl ::fidl_next::TwoWayMethod for Request {
468 type Response = ::fidl_next::wire::Result<
469 'static,
470 crate::wire::RpmbRequestResponse,
471 ::fidl_next::wire::Int32,
472 >;
473 }
474
475 impl<___R> ::fidl_next::Respond<___R> for Request {
476 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
477
478 fn respond(response: ___R) -> Self::Output {
479 ::core::result::Result::Ok(response)
480 }
481 }
482
483 impl<___R> ::fidl_next::RespondErr<___R> for Request {
484 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
485
486 fn respond_err(response: ___R) -> Self::Output {
487 ::core::result::Result::Err(response)
488 }
489 }
490
491 mod ___detail {
492 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Rpmb
493 where
494 ___T: ::fidl_next::Transport,
495 {
496 type Client = RpmbClient<___T>;
497 type Server = RpmbServer<___T>;
498 }
499
500 #[repr(transparent)]
502 pub struct RpmbClient<___T: ::fidl_next::Transport> {
503 #[allow(dead_code)]
504 client: ::fidl_next::protocol::Client<___T>,
505 }
506
507 impl<___T> RpmbClient<___T>
508 where
509 ___T: ::fidl_next::Transport,
510 {
511 pub fn get_device_info(
512 &self,
513 ) -> ::fidl_next::TwoWayFuture<'_, super::GetDeviceInfo, ___T> {
514 ::fidl_next::TwoWayFuture::from_untyped(
515 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
516 6399474108337708832,
517 <super::GetDeviceInfo as ::fidl_next::Method>::FLEXIBILITY,
518 (),
519 ),
520 )
521 }
522
523 pub fn request(
524 &self,
525
526 request: impl ::fidl_next::Encode<
527 crate::wire::Request<'static>,
528 <___T as ::fidl_next::Transport>::SendBuffer,
529 >,
530 ) -> ::fidl_next::TwoWayFuture<'_, super::Request, ___T>
531 where
532 <___T as ::fidl_next::Transport>::SendBuffer:
533 ::fidl_next::encoder::InternalHandleEncoder,
534 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
535 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
536 {
537 self.request_with(crate::generic::RpmbRequestRequest { request })
538 }
539
540 pub fn request_with<___R>(
541 &self,
542 request: ___R,
543 ) -> ::fidl_next::TwoWayFuture<'_, super::Request, ___T>
544 where
545 ___R: ::fidl_next::Encode<
546 crate::wire::RpmbRequestRequest<'static>,
547 <___T as ::fidl_next::Transport>::SendBuffer,
548 >,
549 {
550 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
551 2199356259956099574,
552 <super::Request as ::fidl_next::Method>::FLEXIBILITY,
553 request,
554 ))
555 }
556 }
557
558 #[repr(transparent)]
560 pub struct RpmbServer<___T: ::fidl_next::Transport> {
561 server: ::fidl_next::protocol::Server<___T>,
562 }
563
564 impl<___T> RpmbServer<___T> where ___T: ::fidl_next::Transport {}
565 }
566}
567
568#[diagnostic::on_unimplemented(
569 note = "If {Self} implements the non-local RpmbClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
570)]
571
572pub trait RpmbLocalClientHandler<
576 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
577 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
578>
579{
580}
581
582impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Rpmb
583where
584 ___H: RpmbLocalClientHandler<___T>,
585 ___T: ::fidl_next::Transport,
586{
587 async fn on_event(
588 handler: &mut ___H,
589 ordinal: u64,
590 flexibility: ::fidl_next::protocol::Flexibility,
591 body: ::fidl_next::Body<___T>,
592 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
593 match ordinal {
594 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
595 }
596 }
597}
598
599#[diagnostic::on_unimplemented(
600 note = "If {Self} implements the non-local RpmbServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
601)]
602
603pub trait RpmbLocalServerHandler<
607 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
608 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
609>
610{
611 fn get_device_info(
612 &mut self,
613
614 responder: ::fidl_next::Responder<rpmb::GetDeviceInfo, ___T>,
615 ) -> impl ::core::future::Future<Output = ()>;
616
617 fn request(
618 &mut self,
619
620 request: ::fidl_next::Request<rpmb::Request, ___T>,
621
622 responder: ::fidl_next::Responder<rpmb::Request, ___T>,
623 ) -> impl ::core::future::Future<Output = ()>;
624}
625
626impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Rpmb
627where
628 ___H: RpmbLocalServerHandler<___T>,
629 ___T: ::fidl_next::Transport,
630 for<'de> crate::wire::RpmbRequestRequest<'de>: ::fidl_next::Decode<
631 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
632 Constraint = (),
633 >,
634{
635 async fn on_one_way(
636 handler: &mut ___H,
637 ordinal: u64,
638 flexibility: ::fidl_next::protocol::Flexibility,
639 body: ::fidl_next::Body<___T>,
640 ) -> ::core::result::Result<
641 (),
642 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
643 > {
644 match ordinal {
645 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
646 }
647 }
648
649 async fn on_two_way(
650 handler: &mut ___H,
651 ordinal: u64,
652 flexibility: ::fidl_next::protocol::Flexibility,
653 body: ::fidl_next::Body<___T>,
654 responder: ::fidl_next::protocol::Responder<___T>,
655 ) -> ::core::result::Result<
656 (),
657 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
658 > {
659 match ordinal {
660 6399474108337708832 => {
661 let responder = ::fidl_next::Responder::from_untyped(responder);
662
663 handler.get_device_info(responder).await;
664 Ok(())
665 }
666
667 2199356259956099574 => {
668 let responder = ::fidl_next::Responder::from_untyped(responder);
669
670 match ::fidl_next::AsDecoderExt::into_decoded(body) {
671 Ok(decoded) => {
672 handler
673 .request(::fidl_next::Request::from_decoded(decoded), responder)
674 .await;
675 Ok(())
676 }
677 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
678 ordinal: 2199356259956099574,
679 error,
680 }),
681 }
682 }
683
684 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
685 }
686 }
687}
688
689pub trait RpmbClientHandler<
693 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
694 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
695>
696{
697}
698
699impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Rpmb
700where
701 ___H: RpmbClientHandler<___T> + ::core::marker::Send,
702 ___T: ::fidl_next::Transport,
703{
704 async fn on_event(
705 handler: &mut ___H,
706 ordinal: u64,
707 flexibility: ::fidl_next::protocol::Flexibility,
708 body: ::fidl_next::Body<___T>,
709 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
710 match ordinal {
711 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
712 }
713 }
714}
715
716pub trait RpmbServerHandler<
720 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
721 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
722>
723{
724 fn get_device_info(
725 &mut self,
726
727 responder: ::fidl_next::Responder<rpmb::GetDeviceInfo, ___T>,
728 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
729
730 fn request(
731 &mut self,
732
733 request: ::fidl_next::Request<rpmb::Request, ___T>,
734
735 responder: ::fidl_next::Responder<rpmb::Request, ___T>,
736 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
737}
738
739impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Rpmb
740where
741 ___H: RpmbServerHandler<___T> + ::core::marker::Send,
742 ___T: ::fidl_next::Transport,
743 for<'de> crate::wire::RpmbRequestRequest<'de>: ::fidl_next::Decode<
744 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
745 Constraint = (),
746 >,
747{
748 async fn on_one_way(
749 handler: &mut ___H,
750 ordinal: u64,
751 flexibility: ::fidl_next::protocol::Flexibility,
752 body: ::fidl_next::Body<___T>,
753 ) -> ::core::result::Result<
754 (),
755 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
756 > {
757 match ordinal {
758 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
759 }
760 }
761
762 async fn on_two_way(
763 handler: &mut ___H,
764 ordinal: u64,
765 flexibility: ::fidl_next::protocol::Flexibility,
766 body: ::fidl_next::Body<___T>,
767 responder: ::fidl_next::protocol::Responder<___T>,
768 ) -> ::core::result::Result<
769 (),
770 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
771 > {
772 match ordinal {
773 6399474108337708832 => {
774 let responder = ::fidl_next::Responder::from_untyped(responder);
775
776 handler.get_device_info(responder).await;
777 Ok(())
778 }
779
780 2199356259956099574 => {
781 let responder = ::fidl_next::Responder::from_untyped(responder);
782
783 match ::fidl_next::AsDecoderExt::into_decoded(body) {
784 Ok(decoded) => {
785 handler
786 .request(::fidl_next::Request::from_decoded(decoded), responder)
787 .await;
788 Ok(())
789 }
790 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
791 ordinal: 2199356259956099574,
792 error,
793 }),
794 }
795 }
796
797 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
798 }
799 }
800}
801
802impl<___T> RpmbClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
803
804impl<___H, ___T> RpmbLocalClientHandler<___T> for ::fidl_next::Local<___H>
805where
806 ___H: RpmbClientHandler<___T>,
807 ___T: ::fidl_next::Transport,
808{
809}
810
811impl<___H, ___T> RpmbLocalServerHandler<___T> for ::fidl_next::Local<___H>
812where
813 ___H: RpmbServerHandler<___T>,
814 ___T: ::fidl_next::Transport,
815{
816 async fn get_device_info(
817 &mut self,
818
819 responder: ::fidl_next::Responder<rpmb::GetDeviceInfo, ___T>,
820 ) {
821 ___H::get_device_info(&mut self.0, responder).await
822 }
823
824 async fn request(
825 &mut self,
826
827 request: ::fidl_next::Request<rpmb::Request, ___T>,
828
829 responder: ::fidl_next::Responder<rpmb::Request, ___T>,
830 ) {
831 ___H::request(&mut self.0, request, responder).await
832 }
833}
834
835#[doc = " A driver transport variant of the `Rpmb` protocol.\n"]
837#[derive(PartialEq, Debug)]
838pub struct DriverRpmb;
839
840impl ::fidl_next::Discoverable for DriverRpmb {
841 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.rpmb.DriverRpmb";
842}
843
844#[cfg(feature = "driver")]
845impl ::fidl_next::HasTransport for DriverRpmb {
846 type Transport = ::fdf_fidl::DriverChannel;
847}
848
849pub mod driver_rpmb {
850 pub mod prelude {
851 pub use crate::{
852 DriverRpmb, DriverRpmbClientHandler, DriverRpmbLocalClientHandler,
853 DriverRpmbLocalServerHandler, DriverRpmbServerHandler, driver_rpmb,
854 };
855
856 pub use crate::natural::RpmbGetDeviceInfoResponse;
857
858 pub use crate::natural::RpmbRequestRequest;
859
860 pub use crate::natural::RpmbRequestResponse;
861 }
862
863 pub struct GetDeviceInfo;
864
865 impl ::fidl_next::Method for GetDeviceInfo {
866 const ORDINAL: u64 = 6399474108337708832;
867 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
868 ::fidl_next::protocol::Flexibility::Strict;
869
870 type Protocol = crate::DriverRpmb;
871
872 type Request = ::fidl_next::wire::EmptyMessageBody;
873 }
874
875 impl ::fidl_next::TwoWayMethod for GetDeviceInfo {
876 type Response = crate::wire::RpmbGetDeviceInfoResponse<'static>;
877 }
878
879 impl<___R> ::fidl_next::Respond<___R> for GetDeviceInfo {
880 type Output = crate::generic::RpmbGetDeviceInfoResponse<___R>;
881
882 fn respond(response: ___R) -> Self::Output {
883 crate::generic::RpmbGetDeviceInfoResponse { info: response }
884 }
885 }
886
887 pub struct Request;
888
889 impl ::fidl_next::Method for Request {
890 const ORDINAL: u64 = 2199356259956099574;
891 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
892 ::fidl_next::protocol::Flexibility::Strict;
893
894 type Protocol = crate::DriverRpmb;
895
896 type Request = crate::wire::RpmbRequestRequest<'static>;
897 }
898
899 impl ::fidl_next::TwoWayMethod for Request {
900 type Response = ::fidl_next::wire::Result<
901 'static,
902 crate::wire::RpmbRequestResponse,
903 ::fidl_next::wire::Int32,
904 >;
905 }
906
907 impl<___R> ::fidl_next::Respond<___R> for Request {
908 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
909
910 fn respond(response: ___R) -> Self::Output {
911 ::core::result::Result::Ok(response)
912 }
913 }
914
915 impl<___R> ::fidl_next::RespondErr<___R> for Request {
916 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
917
918 fn respond_err(response: ___R) -> Self::Output {
919 ::core::result::Result::Err(response)
920 }
921 }
922
923 mod ___detail {
924 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::DriverRpmb
925 where
926 ___T: ::fidl_next::Transport,
927 {
928 type Client = DriverRpmbClient<___T>;
929 type Server = DriverRpmbServer<___T>;
930 }
931
932 #[repr(transparent)]
934 pub struct DriverRpmbClient<___T: ::fidl_next::Transport> {
935 #[allow(dead_code)]
936 client: ::fidl_next::protocol::Client<___T>,
937 }
938
939 impl<___T> DriverRpmbClient<___T>
940 where
941 ___T: ::fidl_next::Transport,
942 {
943 pub fn get_device_info(
944 &self,
945 ) -> ::fidl_next::TwoWayFuture<'_, super::GetDeviceInfo, ___T> {
946 ::fidl_next::TwoWayFuture::from_untyped(
947 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
948 6399474108337708832,
949 <super::GetDeviceInfo as ::fidl_next::Method>::FLEXIBILITY,
950 (),
951 ),
952 )
953 }
954
955 pub fn request(
956 &self,
957
958 request: impl ::fidl_next::Encode<
959 crate::wire::Request<'static>,
960 <___T as ::fidl_next::Transport>::SendBuffer,
961 >,
962 ) -> ::fidl_next::TwoWayFuture<'_, super::Request, ___T>
963 where
964 <___T as ::fidl_next::Transport>::SendBuffer:
965 ::fidl_next::encoder::InternalHandleEncoder,
966 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
967 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
968 {
969 self.request_with(crate::generic::RpmbRequestRequest { request })
970 }
971
972 pub fn request_with<___R>(
973 &self,
974 request: ___R,
975 ) -> ::fidl_next::TwoWayFuture<'_, super::Request, ___T>
976 where
977 ___R: ::fidl_next::Encode<
978 crate::wire::RpmbRequestRequest<'static>,
979 <___T as ::fidl_next::Transport>::SendBuffer,
980 >,
981 {
982 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
983 2199356259956099574,
984 <super::Request as ::fidl_next::Method>::FLEXIBILITY,
985 request,
986 ))
987 }
988 }
989
990 #[repr(transparent)]
992 pub struct DriverRpmbServer<___T: ::fidl_next::Transport> {
993 server: ::fidl_next::protocol::Server<___T>,
994 }
995
996 impl<___T> DriverRpmbServer<___T> where ___T: ::fidl_next::Transport {}
997 }
998}
999
1000#[diagnostic::on_unimplemented(
1001 note = "If {Self} implements the non-local DriverRpmbClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1002)]
1003
1004pub trait DriverRpmbLocalClientHandler<
1008 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
1009 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
1010>
1011{
1012}
1013
1014impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for DriverRpmb
1015where
1016 ___H: DriverRpmbLocalClientHandler<___T>,
1017 ___T: ::fidl_next::Transport,
1018{
1019 async fn on_event(
1020 handler: &mut ___H,
1021 ordinal: u64,
1022 flexibility: ::fidl_next::protocol::Flexibility,
1023 body: ::fidl_next::Body<___T>,
1024 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1025 match ordinal {
1026 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1027 }
1028 }
1029}
1030
1031#[diagnostic::on_unimplemented(
1032 note = "If {Self} implements the non-local DriverRpmbServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1033)]
1034
1035pub trait DriverRpmbLocalServerHandler<
1039 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
1040 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
1041>
1042{
1043 fn get_device_info(
1044 &mut self,
1045
1046 responder: ::fidl_next::Responder<driver_rpmb::GetDeviceInfo, ___T>,
1047 ) -> impl ::core::future::Future<Output = ()>;
1048
1049 fn request(
1050 &mut self,
1051
1052 request: ::fidl_next::Request<driver_rpmb::Request, ___T>,
1053
1054 responder: ::fidl_next::Responder<driver_rpmb::Request, ___T>,
1055 ) -> impl ::core::future::Future<Output = ()>;
1056}
1057
1058impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for DriverRpmb
1059where
1060 ___H: DriverRpmbLocalServerHandler<___T>,
1061 ___T: ::fidl_next::Transport,
1062 for<'de> crate::wire::RpmbRequestRequest<'de>: ::fidl_next::Decode<
1063 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1064 Constraint = (),
1065 >,
1066{
1067 async fn on_one_way(
1068 handler: &mut ___H,
1069 ordinal: u64,
1070 flexibility: ::fidl_next::protocol::Flexibility,
1071 body: ::fidl_next::Body<___T>,
1072 ) -> ::core::result::Result<
1073 (),
1074 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1075 > {
1076 match ordinal {
1077 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1078 }
1079 }
1080
1081 async fn on_two_way(
1082 handler: &mut ___H,
1083 ordinal: u64,
1084 flexibility: ::fidl_next::protocol::Flexibility,
1085 body: ::fidl_next::Body<___T>,
1086 responder: ::fidl_next::protocol::Responder<___T>,
1087 ) -> ::core::result::Result<
1088 (),
1089 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1090 > {
1091 match ordinal {
1092 6399474108337708832 => {
1093 let responder = ::fidl_next::Responder::from_untyped(responder);
1094
1095 handler.get_device_info(responder).await;
1096 Ok(())
1097 }
1098
1099 2199356259956099574 => {
1100 let responder = ::fidl_next::Responder::from_untyped(responder);
1101
1102 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1103 Ok(decoded) => {
1104 handler
1105 .request(::fidl_next::Request::from_decoded(decoded), responder)
1106 .await;
1107 Ok(())
1108 }
1109 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1110 ordinal: 2199356259956099574,
1111 error,
1112 }),
1113 }
1114 }
1115
1116 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1117 }
1118 }
1119}
1120
1121pub trait DriverRpmbClientHandler<
1125 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
1126 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
1127>
1128{
1129}
1130
1131impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for DriverRpmb
1132where
1133 ___H: DriverRpmbClientHandler<___T> + ::core::marker::Send,
1134 ___T: ::fidl_next::Transport,
1135{
1136 async fn on_event(
1137 handler: &mut ___H,
1138 ordinal: u64,
1139 flexibility: ::fidl_next::protocol::Flexibility,
1140 body: ::fidl_next::Body<___T>,
1141 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1142 match ordinal {
1143 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1144 }
1145 }
1146}
1147
1148pub trait DriverRpmbServerHandler<
1152 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
1153 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
1154>
1155{
1156 fn get_device_info(
1157 &mut self,
1158
1159 responder: ::fidl_next::Responder<driver_rpmb::GetDeviceInfo, ___T>,
1160 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1161
1162 fn request(
1163 &mut self,
1164
1165 request: ::fidl_next::Request<driver_rpmb::Request, ___T>,
1166
1167 responder: ::fidl_next::Responder<driver_rpmb::Request, ___T>,
1168 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1169}
1170
1171impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for DriverRpmb
1172where
1173 ___H: DriverRpmbServerHandler<___T> + ::core::marker::Send,
1174 ___T: ::fidl_next::Transport,
1175 for<'de> crate::wire::RpmbRequestRequest<'de>: ::fidl_next::Decode<
1176 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1177 Constraint = (),
1178 >,
1179{
1180 async fn on_one_way(
1181 handler: &mut ___H,
1182 ordinal: u64,
1183 flexibility: ::fidl_next::protocol::Flexibility,
1184 body: ::fidl_next::Body<___T>,
1185 ) -> ::core::result::Result<
1186 (),
1187 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1188 > {
1189 match ordinal {
1190 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1191 }
1192 }
1193
1194 async fn on_two_way(
1195 handler: &mut ___H,
1196 ordinal: u64,
1197 flexibility: ::fidl_next::protocol::Flexibility,
1198 body: ::fidl_next::Body<___T>,
1199 responder: ::fidl_next::protocol::Responder<___T>,
1200 ) -> ::core::result::Result<
1201 (),
1202 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1203 > {
1204 match ordinal {
1205 6399474108337708832 => {
1206 let responder = ::fidl_next::Responder::from_untyped(responder);
1207
1208 handler.get_device_info(responder).await;
1209 Ok(())
1210 }
1211
1212 2199356259956099574 => {
1213 let responder = ::fidl_next::Responder::from_untyped(responder);
1214
1215 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1216 Ok(decoded) => {
1217 handler
1218 .request(::fidl_next::Request::from_decoded(decoded), responder)
1219 .await;
1220 Ok(())
1221 }
1222 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1223 ordinal: 2199356259956099574,
1224 error,
1225 }),
1226 }
1227 }
1228
1229 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1230 }
1231 }
1232}
1233
1234impl<___T> DriverRpmbClientHandler<___T> for ::fidl_next::IgnoreEvents where
1235 ___T: ::fidl_next::Transport
1236{
1237}
1238
1239impl<___H, ___T> DriverRpmbLocalClientHandler<___T> for ::fidl_next::Local<___H>
1240where
1241 ___H: DriverRpmbClientHandler<___T>,
1242 ___T: ::fidl_next::Transport,
1243{
1244}
1245
1246impl<___H, ___T> DriverRpmbLocalServerHandler<___T> for ::fidl_next::Local<___H>
1247where
1248 ___H: DriverRpmbServerHandler<___T>,
1249 ___T: ::fidl_next::Transport,
1250{
1251 async fn get_device_info(
1252 &mut self,
1253
1254 responder: ::fidl_next::Responder<driver_rpmb::GetDeviceInfo, ___T>,
1255 ) {
1256 ___H::get_device_info(&mut self.0, responder).await
1257 }
1258
1259 async fn request(
1260 &mut self,
1261
1262 request: ::fidl_next::Request<driver_rpmb::Request, ___T>,
1263
1264 responder: ::fidl_next::Responder<driver_rpmb::Request, ___T>,
1265 ) {
1266 ___H::request(&mut self.0, request, responder).await
1267 }
1268}
1269
1270#[derive(Debug)]
1272pub struct Service;
1273
1274impl ::fidl_next::DiscoverableService for Service {
1275 const SERVICE_NAME: &'static str = "fuchsia.hardware.rpmb.Service";
1276 const MEMBER_NAMES: &'static [&'static str] = &["device"];
1277}
1278
1279impl ::fidl_next::HasServiceRequest<::fidl_next::fuchsia::zx::Channel> for Service {}
1280
1281impl<___C> ::fidl_next::Service<___C> for Service
1282where
1283 ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
1284{
1285 type Connector = ServiceConnector<___C>;
1286}
1287
1288#[repr(transparent)]
1290pub struct ServiceConnector<___C> {
1291 #[allow(dead_code)]
1292 connector: ___C,
1293}
1294
1295impl<___C> ServiceConnector<___C>
1296where
1297 ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
1298{
1299 pub fn device(
1301 &self,
1302 server_end: ::fidl_next::ServerEnd<crate::Rpmb, ::fidl_next::fuchsia::zx::Channel>,
1303 ) -> ::core::result::Result<
1304 (),
1305 <___C as ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>>::Error,
1306 > {
1307 ::fidl_next::protocol::ServiceConnector::<
1308 ::fidl_next::fuchsia::zx::Channel
1309 >::connect_to_member(
1310 &self.connector,
1311 "device",
1312 server_end.into_untyped(),
1313 )
1314 }
1315}
1316
1317pub trait ServiceHandler {
1319 fn device(
1321 &self,
1322 server_end: ::fidl_next::ServerEnd<crate::Rpmb, ::fidl_next::fuchsia::zx::Channel>,
1323 );
1324}
1325
1326impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for Service
1327where
1328 ___H: ServiceHandler,
1329 ::fidl_next::fuchsia::zx::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
1330{
1331 fn on_connection(handler: &___H, member: &str, server_end: ___T) {
1332 use ::fidl_next::InstanceFromServiceTransport;
1333 match member {
1334 "device" => handler.device(::fidl_next::ServerEnd::from_untyped(
1335 ::fidl_next::fuchsia::zx::Channel::from_service_transport(server_end),
1336 )),
1337
1338 _ => unreachable!(),
1339 }
1340 }
1341}
1342
1343pub use fidl_next_common_fuchsia_hardware_rpmb::*;