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