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