1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_hardware_tee_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct DeviceConnectorConnectToApplicationRequest {
16 pub application_uuid: fidl_fuchsia_tee::Uuid,
17 pub service_provider:
18 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>>,
19 pub application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
20}
21
22impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
23 for DeviceConnectorConnectToApplicationRequest
24{
25}
26
27#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28pub struct DeviceConnectorConnectToDeviceInfoRequest {
29 pub device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
30}
31
32impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
33 for DeviceConnectorConnectToDeviceInfoRequest
34{
35}
36
37#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
38pub struct DeviceConnectorMarker;
39
40impl fidl::endpoints::ProtocolMarker for DeviceConnectorMarker {
41 type Proxy = DeviceConnectorProxy;
42 type RequestStream = DeviceConnectorRequestStream;
43 #[cfg(target_os = "fuchsia")]
44 type SynchronousProxy = DeviceConnectorSynchronousProxy;
45
46 const DEBUG_NAME: &'static str = "(anonymous) DeviceConnector";
47}
48
49pub trait DeviceConnectorProxyInterface: Send + Sync {
50 fn r#connect_to_device_info(
51 &self,
52 device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
53 ) -> Result<(), fidl::Error>;
54 fn r#connect_to_application(
55 &self,
56 application_uuid: &fidl_fuchsia_tee::Uuid,
57 service_provider: Option<
58 fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
59 >,
60 application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
61 ) -> Result<(), fidl::Error>;
62}
63#[derive(Debug)]
64#[cfg(target_os = "fuchsia")]
65pub struct DeviceConnectorSynchronousProxy {
66 client: fidl::client::sync::Client,
67}
68
69#[cfg(target_os = "fuchsia")]
70impl fidl::endpoints::SynchronousProxy for DeviceConnectorSynchronousProxy {
71 type Proxy = DeviceConnectorProxy;
72 type Protocol = DeviceConnectorMarker;
73
74 fn from_channel(inner: fidl::Channel) -> Self {
75 Self::new(inner)
76 }
77
78 fn into_channel(self) -> fidl::Channel {
79 self.client.into_channel()
80 }
81
82 fn as_channel(&self) -> &fidl::Channel {
83 self.client.as_channel()
84 }
85}
86
87#[cfg(target_os = "fuchsia")]
88impl DeviceConnectorSynchronousProxy {
89 pub fn new(channel: fidl::Channel) -> Self {
90 let protocol_name = <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
91 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
92 }
93
94 pub fn into_channel(self) -> fidl::Channel {
95 self.client.into_channel()
96 }
97
98 pub fn wait_for_event(
101 &self,
102 deadline: zx::MonotonicInstant,
103 ) -> Result<DeviceConnectorEvent, fidl::Error> {
104 DeviceConnectorEvent::decode(self.client.wait_for_event(deadline)?)
105 }
106
107 pub fn r#connect_to_device_info(
111 &self,
112 mut device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
113 ) -> Result<(), fidl::Error> {
114 self.client.send::<DeviceConnectorConnectToDeviceInfoRequest>(
115 (device_info_request,),
116 0x5fa3623fd14f786,
117 fidl::encoding::DynamicFlags::empty(),
118 )
119 }
120
121 pub fn r#connect_to_application(
126 &self,
127 mut application_uuid: &fidl_fuchsia_tee::Uuid,
128 mut service_provider: Option<
129 fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
130 >,
131 mut application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
132 ) -> Result<(), fidl::Error> {
133 self.client.send::<DeviceConnectorConnectToApplicationRequest>(
134 (application_uuid, service_provider, application_request),
135 0x6e7f7e307df7816a,
136 fidl::encoding::DynamicFlags::empty(),
137 )
138 }
139}
140
141#[derive(Debug, Clone)]
142pub struct DeviceConnectorProxy {
143 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
144}
145
146impl fidl::endpoints::Proxy for DeviceConnectorProxy {
147 type Protocol = DeviceConnectorMarker;
148
149 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
150 Self::new(inner)
151 }
152
153 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
154 self.client.into_channel().map_err(|client| Self { client })
155 }
156
157 fn as_channel(&self) -> &::fidl::AsyncChannel {
158 self.client.as_channel()
159 }
160}
161
162impl DeviceConnectorProxy {
163 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
165 let protocol_name = <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
166 Self { client: fidl::client::Client::new(channel, protocol_name) }
167 }
168
169 pub fn take_event_stream(&self) -> DeviceConnectorEventStream {
175 DeviceConnectorEventStream { event_receiver: self.client.take_event_receiver() }
176 }
177
178 pub fn r#connect_to_device_info(
182 &self,
183 mut device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
184 ) -> Result<(), fidl::Error> {
185 DeviceConnectorProxyInterface::r#connect_to_device_info(self, device_info_request)
186 }
187
188 pub fn r#connect_to_application(
193 &self,
194 mut application_uuid: &fidl_fuchsia_tee::Uuid,
195 mut service_provider: Option<
196 fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
197 >,
198 mut application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
199 ) -> Result<(), fidl::Error> {
200 DeviceConnectorProxyInterface::r#connect_to_application(
201 self,
202 application_uuid,
203 service_provider,
204 application_request,
205 )
206 }
207}
208
209impl DeviceConnectorProxyInterface for DeviceConnectorProxy {
210 fn r#connect_to_device_info(
211 &self,
212 mut device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
213 ) -> Result<(), fidl::Error> {
214 self.client.send::<DeviceConnectorConnectToDeviceInfoRequest>(
215 (device_info_request,),
216 0x5fa3623fd14f786,
217 fidl::encoding::DynamicFlags::empty(),
218 )
219 }
220
221 fn r#connect_to_application(
222 &self,
223 mut application_uuid: &fidl_fuchsia_tee::Uuid,
224 mut service_provider: Option<
225 fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
226 >,
227 mut application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
228 ) -> Result<(), fidl::Error> {
229 self.client.send::<DeviceConnectorConnectToApplicationRequest>(
230 (application_uuid, service_provider, application_request),
231 0x6e7f7e307df7816a,
232 fidl::encoding::DynamicFlags::empty(),
233 )
234 }
235}
236
237pub struct DeviceConnectorEventStream {
238 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
239}
240
241impl std::marker::Unpin for DeviceConnectorEventStream {}
242
243impl futures::stream::FusedStream for DeviceConnectorEventStream {
244 fn is_terminated(&self) -> bool {
245 self.event_receiver.is_terminated()
246 }
247}
248
249impl futures::Stream for DeviceConnectorEventStream {
250 type Item = Result<DeviceConnectorEvent, fidl::Error>;
251
252 fn poll_next(
253 mut self: std::pin::Pin<&mut Self>,
254 cx: &mut std::task::Context<'_>,
255 ) -> std::task::Poll<Option<Self::Item>> {
256 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
257 &mut self.event_receiver,
258 cx
259 )?) {
260 Some(buf) => std::task::Poll::Ready(Some(DeviceConnectorEvent::decode(buf))),
261 None => std::task::Poll::Ready(None),
262 }
263 }
264}
265
266#[derive(Debug)]
267pub enum DeviceConnectorEvent {}
268
269impl DeviceConnectorEvent {
270 fn decode(
272 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
273 ) -> Result<DeviceConnectorEvent, fidl::Error> {
274 let (bytes, _handles) = buf.split_mut();
275 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
276 debug_assert_eq!(tx_header.tx_id, 0);
277 match tx_header.ordinal {
278 _ => Err(fidl::Error::UnknownOrdinal {
279 ordinal: tx_header.ordinal,
280 protocol_name:
281 <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
282 }),
283 }
284 }
285}
286
287pub struct DeviceConnectorRequestStream {
289 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
290 is_terminated: bool,
291}
292
293impl std::marker::Unpin for DeviceConnectorRequestStream {}
294
295impl futures::stream::FusedStream for DeviceConnectorRequestStream {
296 fn is_terminated(&self) -> bool {
297 self.is_terminated
298 }
299}
300
301impl fidl::endpoints::RequestStream for DeviceConnectorRequestStream {
302 type Protocol = DeviceConnectorMarker;
303 type ControlHandle = DeviceConnectorControlHandle;
304
305 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
306 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
307 }
308
309 fn control_handle(&self) -> Self::ControlHandle {
310 DeviceConnectorControlHandle { inner: self.inner.clone() }
311 }
312
313 fn into_inner(
314 self,
315 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
316 {
317 (self.inner, self.is_terminated)
318 }
319
320 fn from_inner(
321 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
322 is_terminated: bool,
323 ) -> Self {
324 Self { inner, is_terminated }
325 }
326}
327
328impl futures::Stream for DeviceConnectorRequestStream {
329 type Item = Result<DeviceConnectorRequest, fidl::Error>;
330
331 fn poll_next(
332 mut self: std::pin::Pin<&mut Self>,
333 cx: &mut std::task::Context<'_>,
334 ) -> std::task::Poll<Option<Self::Item>> {
335 let this = &mut *self;
336 if this.inner.check_shutdown(cx) {
337 this.is_terminated = true;
338 return std::task::Poll::Ready(None);
339 }
340 if this.is_terminated {
341 panic!("polled DeviceConnectorRequestStream after completion");
342 }
343 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
344 |bytes, handles| {
345 match this.inner.channel().read_etc(cx, bytes, handles) {
346 std::task::Poll::Ready(Ok(())) => {}
347 std::task::Poll::Pending => return std::task::Poll::Pending,
348 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
349 this.is_terminated = true;
350 return std::task::Poll::Ready(None);
351 }
352 std::task::Poll::Ready(Err(e)) => {
353 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
354 e.into(),
355 ))))
356 }
357 }
358
359 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
361
362 std::task::Poll::Ready(Some(match header.ordinal {
363 0x5fa3623fd14f786 => {
364 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
365 let mut req = fidl::new_empty!(
366 DeviceConnectorConnectToDeviceInfoRequest,
367 fidl::encoding::DefaultFuchsiaResourceDialect
368 );
369 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnectorConnectToDeviceInfoRequest>(&header, _body_bytes, handles, &mut req)?;
370 let control_handle =
371 DeviceConnectorControlHandle { inner: this.inner.clone() };
372 Ok(DeviceConnectorRequest::ConnectToDeviceInfo {
373 device_info_request: req.device_info_request,
374
375 control_handle,
376 })
377 }
378 0x6e7f7e307df7816a => {
379 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
380 let mut req = fidl::new_empty!(
381 DeviceConnectorConnectToApplicationRequest,
382 fidl::encoding::DefaultFuchsiaResourceDialect
383 );
384 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnectorConnectToApplicationRequest>(&header, _body_bytes, handles, &mut req)?;
385 let control_handle =
386 DeviceConnectorControlHandle { inner: this.inner.clone() };
387 Ok(DeviceConnectorRequest::ConnectToApplication {
388 application_uuid: req.application_uuid,
389 service_provider: req.service_provider,
390 application_request: req.application_request,
391
392 control_handle,
393 })
394 }
395 _ => Err(fidl::Error::UnknownOrdinal {
396 ordinal: header.ordinal,
397 protocol_name:
398 <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
399 }),
400 }))
401 },
402 )
403 }
404}
405
406#[derive(Debug)]
408pub enum DeviceConnectorRequest {
409 ConnectToDeviceInfo {
413 device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
414 control_handle: DeviceConnectorControlHandle,
415 },
416 ConnectToApplication {
421 application_uuid: fidl_fuchsia_tee::Uuid,
422 service_provider:
423 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>>,
424 application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
425 control_handle: DeviceConnectorControlHandle,
426 },
427}
428
429impl DeviceConnectorRequest {
430 #[allow(irrefutable_let_patterns)]
431 pub fn into_connect_to_device_info(
432 self,
433 ) -> Option<(
434 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
435 DeviceConnectorControlHandle,
436 )> {
437 if let DeviceConnectorRequest::ConnectToDeviceInfo { device_info_request, control_handle } =
438 self
439 {
440 Some((device_info_request, control_handle))
441 } else {
442 None
443 }
444 }
445
446 #[allow(irrefutable_let_patterns)]
447 pub fn into_connect_to_application(
448 self,
449 ) -> Option<(
450 fidl_fuchsia_tee::Uuid,
451 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>>,
452 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
453 DeviceConnectorControlHandle,
454 )> {
455 if let DeviceConnectorRequest::ConnectToApplication {
456 application_uuid,
457 service_provider,
458 application_request,
459 control_handle,
460 } = self
461 {
462 Some((application_uuid, service_provider, application_request, control_handle))
463 } else {
464 None
465 }
466 }
467
468 pub fn method_name(&self) -> &'static str {
470 match *self {
471 DeviceConnectorRequest::ConnectToDeviceInfo { .. } => "connect_to_device_info",
472 DeviceConnectorRequest::ConnectToApplication { .. } => "connect_to_application",
473 }
474 }
475}
476
477#[derive(Debug, Clone)]
478pub struct DeviceConnectorControlHandle {
479 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
480}
481
482impl fidl::endpoints::ControlHandle for DeviceConnectorControlHandle {
483 fn shutdown(&self) {
484 self.inner.shutdown()
485 }
486 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
487 self.inner.shutdown_with_epitaph(status)
488 }
489
490 fn is_closed(&self) -> bool {
491 self.inner.channel().is_closed()
492 }
493 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
494 self.inner.channel().on_closed()
495 }
496
497 #[cfg(target_os = "fuchsia")]
498 fn signal_peer(
499 &self,
500 clear_mask: zx::Signals,
501 set_mask: zx::Signals,
502 ) -> Result<(), zx_status::Status> {
503 use fidl::Peered;
504 self.inner.channel().signal_peer(clear_mask, set_mask)
505 }
506}
507
508impl DeviceConnectorControlHandle {}
509
510#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
511pub struct ServiceMarker;
512
513#[cfg(target_os = "fuchsia")]
514impl fidl::endpoints::ServiceMarker for ServiceMarker {
515 type Proxy = ServiceProxy;
516 type Request = ServiceRequest;
517 const SERVICE_NAME: &'static str = "fuchsia.hardware.tee.Service";
518}
519
520#[cfg(target_os = "fuchsia")]
523pub enum ServiceRequest {
524 DeviceConnector(DeviceConnectorRequestStream),
525}
526
527#[cfg(target_os = "fuchsia")]
528impl fidl::endpoints::ServiceRequest for ServiceRequest {
529 type Service = ServiceMarker;
530
531 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
532 match name {
533 "device_connector" => Self::DeviceConnector(
534 <DeviceConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(
535 _channel,
536 ),
537 ),
538 _ => panic!("no such member protocol name for service Service"),
539 }
540 }
541
542 fn member_names() -> &'static [&'static str] {
543 &["device_connector"]
544 }
545}
546#[cfg(target_os = "fuchsia")]
547pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
548
549#[cfg(target_os = "fuchsia")]
550impl fidl::endpoints::ServiceProxy for ServiceProxy {
551 type Service = ServiceMarker;
552
553 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
554 Self(opener)
555 }
556}
557
558#[cfg(target_os = "fuchsia")]
559impl ServiceProxy {
560 pub fn connect_to_device_connector(&self) -> Result<DeviceConnectorProxy, fidl::Error> {
561 let (proxy, server_end) = fidl::endpoints::create_proxy::<DeviceConnectorMarker>();
562 self.connect_channel_to_device_connector(server_end)?;
563 Ok(proxy)
564 }
565
566 pub fn connect_to_device_connector_sync(
569 &self,
570 ) -> Result<DeviceConnectorSynchronousProxy, fidl::Error> {
571 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DeviceConnectorMarker>();
572 self.connect_channel_to_device_connector(server_end)?;
573 Ok(proxy)
574 }
575
576 pub fn connect_channel_to_device_connector(
579 &self,
580 server_end: fidl::endpoints::ServerEnd<DeviceConnectorMarker>,
581 ) -> Result<(), fidl::Error> {
582 self.0.open_member("device_connector", server_end.into_channel())
583 }
584
585 pub fn instance_name(&self) -> &str {
586 self.0.instance_name()
587 }
588}
589
590mod internal {
591 use super::*;
592
593 impl fidl::encoding::ResourceTypeMarker for DeviceConnectorConnectToApplicationRequest {
594 type Borrowed<'a> = &'a mut Self;
595 fn take_or_borrow<'a>(
596 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
597 ) -> Self::Borrowed<'a> {
598 value
599 }
600 }
601
602 unsafe impl fidl::encoding::TypeMarker for DeviceConnectorConnectToApplicationRequest {
603 type Owned = Self;
604
605 #[inline(always)]
606 fn inline_align(_context: fidl::encoding::Context) -> usize {
607 4
608 }
609
610 #[inline(always)]
611 fn inline_size(_context: fidl::encoding::Context) -> usize {
612 24
613 }
614 }
615
616 unsafe impl
617 fidl::encoding::Encode<
618 DeviceConnectorConnectToApplicationRequest,
619 fidl::encoding::DefaultFuchsiaResourceDialect,
620 > for &mut DeviceConnectorConnectToApplicationRequest
621 {
622 #[inline]
623 unsafe fn encode(
624 self,
625 encoder: &mut fidl::encoding::Encoder<
626 '_,
627 fidl::encoding::DefaultFuchsiaResourceDialect,
628 >,
629 offset: usize,
630 _depth: fidl::encoding::Depth,
631 ) -> fidl::Result<()> {
632 encoder.debug_check_bounds::<DeviceConnectorConnectToApplicationRequest>(offset);
633 fidl::encoding::Encode::<
635 DeviceConnectorConnectToApplicationRequest,
636 fidl::encoding::DefaultFuchsiaResourceDialect,
637 >::encode(
638 (
639 <fidl_fuchsia_tee::Uuid as fidl::encoding::ValueTypeMarker>::borrow(
640 &self.application_uuid,
641 ),
642 <fidl::encoding::Optional<
643 fidl::encoding::Endpoint<
644 fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
645 >,
646 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
647 &mut self.service_provider,
648 ),
649 <fidl::encoding::Endpoint<
650 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
651 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
652 &mut self.application_request,
653 ),
654 ),
655 encoder,
656 offset,
657 _depth,
658 )
659 }
660 }
661 unsafe impl<
662 T0: fidl::encoding::Encode<
663 fidl_fuchsia_tee::Uuid,
664 fidl::encoding::DefaultFuchsiaResourceDialect,
665 >,
666 T1: fidl::encoding::Encode<
667 fidl::encoding::Optional<
668 fidl::encoding::Endpoint<
669 fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
670 >,
671 >,
672 fidl::encoding::DefaultFuchsiaResourceDialect,
673 >,
674 T2: fidl::encoding::Encode<
675 fidl::encoding::Endpoint<
676 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
677 >,
678 fidl::encoding::DefaultFuchsiaResourceDialect,
679 >,
680 >
681 fidl::encoding::Encode<
682 DeviceConnectorConnectToApplicationRequest,
683 fidl::encoding::DefaultFuchsiaResourceDialect,
684 > for (T0, T1, T2)
685 {
686 #[inline]
687 unsafe fn encode(
688 self,
689 encoder: &mut fidl::encoding::Encoder<
690 '_,
691 fidl::encoding::DefaultFuchsiaResourceDialect,
692 >,
693 offset: usize,
694 depth: fidl::encoding::Depth,
695 ) -> fidl::Result<()> {
696 encoder.debug_check_bounds::<DeviceConnectorConnectToApplicationRequest>(offset);
697 self.0.encode(encoder, offset + 0, depth)?;
701 self.1.encode(encoder, offset + 16, depth)?;
702 self.2.encode(encoder, offset + 20, depth)?;
703 Ok(())
704 }
705 }
706
707 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
708 for DeviceConnectorConnectToApplicationRequest
709 {
710 #[inline(always)]
711 fn new_empty() -> Self {
712 Self {
713 application_uuid: fidl::new_empty!(
714 fidl_fuchsia_tee::Uuid,
715 fidl::encoding::DefaultFuchsiaResourceDialect
716 ),
717 service_provider: fidl::new_empty!(
718 fidl::encoding::Optional<
719 fidl::encoding::Endpoint<
720 fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
721 >,
722 >,
723 fidl::encoding::DefaultFuchsiaResourceDialect
724 ),
725 application_request: fidl::new_empty!(
726 fidl::encoding::Endpoint<
727 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
728 >,
729 fidl::encoding::DefaultFuchsiaResourceDialect
730 ),
731 }
732 }
733
734 #[inline]
735 unsafe fn decode(
736 &mut self,
737 decoder: &mut fidl::encoding::Decoder<
738 '_,
739 fidl::encoding::DefaultFuchsiaResourceDialect,
740 >,
741 offset: usize,
742 _depth: fidl::encoding::Depth,
743 ) -> fidl::Result<()> {
744 decoder.debug_check_bounds::<Self>(offset);
745 fidl::decode!(
747 fidl_fuchsia_tee::Uuid,
748 fidl::encoding::DefaultFuchsiaResourceDialect,
749 &mut self.application_uuid,
750 decoder,
751 offset + 0,
752 _depth
753 )?;
754 fidl::decode!(
755 fidl::encoding::Optional<
756 fidl::encoding::Endpoint<
757 fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
758 >,
759 >,
760 fidl::encoding::DefaultFuchsiaResourceDialect,
761 &mut self.service_provider,
762 decoder,
763 offset + 16,
764 _depth
765 )?;
766 fidl::decode!(
767 fidl::encoding::Endpoint<
768 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
769 >,
770 fidl::encoding::DefaultFuchsiaResourceDialect,
771 &mut self.application_request,
772 decoder,
773 offset + 20,
774 _depth
775 )?;
776 Ok(())
777 }
778 }
779
780 impl fidl::encoding::ResourceTypeMarker for DeviceConnectorConnectToDeviceInfoRequest {
781 type Borrowed<'a> = &'a mut Self;
782 fn take_or_borrow<'a>(
783 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
784 ) -> Self::Borrowed<'a> {
785 value
786 }
787 }
788
789 unsafe impl fidl::encoding::TypeMarker for DeviceConnectorConnectToDeviceInfoRequest {
790 type Owned = Self;
791
792 #[inline(always)]
793 fn inline_align(_context: fidl::encoding::Context) -> usize {
794 4
795 }
796
797 #[inline(always)]
798 fn inline_size(_context: fidl::encoding::Context) -> usize {
799 4
800 }
801 }
802
803 unsafe impl
804 fidl::encoding::Encode<
805 DeviceConnectorConnectToDeviceInfoRequest,
806 fidl::encoding::DefaultFuchsiaResourceDialect,
807 > for &mut DeviceConnectorConnectToDeviceInfoRequest
808 {
809 #[inline]
810 unsafe fn encode(
811 self,
812 encoder: &mut fidl::encoding::Encoder<
813 '_,
814 fidl::encoding::DefaultFuchsiaResourceDialect,
815 >,
816 offset: usize,
817 _depth: fidl::encoding::Depth,
818 ) -> fidl::Result<()> {
819 encoder.debug_check_bounds::<DeviceConnectorConnectToDeviceInfoRequest>(offset);
820 fidl::encoding::Encode::<
822 DeviceConnectorConnectToDeviceInfoRequest,
823 fidl::encoding::DefaultFuchsiaResourceDialect,
824 >::encode(
825 (<fidl::encoding::Endpoint<
826 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
827 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
828 &mut self.device_info_request,
829 ),),
830 encoder,
831 offset,
832 _depth,
833 )
834 }
835 }
836 unsafe impl<
837 T0: fidl::encoding::Encode<
838 fidl::encoding::Endpoint<
839 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
840 >,
841 fidl::encoding::DefaultFuchsiaResourceDialect,
842 >,
843 >
844 fidl::encoding::Encode<
845 DeviceConnectorConnectToDeviceInfoRequest,
846 fidl::encoding::DefaultFuchsiaResourceDialect,
847 > for (T0,)
848 {
849 #[inline]
850 unsafe fn encode(
851 self,
852 encoder: &mut fidl::encoding::Encoder<
853 '_,
854 fidl::encoding::DefaultFuchsiaResourceDialect,
855 >,
856 offset: usize,
857 depth: fidl::encoding::Depth,
858 ) -> fidl::Result<()> {
859 encoder.debug_check_bounds::<DeviceConnectorConnectToDeviceInfoRequest>(offset);
860 self.0.encode(encoder, offset + 0, depth)?;
864 Ok(())
865 }
866 }
867
868 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
869 for DeviceConnectorConnectToDeviceInfoRequest
870 {
871 #[inline(always)]
872 fn new_empty() -> Self {
873 Self {
874 device_info_request: fidl::new_empty!(
875 fidl::encoding::Endpoint<
876 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
877 >,
878 fidl::encoding::DefaultFuchsiaResourceDialect
879 ),
880 }
881 }
882
883 #[inline]
884 unsafe fn decode(
885 &mut self,
886 decoder: &mut fidl::encoding::Decoder<
887 '_,
888 fidl::encoding::DefaultFuchsiaResourceDialect,
889 >,
890 offset: usize,
891 _depth: fidl::encoding::Depth,
892 ) -> fidl::Result<()> {
893 decoder.debug_check_bounds::<Self>(offset);
894 fidl::decode!(
896 fidl::encoding::Endpoint<
897 fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
898 >,
899 fidl::encoding::DefaultFuchsiaResourceDialect,
900 &mut self.device_info_request,
901 decoder,
902 offset + 0,
903 _depth
904 )?;
905 Ok(())
906 }
907 }
908}