Skip to main content

fidl_fuchsia_test_debug/
fidl_fuchsia_test_debug.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_debug_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DebugDataProcessorAddDebugVmosRequest {
16    pub vmos: Vec<DebugVmo>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20    for DebugDataProcessorAddDebugVmosRequest
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct DebugDataProcessorSetDirectoryRequest {
26    pub directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30    for DebugDataProcessorSetDirectoryRequest
31{
32}
33
34/// Container for a single VMO that is ready to be processed.
35#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub struct DebugVmo {
37    pub vmo: fidl::Vmo,
38    pub data_sink: String,
39    pub test_url: String,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DebugVmo {}
43
44#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
45pub struct DebugDataProcessorMarker;
46
47impl fidl::endpoints::ProtocolMarker for DebugDataProcessorMarker {
48    type Proxy = DebugDataProcessorProxy;
49    type RequestStream = DebugDataProcessorRequestStream;
50    #[cfg(target_os = "fuchsia")]
51    type SynchronousProxy = DebugDataProcessorSynchronousProxy;
52
53    const DEBUG_NAME: &'static str = "fuchsia.test.debug.DebugDataProcessor";
54}
55impl fidl::endpoints::DiscoverableProtocolMarker for DebugDataProcessorMarker {}
56
57pub trait DebugDataProcessorProxyInterface: Send + Sync {
58    fn r#set_directory(
59        &self,
60        directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
61    ) -> Result<(), fidl::Error>;
62    type AddDebugVmosResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
63    fn r#add_debug_vmos(&self, vmos: Vec<DebugVmo>) -> Self::AddDebugVmosResponseFut;
64    type FinishResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
65    fn r#finish(&self) -> Self::FinishResponseFut;
66}
67#[derive(Debug)]
68#[cfg(target_os = "fuchsia")]
69pub struct DebugDataProcessorSynchronousProxy {
70    client: fidl::client::sync::Client,
71}
72
73#[cfg(target_os = "fuchsia")]
74impl fidl::endpoints::SynchronousProxy for DebugDataProcessorSynchronousProxy {
75    type Proxy = DebugDataProcessorProxy;
76    type Protocol = DebugDataProcessorMarker;
77
78    fn from_channel(inner: fidl::Channel) -> Self {
79        Self::new(inner)
80    }
81
82    fn into_channel(self) -> fidl::Channel {
83        self.client.into_channel()
84    }
85
86    fn as_channel(&self) -> &fidl::Channel {
87        self.client.as_channel()
88    }
89}
90
91#[cfg(target_os = "fuchsia")]
92impl DebugDataProcessorSynchronousProxy {
93    pub fn new(channel: fidl::Channel) -> Self {
94        Self { client: fidl::client::sync::Client::new(channel) }
95    }
96
97    pub fn into_channel(self) -> fidl::Channel {
98        self.client.into_channel()
99    }
100
101    /// Waits until an event arrives and returns it. It is safe for other
102    /// threads to make concurrent requests while waiting for an event.
103    pub fn wait_for_event(
104        &self,
105        deadline: zx::MonotonicInstant,
106    ) -> Result<DebugDataProcessorEvent, fidl::Error> {
107        DebugDataProcessorEvent::decode(
108            self.client.wait_for_event::<DebugDataProcessorMarker>(deadline)?,
109        )
110    }
111
112    /// Set the directory to store results in. This must be called first.
113    /// Note that we currently provide a directory as coverage tools pull profile
114    /// information off the device using a specific, topology dependent location
115    /// in the /tmp filesystem. Once these tools are updated, we can update this
116    /// protocol free of this constraint.
117    pub fn r#set_directory(
118        &self,
119        mut directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
120    ) -> Result<(), fidl::Error> {
121        self.client.send::<DebugDataProcessorSetDirectoryRequest>(
122            (directory,),
123            0x3010ac21cf0b4c79,
124            fidl::encoding::DynamicFlags::empty(),
125        )
126    }
127
128    /// Add more VMOs to process. The VMOs are expected to be ready to process.
129    pub fn r#add_debug_vmos(
130        &self,
131        mut vmos: Vec<DebugVmo>,
132        ___deadline: zx::MonotonicInstant,
133    ) -> Result<(), fidl::Error> {
134        let _response = self.client.send_query::<
135            DebugDataProcessorAddDebugVmosRequest,
136            fidl::encoding::EmptyPayload,
137            DebugDataProcessorMarker,
138        >(
139            (vmos.as_mut(),),
140            0x48b3d3070f48199b,
141            fidl::encoding::DynamicFlags::empty(),
142            ___deadline,
143        )?;
144        Ok(_response)
145    }
146
147    /// Indicates all VMOs have been sent. This method returns when all processing
148    /// is complete, after which the client may observe the results in the directory
149    /// passed via NewProcessor.
150    pub fn r#finish(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
151        let _response = self.client.send_query::<
152            fidl::encoding::EmptyPayload,
153            fidl::encoding::EmptyPayload,
154            DebugDataProcessorMarker,
155        >(
156            (),
157            0x2bc6016f91bdf3a7,
158            fidl::encoding::DynamicFlags::empty(),
159            ___deadline,
160        )?;
161        Ok(_response)
162    }
163}
164
165#[cfg(target_os = "fuchsia")]
166impl From<DebugDataProcessorSynchronousProxy> for zx::NullableHandle {
167    fn from(value: DebugDataProcessorSynchronousProxy) -> Self {
168        value.into_channel().into()
169    }
170}
171
172#[cfg(target_os = "fuchsia")]
173impl From<fidl::Channel> for DebugDataProcessorSynchronousProxy {
174    fn from(value: fidl::Channel) -> Self {
175        Self::new(value)
176    }
177}
178
179#[cfg(target_os = "fuchsia")]
180impl fidl::endpoints::FromClient for DebugDataProcessorSynchronousProxy {
181    type Protocol = DebugDataProcessorMarker;
182
183    fn from_client(value: fidl::endpoints::ClientEnd<DebugDataProcessorMarker>) -> Self {
184        Self::new(value.into_channel())
185    }
186}
187
188#[derive(Debug, Clone)]
189pub struct DebugDataProcessorProxy {
190    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
191}
192
193impl fidl::endpoints::Proxy for DebugDataProcessorProxy {
194    type Protocol = DebugDataProcessorMarker;
195
196    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
197        Self::new(inner)
198    }
199
200    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
201        self.client.into_channel().map_err(|client| Self { client })
202    }
203
204    fn as_channel(&self) -> &::fidl::AsyncChannel {
205        self.client.as_channel()
206    }
207}
208
209impl DebugDataProcessorProxy {
210    /// Create a new Proxy for fuchsia.test.debug/DebugDataProcessor.
211    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
212        let protocol_name =
213            <DebugDataProcessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
214        Self { client: fidl::client::Client::new(channel, protocol_name) }
215    }
216
217    /// Get a Stream of events from the remote end of the protocol.
218    ///
219    /// # Panics
220    ///
221    /// Panics if the event stream was already taken.
222    pub fn take_event_stream(&self) -> DebugDataProcessorEventStream {
223        DebugDataProcessorEventStream { event_receiver: self.client.take_event_receiver() }
224    }
225
226    /// Set the directory to store results in. This must be called first.
227    /// Note that we currently provide a directory as coverage tools pull profile
228    /// information off the device using a specific, topology dependent location
229    /// in the /tmp filesystem. Once these tools are updated, we can update this
230    /// protocol free of this constraint.
231    pub fn r#set_directory(
232        &self,
233        mut directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
234    ) -> Result<(), fidl::Error> {
235        DebugDataProcessorProxyInterface::r#set_directory(self, directory)
236    }
237
238    /// Add more VMOs to process. The VMOs are expected to be ready to process.
239    pub fn r#add_debug_vmos(
240        &self,
241        mut vmos: Vec<DebugVmo>,
242    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
243        DebugDataProcessorProxyInterface::r#add_debug_vmos(self, vmos)
244    }
245
246    /// Indicates all VMOs have been sent. This method returns when all processing
247    /// is complete, after which the client may observe the results in the directory
248    /// passed via NewProcessor.
249    pub fn r#finish(
250        &self,
251    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
252        DebugDataProcessorProxyInterface::r#finish(self)
253    }
254}
255
256impl DebugDataProcessorProxyInterface for DebugDataProcessorProxy {
257    fn r#set_directory(
258        &self,
259        mut directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
260    ) -> Result<(), fidl::Error> {
261        self.client.send::<DebugDataProcessorSetDirectoryRequest>(
262            (directory,),
263            0x3010ac21cf0b4c79,
264            fidl::encoding::DynamicFlags::empty(),
265        )
266    }
267
268    type AddDebugVmosResponseFut =
269        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
270    fn r#add_debug_vmos(&self, mut vmos: Vec<DebugVmo>) -> Self::AddDebugVmosResponseFut {
271        fn _decode(
272            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
273        ) -> Result<(), fidl::Error> {
274            let _response = fidl::client::decode_transaction_body::<
275                fidl::encoding::EmptyPayload,
276                fidl::encoding::DefaultFuchsiaResourceDialect,
277                0x48b3d3070f48199b,
278            >(_buf?)?;
279            Ok(_response)
280        }
281        self.client.send_query_and_decode::<DebugDataProcessorAddDebugVmosRequest, ()>(
282            (vmos.as_mut(),),
283            0x48b3d3070f48199b,
284            fidl::encoding::DynamicFlags::empty(),
285            _decode,
286        )
287    }
288
289    type FinishResponseFut =
290        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
291    fn r#finish(&self) -> Self::FinishResponseFut {
292        fn _decode(
293            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
294        ) -> Result<(), fidl::Error> {
295            let _response = fidl::client::decode_transaction_body::<
296                fidl::encoding::EmptyPayload,
297                fidl::encoding::DefaultFuchsiaResourceDialect,
298                0x2bc6016f91bdf3a7,
299            >(_buf?)?;
300            Ok(_response)
301        }
302        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
303            (),
304            0x2bc6016f91bdf3a7,
305            fidl::encoding::DynamicFlags::empty(),
306            _decode,
307        )
308    }
309}
310
311pub struct DebugDataProcessorEventStream {
312    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
313}
314
315impl std::marker::Unpin for DebugDataProcessorEventStream {}
316
317impl futures::stream::FusedStream for DebugDataProcessorEventStream {
318    fn is_terminated(&self) -> bool {
319        self.event_receiver.is_terminated()
320    }
321}
322
323impl futures::Stream for DebugDataProcessorEventStream {
324    type Item = Result<DebugDataProcessorEvent, fidl::Error>;
325
326    fn poll_next(
327        mut self: std::pin::Pin<&mut Self>,
328        cx: &mut std::task::Context<'_>,
329    ) -> std::task::Poll<Option<Self::Item>> {
330        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
331            &mut self.event_receiver,
332            cx
333        )?) {
334            Some(buf) => std::task::Poll::Ready(Some(DebugDataProcessorEvent::decode(buf))),
335            None => std::task::Poll::Ready(None),
336        }
337    }
338}
339
340#[derive(Debug)]
341pub enum DebugDataProcessorEvent {}
342
343impl DebugDataProcessorEvent {
344    /// Decodes a message buffer as a [`DebugDataProcessorEvent`].
345    fn decode(
346        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
347    ) -> Result<DebugDataProcessorEvent, fidl::Error> {
348        let (bytes, _handles) = buf.split_mut();
349        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
350        debug_assert_eq!(tx_header.tx_id, 0);
351        match tx_header.ordinal {
352            _ => Err(fidl::Error::UnknownOrdinal {
353                ordinal: tx_header.ordinal,
354                protocol_name:
355                    <DebugDataProcessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
356            }),
357        }
358    }
359}
360
361/// A Stream of incoming requests for fuchsia.test.debug/DebugDataProcessor.
362pub struct DebugDataProcessorRequestStream {
363    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
364    is_terminated: bool,
365}
366
367impl std::marker::Unpin for DebugDataProcessorRequestStream {}
368
369impl futures::stream::FusedStream for DebugDataProcessorRequestStream {
370    fn is_terminated(&self) -> bool {
371        self.is_terminated
372    }
373}
374
375impl fidl::endpoints::RequestStream for DebugDataProcessorRequestStream {
376    type Protocol = DebugDataProcessorMarker;
377    type ControlHandle = DebugDataProcessorControlHandle;
378
379    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
380        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
381    }
382
383    fn control_handle(&self) -> Self::ControlHandle {
384        DebugDataProcessorControlHandle { inner: self.inner.clone() }
385    }
386
387    fn into_inner(
388        self,
389    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
390    {
391        (self.inner, self.is_terminated)
392    }
393
394    fn from_inner(
395        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
396        is_terminated: bool,
397    ) -> Self {
398        Self { inner, is_terminated }
399    }
400}
401
402impl futures::Stream for DebugDataProcessorRequestStream {
403    type Item = Result<DebugDataProcessorRequest, fidl::Error>;
404
405    fn poll_next(
406        mut self: std::pin::Pin<&mut Self>,
407        cx: &mut std::task::Context<'_>,
408    ) -> std::task::Poll<Option<Self::Item>> {
409        let this = &mut *self;
410        if this.inner.check_shutdown(cx) {
411            this.is_terminated = true;
412            return std::task::Poll::Ready(None);
413        }
414        if this.is_terminated {
415            panic!("polled DebugDataProcessorRequestStream after completion");
416        }
417        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
418            |bytes, handles| {
419                match this.inner.channel().read_etc(cx, bytes, handles) {
420                    std::task::Poll::Ready(Ok(())) => {}
421                    std::task::Poll::Pending => return std::task::Poll::Pending,
422                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
423                        this.is_terminated = true;
424                        return std::task::Poll::Ready(None);
425                    }
426                    std::task::Poll::Ready(Err(e)) => {
427                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
428                            e.into(),
429                        ))));
430                    }
431                }
432
433                // A message has been received from the channel
434                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
435
436                std::task::Poll::Ready(Some(match header.ordinal {
437                0x3010ac21cf0b4c79 => {
438                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
439                    let mut req = fidl::new_empty!(DebugDataProcessorSetDirectoryRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
440                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugDataProcessorSetDirectoryRequest>(&header, _body_bytes, handles, &mut req)?;
441                    let control_handle = DebugDataProcessorControlHandle {
442                        inner: this.inner.clone(),
443                    };
444                    Ok(DebugDataProcessorRequest::SetDirectory {directory: req.directory,
445
446                        control_handle,
447                    })
448                }
449                0x48b3d3070f48199b => {
450                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
451                    let mut req = fidl::new_empty!(DebugDataProcessorAddDebugVmosRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
452                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugDataProcessorAddDebugVmosRequest>(&header, _body_bytes, handles, &mut req)?;
453                    let control_handle = DebugDataProcessorControlHandle {
454                        inner: this.inner.clone(),
455                    };
456                    Ok(DebugDataProcessorRequest::AddDebugVmos {vmos: req.vmos,
457
458                        responder: DebugDataProcessorAddDebugVmosResponder {
459                            control_handle: std::mem::ManuallyDrop::new(control_handle),
460                            tx_id: header.tx_id,
461                        },
462                    })
463                }
464                0x2bc6016f91bdf3a7 => {
465                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
466                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
467                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
468                    let control_handle = DebugDataProcessorControlHandle {
469                        inner: this.inner.clone(),
470                    };
471                    Ok(DebugDataProcessorRequest::Finish {
472                        responder: DebugDataProcessorFinishResponder {
473                            control_handle: std::mem::ManuallyDrop::new(control_handle),
474                            tx_id: header.tx_id,
475                        },
476                    })
477                }
478                _ => Err(fidl::Error::UnknownOrdinal {
479                    ordinal: header.ordinal,
480                    protocol_name: <DebugDataProcessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
481                }),
482            }))
483            },
484        )
485    }
486}
487
488/// A test-manager internal protocol used for communicating between the debug data
489/// component, which implements `fuchsia.debugdata.Publisher`, and the component that
490/// actually processes the VMOs passed to `fuchsia.debugdata.Publisher`.
491/// In the future, this protocol may be moved to the SDK, to enable "pluggable" VMO
492/// processing, or removed entirely if VMO processing is moved to the host.
493#[derive(Debug)]
494pub enum DebugDataProcessorRequest {
495    /// Set the directory to store results in. This must be called first.
496    /// Note that we currently provide a directory as coverage tools pull profile
497    /// information off the device using a specific, topology dependent location
498    /// in the /tmp filesystem. Once these tools are updated, we can update this
499    /// protocol free of this constraint.
500    SetDirectory {
501        directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
502        control_handle: DebugDataProcessorControlHandle,
503    },
504    /// Add more VMOs to process. The VMOs are expected to be ready to process.
505    AddDebugVmos { vmos: Vec<DebugVmo>, responder: DebugDataProcessorAddDebugVmosResponder },
506    /// Indicates all VMOs have been sent. This method returns when all processing
507    /// is complete, after which the client may observe the results in the directory
508    /// passed via NewProcessor.
509    Finish { responder: DebugDataProcessorFinishResponder },
510}
511
512impl DebugDataProcessorRequest {
513    #[allow(irrefutable_let_patterns)]
514    pub fn into_set_directory(
515        self,
516    ) -> Option<(
517        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
518        DebugDataProcessorControlHandle,
519    )> {
520        if let DebugDataProcessorRequest::SetDirectory { directory, control_handle } = self {
521            Some((directory, control_handle))
522        } else {
523            None
524        }
525    }
526
527    #[allow(irrefutable_let_patterns)]
528    pub fn into_add_debug_vmos(
529        self,
530    ) -> Option<(Vec<DebugVmo>, DebugDataProcessorAddDebugVmosResponder)> {
531        if let DebugDataProcessorRequest::AddDebugVmos { vmos, responder } = self {
532            Some((vmos, responder))
533        } else {
534            None
535        }
536    }
537
538    #[allow(irrefutable_let_patterns)]
539    pub fn into_finish(self) -> Option<(DebugDataProcessorFinishResponder)> {
540        if let DebugDataProcessorRequest::Finish { responder } = self {
541            Some((responder))
542        } else {
543            None
544        }
545    }
546
547    /// Name of the method defined in FIDL
548    pub fn method_name(&self) -> &'static str {
549        match *self {
550            DebugDataProcessorRequest::SetDirectory { .. } => "set_directory",
551            DebugDataProcessorRequest::AddDebugVmos { .. } => "add_debug_vmos",
552            DebugDataProcessorRequest::Finish { .. } => "finish",
553        }
554    }
555}
556
557#[derive(Debug, Clone)]
558pub struct DebugDataProcessorControlHandle {
559    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
560}
561
562impl DebugDataProcessorControlHandle {
563    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
564        self.inner.shutdown_with_epitaph(status.into())
565    }
566}
567
568impl fidl::endpoints::ControlHandle for DebugDataProcessorControlHandle {
569    fn shutdown(&self) {
570        self.inner.shutdown()
571    }
572
573    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
574        self.inner.shutdown_with_epitaph(status)
575    }
576
577    fn is_closed(&self) -> bool {
578        self.inner.channel().is_closed()
579    }
580    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
581        self.inner.channel().on_closed()
582    }
583
584    #[cfg(target_os = "fuchsia")]
585    fn signal_peer(
586        &self,
587        clear_mask: zx::Signals,
588        set_mask: zx::Signals,
589    ) -> Result<(), zx_status::Status> {
590        use fidl::Peered;
591        self.inner.channel().signal_peer(clear_mask, set_mask)
592    }
593}
594
595impl DebugDataProcessorControlHandle {}
596
597#[must_use = "FIDL methods require a response to be sent"]
598#[derive(Debug)]
599pub struct DebugDataProcessorAddDebugVmosResponder {
600    control_handle: std::mem::ManuallyDrop<DebugDataProcessorControlHandle>,
601    tx_id: u32,
602}
603
604/// Set the the channel to be shutdown (see [`DebugDataProcessorControlHandle::shutdown`])
605/// if the responder is dropped without sending a response, so that the client
606/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
607impl std::ops::Drop for DebugDataProcessorAddDebugVmosResponder {
608    fn drop(&mut self) {
609        self.control_handle.shutdown();
610        // Safety: drops once, never accessed again
611        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
612    }
613}
614
615impl fidl::endpoints::Responder for DebugDataProcessorAddDebugVmosResponder {
616    type ControlHandle = DebugDataProcessorControlHandle;
617
618    fn control_handle(&self) -> &DebugDataProcessorControlHandle {
619        &self.control_handle
620    }
621
622    fn drop_without_shutdown(mut self) {
623        // Safety: drops once, never accessed again due to mem::forget
624        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
625        // Prevent Drop from running (which would shut down the channel)
626        std::mem::forget(self);
627    }
628}
629
630impl DebugDataProcessorAddDebugVmosResponder {
631    /// Sends a response to the FIDL transaction.
632    ///
633    /// Sets the channel to shutdown if an error occurs.
634    pub fn send(self) -> Result<(), fidl::Error> {
635        let _result = self.send_raw();
636        if _result.is_err() {
637            self.control_handle.shutdown();
638        }
639        self.drop_without_shutdown();
640        _result
641    }
642
643    /// Similar to "send" but does not shutdown the channel if an error occurs.
644    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
645        let _result = self.send_raw();
646        self.drop_without_shutdown();
647        _result
648    }
649
650    fn send_raw(&self) -> Result<(), fidl::Error> {
651        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
652            (),
653            self.tx_id,
654            0x48b3d3070f48199b,
655            fidl::encoding::DynamicFlags::empty(),
656        )
657    }
658}
659
660#[must_use = "FIDL methods require a response to be sent"]
661#[derive(Debug)]
662pub struct DebugDataProcessorFinishResponder {
663    control_handle: std::mem::ManuallyDrop<DebugDataProcessorControlHandle>,
664    tx_id: u32,
665}
666
667/// Set the the channel to be shutdown (see [`DebugDataProcessorControlHandle::shutdown`])
668/// if the responder is dropped without sending a response, so that the client
669/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
670impl std::ops::Drop for DebugDataProcessorFinishResponder {
671    fn drop(&mut self) {
672        self.control_handle.shutdown();
673        // Safety: drops once, never accessed again
674        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
675    }
676}
677
678impl fidl::endpoints::Responder for DebugDataProcessorFinishResponder {
679    type ControlHandle = DebugDataProcessorControlHandle;
680
681    fn control_handle(&self) -> &DebugDataProcessorControlHandle {
682        &self.control_handle
683    }
684
685    fn drop_without_shutdown(mut self) {
686        // Safety: drops once, never accessed again due to mem::forget
687        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
688        // Prevent Drop from running (which would shut down the channel)
689        std::mem::forget(self);
690    }
691}
692
693impl DebugDataProcessorFinishResponder {
694    /// Sends a response to the FIDL transaction.
695    ///
696    /// Sets the channel to shutdown if an error occurs.
697    pub fn send(self) -> Result<(), fidl::Error> {
698        let _result = self.send_raw();
699        if _result.is_err() {
700            self.control_handle.shutdown();
701        }
702        self.drop_without_shutdown();
703        _result
704    }
705
706    /// Similar to "send" but does not shutdown the channel if an error occurs.
707    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
708        let _result = self.send_raw();
709        self.drop_without_shutdown();
710        _result
711    }
712
713    fn send_raw(&self) -> Result<(), fidl::Error> {
714        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
715            (),
716            self.tx_id,
717            0x2bc6016f91bdf3a7,
718            fidl::encoding::DynamicFlags::empty(),
719        )
720    }
721}
722
723mod internal {
724    use super::*;
725
726    impl fidl::encoding::ResourceTypeMarker for DebugDataProcessorAddDebugVmosRequest {
727        type Borrowed<'a> = &'a mut Self;
728        fn take_or_borrow<'a>(
729            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
730        ) -> Self::Borrowed<'a> {
731            value
732        }
733    }
734
735    unsafe impl fidl::encoding::TypeMarker for DebugDataProcessorAddDebugVmosRequest {
736        type Owned = Self;
737
738        #[inline(always)]
739        fn inline_align(_context: fidl::encoding::Context) -> usize {
740            8
741        }
742
743        #[inline(always)]
744        fn inline_size(_context: fidl::encoding::Context) -> usize {
745            16
746        }
747    }
748
749    unsafe impl
750        fidl::encoding::Encode<
751            DebugDataProcessorAddDebugVmosRequest,
752            fidl::encoding::DefaultFuchsiaResourceDialect,
753        > for &mut DebugDataProcessorAddDebugVmosRequest
754    {
755        #[inline]
756        unsafe fn encode(
757            self,
758            encoder: &mut fidl::encoding::Encoder<
759                '_,
760                fidl::encoding::DefaultFuchsiaResourceDialect,
761            >,
762            offset: usize,
763            _depth: fidl::encoding::Depth,
764        ) -> fidl::Result<()> {
765            encoder.debug_check_bounds::<DebugDataProcessorAddDebugVmosRequest>(offset);
766            // Delegate to tuple encoding.
767            fidl::encoding::Encode::<DebugDataProcessorAddDebugVmosRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
768                (
769                    <fidl::encoding::UnboundedVector<DebugVmo> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.vmos),
770                ),
771                encoder, offset, _depth
772            )
773        }
774    }
775    unsafe impl<
776        T0: fidl::encoding::Encode<
777                fidl::encoding::UnboundedVector<DebugVmo>,
778                fidl::encoding::DefaultFuchsiaResourceDialect,
779            >,
780    >
781        fidl::encoding::Encode<
782            DebugDataProcessorAddDebugVmosRequest,
783            fidl::encoding::DefaultFuchsiaResourceDialect,
784        > for (T0,)
785    {
786        #[inline]
787        unsafe fn encode(
788            self,
789            encoder: &mut fidl::encoding::Encoder<
790                '_,
791                fidl::encoding::DefaultFuchsiaResourceDialect,
792            >,
793            offset: usize,
794            depth: fidl::encoding::Depth,
795        ) -> fidl::Result<()> {
796            encoder.debug_check_bounds::<DebugDataProcessorAddDebugVmosRequest>(offset);
797            // Zero out padding regions. There's no need to apply masks
798            // because the unmasked parts will be overwritten by fields.
799            // Write the fields.
800            self.0.encode(encoder, offset + 0, depth)?;
801            Ok(())
802        }
803    }
804
805    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
806        for DebugDataProcessorAddDebugVmosRequest
807    {
808        #[inline(always)]
809        fn new_empty() -> Self {
810            Self {
811                vmos: fidl::new_empty!(
812                    fidl::encoding::UnboundedVector<DebugVmo>,
813                    fidl::encoding::DefaultFuchsiaResourceDialect
814                ),
815            }
816        }
817
818        #[inline]
819        unsafe fn decode(
820            &mut self,
821            decoder: &mut fidl::encoding::Decoder<
822                '_,
823                fidl::encoding::DefaultFuchsiaResourceDialect,
824            >,
825            offset: usize,
826            _depth: fidl::encoding::Depth,
827        ) -> fidl::Result<()> {
828            decoder.debug_check_bounds::<Self>(offset);
829            // Verify that padding bytes are zero.
830            fidl::decode!(
831                fidl::encoding::UnboundedVector<DebugVmo>,
832                fidl::encoding::DefaultFuchsiaResourceDialect,
833                &mut self.vmos,
834                decoder,
835                offset + 0,
836                _depth
837            )?;
838            Ok(())
839        }
840    }
841
842    impl fidl::encoding::ResourceTypeMarker for DebugDataProcessorSetDirectoryRequest {
843        type Borrowed<'a> = &'a mut Self;
844        fn take_or_borrow<'a>(
845            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
846        ) -> Self::Borrowed<'a> {
847            value
848        }
849    }
850
851    unsafe impl fidl::encoding::TypeMarker for DebugDataProcessorSetDirectoryRequest {
852        type Owned = Self;
853
854        #[inline(always)]
855        fn inline_align(_context: fidl::encoding::Context) -> usize {
856            4
857        }
858
859        #[inline(always)]
860        fn inline_size(_context: fidl::encoding::Context) -> usize {
861            4
862        }
863    }
864
865    unsafe impl
866        fidl::encoding::Encode<
867            DebugDataProcessorSetDirectoryRequest,
868            fidl::encoding::DefaultFuchsiaResourceDialect,
869        > for &mut DebugDataProcessorSetDirectoryRequest
870    {
871        #[inline]
872        unsafe fn encode(
873            self,
874            encoder: &mut fidl::encoding::Encoder<
875                '_,
876                fidl::encoding::DefaultFuchsiaResourceDialect,
877            >,
878            offset: usize,
879            _depth: fidl::encoding::Depth,
880        ) -> fidl::Result<()> {
881            encoder.debug_check_bounds::<DebugDataProcessorSetDirectoryRequest>(offset);
882            // Delegate to tuple encoding.
883            fidl::encoding::Encode::<
884                DebugDataProcessorSetDirectoryRequest,
885                fidl::encoding::DefaultFuchsiaResourceDialect,
886            >::encode(
887                (<fidl::encoding::Endpoint<
888                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
889                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
890                    &mut self.directory
891                ),),
892                encoder,
893                offset,
894                _depth,
895            )
896        }
897    }
898    unsafe impl<
899        T0: fidl::encoding::Encode<
900                fidl::encoding::Endpoint<
901                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
902                >,
903                fidl::encoding::DefaultFuchsiaResourceDialect,
904            >,
905    >
906        fidl::encoding::Encode<
907            DebugDataProcessorSetDirectoryRequest,
908            fidl::encoding::DefaultFuchsiaResourceDialect,
909        > for (T0,)
910    {
911        #[inline]
912        unsafe fn encode(
913            self,
914            encoder: &mut fidl::encoding::Encoder<
915                '_,
916                fidl::encoding::DefaultFuchsiaResourceDialect,
917            >,
918            offset: usize,
919            depth: fidl::encoding::Depth,
920        ) -> fidl::Result<()> {
921            encoder.debug_check_bounds::<DebugDataProcessorSetDirectoryRequest>(offset);
922            // Zero out padding regions. There's no need to apply masks
923            // because the unmasked parts will be overwritten by fields.
924            // Write the fields.
925            self.0.encode(encoder, offset + 0, depth)?;
926            Ok(())
927        }
928    }
929
930    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
931        for DebugDataProcessorSetDirectoryRequest
932    {
933        #[inline(always)]
934        fn new_empty() -> Self {
935            Self {
936                directory: fidl::new_empty!(
937                    fidl::encoding::Endpoint<
938                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
939                    >,
940                    fidl::encoding::DefaultFuchsiaResourceDialect
941                ),
942            }
943        }
944
945        #[inline]
946        unsafe fn decode(
947            &mut self,
948            decoder: &mut fidl::encoding::Decoder<
949                '_,
950                fidl::encoding::DefaultFuchsiaResourceDialect,
951            >,
952            offset: usize,
953            _depth: fidl::encoding::Depth,
954        ) -> fidl::Result<()> {
955            decoder.debug_check_bounds::<Self>(offset);
956            // Verify that padding bytes are zero.
957            fidl::decode!(
958                fidl::encoding::Endpoint<
959                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
960                >,
961                fidl::encoding::DefaultFuchsiaResourceDialect,
962                &mut self.directory,
963                decoder,
964                offset + 0,
965                _depth
966            )?;
967            Ok(())
968        }
969    }
970
971    impl fidl::encoding::ResourceTypeMarker for DebugVmo {
972        type Borrowed<'a> = &'a mut Self;
973        fn take_or_borrow<'a>(
974            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
975        ) -> Self::Borrowed<'a> {
976            value
977        }
978    }
979
980    unsafe impl fidl::encoding::TypeMarker for DebugVmo {
981        type Owned = Self;
982
983        #[inline(always)]
984        fn inline_align(_context: fidl::encoding::Context) -> usize {
985            8
986        }
987
988        #[inline(always)]
989        fn inline_size(_context: fidl::encoding::Context) -> usize {
990            40
991        }
992    }
993
994    unsafe impl fidl::encoding::Encode<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
995        for &mut DebugVmo
996    {
997        #[inline]
998        unsafe fn encode(
999            self,
1000            encoder: &mut fidl::encoding::Encoder<
1001                '_,
1002                fidl::encoding::DefaultFuchsiaResourceDialect,
1003            >,
1004            offset: usize,
1005            _depth: fidl::encoding::Depth,
1006        ) -> fidl::Result<()> {
1007            encoder.debug_check_bounds::<DebugVmo>(offset);
1008            // Delegate to tuple encoding.
1009            fidl::encoding::Encode::<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1010                (
1011                    <fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.vmo),
1012                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.data_sink),
1013                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
1014                ),
1015                encoder, offset, _depth
1016            )
1017        }
1018    }
1019    unsafe impl<
1020        T0: fidl::encoding::Encode<
1021                fidl::encoding::HandleType<
1022                    fidl::Vmo,
1023                    { fidl::ObjectType::VMO.into_raw() },
1024                    2147483648,
1025                >,
1026                fidl::encoding::DefaultFuchsiaResourceDialect,
1027            >,
1028        T1: fidl::encoding::Encode<
1029                fidl::encoding::BoundedString<1024>,
1030                fidl::encoding::DefaultFuchsiaResourceDialect,
1031            >,
1032        T2: fidl::encoding::Encode<
1033                fidl::encoding::BoundedString<1024>,
1034                fidl::encoding::DefaultFuchsiaResourceDialect,
1035            >,
1036    > fidl::encoding::Encode<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
1037        for (T0, T1, T2)
1038    {
1039        #[inline]
1040        unsafe fn encode(
1041            self,
1042            encoder: &mut fidl::encoding::Encoder<
1043                '_,
1044                fidl::encoding::DefaultFuchsiaResourceDialect,
1045            >,
1046            offset: usize,
1047            depth: fidl::encoding::Depth,
1048        ) -> fidl::Result<()> {
1049            encoder.debug_check_bounds::<DebugVmo>(offset);
1050            // Zero out padding regions. There's no need to apply masks
1051            // because the unmasked parts will be overwritten by fields.
1052            unsafe {
1053                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1054                (ptr as *mut u64).write_unaligned(0);
1055            }
1056            // Write the fields.
1057            self.0.encode(encoder, offset + 0, depth)?;
1058            self.1.encode(encoder, offset + 8, depth)?;
1059            self.2.encode(encoder, offset + 24, depth)?;
1060            Ok(())
1061        }
1062    }
1063
1064    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DebugVmo {
1065        #[inline(always)]
1066        fn new_empty() -> Self {
1067            Self {
1068                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1069                data_sink: fidl::new_empty!(
1070                    fidl::encoding::BoundedString<1024>,
1071                    fidl::encoding::DefaultFuchsiaResourceDialect
1072                ),
1073                test_url: fidl::new_empty!(
1074                    fidl::encoding::BoundedString<1024>,
1075                    fidl::encoding::DefaultFuchsiaResourceDialect
1076                ),
1077            }
1078        }
1079
1080        #[inline]
1081        unsafe fn decode(
1082            &mut self,
1083            decoder: &mut fidl::encoding::Decoder<
1084                '_,
1085                fidl::encoding::DefaultFuchsiaResourceDialect,
1086            >,
1087            offset: usize,
1088            _depth: fidl::encoding::Depth,
1089        ) -> fidl::Result<()> {
1090            decoder.debug_check_bounds::<Self>(offset);
1091            // Verify that padding bytes are zero.
1092            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1093            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1094            let mask = 0xffffffff00000000u64;
1095            let maskedval = padval & mask;
1096            if maskedval != 0 {
1097                return Err(fidl::Error::NonZeroPadding {
1098                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1099                });
1100            }
1101            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
1102            fidl::decode!(
1103                fidl::encoding::BoundedString<1024>,
1104                fidl::encoding::DefaultFuchsiaResourceDialect,
1105                &mut self.data_sink,
1106                decoder,
1107                offset + 8,
1108                _depth
1109            )?;
1110            fidl::decode!(
1111                fidl::encoding::BoundedString<1024>,
1112                fidl::encoding::DefaultFuchsiaResourceDialect,
1113                &mut self.test_url,
1114                decoder,
1115                offset + 24,
1116                _depth
1117            )?;
1118            Ok(())
1119        }
1120    }
1121}