Skip to main content

fidl_fuchsia_hardware_tee/
fidl_fuchsia_hardware_tee.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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        Self { client: fidl::client::sync::Client::new(channel) }
91    }
92
93    pub fn into_channel(self) -> fidl::Channel {
94        self.client.into_channel()
95    }
96
97    /// Waits until an event arrives and returns it. It is safe for other
98    /// threads to make concurrent requests while waiting for an event.
99    pub fn wait_for_event(
100        &self,
101        deadline: zx::MonotonicInstant,
102    ) -> Result<DeviceConnectorEvent, fidl::Error> {
103        DeviceConnectorEvent::decode(self.client.wait_for_event::<DeviceConnectorMarker>(deadline)?)
104    }
105
106    /// Requests a `DeviceInfo` connection to the TEE driver to enumerate device info.
107    ///
108    /// The sole caller of this should be the TEE Manager.
109    pub fn r#connect_to_device_info(
110        &self,
111        mut device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
112    ) -> Result<(), fidl::Error> {
113        self.client.send::<DeviceConnectorConnectToDeviceInfoRequest>(
114            (device_info_request,),
115            0x5fa3623fd14f786,
116            fidl::encoding::DynamicFlags::empty(),
117        )
118    }
119
120    /// Requests an `Application` connection from the TEE driver while the caller provides a client
121    /// channel end to a `Provider` server that supports the driver on any RPCs.
122    ///
123    /// The sole caller of this should be the TEE Manager.
124    pub fn r#connect_to_application(
125        &self,
126        mut application_uuid: &fidl_fuchsia_tee::Uuid,
127        mut service_provider: Option<
128            fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
129        >,
130        mut application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
131    ) -> Result<(), fidl::Error> {
132        self.client.send::<DeviceConnectorConnectToApplicationRequest>(
133            (application_uuid, service_provider, application_request),
134            0x6e7f7e307df7816a,
135            fidl::encoding::DynamicFlags::empty(),
136        )
137    }
138}
139
140#[cfg(target_os = "fuchsia")]
141impl From<DeviceConnectorSynchronousProxy> for zx::NullableHandle {
142    fn from(value: DeviceConnectorSynchronousProxy) -> Self {
143        value.into_channel().into()
144    }
145}
146
147#[cfg(target_os = "fuchsia")]
148impl From<fidl::Channel> for DeviceConnectorSynchronousProxy {
149    fn from(value: fidl::Channel) -> Self {
150        Self::new(value)
151    }
152}
153
154#[cfg(target_os = "fuchsia")]
155impl fidl::endpoints::FromClient for DeviceConnectorSynchronousProxy {
156    type Protocol = DeviceConnectorMarker;
157
158    fn from_client(value: fidl::endpoints::ClientEnd<DeviceConnectorMarker>) -> Self {
159        Self::new(value.into_channel())
160    }
161}
162
163#[derive(Debug, Clone)]
164pub struct DeviceConnectorProxy {
165    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
166}
167
168impl fidl::endpoints::Proxy for DeviceConnectorProxy {
169    type Protocol = DeviceConnectorMarker;
170
171    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
172        Self::new(inner)
173    }
174
175    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
176        self.client.into_channel().map_err(|client| Self { client })
177    }
178
179    fn as_channel(&self) -> &::fidl::AsyncChannel {
180        self.client.as_channel()
181    }
182}
183
184impl DeviceConnectorProxy {
185    /// Create a new Proxy for fuchsia.hardware.tee/DeviceConnector.
186    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
187        let protocol_name = <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
188        Self { client: fidl::client::Client::new(channel, protocol_name) }
189    }
190
191    /// Get a Stream of events from the remote end of the protocol.
192    ///
193    /// # Panics
194    ///
195    /// Panics if the event stream was already taken.
196    pub fn take_event_stream(&self) -> DeviceConnectorEventStream {
197        DeviceConnectorEventStream { event_receiver: self.client.take_event_receiver() }
198    }
199
200    /// Requests a `DeviceInfo` connection to the TEE driver to enumerate device info.
201    ///
202    /// The sole caller of this should be the TEE Manager.
203    pub fn r#connect_to_device_info(
204        &self,
205        mut device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
206    ) -> Result<(), fidl::Error> {
207        DeviceConnectorProxyInterface::r#connect_to_device_info(self, device_info_request)
208    }
209
210    /// Requests an `Application` connection from the TEE driver while the caller provides a client
211    /// channel end to a `Provider` server that supports the driver on any RPCs.
212    ///
213    /// The sole caller of this should be the TEE Manager.
214    pub fn r#connect_to_application(
215        &self,
216        mut application_uuid: &fidl_fuchsia_tee::Uuid,
217        mut service_provider: Option<
218            fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
219        >,
220        mut application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
221    ) -> Result<(), fidl::Error> {
222        DeviceConnectorProxyInterface::r#connect_to_application(
223            self,
224            application_uuid,
225            service_provider,
226            application_request,
227        )
228    }
229}
230
231impl DeviceConnectorProxyInterface for DeviceConnectorProxy {
232    fn r#connect_to_device_info(
233        &self,
234        mut device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
235    ) -> Result<(), fidl::Error> {
236        self.client.send::<DeviceConnectorConnectToDeviceInfoRequest>(
237            (device_info_request,),
238            0x5fa3623fd14f786,
239            fidl::encoding::DynamicFlags::empty(),
240        )
241    }
242
243    fn r#connect_to_application(
244        &self,
245        mut application_uuid: &fidl_fuchsia_tee::Uuid,
246        mut service_provider: Option<
247            fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
248        >,
249        mut application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
250    ) -> Result<(), fidl::Error> {
251        self.client.send::<DeviceConnectorConnectToApplicationRequest>(
252            (application_uuid, service_provider, application_request),
253            0x6e7f7e307df7816a,
254            fidl::encoding::DynamicFlags::empty(),
255        )
256    }
257}
258
259pub struct DeviceConnectorEventStream {
260    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
261}
262
263impl std::marker::Unpin for DeviceConnectorEventStream {}
264
265impl futures::stream::FusedStream for DeviceConnectorEventStream {
266    fn is_terminated(&self) -> bool {
267        self.event_receiver.is_terminated()
268    }
269}
270
271impl futures::Stream for DeviceConnectorEventStream {
272    type Item = Result<DeviceConnectorEvent, fidl::Error>;
273
274    fn poll_next(
275        mut self: std::pin::Pin<&mut Self>,
276        cx: &mut std::task::Context<'_>,
277    ) -> std::task::Poll<Option<Self::Item>> {
278        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
279            &mut self.event_receiver,
280            cx
281        )?) {
282            Some(buf) => std::task::Poll::Ready(Some(DeviceConnectorEvent::decode(buf))),
283            None => std::task::Poll::Ready(None),
284        }
285    }
286}
287
288#[derive(Debug)]
289pub enum DeviceConnectorEvent {}
290
291impl DeviceConnectorEvent {
292    /// Decodes a message buffer as a [`DeviceConnectorEvent`].
293    fn decode(
294        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
295    ) -> Result<DeviceConnectorEvent, fidl::Error> {
296        let (bytes, _handles) = buf.split_mut();
297        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
298        debug_assert_eq!(tx_header.tx_id, 0);
299        match tx_header.ordinal {
300            _ => Err(fidl::Error::UnknownOrdinal {
301                ordinal: tx_header.ordinal,
302                protocol_name:
303                    <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
304            }),
305        }
306    }
307}
308
309/// A Stream of incoming requests for fuchsia.hardware.tee/DeviceConnector.
310pub struct DeviceConnectorRequestStream {
311    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
312    is_terminated: bool,
313}
314
315impl std::marker::Unpin for DeviceConnectorRequestStream {}
316
317impl futures::stream::FusedStream for DeviceConnectorRequestStream {
318    fn is_terminated(&self) -> bool {
319        self.is_terminated
320    }
321}
322
323impl fidl::endpoints::RequestStream for DeviceConnectorRequestStream {
324    type Protocol = DeviceConnectorMarker;
325    type ControlHandle = DeviceConnectorControlHandle;
326
327    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
328        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
329    }
330
331    fn control_handle(&self) -> Self::ControlHandle {
332        DeviceConnectorControlHandle { inner: self.inner.clone() }
333    }
334
335    fn into_inner(
336        self,
337    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
338    {
339        (self.inner, self.is_terminated)
340    }
341
342    fn from_inner(
343        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
344        is_terminated: bool,
345    ) -> Self {
346        Self { inner, is_terminated }
347    }
348}
349
350impl futures::Stream for DeviceConnectorRequestStream {
351    type Item = Result<DeviceConnectorRequest, fidl::Error>;
352
353    fn poll_next(
354        mut self: std::pin::Pin<&mut Self>,
355        cx: &mut std::task::Context<'_>,
356    ) -> std::task::Poll<Option<Self::Item>> {
357        let this = &mut *self;
358        if this.inner.check_shutdown(cx) {
359            this.is_terminated = true;
360            return std::task::Poll::Ready(None);
361        }
362        if this.is_terminated {
363            panic!("polled DeviceConnectorRequestStream after completion");
364        }
365        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
366            |bytes, handles| {
367                match this.inner.channel().read_etc(cx, bytes, handles) {
368                    std::task::Poll::Ready(Ok(())) => {}
369                    std::task::Poll::Pending => return std::task::Poll::Pending,
370                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
371                        this.is_terminated = true;
372                        return std::task::Poll::Ready(None);
373                    }
374                    std::task::Poll::Ready(Err(e)) => {
375                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
376                            e.into(),
377                        ))));
378                    }
379                }
380
381                // A message has been received from the channel
382                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
383
384                std::task::Poll::Ready(Some(match header.ordinal {
385                    0x5fa3623fd14f786 => {
386                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
387                        let mut req = fidl::new_empty!(
388                            DeviceConnectorConnectToDeviceInfoRequest,
389                            fidl::encoding::DefaultFuchsiaResourceDialect
390                        );
391                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnectorConnectToDeviceInfoRequest>(&header, _body_bytes, handles, &mut req)?;
392                        let control_handle =
393                            DeviceConnectorControlHandle { inner: this.inner.clone() };
394                        Ok(DeviceConnectorRequest::ConnectToDeviceInfo {
395                            device_info_request: req.device_info_request,
396
397                            control_handle,
398                        })
399                    }
400                    0x6e7f7e307df7816a => {
401                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
402                        let mut req = fidl::new_empty!(
403                            DeviceConnectorConnectToApplicationRequest,
404                            fidl::encoding::DefaultFuchsiaResourceDialect
405                        );
406                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnectorConnectToApplicationRequest>(&header, _body_bytes, handles, &mut req)?;
407                        let control_handle =
408                            DeviceConnectorControlHandle { inner: this.inner.clone() };
409                        Ok(DeviceConnectorRequest::ConnectToApplication {
410                            application_uuid: req.application_uuid,
411                            service_provider: req.service_provider,
412                            application_request: req.application_request,
413
414                            control_handle,
415                        })
416                    }
417                    _ => Err(fidl::Error::UnknownOrdinal {
418                        ordinal: header.ordinal,
419                        protocol_name:
420                            <DeviceConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
421                    }),
422                }))
423            },
424        )
425    }
426}
427
428/// Protocol used by the TEE Manager to proxy requests for TEE access to the driver.
429#[derive(Debug)]
430pub enum DeviceConnectorRequest {
431    /// Requests a `DeviceInfo` connection to the TEE driver to enumerate device info.
432    ///
433    /// The sole caller of this should be the TEE Manager.
434    ConnectToDeviceInfo {
435        device_info_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
436        control_handle: DeviceConnectorControlHandle,
437    },
438    /// Requests an `Application` connection from the TEE driver while the caller provides a client
439    /// channel end to a `Provider` server that supports the driver on any RPCs.
440    ///
441    /// The sole caller of this should be the TEE Manager.
442    ConnectToApplication {
443        application_uuid: fidl_fuchsia_tee::Uuid,
444        service_provider:
445            Option<fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>>,
446        application_request: fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
447        control_handle: DeviceConnectorControlHandle,
448    },
449}
450
451impl DeviceConnectorRequest {
452    #[allow(irrefutable_let_patterns)]
453    pub fn into_connect_to_device_info(
454        self,
455    ) -> Option<(
456        fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
457        DeviceConnectorControlHandle,
458    )> {
459        if let DeviceConnectorRequest::ConnectToDeviceInfo { device_info_request, control_handle } =
460            self
461        {
462            Some((device_info_request, control_handle))
463        } else {
464            None
465        }
466    }
467
468    #[allow(irrefutable_let_patterns)]
469    pub fn into_connect_to_application(
470        self,
471    ) -> Option<(
472        fidl_fuchsia_tee::Uuid,
473        Option<fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>>,
474        fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
475        DeviceConnectorControlHandle,
476    )> {
477        if let DeviceConnectorRequest::ConnectToApplication {
478            application_uuid,
479            service_provider,
480            application_request,
481            control_handle,
482        } = self
483        {
484            Some((application_uuid, service_provider, application_request, control_handle))
485        } else {
486            None
487        }
488    }
489
490    /// Name of the method defined in FIDL
491    pub fn method_name(&self) -> &'static str {
492        match *self {
493            DeviceConnectorRequest::ConnectToDeviceInfo { .. } => "connect_to_device_info",
494            DeviceConnectorRequest::ConnectToApplication { .. } => "connect_to_application",
495        }
496    }
497}
498
499#[derive(Debug, Clone)]
500pub struct DeviceConnectorControlHandle {
501    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
502}
503
504impl fidl::endpoints::ControlHandle for DeviceConnectorControlHandle {
505    fn shutdown(&self) {
506        self.inner.shutdown()
507    }
508
509    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
510        self.inner.shutdown_with_epitaph(status)
511    }
512
513    fn is_closed(&self) -> bool {
514        self.inner.channel().is_closed()
515    }
516    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
517        self.inner.channel().on_closed()
518    }
519
520    #[cfg(target_os = "fuchsia")]
521    fn signal_peer(
522        &self,
523        clear_mask: zx::Signals,
524        set_mask: zx::Signals,
525    ) -> Result<(), zx_status::Status> {
526        use fidl::Peered;
527        self.inner.channel().signal_peer(clear_mask, set_mask)
528    }
529}
530
531impl DeviceConnectorControlHandle {}
532
533#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
534pub struct ServiceMarker;
535
536#[cfg(target_os = "fuchsia")]
537impl fidl::endpoints::ServiceMarker for ServiceMarker {
538    type Proxy = ServiceProxy;
539    type Request = ServiceRequest;
540    const SERVICE_NAME: &'static str = "fuchsia.hardware.tee.Service";
541}
542
543/// A request for one of the member protocols of Service.
544///
545#[cfg(target_os = "fuchsia")]
546pub enum ServiceRequest {
547    DeviceConnector(DeviceConnectorRequestStream),
548}
549
550#[cfg(target_os = "fuchsia")]
551impl fidl::endpoints::ServiceRequest for ServiceRequest {
552    type Service = ServiceMarker;
553
554    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
555        match name {
556            "device_connector" => Self::DeviceConnector(
557                <DeviceConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(
558                    _channel,
559                ),
560            ),
561            _ => panic!("no such member protocol name for service Service"),
562        }
563    }
564
565    fn member_names() -> &'static [&'static str] {
566        &["device_connector"]
567    }
568}
569#[cfg(target_os = "fuchsia")]
570pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
571
572#[cfg(target_os = "fuchsia")]
573impl fidl::endpoints::ServiceProxy for ServiceProxy {
574    type Service = ServiceMarker;
575
576    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
577        Self(opener)
578    }
579}
580
581#[cfg(target_os = "fuchsia")]
582impl ServiceProxy {
583    pub fn connect_to_device_connector(&self) -> Result<DeviceConnectorProxy, fidl::Error> {
584        let (proxy, server_end) = fidl::endpoints::create_proxy::<DeviceConnectorMarker>();
585        self.connect_channel_to_device_connector(server_end)?;
586        Ok(proxy)
587    }
588
589    /// Like `connect_to_device_connector`, but returns a sync proxy.
590    /// See [`Self::connect_to_device_connector`] for more details.
591    pub fn connect_to_device_connector_sync(
592        &self,
593    ) -> Result<DeviceConnectorSynchronousProxy, fidl::Error> {
594        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DeviceConnectorMarker>();
595        self.connect_channel_to_device_connector(server_end)?;
596        Ok(proxy)
597    }
598
599    /// Like `connect_to_device_connector`, but accepts a server end.
600    /// See [`Self::connect_to_device_connector`] for more details.
601    pub fn connect_channel_to_device_connector(
602        &self,
603        server_end: fidl::endpoints::ServerEnd<DeviceConnectorMarker>,
604    ) -> Result<(), fidl::Error> {
605        self.0.open_member("device_connector", server_end.into_channel())
606    }
607
608    pub fn instance_name(&self) -> &str {
609        self.0.instance_name()
610    }
611}
612
613mod internal {
614    use super::*;
615
616    impl fidl::encoding::ResourceTypeMarker for DeviceConnectorConnectToApplicationRequest {
617        type Borrowed<'a> = &'a mut Self;
618        fn take_or_borrow<'a>(
619            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
620        ) -> Self::Borrowed<'a> {
621            value
622        }
623    }
624
625    unsafe impl fidl::encoding::TypeMarker for DeviceConnectorConnectToApplicationRequest {
626        type Owned = Self;
627
628        #[inline(always)]
629        fn inline_align(_context: fidl::encoding::Context) -> usize {
630            4
631        }
632
633        #[inline(always)]
634        fn inline_size(_context: fidl::encoding::Context) -> usize {
635            24
636        }
637    }
638
639    unsafe impl
640        fidl::encoding::Encode<
641            DeviceConnectorConnectToApplicationRequest,
642            fidl::encoding::DefaultFuchsiaResourceDialect,
643        > for &mut DeviceConnectorConnectToApplicationRequest
644    {
645        #[inline]
646        unsafe fn encode(
647            self,
648            encoder: &mut fidl::encoding::Encoder<
649                '_,
650                fidl::encoding::DefaultFuchsiaResourceDialect,
651            >,
652            offset: usize,
653            _depth: fidl::encoding::Depth,
654        ) -> fidl::Result<()> {
655            encoder.debug_check_bounds::<DeviceConnectorConnectToApplicationRequest>(offset);
656            // Delegate to tuple encoding.
657            fidl::encoding::Encode::<
658                DeviceConnectorConnectToApplicationRequest,
659                fidl::encoding::DefaultFuchsiaResourceDialect,
660            >::encode(
661                (
662                    <fidl_fuchsia_tee::Uuid as fidl::encoding::ValueTypeMarker>::borrow(
663                        &self.application_uuid,
664                    ),
665                    <fidl::encoding::Optional<
666                        fidl::encoding::Endpoint<
667                            fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
668                        >,
669                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
670                        &mut self.service_provider,
671                    ),
672                    <fidl::encoding::Endpoint<
673                        fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
674                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
675                        &mut self.application_request,
676                    ),
677                ),
678                encoder,
679                offset,
680                _depth,
681            )
682        }
683    }
684    unsafe impl<
685        T0: fidl::encoding::Encode<
686                fidl_fuchsia_tee::Uuid,
687                fidl::encoding::DefaultFuchsiaResourceDialect,
688            >,
689        T1: fidl::encoding::Encode<
690                fidl::encoding::Optional<
691                    fidl::encoding::Endpoint<
692                        fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
693                    >,
694                >,
695                fidl::encoding::DefaultFuchsiaResourceDialect,
696            >,
697        T2: fidl::encoding::Encode<
698                fidl::encoding::Endpoint<
699                    fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
700                >,
701                fidl::encoding::DefaultFuchsiaResourceDialect,
702            >,
703    >
704        fidl::encoding::Encode<
705            DeviceConnectorConnectToApplicationRequest,
706            fidl::encoding::DefaultFuchsiaResourceDialect,
707        > for (T0, T1, T2)
708    {
709        #[inline]
710        unsafe fn encode(
711            self,
712            encoder: &mut fidl::encoding::Encoder<
713                '_,
714                fidl::encoding::DefaultFuchsiaResourceDialect,
715            >,
716            offset: usize,
717            depth: fidl::encoding::Depth,
718        ) -> fidl::Result<()> {
719            encoder.debug_check_bounds::<DeviceConnectorConnectToApplicationRequest>(offset);
720            // Zero out padding regions. There's no need to apply masks
721            // because the unmasked parts will be overwritten by fields.
722            // Write the fields.
723            self.0.encode(encoder, offset + 0, depth)?;
724            self.1.encode(encoder, offset + 16, depth)?;
725            self.2.encode(encoder, offset + 20, depth)?;
726            Ok(())
727        }
728    }
729
730    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
731        for DeviceConnectorConnectToApplicationRequest
732    {
733        #[inline(always)]
734        fn new_empty() -> Self {
735            Self {
736                application_uuid: fidl::new_empty!(
737                    fidl_fuchsia_tee::Uuid,
738                    fidl::encoding::DefaultFuchsiaResourceDialect
739                ),
740                service_provider: fidl::new_empty!(
741                    fidl::encoding::Optional<
742                        fidl::encoding::Endpoint<
743                            fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
744                        >,
745                    >,
746                    fidl::encoding::DefaultFuchsiaResourceDialect
747                ),
748                application_request: fidl::new_empty!(
749                    fidl::encoding::Endpoint<
750                        fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
751                    >,
752                    fidl::encoding::DefaultFuchsiaResourceDialect
753                ),
754            }
755        }
756
757        #[inline]
758        unsafe fn decode(
759            &mut self,
760            decoder: &mut fidl::encoding::Decoder<
761                '_,
762                fidl::encoding::DefaultFuchsiaResourceDialect,
763            >,
764            offset: usize,
765            _depth: fidl::encoding::Depth,
766        ) -> fidl::Result<()> {
767            decoder.debug_check_bounds::<Self>(offset);
768            // Verify that padding bytes are zero.
769            fidl::decode!(
770                fidl_fuchsia_tee::Uuid,
771                fidl::encoding::DefaultFuchsiaResourceDialect,
772                &mut self.application_uuid,
773                decoder,
774                offset + 0,
775                _depth
776            )?;
777            fidl::decode!(
778                fidl::encoding::Optional<
779                    fidl::encoding::Endpoint<
780                        fidl::endpoints::ClientEnd<fidl_fuchsia_tee_manager::ProviderMarker>,
781                    >,
782                >,
783                fidl::encoding::DefaultFuchsiaResourceDialect,
784                &mut self.service_provider,
785                decoder,
786                offset + 16,
787                _depth
788            )?;
789            fidl::decode!(
790                fidl::encoding::Endpoint<
791                    fidl::endpoints::ServerEnd<fidl_fuchsia_tee::ApplicationMarker>,
792                >,
793                fidl::encoding::DefaultFuchsiaResourceDialect,
794                &mut self.application_request,
795                decoder,
796                offset + 20,
797                _depth
798            )?;
799            Ok(())
800        }
801    }
802
803    impl fidl::encoding::ResourceTypeMarker for DeviceConnectorConnectToDeviceInfoRequest {
804        type Borrowed<'a> = &'a mut Self;
805        fn take_or_borrow<'a>(
806            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
807        ) -> Self::Borrowed<'a> {
808            value
809        }
810    }
811
812    unsafe impl fidl::encoding::TypeMarker for DeviceConnectorConnectToDeviceInfoRequest {
813        type Owned = Self;
814
815        #[inline(always)]
816        fn inline_align(_context: fidl::encoding::Context) -> usize {
817            4
818        }
819
820        #[inline(always)]
821        fn inline_size(_context: fidl::encoding::Context) -> usize {
822            4
823        }
824    }
825
826    unsafe impl
827        fidl::encoding::Encode<
828            DeviceConnectorConnectToDeviceInfoRequest,
829            fidl::encoding::DefaultFuchsiaResourceDialect,
830        > for &mut DeviceConnectorConnectToDeviceInfoRequest
831    {
832        #[inline]
833        unsafe fn encode(
834            self,
835            encoder: &mut fidl::encoding::Encoder<
836                '_,
837                fidl::encoding::DefaultFuchsiaResourceDialect,
838            >,
839            offset: usize,
840            _depth: fidl::encoding::Depth,
841        ) -> fidl::Result<()> {
842            encoder.debug_check_bounds::<DeviceConnectorConnectToDeviceInfoRequest>(offset);
843            // Delegate to tuple encoding.
844            fidl::encoding::Encode::<
845                DeviceConnectorConnectToDeviceInfoRequest,
846                fidl::encoding::DefaultFuchsiaResourceDialect,
847            >::encode(
848                (<fidl::encoding::Endpoint<
849                    fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
850                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
851                    &mut self.device_info_request,
852                ),),
853                encoder,
854                offset,
855                _depth,
856            )
857        }
858    }
859    unsafe impl<
860        T0: fidl::encoding::Encode<
861                fidl::encoding::Endpoint<
862                    fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
863                >,
864                fidl::encoding::DefaultFuchsiaResourceDialect,
865            >,
866    >
867        fidl::encoding::Encode<
868            DeviceConnectorConnectToDeviceInfoRequest,
869            fidl::encoding::DefaultFuchsiaResourceDialect,
870        > for (T0,)
871    {
872        #[inline]
873        unsafe fn encode(
874            self,
875            encoder: &mut fidl::encoding::Encoder<
876                '_,
877                fidl::encoding::DefaultFuchsiaResourceDialect,
878            >,
879            offset: usize,
880            depth: fidl::encoding::Depth,
881        ) -> fidl::Result<()> {
882            encoder.debug_check_bounds::<DeviceConnectorConnectToDeviceInfoRequest>(offset);
883            // Zero out padding regions. There's no need to apply masks
884            // because the unmasked parts will be overwritten by fields.
885            // Write the fields.
886            self.0.encode(encoder, offset + 0, depth)?;
887            Ok(())
888        }
889    }
890
891    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
892        for DeviceConnectorConnectToDeviceInfoRequest
893    {
894        #[inline(always)]
895        fn new_empty() -> Self {
896            Self {
897                device_info_request: fidl::new_empty!(
898                    fidl::encoding::Endpoint<
899                        fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
900                    >,
901                    fidl::encoding::DefaultFuchsiaResourceDialect
902                ),
903            }
904        }
905
906        #[inline]
907        unsafe fn decode(
908            &mut self,
909            decoder: &mut fidl::encoding::Decoder<
910                '_,
911                fidl::encoding::DefaultFuchsiaResourceDialect,
912            >,
913            offset: usize,
914            _depth: fidl::encoding::Depth,
915        ) -> fidl::Result<()> {
916            decoder.debug_check_bounds::<Self>(offset);
917            // Verify that padding bytes are zero.
918            fidl::decode!(
919                fidl::encoding::Endpoint<
920                    fidl::endpoints::ServerEnd<fidl_fuchsia_tee::DeviceInfoMarker>,
921                >,
922                fidl::encoding::DefaultFuchsiaResourceDialect,
923                &mut self.device_info_request,
924                decoder,
925                offset + 0,
926                _depth
927            )?;
928            Ok(())
929        }
930    }
931}