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_tracing_controller__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ProvisionerInitializeTracingRequest {
16 pub controller: fidl::endpoints::ServerEnd<SessionMarker>,
17 pub config: TraceConfig,
18 pub output: fidl::Socket,
19}
20
21impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
22 for ProvisionerInitializeTracingRequest
23{
24}
25
26#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27pub struct SessionManagerEndTraceSessionRequest {
28 pub task_id: u64,
29 pub output: fidl::Socket,
30}
31
32impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
33 for SessionManagerEndTraceSessionRequest
34{
35}
36
37#[derive(Debug, PartialEq)]
38pub struct SessionManagerStartTraceSessionOnBootRequest {
39 pub config: TraceConfig,
40 pub options: TraceOptions,
41}
42
43impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
44 for SessionManagerStartTraceSessionOnBootRequest
45{
46}
47
48#[derive(Debug, PartialEq)]
49pub struct SessionManagerStartTraceSessionRequest {
50 pub config: TraceConfig,
51 pub options: TraceOptions,
52}
53
54impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
55 for SessionManagerStartTraceSessionRequest
56{
57}
58
59#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
60pub struct ProvisionerMarker;
61
62impl fidl::endpoints::ProtocolMarker for ProvisionerMarker {
63 type Proxy = ProvisionerProxy;
64 type RequestStream = ProvisionerRequestStream;
65 #[cfg(target_os = "fuchsia")]
66 type SynchronousProxy = ProvisionerSynchronousProxy;
67
68 const DEBUG_NAME: &'static str = "fuchsia.tracing.controller.Provisioner";
69}
70impl fidl::endpoints::DiscoverableProtocolMarker for ProvisionerMarker {}
71
72pub trait ProvisionerProxyInterface: Send + Sync {
73 fn r#initialize_tracing(
74 &self,
75 controller: fidl::endpoints::ServerEnd<SessionMarker>,
76 config: &TraceConfig,
77 output: fidl::Socket,
78 ) -> Result<(), fidl::Error>;
79 type GetProvidersResponseFut: std::future::Future<Output = Result<Vec<ProviderInfo>, fidl::Error>>
80 + Send;
81 fn r#get_providers(&self) -> Self::GetProvidersResponseFut;
82 type GetKnownCategoriesResponseFut: std::future::Future<Output = Result<Vec<fidl_fuchsia_tracing::KnownCategory>, fidl::Error>>
83 + Send;
84 fn r#get_known_categories(&self) -> Self::GetKnownCategoriesResponseFut;
85}
86#[derive(Debug)]
87#[cfg(target_os = "fuchsia")]
88pub struct ProvisionerSynchronousProxy {
89 client: fidl::client::sync::Client,
90}
91
92#[cfg(target_os = "fuchsia")]
93impl fidl::endpoints::SynchronousProxy for ProvisionerSynchronousProxy {
94 type Proxy = ProvisionerProxy;
95 type Protocol = ProvisionerMarker;
96
97 fn from_channel(inner: fidl::Channel) -> Self {
98 Self::new(inner)
99 }
100
101 fn into_channel(self) -> fidl::Channel {
102 self.client.into_channel()
103 }
104
105 fn as_channel(&self) -> &fidl::Channel {
106 self.client.as_channel()
107 }
108}
109
110#[cfg(target_os = "fuchsia")]
111impl ProvisionerSynchronousProxy {
112 pub fn new(channel: fidl::Channel) -> Self {
113 Self { client: fidl::client::sync::Client::new(channel) }
114 }
115
116 pub fn into_channel(self) -> fidl::Channel {
117 self.client.into_channel()
118 }
119
120 pub fn wait_for_event(
123 &self,
124 deadline: zx::MonotonicInstant,
125 ) -> Result<ProvisionerEvent, fidl::Error> {
126 ProvisionerEvent::decode(self.client.wait_for_event::<ProvisionerMarker>(deadline)?)
127 }
128
129 pub fn r#initialize_tracing(
140 &self,
141 mut controller: fidl::endpoints::ServerEnd<SessionMarker>,
142 mut config: &TraceConfig,
143 mut output: fidl::Socket,
144 ) -> Result<(), fidl::Error> {
145 self.client.send::<ProvisionerInitializeTracingRequest>(
146 (controller, config, output),
147 0x3b046ed3a0684ab8,
148 fidl::encoding::DynamicFlags::FLEXIBLE,
149 )
150 }
151
152 pub fn r#get_providers(
154 &self,
155 ___deadline: zx::MonotonicInstant,
156 ) -> Result<Vec<ProviderInfo>, fidl::Error> {
157 let _response = self.client.send_query::<
158 fidl::encoding::EmptyPayload,
159 fidl::encoding::FlexibleType<ProvisionerGetProvidersResponse>,
160 ProvisionerMarker,
161 >(
162 (),
163 0xc4d4f36edc50d43,
164 fidl::encoding::DynamicFlags::FLEXIBLE,
165 ___deadline,
166 )?
167 .into_result::<ProvisionerMarker>("get_providers")?;
168 Ok(_response.providers)
169 }
170
171 pub fn r#get_known_categories(
172 &self,
173 ___deadline: zx::MonotonicInstant,
174 ) -> Result<Vec<fidl_fuchsia_tracing::KnownCategory>, fidl::Error> {
175 let _response = self.client.send_query::<
176 fidl::encoding::EmptyPayload,
177 fidl::encoding::FlexibleType<ProvisionerGetKnownCategoriesResponse>,
178 ProvisionerMarker,
179 >(
180 (),
181 0x41ef99397b945a4,
182 fidl::encoding::DynamicFlags::FLEXIBLE,
183 ___deadline,
184 )?
185 .into_result::<ProvisionerMarker>("get_known_categories")?;
186 Ok(_response.categories)
187 }
188}
189
190#[cfg(target_os = "fuchsia")]
191impl From<ProvisionerSynchronousProxy> for zx::NullableHandle {
192 fn from(value: ProvisionerSynchronousProxy) -> Self {
193 value.into_channel().into()
194 }
195}
196
197#[cfg(target_os = "fuchsia")]
198impl From<fidl::Channel> for ProvisionerSynchronousProxy {
199 fn from(value: fidl::Channel) -> Self {
200 Self::new(value)
201 }
202}
203
204#[cfg(target_os = "fuchsia")]
205impl fidl::endpoints::FromClient for ProvisionerSynchronousProxy {
206 type Protocol = ProvisionerMarker;
207
208 fn from_client(value: fidl::endpoints::ClientEnd<ProvisionerMarker>) -> Self {
209 Self::new(value.into_channel())
210 }
211}
212
213#[derive(Debug, Clone)]
214pub struct ProvisionerProxy {
215 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
216}
217
218impl fidl::endpoints::Proxy for ProvisionerProxy {
219 type Protocol = ProvisionerMarker;
220
221 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
222 Self::new(inner)
223 }
224
225 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
226 self.client.into_channel().map_err(|client| Self { client })
227 }
228
229 fn as_channel(&self) -> &::fidl::AsyncChannel {
230 self.client.as_channel()
231 }
232}
233
234impl ProvisionerProxy {
235 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
237 let protocol_name = <ProvisionerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
238 Self { client: fidl::client::Client::new(channel, protocol_name) }
239 }
240
241 pub fn take_event_stream(&self) -> ProvisionerEventStream {
247 ProvisionerEventStream { event_receiver: self.client.take_event_receiver() }
248 }
249
250 pub fn r#initialize_tracing(
261 &self,
262 mut controller: fidl::endpoints::ServerEnd<SessionMarker>,
263 mut config: &TraceConfig,
264 mut output: fidl::Socket,
265 ) -> Result<(), fidl::Error> {
266 ProvisionerProxyInterface::r#initialize_tracing(self, controller, config, output)
267 }
268
269 pub fn r#get_providers(
271 &self,
272 ) -> fidl::client::QueryResponseFut<
273 Vec<ProviderInfo>,
274 fidl::encoding::DefaultFuchsiaResourceDialect,
275 > {
276 ProvisionerProxyInterface::r#get_providers(self)
277 }
278
279 pub fn r#get_known_categories(
280 &self,
281 ) -> fidl::client::QueryResponseFut<
282 Vec<fidl_fuchsia_tracing::KnownCategory>,
283 fidl::encoding::DefaultFuchsiaResourceDialect,
284 > {
285 ProvisionerProxyInterface::r#get_known_categories(self)
286 }
287}
288
289impl ProvisionerProxyInterface for ProvisionerProxy {
290 fn r#initialize_tracing(
291 &self,
292 mut controller: fidl::endpoints::ServerEnd<SessionMarker>,
293 mut config: &TraceConfig,
294 mut output: fidl::Socket,
295 ) -> Result<(), fidl::Error> {
296 self.client.send::<ProvisionerInitializeTracingRequest>(
297 (controller, config, output),
298 0x3b046ed3a0684ab8,
299 fidl::encoding::DynamicFlags::FLEXIBLE,
300 )
301 }
302
303 type GetProvidersResponseFut = fidl::client::QueryResponseFut<
304 Vec<ProviderInfo>,
305 fidl::encoding::DefaultFuchsiaResourceDialect,
306 >;
307 fn r#get_providers(&self) -> Self::GetProvidersResponseFut {
308 fn _decode(
309 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
310 ) -> Result<Vec<ProviderInfo>, fidl::Error> {
311 let _response = fidl::client::decode_transaction_body::<
312 fidl::encoding::FlexibleType<ProvisionerGetProvidersResponse>,
313 fidl::encoding::DefaultFuchsiaResourceDialect,
314 0xc4d4f36edc50d43,
315 >(_buf?)?
316 .into_result::<ProvisionerMarker>("get_providers")?;
317 Ok(_response.providers)
318 }
319 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<ProviderInfo>>(
320 (),
321 0xc4d4f36edc50d43,
322 fidl::encoding::DynamicFlags::FLEXIBLE,
323 _decode,
324 )
325 }
326
327 type GetKnownCategoriesResponseFut = fidl::client::QueryResponseFut<
328 Vec<fidl_fuchsia_tracing::KnownCategory>,
329 fidl::encoding::DefaultFuchsiaResourceDialect,
330 >;
331 fn r#get_known_categories(&self) -> Self::GetKnownCategoriesResponseFut {
332 fn _decode(
333 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
334 ) -> Result<Vec<fidl_fuchsia_tracing::KnownCategory>, fidl::Error> {
335 let _response = fidl::client::decode_transaction_body::<
336 fidl::encoding::FlexibleType<ProvisionerGetKnownCategoriesResponse>,
337 fidl::encoding::DefaultFuchsiaResourceDialect,
338 0x41ef99397b945a4,
339 >(_buf?)?
340 .into_result::<ProvisionerMarker>("get_known_categories")?;
341 Ok(_response.categories)
342 }
343 self.client.send_query_and_decode::<
344 fidl::encoding::EmptyPayload,
345 Vec<fidl_fuchsia_tracing::KnownCategory>,
346 >(
347 (),
348 0x41ef99397b945a4,
349 fidl::encoding::DynamicFlags::FLEXIBLE,
350 _decode,
351 )
352 }
353}
354
355pub struct ProvisionerEventStream {
356 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
357}
358
359impl std::marker::Unpin for ProvisionerEventStream {}
360
361impl futures::stream::FusedStream for ProvisionerEventStream {
362 fn is_terminated(&self) -> bool {
363 self.event_receiver.is_terminated()
364 }
365}
366
367impl futures::Stream for ProvisionerEventStream {
368 type Item = Result<ProvisionerEvent, fidl::Error>;
369
370 fn poll_next(
371 mut self: std::pin::Pin<&mut Self>,
372 cx: &mut std::task::Context<'_>,
373 ) -> std::task::Poll<Option<Self::Item>> {
374 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
375 &mut self.event_receiver,
376 cx
377 )?) {
378 Some(buf) => std::task::Poll::Ready(Some(ProvisionerEvent::decode(buf))),
379 None => std::task::Poll::Ready(None),
380 }
381 }
382}
383
384#[derive(Debug)]
385pub enum ProvisionerEvent {
386 #[non_exhaustive]
387 _UnknownEvent {
388 ordinal: u64,
390 },
391}
392
393impl ProvisionerEvent {
394 fn decode(
396 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
397 ) -> Result<ProvisionerEvent, fidl::Error> {
398 let (bytes, _handles) = buf.split_mut();
399 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
400 debug_assert_eq!(tx_header.tx_id, 0);
401 match tx_header.ordinal {
402 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
403 Ok(ProvisionerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
404 }
405 _ => Err(fidl::Error::UnknownOrdinal {
406 ordinal: tx_header.ordinal,
407 protocol_name: <ProvisionerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
408 }),
409 }
410 }
411}
412
413pub struct ProvisionerRequestStream {
415 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
416 is_terminated: bool,
417}
418
419impl std::marker::Unpin for ProvisionerRequestStream {}
420
421impl futures::stream::FusedStream for ProvisionerRequestStream {
422 fn is_terminated(&self) -> bool {
423 self.is_terminated
424 }
425}
426
427impl fidl::endpoints::RequestStream for ProvisionerRequestStream {
428 type Protocol = ProvisionerMarker;
429 type ControlHandle = ProvisionerControlHandle;
430
431 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
432 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
433 }
434
435 fn control_handle(&self) -> Self::ControlHandle {
436 ProvisionerControlHandle { inner: self.inner.clone() }
437 }
438
439 fn into_inner(
440 self,
441 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
442 {
443 (self.inner, self.is_terminated)
444 }
445
446 fn from_inner(
447 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
448 is_terminated: bool,
449 ) -> Self {
450 Self { inner, is_terminated }
451 }
452}
453
454impl futures::Stream for ProvisionerRequestStream {
455 type Item = Result<ProvisionerRequest, fidl::Error>;
456
457 fn poll_next(
458 mut self: std::pin::Pin<&mut Self>,
459 cx: &mut std::task::Context<'_>,
460 ) -> std::task::Poll<Option<Self::Item>> {
461 let this = &mut *self;
462 if this.inner.check_shutdown(cx) {
463 this.is_terminated = true;
464 return std::task::Poll::Ready(None);
465 }
466 if this.is_terminated {
467 panic!("polled ProvisionerRequestStream after completion");
468 }
469 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
470 |bytes, handles| {
471 match this.inner.channel().read_etc(cx, bytes, handles) {
472 std::task::Poll::Ready(Ok(())) => {}
473 std::task::Poll::Pending => return std::task::Poll::Pending,
474 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
475 this.is_terminated = true;
476 return std::task::Poll::Ready(None);
477 }
478 std::task::Poll::Ready(Err(e)) => {
479 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
480 e.into(),
481 ))));
482 }
483 }
484
485 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
487
488 std::task::Poll::Ready(Some(match header.ordinal {
489 0x3b046ed3a0684ab8 => {
490 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
491 let mut req = fidl::new_empty!(
492 ProvisionerInitializeTracingRequest,
493 fidl::encoding::DefaultFuchsiaResourceDialect
494 );
495 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProvisionerInitializeTracingRequest>(&header, _body_bytes, handles, &mut req)?;
496 let control_handle = ProvisionerControlHandle { inner: this.inner.clone() };
497 Ok(ProvisionerRequest::InitializeTracing {
498 controller: req.controller,
499 config: req.config,
500 output: req.output,
501
502 control_handle,
503 })
504 }
505 0xc4d4f36edc50d43 => {
506 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
507 let mut req = fidl::new_empty!(
508 fidl::encoding::EmptyPayload,
509 fidl::encoding::DefaultFuchsiaResourceDialect
510 );
511 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
512 let control_handle = ProvisionerControlHandle { inner: this.inner.clone() };
513 Ok(ProvisionerRequest::GetProviders {
514 responder: ProvisionerGetProvidersResponder {
515 control_handle: std::mem::ManuallyDrop::new(control_handle),
516 tx_id: header.tx_id,
517 },
518 })
519 }
520 0x41ef99397b945a4 => {
521 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
522 let mut req = fidl::new_empty!(
523 fidl::encoding::EmptyPayload,
524 fidl::encoding::DefaultFuchsiaResourceDialect
525 );
526 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
527 let control_handle = ProvisionerControlHandle { inner: this.inner.clone() };
528 Ok(ProvisionerRequest::GetKnownCategories {
529 responder: ProvisionerGetKnownCategoriesResponder {
530 control_handle: std::mem::ManuallyDrop::new(control_handle),
531 tx_id: header.tx_id,
532 },
533 })
534 }
535 _ if header.tx_id == 0
536 && header
537 .dynamic_flags()
538 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
539 {
540 Ok(ProvisionerRequest::_UnknownMethod {
541 ordinal: header.ordinal,
542 control_handle: ProvisionerControlHandle { inner: this.inner.clone() },
543 method_type: fidl::MethodType::OneWay,
544 })
545 }
546 _ if header
547 .dynamic_flags()
548 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
549 {
550 this.inner.send_framework_err(
551 fidl::encoding::FrameworkErr::UnknownMethod,
552 header.tx_id,
553 header.ordinal,
554 header.dynamic_flags(),
555 (bytes, handles),
556 )?;
557 Ok(ProvisionerRequest::_UnknownMethod {
558 ordinal: header.ordinal,
559 control_handle: ProvisionerControlHandle { inner: this.inner.clone() },
560 method_type: fidl::MethodType::TwoWay,
561 })
562 }
563 _ => Err(fidl::Error::UnknownOrdinal {
564 ordinal: header.ordinal,
565 protocol_name:
566 <ProvisionerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
567 }),
568 }))
569 },
570 )
571 }
572}
573
574#[derive(Debug)]
582pub enum ProvisionerRequest {
583 InitializeTracing {
594 controller: fidl::endpoints::ServerEnd<SessionMarker>,
595 config: TraceConfig,
596 output: fidl::Socket,
597 control_handle: ProvisionerControlHandle,
598 },
599 GetProviders {
601 responder: ProvisionerGetProvidersResponder,
602 },
603 GetKnownCategories {
604 responder: ProvisionerGetKnownCategoriesResponder,
605 },
606 #[non_exhaustive]
608 _UnknownMethod {
609 ordinal: u64,
611 control_handle: ProvisionerControlHandle,
612 method_type: fidl::MethodType,
613 },
614}
615
616impl ProvisionerRequest {
617 #[allow(irrefutable_let_patterns)]
618 pub fn into_initialize_tracing(
619 self,
620 ) -> Option<(
621 fidl::endpoints::ServerEnd<SessionMarker>,
622 TraceConfig,
623 fidl::Socket,
624 ProvisionerControlHandle,
625 )> {
626 if let ProvisionerRequest::InitializeTracing {
627 controller,
628 config,
629 output,
630 control_handle,
631 } = self
632 {
633 Some((controller, config, output, control_handle))
634 } else {
635 None
636 }
637 }
638
639 #[allow(irrefutable_let_patterns)]
640 pub fn into_get_providers(self) -> Option<(ProvisionerGetProvidersResponder)> {
641 if let ProvisionerRequest::GetProviders { responder } = self {
642 Some((responder))
643 } else {
644 None
645 }
646 }
647
648 #[allow(irrefutable_let_patterns)]
649 pub fn into_get_known_categories(self) -> Option<(ProvisionerGetKnownCategoriesResponder)> {
650 if let ProvisionerRequest::GetKnownCategories { responder } = self {
651 Some((responder))
652 } else {
653 None
654 }
655 }
656
657 pub fn method_name(&self) -> &'static str {
659 match *self {
660 ProvisionerRequest::InitializeTracing { .. } => "initialize_tracing",
661 ProvisionerRequest::GetProviders { .. } => "get_providers",
662 ProvisionerRequest::GetKnownCategories { .. } => "get_known_categories",
663 ProvisionerRequest::_UnknownMethod {
664 method_type: fidl::MethodType::OneWay, ..
665 } => "unknown one-way method",
666 ProvisionerRequest::_UnknownMethod {
667 method_type: fidl::MethodType::TwoWay, ..
668 } => "unknown two-way method",
669 }
670 }
671}
672
673#[derive(Debug, Clone)]
674pub struct ProvisionerControlHandle {
675 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
676}
677
678impl fidl::endpoints::ControlHandle for ProvisionerControlHandle {
679 fn shutdown(&self) {
680 self.inner.shutdown()
681 }
682
683 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
684 self.inner.shutdown_with_epitaph(status)
685 }
686
687 fn is_closed(&self) -> bool {
688 self.inner.channel().is_closed()
689 }
690 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
691 self.inner.channel().on_closed()
692 }
693
694 #[cfg(target_os = "fuchsia")]
695 fn signal_peer(
696 &self,
697 clear_mask: zx::Signals,
698 set_mask: zx::Signals,
699 ) -> Result<(), zx_status::Status> {
700 use fidl::Peered;
701 self.inner.channel().signal_peer(clear_mask, set_mask)
702 }
703}
704
705impl ProvisionerControlHandle {}
706
707#[must_use = "FIDL methods require a response to be sent"]
708#[derive(Debug)]
709pub struct ProvisionerGetProvidersResponder {
710 control_handle: std::mem::ManuallyDrop<ProvisionerControlHandle>,
711 tx_id: u32,
712}
713
714impl std::ops::Drop for ProvisionerGetProvidersResponder {
718 fn drop(&mut self) {
719 self.control_handle.shutdown();
720 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
722 }
723}
724
725impl fidl::endpoints::Responder for ProvisionerGetProvidersResponder {
726 type ControlHandle = ProvisionerControlHandle;
727
728 fn control_handle(&self) -> &ProvisionerControlHandle {
729 &self.control_handle
730 }
731
732 fn drop_without_shutdown(mut self) {
733 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
735 std::mem::forget(self);
737 }
738}
739
740impl ProvisionerGetProvidersResponder {
741 pub fn send(self, mut providers: &[ProviderInfo]) -> Result<(), fidl::Error> {
745 let _result = self.send_raw(providers);
746 if _result.is_err() {
747 self.control_handle.shutdown();
748 }
749 self.drop_without_shutdown();
750 _result
751 }
752
753 pub fn send_no_shutdown_on_err(
755 self,
756 mut providers: &[ProviderInfo],
757 ) -> Result<(), fidl::Error> {
758 let _result = self.send_raw(providers);
759 self.drop_without_shutdown();
760 _result
761 }
762
763 fn send_raw(&self, mut providers: &[ProviderInfo]) -> Result<(), fidl::Error> {
764 self.control_handle
765 .inner
766 .send::<fidl::encoding::FlexibleType<ProvisionerGetProvidersResponse>>(
767 fidl::encoding::Flexible::new((providers,)),
768 self.tx_id,
769 0xc4d4f36edc50d43,
770 fidl::encoding::DynamicFlags::FLEXIBLE,
771 )
772 }
773}
774
775#[must_use = "FIDL methods require a response to be sent"]
776#[derive(Debug)]
777pub struct ProvisionerGetKnownCategoriesResponder {
778 control_handle: std::mem::ManuallyDrop<ProvisionerControlHandle>,
779 tx_id: u32,
780}
781
782impl std::ops::Drop for ProvisionerGetKnownCategoriesResponder {
786 fn drop(&mut self) {
787 self.control_handle.shutdown();
788 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
790 }
791}
792
793impl fidl::endpoints::Responder for ProvisionerGetKnownCategoriesResponder {
794 type ControlHandle = ProvisionerControlHandle;
795
796 fn control_handle(&self) -> &ProvisionerControlHandle {
797 &self.control_handle
798 }
799
800 fn drop_without_shutdown(mut self) {
801 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
803 std::mem::forget(self);
805 }
806}
807
808impl ProvisionerGetKnownCategoriesResponder {
809 pub fn send(
813 self,
814 mut categories: &[fidl_fuchsia_tracing::KnownCategory],
815 ) -> Result<(), fidl::Error> {
816 let _result = self.send_raw(categories);
817 if _result.is_err() {
818 self.control_handle.shutdown();
819 }
820 self.drop_without_shutdown();
821 _result
822 }
823
824 pub fn send_no_shutdown_on_err(
826 self,
827 mut categories: &[fidl_fuchsia_tracing::KnownCategory],
828 ) -> Result<(), fidl::Error> {
829 let _result = self.send_raw(categories);
830 self.drop_without_shutdown();
831 _result
832 }
833
834 fn send_raw(
835 &self,
836 mut categories: &[fidl_fuchsia_tracing::KnownCategory],
837 ) -> Result<(), fidl::Error> {
838 self.control_handle
839 .inner
840 .send::<fidl::encoding::FlexibleType<ProvisionerGetKnownCategoriesResponse>>(
841 fidl::encoding::Flexible::new((categories,)),
842 self.tx_id,
843 0x41ef99397b945a4,
844 fidl::encoding::DynamicFlags::FLEXIBLE,
845 )
846 }
847}
848
849#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
850pub struct SessionMarker;
851
852impl fidl::endpoints::ProtocolMarker for SessionMarker {
853 type Proxy = SessionProxy;
854 type RequestStream = SessionRequestStream;
855 #[cfg(target_os = "fuchsia")]
856 type SynchronousProxy = SessionSynchronousProxy;
857
858 const DEBUG_NAME: &'static str = "(anonymous) Session";
859}
860pub type SessionStartTracingResult = Result<(), StartError>;
861pub type SessionStopTracingResult = Result<StopResult, StopError>;
862pub type SessionFlushBuffersResult = Result<(), FlushError>;
863
864pub trait SessionProxyInterface: Send + Sync {
865 type StartTracingResponseFut: std::future::Future<Output = Result<SessionStartTracingResult, fidl::Error>>
866 + Send;
867 fn r#start_tracing(&self, payload: &StartOptions) -> Self::StartTracingResponseFut;
868 type StopTracingResponseFut: std::future::Future<Output = Result<SessionStopTracingResult, fidl::Error>>
869 + Send;
870 fn r#stop_tracing(&self, payload: &StopOptions) -> Self::StopTracingResponseFut;
871 type WatchAlertResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
872 fn r#watch_alert(&self) -> Self::WatchAlertResponseFut;
873 type FlushBuffersResponseFut: std::future::Future<Output = Result<SessionFlushBuffersResult, fidl::Error>>
874 + Send;
875 fn r#flush_buffers(&self) -> Self::FlushBuffersResponseFut;
876}
877#[derive(Debug)]
878#[cfg(target_os = "fuchsia")]
879pub struct SessionSynchronousProxy {
880 client: fidl::client::sync::Client,
881}
882
883#[cfg(target_os = "fuchsia")]
884impl fidl::endpoints::SynchronousProxy for SessionSynchronousProxy {
885 type Proxy = SessionProxy;
886 type Protocol = SessionMarker;
887
888 fn from_channel(inner: fidl::Channel) -> Self {
889 Self::new(inner)
890 }
891
892 fn into_channel(self) -> fidl::Channel {
893 self.client.into_channel()
894 }
895
896 fn as_channel(&self) -> &fidl::Channel {
897 self.client.as_channel()
898 }
899}
900
901#[cfg(target_os = "fuchsia")]
902impl SessionSynchronousProxy {
903 pub fn new(channel: fidl::Channel) -> Self {
904 Self { client: fidl::client::sync::Client::new(channel) }
905 }
906
907 pub fn into_channel(self) -> fidl::Channel {
908 self.client.into_channel()
909 }
910
911 pub fn wait_for_event(
914 &self,
915 deadline: zx::MonotonicInstant,
916 ) -> Result<SessionEvent, fidl::Error> {
917 SessionEvent::decode(self.client.wait_for_event::<SessionMarker>(deadline)?)
918 }
919
920 pub fn r#start_tracing(
932 &self,
933 mut payload: &StartOptions,
934 ___deadline: zx::MonotonicInstant,
935 ) -> Result<SessionStartTracingResult, fidl::Error> {
936 let _response = self.client.send_query::<
937 StartOptions,
938 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, StartError>,
939 SessionMarker,
940 >(
941 payload,
942 0xde9b6ccbe936631,
943 fidl::encoding::DynamicFlags::FLEXIBLE,
944 ___deadline,
945 )?
946 .into_result::<SessionMarker>("start_tracing")?;
947 Ok(_response.map(|x| x))
948 }
949
950 pub fn r#stop_tracing(
956 &self,
957 mut payload: &StopOptions,
958 ___deadline: zx::MonotonicInstant,
959 ) -> Result<SessionStopTracingResult, fidl::Error> {
960 let _response = self.client.send_query::<
961 StopOptions,
962 fidl::encoding::FlexibleResultType<StopResult, StopError>,
963 SessionMarker,
964 >(
965 payload,
966 0x50fefc9b3ff9b03a,
967 fidl::encoding::DynamicFlags::FLEXIBLE,
968 ___deadline,
969 )?
970 .into_result::<SessionMarker>("stop_tracing")?;
971 Ok(_response.map(|x| x))
972 }
973
974 pub fn r#watch_alert(&self, ___deadline: zx::MonotonicInstant) -> Result<String, fidl::Error> {
983 let _response = self.client.send_query::<
984 fidl::encoding::EmptyPayload,
985 fidl::encoding::FlexibleType<SessionWatchAlertResponse>,
986 SessionMarker,
987 >(
988 (),
989 0x1f1c080716d92276,
990 fidl::encoding::DynamicFlags::FLEXIBLE,
991 ___deadline,
992 )?
993 .into_result::<SessionMarker>("watch_alert")?;
994 Ok(_response.alert_name)
995 }
996
997 pub fn r#flush_buffers(
1007 &self,
1008 ___deadline: zx::MonotonicInstant,
1009 ) -> Result<SessionFlushBuffersResult, fidl::Error> {
1010 let _response = self.client.send_query::<
1011 fidl::encoding::EmptyPayload,
1012 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, FlushError>,
1013 SessionMarker,
1014 >(
1015 (),
1016 0x23d801809a99f102,
1017 fidl::encoding::DynamicFlags::FLEXIBLE,
1018 ___deadline,
1019 )?
1020 .into_result::<SessionMarker>("flush_buffers")?;
1021 Ok(_response.map(|x| x))
1022 }
1023}
1024
1025#[cfg(target_os = "fuchsia")]
1026impl From<SessionSynchronousProxy> for zx::NullableHandle {
1027 fn from(value: SessionSynchronousProxy) -> Self {
1028 value.into_channel().into()
1029 }
1030}
1031
1032#[cfg(target_os = "fuchsia")]
1033impl From<fidl::Channel> for SessionSynchronousProxy {
1034 fn from(value: fidl::Channel) -> Self {
1035 Self::new(value)
1036 }
1037}
1038
1039#[cfg(target_os = "fuchsia")]
1040impl fidl::endpoints::FromClient for SessionSynchronousProxy {
1041 type Protocol = SessionMarker;
1042
1043 fn from_client(value: fidl::endpoints::ClientEnd<SessionMarker>) -> Self {
1044 Self::new(value.into_channel())
1045 }
1046}
1047
1048#[derive(Debug, Clone)]
1049pub struct SessionProxy {
1050 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1051}
1052
1053impl fidl::endpoints::Proxy for SessionProxy {
1054 type Protocol = SessionMarker;
1055
1056 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1057 Self::new(inner)
1058 }
1059
1060 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1061 self.client.into_channel().map_err(|client| Self { client })
1062 }
1063
1064 fn as_channel(&self) -> &::fidl::AsyncChannel {
1065 self.client.as_channel()
1066 }
1067}
1068
1069impl SessionProxy {
1070 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1072 let protocol_name = <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1073 Self { client: fidl::client::Client::new(channel, protocol_name) }
1074 }
1075
1076 pub fn take_event_stream(&self) -> SessionEventStream {
1082 SessionEventStream { event_receiver: self.client.take_event_receiver() }
1083 }
1084
1085 pub fn r#start_tracing(
1097 &self,
1098 mut payload: &StartOptions,
1099 ) -> fidl::client::QueryResponseFut<
1100 SessionStartTracingResult,
1101 fidl::encoding::DefaultFuchsiaResourceDialect,
1102 > {
1103 SessionProxyInterface::r#start_tracing(self, payload)
1104 }
1105
1106 pub fn r#stop_tracing(
1112 &self,
1113 mut payload: &StopOptions,
1114 ) -> fidl::client::QueryResponseFut<
1115 SessionStopTracingResult,
1116 fidl::encoding::DefaultFuchsiaResourceDialect,
1117 > {
1118 SessionProxyInterface::r#stop_tracing(self, payload)
1119 }
1120
1121 pub fn r#watch_alert(
1130 &self,
1131 ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
1132 SessionProxyInterface::r#watch_alert(self)
1133 }
1134
1135 pub fn r#flush_buffers(
1145 &self,
1146 ) -> fidl::client::QueryResponseFut<
1147 SessionFlushBuffersResult,
1148 fidl::encoding::DefaultFuchsiaResourceDialect,
1149 > {
1150 SessionProxyInterface::r#flush_buffers(self)
1151 }
1152}
1153
1154impl SessionProxyInterface for SessionProxy {
1155 type StartTracingResponseFut = fidl::client::QueryResponseFut<
1156 SessionStartTracingResult,
1157 fidl::encoding::DefaultFuchsiaResourceDialect,
1158 >;
1159 fn r#start_tracing(&self, mut payload: &StartOptions) -> Self::StartTracingResponseFut {
1160 fn _decode(
1161 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1162 ) -> Result<SessionStartTracingResult, fidl::Error> {
1163 let _response = fidl::client::decode_transaction_body::<
1164 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, StartError>,
1165 fidl::encoding::DefaultFuchsiaResourceDialect,
1166 0xde9b6ccbe936631,
1167 >(_buf?)?
1168 .into_result::<SessionMarker>("start_tracing")?;
1169 Ok(_response.map(|x| x))
1170 }
1171 self.client.send_query_and_decode::<StartOptions, SessionStartTracingResult>(
1172 payload,
1173 0xde9b6ccbe936631,
1174 fidl::encoding::DynamicFlags::FLEXIBLE,
1175 _decode,
1176 )
1177 }
1178
1179 type StopTracingResponseFut = fidl::client::QueryResponseFut<
1180 SessionStopTracingResult,
1181 fidl::encoding::DefaultFuchsiaResourceDialect,
1182 >;
1183 fn r#stop_tracing(&self, mut payload: &StopOptions) -> Self::StopTracingResponseFut {
1184 fn _decode(
1185 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1186 ) -> Result<SessionStopTracingResult, fidl::Error> {
1187 let _response = fidl::client::decode_transaction_body::<
1188 fidl::encoding::FlexibleResultType<StopResult, StopError>,
1189 fidl::encoding::DefaultFuchsiaResourceDialect,
1190 0x50fefc9b3ff9b03a,
1191 >(_buf?)?
1192 .into_result::<SessionMarker>("stop_tracing")?;
1193 Ok(_response.map(|x| x))
1194 }
1195 self.client.send_query_and_decode::<StopOptions, SessionStopTracingResult>(
1196 payload,
1197 0x50fefc9b3ff9b03a,
1198 fidl::encoding::DynamicFlags::FLEXIBLE,
1199 _decode,
1200 )
1201 }
1202
1203 type WatchAlertResponseFut =
1204 fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
1205 fn r#watch_alert(&self) -> Self::WatchAlertResponseFut {
1206 fn _decode(
1207 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1208 ) -> Result<String, fidl::Error> {
1209 let _response = fidl::client::decode_transaction_body::<
1210 fidl::encoding::FlexibleType<SessionWatchAlertResponse>,
1211 fidl::encoding::DefaultFuchsiaResourceDialect,
1212 0x1f1c080716d92276,
1213 >(_buf?)?
1214 .into_result::<SessionMarker>("watch_alert")?;
1215 Ok(_response.alert_name)
1216 }
1217 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, String>(
1218 (),
1219 0x1f1c080716d92276,
1220 fidl::encoding::DynamicFlags::FLEXIBLE,
1221 _decode,
1222 )
1223 }
1224
1225 type FlushBuffersResponseFut = fidl::client::QueryResponseFut<
1226 SessionFlushBuffersResult,
1227 fidl::encoding::DefaultFuchsiaResourceDialect,
1228 >;
1229 fn r#flush_buffers(&self) -> Self::FlushBuffersResponseFut {
1230 fn _decode(
1231 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1232 ) -> Result<SessionFlushBuffersResult, fidl::Error> {
1233 let _response = fidl::client::decode_transaction_body::<
1234 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, FlushError>,
1235 fidl::encoding::DefaultFuchsiaResourceDialect,
1236 0x23d801809a99f102,
1237 >(_buf?)?
1238 .into_result::<SessionMarker>("flush_buffers")?;
1239 Ok(_response.map(|x| x))
1240 }
1241 self.client
1242 .send_query_and_decode::<fidl::encoding::EmptyPayload, SessionFlushBuffersResult>(
1243 (),
1244 0x23d801809a99f102,
1245 fidl::encoding::DynamicFlags::FLEXIBLE,
1246 _decode,
1247 )
1248 }
1249}
1250
1251pub struct SessionEventStream {
1252 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1253}
1254
1255impl std::marker::Unpin for SessionEventStream {}
1256
1257impl futures::stream::FusedStream for SessionEventStream {
1258 fn is_terminated(&self) -> bool {
1259 self.event_receiver.is_terminated()
1260 }
1261}
1262
1263impl futures::Stream for SessionEventStream {
1264 type Item = Result<SessionEvent, fidl::Error>;
1265
1266 fn poll_next(
1267 mut self: std::pin::Pin<&mut Self>,
1268 cx: &mut std::task::Context<'_>,
1269 ) -> std::task::Poll<Option<Self::Item>> {
1270 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1271 &mut self.event_receiver,
1272 cx
1273 )?) {
1274 Some(buf) => std::task::Poll::Ready(Some(SessionEvent::decode(buf))),
1275 None => std::task::Poll::Ready(None),
1276 }
1277 }
1278}
1279
1280#[derive(Debug)]
1281pub enum SessionEvent {
1282 OnSessionStateChange {
1283 state: SessionState,
1284 },
1285 #[non_exhaustive]
1286 _UnknownEvent {
1287 ordinal: u64,
1289 },
1290}
1291
1292impl SessionEvent {
1293 #[allow(irrefutable_let_patterns)]
1294 pub fn into_on_session_state_change(self) -> Option<SessionState> {
1295 if let SessionEvent::OnSessionStateChange { state } = self { Some((state)) } else { None }
1296 }
1297
1298 fn decode(
1300 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1301 ) -> Result<SessionEvent, fidl::Error> {
1302 let (bytes, _handles) = buf.split_mut();
1303 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1304 debug_assert_eq!(tx_header.tx_id, 0);
1305 match tx_header.ordinal {
1306 0x7ab1640718b971cd => {
1307 let mut out = fidl::new_empty!(
1308 SessionOnSessionStateChangeRequest,
1309 fidl::encoding::DefaultFuchsiaResourceDialect
1310 );
1311 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionOnSessionStateChangeRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1312 Ok((SessionEvent::OnSessionStateChange { state: out.state }))
1313 }
1314 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1315 Ok(SessionEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1316 }
1317 _ => Err(fidl::Error::UnknownOrdinal {
1318 ordinal: tx_header.ordinal,
1319 protocol_name: <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1320 }),
1321 }
1322 }
1323}
1324
1325pub struct SessionRequestStream {
1327 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1328 is_terminated: bool,
1329}
1330
1331impl std::marker::Unpin for SessionRequestStream {}
1332
1333impl futures::stream::FusedStream for SessionRequestStream {
1334 fn is_terminated(&self) -> bool {
1335 self.is_terminated
1336 }
1337}
1338
1339impl fidl::endpoints::RequestStream for SessionRequestStream {
1340 type Protocol = SessionMarker;
1341 type ControlHandle = SessionControlHandle;
1342
1343 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1344 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1345 }
1346
1347 fn control_handle(&self) -> Self::ControlHandle {
1348 SessionControlHandle { inner: self.inner.clone() }
1349 }
1350
1351 fn into_inner(
1352 self,
1353 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1354 {
1355 (self.inner, self.is_terminated)
1356 }
1357
1358 fn from_inner(
1359 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1360 is_terminated: bool,
1361 ) -> Self {
1362 Self { inner, is_terminated }
1363 }
1364}
1365
1366impl futures::Stream for SessionRequestStream {
1367 type Item = Result<SessionRequest, fidl::Error>;
1368
1369 fn poll_next(
1370 mut self: std::pin::Pin<&mut Self>,
1371 cx: &mut std::task::Context<'_>,
1372 ) -> std::task::Poll<Option<Self::Item>> {
1373 let this = &mut *self;
1374 if this.inner.check_shutdown(cx) {
1375 this.is_terminated = true;
1376 return std::task::Poll::Ready(None);
1377 }
1378 if this.is_terminated {
1379 panic!("polled SessionRequestStream after completion");
1380 }
1381 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1382 |bytes, handles| {
1383 match this.inner.channel().read_etc(cx, bytes, handles) {
1384 std::task::Poll::Ready(Ok(())) => {}
1385 std::task::Poll::Pending => return std::task::Poll::Pending,
1386 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1387 this.is_terminated = true;
1388 return std::task::Poll::Ready(None);
1389 }
1390 std::task::Poll::Ready(Err(e)) => {
1391 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1392 e.into(),
1393 ))));
1394 }
1395 }
1396
1397 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1399
1400 std::task::Poll::Ready(Some(match header.ordinal {
1401 0xde9b6ccbe936631 => {
1402 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1403 let mut req = fidl::new_empty!(
1404 StartOptions,
1405 fidl::encoding::DefaultFuchsiaResourceDialect
1406 );
1407 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StartOptions>(&header, _body_bytes, handles, &mut req)?;
1408 let control_handle = SessionControlHandle { inner: this.inner.clone() };
1409 Ok(SessionRequest::StartTracing {
1410 payload: req,
1411 responder: SessionStartTracingResponder {
1412 control_handle: std::mem::ManuallyDrop::new(control_handle),
1413 tx_id: header.tx_id,
1414 },
1415 })
1416 }
1417 0x50fefc9b3ff9b03a => {
1418 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1419 let mut req = fidl::new_empty!(
1420 StopOptions,
1421 fidl::encoding::DefaultFuchsiaResourceDialect
1422 );
1423 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StopOptions>(&header, _body_bytes, handles, &mut req)?;
1424 let control_handle = SessionControlHandle { inner: this.inner.clone() };
1425 Ok(SessionRequest::StopTracing {
1426 payload: req,
1427 responder: SessionStopTracingResponder {
1428 control_handle: std::mem::ManuallyDrop::new(control_handle),
1429 tx_id: header.tx_id,
1430 },
1431 })
1432 }
1433 0x1f1c080716d92276 => {
1434 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1435 let mut req = fidl::new_empty!(
1436 fidl::encoding::EmptyPayload,
1437 fidl::encoding::DefaultFuchsiaResourceDialect
1438 );
1439 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1440 let control_handle = SessionControlHandle { inner: this.inner.clone() };
1441 Ok(SessionRequest::WatchAlert {
1442 responder: SessionWatchAlertResponder {
1443 control_handle: std::mem::ManuallyDrop::new(control_handle),
1444 tx_id: header.tx_id,
1445 },
1446 })
1447 }
1448 0x23d801809a99f102 => {
1449 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1450 let mut req = fidl::new_empty!(
1451 fidl::encoding::EmptyPayload,
1452 fidl::encoding::DefaultFuchsiaResourceDialect
1453 );
1454 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1455 let control_handle = SessionControlHandle { inner: this.inner.clone() };
1456 Ok(SessionRequest::FlushBuffers {
1457 responder: SessionFlushBuffersResponder {
1458 control_handle: std::mem::ManuallyDrop::new(control_handle),
1459 tx_id: header.tx_id,
1460 },
1461 })
1462 }
1463 _ if header.tx_id == 0
1464 && header
1465 .dynamic_flags()
1466 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1467 {
1468 Ok(SessionRequest::_UnknownMethod {
1469 ordinal: header.ordinal,
1470 control_handle: SessionControlHandle { inner: this.inner.clone() },
1471 method_type: fidl::MethodType::OneWay,
1472 })
1473 }
1474 _ if header
1475 .dynamic_flags()
1476 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1477 {
1478 this.inner.send_framework_err(
1479 fidl::encoding::FrameworkErr::UnknownMethod,
1480 header.tx_id,
1481 header.ordinal,
1482 header.dynamic_flags(),
1483 (bytes, handles),
1484 )?;
1485 Ok(SessionRequest::_UnknownMethod {
1486 ordinal: header.ordinal,
1487 control_handle: SessionControlHandle { inner: this.inner.clone() },
1488 method_type: fidl::MethodType::TwoWay,
1489 })
1490 }
1491 _ => Err(fidl::Error::UnknownOrdinal {
1492 ordinal: header.ordinal,
1493 protocol_name:
1494 <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1495 }),
1496 }))
1497 },
1498 )
1499 }
1500}
1501
1502#[derive(Debug)]
1518pub enum SessionRequest {
1519 StartTracing { payload: StartOptions, responder: SessionStartTracingResponder },
1531 StopTracing { payload: StopOptions, responder: SessionStopTracingResponder },
1537 WatchAlert { responder: SessionWatchAlertResponder },
1546 FlushBuffers { responder: SessionFlushBuffersResponder },
1556 #[non_exhaustive]
1558 _UnknownMethod {
1559 ordinal: u64,
1561 control_handle: SessionControlHandle,
1562 method_type: fidl::MethodType,
1563 },
1564}
1565
1566impl SessionRequest {
1567 #[allow(irrefutable_let_patterns)]
1568 pub fn into_start_tracing(self) -> Option<(StartOptions, SessionStartTracingResponder)> {
1569 if let SessionRequest::StartTracing { payload, responder } = self {
1570 Some((payload, responder))
1571 } else {
1572 None
1573 }
1574 }
1575
1576 #[allow(irrefutable_let_patterns)]
1577 pub fn into_stop_tracing(self) -> Option<(StopOptions, SessionStopTracingResponder)> {
1578 if let SessionRequest::StopTracing { payload, responder } = self {
1579 Some((payload, responder))
1580 } else {
1581 None
1582 }
1583 }
1584
1585 #[allow(irrefutable_let_patterns)]
1586 pub fn into_watch_alert(self) -> Option<(SessionWatchAlertResponder)> {
1587 if let SessionRequest::WatchAlert { responder } = self { Some((responder)) } else { None }
1588 }
1589
1590 #[allow(irrefutable_let_patterns)]
1591 pub fn into_flush_buffers(self) -> Option<(SessionFlushBuffersResponder)> {
1592 if let SessionRequest::FlushBuffers { responder } = self { Some((responder)) } else { None }
1593 }
1594
1595 pub fn method_name(&self) -> &'static str {
1597 match *self {
1598 SessionRequest::StartTracing { .. } => "start_tracing",
1599 SessionRequest::StopTracing { .. } => "stop_tracing",
1600 SessionRequest::WatchAlert { .. } => "watch_alert",
1601 SessionRequest::FlushBuffers { .. } => "flush_buffers",
1602 SessionRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1603 "unknown one-way method"
1604 }
1605 SessionRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1606 "unknown two-way method"
1607 }
1608 }
1609 }
1610}
1611
1612#[derive(Debug, Clone)]
1613pub struct SessionControlHandle {
1614 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1615}
1616
1617impl fidl::endpoints::ControlHandle for SessionControlHandle {
1618 fn shutdown(&self) {
1619 self.inner.shutdown()
1620 }
1621
1622 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1623 self.inner.shutdown_with_epitaph(status)
1624 }
1625
1626 fn is_closed(&self) -> bool {
1627 self.inner.channel().is_closed()
1628 }
1629 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1630 self.inner.channel().on_closed()
1631 }
1632
1633 #[cfg(target_os = "fuchsia")]
1634 fn signal_peer(
1635 &self,
1636 clear_mask: zx::Signals,
1637 set_mask: zx::Signals,
1638 ) -> Result<(), zx_status::Status> {
1639 use fidl::Peered;
1640 self.inner.channel().signal_peer(clear_mask, set_mask)
1641 }
1642}
1643
1644impl SessionControlHandle {
1645 pub fn send_on_session_state_change(&self, mut state: SessionState) -> Result<(), fidl::Error> {
1646 self.inner.send::<SessionOnSessionStateChangeRequest>(
1647 (state,),
1648 0,
1649 0x7ab1640718b971cd,
1650 fidl::encoding::DynamicFlags::FLEXIBLE,
1651 )
1652 }
1653}
1654
1655#[must_use = "FIDL methods require a response to be sent"]
1656#[derive(Debug)]
1657pub struct SessionStartTracingResponder {
1658 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
1659 tx_id: u32,
1660}
1661
1662impl std::ops::Drop for SessionStartTracingResponder {
1666 fn drop(&mut self) {
1667 self.control_handle.shutdown();
1668 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1670 }
1671}
1672
1673impl fidl::endpoints::Responder for SessionStartTracingResponder {
1674 type ControlHandle = SessionControlHandle;
1675
1676 fn control_handle(&self) -> &SessionControlHandle {
1677 &self.control_handle
1678 }
1679
1680 fn drop_without_shutdown(mut self) {
1681 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1683 std::mem::forget(self);
1685 }
1686}
1687
1688impl SessionStartTracingResponder {
1689 pub fn send(self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
1693 let _result = self.send_raw(result);
1694 if _result.is_err() {
1695 self.control_handle.shutdown();
1696 }
1697 self.drop_without_shutdown();
1698 _result
1699 }
1700
1701 pub fn send_no_shutdown_on_err(
1703 self,
1704 mut result: Result<(), StartError>,
1705 ) -> Result<(), fidl::Error> {
1706 let _result = self.send_raw(result);
1707 self.drop_without_shutdown();
1708 _result
1709 }
1710
1711 fn send_raw(&self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
1712 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1713 fidl::encoding::EmptyStruct,
1714 StartError,
1715 >>(
1716 fidl::encoding::FlexibleResult::new(result),
1717 self.tx_id,
1718 0xde9b6ccbe936631,
1719 fidl::encoding::DynamicFlags::FLEXIBLE,
1720 )
1721 }
1722}
1723
1724#[must_use = "FIDL methods require a response to be sent"]
1725#[derive(Debug)]
1726pub struct SessionStopTracingResponder {
1727 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
1728 tx_id: u32,
1729}
1730
1731impl std::ops::Drop for SessionStopTracingResponder {
1735 fn drop(&mut self) {
1736 self.control_handle.shutdown();
1737 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1739 }
1740}
1741
1742impl fidl::endpoints::Responder for SessionStopTracingResponder {
1743 type ControlHandle = SessionControlHandle;
1744
1745 fn control_handle(&self) -> &SessionControlHandle {
1746 &self.control_handle
1747 }
1748
1749 fn drop_without_shutdown(mut self) {
1750 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1752 std::mem::forget(self);
1754 }
1755}
1756
1757impl SessionStopTracingResponder {
1758 pub fn send(self, mut result: Result<&StopResult, StopError>) -> Result<(), fidl::Error> {
1762 let _result = self.send_raw(result);
1763 if _result.is_err() {
1764 self.control_handle.shutdown();
1765 }
1766 self.drop_without_shutdown();
1767 _result
1768 }
1769
1770 pub fn send_no_shutdown_on_err(
1772 self,
1773 mut result: Result<&StopResult, StopError>,
1774 ) -> Result<(), fidl::Error> {
1775 let _result = self.send_raw(result);
1776 self.drop_without_shutdown();
1777 _result
1778 }
1779
1780 fn send_raw(&self, mut result: Result<&StopResult, StopError>) -> Result<(), fidl::Error> {
1781 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<StopResult, StopError>>(
1782 fidl::encoding::FlexibleResult::new(result),
1783 self.tx_id,
1784 0x50fefc9b3ff9b03a,
1785 fidl::encoding::DynamicFlags::FLEXIBLE,
1786 )
1787 }
1788}
1789
1790#[must_use = "FIDL methods require a response to be sent"]
1791#[derive(Debug)]
1792pub struct SessionWatchAlertResponder {
1793 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
1794 tx_id: u32,
1795}
1796
1797impl std::ops::Drop for SessionWatchAlertResponder {
1801 fn drop(&mut self) {
1802 self.control_handle.shutdown();
1803 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1805 }
1806}
1807
1808impl fidl::endpoints::Responder for SessionWatchAlertResponder {
1809 type ControlHandle = SessionControlHandle;
1810
1811 fn control_handle(&self) -> &SessionControlHandle {
1812 &self.control_handle
1813 }
1814
1815 fn drop_without_shutdown(mut self) {
1816 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1818 std::mem::forget(self);
1820 }
1821}
1822
1823impl SessionWatchAlertResponder {
1824 pub fn send(self, mut alert_name: &str) -> Result<(), fidl::Error> {
1828 let _result = self.send_raw(alert_name);
1829 if _result.is_err() {
1830 self.control_handle.shutdown();
1831 }
1832 self.drop_without_shutdown();
1833 _result
1834 }
1835
1836 pub fn send_no_shutdown_on_err(self, mut alert_name: &str) -> Result<(), fidl::Error> {
1838 let _result = self.send_raw(alert_name);
1839 self.drop_without_shutdown();
1840 _result
1841 }
1842
1843 fn send_raw(&self, mut alert_name: &str) -> Result<(), fidl::Error> {
1844 self.control_handle.inner.send::<fidl::encoding::FlexibleType<SessionWatchAlertResponse>>(
1845 fidl::encoding::Flexible::new((alert_name,)),
1846 self.tx_id,
1847 0x1f1c080716d92276,
1848 fidl::encoding::DynamicFlags::FLEXIBLE,
1849 )
1850 }
1851}
1852
1853#[must_use = "FIDL methods require a response to be sent"]
1854#[derive(Debug)]
1855pub struct SessionFlushBuffersResponder {
1856 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
1857 tx_id: u32,
1858}
1859
1860impl std::ops::Drop for SessionFlushBuffersResponder {
1864 fn drop(&mut self) {
1865 self.control_handle.shutdown();
1866 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1868 }
1869}
1870
1871impl fidl::endpoints::Responder for SessionFlushBuffersResponder {
1872 type ControlHandle = SessionControlHandle;
1873
1874 fn control_handle(&self) -> &SessionControlHandle {
1875 &self.control_handle
1876 }
1877
1878 fn drop_without_shutdown(mut self) {
1879 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1881 std::mem::forget(self);
1883 }
1884}
1885
1886impl SessionFlushBuffersResponder {
1887 pub fn send(self, mut result: Result<(), FlushError>) -> Result<(), fidl::Error> {
1891 let _result = self.send_raw(result);
1892 if _result.is_err() {
1893 self.control_handle.shutdown();
1894 }
1895 self.drop_without_shutdown();
1896 _result
1897 }
1898
1899 pub fn send_no_shutdown_on_err(
1901 self,
1902 mut result: Result<(), FlushError>,
1903 ) -> Result<(), fidl::Error> {
1904 let _result = self.send_raw(result);
1905 self.drop_without_shutdown();
1906 _result
1907 }
1908
1909 fn send_raw(&self, mut result: Result<(), FlushError>) -> Result<(), fidl::Error> {
1910 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1911 fidl::encoding::EmptyStruct,
1912 FlushError,
1913 >>(
1914 fidl::encoding::FlexibleResult::new(result),
1915 self.tx_id,
1916 0x23d801809a99f102,
1917 fidl::encoding::DynamicFlags::FLEXIBLE,
1918 )
1919 }
1920}
1921
1922#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1923pub struct SessionManagerMarker;
1924
1925impl fidl::endpoints::ProtocolMarker for SessionManagerMarker {
1926 type Proxy = SessionManagerProxy;
1927 type RequestStream = SessionManagerRequestStream;
1928 #[cfg(target_os = "fuchsia")]
1929 type SynchronousProxy = SessionManagerSynchronousProxy;
1930
1931 const DEBUG_NAME: &'static str = "fuchsia.tracing.controller.SessionManager";
1932}
1933impl fidl::endpoints::DiscoverableProtocolMarker for SessionManagerMarker {}
1934pub type SessionManagerStartTraceSessionResult = Result<u64, RecordingError>;
1935pub type SessionManagerStartTraceSessionOnBootResult = Result<(), RecordingError>;
1936pub type SessionManagerEndTraceSessionResult = Result<(TraceOptions, StopResult), RecordingError>;
1937pub type SessionManagerAbortTraceSessionResult = Result<(), RecordingError>;
1938pub type SessionManagerStatusResult = Result<TraceStatus, RecordingError>;
1939
1940pub trait SessionManagerProxyInterface: Send + Sync {
1941 type GetProvidersResponseFut: std::future::Future<Output = Result<Vec<ProviderInfo>, fidl::Error>>
1942 + Send;
1943 fn r#get_providers(&self) -> Self::GetProvidersResponseFut;
1944 type GetKnownCategoriesResponseFut: std::future::Future<Output = Result<Vec<fidl_fuchsia_tracing::KnownCategory>, fidl::Error>>
1945 + Send;
1946 fn r#get_known_categories(&self) -> Self::GetKnownCategoriesResponseFut;
1947 type StartTraceSessionResponseFut: std::future::Future<Output = Result<SessionManagerStartTraceSessionResult, fidl::Error>>
1948 + Send;
1949 fn r#start_trace_session(
1950 &self,
1951 config: &TraceConfig,
1952 options: &TraceOptions,
1953 ) -> Self::StartTraceSessionResponseFut;
1954 type StartTraceSessionOnBootResponseFut: std::future::Future<
1955 Output = Result<SessionManagerStartTraceSessionOnBootResult, fidl::Error>,
1956 > + Send;
1957 fn r#start_trace_session_on_boot(
1958 &self,
1959 config: &TraceConfig,
1960 options: &TraceOptions,
1961 ) -> Self::StartTraceSessionOnBootResponseFut;
1962 type EndTraceSessionResponseFut: std::future::Future<Output = Result<SessionManagerEndTraceSessionResult, fidl::Error>>
1963 + Send;
1964 fn r#end_trace_session(
1965 &self,
1966 task_id: u64,
1967 output: fidl::Socket,
1968 ) -> Self::EndTraceSessionResponseFut;
1969 type AbortTraceSessionResponseFut: std::future::Future<Output = Result<SessionManagerAbortTraceSessionResult, fidl::Error>>
1970 + Send;
1971 fn r#abort_trace_session(&self, task_id: u64) -> Self::AbortTraceSessionResponseFut;
1972 type StatusResponseFut: std::future::Future<Output = Result<SessionManagerStatusResult, fidl::Error>>
1973 + Send;
1974 fn r#status(&self) -> Self::StatusResponseFut;
1975}
1976#[derive(Debug)]
1977#[cfg(target_os = "fuchsia")]
1978pub struct SessionManagerSynchronousProxy {
1979 client: fidl::client::sync::Client,
1980}
1981
1982#[cfg(target_os = "fuchsia")]
1983impl fidl::endpoints::SynchronousProxy for SessionManagerSynchronousProxy {
1984 type Proxy = SessionManagerProxy;
1985 type Protocol = SessionManagerMarker;
1986
1987 fn from_channel(inner: fidl::Channel) -> Self {
1988 Self::new(inner)
1989 }
1990
1991 fn into_channel(self) -> fidl::Channel {
1992 self.client.into_channel()
1993 }
1994
1995 fn as_channel(&self) -> &fidl::Channel {
1996 self.client.as_channel()
1997 }
1998}
1999
2000#[cfg(target_os = "fuchsia")]
2001impl SessionManagerSynchronousProxy {
2002 pub fn new(channel: fidl::Channel) -> Self {
2003 Self { client: fidl::client::sync::Client::new(channel) }
2004 }
2005
2006 pub fn into_channel(self) -> fidl::Channel {
2007 self.client.into_channel()
2008 }
2009
2010 pub fn wait_for_event(
2013 &self,
2014 deadline: zx::MonotonicInstant,
2015 ) -> Result<SessionManagerEvent, fidl::Error> {
2016 SessionManagerEvent::decode(self.client.wait_for_event::<SessionManagerMarker>(deadline)?)
2017 }
2018
2019 pub fn r#get_providers(
2021 &self,
2022 ___deadline: zx::MonotonicInstant,
2023 ) -> Result<Vec<ProviderInfo>, fidl::Error> {
2024 let _response = self.client.send_query::<
2025 fidl::encoding::EmptyPayload,
2026 fidl::encoding::FlexibleType<SessionManagerGetProvidersResponse>,
2027 SessionManagerMarker,
2028 >(
2029 (),
2030 0x61bd49c4eb1fa03,
2031 fidl::encoding::DynamicFlags::FLEXIBLE,
2032 ___deadline,
2033 )?
2034 .into_result::<SessionManagerMarker>("get_providers")?;
2035 Ok(_response.providers)
2036 }
2037
2038 pub fn r#get_known_categories(
2040 &self,
2041 ___deadline: zx::MonotonicInstant,
2042 ) -> Result<Vec<fidl_fuchsia_tracing::KnownCategory>, fidl::Error> {
2043 let _response = self.client.send_query::<
2044 fidl::encoding::EmptyPayload,
2045 fidl::encoding::FlexibleType<SessionManagerGetKnownCategoriesResponse>,
2046 SessionManagerMarker,
2047 >(
2048 (),
2049 0x6f0abdb5401788b2,
2050 fidl::encoding::DynamicFlags::FLEXIBLE,
2051 ___deadline,
2052 )?
2053 .into_result::<SessionManagerMarker>("get_known_categories")?;
2054 Ok(_response.categories)
2055 }
2056
2057 pub fn r#start_trace_session(
2059 &self,
2060 mut config: &TraceConfig,
2061 mut options: &TraceOptions,
2062 ___deadline: zx::MonotonicInstant,
2063 ) -> Result<SessionManagerStartTraceSessionResult, fidl::Error> {
2064 let _response = self.client.send_query::<
2065 SessionManagerStartTraceSessionRequest,
2066 fidl::encoding::FlexibleResultType<SessionManagerStartTraceSessionResponse, RecordingError>,
2067 SessionManagerMarker,
2068 >(
2069 (config, options,),
2070 0x54c39e0c173c0162,
2071 fidl::encoding::DynamicFlags::FLEXIBLE,
2072 ___deadline,
2073 )?
2074 .into_result::<SessionManagerMarker>("start_trace_session")?;
2075 Ok(_response.map(|x| x.task_id))
2076 }
2077
2078 pub fn r#start_trace_session_on_boot(
2080 &self,
2081 mut config: &TraceConfig,
2082 mut options: &TraceOptions,
2083 ___deadline: zx::MonotonicInstant,
2084 ) -> Result<SessionManagerStartTraceSessionOnBootResult, fidl::Error> {
2085 let _response = self.client.send_query::<
2086 SessionManagerStartTraceSessionOnBootRequest,
2087 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, RecordingError>,
2088 SessionManagerMarker,
2089 >(
2090 (config, options,),
2091 0x705558b5612fbf62,
2092 fidl::encoding::DynamicFlags::FLEXIBLE,
2093 ___deadline,
2094 )?
2095 .into_result::<SessionManagerMarker>("start_trace_session_on_boot")?;
2096 Ok(_response.map(|x| x))
2097 }
2098
2099 pub fn r#end_trace_session(
2104 &self,
2105 mut task_id: u64,
2106 mut output: fidl::Socket,
2107 ___deadline: zx::MonotonicInstant,
2108 ) -> Result<SessionManagerEndTraceSessionResult, fidl::Error> {
2109 let _response = self
2110 .client
2111 .send_query::<SessionManagerEndTraceSessionRequest, fidl::encoding::FlexibleResultType<
2112 SessionManagerEndTraceSessionResponse,
2113 RecordingError,
2114 >, SessionManagerMarker>(
2115 (task_id, output),
2116 0x72d6ca80a0787577,
2117 fidl::encoding::DynamicFlags::FLEXIBLE,
2118 ___deadline,
2119 )?
2120 .into_result::<SessionManagerMarker>("end_trace_session")?;
2121 Ok(_response.map(|x| (x.options, x.result)))
2122 }
2123
2124 pub fn r#abort_trace_session(
2126 &self,
2127 mut task_id: u64,
2128 ___deadline: zx::MonotonicInstant,
2129 ) -> Result<SessionManagerAbortTraceSessionResult, fidl::Error> {
2130 let _response = self.client.send_query::<
2131 SessionManagerAbortTraceSessionRequest,
2132 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, RecordingError>,
2133 SessionManagerMarker,
2134 >(
2135 (task_id,),
2136 0x9a14550631bbc7c,
2137 fidl::encoding::DynamicFlags::FLEXIBLE,
2138 ___deadline,
2139 )?
2140 .into_result::<SessionManagerMarker>("abort_trace_session")?;
2141 Ok(_response.map(|x| x))
2142 }
2143
2144 pub fn r#status(
2146 &self,
2147 ___deadline: zx::MonotonicInstant,
2148 ) -> Result<SessionManagerStatusResult, fidl::Error> {
2149 let _response = self.client.send_query::<
2150 fidl::encoding::EmptyPayload,
2151 fidl::encoding::FlexibleResultType<TraceStatus, RecordingError>,
2152 SessionManagerMarker,
2153 >(
2154 (),
2155 0x2ebc198b7af59063,
2156 fidl::encoding::DynamicFlags::FLEXIBLE,
2157 ___deadline,
2158 )?
2159 .into_result::<SessionManagerMarker>("status")?;
2160 Ok(_response.map(|x| x))
2161 }
2162}
2163
2164#[cfg(target_os = "fuchsia")]
2165impl From<SessionManagerSynchronousProxy> for zx::NullableHandle {
2166 fn from(value: SessionManagerSynchronousProxy) -> Self {
2167 value.into_channel().into()
2168 }
2169}
2170
2171#[cfg(target_os = "fuchsia")]
2172impl From<fidl::Channel> for SessionManagerSynchronousProxy {
2173 fn from(value: fidl::Channel) -> Self {
2174 Self::new(value)
2175 }
2176}
2177
2178#[cfg(target_os = "fuchsia")]
2179impl fidl::endpoints::FromClient for SessionManagerSynchronousProxy {
2180 type Protocol = SessionManagerMarker;
2181
2182 fn from_client(value: fidl::endpoints::ClientEnd<SessionManagerMarker>) -> Self {
2183 Self::new(value.into_channel())
2184 }
2185}
2186
2187#[derive(Debug, Clone)]
2188pub struct SessionManagerProxy {
2189 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2190}
2191
2192impl fidl::endpoints::Proxy for SessionManagerProxy {
2193 type Protocol = SessionManagerMarker;
2194
2195 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2196 Self::new(inner)
2197 }
2198
2199 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2200 self.client.into_channel().map_err(|client| Self { client })
2201 }
2202
2203 fn as_channel(&self) -> &::fidl::AsyncChannel {
2204 self.client.as_channel()
2205 }
2206}
2207
2208impl SessionManagerProxy {
2209 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2211 let protocol_name = <SessionManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2212 Self { client: fidl::client::Client::new(channel, protocol_name) }
2213 }
2214
2215 pub fn take_event_stream(&self) -> SessionManagerEventStream {
2221 SessionManagerEventStream { event_receiver: self.client.take_event_receiver() }
2222 }
2223
2224 pub fn r#get_providers(
2226 &self,
2227 ) -> fidl::client::QueryResponseFut<
2228 Vec<ProviderInfo>,
2229 fidl::encoding::DefaultFuchsiaResourceDialect,
2230 > {
2231 SessionManagerProxyInterface::r#get_providers(self)
2232 }
2233
2234 pub fn r#get_known_categories(
2236 &self,
2237 ) -> fidl::client::QueryResponseFut<
2238 Vec<fidl_fuchsia_tracing::KnownCategory>,
2239 fidl::encoding::DefaultFuchsiaResourceDialect,
2240 > {
2241 SessionManagerProxyInterface::r#get_known_categories(self)
2242 }
2243
2244 pub fn r#start_trace_session(
2246 &self,
2247 mut config: &TraceConfig,
2248 mut options: &TraceOptions,
2249 ) -> fidl::client::QueryResponseFut<
2250 SessionManagerStartTraceSessionResult,
2251 fidl::encoding::DefaultFuchsiaResourceDialect,
2252 > {
2253 SessionManagerProxyInterface::r#start_trace_session(self, config, options)
2254 }
2255
2256 pub fn r#start_trace_session_on_boot(
2258 &self,
2259 mut config: &TraceConfig,
2260 mut options: &TraceOptions,
2261 ) -> fidl::client::QueryResponseFut<
2262 SessionManagerStartTraceSessionOnBootResult,
2263 fidl::encoding::DefaultFuchsiaResourceDialect,
2264 > {
2265 SessionManagerProxyInterface::r#start_trace_session_on_boot(self, config, options)
2266 }
2267
2268 pub fn r#end_trace_session(
2273 &self,
2274 mut task_id: u64,
2275 mut output: fidl::Socket,
2276 ) -> fidl::client::QueryResponseFut<
2277 SessionManagerEndTraceSessionResult,
2278 fidl::encoding::DefaultFuchsiaResourceDialect,
2279 > {
2280 SessionManagerProxyInterface::r#end_trace_session(self, task_id, output)
2281 }
2282
2283 pub fn r#abort_trace_session(
2285 &self,
2286 mut task_id: u64,
2287 ) -> fidl::client::QueryResponseFut<
2288 SessionManagerAbortTraceSessionResult,
2289 fidl::encoding::DefaultFuchsiaResourceDialect,
2290 > {
2291 SessionManagerProxyInterface::r#abort_trace_session(self, task_id)
2292 }
2293
2294 pub fn r#status(
2296 &self,
2297 ) -> fidl::client::QueryResponseFut<
2298 SessionManagerStatusResult,
2299 fidl::encoding::DefaultFuchsiaResourceDialect,
2300 > {
2301 SessionManagerProxyInterface::r#status(self)
2302 }
2303}
2304
2305impl SessionManagerProxyInterface for SessionManagerProxy {
2306 type GetProvidersResponseFut = fidl::client::QueryResponseFut<
2307 Vec<ProviderInfo>,
2308 fidl::encoding::DefaultFuchsiaResourceDialect,
2309 >;
2310 fn r#get_providers(&self) -> Self::GetProvidersResponseFut {
2311 fn _decode(
2312 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2313 ) -> Result<Vec<ProviderInfo>, fidl::Error> {
2314 let _response = fidl::client::decode_transaction_body::<
2315 fidl::encoding::FlexibleType<SessionManagerGetProvidersResponse>,
2316 fidl::encoding::DefaultFuchsiaResourceDialect,
2317 0x61bd49c4eb1fa03,
2318 >(_buf?)?
2319 .into_result::<SessionManagerMarker>("get_providers")?;
2320 Ok(_response.providers)
2321 }
2322 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<ProviderInfo>>(
2323 (),
2324 0x61bd49c4eb1fa03,
2325 fidl::encoding::DynamicFlags::FLEXIBLE,
2326 _decode,
2327 )
2328 }
2329
2330 type GetKnownCategoriesResponseFut = fidl::client::QueryResponseFut<
2331 Vec<fidl_fuchsia_tracing::KnownCategory>,
2332 fidl::encoding::DefaultFuchsiaResourceDialect,
2333 >;
2334 fn r#get_known_categories(&self) -> Self::GetKnownCategoriesResponseFut {
2335 fn _decode(
2336 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2337 ) -> Result<Vec<fidl_fuchsia_tracing::KnownCategory>, fidl::Error> {
2338 let _response = fidl::client::decode_transaction_body::<
2339 fidl::encoding::FlexibleType<SessionManagerGetKnownCategoriesResponse>,
2340 fidl::encoding::DefaultFuchsiaResourceDialect,
2341 0x6f0abdb5401788b2,
2342 >(_buf?)?
2343 .into_result::<SessionManagerMarker>("get_known_categories")?;
2344 Ok(_response.categories)
2345 }
2346 self.client.send_query_and_decode::<
2347 fidl::encoding::EmptyPayload,
2348 Vec<fidl_fuchsia_tracing::KnownCategory>,
2349 >(
2350 (),
2351 0x6f0abdb5401788b2,
2352 fidl::encoding::DynamicFlags::FLEXIBLE,
2353 _decode,
2354 )
2355 }
2356
2357 type StartTraceSessionResponseFut = fidl::client::QueryResponseFut<
2358 SessionManagerStartTraceSessionResult,
2359 fidl::encoding::DefaultFuchsiaResourceDialect,
2360 >;
2361 fn r#start_trace_session(
2362 &self,
2363 mut config: &TraceConfig,
2364 mut options: &TraceOptions,
2365 ) -> Self::StartTraceSessionResponseFut {
2366 fn _decode(
2367 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2368 ) -> Result<SessionManagerStartTraceSessionResult, fidl::Error> {
2369 let _response = fidl::client::decode_transaction_body::<
2370 fidl::encoding::FlexibleResultType<
2371 SessionManagerStartTraceSessionResponse,
2372 RecordingError,
2373 >,
2374 fidl::encoding::DefaultFuchsiaResourceDialect,
2375 0x54c39e0c173c0162,
2376 >(_buf?)?
2377 .into_result::<SessionManagerMarker>("start_trace_session")?;
2378 Ok(_response.map(|x| x.task_id))
2379 }
2380 self.client.send_query_and_decode::<
2381 SessionManagerStartTraceSessionRequest,
2382 SessionManagerStartTraceSessionResult,
2383 >(
2384 (config, options,),
2385 0x54c39e0c173c0162,
2386 fidl::encoding::DynamicFlags::FLEXIBLE,
2387 _decode,
2388 )
2389 }
2390
2391 type StartTraceSessionOnBootResponseFut = fidl::client::QueryResponseFut<
2392 SessionManagerStartTraceSessionOnBootResult,
2393 fidl::encoding::DefaultFuchsiaResourceDialect,
2394 >;
2395 fn r#start_trace_session_on_boot(
2396 &self,
2397 mut config: &TraceConfig,
2398 mut options: &TraceOptions,
2399 ) -> Self::StartTraceSessionOnBootResponseFut {
2400 fn _decode(
2401 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2402 ) -> Result<SessionManagerStartTraceSessionOnBootResult, fidl::Error> {
2403 let _response = fidl::client::decode_transaction_body::<
2404 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, RecordingError>,
2405 fidl::encoding::DefaultFuchsiaResourceDialect,
2406 0x705558b5612fbf62,
2407 >(_buf?)?
2408 .into_result::<SessionManagerMarker>("start_trace_session_on_boot")?;
2409 Ok(_response.map(|x| x))
2410 }
2411 self.client.send_query_and_decode::<
2412 SessionManagerStartTraceSessionOnBootRequest,
2413 SessionManagerStartTraceSessionOnBootResult,
2414 >(
2415 (config, options,),
2416 0x705558b5612fbf62,
2417 fidl::encoding::DynamicFlags::FLEXIBLE,
2418 _decode,
2419 )
2420 }
2421
2422 type EndTraceSessionResponseFut = fidl::client::QueryResponseFut<
2423 SessionManagerEndTraceSessionResult,
2424 fidl::encoding::DefaultFuchsiaResourceDialect,
2425 >;
2426 fn r#end_trace_session(
2427 &self,
2428 mut task_id: u64,
2429 mut output: fidl::Socket,
2430 ) -> Self::EndTraceSessionResponseFut {
2431 fn _decode(
2432 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2433 ) -> Result<SessionManagerEndTraceSessionResult, fidl::Error> {
2434 let _response = fidl::client::decode_transaction_body::<
2435 fidl::encoding::FlexibleResultType<
2436 SessionManagerEndTraceSessionResponse,
2437 RecordingError,
2438 >,
2439 fidl::encoding::DefaultFuchsiaResourceDialect,
2440 0x72d6ca80a0787577,
2441 >(_buf?)?
2442 .into_result::<SessionManagerMarker>("end_trace_session")?;
2443 Ok(_response.map(|x| (x.options, x.result)))
2444 }
2445 self.client.send_query_and_decode::<
2446 SessionManagerEndTraceSessionRequest,
2447 SessionManagerEndTraceSessionResult,
2448 >(
2449 (task_id, output,),
2450 0x72d6ca80a0787577,
2451 fidl::encoding::DynamicFlags::FLEXIBLE,
2452 _decode,
2453 )
2454 }
2455
2456 type AbortTraceSessionResponseFut = fidl::client::QueryResponseFut<
2457 SessionManagerAbortTraceSessionResult,
2458 fidl::encoding::DefaultFuchsiaResourceDialect,
2459 >;
2460 fn r#abort_trace_session(&self, mut task_id: u64) -> Self::AbortTraceSessionResponseFut {
2461 fn _decode(
2462 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2463 ) -> Result<SessionManagerAbortTraceSessionResult, fidl::Error> {
2464 let _response = fidl::client::decode_transaction_body::<
2465 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, RecordingError>,
2466 fidl::encoding::DefaultFuchsiaResourceDialect,
2467 0x9a14550631bbc7c,
2468 >(_buf?)?
2469 .into_result::<SessionManagerMarker>("abort_trace_session")?;
2470 Ok(_response.map(|x| x))
2471 }
2472 self.client.send_query_and_decode::<
2473 SessionManagerAbortTraceSessionRequest,
2474 SessionManagerAbortTraceSessionResult,
2475 >(
2476 (task_id,),
2477 0x9a14550631bbc7c,
2478 fidl::encoding::DynamicFlags::FLEXIBLE,
2479 _decode,
2480 )
2481 }
2482
2483 type StatusResponseFut = fidl::client::QueryResponseFut<
2484 SessionManagerStatusResult,
2485 fidl::encoding::DefaultFuchsiaResourceDialect,
2486 >;
2487 fn r#status(&self) -> Self::StatusResponseFut {
2488 fn _decode(
2489 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2490 ) -> Result<SessionManagerStatusResult, fidl::Error> {
2491 let _response = fidl::client::decode_transaction_body::<
2492 fidl::encoding::FlexibleResultType<TraceStatus, RecordingError>,
2493 fidl::encoding::DefaultFuchsiaResourceDialect,
2494 0x2ebc198b7af59063,
2495 >(_buf?)?
2496 .into_result::<SessionManagerMarker>("status")?;
2497 Ok(_response.map(|x| x))
2498 }
2499 self.client
2500 .send_query_and_decode::<fidl::encoding::EmptyPayload, SessionManagerStatusResult>(
2501 (),
2502 0x2ebc198b7af59063,
2503 fidl::encoding::DynamicFlags::FLEXIBLE,
2504 _decode,
2505 )
2506 }
2507}
2508
2509pub struct SessionManagerEventStream {
2510 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2511}
2512
2513impl std::marker::Unpin for SessionManagerEventStream {}
2514
2515impl futures::stream::FusedStream for SessionManagerEventStream {
2516 fn is_terminated(&self) -> bool {
2517 self.event_receiver.is_terminated()
2518 }
2519}
2520
2521impl futures::Stream for SessionManagerEventStream {
2522 type Item = Result<SessionManagerEvent, fidl::Error>;
2523
2524 fn poll_next(
2525 mut self: std::pin::Pin<&mut Self>,
2526 cx: &mut std::task::Context<'_>,
2527 ) -> std::task::Poll<Option<Self::Item>> {
2528 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2529 &mut self.event_receiver,
2530 cx
2531 )?) {
2532 Some(buf) => std::task::Poll::Ready(Some(SessionManagerEvent::decode(buf))),
2533 None => std::task::Poll::Ready(None),
2534 }
2535 }
2536}
2537
2538#[derive(Debug)]
2539pub enum SessionManagerEvent {
2540 #[non_exhaustive]
2541 _UnknownEvent {
2542 ordinal: u64,
2544 },
2545}
2546
2547impl SessionManagerEvent {
2548 fn decode(
2550 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2551 ) -> Result<SessionManagerEvent, fidl::Error> {
2552 let (bytes, _handles) = buf.split_mut();
2553 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2554 debug_assert_eq!(tx_header.tx_id, 0);
2555 match tx_header.ordinal {
2556 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2557 Ok(SessionManagerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2558 }
2559 _ => Err(fidl::Error::UnknownOrdinal {
2560 ordinal: tx_header.ordinal,
2561 protocol_name:
2562 <SessionManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2563 }),
2564 }
2565 }
2566}
2567
2568pub struct SessionManagerRequestStream {
2570 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2571 is_terminated: bool,
2572}
2573
2574impl std::marker::Unpin for SessionManagerRequestStream {}
2575
2576impl futures::stream::FusedStream for SessionManagerRequestStream {
2577 fn is_terminated(&self) -> bool {
2578 self.is_terminated
2579 }
2580}
2581
2582impl fidl::endpoints::RequestStream for SessionManagerRequestStream {
2583 type Protocol = SessionManagerMarker;
2584 type ControlHandle = SessionManagerControlHandle;
2585
2586 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2587 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2588 }
2589
2590 fn control_handle(&self) -> Self::ControlHandle {
2591 SessionManagerControlHandle { inner: self.inner.clone() }
2592 }
2593
2594 fn into_inner(
2595 self,
2596 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2597 {
2598 (self.inner, self.is_terminated)
2599 }
2600
2601 fn from_inner(
2602 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2603 is_terminated: bool,
2604 ) -> Self {
2605 Self { inner, is_terminated }
2606 }
2607}
2608
2609impl futures::Stream for SessionManagerRequestStream {
2610 type Item = Result<SessionManagerRequest, fidl::Error>;
2611
2612 fn poll_next(
2613 mut self: std::pin::Pin<&mut Self>,
2614 cx: &mut std::task::Context<'_>,
2615 ) -> std::task::Poll<Option<Self::Item>> {
2616 let this = &mut *self;
2617 if this.inner.check_shutdown(cx) {
2618 this.is_terminated = true;
2619 return std::task::Poll::Ready(None);
2620 }
2621 if this.is_terminated {
2622 panic!("polled SessionManagerRequestStream after completion");
2623 }
2624 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2625 |bytes, handles| {
2626 match this.inner.channel().read_etc(cx, bytes, handles) {
2627 std::task::Poll::Ready(Ok(())) => {}
2628 std::task::Poll::Pending => return std::task::Poll::Pending,
2629 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2630 this.is_terminated = true;
2631 return std::task::Poll::Ready(None);
2632 }
2633 std::task::Poll::Ready(Err(e)) => {
2634 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2635 e.into(),
2636 ))));
2637 }
2638 }
2639
2640 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2642
2643 std::task::Poll::Ready(Some(match header.ordinal {
2644 0x61bd49c4eb1fa03 => {
2645 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2646 let mut req = fidl::new_empty!(
2647 fidl::encoding::EmptyPayload,
2648 fidl::encoding::DefaultFuchsiaResourceDialect
2649 );
2650 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2651 let control_handle =
2652 SessionManagerControlHandle { inner: this.inner.clone() };
2653 Ok(SessionManagerRequest::GetProviders {
2654 responder: SessionManagerGetProvidersResponder {
2655 control_handle: std::mem::ManuallyDrop::new(control_handle),
2656 tx_id: header.tx_id,
2657 },
2658 })
2659 }
2660 0x6f0abdb5401788b2 => {
2661 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2662 let mut req = fidl::new_empty!(
2663 fidl::encoding::EmptyPayload,
2664 fidl::encoding::DefaultFuchsiaResourceDialect
2665 );
2666 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2667 let control_handle =
2668 SessionManagerControlHandle { inner: this.inner.clone() };
2669 Ok(SessionManagerRequest::GetKnownCategories {
2670 responder: SessionManagerGetKnownCategoriesResponder {
2671 control_handle: std::mem::ManuallyDrop::new(control_handle),
2672 tx_id: header.tx_id,
2673 },
2674 })
2675 }
2676 0x54c39e0c173c0162 => {
2677 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2678 let mut req = fidl::new_empty!(
2679 SessionManagerStartTraceSessionRequest,
2680 fidl::encoding::DefaultFuchsiaResourceDialect
2681 );
2682 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionManagerStartTraceSessionRequest>(&header, _body_bytes, handles, &mut req)?;
2683 let control_handle =
2684 SessionManagerControlHandle { inner: this.inner.clone() };
2685 Ok(SessionManagerRequest::StartTraceSession {
2686 config: req.config,
2687 options: req.options,
2688
2689 responder: SessionManagerStartTraceSessionResponder {
2690 control_handle: std::mem::ManuallyDrop::new(control_handle),
2691 tx_id: header.tx_id,
2692 },
2693 })
2694 }
2695 0x705558b5612fbf62 => {
2696 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2697 let mut req = fidl::new_empty!(
2698 SessionManagerStartTraceSessionOnBootRequest,
2699 fidl::encoding::DefaultFuchsiaResourceDialect
2700 );
2701 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionManagerStartTraceSessionOnBootRequest>(&header, _body_bytes, handles, &mut req)?;
2702 let control_handle =
2703 SessionManagerControlHandle { inner: this.inner.clone() };
2704 Ok(SessionManagerRequest::StartTraceSessionOnBoot {
2705 config: req.config,
2706 options: req.options,
2707
2708 responder: SessionManagerStartTraceSessionOnBootResponder {
2709 control_handle: std::mem::ManuallyDrop::new(control_handle),
2710 tx_id: header.tx_id,
2711 },
2712 })
2713 }
2714 0x72d6ca80a0787577 => {
2715 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2716 let mut req = fidl::new_empty!(
2717 SessionManagerEndTraceSessionRequest,
2718 fidl::encoding::DefaultFuchsiaResourceDialect
2719 );
2720 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionManagerEndTraceSessionRequest>(&header, _body_bytes, handles, &mut req)?;
2721 let control_handle =
2722 SessionManagerControlHandle { inner: this.inner.clone() };
2723 Ok(SessionManagerRequest::EndTraceSession {
2724 task_id: req.task_id,
2725 output: req.output,
2726
2727 responder: SessionManagerEndTraceSessionResponder {
2728 control_handle: std::mem::ManuallyDrop::new(control_handle),
2729 tx_id: header.tx_id,
2730 },
2731 })
2732 }
2733 0x9a14550631bbc7c => {
2734 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2735 let mut req = fidl::new_empty!(
2736 SessionManagerAbortTraceSessionRequest,
2737 fidl::encoding::DefaultFuchsiaResourceDialect
2738 );
2739 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionManagerAbortTraceSessionRequest>(&header, _body_bytes, handles, &mut req)?;
2740 let control_handle =
2741 SessionManagerControlHandle { inner: this.inner.clone() };
2742 Ok(SessionManagerRequest::AbortTraceSession {
2743 task_id: req.task_id,
2744
2745 responder: SessionManagerAbortTraceSessionResponder {
2746 control_handle: std::mem::ManuallyDrop::new(control_handle),
2747 tx_id: header.tx_id,
2748 },
2749 })
2750 }
2751 0x2ebc198b7af59063 => {
2752 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2753 let mut req = fidl::new_empty!(
2754 fidl::encoding::EmptyPayload,
2755 fidl::encoding::DefaultFuchsiaResourceDialect
2756 );
2757 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2758 let control_handle =
2759 SessionManagerControlHandle { inner: this.inner.clone() };
2760 Ok(SessionManagerRequest::Status {
2761 responder: SessionManagerStatusResponder {
2762 control_handle: std::mem::ManuallyDrop::new(control_handle),
2763 tx_id: header.tx_id,
2764 },
2765 })
2766 }
2767 _ if header.tx_id == 0
2768 && header
2769 .dynamic_flags()
2770 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2771 {
2772 Ok(SessionManagerRequest::_UnknownMethod {
2773 ordinal: header.ordinal,
2774 control_handle: SessionManagerControlHandle {
2775 inner: this.inner.clone(),
2776 },
2777 method_type: fidl::MethodType::OneWay,
2778 })
2779 }
2780 _ if header
2781 .dynamic_flags()
2782 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2783 {
2784 this.inner.send_framework_err(
2785 fidl::encoding::FrameworkErr::UnknownMethod,
2786 header.tx_id,
2787 header.ordinal,
2788 header.dynamic_flags(),
2789 (bytes, handles),
2790 )?;
2791 Ok(SessionManagerRequest::_UnknownMethod {
2792 ordinal: header.ordinal,
2793 control_handle: SessionManagerControlHandle {
2794 inner: this.inner.clone(),
2795 },
2796 method_type: fidl::MethodType::TwoWay,
2797 })
2798 }
2799 _ => Err(fidl::Error::UnknownOrdinal {
2800 ordinal: header.ordinal,
2801 protocol_name:
2802 <SessionManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2803 }),
2804 }))
2805 },
2806 )
2807 }
2808}
2809
2810#[derive(Debug)]
2811pub enum SessionManagerRequest {
2812 GetProviders { responder: SessionManagerGetProvidersResponder },
2814 GetKnownCategories { responder: SessionManagerGetKnownCategoriesResponder },
2816 StartTraceSession {
2818 config: TraceConfig,
2819 options: TraceOptions,
2820 responder: SessionManagerStartTraceSessionResponder,
2821 },
2822 StartTraceSessionOnBoot {
2824 config: TraceConfig,
2825 options: TraceOptions,
2826 responder: SessionManagerStartTraceSessionOnBootResponder,
2827 },
2828 EndTraceSession {
2833 task_id: u64,
2834 output: fidl::Socket,
2835 responder: SessionManagerEndTraceSessionResponder,
2836 },
2837 AbortTraceSession { task_id: u64, responder: SessionManagerAbortTraceSessionResponder },
2839 Status { responder: SessionManagerStatusResponder },
2841 #[non_exhaustive]
2843 _UnknownMethod {
2844 ordinal: u64,
2846 control_handle: SessionManagerControlHandle,
2847 method_type: fidl::MethodType,
2848 },
2849}
2850
2851impl SessionManagerRequest {
2852 #[allow(irrefutable_let_patterns)]
2853 pub fn into_get_providers(self) -> Option<(SessionManagerGetProvidersResponder)> {
2854 if let SessionManagerRequest::GetProviders { responder } = self {
2855 Some((responder))
2856 } else {
2857 None
2858 }
2859 }
2860
2861 #[allow(irrefutable_let_patterns)]
2862 pub fn into_get_known_categories(self) -> Option<(SessionManagerGetKnownCategoriesResponder)> {
2863 if let SessionManagerRequest::GetKnownCategories { responder } = self {
2864 Some((responder))
2865 } else {
2866 None
2867 }
2868 }
2869
2870 #[allow(irrefutable_let_patterns)]
2871 pub fn into_start_trace_session(
2872 self,
2873 ) -> Option<(TraceConfig, TraceOptions, SessionManagerStartTraceSessionResponder)> {
2874 if let SessionManagerRequest::StartTraceSession { config, options, responder } = self {
2875 Some((config, options, responder))
2876 } else {
2877 None
2878 }
2879 }
2880
2881 #[allow(irrefutable_let_patterns)]
2882 pub fn into_start_trace_session_on_boot(
2883 self,
2884 ) -> Option<(TraceConfig, TraceOptions, SessionManagerStartTraceSessionOnBootResponder)> {
2885 if let SessionManagerRequest::StartTraceSessionOnBoot { config, options, responder } = self
2886 {
2887 Some((config, options, responder))
2888 } else {
2889 None
2890 }
2891 }
2892
2893 #[allow(irrefutable_let_patterns)]
2894 pub fn into_end_trace_session(
2895 self,
2896 ) -> Option<(u64, fidl::Socket, SessionManagerEndTraceSessionResponder)> {
2897 if let SessionManagerRequest::EndTraceSession { task_id, output, responder } = self {
2898 Some((task_id, output, responder))
2899 } else {
2900 None
2901 }
2902 }
2903
2904 #[allow(irrefutable_let_patterns)]
2905 pub fn into_abort_trace_session(
2906 self,
2907 ) -> Option<(u64, SessionManagerAbortTraceSessionResponder)> {
2908 if let SessionManagerRequest::AbortTraceSession { task_id, responder } = self {
2909 Some((task_id, responder))
2910 } else {
2911 None
2912 }
2913 }
2914
2915 #[allow(irrefutable_let_patterns)]
2916 pub fn into_status(self) -> Option<(SessionManagerStatusResponder)> {
2917 if let SessionManagerRequest::Status { responder } = self {
2918 Some((responder))
2919 } else {
2920 None
2921 }
2922 }
2923
2924 pub fn method_name(&self) -> &'static str {
2926 match *self {
2927 SessionManagerRequest::GetProviders { .. } => "get_providers",
2928 SessionManagerRequest::GetKnownCategories { .. } => "get_known_categories",
2929 SessionManagerRequest::StartTraceSession { .. } => "start_trace_session",
2930 SessionManagerRequest::StartTraceSessionOnBoot { .. } => "start_trace_session_on_boot",
2931 SessionManagerRequest::EndTraceSession { .. } => "end_trace_session",
2932 SessionManagerRequest::AbortTraceSession { .. } => "abort_trace_session",
2933 SessionManagerRequest::Status { .. } => "status",
2934 SessionManagerRequest::_UnknownMethod {
2935 method_type: fidl::MethodType::OneWay, ..
2936 } => "unknown one-way method",
2937 SessionManagerRequest::_UnknownMethod {
2938 method_type: fidl::MethodType::TwoWay, ..
2939 } => "unknown two-way method",
2940 }
2941 }
2942}
2943
2944#[derive(Debug, Clone)]
2945pub struct SessionManagerControlHandle {
2946 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2947}
2948
2949impl fidl::endpoints::ControlHandle for SessionManagerControlHandle {
2950 fn shutdown(&self) {
2951 self.inner.shutdown()
2952 }
2953
2954 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2955 self.inner.shutdown_with_epitaph(status)
2956 }
2957
2958 fn is_closed(&self) -> bool {
2959 self.inner.channel().is_closed()
2960 }
2961 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2962 self.inner.channel().on_closed()
2963 }
2964
2965 #[cfg(target_os = "fuchsia")]
2966 fn signal_peer(
2967 &self,
2968 clear_mask: zx::Signals,
2969 set_mask: zx::Signals,
2970 ) -> Result<(), zx_status::Status> {
2971 use fidl::Peered;
2972 self.inner.channel().signal_peer(clear_mask, set_mask)
2973 }
2974}
2975
2976impl SessionManagerControlHandle {}
2977
2978#[must_use = "FIDL methods require a response to be sent"]
2979#[derive(Debug)]
2980pub struct SessionManagerGetProvidersResponder {
2981 control_handle: std::mem::ManuallyDrop<SessionManagerControlHandle>,
2982 tx_id: u32,
2983}
2984
2985impl std::ops::Drop for SessionManagerGetProvidersResponder {
2989 fn drop(&mut self) {
2990 self.control_handle.shutdown();
2991 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2993 }
2994}
2995
2996impl fidl::endpoints::Responder for SessionManagerGetProvidersResponder {
2997 type ControlHandle = SessionManagerControlHandle;
2998
2999 fn control_handle(&self) -> &SessionManagerControlHandle {
3000 &self.control_handle
3001 }
3002
3003 fn drop_without_shutdown(mut self) {
3004 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3006 std::mem::forget(self);
3008 }
3009}
3010
3011impl SessionManagerGetProvidersResponder {
3012 pub fn send(self, mut providers: &[ProviderInfo]) -> Result<(), fidl::Error> {
3016 let _result = self.send_raw(providers);
3017 if _result.is_err() {
3018 self.control_handle.shutdown();
3019 }
3020 self.drop_without_shutdown();
3021 _result
3022 }
3023
3024 pub fn send_no_shutdown_on_err(
3026 self,
3027 mut providers: &[ProviderInfo],
3028 ) -> Result<(), fidl::Error> {
3029 let _result = self.send_raw(providers);
3030 self.drop_without_shutdown();
3031 _result
3032 }
3033
3034 fn send_raw(&self, mut providers: &[ProviderInfo]) -> Result<(), fidl::Error> {
3035 self.control_handle
3036 .inner
3037 .send::<fidl::encoding::FlexibleType<SessionManagerGetProvidersResponse>>(
3038 fidl::encoding::Flexible::new((providers,)),
3039 self.tx_id,
3040 0x61bd49c4eb1fa03,
3041 fidl::encoding::DynamicFlags::FLEXIBLE,
3042 )
3043 }
3044}
3045
3046#[must_use = "FIDL methods require a response to be sent"]
3047#[derive(Debug)]
3048pub struct SessionManagerGetKnownCategoriesResponder {
3049 control_handle: std::mem::ManuallyDrop<SessionManagerControlHandle>,
3050 tx_id: u32,
3051}
3052
3053impl std::ops::Drop for SessionManagerGetKnownCategoriesResponder {
3057 fn drop(&mut self) {
3058 self.control_handle.shutdown();
3059 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3061 }
3062}
3063
3064impl fidl::endpoints::Responder for SessionManagerGetKnownCategoriesResponder {
3065 type ControlHandle = SessionManagerControlHandle;
3066
3067 fn control_handle(&self) -> &SessionManagerControlHandle {
3068 &self.control_handle
3069 }
3070
3071 fn drop_without_shutdown(mut self) {
3072 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3074 std::mem::forget(self);
3076 }
3077}
3078
3079impl SessionManagerGetKnownCategoriesResponder {
3080 pub fn send(
3084 self,
3085 mut categories: &[fidl_fuchsia_tracing::KnownCategory],
3086 ) -> Result<(), fidl::Error> {
3087 let _result = self.send_raw(categories);
3088 if _result.is_err() {
3089 self.control_handle.shutdown();
3090 }
3091 self.drop_without_shutdown();
3092 _result
3093 }
3094
3095 pub fn send_no_shutdown_on_err(
3097 self,
3098 mut categories: &[fidl_fuchsia_tracing::KnownCategory],
3099 ) -> Result<(), fidl::Error> {
3100 let _result = self.send_raw(categories);
3101 self.drop_without_shutdown();
3102 _result
3103 }
3104
3105 fn send_raw(
3106 &self,
3107 mut categories: &[fidl_fuchsia_tracing::KnownCategory],
3108 ) -> Result<(), fidl::Error> {
3109 self.control_handle.inner.send::<fidl::encoding::FlexibleType<
3110 SessionManagerGetKnownCategoriesResponse,
3111 >>(
3112 fidl::encoding::Flexible::new((categories,)),
3113 self.tx_id,
3114 0x6f0abdb5401788b2,
3115 fidl::encoding::DynamicFlags::FLEXIBLE,
3116 )
3117 }
3118}
3119
3120#[must_use = "FIDL methods require a response to be sent"]
3121#[derive(Debug)]
3122pub struct SessionManagerStartTraceSessionResponder {
3123 control_handle: std::mem::ManuallyDrop<SessionManagerControlHandle>,
3124 tx_id: u32,
3125}
3126
3127impl std::ops::Drop for SessionManagerStartTraceSessionResponder {
3131 fn drop(&mut self) {
3132 self.control_handle.shutdown();
3133 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3135 }
3136}
3137
3138impl fidl::endpoints::Responder for SessionManagerStartTraceSessionResponder {
3139 type ControlHandle = SessionManagerControlHandle;
3140
3141 fn control_handle(&self) -> &SessionManagerControlHandle {
3142 &self.control_handle
3143 }
3144
3145 fn drop_without_shutdown(mut self) {
3146 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3148 std::mem::forget(self);
3150 }
3151}
3152
3153impl SessionManagerStartTraceSessionResponder {
3154 pub fn send(self, mut result: Result<u64, RecordingError>) -> Result<(), fidl::Error> {
3158 let _result = self.send_raw(result);
3159 if _result.is_err() {
3160 self.control_handle.shutdown();
3161 }
3162 self.drop_without_shutdown();
3163 _result
3164 }
3165
3166 pub fn send_no_shutdown_on_err(
3168 self,
3169 mut result: Result<u64, RecordingError>,
3170 ) -> Result<(), fidl::Error> {
3171 let _result = self.send_raw(result);
3172 self.drop_without_shutdown();
3173 _result
3174 }
3175
3176 fn send_raw(&self, mut result: Result<u64, RecordingError>) -> Result<(), fidl::Error> {
3177 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3178 SessionManagerStartTraceSessionResponse,
3179 RecordingError,
3180 >>(
3181 fidl::encoding::FlexibleResult::new(result.map(|task_id| (task_id,))),
3182 self.tx_id,
3183 0x54c39e0c173c0162,
3184 fidl::encoding::DynamicFlags::FLEXIBLE,
3185 )
3186 }
3187}
3188
3189#[must_use = "FIDL methods require a response to be sent"]
3190#[derive(Debug)]
3191pub struct SessionManagerStartTraceSessionOnBootResponder {
3192 control_handle: std::mem::ManuallyDrop<SessionManagerControlHandle>,
3193 tx_id: u32,
3194}
3195
3196impl std::ops::Drop for SessionManagerStartTraceSessionOnBootResponder {
3200 fn drop(&mut self) {
3201 self.control_handle.shutdown();
3202 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3204 }
3205}
3206
3207impl fidl::endpoints::Responder for SessionManagerStartTraceSessionOnBootResponder {
3208 type ControlHandle = SessionManagerControlHandle;
3209
3210 fn control_handle(&self) -> &SessionManagerControlHandle {
3211 &self.control_handle
3212 }
3213
3214 fn drop_without_shutdown(mut self) {
3215 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3217 std::mem::forget(self);
3219 }
3220}
3221
3222impl SessionManagerStartTraceSessionOnBootResponder {
3223 pub fn send(self, mut result: Result<(), RecordingError>) -> Result<(), fidl::Error> {
3227 let _result = self.send_raw(result);
3228 if _result.is_err() {
3229 self.control_handle.shutdown();
3230 }
3231 self.drop_without_shutdown();
3232 _result
3233 }
3234
3235 pub fn send_no_shutdown_on_err(
3237 self,
3238 mut result: Result<(), RecordingError>,
3239 ) -> Result<(), fidl::Error> {
3240 let _result = self.send_raw(result);
3241 self.drop_without_shutdown();
3242 _result
3243 }
3244
3245 fn send_raw(&self, mut result: Result<(), RecordingError>) -> Result<(), fidl::Error> {
3246 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3247 fidl::encoding::EmptyStruct,
3248 RecordingError,
3249 >>(
3250 fidl::encoding::FlexibleResult::new(result),
3251 self.tx_id,
3252 0x705558b5612fbf62,
3253 fidl::encoding::DynamicFlags::FLEXIBLE,
3254 )
3255 }
3256}
3257
3258#[must_use = "FIDL methods require a response to be sent"]
3259#[derive(Debug)]
3260pub struct SessionManagerEndTraceSessionResponder {
3261 control_handle: std::mem::ManuallyDrop<SessionManagerControlHandle>,
3262 tx_id: u32,
3263}
3264
3265impl std::ops::Drop for SessionManagerEndTraceSessionResponder {
3269 fn drop(&mut self) {
3270 self.control_handle.shutdown();
3271 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3273 }
3274}
3275
3276impl fidl::endpoints::Responder for SessionManagerEndTraceSessionResponder {
3277 type ControlHandle = SessionManagerControlHandle;
3278
3279 fn control_handle(&self) -> &SessionManagerControlHandle {
3280 &self.control_handle
3281 }
3282
3283 fn drop_without_shutdown(mut self) {
3284 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3286 std::mem::forget(self);
3288 }
3289}
3290
3291impl SessionManagerEndTraceSessionResponder {
3292 pub fn send(
3296 self,
3297 mut result: Result<(&TraceOptions, &StopResult), RecordingError>,
3298 ) -> Result<(), fidl::Error> {
3299 let _result = self.send_raw(result);
3300 if _result.is_err() {
3301 self.control_handle.shutdown();
3302 }
3303 self.drop_without_shutdown();
3304 _result
3305 }
3306
3307 pub fn send_no_shutdown_on_err(
3309 self,
3310 mut result: Result<(&TraceOptions, &StopResult), RecordingError>,
3311 ) -> Result<(), fidl::Error> {
3312 let _result = self.send_raw(result);
3313 self.drop_without_shutdown();
3314 _result
3315 }
3316
3317 fn send_raw(
3318 &self,
3319 mut result: Result<(&TraceOptions, &StopResult), RecordingError>,
3320 ) -> Result<(), fidl::Error> {
3321 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3322 SessionManagerEndTraceSessionResponse,
3323 RecordingError,
3324 >>(
3325 fidl::encoding::FlexibleResult::new(result),
3326 self.tx_id,
3327 0x72d6ca80a0787577,
3328 fidl::encoding::DynamicFlags::FLEXIBLE,
3329 )
3330 }
3331}
3332
3333#[must_use = "FIDL methods require a response to be sent"]
3334#[derive(Debug)]
3335pub struct SessionManagerAbortTraceSessionResponder {
3336 control_handle: std::mem::ManuallyDrop<SessionManagerControlHandle>,
3337 tx_id: u32,
3338}
3339
3340impl std::ops::Drop for SessionManagerAbortTraceSessionResponder {
3344 fn drop(&mut self) {
3345 self.control_handle.shutdown();
3346 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3348 }
3349}
3350
3351impl fidl::endpoints::Responder for SessionManagerAbortTraceSessionResponder {
3352 type ControlHandle = SessionManagerControlHandle;
3353
3354 fn control_handle(&self) -> &SessionManagerControlHandle {
3355 &self.control_handle
3356 }
3357
3358 fn drop_without_shutdown(mut self) {
3359 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3361 std::mem::forget(self);
3363 }
3364}
3365
3366impl SessionManagerAbortTraceSessionResponder {
3367 pub fn send(self, mut result: Result<(), RecordingError>) -> Result<(), fidl::Error> {
3371 let _result = self.send_raw(result);
3372 if _result.is_err() {
3373 self.control_handle.shutdown();
3374 }
3375 self.drop_without_shutdown();
3376 _result
3377 }
3378
3379 pub fn send_no_shutdown_on_err(
3381 self,
3382 mut result: Result<(), RecordingError>,
3383 ) -> Result<(), fidl::Error> {
3384 let _result = self.send_raw(result);
3385 self.drop_without_shutdown();
3386 _result
3387 }
3388
3389 fn send_raw(&self, mut result: Result<(), RecordingError>) -> Result<(), fidl::Error> {
3390 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3391 fidl::encoding::EmptyStruct,
3392 RecordingError,
3393 >>(
3394 fidl::encoding::FlexibleResult::new(result),
3395 self.tx_id,
3396 0x9a14550631bbc7c,
3397 fidl::encoding::DynamicFlags::FLEXIBLE,
3398 )
3399 }
3400}
3401
3402#[must_use = "FIDL methods require a response to be sent"]
3403#[derive(Debug)]
3404pub struct SessionManagerStatusResponder {
3405 control_handle: std::mem::ManuallyDrop<SessionManagerControlHandle>,
3406 tx_id: u32,
3407}
3408
3409impl std::ops::Drop for SessionManagerStatusResponder {
3413 fn drop(&mut self) {
3414 self.control_handle.shutdown();
3415 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3417 }
3418}
3419
3420impl fidl::endpoints::Responder for SessionManagerStatusResponder {
3421 type ControlHandle = SessionManagerControlHandle;
3422
3423 fn control_handle(&self) -> &SessionManagerControlHandle {
3424 &self.control_handle
3425 }
3426
3427 fn drop_without_shutdown(mut self) {
3428 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3430 std::mem::forget(self);
3432 }
3433}
3434
3435impl SessionManagerStatusResponder {
3436 pub fn send(self, mut result: Result<&TraceStatus, RecordingError>) -> Result<(), fidl::Error> {
3440 let _result = self.send_raw(result);
3441 if _result.is_err() {
3442 self.control_handle.shutdown();
3443 }
3444 self.drop_without_shutdown();
3445 _result
3446 }
3447
3448 pub fn send_no_shutdown_on_err(
3450 self,
3451 mut result: Result<&TraceStatus, RecordingError>,
3452 ) -> Result<(), fidl::Error> {
3453 let _result = self.send_raw(result);
3454 self.drop_without_shutdown();
3455 _result
3456 }
3457
3458 fn send_raw(
3459 &self,
3460 mut result: Result<&TraceStatus, RecordingError>,
3461 ) -> Result<(), fidl::Error> {
3462 self.control_handle
3463 .inner
3464 .send::<fidl::encoding::FlexibleResultType<TraceStatus, RecordingError>>(
3465 fidl::encoding::FlexibleResult::new(result),
3466 self.tx_id,
3467 0x2ebc198b7af59063,
3468 fidl::encoding::DynamicFlags::FLEXIBLE,
3469 )
3470 }
3471}
3472
3473mod internal {
3474 use super::*;
3475
3476 impl fidl::encoding::ResourceTypeMarker for ProvisionerInitializeTracingRequest {
3477 type Borrowed<'a> = &'a mut Self;
3478 fn take_or_borrow<'a>(
3479 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3480 ) -> Self::Borrowed<'a> {
3481 value
3482 }
3483 }
3484
3485 unsafe impl fidl::encoding::TypeMarker for ProvisionerInitializeTracingRequest {
3486 type Owned = Self;
3487
3488 #[inline(always)]
3489 fn inline_align(_context: fidl::encoding::Context) -> usize {
3490 8
3491 }
3492
3493 #[inline(always)]
3494 fn inline_size(_context: fidl::encoding::Context) -> usize {
3495 32
3496 }
3497 }
3498
3499 unsafe impl
3500 fidl::encoding::Encode<
3501 ProvisionerInitializeTracingRequest,
3502 fidl::encoding::DefaultFuchsiaResourceDialect,
3503 > for &mut ProvisionerInitializeTracingRequest
3504 {
3505 #[inline]
3506 unsafe fn encode(
3507 self,
3508 encoder: &mut fidl::encoding::Encoder<
3509 '_,
3510 fidl::encoding::DefaultFuchsiaResourceDialect,
3511 >,
3512 offset: usize,
3513 _depth: fidl::encoding::Depth,
3514 ) -> fidl::Result<()> {
3515 encoder.debug_check_bounds::<ProvisionerInitializeTracingRequest>(offset);
3516 fidl::encoding::Encode::<ProvisionerInitializeTracingRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3518 (
3519 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
3520 <TraceConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
3521 <fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.output),
3522 ),
3523 encoder, offset, _depth
3524 )
3525 }
3526 }
3527 unsafe impl<
3528 T0: fidl::encoding::Encode<
3529 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3530 fidl::encoding::DefaultFuchsiaResourceDialect,
3531 >,
3532 T1: fidl::encoding::Encode<TraceConfig, fidl::encoding::DefaultFuchsiaResourceDialect>,
3533 T2: fidl::encoding::Encode<
3534 fidl::encoding::HandleType<
3535 fidl::Socket,
3536 { fidl::ObjectType::SOCKET.into_raw() },
3537 16392,
3538 >,
3539 fidl::encoding::DefaultFuchsiaResourceDialect,
3540 >,
3541 >
3542 fidl::encoding::Encode<
3543 ProvisionerInitializeTracingRequest,
3544 fidl::encoding::DefaultFuchsiaResourceDialect,
3545 > for (T0, T1, T2)
3546 {
3547 #[inline]
3548 unsafe fn encode(
3549 self,
3550 encoder: &mut fidl::encoding::Encoder<
3551 '_,
3552 fidl::encoding::DefaultFuchsiaResourceDialect,
3553 >,
3554 offset: usize,
3555 depth: fidl::encoding::Depth,
3556 ) -> fidl::Result<()> {
3557 encoder.debug_check_bounds::<ProvisionerInitializeTracingRequest>(offset);
3558 unsafe {
3561 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3562 (ptr as *mut u64).write_unaligned(0);
3563 }
3564 unsafe {
3565 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
3566 (ptr as *mut u64).write_unaligned(0);
3567 }
3568 self.0.encode(encoder, offset + 0, depth)?;
3570 self.1.encode(encoder, offset + 8, depth)?;
3571 self.2.encode(encoder, offset + 24, depth)?;
3572 Ok(())
3573 }
3574 }
3575
3576 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3577 for ProvisionerInitializeTracingRequest
3578 {
3579 #[inline(always)]
3580 fn new_empty() -> Self {
3581 Self {
3582 controller: fidl::new_empty!(
3583 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3584 fidl::encoding::DefaultFuchsiaResourceDialect
3585 ),
3586 config: fidl::new_empty!(
3587 TraceConfig,
3588 fidl::encoding::DefaultFuchsiaResourceDialect
3589 ),
3590 output: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect),
3591 }
3592 }
3593
3594 #[inline]
3595 unsafe fn decode(
3596 &mut self,
3597 decoder: &mut fidl::encoding::Decoder<
3598 '_,
3599 fidl::encoding::DefaultFuchsiaResourceDialect,
3600 >,
3601 offset: usize,
3602 _depth: fidl::encoding::Depth,
3603 ) -> fidl::Result<()> {
3604 decoder.debug_check_bounds::<Self>(offset);
3605 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3607 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3608 let mask = 0xffffffff00000000u64;
3609 let maskedval = padval & mask;
3610 if maskedval != 0 {
3611 return Err(fidl::Error::NonZeroPadding {
3612 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3613 });
3614 }
3615 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
3616 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3617 let mask = 0xffffffff00000000u64;
3618 let maskedval = padval & mask;
3619 if maskedval != 0 {
3620 return Err(fidl::Error::NonZeroPadding {
3621 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
3622 });
3623 }
3624 fidl::decode!(
3625 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3626 fidl::encoding::DefaultFuchsiaResourceDialect,
3627 &mut self.controller,
3628 decoder,
3629 offset + 0,
3630 _depth
3631 )?;
3632 fidl::decode!(
3633 TraceConfig,
3634 fidl::encoding::DefaultFuchsiaResourceDialect,
3635 &mut self.config,
3636 decoder,
3637 offset + 8,
3638 _depth
3639 )?;
3640 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.output, decoder, offset + 24, _depth)?;
3641 Ok(())
3642 }
3643 }
3644
3645 impl fidl::encoding::ResourceTypeMarker for SessionManagerEndTraceSessionRequest {
3646 type Borrowed<'a> = &'a mut Self;
3647 fn take_or_borrow<'a>(
3648 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3649 ) -> Self::Borrowed<'a> {
3650 value
3651 }
3652 }
3653
3654 unsafe impl fidl::encoding::TypeMarker for SessionManagerEndTraceSessionRequest {
3655 type Owned = Self;
3656
3657 #[inline(always)]
3658 fn inline_align(_context: fidl::encoding::Context) -> usize {
3659 8
3660 }
3661
3662 #[inline(always)]
3663 fn inline_size(_context: fidl::encoding::Context) -> usize {
3664 16
3665 }
3666 }
3667
3668 unsafe impl
3669 fidl::encoding::Encode<
3670 SessionManagerEndTraceSessionRequest,
3671 fidl::encoding::DefaultFuchsiaResourceDialect,
3672 > for &mut SessionManagerEndTraceSessionRequest
3673 {
3674 #[inline]
3675 unsafe fn encode(
3676 self,
3677 encoder: &mut fidl::encoding::Encoder<
3678 '_,
3679 fidl::encoding::DefaultFuchsiaResourceDialect,
3680 >,
3681 offset: usize,
3682 _depth: fidl::encoding::Depth,
3683 ) -> fidl::Result<()> {
3684 encoder.debug_check_bounds::<SessionManagerEndTraceSessionRequest>(offset);
3685 fidl::encoding::Encode::<
3687 SessionManagerEndTraceSessionRequest,
3688 fidl::encoding::DefaultFuchsiaResourceDialect,
3689 >::encode(
3690 (
3691 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.task_id),
3692 <fidl::encoding::HandleType<
3693 fidl::Socket,
3694 { fidl::ObjectType::SOCKET.into_raw() },
3695 16394,
3696 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3697 &mut self.output
3698 ),
3699 ),
3700 encoder,
3701 offset,
3702 _depth,
3703 )
3704 }
3705 }
3706 unsafe impl<
3707 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
3708 T1: fidl::encoding::Encode<
3709 fidl::encoding::HandleType<
3710 fidl::Socket,
3711 { fidl::ObjectType::SOCKET.into_raw() },
3712 16394,
3713 >,
3714 fidl::encoding::DefaultFuchsiaResourceDialect,
3715 >,
3716 >
3717 fidl::encoding::Encode<
3718 SessionManagerEndTraceSessionRequest,
3719 fidl::encoding::DefaultFuchsiaResourceDialect,
3720 > for (T0, T1)
3721 {
3722 #[inline]
3723 unsafe fn encode(
3724 self,
3725 encoder: &mut fidl::encoding::Encoder<
3726 '_,
3727 fidl::encoding::DefaultFuchsiaResourceDialect,
3728 >,
3729 offset: usize,
3730 depth: fidl::encoding::Depth,
3731 ) -> fidl::Result<()> {
3732 encoder.debug_check_bounds::<SessionManagerEndTraceSessionRequest>(offset);
3733 unsafe {
3736 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3737 (ptr as *mut u64).write_unaligned(0);
3738 }
3739 self.0.encode(encoder, offset + 0, depth)?;
3741 self.1.encode(encoder, offset + 8, depth)?;
3742 Ok(())
3743 }
3744 }
3745
3746 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3747 for SessionManagerEndTraceSessionRequest
3748 {
3749 #[inline(always)]
3750 fn new_empty() -> Self {
3751 Self {
3752 task_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
3753 output: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16394>, fidl::encoding::DefaultFuchsiaResourceDialect),
3754 }
3755 }
3756
3757 #[inline]
3758 unsafe fn decode(
3759 &mut self,
3760 decoder: &mut fidl::encoding::Decoder<
3761 '_,
3762 fidl::encoding::DefaultFuchsiaResourceDialect,
3763 >,
3764 offset: usize,
3765 _depth: fidl::encoding::Depth,
3766 ) -> fidl::Result<()> {
3767 decoder.debug_check_bounds::<Self>(offset);
3768 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3770 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3771 let mask = 0xffffffff00000000u64;
3772 let maskedval = padval & mask;
3773 if maskedval != 0 {
3774 return Err(fidl::Error::NonZeroPadding {
3775 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3776 });
3777 }
3778 fidl::decode!(
3779 u64,
3780 fidl::encoding::DefaultFuchsiaResourceDialect,
3781 &mut self.task_id,
3782 decoder,
3783 offset + 0,
3784 _depth
3785 )?;
3786 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16394>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.output, decoder, offset + 8, _depth)?;
3787 Ok(())
3788 }
3789 }
3790
3791 impl fidl::encoding::ResourceTypeMarker for SessionManagerStartTraceSessionOnBootRequest {
3792 type Borrowed<'a> = &'a mut Self;
3793 fn take_or_borrow<'a>(
3794 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3795 ) -> Self::Borrowed<'a> {
3796 value
3797 }
3798 }
3799
3800 unsafe impl fidl::encoding::TypeMarker for SessionManagerStartTraceSessionOnBootRequest {
3801 type Owned = Self;
3802
3803 #[inline(always)]
3804 fn inline_align(_context: fidl::encoding::Context) -> usize {
3805 8
3806 }
3807
3808 #[inline(always)]
3809 fn inline_size(_context: fidl::encoding::Context) -> usize {
3810 32
3811 }
3812 }
3813
3814 unsafe impl
3815 fidl::encoding::Encode<
3816 SessionManagerStartTraceSessionOnBootRequest,
3817 fidl::encoding::DefaultFuchsiaResourceDialect,
3818 > for &mut SessionManagerStartTraceSessionOnBootRequest
3819 {
3820 #[inline]
3821 unsafe fn encode(
3822 self,
3823 encoder: &mut fidl::encoding::Encoder<
3824 '_,
3825 fidl::encoding::DefaultFuchsiaResourceDialect,
3826 >,
3827 offset: usize,
3828 _depth: fidl::encoding::Depth,
3829 ) -> fidl::Result<()> {
3830 encoder.debug_check_bounds::<SessionManagerStartTraceSessionOnBootRequest>(offset);
3831 fidl::encoding::Encode::<
3833 SessionManagerStartTraceSessionOnBootRequest,
3834 fidl::encoding::DefaultFuchsiaResourceDialect,
3835 >::encode(
3836 (
3837 <TraceConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
3838 <TraceOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
3839 ),
3840 encoder,
3841 offset,
3842 _depth,
3843 )
3844 }
3845 }
3846 unsafe impl<
3847 T0: fidl::encoding::Encode<TraceConfig, fidl::encoding::DefaultFuchsiaResourceDialect>,
3848 T1: fidl::encoding::Encode<TraceOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
3849 >
3850 fidl::encoding::Encode<
3851 SessionManagerStartTraceSessionOnBootRequest,
3852 fidl::encoding::DefaultFuchsiaResourceDialect,
3853 > for (T0, T1)
3854 {
3855 #[inline]
3856 unsafe fn encode(
3857 self,
3858 encoder: &mut fidl::encoding::Encoder<
3859 '_,
3860 fidl::encoding::DefaultFuchsiaResourceDialect,
3861 >,
3862 offset: usize,
3863 depth: fidl::encoding::Depth,
3864 ) -> fidl::Result<()> {
3865 encoder.debug_check_bounds::<SessionManagerStartTraceSessionOnBootRequest>(offset);
3866 self.0.encode(encoder, offset + 0, depth)?;
3870 self.1.encode(encoder, offset + 16, depth)?;
3871 Ok(())
3872 }
3873 }
3874
3875 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3876 for SessionManagerStartTraceSessionOnBootRequest
3877 {
3878 #[inline(always)]
3879 fn new_empty() -> Self {
3880 Self {
3881 config: fidl::new_empty!(
3882 TraceConfig,
3883 fidl::encoding::DefaultFuchsiaResourceDialect
3884 ),
3885 options: fidl::new_empty!(
3886 TraceOptions,
3887 fidl::encoding::DefaultFuchsiaResourceDialect
3888 ),
3889 }
3890 }
3891
3892 #[inline]
3893 unsafe fn decode(
3894 &mut self,
3895 decoder: &mut fidl::encoding::Decoder<
3896 '_,
3897 fidl::encoding::DefaultFuchsiaResourceDialect,
3898 >,
3899 offset: usize,
3900 _depth: fidl::encoding::Depth,
3901 ) -> fidl::Result<()> {
3902 decoder.debug_check_bounds::<Self>(offset);
3903 fidl::decode!(
3905 TraceConfig,
3906 fidl::encoding::DefaultFuchsiaResourceDialect,
3907 &mut self.config,
3908 decoder,
3909 offset + 0,
3910 _depth
3911 )?;
3912 fidl::decode!(
3913 TraceOptions,
3914 fidl::encoding::DefaultFuchsiaResourceDialect,
3915 &mut self.options,
3916 decoder,
3917 offset + 16,
3918 _depth
3919 )?;
3920 Ok(())
3921 }
3922 }
3923
3924 impl fidl::encoding::ResourceTypeMarker for SessionManagerStartTraceSessionRequest {
3925 type Borrowed<'a> = &'a mut Self;
3926 fn take_or_borrow<'a>(
3927 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3928 ) -> Self::Borrowed<'a> {
3929 value
3930 }
3931 }
3932
3933 unsafe impl fidl::encoding::TypeMarker for SessionManagerStartTraceSessionRequest {
3934 type Owned = Self;
3935
3936 #[inline(always)]
3937 fn inline_align(_context: fidl::encoding::Context) -> usize {
3938 8
3939 }
3940
3941 #[inline(always)]
3942 fn inline_size(_context: fidl::encoding::Context) -> usize {
3943 32
3944 }
3945 }
3946
3947 unsafe impl
3948 fidl::encoding::Encode<
3949 SessionManagerStartTraceSessionRequest,
3950 fidl::encoding::DefaultFuchsiaResourceDialect,
3951 > for &mut SessionManagerStartTraceSessionRequest
3952 {
3953 #[inline]
3954 unsafe fn encode(
3955 self,
3956 encoder: &mut fidl::encoding::Encoder<
3957 '_,
3958 fidl::encoding::DefaultFuchsiaResourceDialect,
3959 >,
3960 offset: usize,
3961 _depth: fidl::encoding::Depth,
3962 ) -> fidl::Result<()> {
3963 encoder.debug_check_bounds::<SessionManagerStartTraceSessionRequest>(offset);
3964 fidl::encoding::Encode::<
3966 SessionManagerStartTraceSessionRequest,
3967 fidl::encoding::DefaultFuchsiaResourceDialect,
3968 >::encode(
3969 (
3970 <TraceConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
3971 <TraceOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
3972 ),
3973 encoder,
3974 offset,
3975 _depth,
3976 )
3977 }
3978 }
3979 unsafe impl<
3980 T0: fidl::encoding::Encode<TraceConfig, fidl::encoding::DefaultFuchsiaResourceDialect>,
3981 T1: fidl::encoding::Encode<TraceOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
3982 >
3983 fidl::encoding::Encode<
3984 SessionManagerStartTraceSessionRequest,
3985 fidl::encoding::DefaultFuchsiaResourceDialect,
3986 > for (T0, T1)
3987 {
3988 #[inline]
3989 unsafe fn encode(
3990 self,
3991 encoder: &mut fidl::encoding::Encoder<
3992 '_,
3993 fidl::encoding::DefaultFuchsiaResourceDialect,
3994 >,
3995 offset: usize,
3996 depth: fidl::encoding::Depth,
3997 ) -> fidl::Result<()> {
3998 encoder.debug_check_bounds::<SessionManagerStartTraceSessionRequest>(offset);
3999 self.0.encode(encoder, offset + 0, depth)?;
4003 self.1.encode(encoder, offset + 16, depth)?;
4004 Ok(())
4005 }
4006 }
4007
4008 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4009 for SessionManagerStartTraceSessionRequest
4010 {
4011 #[inline(always)]
4012 fn new_empty() -> Self {
4013 Self {
4014 config: fidl::new_empty!(
4015 TraceConfig,
4016 fidl::encoding::DefaultFuchsiaResourceDialect
4017 ),
4018 options: fidl::new_empty!(
4019 TraceOptions,
4020 fidl::encoding::DefaultFuchsiaResourceDialect
4021 ),
4022 }
4023 }
4024
4025 #[inline]
4026 unsafe fn decode(
4027 &mut self,
4028 decoder: &mut fidl::encoding::Decoder<
4029 '_,
4030 fidl::encoding::DefaultFuchsiaResourceDialect,
4031 >,
4032 offset: usize,
4033 _depth: fidl::encoding::Depth,
4034 ) -> fidl::Result<()> {
4035 decoder.debug_check_bounds::<Self>(offset);
4036 fidl::decode!(
4038 TraceConfig,
4039 fidl::encoding::DefaultFuchsiaResourceDialect,
4040 &mut self.config,
4041 decoder,
4042 offset + 0,
4043 _depth
4044 )?;
4045 fidl::decode!(
4046 TraceOptions,
4047 fidl::encoding::DefaultFuchsiaResourceDialect,
4048 &mut self.options,
4049 decoder,
4050 offset + 16,
4051 _depth
4052 )?;
4053 Ok(())
4054 }
4055 }
4056}