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_power_metrics__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct RecorderMarker;
16
17impl fidl::endpoints::ProtocolMarker for RecorderMarker {
18 type Proxy = RecorderProxy;
19 type RequestStream = RecorderRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = RecorderSynchronousProxy;
22
23 const DEBUG_NAME: &'static str = "fuchsia.power.metrics.Recorder";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for RecorderMarker {}
26pub type RecorderStartLoggingResult = Result<(), RecorderError>;
27pub type RecorderStartLoggingForeverResult = Result<(), RecorderError>;
28
29pub trait RecorderProxyInterface: Send + Sync {
30 type StartLoggingResponseFut: std::future::Future<Output = Result<RecorderStartLoggingResult, fidl::Error>>
31 + Send;
32 fn r#start_logging(
33 &self,
34 client_id: &str,
35 metrics: &[Metric],
36 duration_ms: u32,
37 output_samples_to_syslog: bool,
38 output_stats_to_syslog: bool,
39 ) -> Self::StartLoggingResponseFut;
40 type StartLoggingForeverResponseFut: std::future::Future<Output = Result<RecorderStartLoggingForeverResult, fidl::Error>>
41 + Send;
42 fn r#start_logging_forever(
43 &self,
44 client_id: &str,
45 metrics: &[Metric],
46 output_samples_to_syslog: bool,
47 output_stats_to_syslog: bool,
48 ) -> Self::StartLoggingForeverResponseFut;
49 type StopLoggingResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
50 fn r#stop_logging(&self, client_id: &str) -> Self::StopLoggingResponseFut;
51}
52#[derive(Debug)]
53#[cfg(target_os = "fuchsia")]
54pub struct RecorderSynchronousProxy {
55 client: fidl::client::sync::Client,
56}
57
58#[cfg(target_os = "fuchsia")]
59impl fidl::endpoints::SynchronousProxy for RecorderSynchronousProxy {
60 type Proxy = RecorderProxy;
61 type Protocol = RecorderMarker;
62
63 fn from_channel(inner: fidl::Channel) -> Self {
64 Self::new(inner)
65 }
66
67 fn into_channel(self) -> fidl::Channel {
68 self.client.into_channel()
69 }
70
71 fn as_channel(&self) -> &fidl::Channel {
72 self.client.as_channel()
73 }
74}
75
76#[cfg(target_os = "fuchsia")]
77impl RecorderSynchronousProxy {
78 pub fn new(channel: fidl::Channel) -> Self {
79 let protocol_name = <RecorderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
80 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
81 }
82
83 pub fn into_channel(self) -> fidl::Channel {
84 self.client.into_channel()
85 }
86
87 pub fn wait_for_event(
90 &self,
91 deadline: zx::MonotonicInstant,
92 ) -> Result<RecorderEvent, fidl::Error> {
93 RecorderEvent::decode(self.client.wait_for_event(deadline)?)
94 }
95
96 pub fn r#start_logging(
117 &self,
118 mut client_id: &str,
119 mut metrics: &[Metric],
120 mut duration_ms: u32,
121 mut output_samples_to_syslog: bool,
122 mut output_stats_to_syslog: bool,
123 ___deadline: zx::MonotonicInstant,
124 ) -> Result<RecorderStartLoggingResult, fidl::Error> {
125 let _response = self.client.send_query::<
126 RecorderStartLoggingRequest,
127 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RecorderError>,
128 >(
129 (client_id, metrics, duration_ms, output_samples_to_syslog, output_stats_to_syslog,),
130 0x40e4e1a9c6c42bd2,
131 fidl::encoding::DynamicFlags::empty(),
132 ___deadline,
133 )?;
134 Ok(_response.map(|x| x))
135 }
136
137 pub fn r#start_logging_forever(
153 &self,
154 mut client_id: &str,
155 mut metrics: &[Metric],
156 mut output_samples_to_syslog: bool,
157 mut output_stats_to_syslog: bool,
158 ___deadline: zx::MonotonicInstant,
159 ) -> Result<RecorderStartLoggingForeverResult, fidl::Error> {
160 let _response = self.client.send_query::<
161 RecorderStartLoggingForeverRequest,
162 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RecorderError>,
163 >(
164 (client_id, metrics, output_samples_to_syslog, output_stats_to_syslog,),
165 0x37b2675fdc61ff94,
166 fidl::encoding::DynamicFlags::empty(),
167 ___deadline,
168 )?;
169 Ok(_response.map(|x| x))
170 }
171
172 pub fn r#stop_logging(
179 &self,
180 mut client_id: &str,
181 ___deadline: zx::MonotonicInstant,
182 ) -> Result<bool, fidl::Error> {
183 let _response =
184 self.client.send_query::<RecorderStopLoggingRequest, RecorderStopLoggingResponse>(
185 (client_id,),
186 0x615d67a4d94d4732,
187 fidl::encoding::DynamicFlags::empty(),
188 ___deadline,
189 )?;
190 Ok(_response.stopped)
191 }
192}
193
194#[cfg(target_os = "fuchsia")]
195impl From<RecorderSynchronousProxy> for zx::NullableHandle {
196 fn from(value: RecorderSynchronousProxy) -> Self {
197 value.into_channel().into()
198 }
199}
200
201#[cfg(target_os = "fuchsia")]
202impl From<fidl::Channel> for RecorderSynchronousProxy {
203 fn from(value: fidl::Channel) -> Self {
204 Self::new(value)
205 }
206}
207
208#[cfg(target_os = "fuchsia")]
209impl fidl::endpoints::FromClient for RecorderSynchronousProxy {
210 type Protocol = RecorderMarker;
211
212 fn from_client(value: fidl::endpoints::ClientEnd<RecorderMarker>) -> Self {
213 Self::new(value.into_channel())
214 }
215}
216
217#[derive(Debug, Clone)]
218pub struct RecorderProxy {
219 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
220}
221
222impl fidl::endpoints::Proxy for RecorderProxy {
223 type Protocol = RecorderMarker;
224
225 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
226 Self::new(inner)
227 }
228
229 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
230 self.client.into_channel().map_err(|client| Self { client })
231 }
232
233 fn as_channel(&self) -> &::fidl::AsyncChannel {
234 self.client.as_channel()
235 }
236}
237
238impl RecorderProxy {
239 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
241 let protocol_name = <RecorderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
242 Self { client: fidl::client::Client::new(channel, protocol_name) }
243 }
244
245 pub fn take_event_stream(&self) -> RecorderEventStream {
251 RecorderEventStream { event_receiver: self.client.take_event_receiver() }
252 }
253
254 pub fn r#start_logging(
275 &self,
276 mut client_id: &str,
277 mut metrics: &[Metric],
278 mut duration_ms: u32,
279 mut output_samples_to_syslog: bool,
280 mut output_stats_to_syslog: bool,
281 ) -> fidl::client::QueryResponseFut<
282 RecorderStartLoggingResult,
283 fidl::encoding::DefaultFuchsiaResourceDialect,
284 > {
285 RecorderProxyInterface::r#start_logging(
286 self,
287 client_id,
288 metrics,
289 duration_ms,
290 output_samples_to_syslog,
291 output_stats_to_syslog,
292 )
293 }
294
295 pub fn r#start_logging_forever(
311 &self,
312 mut client_id: &str,
313 mut metrics: &[Metric],
314 mut output_samples_to_syslog: bool,
315 mut output_stats_to_syslog: bool,
316 ) -> fidl::client::QueryResponseFut<
317 RecorderStartLoggingForeverResult,
318 fidl::encoding::DefaultFuchsiaResourceDialect,
319 > {
320 RecorderProxyInterface::r#start_logging_forever(
321 self,
322 client_id,
323 metrics,
324 output_samples_to_syslog,
325 output_stats_to_syslog,
326 )
327 }
328
329 pub fn r#stop_logging(
336 &self,
337 mut client_id: &str,
338 ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
339 RecorderProxyInterface::r#stop_logging(self, client_id)
340 }
341}
342
343impl RecorderProxyInterface for RecorderProxy {
344 type StartLoggingResponseFut = fidl::client::QueryResponseFut<
345 RecorderStartLoggingResult,
346 fidl::encoding::DefaultFuchsiaResourceDialect,
347 >;
348 fn r#start_logging(
349 &self,
350 mut client_id: &str,
351 mut metrics: &[Metric],
352 mut duration_ms: u32,
353 mut output_samples_to_syslog: bool,
354 mut output_stats_to_syslog: bool,
355 ) -> Self::StartLoggingResponseFut {
356 fn _decode(
357 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
358 ) -> Result<RecorderStartLoggingResult, fidl::Error> {
359 let _response = fidl::client::decode_transaction_body::<
360 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RecorderError>,
361 fidl::encoding::DefaultFuchsiaResourceDialect,
362 0x40e4e1a9c6c42bd2,
363 >(_buf?)?;
364 Ok(_response.map(|x| x))
365 }
366 self.client
367 .send_query_and_decode::<RecorderStartLoggingRequest, RecorderStartLoggingResult>(
368 (client_id, metrics, duration_ms, output_samples_to_syslog, output_stats_to_syslog),
369 0x40e4e1a9c6c42bd2,
370 fidl::encoding::DynamicFlags::empty(),
371 _decode,
372 )
373 }
374
375 type StartLoggingForeverResponseFut = fidl::client::QueryResponseFut<
376 RecorderStartLoggingForeverResult,
377 fidl::encoding::DefaultFuchsiaResourceDialect,
378 >;
379 fn r#start_logging_forever(
380 &self,
381 mut client_id: &str,
382 mut metrics: &[Metric],
383 mut output_samples_to_syslog: bool,
384 mut output_stats_to_syslog: bool,
385 ) -> Self::StartLoggingForeverResponseFut {
386 fn _decode(
387 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
388 ) -> Result<RecorderStartLoggingForeverResult, fidl::Error> {
389 let _response = fidl::client::decode_transaction_body::<
390 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RecorderError>,
391 fidl::encoding::DefaultFuchsiaResourceDialect,
392 0x37b2675fdc61ff94,
393 >(_buf?)?;
394 Ok(_response.map(|x| x))
395 }
396 self.client.send_query_and_decode::<
397 RecorderStartLoggingForeverRequest,
398 RecorderStartLoggingForeverResult,
399 >(
400 (client_id, metrics, output_samples_to_syslog, output_stats_to_syslog,),
401 0x37b2675fdc61ff94,
402 fidl::encoding::DynamicFlags::empty(),
403 _decode,
404 )
405 }
406
407 type StopLoggingResponseFut =
408 fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
409 fn r#stop_logging(&self, mut client_id: &str) -> Self::StopLoggingResponseFut {
410 fn _decode(
411 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
412 ) -> Result<bool, fidl::Error> {
413 let _response = fidl::client::decode_transaction_body::<
414 RecorderStopLoggingResponse,
415 fidl::encoding::DefaultFuchsiaResourceDialect,
416 0x615d67a4d94d4732,
417 >(_buf?)?;
418 Ok(_response.stopped)
419 }
420 self.client.send_query_and_decode::<RecorderStopLoggingRequest, bool>(
421 (client_id,),
422 0x615d67a4d94d4732,
423 fidl::encoding::DynamicFlags::empty(),
424 _decode,
425 )
426 }
427}
428
429pub struct RecorderEventStream {
430 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
431}
432
433impl std::marker::Unpin for RecorderEventStream {}
434
435impl futures::stream::FusedStream for RecorderEventStream {
436 fn is_terminated(&self) -> bool {
437 self.event_receiver.is_terminated()
438 }
439}
440
441impl futures::Stream for RecorderEventStream {
442 type Item = Result<RecorderEvent, fidl::Error>;
443
444 fn poll_next(
445 mut self: std::pin::Pin<&mut Self>,
446 cx: &mut std::task::Context<'_>,
447 ) -> std::task::Poll<Option<Self::Item>> {
448 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
449 &mut self.event_receiver,
450 cx
451 )?) {
452 Some(buf) => std::task::Poll::Ready(Some(RecorderEvent::decode(buf))),
453 None => std::task::Poll::Ready(None),
454 }
455 }
456}
457
458#[derive(Debug)]
459pub enum RecorderEvent {}
460
461impl RecorderEvent {
462 fn decode(
464 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
465 ) -> Result<RecorderEvent, fidl::Error> {
466 let (bytes, _handles) = buf.split_mut();
467 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
468 debug_assert_eq!(tx_header.tx_id, 0);
469 match tx_header.ordinal {
470 _ => Err(fidl::Error::UnknownOrdinal {
471 ordinal: tx_header.ordinal,
472 protocol_name: <RecorderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
473 }),
474 }
475 }
476}
477
478pub struct RecorderRequestStream {
480 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
481 is_terminated: bool,
482}
483
484impl std::marker::Unpin for RecorderRequestStream {}
485
486impl futures::stream::FusedStream for RecorderRequestStream {
487 fn is_terminated(&self) -> bool {
488 self.is_terminated
489 }
490}
491
492impl fidl::endpoints::RequestStream for RecorderRequestStream {
493 type Protocol = RecorderMarker;
494 type ControlHandle = RecorderControlHandle;
495
496 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
497 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
498 }
499
500 fn control_handle(&self) -> Self::ControlHandle {
501 RecorderControlHandle { inner: self.inner.clone() }
502 }
503
504 fn into_inner(
505 self,
506 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
507 {
508 (self.inner, self.is_terminated)
509 }
510
511 fn from_inner(
512 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
513 is_terminated: bool,
514 ) -> Self {
515 Self { inner, is_terminated }
516 }
517}
518
519impl futures::Stream for RecorderRequestStream {
520 type Item = Result<RecorderRequest, fidl::Error>;
521
522 fn poll_next(
523 mut self: std::pin::Pin<&mut Self>,
524 cx: &mut std::task::Context<'_>,
525 ) -> std::task::Poll<Option<Self::Item>> {
526 let this = &mut *self;
527 if this.inner.check_shutdown(cx) {
528 this.is_terminated = true;
529 return std::task::Poll::Ready(None);
530 }
531 if this.is_terminated {
532 panic!("polled RecorderRequestStream after completion");
533 }
534 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
535 |bytes, handles| {
536 match this.inner.channel().read_etc(cx, bytes, handles) {
537 std::task::Poll::Ready(Ok(())) => {}
538 std::task::Poll::Pending => return std::task::Poll::Pending,
539 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
540 this.is_terminated = true;
541 return std::task::Poll::Ready(None);
542 }
543 std::task::Poll::Ready(Err(e)) => {
544 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
545 e.into(),
546 ))));
547 }
548 }
549
550 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
552
553 std::task::Poll::Ready(Some(match header.ordinal {
554 0x40e4e1a9c6c42bd2 => {
555 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
556 let mut req = fidl::new_empty!(
557 RecorderStartLoggingRequest,
558 fidl::encoding::DefaultFuchsiaResourceDialect
559 );
560 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RecorderStartLoggingRequest>(&header, _body_bytes, handles, &mut req)?;
561 let control_handle = RecorderControlHandle { inner: this.inner.clone() };
562 Ok(RecorderRequest::StartLogging {
563 client_id: req.client_id,
564 metrics: req.metrics,
565 duration_ms: req.duration_ms,
566 output_samples_to_syslog: req.output_samples_to_syslog,
567 output_stats_to_syslog: req.output_stats_to_syslog,
568
569 responder: RecorderStartLoggingResponder {
570 control_handle: std::mem::ManuallyDrop::new(control_handle),
571 tx_id: header.tx_id,
572 },
573 })
574 }
575 0x37b2675fdc61ff94 => {
576 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
577 let mut req = fidl::new_empty!(
578 RecorderStartLoggingForeverRequest,
579 fidl::encoding::DefaultFuchsiaResourceDialect
580 );
581 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RecorderStartLoggingForeverRequest>(&header, _body_bytes, handles, &mut req)?;
582 let control_handle = RecorderControlHandle { inner: this.inner.clone() };
583 Ok(RecorderRequest::StartLoggingForever {
584 client_id: req.client_id,
585 metrics: req.metrics,
586 output_samples_to_syslog: req.output_samples_to_syslog,
587 output_stats_to_syslog: req.output_stats_to_syslog,
588
589 responder: RecorderStartLoggingForeverResponder {
590 control_handle: std::mem::ManuallyDrop::new(control_handle),
591 tx_id: header.tx_id,
592 },
593 })
594 }
595 0x615d67a4d94d4732 => {
596 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
597 let mut req = fidl::new_empty!(
598 RecorderStopLoggingRequest,
599 fidl::encoding::DefaultFuchsiaResourceDialect
600 );
601 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RecorderStopLoggingRequest>(&header, _body_bytes, handles, &mut req)?;
602 let control_handle = RecorderControlHandle { inner: this.inner.clone() };
603 Ok(RecorderRequest::StopLogging {
604 client_id: req.client_id,
605
606 responder: RecorderStopLoggingResponder {
607 control_handle: std::mem::ManuallyDrop::new(control_handle),
608 tx_id: header.tx_id,
609 },
610 })
611 }
612 _ => Err(fidl::Error::UnknownOrdinal {
613 ordinal: header.ordinal,
614 protocol_name:
615 <RecorderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
616 }),
617 }))
618 },
619 )
620 }
621}
622
623#[derive(Debug)]
625pub enum RecorderRequest {
626 StartLogging {
647 client_id: String,
648 metrics: Vec<Metric>,
649 duration_ms: u32,
650 output_samples_to_syslog: bool,
651 output_stats_to_syslog: bool,
652 responder: RecorderStartLoggingResponder,
653 },
654 StartLoggingForever {
670 client_id: String,
671 metrics: Vec<Metric>,
672 output_samples_to_syslog: bool,
673 output_stats_to_syslog: bool,
674 responder: RecorderStartLoggingForeverResponder,
675 },
676 StopLogging { client_id: String, responder: RecorderStopLoggingResponder },
683}
684
685impl RecorderRequest {
686 #[allow(irrefutable_let_patterns)]
687 pub fn into_start_logging(
688 self,
689 ) -> Option<(String, Vec<Metric>, u32, bool, bool, RecorderStartLoggingResponder)> {
690 if let RecorderRequest::StartLogging {
691 client_id,
692 metrics,
693 duration_ms,
694 output_samples_to_syslog,
695 output_stats_to_syslog,
696 responder,
697 } = self
698 {
699 Some((
700 client_id,
701 metrics,
702 duration_ms,
703 output_samples_to_syslog,
704 output_stats_to_syslog,
705 responder,
706 ))
707 } else {
708 None
709 }
710 }
711
712 #[allow(irrefutable_let_patterns)]
713 pub fn into_start_logging_forever(
714 self,
715 ) -> Option<(String, Vec<Metric>, bool, bool, RecorderStartLoggingForeverResponder)> {
716 if let RecorderRequest::StartLoggingForever {
717 client_id,
718 metrics,
719 output_samples_to_syslog,
720 output_stats_to_syslog,
721 responder,
722 } = self
723 {
724 Some((client_id, metrics, output_samples_to_syslog, output_stats_to_syslog, responder))
725 } else {
726 None
727 }
728 }
729
730 #[allow(irrefutable_let_patterns)]
731 pub fn into_stop_logging(self) -> Option<(String, RecorderStopLoggingResponder)> {
732 if let RecorderRequest::StopLogging { client_id, responder } = self {
733 Some((client_id, responder))
734 } else {
735 None
736 }
737 }
738
739 pub fn method_name(&self) -> &'static str {
741 match *self {
742 RecorderRequest::StartLogging { .. } => "start_logging",
743 RecorderRequest::StartLoggingForever { .. } => "start_logging_forever",
744 RecorderRequest::StopLogging { .. } => "stop_logging",
745 }
746 }
747}
748
749#[derive(Debug, Clone)]
750pub struct RecorderControlHandle {
751 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
752}
753
754impl fidl::endpoints::ControlHandle for RecorderControlHandle {
755 fn shutdown(&self) {
756 self.inner.shutdown()
757 }
758
759 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
760 self.inner.shutdown_with_epitaph(status)
761 }
762
763 fn is_closed(&self) -> bool {
764 self.inner.channel().is_closed()
765 }
766 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
767 self.inner.channel().on_closed()
768 }
769
770 #[cfg(target_os = "fuchsia")]
771 fn signal_peer(
772 &self,
773 clear_mask: zx::Signals,
774 set_mask: zx::Signals,
775 ) -> Result<(), zx_status::Status> {
776 use fidl::Peered;
777 self.inner.channel().signal_peer(clear_mask, set_mask)
778 }
779}
780
781impl RecorderControlHandle {}
782
783#[must_use = "FIDL methods require a response to be sent"]
784#[derive(Debug)]
785pub struct RecorderStartLoggingResponder {
786 control_handle: std::mem::ManuallyDrop<RecorderControlHandle>,
787 tx_id: u32,
788}
789
790impl std::ops::Drop for RecorderStartLoggingResponder {
794 fn drop(&mut self) {
795 self.control_handle.shutdown();
796 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
798 }
799}
800
801impl fidl::endpoints::Responder for RecorderStartLoggingResponder {
802 type ControlHandle = RecorderControlHandle;
803
804 fn control_handle(&self) -> &RecorderControlHandle {
805 &self.control_handle
806 }
807
808 fn drop_without_shutdown(mut self) {
809 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
811 std::mem::forget(self);
813 }
814}
815
816impl RecorderStartLoggingResponder {
817 pub fn send(self, mut result: Result<(), RecorderError>) -> Result<(), fidl::Error> {
821 let _result = self.send_raw(result);
822 if _result.is_err() {
823 self.control_handle.shutdown();
824 }
825 self.drop_without_shutdown();
826 _result
827 }
828
829 pub fn send_no_shutdown_on_err(
831 self,
832 mut result: Result<(), RecorderError>,
833 ) -> Result<(), fidl::Error> {
834 let _result = self.send_raw(result);
835 self.drop_without_shutdown();
836 _result
837 }
838
839 fn send_raw(&self, mut result: Result<(), RecorderError>) -> Result<(), fidl::Error> {
840 self.control_handle.inner.send::<fidl::encoding::ResultType<
841 fidl::encoding::EmptyStruct,
842 RecorderError,
843 >>(
844 result,
845 self.tx_id,
846 0x40e4e1a9c6c42bd2,
847 fidl::encoding::DynamicFlags::empty(),
848 )
849 }
850}
851
852#[must_use = "FIDL methods require a response to be sent"]
853#[derive(Debug)]
854pub struct RecorderStartLoggingForeverResponder {
855 control_handle: std::mem::ManuallyDrop<RecorderControlHandle>,
856 tx_id: u32,
857}
858
859impl std::ops::Drop for RecorderStartLoggingForeverResponder {
863 fn drop(&mut self) {
864 self.control_handle.shutdown();
865 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
867 }
868}
869
870impl fidl::endpoints::Responder for RecorderStartLoggingForeverResponder {
871 type ControlHandle = RecorderControlHandle;
872
873 fn control_handle(&self) -> &RecorderControlHandle {
874 &self.control_handle
875 }
876
877 fn drop_without_shutdown(mut self) {
878 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
880 std::mem::forget(self);
882 }
883}
884
885impl RecorderStartLoggingForeverResponder {
886 pub fn send(self, mut result: Result<(), RecorderError>) -> Result<(), fidl::Error> {
890 let _result = self.send_raw(result);
891 if _result.is_err() {
892 self.control_handle.shutdown();
893 }
894 self.drop_without_shutdown();
895 _result
896 }
897
898 pub fn send_no_shutdown_on_err(
900 self,
901 mut result: Result<(), RecorderError>,
902 ) -> Result<(), fidl::Error> {
903 let _result = self.send_raw(result);
904 self.drop_without_shutdown();
905 _result
906 }
907
908 fn send_raw(&self, mut result: Result<(), RecorderError>) -> Result<(), fidl::Error> {
909 self.control_handle.inner.send::<fidl::encoding::ResultType<
910 fidl::encoding::EmptyStruct,
911 RecorderError,
912 >>(
913 result,
914 self.tx_id,
915 0x37b2675fdc61ff94,
916 fidl::encoding::DynamicFlags::empty(),
917 )
918 }
919}
920
921#[must_use = "FIDL methods require a response to be sent"]
922#[derive(Debug)]
923pub struct RecorderStopLoggingResponder {
924 control_handle: std::mem::ManuallyDrop<RecorderControlHandle>,
925 tx_id: u32,
926}
927
928impl std::ops::Drop for RecorderStopLoggingResponder {
932 fn drop(&mut self) {
933 self.control_handle.shutdown();
934 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
936 }
937}
938
939impl fidl::endpoints::Responder for RecorderStopLoggingResponder {
940 type ControlHandle = RecorderControlHandle;
941
942 fn control_handle(&self) -> &RecorderControlHandle {
943 &self.control_handle
944 }
945
946 fn drop_without_shutdown(mut self) {
947 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
949 std::mem::forget(self);
951 }
952}
953
954impl RecorderStopLoggingResponder {
955 pub fn send(self, mut stopped: bool) -> Result<(), fidl::Error> {
959 let _result = self.send_raw(stopped);
960 if _result.is_err() {
961 self.control_handle.shutdown();
962 }
963 self.drop_without_shutdown();
964 _result
965 }
966
967 pub fn send_no_shutdown_on_err(self, mut stopped: bool) -> Result<(), fidl::Error> {
969 let _result = self.send_raw(stopped);
970 self.drop_without_shutdown();
971 _result
972 }
973
974 fn send_raw(&self, mut stopped: bool) -> Result<(), fidl::Error> {
975 self.control_handle.inner.send::<RecorderStopLoggingResponse>(
976 (stopped,),
977 self.tx_id,
978 0x615d67a4d94d4732,
979 fidl::encoding::DynamicFlags::empty(),
980 )
981 }
982}
983
984mod internal {
985 use super::*;
986}