1#![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#[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 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 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 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 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#[derive(Debug, Clone)]
175pub struct DebugDataProcessorProxy {
176 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
177}
178
179impl fidl::endpoints::Proxy for DebugDataProcessorProxy {
180 type Protocol = DebugDataProcessorMarker;
181
182 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
183 Self::new(inner)
184 }
185
186 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
187 self.client.into_channel().map_err(|client| Self { client })
188 }
189
190 fn as_channel(&self) -> &::fidl::AsyncChannel {
191 self.client.as_channel()
192 }
193}
194
195impl DebugDataProcessorProxy {
196 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
198 let protocol_name =
199 <DebugDataProcessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
200 Self { client: fidl::client::Client::new(channel, protocol_name) }
201 }
202
203 pub fn take_event_stream(&self) -> DebugDataProcessorEventStream {
209 DebugDataProcessorEventStream { event_receiver: self.client.take_event_receiver() }
210 }
211
212 pub fn r#set_directory(
218 &self,
219 mut directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
220 ) -> Result<(), fidl::Error> {
221 DebugDataProcessorProxyInterface::r#set_directory(self, directory)
222 }
223
224 pub fn r#add_debug_vmos(
226 &self,
227 mut vmos: Vec<DebugVmo>,
228 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
229 DebugDataProcessorProxyInterface::r#add_debug_vmos(self, vmos)
230 }
231
232 pub fn r#finish(
236 &self,
237 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
238 DebugDataProcessorProxyInterface::r#finish(self)
239 }
240}
241
242impl DebugDataProcessorProxyInterface for DebugDataProcessorProxy {
243 fn r#set_directory(
244 &self,
245 mut directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
246 ) -> Result<(), fidl::Error> {
247 self.client.send::<DebugDataProcessorSetDirectoryRequest>(
248 (directory,),
249 0x3010ac21cf0b4c79,
250 fidl::encoding::DynamicFlags::empty(),
251 )
252 }
253
254 type AddDebugVmosResponseFut =
255 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
256 fn r#add_debug_vmos(&self, mut vmos: Vec<DebugVmo>) -> Self::AddDebugVmosResponseFut {
257 fn _decode(
258 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
259 ) -> Result<(), fidl::Error> {
260 let _response = fidl::client::decode_transaction_body::<
261 fidl::encoding::EmptyPayload,
262 fidl::encoding::DefaultFuchsiaResourceDialect,
263 0x48b3d3070f48199b,
264 >(_buf?)?;
265 Ok(_response)
266 }
267 self.client.send_query_and_decode::<DebugDataProcessorAddDebugVmosRequest, ()>(
268 (vmos.as_mut(),),
269 0x48b3d3070f48199b,
270 fidl::encoding::DynamicFlags::empty(),
271 _decode,
272 )
273 }
274
275 type FinishResponseFut =
276 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
277 fn r#finish(&self) -> Self::FinishResponseFut {
278 fn _decode(
279 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
280 ) -> Result<(), fidl::Error> {
281 let _response = fidl::client::decode_transaction_body::<
282 fidl::encoding::EmptyPayload,
283 fidl::encoding::DefaultFuchsiaResourceDialect,
284 0x2bc6016f91bdf3a7,
285 >(_buf?)?;
286 Ok(_response)
287 }
288 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
289 (),
290 0x2bc6016f91bdf3a7,
291 fidl::encoding::DynamicFlags::empty(),
292 _decode,
293 )
294 }
295}
296
297pub struct DebugDataProcessorEventStream {
298 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
299}
300
301impl std::marker::Unpin for DebugDataProcessorEventStream {}
302
303impl futures::stream::FusedStream for DebugDataProcessorEventStream {
304 fn is_terminated(&self) -> bool {
305 self.event_receiver.is_terminated()
306 }
307}
308
309impl futures::Stream for DebugDataProcessorEventStream {
310 type Item = Result<DebugDataProcessorEvent, fidl::Error>;
311
312 fn poll_next(
313 mut self: std::pin::Pin<&mut Self>,
314 cx: &mut std::task::Context<'_>,
315 ) -> std::task::Poll<Option<Self::Item>> {
316 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
317 &mut self.event_receiver,
318 cx
319 )?) {
320 Some(buf) => std::task::Poll::Ready(Some(DebugDataProcessorEvent::decode(buf))),
321 None => std::task::Poll::Ready(None),
322 }
323 }
324}
325
326#[derive(Debug)]
327pub enum DebugDataProcessorEvent {}
328
329impl DebugDataProcessorEvent {
330 fn decode(
332 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
333 ) -> Result<DebugDataProcessorEvent, fidl::Error> {
334 let (bytes, _handles) = buf.split_mut();
335 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
336 debug_assert_eq!(tx_header.tx_id, 0);
337 match tx_header.ordinal {
338 _ => Err(fidl::Error::UnknownOrdinal {
339 ordinal: tx_header.ordinal,
340 protocol_name:
341 <DebugDataProcessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
342 }),
343 }
344 }
345}
346
347pub struct DebugDataProcessorRequestStream {
349 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
350 is_terminated: bool,
351}
352
353impl std::marker::Unpin for DebugDataProcessorRequestStream {}
354
355impl futures::stream::FusedStream for DebugDataProcessorRequestStream {
356 fn is_terminated(&self) -> bool {
357 self.is_terminated
358 }
359}
360
361impl fidl::endpoints::RequestStream for DebugDataProcessorRequestStream {
362 type Protocol = DebugDataProcessorMarker;
363 type ControlHandle = DebugDataProcessorControlHandle;
364
365 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
366 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
367 }
368
369 fn control_handle(&self) -> Self::ControlHandle {
370 DebugDataProcessorControlHandle { inner: self.inner.clone() }
371 }
372
373 fn into_inner(
374 self,
375 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
376 {
377 (self.inner, self.is_terminated)
378 }
379
380 fn from_inner(
381 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
382 is_terminated: bool,
383 ) -> Self {
384 Self { inner, is_terminated }
385 }
386}
387
388impl futures::Stream for DebugDataProcessorRequestStream {
389 type Item = Result<DebugDataProcessorRequest, fidl::Error>;
390
391 fn poll_next(
392 mut self: std::pin::Pin<&mut Self>,
393 cx: &mut std::task::Context<'_>,
394 ) -> std::task::Poll<Option<Self::Item>> {
395 let this = &mut *self;
396 if this.inner.check_shutdown(cx) {
397 this.is_terminated = true;
398 return std::task::Poll::Ready(None);
399 }
400 if this.is_terminated {
401 panic!("polled DebugDataProcessorRequestStream after completion");
402 }
403 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
404 |bytes, handles| {
405 match this.inner.channel().read_etc(cx, bytes, handles) {
406 std::task::Poll::Ready(Ok(())) => {}
407 std::task::Poll::Pending => return std::task::Poll::Pending,
408 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
409 this.is_terminated = true;
410 return std::task::Poll::Ready(None);
411 }
412 std::task::Poll::Ready(Err(e)) => {
413 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
414 e.into(),
415 ))))
416 }
417 }
418
419 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
421
422 std::task::Poll::Ready(Some(match header.ordinal {
423 0x3010ac21cf0b4c79 => {
424 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
425 let mut req = fidl::new_empty!(DebugDataProcessorSetDirectoryRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
426 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugDataProcessorSetDirectoryRequest>(&header, _body_bytes, handles, &mut req)?;
427 let control_handle = DebugDataProcessorControlHandle {
428 inner: this.inner.clone(),
429 };
430 Ok(DebugDataProcessorRequest::SetDirectory {directory: req.directory,
431
432 control_handle,
433 })
434 }
435 0x48b3d3070f48199b => {
436 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
437 let mut req = fidl::new_empty!(DebugDataProcessorAddDebugVmosRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
438 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugDataProcessorAddDebugVmosRequest>(&header, _body_bytes, handles, &mut req)?;
439 let control_handle = DebugDataProcessorControlHandle {
440 inner: this.inner.clone(),
441 };
442 Ok(DebugDataProcessorRequest::AddDebugVmos {vmos: req.vmos,
443
444 responder: DebugDataProcessorAddDebugVmosResponder {
445 control_handle: std::mem::ManuallyDrop::new(control_handle),
446 tx_id: header.tx_id,
447 },
448 })
449 }
450 0x2bc6016f91bdf3a7 => {
451 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
452 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
453 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
454 let control_handle = DebugDataProcessorControlHandle {
455 inner: this.inner.clone(),
456 };
457 Ok(DebugDataProcessorRequest::Finish {
458 responder: DebugDataProcessorFinishResponder {
459 control_handle: std::mem::ManuallyDrop::new(control_handle),
460 tx_id: header.tx_id,
461 },
462 })
463 }
464 _ => Err(fidl::Error::UnknownOrdinal {
465 ordinal: header.ordinal,
466 protocol_name: <DebugDataProcessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
467 }),
468 }))
469 },
470 )
471 }
472}
473
474#[derive(Debug)]
480pub enum DebugDataProcessorRequest {
481 SetDirectory {
487 directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
488 control_handle: DebugDataProcessorControlHandle,
489 },
490 AddDebugVmos { vmos: Vec<DebugVmo>, responder: DebugDataProcessorAddDebugVmosResponder },
492 Finish { responder: DebugDataProcessorFinishResponder },
496}
497
498impl DebugDataProcessorRequest {
499 #[allow(irrefutable_let_patterns)]
500 pub fn into_set_directory(
501 self,
502 ) -> Option<(
503 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
504 DebugDataProcessorControlHandle,
505 )> {
506 if let DebugDataProcessorRequest::SetDirectory { directory, control_handle } = self {
507 Some((directory, control_handle))
508 } else {
509 None
510 }
511 }
512
513 #[allow(irrefutable_let_patterns)]
514 pub fn into_add_debug_vmos(
515 self,
516 ) -> Option<(Vec<DebugVmo>, DebugDataProcessorAddDebugVmosResponder)> {
517 if let DebugDataProcessorRequest::AddDebugVmos { vmos, responder } = self {
518 Some((vmos, responder))
519 } else {
520 None
521 }
522 }
523
524 #[allow(irrefutable_let_patterns)]
525 pub fn into_finish(self) -> Option<(DebugDataProcessorFinishResponder)> {
526 if let DebugDataProcessorRequest::Finish { responder } = self {
527 Some((responder))
528 } else {
529 None
530 }
531 }
532
533 pub fn method_name(&self) -> &'static str {
535 match *self {
536 DebugDataProcessorRequest::SetDirectory { .. } => "set_directory",
537 DebugDataProcessorRequest::AddDebugVmos { .. } => "add_debug_vmos",
538 DebugDataProcessorRequest::Finish { .. } => "finish",
539 }
540 }
541}
542
543#[derive(Debug, Clone)]
544pub struct DebugDataProcessorControlHandle {
545 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
546}
547
548impl fidl::endpoints::ControlHandle for DebugDataProcessorControlHandle {
549 fn shutdown(&self) {
550 self.inner.shutdown()
551 }
552 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
553 self.inner.shutdown_with_epitaph(status)
554 }
555
556 fn is_closed(&self) -> bool {
557 self.inner.channel().is_closed()
558 }
559 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
560 self.inner.channel().on_closed()
561 }
562
563 #[cfg(target_os = "fuchsia")]
564 fn signal_peer(
565 &self,
566 clear_mask: zx::Signals,
567 set_mask: zx::Signals,
568 ) -> Result<(), zx_status::Status> {
569 use fidl::Peered;
570 self.inner.channel().signal_peer(clear_mask, set_mask)
571 }
572}
573
574impl DebugDataProcessorControlHandle {}
575
576#[must_use = "FIDL methods require a response to be sent"]
577#[derive(Debug)]
578pub struct DebugDataProcessorAddDebugVmosResponder {
579 control_handle: std::mem::ManuallyDrop<DebugDataProcessorControlHandle>,
580 tx_id: u32,
581}
582
583impl std::ops::Drop for DebugDataProcessorAddDebugVmosResponder {
587 fn drop(&mut self) {
588 self.control_handle.shutdown();
589 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
591 }
592}
593
594impl fidl::endpoints::Responder for DebugDataProcessorAddDebugVmosResponder {
595 type ControlHandle = DebugDataProcessorControlHandle;
596
597 fn control_handle(&self) -> &DebugDataProcessorControlHandle {
598 &self.control_handle
599 }
600
601 fn drop_without_shutdown(mut self) {
602 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
604 std::mem::forget(self);
606 }
607}
608
609impl DebugDataProcessorAddDebugVmosResponder {
610 pub fn send(self) -> Result<(), fidl::Error> {
614 let _result = self.send_raw();
615 if _result.is_err() {
616 self.control_handle.shutdown();
617 }
618 self.drop_without_shutdown();
619 _result
620 }
621
622 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
624 let _result = self.send_raw();
625 self.drop_without_shutdown();
626 _result
627 }
628
629 fn send_raw(&self) -> Result<(), fidl::Error> {
630 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
631 (),
632 self.tx_id,
633 0x48b3d3070f48199b,
634 fidl::encoding::DynamicFlags::empty(),
635 )
636 }
637}
638
639#[must_use = "FIDL methods require a response to be sent"]
640#[derive(Debug)]
641pub struct DebugDataProcessorFinishResponder {
642 control_handle: std::mem::ManuallyDrop<DebugDataProcessorControlHandle>,
643 tx_id: u32,
644}
645
646impl std::ops::Drop for DebugDataProcessorFinishResponder {
650 fn drop(&mut self) {
651 self.control_handle.shutdown();
652 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
654 }
655}
656
657impl fidl::endpoints::Responder for DebugDataProcessorFinishResponder {
658 type ControlHandle = DebugDataProcessorControlHandle;
659
660 fn control_handle(&self) -> &DebugDataProcessorControlHandle {
661 &self.control_handle
662 }
663
664 fn drop_without_shutdown(mut self) {
665 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
667 std::mem::forget(self);
669 }
670}
671
672impl DebugDataProcessorFinishResponder {
673 pub fn send(self) -> Result<(), fidl::Error> {
677 let _result = self.send_raw();
678 if _result.is_err() {
679 self.control_handle.shutdown();
680 }
681 self.drop_without_shutdown();
682 _result
683 }
684
685 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
687 let _result = self.send_raw();
688 self.drop_without_shutdown();
689 _result
690 }
691
692 fn send_raw(&self) -> Result<(), fidl::Error> {
693 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
694 (),
695 self.tx_id,
696 0x2bc6016f91bdf3a7,
697 fidl::encoding::DynamicFlags::empty(),
698 )
699 }
700}
701
702mod internal {
703 use super::*;
704
705 impl fidl::encoding::ResourceTypeMarker for DebugDataProcessorAddDebugVmosRequest {
706 type Borrowed<'a> = &'a mut Self;
707 fn take_or_borrow<'a>(
708 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
709 ) -> Self::Borrowed<'a> {
710 value
711 }
712 }
713
714 unsafe impl fidl::encoding::TypeMarker for DebugDataProcessorAddDebugVmosRequest {
715 type Owned = Self;
716
717 #[inline(always)]
718 fn inline_align(_context: fidl::encoding::Context) -> usize {
719 8
720 }
721
722 #[inline(always)]
723 fn inline_size(_context: fidl::encoding::Context) -> usize {
724 16
725 }
726 }
727
728 unsafe impl
729 fidl::encoding::Encode<
730 DebugDataProcessorAddDebugVmosRequest,
731 fidl::encoding::DefaultFuchsiaResourceDialect,
732 > for &mut DebugDataProcessorAddDebugVmosRequest
733 {
734 #[inline]
735 unsafe fn encode(
736 self,
737 encoder: &mut fidl::encoding::Encoder<
738 '_,
739 fidl::encoding::DefaultFuchsiaResourceDialect,
740 >,
741 offset: usize,
742 _depth: fidl::encoding::Depth,
743 ) -> fidl::Result<()> {
744 encoder.debug_check_bounds::<DebugDataProcessorAddDebugVmosRequest>(offset);
745 fidl::encoding::Encode::<DebugDataProcessorAddDebugVmosRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
747 (
748 <fidl::encoding::UnboundedVector<DebugVmo> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.vmos),
749 ),
750 encoder, offset, _depth
751 )
752 }
753 }
754 unsafe impl<
755 T0: fidl::encoding::Encode<
756 fidl::encoding::UnboundedVector<DebugVmo>,
757 fidl::encoding::DefaultFuchsiaResourceDialect,
758 >,
759 >
760 fidl::encoding::Encode<
761 DebugDataProcessorAddDebugVmosRequest,
762 fidl::encoding::DefaultFuchsiaResourceDialect,
763 > for (T0,)
764 {
765 #[inline]
766 unsafe fn encode(
767 self,
768 encoder: &mut fidl::encoding::Encoder<
769 '_,
770 fidl::encoding::DefaultFuchsiaResourceDialect,
771 >,
772 offset: usize,
773 depth: fidl::encoding::Depth,
774 ) -> fidl::Result<()> {
775 encoder.debug_check_bounds::<DebugDataProcessorAddDebugVmosRequest>(offset);
776 self.0.encode(encoder, offset + 0, depth)?;
780 Ok(())
781 }
782 }
783
784 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
785 for DebugDataProcessorAddDebugVmosRequest
786 {
787 #[inline(always)]
788 fn new_empty() -> Self {
789 Self {
790 vmos: fidl::new_empty!(
791 fidl::encoding::UnboundedVector<DebugVmo>,
792 fidl::encoding::DefaultFuchsiaResourceDialect
793 ),
794 }
795 }
796
797 #[inline]
798 unsafe fn decode(
799 &mut self,
800 decoder: &mut fidl::encoding::Decoder<
801 '_,
802 fidl::encoding::DefaultFuchsiaResourceDialect,
803 >,
804 offset: usize,
805 _depth: fidl::encoding::Depth,
806 ) -> fidl::Result<()> {
807 decoder.debug_check_bounds::<Self>(offset);
808 fidl::decode!(
810 fidl::encoding::UnboundedVector<DebugVmo>,
811 fidl::encoding::DefaultFuchsiaResourceDialect,
812 &mut self.vmos,
813 decoder,
814 offset + 0,
815 _depth
816 )?;
817 Ok(())
818 }
819 }
820
821 impl fidl::encoding::ResourceTypeMarker for DebugDataProcessorSetDirectoryRequest {
822 type Borrowed<'a> = &'a mut Self;
823 fn take_or_borrow<'a>(
824 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
825 ) -> Self::Borrowed<'a> {
826 value
827 }
828 }
829
830 unsafe impl fidl::encoding::TypeMarker for DebugDataProcessorSetDirectoryRequest {
831 type Owned = Self;
832
833 #[inline(always)]
834 fn inline_align(_context: fidl::encoding::Context) -> usize {
835 4
836 }
837
838 #[inline(always)]
839 fn inline_size(_context: fidl::encoding::Context) -> usize {
840 4
841 }
842 }
843
844 unsafe impl
845 fidl::encoding::Encode<
846 DebugDataProcessorSetDirectoryRequest,
847 fidl::encoding::DefaultFuchsiaResourceDialect,
848 > for &mut DebugDataProcessorSetDirectoryRequest
849 {
850 #[inline]
851 unsafe fn encode(
852 self,
853 encoder: &mut fidl::encoding::Encoder<
854 '_,
855 fidl::encoding::DefaultFuchsiaResourceDialect,
856 >,
857 offset: usize,
858 _depth: fidl::encoding::Depth,
859 ) -> fidl::Result<()> {
860 encoder.debug_check_bounds::<DebugDataProcessorSetDirectoryRequest>(offset);
861 fidl::encoding::Encode::<
863 DebugDataProcessorSetDirectoryRequest,
864 fidl::encoding::DefaultFuchsiaResourceDialect,
865 >::encode(
866 (<fidl::encoding::Endpoint<
867 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
868 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
869 &mut self.directory
870 ),),
871 encoder,
872 offset,
873 _depth,
874 )
875 }
876 }
877 unsafe impl<
878 T0: fidl::encoding::Encode<
879 fidl::encoding::Endpoint<
880 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
881 >,
882 fidl::encoding::DefaultFuchsiaResourceDialect,
883 >,
884 >
885 fidl::encoding::Encode<
886 DebugDataProcessorSetDirectoryRequest,
887 fidl::encoding::DefaultFuchsiaResourceDialect,
888 > for (T0,)
889 {
890 #[inline]
891 unsafe fn encode(
892 self,
893 encoder: &mut fidl::encoding::Encoder<
894 '_,
895 fidl::encoding::DefaultFuchsiaResourceDialect,
896 >,
897 offset: usize,
898 depth: fidl::encoding::Depth,
899 ) -> fidl::Result<()> {
900 encoder.debug_check_bounds::<DebugDataProcessorSetDirectoryRequest>(offset);
901 self.0.encode(encoder, offset + 0, depth)?;
905 Ok(())
906 }
907 }
908
909 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
910 for DebugDataProcessorSetDirectoryRequest
911 {
912 #[inline(always)]
913 fn new_empty() -> Self {
914 Self {
915 directory: fidl::new_empty!(
916 fidl::encoding::Endpoint<
917 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
918 >,
919 fidl::encoding::DefaultFuchsiaResourceDialect
920 ),
921 }
922 }
923
924 #[inline]
925 unsafe fn decode(
926 &mut self,
927 decoder: &mut fidl::encoding::Decoder<
928 '_,
929 fidl::encoding::DefaultFuchsiaResourceDialect,
930 >,
931 offset: usize,
932 _depth: fidl::encoding::Depth,
933 ) -> fidl::Result<()> {
934 decoder.debug_check_bounds::<Self>(offset);
935 fidl::decode!(
937 fidl::encoding::Endpoint<
938 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
939 >,
940 fidl::encoding::DefaultFuchsiaResourceDialect,
941 &mut self.directory,
942 decoder,
943 offset + 0,
944 _depth
945 )?;
946 Ok(())
947 }
948 }
949
950 impl fidl::encoding::ResourceTypeMarker for DebugVmo {
951 type Borrowed<'a> = &'a mut Self;
952 fn take_or_borrow<'a>(
953 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
954 ) -> Self::Borrowed<'a> {
955 value
956 }
957 }
958
959 unsafe impl fidl::encoding::TypeMarker for DebugVmo {
960 type Owned = Self;
961
962 #[inline(always)]
963 fn inline_align(_context: fidl::encoding::Context) -> usize {
964 8
965 }
966
967 #[inline(always)]
968 fn inline_size(_context: fidl::encoding::Context) -> usize {
969 40
970 }
971 }
972
973 unsafe impl fidl::encoding::Encode<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
974 for &mut DebugVmo
975 {
976 #[inline]
977 unsafe fn encode(
978 self,
979 encoder: &mut fidl::encoding::Encoder<
980 '_,
981 fidl::encoding::DefaultFuchsiaResourceDialect,
982 >,
983 offset: usize,
984 _depth: fidl::encoding::Depth,
985 ) -> fidl::Result<()> {
986 encoder.debug_check_bounds::<DebugVmo>(offset);
987 fidl::encoding::Encode::<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
989 (
990 <fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.vmo),
991 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.data_sink),
992 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_url),
993 ),
994 encoder, offset, _depth
995 )
996 }
997 }
998 unsafe impl<
999 T0: fidl::encoding::Encode<
1000 fidl::encoding::HandleType<
1001 fidl::Vmo,
1002 { fidl::ObjectType::VMO.into_raw() },
1003 2147483648,
1004 >,
1005 fidl::encoding::DefaultFuchsiaResourceDialect,
1006 >,
1007 T1: fidl::encoding::Encode<
1008 fidl::encoding::BoundedString<1024>,
1009 fidl::encoding::DefaultFuchsiaResourceDialect,
1010 >,
1011 T2: fidl::encoding::Encode<
1012 fidl::encoding::BoundedString<1024>,
1013 fidl::encoding::DefaultFuchsiaResourceDialect,
1014 >,
1015 > fidl::encoding::Encode<DebugVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
1016 for (T0, T1, T2)
1017 {
1018 #[inline]
1019 unsafe fn encode(
1020 self,
1021 encoder: &mut fidl::encoding::Encoder<
1022 '_,
1023 fidl::encoding::DefaultFuchsiaResourceDialect,
1024 >,
1025 offset: usize,
1026 depth: fidl::encoding::Depth,
1027 ) -> fidl::Result<()> {
1028 encoder.debug_check_bounds::<DebugVmo>(offset);
1029 unsafe {
1032 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1033 (ptr as *mut u64).write_unaligned(0);
1034 }
1035 self.0.encode(encoder, offset + 0, depth)?;
1037 self.1.encode(encoder, offset + 8, depth)?;
1038 self.2.encode(encoder, offset + 24, depth)?;
1039 Ok(())
1040 }
1041 }
1042
1043 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DebugVmo {
1044 #[inline(always)]
1045 fn new_empty() -> Self {
1046 Self {
1047 vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1048 data_sink: fidl::new_empty!(
1049 fidl::encoding::BoundedString<1024>,
1050 fidl::encoding::DefaultFuchsiaResourceDialect
1051 ),
1052 test_url: fidl::new_empty!(
1053 fidl::encoding::BoundedString<1024>,
1054 fidl::encoding::DefaultFuchsiaResourceDialect
1055 ),
1056 }
1057 }
1058
1059 #[inline]
1060 unsafe fn decode(
1061 &mut self,
1062 decoder: &mut fidl::encoding::Decoder<
1063 '_,
1064 fidl::encoding::DefaultFuchsiaResourceDialect,
1065 >,
1066 offset: usize,
1067 _depth: fidl::encoding::Depth,
1068 ) -> fidl::Result<()> {
1069 decoder.debug_check_bounds::<Self>(offset);
1070 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1072 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1073 let mask = 0xffffffff00000000u64;
1074 let maskedval = padval & mask;
1075 if maskedval != 0 {
1076 return Err(fidl::Error::NonZeroPadding {
1077 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1078 });
1079 }
1080 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
1081 fidl::decode!(
1082 fidl::encoding::BoundedString<1024>,
1083 fidl::encoding::DefaultFuchsiaResourceDialect,
1084 &mut self.data_sink,
1085 decoder,
1086 offset + 8,
1087 _depth
1088 )?;
1089 fidl::decode!(
1090 fidl::encoding::BoundedString<1024>,
1091 fidl::encoding::DefaultFuchsiaResourceDialect,
1092 &mut self.test_url,
1093 decoder,
1094 offset + 24,
1095 _depth
1096 )?;
1097 Ok(())
1098 }
1099 }
1100}