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::Handle {
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    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
562        self.inner.shutdown_with_epitaph(status)
563    }
564
565    fn is_closed(&self) -> bool {
566        self.inner.channel().is_closed()
567    }
568    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
569        self.inner.channel().on_closed()
570    }
571
572    #[cfg(target_os = "fuchsia")]
573    fn signal_peer(
574        &self,
575        clear_mask: zx::Signals,
576        set_mask: zx::Signals,
577    ) -> Result<(), zx_status::Status> {
578        use fidl::Peered;
579        self.inner.channel().signal_peer(clear_mask, set_mask)
580    }
581}
582
583impl DebugDataProcessorControlHandle {}
584
585#[must_use = "FIDL methods require a response to be sent"]
586#[derive(Debug)]
587pub struct DebugDataProcessorAddDebugVmosResponder {
588    control_handle: std::mem::ManuallyDrop<DebugDataProcessorControlHandle>,
589    tx_id: u32,
590}
591
592/// Set the the channel to be shutdown (see [`DebugDataProcessorControlHandle::shutdown`])
593/// if the responder is dropped without sending a response, so that the client
594/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
595impl std::ops::Drop for DebugDataProcessorAddDebugVmosResponder {
596    fn drop(&mut self) {
597        self.control_handle.shutdown();
598        // Safety: drops once, never accessed again
599        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
600    }
601}
602
603impl fidl::endpoints::Responder for DebugDataProcessorAddDebugVmosResponder {
604    type ControlHandle = DebugDataProcessorControlHandle;
605
606    fn control_handle(&self) -> &DebugDataProcessorControlHandle {
607        &self.control_handle
608    }
609
610    fn drop_without_shutdown(mut self) {
611        // Safety: drops once, never accessed again due to mem::forget
612        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
613        // Prevent Drop from running (which would shut down the channel)
614        std::mem::forget(self);
615    }
616}
617
618impl DebugDataProcessorAddDebugVmosResponder {
619    /// Sends a response to the FIDL transaction.
620    ///
621    /// Sets the channel to shutdown if an error occurs.
622    pub fn send(self) -> Result<(), fidl::Error> {
623        let _result = self.send_raw();
624        if _result.is_err() {
625            self.control_handle.shutdown();
626        }
627        self.drop_without_shutdown();
628        _result
629    }
630
631    /// Similar to "send" but does not shutdown the channel if an error occurs.
632    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
633        let _result = self.send_raw();
634        self.drop_without_shutdown();
635        _result
636    }
637
638    fn send_raw(&self) -> Result<(), fidl::Error> {
639        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
640            (),
641            self.tx_id,
642            0x48b3d3070f48199b,
643            fidl::encoding::DynamicFlags::empty(),
644        )
645    }
646}
647
648#[must_use = "FIDL methods require a response to be sent"]
649#[derive(Debug)]
650pub struct DebugDataProcessorFinishResponder {
651    control_handle: std::mem::ManuallyDrop<DebugDataProcessorControlHandle>,
652    tx_id: u32,
653}
654
655/// Set the the channel to be shutdown (see [`DebugDataProcessorControlHandle::shutdown`])
656/// if the responder is dropped without sending a response, so that the client
657/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
658impl std::ops::Drop for DebugDataProcessorFinishResponder {
659    fn drop(&mut self) {
660        self.control_handle.shutdown();
661        // Safety: drops once, never accessed again
662        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
663    }
664}
665
666impl fidl::endpoints::Responder for DebugDataProcessorFinishResponder {
667    type ControlHandle = DebugDataProcessorControlHandle;
668
669    fn control_handle(&self) -> &DebugDataProcessorControlHandle {
670        &self.control_handle
671    }
672
673    fn drop_without_shutdown(mut self) {
674        // Safety: drops once, never accessed again due to mem::forget
675        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
676        // Prevent Drop from running (which would shut down the channel)
677        std::mem::forget(self);
678    }
679}
680
681impl DebugDataProcessorFinishResponder {
682    /// Sends a response to the FIDL transaction.
683    ///
684    /// Sets the channel to shutdown if an error occurs.
685    pub fn send(self) -> Result<(), fidl::Error> {
686        let _result = self.send_raw();
687        if _result.is_err() {
688            self.control_handle.shutdown();
689        }
690        self.drop_without_shutdown();
691        _result
692    }
693
694    /// Similar to "send" but does not shutdown the channel if an error occurs.
695    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
696        let _result = self.send_raw();
697        self.drop_without_shutdown();
698        _result
699    }
700
701    fn send_raw(&self) -> Result<(), fidl::Error> {
702        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
703            (),
704            self.tx_id,
705            0x2bc6016f91bdf3a7,
706            fidl::encoding::DynamicFlags::empty(),
707        )
708    }
709}
710
711mod internal {
712    use super::*;
713
714    impl fidl::encoding::ResourceTypeMarker for DebugDataProcessorAddDebugVmosRequest {
715        type Borrowed<'a> = &'a mut Self;
716        fn take_or_borrow<'a>(
717            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
718        ) -> Self::Borrowed<'a> {
719            value
720        }
721    }
722
723    unsafe impl fidl::encoding::TypeMarker for DebugDataProcessorAddDebugVmosRequest {
724        type Owned = Self;
725
726        #[inline(always)]
727        fn inline_align(_context: fidl::encoding::Context) -> usize {
728            8
729        }
730
731        #[inline(always)]
732        fn inline_size(_context: fidl::encoding::Context) -> usize {
733            16
734        }
735    }
736
737    unsafe impl
738        fidl::encoding::Encode<
739            DebugDataProcessorAddDebugVmosRequest,
740            fidl::encoding::DefaultFuchsiaResourceDialect,
741        > for &mut DebugDataProcessorAddDebugVmosRequest
742    {
743        #[inline]
744        unsafe fn encode(
745            self,
746            encoder: &mut fidl::encoding::Encoder<
747                '_,
748                fidl::encoding::DefaultFuchsiaResourceDialect,
749            >,
750            offset: usize,
751            _depth: fidl::encoding::Depth,
752        ) -> fidl::Result<()> {
753            encoder.debug_check_bounds::<DebugDataProcessorAddDebugVmosRequest>(offset);
754            // Delegate to tuple encoding.
755            fidl::encoding::Encode::<DebugDataProcessorAddDebugVmosRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
756                (
757                    <fidl::encoding::UnboundedVector<DebugVmo> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.vmos),
758                ),
759                encoder, offset, _depth
760            )
761        }
762    }
763    unsafe impl<
764            T0: fidl::encoding::Encode<
765                fidl::encoding::UnboundedVector<DebugVmo>,
766                fidl::encoding::DefaultFuchsiaResourceDialect,
767            >,
768        >
769        fidl::encoding::Encode<
770            DebugDataProcessorAddDebugVmosRequest,
771            fidl::encoding::DefaultFuchsiaResourceDialect,
772        > for (T0,)
773    {
774        #[inline]
775        unsafe fn encode(
776            self,
777            encoder: &mut fidl::encoding::Encoder<
778                '_,
779                fidl::encoding::DefaultFuchsiaResourceDialect,
780            >,
781            offset: usize,
782            depth: fidl::encoding::Depth,
783        ) -> fidl::Result<()> {
784            encoder.debug_check_bounds::<DebugDataProcessorAddDebugVmosRequest>(offset);
785            // Zero out padding regions. There's no need to apply masks
786            // because the unmasked parts will be overwritten by fields.
787            // Write the fields.
788            self.0.encode(encoder, offset + 0, depth)?;
789            Ok(())
790        }
791    }
792
793    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
794        for DebugDataProcessorAddDebugVmosRequest
795    {
796        #[inline(always)]
797        fn new_empty() -> Self {
798            Self {
799                vmos: fidl::new_empty!(
800                    fidl::encoding::UnboundedVector<DebugVmo>,
801                    fidl::encoding::DefaultFuchsiaResourceDialect
802                ),
803            }
804        }
805
806        #[inline]
807        unsafe fn decode(
808            &mut self,
809            decoder: &mut fidl::encoding::Decoder<
810                '_,
811                fidl::encoding::DefaultFuchsiaResourceDialect,
812            >,
813            offset: usize,
814            _depth: fidl::encoding::Depth,
815        ) -> fidl::Result<()> {
816            decoder.debug_check_bounds::<Self>(offset);
817            // Verify that padding bytes are zero.
818            fidl::decode!(
819                fidl::encoding::UnboundedVector<DebugVmo>,
820                fidl::encoding::DefaultFuchsiaResourceDialect,
821                &mut self.vmos,
822                decoder,
823                offset + 0,
824                _depth
825            )?;
826            Ok(())
827        }
828    }
829
830    impl fidl::encoding::ResourceTypeMarker for DebugDataProcessorSetDirectoryRequest {
831        type Borrowed<'a> = &'a mut Self;
832        fn take_or_borrow<'a>(
833            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
834        ) -> Self::Borrowed<'a> {
835            value
836        }
837    }
838
839    unsafe impl fidl::encoding::TypeMarker for DebugDataProcessorSetDirectoryRequest {
840        type Owned = Self;
841
842        #[inline(always)]
843        fn inline_align(_context: fidl::encoding::Context) -> usize {
844            4
845        }
846
847        #[inline(always)]
848        fn inline_size(_context: fidl::encoding::Context) -> usize {
849            4
850        }
851    }
852
853    unsafe impl
854        fidl::encoding::Encode<
855            DebugDataProcessorSetDirectoryRequest,
856            fidl::encoding::DefaultFuchsiaResourceDialect,
857        > for &mut DebugDataProcessorSetDirectoryRequest
858    {
859        #[inline]
860        unsafe fn encode(
861            self,
862            encoder: &mut fidl::encoding::Encoder<
863                '_,
864                fidl::encoding::DefaultFuchsiaResourceDialect,
865            >,
866            offset: usize,
867            _depth: fidl::encoding::Depth,
868        ) -> fidl::Result<()> {
869            encoder.debug_check_bounds::<DebugDataProcessorSetDirectoryRequest>(offset);
870            // Delegate to tuple encoding.
871            fidl::encoding::Encode::<
872                DebugDataProcessorSetDirectoryRequest,
873                fidl::encoding::DefaultFuchsiaResourceDialect,
874            >::encode(
875                (<fidl::encoding::Endpoint<
876                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
877                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
878                    &mut self.directory
879                ),),
880                encoder,
881                offset,
882                _depth,
883            )
884        }
885    }
886    unsafe impl<
887            T0: fidl::encoding::Encode<
888                fidl::encoding::Endpoint<
889                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
890                >,
891                fidl::encoding::DefaultFuchsiaResourceDialect,
892            >,
893        >
894        fidl::encoding::Encode<
895            DebugDataProcessorSetDirectoryRequest,
896            fidl::encoding::DefaultFuchsiaResourceDialect,
897        > for (T0,)
898    {
899        #[inline]
900        unsafe fn encode(
901            self,
902            encoder: &mut fidl::encoding::Encoder<
903                '_,
904                fidl::encoding::DefaultFuchsiaResourceDialect,
905            >,
906            offset: usize,
907            depth: fidl::encoding::Depth,
908        ) -> fidl::Result<()> {
909            encoder.debug_check_bounds::<DebugDataProcessorSetDirectoryRequest>(offset);
910            // Zero out padding regions. There's no need to apply masks
911            // because the unmasked parts will be overwritten by fields.
912            // Write the fields.
913            self.0.encode(encoder, offset + 0, depth)?;
914            Ok(())
915        }
916    }
917
918    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
919        for DebugDataProcessorSetDirectoryRequest
920    {
921        #[inline(always)]
922        fn new_empty() -> Self {
923            Self {
924                directory: fidl::new_empty!(
925                    fidl::encoding::Endpoint<
926                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
927                    >,
928                    fidl::encoding::DefaultFuchsiaResourceDialect
929                ),
930            }
931        }
932
933        #[inline]
934        unsafe fn decode(
935            &mut self,
936            decoder: &mut fidl::encoding::Decoder<
937                '_,
938                fidl::encoding::DefaultFuchsiaResourceDialect,
939            >,
940            offset: usize,
941            _depth: fidl::encoding::Depth,
942        ) -> fidl::Result<()> {
943            decoder.debug_check_bounds::<Self>(offset);
944            // Verify that padding bytes are zero.
945            fidl::decode!(
946                fidl::encoding::Endpoint<
947                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
948                >,
949                fidl::encoding::DefaultFuchsiaResourceDialect,
950                &mut self.directory,
951                decoder,
952                offset + 0,
953                _depth
954            )?;
955            Ok(())
956        }
957    }
958
959    impl fidl::encoding::ResourceTypeMarker for DebugVmo {
960        type Borrowed<'a> = &'a mut Self;
961        fn take_or_borrow<'a>(
962            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
963        ) -> Self::Borrowed<'a> {
964            value
965        }
966    }
967
968    unsafe impl fidl::encoding::TypeMarker for DebugVmo {
969        type Owned = Self;
970
971        #[inline(always)]
972        fn inline_align(_context: fidl::encoding::Context) -> usize {
973            8
974        }
975
976        #[inline(always)]
977        fn inline_size(_context: fidl::encoding::Context) -> usize {
978            40
979        }
980    }
981
982    unsafe impl fidl::encoding::Encode<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
983        for &mut DebugVmo
984    {
985        #[inline]
986        unsafe fn encode(
987            self,
988            encoder: &mut fidl::encoding::Encoder<
989                '_,
990                fidl::encoding::DefaultFuchsiaResourceDialect,
991            >,
992            offset: usize,
993            _depth: fidl::encoding::Depth,
994        ) -> fidl::Result<()> {
995            encoder.debug_check_bounds::<DebugVmo>(offset);
996            // Delegate to tuple encoding.
997            fidl::encoding::Encode::<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
998                (
999                    <fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.vmo),
1000                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.data_sink),
1001                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
1002                ),
1003                encoder, offset, _depth
1004            )
1005        }
1006    }
1007    unsafe impl<
1008            T0: fidl::encoding::Encode<
1009                fidl::encoding::HandleType<
1010                    fidl::Vmo,
1011                    { fidl::ObjectType::VMO.into_raw() },
1012                    2147483648,
1013                >,
1014                fidl::encoding::DefaultFuchsiaResourceDialect,
1015            >,
1016            T1: fidl::encoding::Encode<
1017                fidl::encoding::BoundedString<1024>,
1018                fidl::encoding::DefaultFuchsiaResourceDialect,
1019            >,
1020            T2: fidl::encoding::Encode<
1021                fidl::encoding::BoundedString<1024>,
1022                fidl::encoding::DefaultFuchsiaResourceDialect,
1023            >,
1024        > fidl::encoding::Encode<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
1025        for (T0, T1, T2)
1026    {
1027        #[inline]
1028        unsafe fn encode(
1029            self,
1030            encoder: &mut fidl::encoding::Encoder<
1031                '_,
1032                fidl::encoding::DefaultFuchsiaResourceDialect,
1033            >,
1034            offset: usize,
1035            depth: fidl::encoding::Depth,
1036        ) -> fidl::Result<()> {
1037            encoder.debug_check_bounds::<DebugVmo>(offset);
1038            // Zero out padding regions. There's no need to apply masks
1039            // because the unmasked parts will be overwritten by fields.
1040            unsafe {
1041                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1042                (ptr as *mut u64).write_unaligned(0);
1043            }
1044            // Write the fields.
1045            self.0.encode(encoder, offset + 0, depth)?;
1046            self.1.encode(encoder, offset + 8, depth)?;
1047            self.2.encode(encoder, offset + 24, depth)?;
1048            Ok(())
1049        }
1050    }
1051
1052    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DebugVmo {
1053        #[inline(always)]
1054        fn new_empty() -> Self {
1055            Self {
1056                vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1057                data_sink: fidl::new_empty!(
1058                    fidl::encoding::BoundedString<1024>,
1059                    fidl::encoding::DefaultFuchsiaResourceDialect
1060                ),
1061                test_url: fidl::new_empty!(
1062                    fidl::encoding::BoundedString<1024>,
1063                    fidl::encoding::DefaultFuchsiaResourceDialect
1064                ),
1065            }
1066        }
1067
1068        #[inline]
1069        unsafe fn decode(
1070            &mut self,
1071            decoder: &mut fidl::encoding::Decoder<
1072                '_,
1073                fidl::encoding::DefaultFuchsiaResourceDialect,
1074            >,
1075            offset: usize,
1076            _depth: fidl::encoding::Depth,
1077        ) -> fidl::Result<()> {
1078            decoder.debug_check_bounds::<Self>(offset);
1079            // Verify that padding bytes are zero.
1080            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1081            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1082            let mask = 0xffffffff00000000u64;
1083            let maskedval = padval & mask;
1084            if maskedval != 0 {
1085                return Err(fidl::Error::NonZeroPadding {
1086                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1087                });
1088            }
1089            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
1090            fidl::decode!(
1091                fidl::encoding::BoundedString<1024>,
1092                fidl::encoding::DefaultFuchsiaResourceDialect,
1093                &mut self.data_sink,
1094                decoder,
1095                offset + 8,
1096                _depth
1097            )?;
1098            fidl::decode!(
1099                fidl::encoding::BoundedString<1024>,
1100                fidl::encoding::DefaultFuchsiaResourceDialect,
1101                &mut self.test_url,
1102                decoder,
1103                offset + 24,
1104                _depth
1105            )?;
1106            Ok(())
1107        }
1108    }
1109}