fidl_fuchsia_test_syscalls/
fidl_fuchsia_test_syscalls.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_test_syscalls_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct ControlMarker;
16
17impl fidl::endpoints::ProtocolMarker for ControlMarker {
18    type Proxy = ControlProxy;
19    type RequestStream = ControlRequestStream;
20    #[cfg(target_os = "fuchsia")]
21    type SynchronousProxy = ControlSynchronousProxy;
22
23    const DEBUG_NAME: &'static str = "(anonymous) Control";
24}
25
26pub trait ControlProxyInterface: Send + Sync {
27    type SetSuspendEnterResultResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
28        + Send;
29    fn r#set_suspend_enter_result(&self, status: i32) -> Self::SetSuspendEnterResultResponseFut;
30    type GetStateResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
31    fn r#get_state(&self) -> Self::GetStateResponseFut;
32}
33#[derive(Debug)]
34#[cfg(target_os = "fuchsia")]
35pub struct ControlSynchronousProxy {
36    client: fidl::client::sync::Client,
37}
38
39#[cfg(target_os = "fuchsia")]
40impl fidl::endpoints::SynchronousProxy for ControlSynchronousProxy {
41    type Proxy = ControlProxy;
42    type Protocol = ControlMarker;
43
44    fn from_channel(inner: fidl::Channel) -> Self {
45        Self::new(inner)
46    }
47
48    fn into_channel(self) -> fidl::Channel {
49        self.client.into_channel()
50    }
51
52    fn as_channel(&self) -> &fidl::Channel {
53        self.client.as_channel()
54    }
55}
56
57#[cfg(target_os = "fuchsia")]
58impl ControlSynchronousProxy {
59    pub fn new(channel: fidl::Channel) -> Self {
60        let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
61        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
62    }
63
64    pub fn into_channel(self) -> fidl::Channel {
65        self.client.into_channel()
66    }
67
68    /// Waits until an event arrives and returns it. It is safe for other
69    /// threads to make concurrent requests while waiting for an event.
70    pub fn wait_for_event(
71        &self,
72        deadline: zx::MonotonicInstant,
73    ) -> Result<ControlEvent, fidl::Error> {
74        ControlEvent::decode(self.client.wait_for_event(deadline)?)
75    }
76
77    /// Set the status that the fixture returns on a return from
78    /// zx_system_suspend_enter.
79    pub fn r#set_suspend_enter_result(
80        &self,
81        mut status: i32,
82        ___deadline: zx::MonotonicInstant,
83    ) -> Result<(), fidl::Error> {
84        let _response = self
85            .client
86            .send_query::<ControlSetSuspendEnterResultRequest, fidl::encoding::EmptyPayload>(
87                (status,),
88                0x138f77664d2dcd4,
89                fidl::encoding::DynamicFlags::empty(),
90                ___deadline,
91            )?;
92        Ok(_response)
93    }
94
95    /// Gets the internal state of the instrumented driver.
96    pub fn r#get_state(&self, ___deadline: zx::MonotonicInstant) -> Result<u32, fidl::Error> {
97        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, State>(
98            (),
99            0x759e8e871c4a33d1,
100            fidl::encoding::DynamicFlags::empty(),
101            ___deadline,
102        )?;
103        Ok(_response.zx_system_suspend_enter_calls_count)
104    }
105}
106
107#[derive(Debug, Clone)]
108pub struct ControlProxy {
109    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
110}
111
112impl fidl::endpoints::Proxy for ControlProxy {
113    type Protocol = ControlMarker;
114
115    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
116        Self::new(inner)
117    }
118
119    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
120        self.client.into_channel().map_err(|client| Self { client })
121    }
122
123    fn as_channel(&self) -> &::fidl::AsyncChannel {
124        self.client.as_channel()
125    }
126}
127
128impl ControlProxy {
129    /// Create a new Proxy for fuchsia.test.syscalls/Control.
130    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
131        let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
132        Self { client: fidl::client::Client::new(channel, protocol_name) }
133    }
134
135    /// Get a Stream of events from the remote end of the protocol.
136    ///
137    /// # Panics
138    ///
139    /// Panics if the event stream was already taken.
140    pub fn take_event_stream(&self) -> ControlEventStream {
141        ControlEventStream { event_receiver: self.client.take_event_receiver() }
142    }
143
144    /// Set the status that the fixture returns on a return from
145    /// zx_system_suspend_enter.
146    pub fn r#set_suspend_enter_result(
147        &self,
148        mut status: i32,
149    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
150        ControlProxyInterface::r#set_suspend_enter_result(self, status)
151    }
152
153    /// Gets the internal state of the instrumented driver.
154    pub fn r#get_state(
155        &self,
156    ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
157        ControlProxyInterface::r#get_state(self)
158    }
159}
160
161impl ControlProxyInterface for ControlProxy {
162    type SetSuspendEnterResultResponseFut =
163        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
164    fn r#set_suspend_enter_result(
165        &self,
166        mut status: i32,
167    ) -> Self::SetSuspendEnterResultResponseFut {
168        fn _decode(
169            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
170        ) -> Result<(), fidl::Error> {
171            let _response = fidl::client::decode_transaction_body::<
172                fidl::encoding::EmptyPayload,
173                fidl::encoding::DefaultFuchsiaResourceDialect,
174                0x138f77664d2dcd4,
175            >(_buf?)?;
176            Ok(_response)
177        }
178        self.client.send_query_and_decode::<ControlSetSuspendEnterResultRequest, ()>(
179            (status,),
180            0x138f77664d2dcd4,
181            fidl::encoding::DynamicFlags::empty(),
182            _decode,
183        )
184    }
185
186    type GetStateResponseFut =
187        fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
188    fn r#get_state(&self) -> Self::GetStateResponseFut {
189        fn _decode(
190            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
191        ) -> Result<u32, fidl::Error> {
192            let _response = fidl::client::decode_transaction_body::<
193                State,
194                fidl::encoding::DefaultFuchsiaResourceDialect,
195                0x759e8e871c4a33d1,
196            >(_buf?)?;
197            Ok(_response.zx_system_suspend_enter_calls_count)
198        }
199        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
200            (),
201            0x759e8e871c4a33d1,
202            fidl::encoding::DynamicFlags::empty(),
203            _decode,
204        )
205    }
206}
207
208pub struct ControlEventStream {
209    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
210}
211
212impl std::marker::Unpin for ControlEventStream {}
213
214impl futures::stream::FusedStream for ControlEventStream {
215    fn is_terminated(&self) -> bool {
216        self.event_receiver.is_terminated()
217    }
218}
219
220impl futures::Stream for ControlEventStream {
221    type Item = Result<ControlEvent, fidl::Error>;
222
223    fn poll_next(
224        mut self: std::pin::Pin<&mut Self>,
225        cx: &mut std::task::Context<'_>,
226    ) -> std::task::Poll<Option<Self::Item>> {
227        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
228            &mut self.event_receiver,
229            cx
230        )?) {
231            Some(buf) => std::task::Poll::Ready(Some(ControlEvent::decode(buf))),
232            None => std::task::Poll::Ready(None),
233        }
234    }
235}
236
237#[derive(Debug)]
238pub enum ControlEvent {}
239
240impl ControlEvent {
241    /// Decodes a message buffer as a [`ControlEvent`].
242    fn decode(
243        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
244    ) -> Result<ControlEvent, fidl::Error> {
245        let (bytes, _handles) = buf.split_mut();
246        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
247        debug_assert_eq!(tx_header.tx_id, 0);
248        match tx_header.ordinal {
249            _ => Err(fidl::Error::UnknownOrdinal {
250                ordinal: tx_header.ordinal,
251                protocol_name: <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
252            }),
253        }
254    }
255}
256
257/// A Stream of incoming requests for fuchsia.test.syscalls/Control.
258pub struct ControlRequestStream {
259    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
260    is_terminated: bool,
261}
262
263impl std::marker::Unpin for ControlRequestStream {}
264
265impl futures::stream::FusedStream for ControlRequestStream {
266    fn is_terminated(&self) -> bool {
267        self.is_terminated
268    }
269}
270
271impl fidl::endpoints::RequestStream for ControlRequestStream {
272    type Protocol = ControlMarker;
273    type ControlHandle = ControlControlHandle;
274
275    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
276        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
277    }
278
279    fn control_handle(&self) -> Self::ControlHandle {
280        ControlControlHandle { inner: self.inner.clone() }
281    }
282
283    fn into_inner(
284        self,
285    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
286    {
287        (self.inner, self.is_terminated)
288    }
289
290    fn from_inner(
291        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
292        is_terminated: bool,
293    ) -> Self {
294        Self { inner, is_terminated }
295    }
296}
297
298impl futures::Stream for ControlRequestStream {
299    type Item = Result<ControlRequest, fidl::Error>;
300
301    fn poll_next(
302        mut self: std::pin::Pin<&mut Self>,
303        cx: &mut std::task::Context<'_>,
304    ) -> std::task::Poll<Option<Self::Item>> {
305        let this = &mut *self;
306        if this.inner.check_shutdown(cx) {
307            this.is_terminated = true;
308            return std::task::Poll::Ready(None);
309        }
310        if this.is_terminated {
311            panic!("polled ControlRequestStream after completion");
312        }
313        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
314            |bytes, handles| {
315                match this.inner.channel().read_etc(cx, bytes, handles) {
316                    std::task::Poll::Ready(Ok(())) => {}
317                    std::task::Poll::Pending => return std::task::Poll::Pending,
318                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
319                        this.is_terminated = true;
320                        return std::task::Poll::Ready(None);
321                    }
322                    std::task::Poll::Ready(Err(e)) => {
323                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
324                            e.into(),
325                        ))))
326                    }
327                }
328
329                // A message has been received from the channel
330                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
331
332                std::task::Poll::Ready(Some(match header.ordinal {
333                    0x138f77664d2dcd4 => {
334                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
335                        let mut req = fidl::new_empty!(
336                            ControlSetSuspendEnterResultRequest,
337                            fidl::encoding::DefaultFuchsiaResourceDialect
338                        );
339                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlSetSuspendEnterResultRequest>(&header, _body_bytes, handles, &mut req)?;
340                        let control_handle = ControlControlHandle { inner: this.inner.clone() };
341                        Ok(ControlRequest::SetSuspendEnterResult {
342                            status: req.status,
343
344                            responder: ControlSetSuspendEnterResultResponder {
345                                control_handle: std::mem::ManuallyDrop::new(control_handle),
346                                tx_id: header.tx_id,
347                            },
348                        })
349                    }
350                    0x759e8e871c4a33d1 => {
351                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
352                        let mut req = fidl::new_empty!(
353                            fidl::encoding::EmptyPayload,
354                            fidl::encoding::DefaultFuchsiaResourceDialect
355                        );
356                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
357                        let control_handle = ControlControlHandle { inner: this.inner.clone() };
358                        Ok(ControlRequest::GetState {
359                            responder: ControlGetStateResponder {
360                                control_handle: std::mem::ManuallyDrop::new(control_handle),
361                                tx_id: header.tx_id,
362                            },
363                        })
364                    }
365                    _ => Err(fidl::Error::UnknownOrdinal {
366                        ordinal: header.ordinal,
367                        protocol_name:
368                            <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
369                    }),
370                }))
371            },
372        )
373    }
374}
375
376#[derive(Debug)]
377pub enum ControlRequest {
378    /// Set the status that the fixture returns on a return from
379    /// zx_system_suspend_enter.
380    SetSuspendEnterResult { status: i32, responder: ControlSetSuspendEnterResultResponder },
381    /// Gets the internal state of the instrumented driver.
382    GetState { responder: ControlGetStateResponder },
383}
384
385impl ControlRequest {
386    #[allow(irrefutable_let_patterns)]
387    pub fn into_set_suspend_enter_result(
388        self,
389    ) -> Option<(i32, ControlSetSuspendEnterResultResponder)> {
390        if let ControlRequest::SetSuspendEnterResult { status, responder } = self {
391            Some((status, responder))
392        } else {
393            None
394        }
395    }
396
397    #[allow(irrefutable_let_patterns)]
398    pub fn into_get_state(self) -> Option<(ControlGetStateResponder)> {
399        if let ControlRequest::GetState { responder } = self {
400            Some((responder))
401        } else {
402            None
403        }
404    }
405
406    /// Name of the method defined in FIDL
407    pub fn method_name(&self) -> &'static str {
408        match *self {
409            ControlRequest::SetSuspendEnterResult { .. } => "set_suspend_enter_result",
410            ControlRequest::GetState { .. } => "get_state",
411        }
412    }
413}
414
415#[derive(Debug, Clone)]
416pub struct ControlControlHandle {
417    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
418}
419
420impl fidl::endpoints::ControlHandle for ControlControlHandle {
421    fn shutdown(&self) {
422        self.inner.shutdown()
423    }
424    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
425        self.inner.shutdown_with_epitaph(status)
426    }
427
428    fn is_closed(&self) -> bool {
429        self.inner.channel().is_closed()
430    }
431    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
432        self.inner.channel().on_closed()
433    }
434
435    #[cfg(target_os = "fuchsia")]
436    fn signal_peer(
437        &self,
438        clear_mask: zx::Signals,
439        set_mask: zx::Signals,
440    ) -> Result<(), zx_status::Status> {
441        use fidl::Peered;
442        self.inner.channel().signal_peer(clear_mask, set_mask)
443    }
444}
445
446impl ControlControlHandle {}
447
448#[must_use = "FIDL methods require a response to be sent"]
449#[derive(Debug)]
450pub struct ControlSetSuspendEnterResultResponder {
451    control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
452    tx_id: u32,
453}
454
455/// Set the the channel to be shutdown (see [`ControlControlHandle::shutdown`])
456/// if the responder is dropped without sending a response, so that the client
457/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
458impl std::ops::Drop for ControlSetSuspendEnterResultResponder {
459    fn drop(&mut self) {
460        self.control_handle.shutdown();
461        // Safety: drops once, never accessed again
462        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
463    }
464}
465
466impl fidl::endpoints::Responder for ControlSetSuspendEnterResultResponder {
467    type ControlHandle = ControlControlHandle;
468
469    fn control_handle(&self) -> &ControlControlHandle {
470        &self.control_handle
471    }
472
473    fn drop_without_shutdown(mut self) {
474        // Safety: drops once, never accessed again due to mem::forget
475        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
476        // Prevent Drop from running (which would shut down the channel)
477        std::mem::forget(self);
478    }
479}
480
481impl ControlSetSuspendEnterResultResponder {
482    /// Sends a response to the FIDL transaction.
483    ///
484    /// Sets the channel to shutdown if an error occurs.
485    pub fn send(self) -> Result<(), fidl::Error> {
486        let _result = self.send_raw();
487        if _result.is_err() {
488            self.control_handle.shutdown();
489        }
490        self.drop_without_shutdown();
491        _result
492    }
493
494    /// Similar to "send" but does not shutdown the channel if an error occurs.
495    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
496        let _result = self.send_raw();
497        self.drop_without_shutdown();
498        _result
499    }
500
501    fn send_raw(&self) -> Result<(), fidl::Error> {
502        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
503            (),
504            self.tx_id,
505            0x138f77664d2dcd4,
506            fidl::encoding::DynamicFlags::empty(),
507        )
508    }
509}
510
511#[must_use = "FIDL methods require a response to be sent"]
512#[derive(Debug)]
513pub struct ControlGetStateResponder {
514    control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
515    tx_id: u32,
516}
517
518/// Set the the channel to be shutdown (see [`ControlControlHandle::shutdown`])
519/// if the responder is dropped without sending a response, so that the client
520/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
521impl std::ops::Drop for ControlGetStateResponder {
522    fn drop(&mut self) {
523        self.control_handle.shutdown();
524        // Safety: drops once, never accessed again
525        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
526    }
527}
528
529impl fidl::endpoints::Responder for ControlGetStateResponder {
530    type ControlHandle = ControlControlHandle;
531
532    fn control_handle(&self) -> &ControlControlHandle {
533        &self.control_handle
534    }
535
536    fn drop_without_shutdown(mut self) {
537        // Safety: drops once, never accessed again due to mem::forget
538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
539        // Prevent Drop from running (which would shut down the channel)
540        std::mem::forget(self);
541    }
542}
543
544impl ControlGetStateResponder {
545    /// Sends a response to the FIDL transaction.
546    ///
547    /// Sets the channel to shutdown if an error occurs.
548    pub fn send(self, mut zx_system_suspend_enter_calls_count: u32) -> Result<(), fidl::Error> {
549        let _result = self.send_raw(zx_system_suspend_enter_calls_count);
550        if _result.is_err() {
551            self.control_handle.shutdown();
552        }
553        self.drop_without_shutdown();
554        _result
555    }
556
557    /// Similar to "send" but does not shutdown the channel if an error occurs.
558    pub fn send_no_shutdown_on_err(
559        self,
560        mut zx_system_suspend_enter_calls_count: u32,
561    ) -> Result<(), fidl::Error> {
562        let _result = self.send_raw(zx_system_suspend_enter_calls_count);
563        self.drop_without_shutdown();
564        _result
565    }
566
567    fn send_raw(&self, mut zx_system_suspend_enter_calls_count: u32) -> Result<(), fidl::Error> {
568        self.control_handle.inner.send::<State>(
569            (zx_system_suspend_enter_calls_count,),
570            self.tx_id,
571            0x759e8e871c4a33d1,
572            fidl::encoding::DynamicFlags::empty(),
573        )
574    }
575}
576
577#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
578pub struct ControlServiceMarker;
579
580#[cfg(target_os = "fuchsia")]
581impl fidl::endpoints::ServiceMarker for ControlServiceMarker {
582    type Proxy = ControlServiceProxy;
583    type Request = ControlServiceRequest;
584    const SERVICE_NAME: &'static str = "fuchsia.test.syscalls.ControlService";
585}
586
587/// A request for one of the member protocols of ControlService.
588///
589/// Serves the Control protocol as a service. Only needed due to
590/// driver test realm implementation detail.
591#[cfg(target_os = "fuchsia")]
592pub enum ControlServiceRequest {
593    Control(ControlRequestStream),
594}
595
596#[cfg(target_os = "fuchsia")]
597impl fidl::endpoints::ServiceRequest for ControlServiceRequest {
598    type Service = ControlServiceMarker;
599
600    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
601        match name {
602            "control" => Self::Control(
603                <ControlRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
604            ),
605            _ => panic!("no such member protocol name for service ControlService"),
606        }
607    }
608
609    fn member_names() -> &'static [&'static str] {
610        &["control"]
611    }
612}
613/// Serves the Control protocol as a service. Only needed due to
614/// driver test realm implementation detail.
615#[cfg(target_os = "fuchsia")]
616pub struct ControlServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
617
618#[cfg(target_os = "fuchsia")]
619impl fidl::endpoints::ServiceProxy for ControlServiceProxy {
620    type Service = ControlServiceMarker;
621
622    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
623        Self(opener)
624    }
625}
626
627#[cfg(target_os = "fuchsia")]
628impl ControlServiceProxy {
629    pub fn connect_to_control(&self) -> Result<ControlProxy, fidl::Error> {
630        let (proxy, server_end) = fidl::endpoints::create_proxy::<ControlMarker>();
631        self.connect_channel_to_control(server_end)?;
632        Ok(proxy)
633    }
634
635    /// Like `connect_to_control`, but returns a sync proxy.
636    /// See [`Self::connect_to_control`] for more details.
637    pub fn connect_to_control_sync(&self) -> Result<ControlSynchronousProxy, fidl::Error> {
638        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ControlMarker>();
639        self.connect_channel_to_control(server_end)?;
640        Ok(proxy)
641    }
642
643    /// Like `connect_to_control`, but accepts a server end.
644    /// See [`Self::connect_to_control`] for more details.
645    pub fn connect_channel_to_control(
646        &self,
647        server_end: fidl::endpoints::ServerEnd<ControlMarker>,
648    ) -> Result<(), fidl::Error> {
649        self.0.open_member("control", server_end.into_channel())
650    }
651
652    pub fn instance_name(&self) -> &str {
653        self.0.instance_name()
654    }
655}
656
657mod internal {
658    use super::*;
659}