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