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_gpu_magma_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DependencyInjectionSetMemoryPressureProviderRequest {
16 pub provider: fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for DependencyInjectionSetMemoryPressureProviderRequest
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct DeviceConnect2Request {
26 pub client_id: u64,
27 pub primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
28 pub notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DeviceConnect2Request {}
32
33#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34pub struct PerformanceCounterAccessGetPerformanceCountTokenResponse {
35 pub access_token: fidl::Event,
36}
37
38impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
39 for PerformanceCounterAccessGetPerformanceCountTokenResponse
40{
41}
42
43#[derive(Debug, PartialEq)]
44pub struct PowerElementProviderGetPowerGoalsResponse {
45 pub goals: Vec<PowerGoal>,
46}
47
48impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
49 for PowerElementProviderGetPowerGoalsResponse
50{
51}
52
53#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
54pub struct PrimaryCreatePerformanceCounterBufferPoolRequest {
55 pub pool_id: u64,
56 pub event_channel: fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
57}
58
59impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
60 for PrimaryCreatePerformanceCounterBufferPoolRequest
61{
62}
63
64#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
65pub struct PrimaryEnablePerformanceCounterAccessRequest {
66 pub access_token: fidl::Event,
67}
68
69impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
70 for PrimaryEnablePerformanceCounterAccessRequest
71{
72}
73
74#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
75pub struct PrimaryImportObject2Request {
76 pub object: fidl::Handle,
77 pub object_type: ObjectType,
78 pub object_id: u64,
79}
80
81impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
82 for PrimaryImportObject2Request
83{
84}
85
86#[derive(Debug, Default, PartialEq)]
87pub struct PowerElementProviderGetClockSpeedLevelResponse {
88 pub token: Option<fidl::Event>,
90 pub level: Option<u8>,
92 pub actual_hz: Option<u64>,
96 #[doc(hidden)]
97 pub __source_breaking: fidl::marker::SourceBreaking,
98}
99
100impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
101 for PowerElementProviderGetClockSpeedLevelResponse
102{
103}
104
105#[derive(Debug, Default, PartialEq)]
106pub struct PowerElementProviderSetClockLimitResponse {
107 pub handle: Option<fidl::EventPair>,
110 pub actual_hz: Option<u64>,
113 #[doc(hidden)]
114 pub __source_breaking: fidl::marker::SourceBreaking,
115}
116
117impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
118 for PowerElementProviderSetClockLimitResponse
119{
120}
121
122#[derive(Debug, Default, PartialEq)]
125pub struct PowerGoal {
126 pub type_: Option<PowerGoalType>,
128 pub token: Option<fidl::Event>,
131 #[doc(hidden)]
132 pub __source_breaking: fidl::marker::SourceBreaking,
133}
134
135impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PowerGoal {}
136
137#[derive(Debug, Default, PartialEq)]
138pub struct PrimaryImportObjectRequest {
139 pub object: Option<Object>,
141 pub object_type: Option<ObjectType>,
143 pub object_id: Option<u64>,
145 pub flags: Option<ImportFlags>,
147 #[doc(hidden)]
148 pub __source_breaking: fidl::marker::SourceBreaking,
149}
150
151impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
152 for PrimaryImportObjectRequest
153{
154}
155
156#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157pub enum DeviceQueryResponse {
158 SimpleResult(u64),
159 BufferResult(fidl::Vmo),
160}
161
162impl DeviceQueryResponse {
163 #[inline]
164 pub fn ordinal(&self) -> u64 {
165 match *self {
166 Self::SimpleResult(_) => 1,
167 Self::BufferResult(_) => 2,
168 }
169 }
170
171 #[deprecated = "Strict unions should not use `is_unknown`"]
172 #[inline]
173 pub fn is_unknown(&self) -> bool {
174 false
175 }
176}
177
178impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DeviceQueryResponse {}
179
180#[derive(Debug)]
181pub enum Object {
182 Semaphore(fidl::Event),
183 Buffer(fidl::Vmo),
184 VmoSemaphore(fidl::Vmo),
185 #[doc(hidden)]
186 __SourceBreaking {
187 unknown_ordinal: u64,
188 },
189}
190
191#[macro_export]
193macro_rules! ObjectUnknown {
194 () => {
195 _
196 };
197}
198
199impl PartialEq for Object {
201 fn eq(&self, other: &Self) -> bool {
202 match (self, other) {
203 (Self::Semaphore(x), Self::Semaphore(y)) => *x == *y,
204 (Self::Buffer(x), Self::Buffer(y)) => *x == *y,
205 (Self::VmoSemaphore(x), Self::VmoSemaphore(y)) => *x == *y,
206 _ => false,
207 }
208 }
209}
210
211impl Object {
212 #[inline]
213 pub fn ordinal(&self) -> u64 {
214 match *self {
215 Self::Semaphore(_) => 1,
216 Self::Buffer(_) => 2,
217 Self::VmoSemaphore(_) => 3,
218 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
219 }
220 }
221
222 #[inline]
223 pub fn unknown_variant_for_testing() -> Self {
224 Self::__SourceBreaking { unknown_ordinal: 0 }
225 }
226
227 #[inline]
228 pub fn is_unknown(&self) -> bool {
229 match self {
230 Self::__SourceBreaking { .. } => true,
231 _ => false,
232 }
233 }
234}
235
236impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Object {}
237
238#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
239pub struct CombinedDeviceMarker;
240
241impl fidl::endpoints::ProtocolMarker for CombinedDeviceMarker {
242 type Proxy = CombinedDeviceProxy;
243 type RequestStream = CombinedDeviceRequestStream;
244 #[cfg(target_os = "fuchsia")]
245 type SynchronousProxy = CombinedDeviceSynchronousProxy;
246
247 const DEBUG_NAME: &'static str = "(anonymous) CombinedDevice";
248}
249
250pub trait CombinedDeviceProxyInterface: Send + Sync {
251 type QueryResponseFut: std::future::Future<Output = Result<DeviceQueryResult, fidl::Error>>
252 + Send;
253 fn r#query(&self, query_id: QueryId) -> Self::QueryResponseFut;
254 fn r#connect2(
255 &self,
256 client_id: u64,
257 primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
258 notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
259 ) -> Result<(), fidl::Error>;
260 fn r#dump_state(&self, dump_type: u32) -> Result<(), fidl::Error>;
261 type GetIcdListResponseFut: std::future::Future<Output = Result<Vec<IcdInfo>, fidl::Error>>
262 + Send;
263 fn r#get_icd_list(&self) -> Self::GetIcdListResponseFut;
264}
265#[derive(Debug)]
266#[cfg(target_os = "fuchsia")]
267pub struct CombinedDeviceSynchronousProxy {
268 client: fidl::client::sync::Client,
269}
270
271#[cfg(target_os = "fuchsia")]
272impl fidl::endpoints::SynchronousProxy for CombinedDeviceSynchronousProxy {
273 type Proxy = CombinedDeviceProxy;
274 type Protocol = CombinedDeviceMarker;
275
276 fn from_channel(inner: fidl::Channel) -> Self {
277 Self::new(inner)
278 }
279
280 fn into_channel(self) -> fidl::Channel {
281 self.client.into_channel()
282 }
283
284 fn as_channel(&self) -> &fidl::Channel {
285 self.client.as_channel()
286 }
287}
288
289#[cfg(target_os = "fuchsia")]
290impl CombinedDeviceSynchronousProxy {
291 pub fn new(channel: fidl::Channel) -> Self {
292 let protocol_name = <CombinedDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
293 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
294 }
295
296 pub fn into_channel(self) -> fidl::Channel {
297 self.client.into_channel()
298 }
299
300 pub fn wait_for_event(
303 &self,
304 deadline: zx::MonotonicInstant,
305 ) -> Result<CombinedDeviceEvent, fidl::Error> {
306 CombinedDeviceEvent::decode(self.client.wait_for_event(deadline)?)
307 }
308
309 pub fn r#query(
311 &self,
312 mut query_id: QueryId,
313 ___deadline: zx::MonotonicInstant,
314 ) -> Result<DeviceQueryResult, fidl::Error> {
315 let _response = self
316 .client
317 .send_query::<DeviceQueryRequest, fidl::encoding::ResultType<DeviceQueryResponse, i32>>(
318 (query_id,),
319 0x627d4c6093b078e7,
320 fidl::encoding::DynamicFlags::empty(),
321 ___deadline,
322 )?;
323 Ok(_response.map(|x| x))
324 }
325
326 pub fn r#connect2(
331 &self,
332 mut client_id: u64,
333 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
334 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
335 ) -> Result<(), fidl::Error> {
336 self.client.send::<DeviceConnect2Request>(
337 (client_id, primary_channel, notification_channel),
338 0x3a5b134714c67914,
339 fidl::encoding::DynamicFlags::empty(),
340 )
341 }
342
343 pub fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
345 self.client.send::<DiagnosticDeviceDumpStateRequest>(
346 (dump_type,),
347 0x5420df493d4fa915,
348 fidl::encoding::DynamicFlags::empty(),
349 )
350 }
351
352 pub fn r#get_icd_list(
355 &self,
356 ___deadline: zx::MonotonicInstant,
357 ) -> Result<Vec<IcdInfo>, fidl::Error> {
358 let _response = self
359 .client
360 .send_query::<fidl::encoding::EmptyPayload, IcdLoaderDeviceGetIcdListResponse>(
361 (),
362 0x7673e76395008257,
363 fidl::encoding::DynamicFlags::empty(),
364 ___deadline,
365 )?;
366 Ok(_response.icd_list)
367 }
368}
369
370#[cfg(target_os = "fuchsia")]
371impl From<CombinedDeviceSynchronousProxy> for zx::Handle {
372 fn from(value: CombinedDeviceSynchronousProxy) -> Self {
373 value.into_channel().into()
374 }
375}
376
377#[cfg(target_os = "fuchsia")]
378impl From<fidl::Channel> for CombinedDeviceSynchronousProxy {
379 fn from(value: fidl::Channel) -> Self {
380 Self::new(value)
381 }
382}
383
384#[derive(Debug, Clone)]
385pub struct CombinedDeviceProxy {
386 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
387}
388
389impl fidl::endpoints::Proxy for CombinedDeviceProxy {
390 type Protocol = CombinedDeviceMarker;
391
392 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
393 Self::new(inner)
394 }
395
396 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
397 self.client.into_channel().map_err(|client| Self { client })
398 }
399
400 fn as_channel(&self) -> &::fidl::AsyncChannel {
401 self.client.as_channel()
402 }
403}
404
405impl CombinedDeviceProxy {
406 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
408 let protocol_name = <CombinedDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
409 Self { client: fidl::client::Client::new(channel, protocol_name) }
410 }
411
412 pub fn take_event_stream(&self) -> CombinedDeviceEventStream {
418 CombinedDeviceEventStream { event_receiver: self.client.take_event_receiver() }
419 }
420
421 pub fn r#query(
423 &self,
424 mut query_id: QueryId,
425 ) -> fidl::client::QueryResponseFut<
426 DeviceQueryResult,
427 fidl::encoding::DefaultFuchsiaResourceDialect,
428 > {
429 CombinedDeviceProxyInterface::r#query(self, query_id)
430 }
431
432 pub fn r#connect2(
437 &self,
438 mut client_id: u64,
439 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
440 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
441 ) -> Result<(), fidl::Error> {
442 CombinedDeviceProxyInterface::r#connect2(
443 self,
444 client_id,
445 primary_channel,
446 notification_channel,
447 )
448 }
449
450 pub fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
452 CombinedDeviceProxyInterface::r#dump_state(self, dump_type)
453 }
454
455 pub fn r#get_icd_list(
458 &self,
459 ) -> fidl::client::QueryResponseFut<Vec<IcdInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>
460 {
461 CombinedDeviceProxyInterface::r#get_icd_list(self)
462 }
463}
464
465impl CombinedDeviceProxyInterface for CombinedDeviceProxy {
466 type QueryResponseFut = fidl::client::QueryResponseFut<
467 DeviceQueryResult,
468 fidl::encoding::DefaultFuchsiaResourceDialect,
469 >;
470 fn r#query(&self, mut query_id: QueryId) -> Self::QueryResponseFut {
471 fn _decode(
472 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
473 ) -> Result<DeviceQueryResult, fidl::Error> {
474 let _response = fidl::client::decode_transaction_body::<
475 fidl::encoding::ResultType<DeviceQueryResponse, i32>,
476 fidl::encoding::DefaultFuchsiaResourceDialect,
477 0x627d4c6093b078e7,
478 >(_buf?)?;
479 Ok(_response.map(|x| x))
480 }
481 self.client.send_query_and_decode::<DeviceQueryRequest, DeviceQueryResult>(
482 (query_id,),
483 0x627d4c6093b078e7,
484 fidl::encoding::DynamicFlags::empty(),
485 _decode,
486 )
487 }
488
489 fn r#connect2(
490 &self,
491 mut client_id: u64,
492 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
493 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
494 ) -> Result<(), fidl::Error> {
495 self.client.send::<DeviceConnect2Request>(
496 (client_id, primary_channel, notification_channel),
497 0x3a5b134714c67914,
498 fidl::encoding::DynamicFlags::empty(),
499 )
500 }
501
502 fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
503 self.client.send::<DiagnosticDeviceDumpStateRequest>(
504 (dump_type,),
505 0x5420df493d4fa915,
506 fidl::encoding::DynamicFlags::empty(),
507 )
508 }
509
510 type GetIcdListResponseFut =
511 fidl::client::QueryResponseFut<Vec<IcdInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>;
512 fn r#get_icd_list(&self) -> Self::GetIcdListResponseFut {
513 fn _decode(
514 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
515 ) -> Result<Vec<IcdInfo>, fidl::Error> {
516 let _response = fidl::client::decode_transaction_body::<
517 IcdLoaderDeviceGetIcdListResponse,
518 fidl::encoding::DefaultFuchsiaResourceDialect,
519 0x7673e76395008257,
520 >(_buf?)?;
521 Ok(_response.icd_list)
522 }
523 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<IcdInfo>>(
524 (),
525 0x7673e76395008257,
526 fidl::encoding::DynamicFlags::empty(),
527 _decode,
528 )
529 }
530}
531
532pub struct CombinedDeviceEventStream {
533 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
534}
535
536impl std::marker::Unpin for CombinedDeviceEventStream {}
537
538impl futures::stream::FusedStream for CombinedDeviceEventStream {
539 fn is_terminated(&self) -> bool {
540 self.event_receiver.is_terminated()
541 }
542}
543
544impl futures::Stream for CombinedDeviceEventStream {
545 type Item = Result<CombinedDeviceEvent, fidl::Error>;
546
547 fn poll_next(
548 mut self: std::pin::Pin<&mut Self>,
549 cx: &mut std::task::Context<'_>,
550 ) -> std::task::Poll<Option<Self::Item>> {
551 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
552 &mut self.event_receiver,
553 cx
554 )?) {
555 Some(buf) => std::task::Poll::Ready(Some(CombinedDeviceEvent::decode(buf))),
556 None => std::task::Poll::Ready(None),
557 }
558 }
559}
560
561#[derive(Debug)]
562pub enum CombinedDeviceEvent {}
563
564impl CombinedDeviceEvent {
565 fn decode(
567 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
568 ) -> Result<CombinedDeviceEvent, fidl::Error> {
569 let (bytes, _handles) = buf.split_mut();
570 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
571 debug_assert_eq!(tx_header.tx_id, 0);
572 match tx_header.ordinal {
573 _ => Err(fidl::Error::UnknownOrdinal {
574 ordinal: tx_header.ordinal,
575 protocol_name:
576 <CombinedDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
577 }),
578 }
579 }
580}
581
582pub struct CombinedDeviceRequestStream {
584 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
585 is_terminated: bool,
586}
587
588impl std::marker::Unpin for CombinedDeviceRequestStream {}
589
590impl futures::stream::FusedStream for CombinedDeviceRequestStream {
591 fn is_terminated(&self) -> bool {
592 self.is_terminated
593 }
594}
595
596impl fidl::endpoints::RequestStream for CombinedDeviceRequestStream {
597 type Protocol = CombinedDeviceMarker;
598 type ControlHandle = CombinedDeviceControlHandle;
599
600 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
601 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
602 }
603
604 fn control_handle(&self) -> Self::ControlHandle {
605 CombinedDeviceControlHandle { inner: self.inner.clone() }
606 }
607
608 fn into_inner(
609 self,
610 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
611 {
612 (self.inner, self.is_terminated)
613 }
614
615 fn from_inner(
616 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
617 is_terminated: bool,
618 ) -> Self {
619 Self { inner, is_terminated }
620 }
621}
622
623impl futures::Stream for CombinedDeviceRequestStream {
624 type Item = Result<CombinedDeviceRequest, fidl::Error>;
625
626 fn poll_next(
627 mut self: std::pin::Pin<&mut Self>,
628 cx: &mut std::task::Context<'_>,
629 ) -> std::task::Poll<Option<Self::Item>> {
630 let this = &mut *self;
631 if this.inner.check_shutdown(cx) {
632 this.is_terminated = true;
633 return std::task::Poll::Ready(None);
634 }
635 if this.is_terminated {
636 panic!("polled CombinedDeviceRequestStream after completion");
637 }
638 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
639 |bytes, handles| {
640 match this.inner.channel().read_etc(cx, bytes, handles) {
641 std::task::Poll::Ready(Ok(())) => {}
642 std::task::Poll::Pending => return std::task::Poll::Pending,
643 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
644 this.is_terminated = true;
645 return std::task::Poll::Ready(None);
646 }
647 std::task::Poll::Ready(Err(e)) => {
648 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
649 e.into(),
650 ))))
651 }
652 }
653
654 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
656
657 std::task::Poll::Ready(Some(match header.ordinal {
658 0x627d4c6093b078e7 => {
659 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
660 let mut req = fidl::new_empty!(
661 DeviceQueryRequest,
662 fidl::encoding::DefaultFuchsiaResourceDialect
663 );
664 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceQueryRequest>(&header, _body_bytes, handles, &mut req)?;
665 let control_handle =
666 CombinedDeviceControlHandle { inner: this.inner.clone() };
667 Ok(CombinedDeviceRequest::Query {
668 query_id: req.query_id,
669
670 responder: CombinedDeviceQueryResponder {
671 control_handle: std::mem::ManuallyDrop::new(control_handle),
672 tx_id: header.tx_id,
673 },
674 })
675 }
676 0x3a5b134714c67914 => {
677 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
678 let mut req = fidl::new_empty!(
679 DeviceConnect2Request,
680 fidl::encoding::DefaultFuchsiaResourceDialect
681 );
682 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnect2Request>(&header, _body_bytes, handles, &mut req)?;
683 let control_handle =
684 CombinedDeviceControlHandle { inner: this.inner.clone() };
685 Ok(CombinedDeviceRequest::Connect2 {
686 client_id: req.client_id,
687 primary_channel: req.primary_channel,
688 notification_channel: req.notification_channel,
689
690 control_handle,
691 })
692 }
693 0x5420df493d4fa915 => {
694 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
695 let mut req = fidl::new_empty!(
696 DiagnosticDeviceDumpStateRequest,
697 fidl::encoding::DefaultFuchsiaResourceDialect
698 );
699 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DiagnosticDeviceDumpStateRequest>(&header, _body_bytes, handles, &mut req)?;
700 let control_handle =
701 CombinedDeviceControlHandle { inner: this.inner.clone() };
702 Ok(CombinedDeviceRequest::DumpState {
703 dump_type: req.dump_type,
704
705 control_handle,
706 })
707 }
708 0x7673e76395008257 => {
709 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
710 let mut req = fidl::new_empty!(
711 fidl::encoding::EmptyPayload,
712 fidl::encoding::DefaultFuchsiaResourceDialect
713 );
714 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
715 let control_handle =
716 CombinedDeviceControlHandle { inner: this.inner.clone() };
717 Ok(CombinedDeviceRequest::GetIcdList {
718 responder: CombinedDeviceGetIcdListResponder {
719 control_handle: std::mem::ManuallyDrop::new(control_handle),
720 tx_id: header.tx_id,
721 },
722 })
723 }
724 _ => Err(fidl::Error::UnknownOrdinal {
725 ordinal: header.ordinal,
726 protocol_name:
727 <CombinedDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
728 }),
729 }))
730 },
731 )
732 }
733}
734
735#[derive(Debug)]
738pub enum CombinedDeviceRequest {
739 Query { query_id: QueryId, responder: CombinedDeviceQueryResponder },
741 Connect2 {
746 client_id: u64,
747 primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
748 notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
749 control_handle: CombinedDeviceControlHandle,
750 },
751 DumpState { dump_type: u32, control_handle: CombinedDeviceControlHandle },
753 GetIcdList { responder: CombinedDeviceGetIcdListResponder },
756}
757
758impl CombinedDeviceRequest {
759 #[allow(irrefutable_let_patterns)]
760 pub fn into_query(self) -> Option<(QueryId, CombinedDeviceQueryResponder)> {
761 if let CombinedDeviceRequest::Query { query_id, responder } = self {
762 Some((query_id, responder))
763 } else {
764 None
765 }
766 }
767
768 #[allow(irrefutable_let_patterns)]
769 pub fn into_connect2(
770 self,
771 ) -> Option<(
772 u64,
773 fidl::endpoints::ServerEnd<PrimaryMarker>,
774 fidl::endpoints::ServerEnd<NotificationMarker>,
775 CombinedDeviceControlHandle,
776 )> {
777 if let CombinedDeviceRequest::Connect2 {
778 client_id,
779 primary_channel,
780 notification_channel,
781 control_handle,
782 } = self
783 {
784 Some((client_id, primary_channel, notification_channel, control_handle))
785 } else {
786 None
787 }
788 }
789
790 #[allow(irrefutable_let_patterns)]
791 pub fn into_dump_state(self) -> Option<(u32, CombinedDeviceControlHandle)> {
792 if let CombinedDeviceRequest::DumpState { dump_type, control_handle } = self {
793 Some((dump_type, control_handle))
794 } else {
795 None
796 }
797 }
798
799 #[allow(irrefutable_let_patterns)]
800 pub fn into_get_icd_list(self) -> Option<(CombinedDeviceGetIcdListResponder)> {
801 if let CombinedDeviceRequest::GetIcdList { responder } = self {
802 Some((responder))
803 } else {
804 None
805 }
806 }
807
808 pub fn method_name(&self) -> &'static str {
810 match *self {
811 CombinedDeviceRequest::Query { .. } => "query",
812 CombinedDeviceRequest::Connect2 { .. } => "connect2",
813 CombinedDeviceRequest::DumpState { .. } => "dump_state",
814 CombinedDeviceRequest::GetIcdList { .. } => "get_icd_list",
815 }
816 }
817}
818
819#[derive(Debug, Clone)]
820pub struct CombinedDeviceControlHandle {
821 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
822}
823
824impl fidl::endpoints::ControlHandle for CombinedDeviceControlHandle {
825 fn shutdown(&self) {
826 self.inner.shutdown()
827 }
828 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
829 self.inner.shutdown_with_epitaph(status)
830 }
831
832 fn is_closed(&self) -> bool {
833 self.inner.channel().is_closed()
834 }
835 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
836 self.inner.channel().on_closed()
837 }
838
839 #[cfg(target_os = "fuchsia")]
840 fn signal_peer(
841 &self,
842 clear_mask: zx::Signals,
843 set_mask: zx::Signals,
844 ) -> Result<(), zx_status::Status> {
845 use fidl::Peered;
846 self.inner.channel().signal_peer(clear_mask, set_mask)
847 }
848}
849
850impl CombinedDeviceControlHandle {}
851
852#[must_use = "FIDL methods require a response to be sent"]
853#[derive(Debug)]
854pub struct CombinedDeviceQueryResponder {
855 control_handle: std::mem::ManuallyDrop<CombinedDeviceControlHandle>,
856 tx_id: u32,
857}
858
859impl std::ops::Drop for CombinedDeviceQueryResponder {
863 fn drop(&mut self) {
864 self.control_handle.shutdown();
865 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
867 }
868}
869
870impl fidl::endpoints::Responder for CombinedDeviceQueryResponder {
871 type ControlHandle = CombinedDeviceControlHandle;
872
873 fn control_handle(&self) -> &CombinedDeviceControlHandle {
874 &self.control_handle
875 }
876
877 fn drop_without_shutdown(mut self) {
878 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
880 std::mem::forget(self);
882 }
883}
884
885impl CombinedDeviceQueryResponder {
886 pub fn send(self, mut result: Result<DeviceQueryResponse, i32>) -> Result<(), fidl::Error> {
890 let _result = self.send_raw(result);
891 if _result.is_err() {
892 self.control_handle.shutdown();
893 }
894 self.drop_without_shutdown();
895 _result
896 }
897
898 pub fn send_no_shutdown_on_err(
900 self,
901 mut result: Result<DeviceQueryResponse, i32>,
902 ) -> Result<(), fidl::Error> {
903 let _result = self.send_raw(result);
904 self.drop_without_shutdown();
905 _result
906 }
907
908 fn send_raw(&self, mut result: Result<DeviceQueryResponse, i32>) -> Result<(), fidl::Error> {
909 self.control_handle.inner.send::<fidl::encoding::ResultType<DeviceQueryResponse, i32>>(
910 result.as_mut().map_err(|e| *e),
911 self.tx_id,
912 0x627d4c6093b078e7,
913 fidl::encoding::DynamicFlags::empty(),
914 )
915 }
916}
917
918#[must_use = "FIDL methods require a response to be sent"]
919#[derive(Debug)]
920pub struct CombinedDeviceGetIcdListResponder {
921 control_handle: std::mem::ManuallyDrop<CombinedDeviceControlHandle>,
922 tx_id: u32,
923}
924
925impl std::ops::Drop for CombinedDeviceGetIcdListResponder {
929 fn drop(&mut self) {
930 self.control_handle.shutdown();
931 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
933 }
934}
935
936impl fidl::endpoints::Responder for CombinedDeviceGetIcdListResponder {
937 type ControlHandle = CombinedDeviceControlHandle;
938
939 fn control_handle(&self) -> &CombinedDeviceControlHandle {
940 &self.control_handle
941 }
942
943 fn drop_without_shutdown(mut self) {
944 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
946 std::mem::forget(self);
948 }
949}
950
951impl CombinedDeviceGetIcdListResponder {
952 pub fn send(self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
956 let _result = self.send_raw(icd_list);
957 if _result.is_err() {
958 self.control_handle.shutdown();
959 }
960 self.drop_without_shutdown();
961 _result
962 }
963
964 pub fn send_no_shutdown_on_err(self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
966 let _result = self.send_raw(icd_list);
967 self.drop_without_shutdown();
968 _result
969 }
970
971 fn send_raw(&self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
972 self.control_handle.inner.send::<IcdLoaderDeviceGetIcdListResponse>(
973 (icd_list,),
974 self.tx_id,
975 0x7673e76395008257,
976 fidl::encoding::DynamicFlags::empty(),
977 )
978 }
979}
980
981#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
982pub struct DependencyInjectionMarker;
983
984impl fidl::endpoints::ProtocolMarker for DependencyInjectionMarker {
985 type Proxy = DependencyInjectionProxy;
986 type RequestStream = DependencyInjectionRequestStream;
987 #[cfg(target_os = "fuchsia")]
988 type SynchronousProxy = DependencyInjectionSynchronousProxy;
989
990 const DEBUG_NAME: &'static str = "(anonymous) DependencyInjection";
991}
992
993pub trait DependencyInjectionProxyInterface: Send + Sync {
994 fn r#set_memory_pressure_provider(
995 &self,
996 provider: fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
997 ) -> Result<(), fidl::Error>;
998}
999#[derive(Debug)]
1000#[cfg(target_os = "fuchsia")]
1001pub struct DependencyInjectionSynchronousProxy {
1002 client: fidl::client::sync::Client,
1003}
1004
1005#[cfg(target_os = "fuchsia")]
1006impl fidl::endpoints::SynchronousProxy for DependencyInjectionSynchronousProxy {
1007 type Proxy = DependencyInjectionProxy;
1008 type Protocol = DependencyInjectionMarker;
1009
1010 fn from_channel(inner: fidl::Channel) -> Self {
1011 Self::new(inner)
1012 }
1013
1014 fn into_channel(self) -> fidl::Channel {
1015 self.client.into_channel()
1016 }
1017
1018 fn as_channel(&self) -> &fidl::Channel {
1019 self.client.as_channel()
1020 }
1021}
1022
1023#[cfg(target_os = "fuchsia")]
1024impl DependencyInjectionSynchronousProxy {
1025 pub fn new(channel: fidl::Channel) -> Self {
1026 let protocol_name =
1027 <DependencyInjectionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1028 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1029 }
1030
1031 pub fn into_channel(self) -> fidl::Channel {
1032 self.client.into_channel()
1033 }
1034
1035 pub fn wait_for_event(
1038 &self,
1039 deadline: zx::MonotonicInstant,
1040 ) -> Result<DependencyInjectionEvent, fidl::Error> {
1041 DependencyInjectionEvent::decode(self.client.wait_for_event(deadline)?)
1042 }
1043
1044 pub fn r#set_memory_pressure_provider(
1046 &self,
1047 mut provider: fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
1048 ) -> Result<(), fidl::Error> {
1049 self.client.send::<DependencyInjectionSetMemoryPressureProviderRequest>(
1050 (provider,),
1051 0x5ef0be960d4b0f4c,
1052 fidl::encoding::DynamicFlags::empty(),
1053 )
1054 }
1055}
1056
1057#[cfg(target_os = "fuchsia")]
1058impl From<DependencyInjectionSynchronousProxy> for zx::Handle {
1059 fn from(value: DependencyInjectionSynchronousProxy) -> Self {
1060 value.into_channel().into()
1061 }
1062}
1063
1064#[cfg(target_os = "fuchsia")]
1065impl From<fidl::Channel> for DependencyInjectionSynchronousProxy {
1066 fn from(value: fidl::Channel) -> Self {
1067 Self::new(value)
1068 }
1069}
1070
1071#[derive(Debug, Clone)]
1072pub struct DependencyInjectionProxy {
1073 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1074}
1075
1076impl fidl::endpoints::Proxy for DependencyInjectionProxy {
1077 type Protocol = DependencyInjectionMarker;
1078
1079 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1080 Self::new(inner)
1081 }
1082
1083 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1084 self.client.into_channel().map_err(|client| Self { client })
1085 }
1086
1087 fn as_channel(&self) -> &::fidl::AsyncChannel {
1088 self.client.as_channel()
1089 }
1090}
1091
1092impl DependencyInjectionProxy {
1093 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1095 let protocol_name =
1096 <DependencyInjectionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1097 Self { client: fidl::client::Client::new(channel, protocol_name) }
1098 }
1099
1100 pub fn take_event_stream(&self) -> DependencyInjectionEventStream {
1106 DependencyInjectionEventStream { event_receiver: self.client.take_event_receiver() }
1107 }
1108
1109 pub fn r#set_memory_pressure_provider(
1111 &self,
1112 mut provider: fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
1113 ) -> Result<(), fidl::Error> {
1114 DependencyInjectionProxyInterface::r#set_memory_pressure_provider(self, provider)
1115 }
1116}
1117
1118impl DependencyInjectionProxyInterface for DependencyInjectionProxy {
1119 fn r#set_memory_pressure_provider(
1120 &self,
1121 mut provider: fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
1122 ) -> Result<(), fidl::Error> {
1123 self.client.send::<DependencyInjectionSetMemoryPressureProviderRequest>(
1124 (provider,),
1125 0x5ef0be960d4b0f4c,
1126 fidl::encoding::DynamicFlags::empty(),
1127 )
1128 }
1129}
1130
1131pub struct DependencyInjectionEventStream {
1132 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1133}
1134
1135impl std::marker::Unpin for DependencyInjectionEventStream {}
1136
1137impl futures::stream::FusedStream for DependencyInjectionEventStream {
1138 fn is_terminated(&self) -> bool {
1139 self.event_receiver.is_terminated()
1140 }
1141}
1142
1143impl futures::Stream for DependencyInjectionEventStream {
1144 type Item = Result<DependencyInjectionEvent, fidl::Error>;
1145
1146 fn poll_next(
1147 mut self: std::pin::Pin<&mut Self>,
1148 cx: &mut std::task::Context<'_>,
1149 ) -> std::task::Poll<Option<Self::Item>> {
1150 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1151 &mut self.event_receiver,
1152 cx
1153 )?) {
1154 Some(buf) => std::task::Poll::Ready(Some(DependencyInjectionEvent::decode(buf))),
1155 None => std::task::Poll::Ready(None),
1156 }
1157 }
1158}
1159
1160#[derive(Debug)]
1161pub enum DependencyInjectionEvent {}
1162
1163impl DependencyInjectionEvent {
1164 fn decode(
1166 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1167 ) -> Result<DependencyInjectionEvent, fidl::Error> {
1168 let (bytes, _handles) = buf.split_mut();
1169 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1170 debug_assert_eq!(tx_header.tx_id, 0);
1171 match tx_header.ordinal {
1172 _ => Err(fidl::Error::UnknownOrdinal {
1173 ordinal: tx_header.ordinal,
1174 protocol_name:
1175 <DependencyInjectionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1176 }),
1177 }
1178 }
1179}
1180
1181pub struct DependencyInjectionRequestStream {
1183 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1184 is_terminated: bool,
1185}
1186
1187impl std::marker::Unpin for DependencyInjectionRequestStream {}
1188
1189impl futures::stream::FusedStream for DependencyInjectionRequestStream {
1190 fn is_terminated(&self) -> bool {
1191 self.is_terminated
1192 }
1193}
1194
1195impl fidl::endpoints::RequestStream for DependencyInjectionRequestStream {
1196 type Protocol = DependencyInjectionMarker;
1197 type ControlHandle = DependencyInjectionControlHandle;
1198
1199 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1200 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1201 }
1202
1203 fn control_handle(&self) -> Self::ControlHandle {
1204 DependencyInjectionControlHandle { inner: self.inner.clone() }
1205 }
1206
1207 fn into_inner(
1208 self,
1209 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1210 {
1211 (self.inner, self.is_terminated)
1212 }
1213
1214 fn from_inner(
1215 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1216 is_terminated: bool,
1217 ) -> Self {
1218 Self { inner, is_terminated }
1219 }
1220}
1221
1222impl futures::Stream for DependencyInjectionRequestStream {
1223 type Item = Result<DependencyInjectionRequest, fidl::Error>;
1224
1225 fn poll_next(
1226 mut self: std::pin::Pin<&mut Self>,
1227 cx: &mut std::task::Context<'_>,
1228 ) -> std::task::Poll<Option<Self::Item>> {
1229 let this = &mut *self;
1230 if this.inner.check_shutdown(cx) {
1231 this.is_terminated = true;
1232 return std::task::Poll::Ready(None);
1233 }
1234 if this.is_terminated {
1235 panic!("polled DependencyInjectionRequestStream after completion");
1236 }
1237 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1238 |bytes, handles| {
1239 match this.inner.channel().read_etc(cx, bytes, handles) {
1240 std::task::Poll::Ready(Ok(())) => {}
1241 std::task::Poll::Pending => return std::task::Poll::Pending,
1242 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1243 this.is_terminated = true;
1244 return std::task::Poll::Ready(None);
1245 }
1246 std::task::Poll::Ready(Err(e)) => {
1247 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1248 e.into(),
1249 ))))
1250 }
1251 }
1252
1253 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1255
1256 std::task::Poll::Ready(Some(match header.ordinal {
1257 0x5ef0be960d4b0f4c => {
1258 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1259 let mut req = fidl::new_empty!(DependencyInjectionSetMemoryPressureProviderRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1260 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DependencyInjectionSetMemoryPressureProviderRequest>(&header, _body_bytes, handles, &mut req)?;
1261 let control_handle = DependencyInjectionControlHandle {
1262 inner: this.inner.clone(),
1263 };
1264 Ok(DependencyInjectionRequest::SetMemoryPressureProvider {provider: req.provider,
1265
1266 control_handle,
1267 })
1268 }
1269 _ => Err(fidl::Error::UnknownOrdinal {
1270 ordinal: header.ordinal,
1271 protocol_name: <DependencyInjectionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1272 }),
1273 }))
1274 },
1275 )
1276 }
1277}
1278
1279#[derive(Debug)]
1283pub enum DependencyInjectionRequest {
1284 SetMemoryPressureProvider {
1286 provider: fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
1287 control_handle: DependencyInjectionControlHandle,
1288 },
1289}
1290
1291impl DependencyInjectionRequest {
1292 #[allow(irrefutable_let_patterns)]
1293 pub fn into_set_memory_pressure_provider(
1294 self,
1295 ) -> Option<(
1296 fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
1297 DependencyInjectionControlHandle,
1298 )> {
1299 if let DependencyInjectionRequest::SetMemoryPressureProvider { provider, control_handle } =
1300 self
1301 {
1302 Some((provider, control_handle))
1303 } else {
1304 None
1305 }
1306 }
1307
1308 pub fn method_name(&self) -> &'static str {
1310 match *self {
1311 DependencyInjectionRequest::SetMemoryPressureProvider { .. } => {
1312 "set_memory_pressure_provider"
1313 }
1314 }
1315 }
1316}
1317
1318#[derive(Debug, Clone)]
1319pub struct DependencyInjectionControlHandle {
1320 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1321}
1322
1323impl fidl::endpoints::ControlHandle for DependencyInjectionControlHandle {
1324 fn shutdown(&self) {
1325 self.inner.shutdown()
1326 }
1327 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1328 self.inner.shutdown_with_epitaph(status)
1329 }
1330
1331 fn is_closed(&self) -> bool {
1332 self.inner.channel().is_closed()
1333 }
1334 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1335 self.inner.channel().on_closed()
1336 }
1337
1338 #[cfg(target_os = "fuchsia")]
1339 fn signal_peer(
1340 &self,
1341 clear_mask: zx::Signals,
1342 set_mask: zx::Signals,
1343 ) -> Result<(), zx_status::Status> {
1344 use fidl::Peered;
1345 self.inner.channel().signal_peer(clear_mask, set_mask)
1346 }
1347}
1348
1349impl DependencyInjectionControlHandle {}
1350
1351#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1352pub struct DeviceMarker;
1353
1354impl fidl::endpoints::ProtocolMarker for DeviceMarker {
1355 type Proxy = DeviceProxy;
1356 type RequestStream = DeviceRequestStream;
1357 #[cfg(target_os = "fuchsia")]
1358 type SynchronousProxy = DeviceSynchronousProxy;
1359
1360 const DEBUG_NAME: &'static str = "(anonymous) Device";
1361}
1362pub type DeviceQueryResult = Result<DeviceQueryResponse, i32>;
1363
1364pub trait DeviceProxyInterface: Send + Sync {
1365 type QueryResponseFut: std::future::Future<Output = Result<DeviceQueryResult, fidl::Error>>
1366 + Send;
1367 fn r#query(&self, query_id: QueryId) -> Self::QueryResponseFut;
1368 fn r#connect2(
1369 &self,
1370 client_id: u64,
1371 primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
1372 notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
1373 ) -> Result<(), fidl::Error>;
1374}
1375#[derive(Debug)]
1376#[cfg(target_os = "fuchsia")]
1377pub struct DeviceSynchronousProxy {
1378 client: fidl::client::sync::Client,
1379}
1380
1381#[cfg(target_os = "fuchsia")]
1382impl fidl::endpoints::SynchronousProxy for DeviceSynchronousProxy {
1383 type Proxy = DeviceProxy;
1384 type Protocol = DeviceMarker;
1385
1386 fn from_channel(inner: fidl::Channel) -> Self {
1387 Self::new(inner)
1388 }
1389
1390 fn into_channel(self) -> fidl::Channel {
1391 self.client.into_channel()
1392 }
1393
1394 fn as_channel(&self) -> &fidl::Channel {
1395 self.client.as_channel()
1396 }
1397}
1398
1399#[cfg(target_os = "fuchsia")]
1400impl DeviceSynchronousProxy {
1401 pub fn new(channel: fidl::Channel) -> Self {
1402 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1403 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1404 }
1405
1406 pub fn into_channel(self) -> fidl::Channel {
1407 self.client.into_channel()
1408 }
1409
1410 pub fn wait_for_event(
1413 &self,
1414 deadline: zx::MonotonicInstant,
1415 ) -> Result<DeviceEvent, fidl::Error> {
1416 DeviceEvent::decode(self.client.wait_for_event(deadline)?)
1417 }
1418
1419 pub fn r#query(
1421 &self,
1422 mut query_id: QueryId,
1423 ___deadline: zx::MonotonicInstant,
1424 ) -> Result<DeviceQueryResult, fidl::Error> {
1425 let _response = self
1426 .client
1427 .send_query::<DeviceQueryRequest, fidl::encoding::ResultType<DeviceQueryResponse, i32>>(
1428 (query_id,),
1429 0x627d4c6093b078e7,
1430 fidl::encoding::DynamicFlags::empty(),
1431 ___deadline,
1432 )?;
1433 Ok(_response.map(|x| x))
1434 }
1435
1436 pub fn r#connect2(
1441 &self,
1442 mut client_id: u64,
1443 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
1444 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
1445 ) -> Result<(), fidl::Error> {
1446 self.client.send::<DeviceConnect2Request>(
1447 (client_id, primary_channel, notification_channel),
1448 0x3a5b134714c67914,
1449 fidl::encoding::DynamicFlags::empty(),
1450 )
1451 }
1452}
1453
1454#[cfg(target_os = "fuchsia")]
1455impl From<DeviceSynchronousProxy> for zx::Handle {
1456 fn from(value: DeviceSynchronousProxy) -> Self {
1457 value.into_channel().into()
1458 }
1459}
1460
1461#[cfg(target_os = "fuchsia")]
1462impl From<fidl::Channel> for DeviceSynchronousProxy {
1463 fn from(value: fidl::Channel) -> Self {
1464 Self::new(value)
1465 }
1466}
1467
1468#[derive(Debug, Clone)]
1469pub struct DeviceProxy {
1470 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1471}
1472
1473impl fidl::endpoints::Proxy for DeviceProxy {
1474 type Protocol = DeviceMarker;
1475
1476 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1477 Self::new(inner)
1478 }
1479
1480 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1481 self.client.into_channel().map_err(|client| Self { client })
1482 }
1483
1484 fn as_channel(&self) -> &::fidl::AsyncChannel {
1485 self.client.as_channel()
1486 }
1487}
1488
1489impl DeviceProxy {
1490 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1492 let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1493 Self { client: fidl::client::Client::new(channel, protocol_name) }
1494 }
1495
1496 pub fn take_event_stream(&self) -> DeviceEventStream {
1502 DeviceEventStream { event_receiver: self.client.take_event_receiver() }
1503 }
1504
1505 pub fn r#query(
1507 &self,
1508 mut query_id: QueryId,
1509 ) -> fidl::client::QueryResponseFut<
1510 DeviceQueryResult,
1511 fidl::encoding::DefaultFuchsiaResourceDialect,
1512 > {
1513 DeviceProxyInterface::r#query(self, query_id)
1514 }
1515
1516 pub fn r#connect2(
1521 &self,
1522 mut client_id: u64,
1523 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
1524 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
1525 ) -> Result<(), fidl::Error> {
1526 DeviceProxyInterface::r#connect2(self, client_id, primary_channel, notification_channel)
1527 }
1528}
1529
1530impl DeviceProxyInterface for DeviceProxy {
1531 type QueryResponseFut = fidl::client::QueryResponseFut<
1532 DeviceQueryResult,
1533 fidl::encoding::DefaultFuchsiaResourceDialect,
1534 >;
1535 fn r#query(&self, mut query_id: QueryId) -> Self::QueryResponseFut {
1536 fn _decode(
1537 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1538 ) -> Result<DeviceQueryResult, fidl::Error> {
1539 let _response = fidl::client::decode_transaction_body::<
1540 fidl::encoding::ResultType<DeviceQueryResponse, i32>,
1541 fidl::encoding::DefaultFuchsiaResourceDialect,
1542 0x627d4c6093b078e7,
1543 >(_buf?)?;
1544 Ok(_response.map(|x| x))
1545 }
1546 self.client.send_query_and_decode::<DeviceQueryRequest, DeviceQueryResult>(
1547 (query_id,),
1548 0x627d4c6093b078e7,
1549 fidl::encoding::DynamicFlags::empty(),
1550 _decode,
1551 )
1552 }
1553
1554 fn r#connect2(
1555 &self,
1556 mut client_id: u64,
1557 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
1558 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
1559 ) -> Result<(), fidl::Error> {
1560 self.client.send::<DeviceConnect2Request>(
1561 (client_id, primary_channel, notification_channel),
1562 0x3a5b134714c67914,
1563 fidl::encoding::DynamicFlags::empty(),
1564 )
1565 }
1566}
1567
1568pub struct DeviceEventStream {
1569 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1570}
1571
1572impl std::marker::Unpin for DeviceEventStream {}
1573
1574impl futures::stream::FusedStream for DeviceEventStream {
1575 fn is_terminated(&self) -> bool {
1576 self.event_receiver.is_terminated()
1577 }
1578}
1579
1580impl futures::Stream for DeviceEventStream {
1581 type Item = Result<DeviceEvent, fidl::Error>;
1582
1583 fn poll_next(
1584 mut self: std::pin::Pin<&mut Self>,
1585 cx: &mut std::task::Context<'_>,
1586 ) -> std::task::Poll<Option<Self::Item>> {
1587 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1588 &mut self.event_receiver,
1589 cx
1590 )?) {
1591 Some(buf) => std::task::Poll::Ready(Some(DeviceEvent::decode(buf))),
1592 None => std::task::Poll::Ready(None),
1593 }
1594 }
1595}
1596
1597#[derive(Debug)]
1598pub enum DeviceEvent {}
1599
1600impl DeviceEvent {
1601 fn decode(
1603 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1604 ) -> Result<DeviceEvent, fidl::Error> {
1605 let (bytes, _handles) = buf.split_mut();
1606 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1607 debug_assert_eq!(tx_header.tx_id, 0);
1608 match tx_header.ordinal {
1609 _ => Err(fidl::Error::UnknownOrdinal {
1610 ordinal: tx_header.ordinal,
1611 protocol_name: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1612 }),
1613 }
1614 }
1615}
1616
1617pub struct DeviceRequestStream {
1619 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1620 is_terminated: bool,
1621}
1622
1623impl std::marker::Unpin for DeviceRequestStream {}
1624
1625impl futures::stream::FusedStream for DeviceRequestStream {
1626 fn is_terminated(&self) -> bool {
1627 self.is_terminated
1628 }
1629}
1630
1631impl fidl::endpoints::RequestStream for DeviceRequestStream {
1632 type Protocol = DeviceMarker;
1633 type ControlHandle = DeviceControlHandle;
1634
1635 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1636 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1637 }
1638
1639 fn control_handle(&self) -> Self::ControlHandle {
1640 DeviceControlHandle { inner: self.inner.clone() }
1641 }
1642
1643 fn into_inner(
1644 self,
1645 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1646 {
1647 (self.inner, self.is_terminated)
1648 }
1649
1650 fn from_inner(
1651 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1652 is_terminated: bool,
1653 ) -> Self {
1654 Self { inner, is_terminated }
1655 }
1656}
1657
1658impl futures::Stream for DeviceRequestStream {
1659 type Item = Result<DeviceRequest, fidl::Error>;
1660
1661 fn poll_next(
1662 mut self: std::pin::Pin<&mut Self>,
1663 cx: &mut std::task::Context<'_>,
1664 ) -> std::task::Poll<Option<Self::Item>> {
1665 let this = &mut *self;
1666 if this.inner.check_shutdown(cx) {
1667 this.is_terminated = true;
1668 return std::task::Poll::Ready(None);
1669 }
1670 if this.is_terminated {
1671 panic!("polled DeviceRequestStream after completion");
1672 }
1673 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1674 |bytes, handles| {
1675 match this.inner.channel().read_etc(cx, bytes, handles) {
1676 std::task::Poll::Ready(Ok(())) => {}
1677 std::task::Poll::Pending => return std::task::Poll::Pending,
1678 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1679 this.is_terminated = true;
1680 return std::task::Poll::Ready(None);
1681 }
1682 std::task::Poll::Ready(Err(e)) => {
1683 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1684 e.into(),
1685 ))))
1686 }
1687 }
1688
1689 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1691
1692 std::task::Poll::Ready(Some(match header.ordinal {
1693 0x627d4c6093b078e7 => {
1694 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1695 let mut req = fidl::new_empty!(
1696 DeviceQueryRequest,
1697 fidl::encoding::DefaultFuchsiaResourceDialect
1698 );
1699 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceQueryRequest>(&header, _body_bytes, handles, &mut req)?;
1700 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
1701 Ok(DeviceRequest::Query {
1702 query_id: req.query_id,
1703
1704 responder: DeviceQueryResponder {
1705 control_handle: std::mem::ManuallyDrop::new(control_handle),
1706 tx_id: header.tx_id,
1707 },
1708 })
1709 }
1710 0x3a5b134714c67914 => {
1711 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1712 let mut req = fidl::new_empty!(
1713 DeviceConnect2Request,
1714 fidl::encoding::DefaultFuchsiaResourceDialect
1715 );
1716 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnect2Request>(&header, _body_bytes, handles, &mut req)?;
1717 let control_handle = DeviceControlHandle { inner: this.inner.clone() };
1718 Ok(DeviceRequest::Connect2 {
1719 client_id: req.client_id,
1720 primary_channel: req.primary_channel,
1721 notification_channel: req.notification_channel,
1722
1723 control_handle,
1724 })
1725 }
1726 _ => Err(fidl::Error::UnknownOrdinal {
1727 ordinal: header.ordinal,
1728 protocol_name:
1729 <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1730 }),
1731 }))
1732 },
1733 )
1734 }
1735}
1736
1737#[derive(Debug)]
1743pub enum DeviceRequest {
1744 Query { query_id: QueryId, responder: DeviceQueryResponder },
1746 Connect2 {
1751 client_id: u64,
1752 primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
1753 notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
1754 control_handle: DeviceControlHandle,
1755 },
1756}
1757
1758impl DeviceRequest {
1759 #[allow(irrefutable_let_patterns)]
1760 pub fn into_query(self) -> Option<(QueryId, DeviceQueryResponder)> {
1761 if let DeviceRequest::Query { query_id, responder } = self {
1762 Some((query_id, responder))
1763 } else {
1764 None
1765 }
1766 }
1767
1768 #[allow(irrefutable_let_patterns)]
1769 pub fn into_connect2(
1770 self,
1771 ) -> Option<(
1772 u64,
1773 fidl::endpoints::ServerEnd<PrimaryMarker>,
1774 fidl::endpoints::ServerEnd<NotificationMarker>,
1775 DeviceControlHandle,
1776 )> {
1777 if let DeviceRequest::Connect2 {
1778 client_id,
1779 primary_channel,
1780 notification_channel,
1781 control_handle,
1782 } = self
1783 {
1784 Some((client_id, primary_channel, notification_channel, control_handle))
1785 } else {
1786 None
1787 }
1788 }
1789
1790 pub fn method_name(&self) -> &'static str {
1792 match *self {
1793 DeviceRequest::Query { .. } => "query",
1794 DeviceRequest::Connect2 { .. } => "connect2",
1795 }
1796 }
1797}
1798
1799#[derive(Debug, Clone)]
1800pub struct DeviceControlHandle {
1801 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1802}
1803
1804impl fidl::endpoints::ControlHandle for DeviceControlHandle {
1805 fn shutdown(&self) {
1806 self.inner.shutdown()
1807 }
1808 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1809 self.inner.shutdown_with_epitaph(status)
1810 }
1811
1812 fn is_closed(&self) -> bool {
1813 self.inner.channel().is_closed()
1814 }
1815 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1816 self.inner.channel().on_closed()
1817 }
1818
1819 #[cfg(target_os = "fuchsia")]
1820 fn signal_peer(
1821 &self,
1822 clear_mask: zx::Signals,
1823 set_mask: zx::Signals,
1824 ) -> Result<(), zx_status::Status> {
1825 use fidl::Peered;
1826 self.inner.channel().signal_peer(clear_mask, set_mask)
1827 }
1828}
1829
1830impl DeviceControlHandle {}
1831
1832#[must_use = "FIDL methods require a response to be sent"]
1833#[derive(Debug)]
1834pub struct DeviceQueryResponder {
1835 control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1836 tx_id: u32,
1837}
1838
1839impl std::ops::Drop for DeviceQueryResponder {
1843 fn drop(&mut self) {
1844 self.control_handle.shutdown();
1845 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1847 }
1848}
1849
1850impl fidl::endpoints::Responder for DeviceQueryResponder {
1851 type ControlHandle = DeviceControlHandle;
1852
1853 fn control_handle(&self) -> &DeviceControlHandle {
1854 &self.control_handle
1855 }
1856
1857 fn drop_without_shutdown(mut self) {
1858 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1860 std::mem::forget(self);
1862 }
1863}
1864
1865impl DeviceQueryResponder {
1866 pub fn send(self, mut result: Result<DeviceQueryResponse, i32>) -> Result<(), fidl::Error> {
1870 let _result = self.send_raw(result);
1871 if _result.is_err() {
1872 self.control_handle.shutdown();
1873 }
1874 self.drop_without_shutdown();
1875 _result
1876 }
1877
1878 pub fn send_no_shutdown_on_err(
1880 self,
1881 mut result: Result<DeviceQueryResponse, i32>,
1882 ) -> Result<(), fidl::Error> {
1883 let _result = self.send_raw(result);
1884 self.drop_without_shutdown();
1885 _result
1886 }
1887
1888 fn send_raw(&self, mut result: Result<DeviceQueryResponse, i32>) -> Result<(), fidl::Error> {
1889 self.control_handle.inner.send::<fidl::encoding::ResultType<DeviceQueryResponse, i32>>(
1890 result.as_mut().map_err(|e| *e),
1891 self.tx_id,
1892 0x627d4c6093b078e7,
1893 fidl::encoding::DynamicFlags::empty(),
1894 )
1895 }
1896}
1897
1898#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1899pub struct DiagnosticDeviceMarker;
1900
1901impl fidl::endpoints::ProtocolMarker for DiagnosticDeviceMarker {
1902 type Proxy = DiagnosticDeviceProxy;
1903 type RequestStream = DiagnosticDeviceRequestStream;
1904 #[cfg(target_os = "fuchsia")]
1905 type SynchronousProxy = DiagnosticDeviceSynchronousProxy;
1906
1907 const DEBUG_NAME: &'static str = "(anonymous) DiagnosticDevice";
1908}
1909
1910pub trait DiagnosticDeviceProxyInterface: Send + Sync {
1911 fn r#dump_state(&self, dump_type: u32) -> Result<(), fidl::Error>;
1912}
1913#[derive(Debug)]
1914#[cfg(target_os = "fuchsia")]
1915pub struct DiagnosticDeviceSynchronousProxy {
1916 client: fidl::client::sync::Client,
1917}
1918
1919#[cfg(target_os = "fuchsia")]
1920impl fidl::endpoints::SynchronousProxy for DiagnosticDeviceSynchronousProxy {
1921 type Proxy = DiagnosticDeviceProxy;
1922 type Protocol = DiagnosticDeviceMarker;
1923
1924 fn from_channel(inner: fidl::Channel) -> Self {
1925 Self::new(inner)
1926 }
1927
1928 fn into_channel(self) -> fidl::Channel {
1929 self.client.into_channel()
1930 }
1931
1932 fn as_channel(&self) -> &fidl::Channel {
1933 self.client.as_channel()
1934 }
1935}
1936
1937#[cfg(target_os = "fuchsia")]
1938impl DiagnosticDeviceSynchronousProxy {
1939 pub fn new(channel: fidl::Channel) -> Self {
1940 let protocol_name = <DiagnosticDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1941 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1942 }
1943
1944 pub fn into_channel(self) -> fidl::Channel {
1945 self.client.into_channel()
1946 }
1947
1948 pub fn wait_for_event(
1951 &self,
1952 deadline: zx::MonotonicInstant,
1953 ) -> Result<DiagnosticDeviceEvent, fidl::Error> {
1954 DiagnosticDeviceEvent::decode(self.client.wait_for_event(deadline)?)
1955 }
1956
1957 pub fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
1959 self.client.send::<DiagnosticDeviceDumpStateRequest>(
1960 (dump_type,),
1961 0x5420df493d4fa915,
1962 fidl::encoding::DynamicFlags::empty(),
1963 )
1964 }
1965}
1966
1967#[cfg(target_os = "fuchsia")]
1968impl From<DiagnosticDeviceSynchronousProxy> for zx::Handle {
1969 fn from(value: DiagnosticDeviceSynchronousProxy) -> Self {
1970 value.into_channel().into()
1971 }
1972}
1973
1974#[cfg(target_os = "fuchsia")]
1975impl From<fidl::Channel> for DiagnosticDeviceSynchronousProxy {
1976 fn from(value: fidl::Channel) -> Self {
1977 Self::new(value)
1978 }
1979}
1980
1981#[derive(Debug, Clone)]
1982pub struct DiagnosticDeviceProxy {
1983 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1984}
1985
1986impl fidl::endpoints::Proxy for DiagnosticDeviceProxy {
1987 type Protocol = DiagnosticDeviceMarker;
1988
1989 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1990 Self::new(inner)
1991 }
1992
1993 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1994 self.client.into_channel().map_err(|client| Self { client })
1995 }
1996
1997 fn as_channel(&self) -> &::fidl::AsyncChannel {
1998 self.client.as_channel()
1999 }
2000}
2001
2002impl DiagnosticDeviceProxy {
2003 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2005 let protocol_name = <DiagnosticDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2006 Self { client: fidl::client::Client::new(channel, protocol_name) }
2007 }
2008
2009 pub fn take_event_stream(&self) -> DiagnosticDeviceEventStream {
2015 DiagnosticDeviceEventStream { event_receiver: self.client.take_event_receiver() }
2016 }
2017
2018 pub fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
2020 DiagnosticDeviceProxyInterface::r#dump_state(self, dump_type)
2021 }
2022}
2023
2024impl DiagnosticDeviceProxyInterface for DiagnosticDeviceProxy {
2025 fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
2026 self.client.send::<DiagnosticDeviceDumpStateRequest>(
2027 (dump_type,),
2028 0x5420df493d4fa915,
2029 fidl::encoding::DynamicFlags::empty(),
2030 )
2031 }
2032}
2033
2034pub struct DiagnosticDeviceEventStream {
2035 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2036}
2037
2038impl std::marker::Unpin for DiagnosticDeviceEventStream {}
2039
2040impl futures::stream::FusedStream for DiagnosticDeviceEventStream {
2041 fn is_terminated(&self) -> bool {
2042 self.event_receiver.is_terminated()
2043 }
2044}
2045
2046impl futures::Stream for DiagnosticDeviceEventStream {
2047 type Item = Result<DiagnosticDeviceEvent, fidl::Error>;
2048
2049 fn poll_next(
2050 mut self: std::pin::Pin<&mut Self>,
2051 cx: &mut std::task::Context<'_>,
2052 ) -> std::task::Poll<Option<Self::Item>> {
2053 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2054 &mut self.event_receiver,
2055 cx
2056 )?) {
2057 Some(buf) => std::task::Poll::Ready(Some(DiagnosticDeviceEvent::decode(buf))),
2058 None => std::task::Poll::Ready(None),
2059 }
2060 }
2061}
2062
2063#[derive(Debug)]
2064pub enum DiagnosticDeviceEvent {}
2065
2066impl DiagnosticDeviceEvent {
2067 fn decode(
2069 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2070 ) -> Result<DiagnosticDeviceEvent, fidl::Error> {
2071 let (bytes, _handles) = buf.split_mut();
2072 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2073 debug_assert_eq!(tx_header.tx_id, 0);
2074 match tx_header.ordinal {
2075 _ => Err(fidl::Error::UnknownOrdinal {
2076 ordinal: tx_header.ordinal,
2077 protocol_name:
2078 <DiagnosticDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2079 }),
2080 }
2081 }
2082}
2083
2084pub struct DiagnosticDeviceRequestStream {
2086 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2087 is_terminated: bool,
2088}
2089
2090impl std::marker::Unpin for DiagnosticDeviceRequestStream {}
2091
2092impl futures::stream::FusedStream for DiagnosticDeviceRequestStream {
2093 fn is_terminated(&self) -> bool {
2094 self.is_terminated
2095 }
2096}
2097
2098impl fidl::endpoints::RequestStream for DiagnosticDeviceRequestStream {
2099 type Protocol = DiagnosticDeviceMarker;
2100 type ControlHandle = DiagnosticDeviceControlHandle;
2101
2102 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2103 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2104 }
2105
2106 fn control_handle(&self) -> Self::ControlHandle {
2107 DiagnosticDeviceControlHandle { inner: self.inner.clone() }
2108 }
2109
2110 fn into_inner(
2111 self,
2112 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2113 {
2114 (self.inner, self.is_terminated)
2115 }
2116
2117 fn from_inner(
2118 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2119 is_terminated: bool,
2120 ) -> Self {
2121 Self { inner, is_terminated }
2122 }
2123}
2124
2125impl futures::Stream for DiagnosticDeviceRequestStream {
2126 type Item = Result<DiagnosticDeviceRequest, fidl::Error>;
2127
2128 fn poll_next(
2129 mut self: std::pin::Pin<&mut Self>,
2130 cx: &mut std::task::Context<'_>,
2131 ) -> std::task::Poll<Option<Self::Item>> {
2132 let this = &mut *self;
2133 if this.inner.check_shutdown(cx) {
2134 this.is_terminated = true;
2135 return std::task::Poll::Ready(None);
2136 }
2137 if this.is_terminated {
2138 panic!("polled DiagnosticDeviceRequestStream after completion");
2139 }
2140 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2141 |bytes, handles| {
2142 match this.inner.channel().read_etc(cx, bytes, handles) {
2143 std::task::Poll::Ready(Ok(())) => {}
2144 std::task::Poll::Pending => return std::task::Poll::Pending,
2145 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2146 this.is_terminated = true;
2147 return std::task::Poll::Ready(None);
2148 }
2149 std::task::Poll::Ready(Err(e)) => {
2150 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2151 e.into(),
2152 ))))
2153 }
2154 }
2155
2156 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2158
2159 std::task::Poll::Ready(Some(match header.ordinal {
2160 0x5420df493d4fa915 => {
2161 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2162 let mut req = fidl::new_empty!(
2163 DiagnosticDeviceDumpStateRequest,
2164 fidl::encoding::DefaultFuchsiaResourceDialect
2165 );
2166 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DiagnosticDeviceDumpStateRequest>(&header, _body_bytes, handles, &mut req)?;
2167 let control_handle =
2168 DiagnosticDeviceControlHandle { inner: this.inner.clone() };
2169 Ok(DiagnosticDeviceRequest::DumpState {
2170 dump_type: req.dump_type,
2171
2172 control_handle,
2173 })
2174 }
2175 _ => Err(fidl::Error::UnknownOrdinal {
2176 ordinal: header.ordinal,
2177 protocol_name:
2178 <DiagnosticDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2179 }),
2180 }))
2181 },
2182 )
2183 }
2184}
2185
2186#[derive(Debug)]
2188pub enum DiagnosticDeviceRequest {
2189 DumpState { dump_type: u32, control_handle: DiagnosticDeviceControlHandle },
2191}
2192
2193impl DiagnosticDeviceRequest {
2194 #[allow(irrefutable_let_patterns)]
2195 pub fn into_dump_state(self) -> Option<(u32, DiagnosticDeviceControlHandle)> {
2196 if let DiagnosticDeviceRequest::DumpState { dump_type, control_handle } = self {
2197 Some((dump_type, control_handle))
2198 } else {
2199 None
2200 }
2201 }
2202
2203 pub fn method_name(&self) -> &'static str {
2205 match *self {
2206 DiagnosticDeviceRequest::DumpState { .. } => "dump_state",
2207 }
2208 }
2209}
2210
2211#[derive(Debug, Clone)]
2212pub struct DiagnosticDeviceControlHandle {
2213 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2214}
2215
2216impl fidl::endpoints::ControlHandle for DiagnosticDeviceControlHandle {
2217 fn shutdown(&self) {
2218 self.inner.shutdown()
2219 }
2220 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2221 self.inner.shutdown_with_epitaph(status)
2222 }
2223
2224 fn is_closed(&self) -> bool {
2225 self.inner.channel().is_closed()
2226 }
2227 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2228 self.inner.channel().on_closed()
2229 }
2230
2231 #[cfg(target_os = "fuchsia")]
2232 fn signal_peer(
2233 &self,
2234 clear_mask: zx::Signals,
2235 set_mask: zx::Signals,
2236 ) -> Result<(), zx_status::Status> {
2237 use fidl::Peered;
2238 self.inner.channel().signal_peer(clear_mask, set_mask)
2239 }
2240}
2241
2242impl DiagnosticDeviceControlHandle {}
2243
2244#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2245pub struct IcdLoaderDeviceMarker;
2246
2247impl fidl::endpoints::ProtocolMarker for IcdLoaderDeviceMarker {
2248 type Proxy = IcdLoaderDeviceProxy;
2249 type RequestStream = IcdLoaderDeviceRequestStream;
2250 #[cfg(target_os = "fuchsia")]
2251 type SynchronousProxy = IcdLoaderDeviceSynchronousProxy;
2252
2253 const DEBUG_NAME: &'static str = "(anonymous) IcdLoaderDevice";
2254}
2255
2256pub trait IcdLoaderDeviceProxyInterface: Send + Sync {
2257 type GetIcdListResponseFut: std::future::Future<Output = Result<Vec<IcdInfo>, fidl::Error>>
2258 + Send;
2259 fn r#get_icd_list(&self) -> Self::GetIcdListResponseFut;
2260}
2261#[derive(Debug)]
2262#[cfg(target_os = "fuchsia")]
2263pub struct IcdLoaderDeviceSynchronousProxy {
2264 client: fidl::client::sync::Client,
2265}
2266
2267#[cfg(target_os = "fuchsia")]
2268impl fidl::endpoints::SynchronousProxy for IcdLoaderDeviceSynchronousProxy {
2269 type Proxy = IcdLoaderDeviceProxy;
2270 type Protocol = IcdLoaderDeviceMarker;
2271
2272 fn from_channel(inner: fidl::Channel) -> Self {
2273 Self::new(inner)
2274 }
2275
2276 fn into_channel(self) -> fidl::Channel {
2277 self.client.into_channel()
2278 }
2279
2280 fn as_channel(&self) -> &fidl::Channel {
2281 self.client.as_channel()
2282 }
2283}
2284
2285#[cfg(target_os = "fuchsia")]
2286impl IcdLoaderDeviceSynchronousProxy {
2287 pub fn new(channel: fidl::Channel) -> Self {
2288 let protocol_name = <IcdLoaderDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2289 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2290 }
2291
2292 pub fn into_channel(self) -> fidl::Channel {
2293 self.client.into_channel()
2294 }
2295
2296 pub fn wait_for_event(
2299 &self,
2300 deadline: zx::MonotonicInstant,
2301 ) -> Result<IcdLoaderDeviceEvent, fidl::Error> {
2302 IcdLoaderDeviceEvent::decode(self.client.wait_for_event(deadline)?)
2303 }
2304
2305 pub fn r#get_icd_list(
2308 &self,
2309 ___deadline: zx::MonotonicInstant,
2310 ) -> Result<Vec<IcdInfo>, fidl::Error> {
2311 let _response = self
2312 .client
2313 .send_query::<fidl::encoding::EmptyPayload, IcdLoaderDeviceGetIcdListResponse>(
2314 (),
2315 0x7673e76395008257,
2316 fidl::encoding::DynamicFlags::empty(),
2317 ___deadline,
2318 )?;
2319 Ok(_response.icd_list)
2320 }
2321}
2322
2323#[cfg(target_os = "fuchsia")]
2324impl From<IcdLoaderDeviceSynchronousProxy> for zx::Handle {
2325 fn from(value: IcdLoaderDeviceSynchronousProxy) -> Self {
2326 value.into_channel().into()
2327 }
2328}
2329
2330#[cfg(target_os = "fuchsia")]
2331impl From<fidl::Channel> for IcdLoaderDeviceSynchronousProxy {
2332 fn from(value: fidl::Channel) -> Self {
2333 Self::new(value)
2334 }
2335}
2336
2337#[derive(Debug, Clone)]
2338pub struct IcdLoaderDeviceProxy {
2339 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2340}
2341
2342impl fidl::endpoints::Proxy for IcdLoaderDeviceProxy {
2343 type Protocol = IcdLoaderDeviceMarker;
2344
2345 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2346 Self::new(inner)
2347 }
2348
2349 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2350 self.client.into_channel().map_err(|client| Self { client })
2351 }
2352
2353 fn as_channel(&self) -> &::fidl::AsyncChannel {
2354 self.client.as_channel()
2355 }
2356}
2357
2358impl IcdLoaderDeviceProxy {
2359 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2361 let protocol_name = <IcdLoaderDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2362 Self { client: fidl::client::Client::new(channel, protocol_name) }
2363 }
2364
2365 pub fn take_event_stream(&self) -> IcdLoaderDeviceEventStream {
2371 IcdLoaderDeviceEventStream { event_receiver: self.client.take_event_receiver() }
2372 }
2373
2374 pub fn r#get_icd_list(
2377 &self,
2378 ) -> fidl::client::QueryResponseFut<Vec<IcdInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>
2379 {
2380 IcdLoaderDeviceProxyInterface::r#get_icd_list(self)
2381 }
2382}
2383
2384impl IcdLoaderDeviceProxyInterface for IcdLoaderDeviceProxy {
2385 type GetIcdListResponseFut =
2386 fidl::client::QueryResponseFut<Vec<IcdInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2387 fn r#get_icd_list(&self) -> Self::GetIcdListResponseFut {
2388 fn _decode(
2389 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2390 ) -> Result<Vec<IcdInfo>, fidl::Error> {
2391 let _response = fidl::client::decode_transaction_body::<
2392 IcdLoaderDeviceGetIcdListResponse,
2393 fidl::encoding::DefaultFuchsiaResourceDialect,
2394 0x7673e76395008257,
2395 >(_buf?)?;
2396 Ok(_response.icd_list)
2397 }
2398 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<IcdInfo>>(
2399 (),
2400 0x7673e76395008257,
2401 fidl::encoding::DynamicFlags::empty(),
2402 _decode,
2403 )
2404 }
2405}
2406
2407pub struct IcdLoaderDeviceEventStream {
2408 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2409}
2410
2411impl std::marker::Unpin for IcdLoaderDeviceEventStream {}
2412
2413impl futures::stream::FusedStream for IcdLoaderDeviceEventStream {
2414 fn is_terminated(&self) -> bool {
2415 self.event_receiver.is_terminated()
2416 }
2417}
2418
2419impl futures::Stream for IcdLoaderDeviceEventStream {
2420 type Item = Result<IcdLoaderDeviceEvent, fidl::Error>;
2421
2422 fn poll_next(
2423 mut self: std::pin::Pin<&mut Self>,
2424 cx: &mut std::task::Context<'_>,
2425 ) -> std::task::Poll<Option<Self::Item>> {
2426 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2427 &mut self.event_receiver,
2428 cx
2429 )?) {
2430 Some(buf) => std::task::Poll::Ready(Some(IcdLoaderDeviceEvent::decode(buf))),
2431 None => std::task::Poll::Ready(None),
2432 }
2433 }
2434}
2435
2436#[derive(Debug)]
2437pub enum IcdLoaderDeviceEvent {}
2438
2439impl IcdLoaderDeviceEvent {
2440 fn decode(
2442 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2443 ) -> Result<IcdLoaderDeviceEvent, fidl::Error> {
2444 let (bytes, _handles) = buf.split_mut();
2445 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2446 debug_assert_eq!(tx_header.tx_id, 0);
2447 match tx_header.ordinal {
2448 _ => Err(fidl::Error::UnknownOrdinal {
2449 ordinal: tx_header.ordinal,
2450 protocol_name:
2451 <IcdLoaderDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2452 }),
2453 }
2454 }
2455}
2456
2457pub struct IcdLoaderDeviceRequestStream {
2459 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2460 is_terminated: bool,
2461}
2462
2463impl std::marker::Unpin for IcdLoaderDeviceRequestStream {}
2464
2465impl futures::stream::FusedStream for IcdLoaderDeviceRequestStream {
2466 fn is_terminated(&self) -> bool {
2467 self.is_terminated
2468 }
2469}
2470
2471impl fidl::endpoints::RequestStream for IcdLoaderDeviceRequestStream {
2472 type Protocol = IcdLoaderDeviceMarker;
2473 type ControlHandle = IcdLoaderDeviceControlHandle;
2474
2475 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2476 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2477 }
2478
2479 fn control_handle(&self) -> Self::ControlHandle {
2480 IcdLoaderDeviceControlHandle { inner: self.inner.clone() }
2481 }
2482
2483 fn into_inner(
2484 self,
2485 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2486 {
2487 (self.inner, self.is_terminated)
2488 }
2489
2490 fn from_inner(
2491 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2492 is_terminated: bool,
2493 ) -> Self {
2494 Self { inner, is_terminated }
2495 }
2496}
2497
2498impl futures::Stream for IcdLoaderDeviceRequestStream {
2499 type Item = Result<IcdLoaderDeviceRequest, fidl::Error>;
2500
2501 fn poll_next(
2502 mut self: std::pin::Pin<&mut Self>,
2503 cx: &mut std::task::Context<'_>,
2504 ) -> std::task::Poll<Option<Self::Item>> {
2505 let this = &mut *self;
2506 if this.inner.check_shutdown(cx) {
2507 this.is_terminated = true;
2508 return std::task::Poll::Ready(None);
2509 }
2510 if this.is_terminated {
2511 panic!("polled IcdLoaderDeviceRequestStream after completion");
2512 }
2513 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2514 |bytes, handles| {
2515 match this.inner.channel().read_etc(cx, bytes, handles) {
2516 std::task::Poll::Ready(Ok(())) => {}
2517 std::task::Poll::Pending => return std::task::Poll::Pending,
2518 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2519 this.is_terminated = true;
2520 return std::task::Poll::Ready(None);
2521 }
2522 std::task::Poll::Ready(Err(e)) => {
2523 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2524 e.into(),
2525 ))))
2526 }
2527 }
2528
2529 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2531
2532 std::task::Poll::Ready(Some(match header.ordinal {
2533 0x7673e76395008257 => {
2534 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2535 let mut req = fidl::new_empty!(
2536 fidl::encoding::EmptyPayload,
2537 fidl::encoding::DefaultFuchsiaResourceDialect
2538 );
2539 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2540 let control_handle =
2541 IcdLoaderDeviceControlHandle { inner: this.inner.clone() };
2542 Ok(IcdLoaderDeviceRequest::GetIcdList {
2543 responder: IcdLoaderDeviceGetIcdListResponder {
2544 control_handle: std::mem::ManuallyDrop::new(control_handle),
2545 tx_id: header.tx_id,
2546 },
2547 })
2548 }
2549 _ => Err(fidl::Error::UnknownOrdinal {
2550 ordinal: header.ordinal,
2551 protocol_name:
2552 <IcdLoaderDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2553 }),
2554 }))
2555 },
2556 )
2557 }
2558}
2559
2560#[derive(Debug)]
2562pub enum IcdLoaderDeviceRequest {
2563 GetIcdList { responder: IcdLoaderDeviceGetIcdListResponder },
2566}
2567
2568impl IcdLoaderDeviceRequest {
2569 #[allow(irrefutable_let_patterns)]
2570 pub fn into_get_icd_list(self) -> Option<(IcdLoaderDeviceGetIcdListResponder)> {
2571 if let IcdLoaderDeviceRequest::GetIcdList { responder } = self {
2572 Some((responder))
2573 } else {
2574 None
2575 }
2576 }
2577
2578 pub fn method_name(&self) -> &'static str {
2580 match *self {
2581 IcdLoaderDeviceRequest::GetIcdList { .. } => "get_icd_list",
2582 }
2583 }
2584}
2585
2586#[derive(Debug, Clone)]
2587pub struct IcdLoaderDeviceControlHandle {
2588 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2589}
2590
2591impl fidl::endpoints::ControlHandle for IcdLoaderDeviceControlHandle {
2592 fn shutdown(&self) {
2593 self.inner.shutdown()
2594 }
2595 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2596 self.inner.shutdown_with_epitaph(status)
2597 }
2598
2599 fn is_closed(&self) -> bool {
2600 self.inner.channel().is_closed()
2601 }
2602 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2603 self.inner.channel().on_closed()
2604 }
2605
2606 #[cfg(target_os = "fuchsia")]
2607 fn signal_peer(
2608 &self,
2609 clear_mask: zx::Signals,
2610 set_mask: zx::Signals,
2611 ) -> Result<(), zx_status::Status> {
2612 use fidl::Peered;
2613 self.inner.channel().signal_peer(clear_mask, set_mask)
2614 }
2615}
2616
2617impl IcdLoaderDeviceControlHandle {}
2618
2619#[must_use = "FIDL methods require a response to be sent"]
2620#[derive(Debug)]
2621pub struct IcdLoaderDeviceGetIcdListResponder {
2622 control_handle: std::mem::ManuallyDrop<IcdLoaderDeviceControlHandle>,
2623 tx_id: u32,
2624}
2625
2626impl std::ops::Drop for IcdLoaderDeviceGetIcdListResponder {
2630 fn drop(&mut self) {
2631 self.control_handle.shutdown();
2632 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2634 }
2635}
2636
2637impl fidl::endpoints::Responder for IcdLoaderDeviceGetIcdListResponder {
2638 type ControlHandle = IcdLoaderDeviceControlHandle;
2639
2640 fn control_handle(&self) -> &IcdLoaderDeviceControlHandle {
2641 &self.control_handle
2642 }
2643
2644 fn drop_without_shutdown(mut self) {
2645 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2647 std::mem::forget(self);
2649 }
2650}
2651
2652impl IcdLoaderDeviceGetIcdListResponder {
2653 pub fn send(self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
2657 let _result = self.send_raw(icd_list);
2658 if _result.is_err() {
2659 self.control_handle.shutdown();
2660 }
2661 self.drop_without_shutdown();
2662 _result
2663 }
2664
2665 pub fn send_no_shutdown_on_err(self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
2667 let _result = self.send_raw(icd_list);
2668 self.drop_without_shutdown();
2669 _result
2670 }
2671
2672 fn send_raw(&self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
2673 self.control_handle.inner.send::<IcdLoaderDeviceGetIcdListResponse>(
2674 (icd_list,),
2675 self.tx_id,
2676 0x7673e76395008257,
2677 fidl::encoding::DynamicFlags::empty(),
2678 )
2679 }
2680}
2681
2682#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2683pub struct NotificationMarker;
2684
2685impl fidl::endpoints::ProtocolMarker for NotificationMarker {
2686 type Proxy = NotificationProxy;
2687 type RequestStream = NotificationRequestStream;
2688 #[cfg(target_os = "fuchsia")]
2689 type SynchronousProxy = NotificationSynchronousProxy;
2690
2691 const DEBUG_NAME: &'static str = "(anonymous) Notification";
2692}
2693
2694pub trait NotificationProxyInterface: Send + Sync {}
2695#[derive(Debug)]
2696#[cfg(target_os = "fuchsia")]
2697pub struct NotificationSynchronousProxy {
2698 client: fidl::client::sync::Client,
2699}
2700
2701#[cfg(target_os = "fuchsia")]
2702impl fidl::endpoints::SynchronousProxy for NotificationSynchronousProxy {
2703 type Proxy = NotificationProxy;
2704 type Protocol = NotificationMarker;
2705
2706 fn from_channel(inner: fidl::Channel) -> Self {
2707 Self::new(inner)
2708 }
2709
2710 fn into_channel(self) -> fidl::Channel {
2711 self.client.into_channel()
2712 }
2713
2714 fn as_channel(&self) -> &fidl::Channel {
2715 self.client.as_channel()
2716 }
2717}
2718
2719#[cfg(target_os = "fuchsia")]
2720impl NotificationSynchronousProxy {
2721 pub fn new(channel: fidl::Channel) -> Self {
2722 let protocol_name = <NotificationMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2723 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2724 }
2725
2726 pub fn into_channel(self) -> fidl::Channel {
2727 self.client.into_channel()
2728 }
2729
2730 pub fn wait_for_event(
2733 &self,
2734 deadline: zx::MonotonicInstant,
2735 ) -> Result<NotificationEvent, fidl::Error> {
2736 NotificationEvent::decode(self.client.wait_for_event(deadline)?)
2737 }
2738}
2739
2740#[cfg(target_os = "fuchsia")]
2741impl From<NotificationSynchronousProxy> for zx::Handle {
2742 fn from(value: NotificationSynchronousProxy) -> Self {
2743 value.into_channel().into()
2744 }
2745}
2746
2747#[cfg(target_os = "fuchsia")]
2748impl From<fidl::Channel> for NotificationSynchronousProxy {
2749 fn from(value: fidl::Channel) -> Self {
2750 Self::new(value)
2751 }
2752}
2753
2754#[derive(Debug, Clone)]
2755pub struct NotificationProxy {
2756 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2757}
2758
2759impl fidl::endpoints::Proxy for NotificationProxy {
2760 type Protocol = NotificationMarker;
2761
2762 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2763 Self::new(inner)
2764 }
2765
2766 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2767 self.client.into_channel().map_err(|client| Self { client })
2768 }
2769
2770 fn as_channel(&self) -> &::fidl::AsyncChannel {
2771 self.client.as_channel()
2772 }
2773}
2774
2775impl NotificationProxy {
2776 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2778 let protocol_name = <NotificationMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2779 Self { client: fidl::client::Client::new(channel, protocol_name) }
2780 }
2781
2782 pub fn take_event_stream(&self) -> NotificationEventStream {
2788 NotificationEventStream { event_receiver: self.client.take_event_receiver() }
2789 }
2790}
2791
2792impl NotificationProxyInterface for NotificationProxy {}
2793
2794pub struct NotificationEventStream {
2795 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2796}
2797
2798impl std::marker::Unpin for NotificationEventStream {}
2799
2800impl futures::stream::FusedStream for NotificationEventStream {
2801 fn is_terminated(&self) -> bool {
2802 self.event_receiver.is_terminated()
2803 }
2804}
2805
2806impl futures::Stream for NotificationEventStream {
2807 type Item = Result<NotificationEvent, fidl::Error>;
2808
2809 fn poll_next(
2810 mut self: std::pin::Pin<&mut Self>,
2811 cx: &mut std::task::Context<'_>,
2812 ) -> std::task::Poll<Option<Self::Item>> {
2813 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2814 &mut self.event_receiver,
2815 cx
2816 )?) {
2817 Some(buf) => std::task::Poll::Ready(Some(NotificationEvent::decode(buf))),
2818 None => std::task::Poll::Ready(None),
2819 }
2820 }
2821}
2822
2823#[derive(Debug)]
2824pub enum NotificationEvent {}
2825
2826impl NotificationEvent {
2827 fn decode(
2829 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2830 ) -> Result<NotificationEvent, fidl::Error> {
2831 let (bytes, _handles) = buf.split_mut();
2832 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2833 debug_assert_eq!(tx_header.tx_id, 0);
2834 match tx_header.ordinal {
2835 _ => Err(fidl::Error::UnknownOrdinal {
2836 ordinal: tx_header.ordinal,
2837 protocol_name: <NotificationMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2838 }),
2839 }
2840 }
2841}
2842
2843pub struct NotificationRequestStream {
2845 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2846 is_terminated: bool,
2847}
2848
2849impl std::marker::Unpin for NotificationRequestStream {}
2850
2851impl futures::stream::FusedStream for NotificationRequestStream {
2852 fn is_terminated(&self) -> bool {
2853 self.is_terminated
2854 }
2855}
2856
2857impl fidl::endpoints::RequestStream for NotificationRequestStream {
2858 type Protocol = NotificationMarker;
2859 type ControlHandle = NotificationControlHandle;
2860
2861 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2862 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2863 }
2864
2865 fn control_handle(&self) -> Self::ControlHandle {
2866 NotificationControlHandle { inner: self.inner.clone() }
2867 }
2868
2869 fn into_inner(
2870 self,
2871 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2872 {
2873 (self.inner, self.is_terminated)
2874 }
2875
2876 fn from_inner(
2877 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2878 is_terminated: bool,
2879 ) -> Self {
2880 Self { inner, is_terminated }
2881 }
2882}
2883
2884impl futures::Stream for NotificationRequestStream {
2885 type Item = Result<NotificationRequest, fidl::Error>;
2886
2887 fn poll_next(
2888 mut self: std::pin::Pin<&mut Self>,
2889 cx: &mut std::task::Context<'_>,
2890 ) -> std::task::Poll<Option<Self::Item>> {
2891 let this = &mut *self;
2892 if this.inner.check_shutdown(cx) {
2893 this.is_terminated = true;
2894 return std::task::Poll::Ready(None);
2895 }
2896 if this.is_terminated {
2897 panic!("polled NotificationRequestStream after completion");
2898 }
2899 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2900 |bytes, handles| {
2901 match this.inner.channel().read_etc(cx, bytes, handles) {
2902 std::task::Poll::Ready(Ok(())) => {}
2903 std::task::Poll::Pending => return std::task::Poll::Pending,
2904 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2905 this.is_terminated = true;
2906 return std::task::Poll::Ready(None);
2907 }
2908 std::task::Poll::Ready(Err(e)) => {
2909 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2910 e.into(),
2911 ))))
2912 }
2913 }
2914
2915 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2917
2918 std::task::Poll::Ready(Some(match header.ordinal {
2919 _ => Err(fidl::Error::UnknownOrdinal {
2920 ordinal: header.ordinal,
2921 protocol_name:
2922 <NotificationMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2923 }),
2924 }))
2925 },
2926 )
2927 }
2928}
2929
2930#[derive(Debug)]
2932pub enum NotificationRequest {}
2933
2934impl NotificationRequest {
2935 pub fn method_name(&self) -> &'static str {
2937 match *self {}
2938 }
2939}
2940
2941#[derive(Debug, Clone)]
2942pub struct NotificationControlHandle {
2943 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2944}
2945
2946impl fidl::endpoints::ControlHandle for NotificationControlHandle {
2947 fn shutdown(&self) {
2948 self.inner.shutdown()
2949 }
2950 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2951 self.inner.shutdown_with_epitaph(status)
2952 }
2953
2954 fn is_closed(&self) -> bool {
2955 self.inner.channel().is_closed()
2956 }
2957 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2958 self.inner.channel().on_closed()
2959 }
2960
2961 #[cfg(target_os = "fuchsia")]
2962 fn signal_peer(
2963 &self,
2964 clear_mask: zx::Signals,
2965 set_mask: zx::Signals,
2966 ) -> Result<(), zx_status::Status> {
2967 use fidl::Peered;
2968 self.inner.channel().signal_peer(clear_mask, set_mask)
2969 }
2970}
2971
2972impl NotificationControlHandle {}
2973
2974#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2975pub struct PerformanceCounterAccessMarker;
2976
2977impl fidl::endpoints::ProtocolMarker for PerformanceCounterAccessMarker {
2978 type Proxy = PerformanceCounterAccessProxy;
2979 type RequestStream = PerformanceCounterAccessRequestStream;
2980 #[cfg(target_os = "fuchsia")]
2981 type SynchronousProxy = PerformanceCounterAccessSynchronousProxy;
2982
2983 const DEBUG_NAME: &'static str = "(anonymous) PerformanceCounterAccess";
2984}
2985
2986pub trait PerformanceCounterAccessProxyInterface: Send + Sync {
2987 type GetPerformanceCountTokenResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
2988 + Send;
2989 fn r#get_performance_count_token(&self) -> Self::GetPerformanceCountTokenResponseFut;
2990}
2991#[derive(Debug)]
2992#[cfg(target_os = "fuchsia")]
2993pub struct PerformanceCounterAccessSynchronousProxy {
2994 client: fidl::client::sync::Client,
2995}
2996
2997#[cfg(target_os = "fuchsia")]
2998impl fidl::endpoints::SynchronousProxy for PerformanceCounterAccessSynchronousProxy {
2999 type Proxy = PerformanceCounterAccessProxy;
3000 type Protocol = PerformanceCounterAccessMarker;
3001
3002 fn from_channel(inner: fidl::Channel) -> Self {
3003 Self::new(inner)
3004 }
3005
3006 fn into_channel(self) -> fidl::Channel {
3007 self.client.into_channel()
3008 }
3009
3010 fn as_channel(&self) -> &fidl::Channel {
3011 self.client.as_channel()
3012 }
3013}
3014
3015#[cfg(target_os = "fuchsia")]
3016impl PerformanceCounterAccessSynchronousProxy {
3017 pub fn new(channel: fidl::Channel) -> Self {
3018 let protocol_name =
3019 <PerformanceCounterAccessMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3020 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3021 }
3022
3023 pub fn into_channel(self) -> fidl::Channel {
3024 self.client.into_channel()
3025 }
3026
3027 pub fn wait_for_event(
3030 &self,
3031 deadline: zx::MonotonicInstant,
3032 ) -> Result<PerformanceCounterAccessEvent, fidl::Error> {
3033 PerformanceCounterAccessEvent::decode(self.client.wait_for_event(deadline)?)
3034 }
3035
3036 pub fn r#get_performance_count_token(
3039 &self,
3040 ___deadline: zx::MonotonicInstant,
3041 ) -> Result<fidl::Event, fidl::Error> {
3042 let _response = self.client.send_query::<
3043 fidl::encoding::EmptyPayload,
3044 PerformanceCounterAccessGetPerformanceCountTokenResponse,
3045 >(
3046 (),
3047 0x48410470c5f00f92,
3048 fidl::encoding::DynamicFlags::empty(),
3049 ___deadline,
3050 )?;
3051 Ok(_response.access_token)
3052 }
3053}
3054
3055#[cfg(target_os = "fuchsia")]
3056impl From<PerformanceCounterAccessSynchronousProxy> for zx::Handle {
3057 fn from(value: PerformanceCounterAccessSynchronousProxy) -> Self {
3058 value.into_channel().into()
3059 }
3060}
3061
3062#[cfg(target_os = "fuchsia")]
3063impl From<fidl::Channel> for PerformanceCounterAccessSynchronousProxy {
3064 fn from(value: fidl::Channel) -> Self {
3065 Self::new(value)
3066 }
3067}
3068
3069#[derive(Debug, Clone)]
3070pub struct PerformanceCounterAccessProxy {
3071 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3072}
3073
3074impl fidl::endpoints::Proxy for PerformanceCounterAccessProxy {
3075 type Protocol = PerformanceCounterAccessMarker;
3076
3077 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3078 Self::new(inner)
3079 }
3080
3081 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3082 self.client.into_channel().map_err(|client| Self { client })
3083 }
3084
3085 fn as_channel(&self) -> &::fidl::AsyncChannel {
3086 self.client.as_channel()
3087 }
3088}
3089
3090impl PerformanceCounterAccessProxy {
3091 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3093 let protocol_name =
3094 <PerformanceCounterAccessMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3095 Self { client: fidl::client::Client::new(channel, protocol_name) }
3096 }
3097
3098 pub fn take_event_stream(&self) -> PerformanceCounterAccessEventStream {
3104 PerformanceCounterAccessEventStream { event_receiver: self.client.take_event_receiver() }
3105 }
3106
3107 pub fn r#get_performance_count_token(
3110 &self,
3111 ) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
3112 {
3113 PerformanceCounterAccessProxyInterface::r#get_performance_count_token(self)
3114 }
3115}
3116
3117impl PerformanceCounterAccessProxyInterface for PerformanceCounterAccessProxy {
3118 type GetPerformanceCountTokenResponseFut =
3119 fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
3120 fn r#get_performance_count_token(&self) -> Self::GetPerformanceCountTokenResponseFut {
3121 fn _decode(
3122 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3123 ) -> Result<fidl::Event, fidl::Error> {
3124 let _response = fidl::client::decode_transaction_body::<
3125 PerformanceCounterAccessGetPerformanceCountTokenResponse,
3126 fidl::encoding::DefaultFuchsiaResourceDialect,
3127 0x48410470c5f00f92,
3128 >(_buf?)?;
3129 Ok(_response.access_token)
3130 }
3131 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Event>(
3132 (),
3133 0x48410470c5f00f92,
3134 fidl::encoding::DynamicFlags::empty(),
3135 _decode,
3136 )
3137 }
3138}
3139
3140pub struct PerformanceCounterAccessEventStream {
3141 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3142}
3143
3144impl std::marker::Unpin for PerformanceCounterAccessEventStream {}
3145
3146impl futures::stream::FusedStream for PerformanceCounterAccessEventStream {
3147 fn is_terminated(&self) -> bool {
3148 self.event_receiver.is_terminated()
3149 }
3150}
3151
3152impl futures::Stream for PerformanceCounterAccessEventStream {
3153 type Item = Result<PerformanceCounterAccessEvent, fidl::Error>;
3154
3155 fn poll_next(
3156 mut self: std::pin::Pin<&mut Self>,
3157 cx: &mut std::task::Context<'_>,
3158 ) -> std::task::Poll<Option<Self::Item>> {
3159 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3160 &mut self.event_receiver,
3161 cx
3162 )?) {
3163 Some(buf) => std::task::Poll::Ready(Some(PerformanceCounterAccessEvent::decode(buf))),
3164 None => std::task::Poll::Ready(None),
3165 }
3166 }
3167}
3168
3169#[derive(Debug)]
3170pub enum PerformanceCounterAccessEvent {}
3171
3172impl PerformanceCounterAccessEvent {
3173 fn decode(
3175 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3176 ) -> Result<PerformanceCounterAccessEvent, fidl::Error> {
3177 let (bytes, _handles) = buf.split_mut();
3178 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3179 debug_assert_eq!(tx_header.tx_id, 0);
3180 match tx_header.ordinal {
3181 _ => Err(fidl::Error::UnknownOrdinal {
3182 ordinal: tx_header.ordinal,
3183 protocol_name:
3184 <PerformanceCounterAccessMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3185 }),
3186 }
3187 }
3188}
3189
3190pub struct PerformanceCounterAccessRequestStream {
3192 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3193 is_terminated: bool,
3194}
3195
3196impl std::marker::Unpin for PerformanceCounterAccessRequestStream {}
3197
3198impl futures::stream::FusedStream for PerformanceCounterAccessRequestStream {
3199 fn is_terminated(&self) -> bool {
3200 self.is_terminated
3201 }
3202}
3203
3204impl fidl::endpoints::RequestStream for PerformanceCounterAccessRequestStream {
3205 type Protocol = PerformanceCounterAccessMarker;
3206 type ControlHandle = PerformanceCounterAccessControlHandle;
3207
3208 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3209 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3210 }
3211
3212 fn control_handle(&self) -> Self::ControlHandle {
3213 PerformanceCounterAccessControlHandle { inner: self.inner.clone() }
3214 }
3215
3216 fn into_inner(
3217 self,
3218 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3219 {
3220 (self.inner, self.is_terminated)
3221 }
3222
3223 fn from_inner(
3224 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3225 is_terminated: bool,
3226 ) -> Self {
3227 Self { inner, is_terminated }
3228 }
3229}
3230
3231impl futures::Stream for PerformanceCounterAccessRequestStream {
3232 type Item = Result<PerformanceCounterAccessRequest, fidl::Error>;
3233
3234 fn poll_next(
3235 mut self: std::pin::Pin<&mut Self>,
3236 cx: &mut std::task::Context<'_>,
3237 ) -> std::task::Poll<Option<Self::Item>> {
3238 let this = &mut *self;
3239 if this.inner.check_shutdown(cx) {
3240 this.is_terminated = true;
3241 return std::task::Poll::Ready(None);
3242 }
3243 if this.is_terminated {
3244 panic!("polled PerformanceCounterAccessRequestStream after completion");
3245 }
3246 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3247 |bytes, handles| {
3248 match this.inner.channel().read_etc(cx, bytes, handles) {
3249 std::task::Poll::Ready(Ok(())) => {}
3250 std::task::Poll::Pending => return std::task::Poll::Pending,
3251 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3252 this.is_terminated = true;
3253 return std::task::Poll::Ready(None);
3254 }
3255 std::task::Poll::Ready(Err(e)) => {
3256 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3257 e.into(),
3258 ))))
3259 }
3260 }
3261
3262 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3264
3265 std::task::Poll::Ready(Some(match header.ordinal {
3266 0x48410470c5f00f92 => {
3267 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3268 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3269 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3270 let control_handle = PerformanceCounterAccessControlHandle {
3271 inner: this.inner.clone(),
3272 };
3273 Ok(PerformanceCounterAccessRequest::GetPerformanceCountToken {
3274 responder: PerformanceCounterAccessGetPerformanceCountTokenResponder {
3275 control_handle: std::mem::ManuallyDrop::new(control_handle),
3276 tx_id: header.tx_id,
3277 },
3278 })
3279 }
3280 _ => Err(fidl::Error::UnknownOrdinal {
3281 ordinal: header.ordinal,
3282 protocol_name: <PerformanceCounterAccessMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3283 }),
3284 }))
3285 },
3286 )
3287 }
3288}
3289
3290#[derive(Debug)]
3292pub enum PerformanceCounterAccessRequest {
3293 GetPerformanceCountToken {
3296 responder: PerformanceCounterAccessGetPerformanceCountTokenResponder,
3297 },
3298}
3299
3300impl PerformanceCounterAccessRequest {
3301 #[allow(irrefutable_let_patterns)]
3302 pub fn into_get_performance_count_token(
3303 self,
3304 ) -> Option<(PerformanceCounterAccessGetPerformanceCountTokenResponder)> {
3305 if let PerformanceCounterAccessRequest::GetPerformanceCountToken { responder } = self {
3306 Some((responder))
3307 } else {
3308 None
3309 }
3310 }
3311
3312 pub fn method_name(&self) -> &'static str {
3314 match *self {
3315 PerformanceCounterAccessRequest::GetPerformanceCountToken { .. } => {
3316 "get_performance_count_token"
3317 }
3318 }
3319 }
3320}
3321
3322#[derive(Debug, Clone)]
3323pub struct PerformanceCounterAccessControlHandle {
3324 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3325}
3326
3327impl fidl::endpoints::ControlHandle for PerformanceCounterAccessControlHandle {
3328 fn shutdown(&self) {
3329 self.inner.shutdown()
3330 }
3331 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3332 self.inner.shutdown_with_epitaph(status)
3333 }
3334
3335 fn is_closed(&self) -> bool {
3336 self.inner.channel().is_closed()
3337 }
3338 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3339 self.inner.channel().on_closed()
3340 }
3341
3342 #[cfg(target_os = "fuchsia")]
3343 fn signal_peer(
3344 &self,
3345 clear_mask: zx::Signals,
3346 set_mask: zx::Signals,
3347 ) -> Result<(), zx_status::Status> {
3348 use fidl::Peered;
3349 self.inner.channel().signal_peer(clear_mask, set_mask)
3350 }
3351}
3352
3353impl PerformanceCounterAccessControlHandle {}
3354
3355#[must_use = "FIDL methods require a response to be sent"]
3356#[derive(Debug)]
3357pub struct PerformanceCounterAccessGetPerformanceCountTokenResponder {
3358 control_handle: std::mem::ManuallyDrop<PerformanceCounterAccessControlHandle>,
3359 tx_id: u32,
3360}
3361
3362impl std::ops::Drop for PerformanceCounterAccessGetPerformanceCountTokenResponder {
3366 fn drop(&mut self) {
3367 self.control_handle.shutdown();
3368 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3370 }
3371}
3372
3373impl fidl::endpoints::Responder for PerformanceCounterAccessGetPerformanceCountTokenResponder {
3374 type ControlHandle = PerformanceCounterAccessControlHandle;
3375
3376 fn control_handle(&self) -> &PerformanceCounterAccessControlHandle {
3377 &self.control_handle
3378 }
3379
3380 fn drop_without_shutdown(mut self) {
3381 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3383 std::mem::forget(self);
3385 }
3386}
3387
3388impl PerformanceCounterAccessGetPerformanceCountTokenResponder {
3389 pub fn send(self, mut access_token: fidl::Event) -> Result<(), fidl::Error> {
3393 let _result = self.send_raw(access_token);
3394 if _result.is_err() {
3395 self.control_handle.shutdown();
3396 }
3397 self.drop_without_shutdown();
3398 _result
3399 }
3400
3401 pub fn send_no_shutdown_on_err(self, mut access_token: fidl::Event) -> Result<(), fidl::Error> {
3403 let _result = self.send_raw(access_token);
3404 self.drop_without_shutdown();
3405 _result
3406 }
3407
3408 fn send_raw(&self, mut access_token: fidl::Event) -> Result<(), fidl::Error> {
3409 self.control_handle.inner.send::<PerformanceCounterAccessGetPerformanceCountTokenResponse>(
3410 (access_token,),
3411 self.tx_id,
3412 0x48410470c5f00f92,
3413 fidl::encoding::DynamicFlags::empty(),
3414 )
3415 }
3416}
3417
3418#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3419pub struct PerformanceCounterEventsMarker;
3420
3421impl fidl::endpoints::ProtocolMarker for PerformanceCounterEventsMarker {
3422 type Proxy = PerformanceCounterEventsProxy;
3423 type RequestStream = PerformanceCounterEventsRequestStream;
3424 #[cfg(target_os = "fuchsia")]
3425 type SynchronousProxy = PerformanceCounterEventsSynchronousProxy;
3426
3427 const DEBUG_NAME: &'static str = "(anonymous) PerformanceCounterEvents";
3428}
3429
3430pub trait PerformanceCounterEventsProxyInterface: Send + Sync {}
3431#[derive(Debug)]
3432#[cfg(target_os = "fuchsia")]
3433pub struct PerformanceCounterEventsSynchronousProxy {
3434 client: fidl::client::sync::Client,
3435}
3436
3437#[cfg(target_os = "fuchsia")]
3438impl fidl::endpoints::SynchronousProxy for PerformanceCounterEventsSynchronousProxy {
3439 type Proxy = PerformanceCounterEventsProxy;
3440 type Protocol = PerformanceCounterEventsMarker;
3441
3442 fn from_channel(inner: fidl::Channel) -> Self {
3443 Self::new(inner)
3444 }
3445
3446 fn into_channel(self) -> fidl::Channel {
3447 self.client.into_channel()
3448 }
3449
3450 fn as_channel(&self) -> &fidl::Channel {
3451 self.client.as_channel()
3452 }
3453}
3454
3455#[cfg(target_os = "fuchsia")]
3456impl PerformanceCounterEventsSynchronousProxy {
3457 pub fn new(channel: fidl::Channel) -> Self {
3458 let protocol_name =
3459 <PerformanceCounterEventsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3460 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3461 }
3462
3463 pub fn into_channel(self) -> fidl::Channel {
3464 self.client.into_channel()
3465 }
3466
3467 pub fn wait_for_event(
3470 &self,
3471 deadline: zx::MonotonicInstant,
3472 ) -> Result<PerformanceCounterEventsEvent, fidl::Error> {
3473 PerformanceCounterEventsEvent::decode(self.client.wait_for_event(deadline)?)
3474 }
3475}
3476
3477#[cfg(target_os = "fuchsia")]
3478impl From<PerformanceCounterEventsSynchronousProxy> for zx::Handle {
3479 fn from(value: PerformanceCounterEventsSynchronousProxy) -> Self {
3480 value.into_channel().into()
3481 }
3482}
3483
3484#[cfg(target_os = "fuchsia")]
3485impl From<fidl::Channel> for PerformanceCounterEventsSynchronousProxy {
3486 fn from(value: fidl::Channel) -> Self {
3487 Self::new(value)
3488 }
3489}
3490
3491#[derive(Debug, Clone)]
3492pub struct PerformanceCounterEventsProxy {
3493 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3494}
3495
3496impl fidl::endpoints::Proxy for PerformanceCounterEventsProxy {
3497 type Protocol = PerformanceCounterEventsMarker;
3498
3499 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3500 Self::new(inner)
3501 }
3502
3503 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3504 self.client.into_channel().map_err(|client| Self { client })
3505 }
3506
3507 fn as_channel(&self) -> &::fidl::AsyncChannel {
3508 self.client.as_channel()
3509 }
3510}
3511
3512impl PerformanceCounterEventsProxy {
3513 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3515 let protocol_name =
3516 <PerformanceCounterEventsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3517 Self { client: fidl::client::Client::new(channel, protocol_name) }
3518 }
3519
3520 pub fn take_event_stream(&self) -> PerformanceCounterEventsEventStream {
3526 PerformanceCounterEventsEventStream { event_receiver: self.client.take_event_receiver() }
3527 }
3528}
3529
3530impl PerformanceCounterEventsProxyInterface for PerformanceCounterEventsProxy {}
3531
3532pub struct PerformanceCounterEventsEventStream {
3533 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3534}
3535
3536impl std::marker::Unpin for PerformanceCounterEventsEventStream {}
3537
3538impl futures::stream::FusedStream for PerformanceCounterEventsEventStream {
3539 fn is_terminated(&self) -> bool {
3540 self.event_receiver.is_terminated()
3541 }
3542}
3543
3544impl futures::Stream for PerformanceCounterEventsEventStream {
3545 type Item = Result<PerformanceCounterEventsEvent, fidl::Error>;
3546
3547 fn poll_next(
3548 mut self: std::pin::Pin<&mut Self>,
3549 cx: &mut std::task::Context<'_>,
3550 ) -> std::task::Poll<Option<Self::Item>> {
3551 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3552 &mut self.event_receiver,
3553 cx
3554 )?) {
3555 Some(buf) => std::task::Poll::Ready(Some(PerformanceCounterEventsEvent::decode(buf))),
3556 None => std::task::Poll::Ready(None),
3557 }
3558 }
3559}
3560
3561#[derive(Debug)]
3562pub enum PerformanceCounterEventsEvent {
3563 OnPerformanceCounterReadCompleted {
3564 payload: PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest,
3565 },
3566}
3567
3568impl PerformanceCounterEventsEvent {
3569 #[allow(irrefutable_let_patterns)]
3570 pub fn into_on_performance_counter_read_completed(
3571 self,
3572 ) -> Option<PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest> {
3573 if let PerformanceCounterEventsEvent::OnPerformanceCounterReadCompleted { payload } = self {
3574 Some((payload))
3575 } else {
3576 None
3577 }
3578 }
3579
3580 fn decode(
3582 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3583 ) -> Result<PerformanceCounterEventsEvent, fidl::Error> {
3584 let (bytes, _handles) = buf.split_mut();
3585 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3586 debug_assert_eq!(tx_header.tx_id, 0);
3587 match tx_header.ordinal {
3588 0x3f134926720d44d7 => {
3589 let mut out = fidl::new_empty!(
3590 PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest,
3591 fidl::encoding::DefaultFuchsiaResourceDialect
3592 );
3593 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3594 Ok((PerformanceCounterEventsEvent::OnPerformanceCounterReadCompleted {
3595 payload: out,
3596 }))
3597 }
3598 _ => Err(fidl::Error::UnknownOrdinal {
3599 ordinal: tx_header.ordinal,
3600 protocol_name:
3601 <PerformanceCounterEventsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3602 }),
3603 }
3604 }
3605}
3606
3607pub struct PerformanceCounterEventsRequestStream {
3609 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3610 is_terminated: bool,
3611}
3612
3613impl std::marker::Unpin for PerformanceCounterEventsRequestStream {}
3614
3615impl futures::stream::FusedStream for PerformanceCounterEventsRequestStream {
3616 fn is_terminated(&self) -> bool {
3617 self.is_terminated
3618 }
3619}
3620
3621impl fidl::endpoints::RequestStream for PerformanceCounterEventsRequestStream {
3622 type Protocol = PerformanceCounterEventsMarker;
3623 type ControlHandle = PerformanceCounterEventsControlHandle;
3624
3625 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3626 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3627 }
3628
3629 fn control_handle(&self) -> Self::ControlHandle {
3630 PerformanceCounterEventsControlHandle { inner: self.inner.clone() }
3631 }
3632
3633 fn into_inner(
3634 self,
3635 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3636 {
3637 (self.inner, self.is_terminated)
3638 }
3639
3640 fn from_inner(
3641 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3642 is_terminated: bool,
3643 ) -> Self {
3644 Self { inner, is_terminated }
3645 }
3646}
3647
3648impl futures::Stream for PerformanceCounterEventsRequestStream {
3649 type Item = Result<PerformanceCounterEventsRequest, fidl::Error>;
3650
3651 fn poll_next(
3652 mut self: std::pin::Pin<&mut Self>,
3653 cx: &mut std::task::Context<'_>,
3654 ) -> std::task::Poll<Option<Self::Item>> {
3655 let this = &mut *self;
3656 if this.inner.check_shutdown(cx) {
3657 this.is_terminated = true;
3658 return std::task::Poll::Ready(None);
3659 }
3660 if this.is_terminated {
3661 panic!("polled PerformanceCounterEventsRequestStream after completion");
3662 }
3663 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3664 |bytes, handles| {
3665 match this.inner.channel().read_etc(cx, bytes, handles) {
3666 std::task::Poll::Ready(Ok(())) => {}
3667 std::task::Poll::Pending => return std::task::Poll::Pending,
3668 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3669 this.is_terminated = true;
3670 return std::task::Poll::Ready(None);
3671 }
3672 std::task::Poll::Ready(Err(e)) => {
3673 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3674 e.into(),
3675 ))))
3676 }
3677 }
3678
3679 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3681
3682 std::task::Poll::Ready(Some(match header.ordinal {
3683 _ => Err(fidl::Error::UnknownOrdinal {
3684 ordinal: header.ordinal,
3685 protocol_name: <PerformanceCounterEventsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3686 }),
3687 }))
3688 },
3689 )
3690 }
3691}
3692
3693#[derive(Debug)]
3694pub enum PerformanceCounterEventsRequest {}
3695
3696impl PerformanceCounterEventsRequest {
3697 pub fn method_name(&self) -> &'static str {
3699 match *self {}
3700 }
3701}
3702
3703#[derive(Debug, Clone)]
3704pub struct PerformanceCounterEventsControlHandle {
3705 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3706}
3707
3708impl fidl::endpoints::ControlHandle for PerformanceCounterEventsControlHandle {
3709 fn shutdown(&self) {
3710 self.inner.shutdown()
3711 }
3712 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3713 self.inner.shutdown_with_epitaph(status)
3714 }
3715
3716 fn is_closed(&self) -> bool {
3717 self.inner.channel().is_closed()
3718 }
3719 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3720 self.inner.channel().on_closed()
3721 }
3722
3723 #[cfg(target_os = "fuchsia")]
3724 fn signal_peer(
3725 &self,
3726 clear_mask: zx::Signals,
3727 set_mask: zx::Signals,
3728 ) -> Result<(), zx_status::Status> {
3729 use fidl::Peered;
3730 self.inner.channel().signal_peer(clear_mask, set_mask)
3731 }
3732}
3733
3734impl PerformanceCounterEventsControlHandle {
3735 pub fn send_on_performance_counter_read_completed(
3736 &self,
3737 mut payload: &PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest,
3738 ) -> Result<(), fidl::Error> {
3739 self.inner.send::<PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest>(
3740 payload,
3741 0,
3742 0x3f134926720d44d7,
3743 fidl::encoding::DynamicFlags::empty(),
3744 )
3745 }
3746}
3747
3748#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3749pub struct PowerElementProviderMarker;
3750
3751impl fidl::endpoints::ProtocolMarker for PowerElementProviderMarker {
3752 type Proxy = PowerElementProviderProxy;
3753 type RequestStream = PowerElementProviderRequestStream;
3754 #[cfg(target_os = "fuchsia")]
3755 type SynchronousProxy = PowerElementProviderSynchronousProxy;
3756
3757 const DEBUG_NAME: &'static str = "(anonymous) PowerElementProvider";
3758}
3759pub type PowerElementProviderGetClockSpeedLevelResult =
3760 Result<PowerElementProviderGetClockSpeedLevelResponse, i32>;
3761pub type PowerElementProviderSetClockLimitResult =
3762 Result<PowerElementProviderSetClockLimitResponse, i32>;
3763
3764pub trait PowerElementProviderProxyInterface: Send + Sync {
3765 type GetPowerGoalsResponseFut: std::future::Future<Output = Result<Vec<PowerGoal>, fidl::Error>>
3766 + Send;
3767 fn r#get_power_goals(&self) -> Self::GetPowerGoalsResponseFut;
3768 type GetClockSpeedLevelResponseFut: std::future::Future<
3769 Output = Result<PowerElementProviderGetClockSpeedLevelResult, fidl::Error>,
3770 > + Send;
3771 fn r#get_clock_speed_level(
3772 &self,
3773 payload: &PowerElementProviderGetClockSpeedLevelRequest,
3774 ) -> Self::GetClockSpeedLevelResponseFut;
3775 type SetClockLimitResponseFut: std::future::Future<Output = Result<PowerElementProviderSetClockLimitResult, fidl::Error>>
3776 + Send;
3777 fn r#set_clock_limit(
3778 &self,
3779 payload: &PowerElementProviderSetClockLimitRequest,
3780 ) -> Self::SetClockLimitResponseFut;
3781}
3782#[derive(Debug)]
3783#[cfg(target_os = "fuchsia")]
3784pub struct PowerElementProviderSynchronousProxy {
3785 client: fidl::client::sync::Client,
3786}
3787
3788#[cfg(target_os = "fuchsia")]
3789impl fidl::endpoints::SynchronousProxy for PowerElementProviderSynchronousProxy {
3790 type Proxy = PowerElementProviderProxy;
3791 type Protocol = PowerElementProviderMarker;
3792
3793 fn from_channel(inner: fidl::Channel) -> Self {
3794 Self::new(inner)
3795 }
3796
3797 fn into_channel(self) -> fidl::Channel {
3798 self.client.into_channel()
3799 }
3800
3801 fn as_channel(&self) -> &fidl::Channel {
3802 self.client.as_channel()
3803 }
3804}
3805
3806#[cfg(target_os = "fuchsia")]
3807impl PowerElementProviderSynchronousProxy {
3808 pub fn new(channel: fidl::Channel) -> Self {
3809 let protocol_name =
3810 <PowerElementProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3811 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3812 }
3813
3814 pub fn into_channel(self) -> fidl::Channel {
3815 self.client.into_channel()
3816 }
3817
3818 pub fn wait_for_event(
3821 &self,
3822 deadline: zx::MonotonicInstant,
3823 ) -> Result<PowerElementProviderEvent, fidl::Error> {
3824 PowerElementProviderEvent::decode(self.client.wait_for_event(deadline)?)
3825 }
3826
3827 pub fn r#get_power_goals(
3829 &self,
3830 ___deadline: zx::MonotonicInstant,
3831 ) -> Result<Vec<PowerGoal>, fidl::Error> {
3832 let _response = self.client.send_query::<
3833 fidl::encoding::EmptyPayload,
3834 fidl::encoding::FlexibleType<PowerElementProviderGetPowerGoalsResponse>,
3835 >(
3836 (),
3837 0x2ff49ddffb0e07c0,
3838 fidl::encoding::DynamicFlags::FLEXIBLE,
3839 ___deadline,
3840 )?
3841 .into_result::<PowerElementProviderMarker>("get_power_goals")?;
3842 Ok(_response.goals)
3843 }
3844
3845 pub fn r#get_clock_speed_level(
3849 &self,
3850 mut payload: &PowerElementProviderGetClockSpeedLevelRequest,
3851 ___deadline: zx::MonotonicInstant,
3852 ) -> Result<PowerElementProviderGetClockSpeedLevelResult, fidl::Error> {
3853 let _response = self.client.send_query::<
3854 PowerElementProviderGetClockSpeedLevelRequest,
3855 fidl::encoding::FlexibleResultType<PowerElementProviderGetClockSpeedLevelResponse, i32>,
3856 >(
3857 payload,
3858 0x5315a9bc44a9c53c,
3859 fidl::encoding::DynamicFlags::FLEXIBLE,
3860 ___deadline,
3861 )?
3862 .into_result::<PowerElementProviderMarker>("get_clock_speed_level")?;
3863 Ok(_response.map(|x| x))
3864 }
3865
3866 pub fn r#set_clock_limit(
3868 &self,
3869 mut payload: &PowerElementProviderSetClockLimitRequest,
3870 ___deadline: zx::MonotonicInstant,
3871 ) -> Result<PowerElementProviderSetClockLimitResult, fidl::Error> {
3872 let _response = self.client.send_query::<
3873 PowerElementProviderSetClockLimitRequest,
3874 fidl::encoding::FlexibleResultType<PowerElementProviderSetClockLimitResponse, i32>,
3875 >(
3876 payload,
3877 0x614bf25c3a1571b4,
3878 fidl::encoding::DynamicFlags::FLEXIBLE,
3879 ___deadline,
3880 )?
3881 .into_result::<PowerElementProviderMarker>("set_clock_limit")?;
3882 Ok(_response.map(|x| x))
3883 }
3884}
3885
3886#[cfg(target_os = "fuchsia")]
3887impl From<PowerElementProviderSynchronousProxy> for zx::Handle {
3888 fn from(value: PowerElementProviderSynchronousProxy) -> Self {
3889 value.into_channel().into()
3890 }
3891}
3892
3893#[cfg(target_os = "fuchsia")]
3894impl From<fidl::Channel> for PowerElementProviderSynchronousProxy {
3895 fn from(value: fidl::Channel) -> Self {
3896 Self::new(value)
3897 }
3898}
3899
3900#[derive(Debug, Clone)]
3901pub struct PowerElementProviderProxy {
3902 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3903}
3904
3905impl fidl::endpoints::Proxy for PowerElementProviderProxy {
3906 type Protocol = PowerElementProviderMarker;
3907
3908 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3909 Self::new(inner)
3910 }
3911
3912 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3913 self.client.into_channel().map_err(|client| Self { client })
3914 }
3915
3916 fn as_channel(&self) -> &::fidl::AsyncChannel {
3917 self.client.as_channel()
3918 }
3919}
3920
3921impl PowerElementProviderProxy {
3922 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3924 let protocol_name =
3925 <PowerElementProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3926 Self { client: fidl::client::Client::new(channel, protocol_name) }
3927 }
3928
3929 pub fn take_event_stream(&self) -> PowerElementProviderEventStream {
3935 PowerElementProviderEventStream { event_receiver: self.client.take_event_receiver() }
3936 }
3937
3938 pub fn r#get_power_goals(
3940 &self,
3941 ) -> fidl::client::QueryResponseFut<Vec<PowerGoal>, fidl::encoding::DefaultFuchsiaResourceDialect>
3942 {
3943 PowerElementProviderProxyInterface::r#get_power_goals(self)
3944 }
3945
3946 pub fn r#get_clock_speed_level(
3950 &self,
3951 mut payload: &PowerElementProviderGetClockSpeedLevelRequest,
3952 ) -> fidl::client::QueryResponseFut<
3953 PowerElementProviderGetClockSpeedLevelResult,
3954 fidl::encoding::DefaultFuchsiaResourceDialect,
3955 > {
3956 PowerElementProviderProxyInterface::r#get_clock_speed_level(self, payload)
3957 }
3958
3959 pub fn r#set_clock_limit(
3961 &self,
3962 mut payload: &PowerElementProviderSetClockLimitRequest,
3963 ) -> fidl::client::QueryResponseFut<
3964 PowerElementProviderSetClockLimitResult,
3965 fidl::encoding::DefaultFuchsiaResourceDialect,
3966 > {
3967 PowerElementProviderProxyInterface::r#set_clock_limit(self, payload)
3968 }
3969}
3970
3971impl PowerElementProviderProxyInterface for PowerElementProviderProxy {
3972 type GetPowerGoalsResponseFut = fidl::client::QueryResponseFut<
3973 Vec<PowerGoal>,
3974 fidl::encoding::DefaultFuchsiaResourceDialect,
3975 >;
3976 fn r#get_power_goals(&self) -> Self::GetPowerGoalsResponseFut {
3977 fn _decode(
3978 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3979 ) -> Result<Vec<PowerGoal>, fidl::Error> {
3980 let _response = fidl::client::decode_transaction_body::<
3981 fidl::encoding::FlexibleType<PowerElementProviderGetPowerGoalsResponse>,
3982 fidl::encoding::DefaultFuchsiaResourceDialect,
3983 0x2ff49ddffb0e07c0,
3984 >(_buf?)?
3985 .into_result::<PowerElementProviderMarker>("get_power_goals")?;
3986 Ok(_response.goals)
3987 }
3988 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<PowerGoal>>(
3989 (),
3990 0x2ff49ddffb0e07c0,
3991 fidl::encoding::DynamicFlags::FLEXIBLE,
3992 _decode,
3993 )
3994 }
3995
3996 type GetClockSpeedLevelResponseFut = fidl::client::QueryResponseFut<
3997 PowerElementProviderGetClockSpeedLevelResult,
3998 fidl::encoding::DefaultFuchsiaResourceDialect,
3999 >;
4000 fn r#get_clock_speed_level(
4001 &self,
4002 mut payload: &PowerElementProviderGetClockSpeedLevelRequest,
4003 ) -> Self::GetClockSpeedLevelResponseFut {
4004 fn _decode(
4005 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4006 ) -> Result<PowerElementProviderGetClockSpeedLevelResult, fidl::Error> {
4007 let _response = fidl::client::decode_transaction_body::<
4008 fidl::encoding::FlexibleResultType<
4009 PowerElementProviderGetClockSpeedLevelResponse,
4010 i32,
4011 >,
4012 fidl::encoding::DefaultFuchsiaResourceDialect,
4013 0x5315a9bc44a9c53c,
4014 >(_buf?)?
4015 .into_result::<PowerElementProviderMarker>("get_clock_speed_level")?;
4016 Ok(_response.map(|x| x))
4017 }
4018 self.client.send_query_and_decode::<
4019 PowerElementProviderGetClockSpeedLevelRequest,
4020 PowerElementProviderGetClockSpeedLevelResult,
4021 >(
4022 payload,
4023 0x5315a9bc44a9c53c,
4024 fidl::encoding::DynamicFlags::FLEXIBLE,
4025 _decode,
4026 )
4027 }
4028
4029 type SetClockLimitResponseFut = fidl::client::QueryResponseFut<
4030 PowerElementProviderSetClockLimitResult,
4031 fidl::encoding::DefaultFuchsiaResourceDialect,
4032 >;
4033 fn r#set_clock_limit(
4034 &self,
4035 mut payload: &PowerElementProviderSetClockLimitRequest,
4036 ) -> Self::SetClockLimitResponseFut {
4037 fn _decode(
4038 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4039 ) -> Result<PowerElementProviderSetClockLimitResult, fidl::Error> {
4040 let _response = fidl::client::decode_transaction_body::<
4041 fidl::encoding::FlexibleResultType<PowerElementProviderSetClockLimitResponse, i32>,
4042 fidl::encoding::DefaultFuchsiaResourceDialect,
4043 0x614bf25c3a1571b4,
4044 >(_buf?)?
4045 .into_result::<PowerElementProviderMarker>("set_clock_limit")?;
4046 Ok(_response.map(|x| x))
4047 }
4048 self.client.send_query_and_decode::<
4049 PowerElementProviderSetClockLimitRequest,
4050 PowerElementProviderSetClockLimitResult,
4051 >(
4052 payload,
4053 0x614bf25c3a1571b4,
4054 fidl::encoding::DynamicFlags::FLEXIBLE,
4055 _decode,
4056 )
4057 }
4058}
4059
4060pub struct PowerElementProviderEventStream {
4061 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4062}
4063
4064impl std::marker::Unpin for PowerElementProviderEventStream {}
4065
4066impl futures::stream::FusedStream for PowerElementProviderEventStream {
4067 fn is_terminated(&self) -> bool {
4068 self.event_receiver.is_terminated()
4069 }
4070}
4071
4072impl futures::Stream for PowerElementProviderEventStream {
4073 type Item = Result<PowerElementProviderEvent, fidl::Error>;
4074
4075 fn poll_next(
4076 mut self: std::pin::Pin<&mut Self>,
4077 cx: &mut std::task::Context<'_>,
4078 ) -> std::task::Poll<Option<Self::Item>> {
4079 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4080 &mut self.event_receiver,
4081 cx
4082 )?) {
4083 Some(buf) => std::task::Poll::Ready(Some(PowerElementProviderEvent::decode(buf))),
4084 None => std::task::Poll::Ready(None),
4085 }
4086 }
4087}
4088
4089#[derive(Debug)]
4090pub enum PowerElementProviderEvent {
4091 #[non_exhaustive]
4092 _UnknownEvent {
4093 ordinal: u64,
4095 },
4096}
4097
4098impl PowerElementProviderEvent {
4099 fn decode(
4101 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4102 ) -> Result<PowerElementProviderEvent, fidl::Error> {
4103 let (bytes, _handles) = buf.split_mut();
4104 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4105 debug_assert_eq!(tx_header.tx_id, 0);
4106 match tx_header.ordinal {
4107 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4108 Ok(PowerElementProviderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4109 }
4110 _ => Err(fidl::Error::UnknownOrdinal {
4111 ordinal: tx_header.ordinal,
4112 protocol_name:
4113 <PowerElementProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4114 }),
4115 }
4116 }
4117}
4118
4119pub struct PowerElementProviderRequestStream {
4121 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4122 is_terminated: bool,
4123}
4124
4125impl std::marker::Unpin for PowerElementProviderRequestStream {}
4126
4127impl futures::stream::FusedStream for PowerElementProviderRequestStream {
4128 fn is_terminated(&self) -> bool {
4129 self.is_terminated
4130 }
4131}
4132
4133impl fidl::endpoints::RequestStream for PowerElementProviderRequestStream {
4134 type Protocol = PowerElementProviderMarker;
4135 type ControlHandle = PowerElementProviderControlHandle;
4136
4137 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4138 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4139 }
4140
4141 fn control_handle(&self) -> Self::ControlHandle {
4142 PowerElementProviderControlHandle { inner: self.inner.clone() }
4143 }
4144
4145 fn into_inner(
4146 self,
4147 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4148 {
4149 (self.inner, self.is_terminated)
4150 }
4151
4152 fn from_inner(
4153 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4154 is_terminated: bool,
4155 ) -> Self {
4156 Self { inner, is_terminated }
4157 }
4158}
4159
4160impl futures::Stream for PowerElementProviderRequestStream {
4161 type Item = Result<PowerElementProviderRequest, fidl::Error>;
4162
4163 fn poll_next(
4164 mut self: std::pin::Pin<&mut Self>,
4165 cx: &mut std::task::Context<'_>,
4166 ) -> std::task::Poll<Option<Self::Item>> {
4167 let this = &mut *self;
4168 if this.inner.check_shutdown(cx) {
4169 this.is_terminated = true;
4170 return std::task::Poll::Ready(None);
4171 }
4172 if this.is_terminated {
4173 panic!("polled PowerElementProviderRequestStream after completion");
4174 }
4175 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4176 |bytes, handles| {
4177 match this.inner.channel().read_etc(cx, bytes, handles) {
4178 std::task::Poll::Ready(Ok(())) => {}
4179 std::task::Poll::Pending => return std::task::Poll::Pending,
4180 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4181 this.is_terminated = true;
4182 return std::task::Poll::Ready(None);
4183 }
4184 std::task::Poll::Ready(Err(e)) => {
4185 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4186 e.into(),
4187 ))))
4188 }
4189 }
4190
4191 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4193
4194 std::task::Poll::Ready(Some(match header.ordinal {
4195 0x2ff49ddffb0e07c0 => {
4196 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4197 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4198 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4199 let control_handle = PowerElementProviderControlHandle {
4200 inner: this.inner.clone(),
4201 };
4202 Ok(PowerElementProviderRequest::GetPowerGoals {
4203 responder: PowerElementProviderGetPowerGoalsResponder {
4204 control_handle: std::mem::ManuallyDrop::new(control_handle),
4205 tx_id: header.tx_id,
4206 },
4207 })
4208 }
4209 0x5315a9bc44a9c53c => {
4210 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4211 let mut req = fidl::new_empty!(PowerElementProviderGetClockSpeedLevelRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4212 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PowerElementProviderGetClockSpeedLevelRequest>(&header, _body_bytes, handles, &mut req)?;
4213 let control_handle = PowerElementProviderControlHandle {
4214 inner: this.inner.clone(),
4215 };
4216 Ok(PowerElementProviderRequest::GetClockSpeedLevel {payload: req,
4217 responder: PowerElementProviderGetClockSpeedLevelResponder {
4218 control_handle: std::mem::ManuallyDrop::new(control_handle),
4219 tx_id: header.tx_id,
4220 },
4221 })
4222 }
4223 0x614bf25c3a1571b4 => {
4224 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4225 let mut req = fidl::new_empty!(PowerElementProviderSetClockLimitRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4226 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PowerElementProviderSetClockLimitRequest>(&header, _body_bytes, handles, &mut req)?;
4227 let control_handle = PowerElementProviderControlHandle {
4228 inner: this.inner.clone(),
4229 };
4230 Ok(PowerElementProviderRequest::SetClockLimit {payload: req,
4231 responder: PowerElementProviderSetClockLimitResponder {
4232 control_handle: std::mem::ManuallyDrop::new(control_handle),
4233 tx_id: header.tx_id,
4234 },
4235 })
4236 }
4237 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4238 Ok(PowerElementProviderRequest::_UnknownMethod {
4239 ordinal: header.ordinal,
4240 control_handle: PowerElementProviderControlHandle { inner: this.inner.clone() },
4241 method_type: fidl::MethodType::OneWay,
4242 })
4243 }
4244 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4245 this.inner.send_framework_err(
4246 fidl::encoding::FrameworkErr::UnknownMethod,
4247 header.tx_id,
4248 header.ordinal,
4249 header.dynamic_flags(),
4250 (bytes, handles),
4251 )?;
4252 Ok(PowerElementProviderRequest::_UnknownMethod {
4253 ordinal: header.ordinal,
4254 control_handle: PowerElementProviderControlHandle { inner: this.inner.clone() },
4255 method_type: fidl::MethodType::TwoWay,
4256 })
4257 }
4258 _ => Err(fidl::Error::UnknownOrdinal {
4259 ordinal: header.ordinal,
4260 protocol_name: <PowerElementProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4261 }),
4262 }))
4263 },
4264 )
4265 }
4266}
4267
4268#[derive(Debug)]
4270pub enum PowerElementProviderRequest {
4271 GetPowerGoals { responder: PowerElementProviderGetPowerGoalsResponder },
4273 GetClockSpeedLevel {
4277 payload: PowerElementProviderGetClockSpeedLevelRequest,
4278 responder: PowerElementProviderGetClockSpeedLevelResponder,
4279 },
4280 SetClockLimit {
4282 payload: PowerElementProviderSetClockLimitRequest,
4283 responder: PowerElementProviderSetClockLimitResponder,
4284 },
4285 #[non_exhaustive]
4287 _UnknownMethod {
4288 ordinal: u64,
4290 control_handle: PowerElementProviderControlHandle,
4291 method_type: fidl::MethodType,
4292 },
4293}
4294
4295impl PowerElementProviderRequest {
4296 #[allow(irrefutable_let_patterns)]
4297 pub fn into_get_power_goals(self) -> Option<(PowerElementProviderGetPowerGoalsResponder)> {
4298 if let PowerElementProviderRequest::GetPowerGoals { responder } = self {
4299 Some((responder))
4300 } else {
4301 None
4302 }
4303 }
4304
4305 #[allow(irrefutable_let_patterns)]
4306 pub fn into_get_clock_speed_level(
4307 self,
4308 ) -> Option<(
4309 PowerElementProviderGetClockSpeedLevelRequest,
4310 PowerElementProviderGetClockSpeedLevelResponder,
4311 )> {
4312 if let PowerElementProviderRequest::GetClockSpeedLevel { payload, responder } = self {
4313 Some((payload, responder))
4314 } else {
4315 None
4316 }
4317 }
4318
4319 #[allow(irrefutable_let_patterns)]
4320 pub fn into_set_clock_limit(
4321 self,
4322 ) -> Option<(
4323 PowerElementProviderSetClockLimitRequest,
4324 PowerElementProviderSetClockLimitResponder,
4325 )> {
4326 if let PowerElementProviderRequest::SetClockLimit { payload, responder } = self {
4327 Some((payload, responder))
4328 } else {
4329 None
4330 }
4331 }
4332
4333 pub fn method_name(&self) -> &'static str {
4335 match *self {
4336 PowerElementProviderRequest::GetPowerGoals { .. } => "get_power_goals",
4337 PowerElementProviderRequest::GetClockSpeedLevel { .. } => "get_clock_speed_level",
4338 PowerElementProviderRequest::SetClockLimit { .. } => "set_clock_limit",
4339 PowerElementProviderRequest::_UnknownMethod {
4340 method_type: fidl::MethodType::OneWay,
4341 ..
4342 } => "unknown one-way method",
4343 PowerElementProviderRequest::_UnknownMethod {
4344 method_type: fidl::MethodType::TwoWay,
4345 ..
4346 } => "unknown two-way method",
4347 }
4348 }
4349}
4350
4351#[derive(Debug, Clone)]
4352pub struct PowerElementProviderControlHandle {
4353 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4354}
4355
4356impl fidl::endpoints::ControlHandle for PowerElementProviderControlHandle {
4357 fn shutdown(&self) {
4358 self.inner.shutdown()
4359 }
4360 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4361 self.inner.shutdown_with_epitaph(status)
4362 }
4363
4364 fn is_closed(&self) -> bool {
4365 self.inner.channel().is_closed()
4366 }
4367 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4368 self.inner.channel().on_closed()
4369 }
4370
4371 #[cfg(target_os = "fuchsia")]
4372 fn signal_peer(
4373 &self,
4374 clear_mask: zx::Signals,
4375 set_mask: zx::Signals,
4376 ) -> Result<(), zx_status::Status> {
4377 use fidl::Peered;
4378 self.inner.channel().signal_peer(clear_mask, set_mask)
4379 }
4380}
4381
4382impl PowerElementProviderControlHandle {}
4383
4384#[must_use = "FIDL methods require a response to be sent"]
4385#[derive(Debug)]
4386pub struct PowerElementProviderGetPowerGoalsResponder {
4387 control_handle: std::mem::ManuallyDrop<PowerElementProviderControlHandle>,
4388 tx_id: u32,
4389}
4390
4391impl std::ops::Drop for PowerElementProviderGetPowerGoalsResponder {
4395 fn drop(&mut self) {
4396 self.control_handle.shutdown();
4397 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4399 }
4400}
4401
4402impl fidl::endpoints::Responder for PowerElementProviderGetPowerGoalsResponder {
4403 type ControlHandle = PowerElementProviderControlHandle;
4404
4405 fn control_handle(&self) -> &PowerElementProviderControlHandle {
4406 &self.control_handle
4407 }
4408
4409 fn drop_without_shutdown(mut self) {
4410 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4412 std::mem::forget(self);
4414 }
4415}
4416
4417impl PowerElementProviderGetPowerGoalsResponder {
4418 pub fn send(self, mut goals: Vec<PowerGoal>) -> Result<(), fidl::Error> {
4422 let _result = self.send_raw(goals);
4423 if _result.is_err() {
4424 self.control_handle.shutdown();
4425 }
4426 self.drop_without_shutdown();
4427 _result
4428 }
4429
4430 pub fn send_no_shutdown_on_err(self, mut goals: Vec<PowerGoal>) -> Result<(), fidl::Error> {
4432 let _result = self.send_raw(goals);
4433 self.drop_without_shutdown();
4434 _result
4435 }
4436
4437 fn send_raw(&self, mut goals: Vec<PowerGoal>) -> Result<(), fidl::Error> {
4438 self.control_handle.inner.send::<fidl::encoding::FlexibleType<
4439 PowerElementProviderGetPowerGoalsResponse,
4440 >>(
4441 fidl::encoding::Flexible::new((goals.as_mut(),)),
4442 self.tx_id,
4443 0x2ff49ddffb0e07c0,
4444 fidl::encoding::DynamicFlags::FLEXIBLE,
4445 )
4446 }
4447}
4448
4449#[must_use = "FIDL methods require a response to be sent"]
4450#[derive(Debug)]
4451pub struct PowerElementProviderGetClockSpeedLevelResponder {
4452 control_handle: std::mem::ManuallyDrop<PowerElementProviderControlHandle>,
4453 tx_id: u32,
4454}
4455
4456impl std::ops::Drop for PowerElementProviderGetClockSpeedLevelResponder {
4460 fn drop(&mut self) {
4461 self.control_handle.shutdown();
4462 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4464 }
4465}
4466
4467impl fidl::endpoints::Responder for PowerElementProviderGetClockSpeedLevelResponder {
4468 type ControlHandle = PowerElementProviderControlHandle;
4469
4470 fn control_handle(&self) -> &PowerElementProviderControlHandle {
4471 &self.control_handle
4472 }
4473
4474 fn drop_without_shutdown(mut self) {
4475 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4477 std::mem::forget(self);
4479 }
4480}
4481
4482impl PowerElementProviderGetClockSpeedLevelResponder {
4483 pub fn send(
4487 self,
4488 mut result: Result<PowerElementProviderGetClockSpeedLevelResponse, i32>,
4489 ) -> Result<(), fidl::Error> {
4490 let _result = self.send_raw(result);
4491 if _result.is_err() {
4492 self.control_handle.shutdown();
4493 }
4494 self.drop_without_shutdown();
4495 _result
4496 }
4497
4498 pub fn send_no_shutdown_on_err(
4500 self,
4501 mut result: Result<PowerElementProviderGetClockSpeedLevelResponse, i32>,
4502 ) -> Result<(), fidl::Error> {
4503 let _result = self.send_raw(result);
4504 self.drop_without_shutdown();
4505 _result
4506 }
4507
4508 fn send_raw(
4509 &self,
4510 mut result: Result<PowerElementProviderGetClockSpeedLevelResponse, i32>,
4511 ) -> Result<(), fidl::Error> {
4512 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4513 PowerElementProviderGetClockSpeedLevelResponse,
4514 i32,
4515 >>(
4516 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4517 self.tx_id,
4518 0x5315a9bc44a9c53c,
4519 fidl::encoding::DynamicFlags::FLEXIBLE,
4520 )
4521 }
4522}
4523
4524#[must_use = "FIDL methods require a response to be sent"]
4525#[derive(Debug)]
4526pub struct PowerElementProviderSetClockLimitResponder {
4527 control_handle: std::mem::ManuallyDrop<PowerElementProviderControlHandle>,
4528 tx_id: u32,
4529}
4530
4531impl std::ops::Drop for PowerElementProviderSetClockLimitResponder {
4535 fn drop(&mut self) {
4536 self.control_handle.shutdown();
4537 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4539 }
4540}
4541
4542impl fidl::endpoints::Responder for PowerElementProviderSetClockLimitResponder {
4543 type ControlHandle = PowerElementProviderControlHandle;
4544
4545 fn control_handle(&self) -> &PowerElementProviderControlHandle {
4546 &self.control_handle
4547 }
4548
4549 fn drop_without_shutdown(mut self) {
4550 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4552 std::mem::forget(self);
4554 }
4555}
4556
4557impl PowerElementProviderSetClockLimitResponder {
4558 pub fn send(
4562 self,
4563 mut result: Result<PowerElementProviderSetClockLimitResponse, i32>,
4564 ) -> Result<(), fidl::Error> {
4565 let _result = self.send_raw(result);
4566 if _result.is_err() {
4567 self.control_handle.shutdown();
4568 }
4569 self.drop_without_shutdown();
4570 _result
4571 }
4572
4573 pub fn send_no_shutdown_on_err(
4575 self,
4576 mut result: Result<PowerElementProviderSetClockLimitResponse, i32>,
4577 ) -> Result<(), fidl::Error> {
4578 let _result = self.send_raw(result);
4579 self.drop_without_shutdown();
4580 _result
4581 }
4582
4583 fn send_raw(
4584 &self,
4585 mut result: Result<PowerElementProviderSetClockLimitResponse, i32>,
4586 ) -> Result<(), fidl::Error> {
4587 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4588 PowerElementProviderSetClockLimitResponse,
4589 i32,
4590 >>(
4591 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4592 self.tx_id,
4593 0x614bf25c3a1571b4,
4594 fidl::encoding::DynamicFlags::FLEXIBLE,
4595 )
4596 }
4597}
4598
4599#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4600pub struct PrimaryMarker;
4601
4602impl fidl::endpoints::ProtocolMarker for PrimaryMarker {
4603 type Proxy = PrimaryProxy;
4604 type RequestStream = PrimaryRequestStream;
4605 #[cfg(target_os = "fuchsia")]
4606 type SynchronousProxy = PrimarySynchronousProxy;
4607
4608 const DEBUG_NAME: &'static str = "(anonymous) Primary";
4609}
4610
4611pub trait PrimaryProxyInterface: Send + Sync {
4612 fn r#import_object2(
4613 &self,
4614 object: fidl::Handle,
4615 object_type: ObjectType,
4616 object_id: u64,
4617 ) -> Result<(), fidl::Error>;
4618 fn r#import_object(&self, payload: PrimaryImportObjectRequest) -> Result<(), fidl::Error>;
4619 fn r#release_object(&self, object_id: u64, object_type: ObjectType) -> Result<(), fidl::Error>;
4620 fn r#create_context(&self, context_id: u32) -> Result<(), fidl::Error>;
4621 fn r#destroy_context(&self, context_id: u32) -> Result<(), fidl::Error>;
4622 fn r#execute_command(
4623 &self,
4624 context_id: u32,
4625 resources: &[BufferRange],
4626 command_buffers: &[CommandBuffer],
4627 wait_semaphores: &[u64],
4628 signal_semaphores: &[u64],
4629 flags: CommandBufferFlags,
4630 ) -> Result<(), fidl::Error>;
4631 fn r#execute_immediate_commands(
4632 &self,
4633 context_id: u32,
4634 command_data: &[u8],
4635 semaphores: &[u64],
4636 ) -> Result<(), fidl::Error>;
4637 fn r#execute_inline_commands(
4638 &self,
4639 context_id: u32,
4640 commands: &[InlineCommand],
4641 ) -> Result<(), fidl::Error>;
4642 type FlushResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
4643 fn r#flush(&self) -> Self::FlushResponseFut;
4644 fn r#map_buffer(&self, payload: &PrimaryMapBufferRequest) -> Result<(), fidl::Error>;
4645 fn r#unmap_buffer(&self, payload: &PrimaryUnmapBufferRequest) -> Result<(), fidl::Error>;
4646 fn r#buffer_range_op2(&self, op: BufferOp, range: &BufferRange) -> Result<(), fidl::Error>;
4647 fn r#enable_flow_control(&self) -> Result<(), fidl::Error>;
4648 fn r#enable_performance_counter_access(
4649 &self,
4650 access_token: fidl::Event,
4651 ) -> Result<(), fidl::Error>;
4652 type IsPerformanceCounterAccessAllowedResponseFut: std::future::Future<Output = Result<bool, fidl::Error>>
4653 + Send;
4654 fn r#is_performance_counter_access_allowed(
4655 &self,
4656 ) -> Self::IsPerformanceCounterAccessAllowedResponseFut;
4657 fn r#enable_performance_counters(&self, counters: &[u64]) -> Result<(), fidl::Error>;
4658 fn r#create_performance_counter_buffer_pool(
4659 &self,
4660 pool_id: u64,
4661 event_channel: fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
4662 ) -> Result<(), fidl::Error>;
4663 fn r#release_performance_counter_buffer_pool(&self, pool_id: u64) -> Result<(), fidl::Error>;
4664 fn r#add_performance_counter_buffer_offsets_to_pool(
4665 &self,
4666 pool_id: u64,
4667 offsets: &[BufferRange],
4668 ) -> Result<(), fidl::Error>;
4669 fn r#remove_performance_counter_buffer_from_pool(
4670 &self,
4671 pool_id: u64,
4672 buffer_id: u64,
4673 ) -> Result<(), fidl::Error>;
4674 fn r#dump_performance_counters(&self, pool_id: u64, trigger_id: u32)
4675 -> Result<(), fidl::Error>;
4676 fn r#clear_performance_counters(&self, counters: &[u64]) -> Result<(), fidl::Error>;
4677}
4678#[derive(Debug)]
4679#[cfg(target_os = "fuchsia")]
4680pub struct PrimarySynchronousProxy {
4681 client: fidl::client::sync::Client,
4682}
4683
4684#[cfg(target_os = "fuchsia")]
4685impl fidl::endpoints::SynchronousProxy for PrimarySynchronousProxy {
4686 type Proxy = PrimaryProxy;
4687 type Protocol = PrimaryMarker;
4688
4689 fn from_channel(inner: fidl::Channel) -> Self {
4690 Self::new(inner)
4691 }
4692
4693 fn into_channel(self) -> fidl::Channel {
4694 self.client.into_channel()
4695 }
4696
4697 fn as_channel(&self) -> &fidl::Channel {
4698 self.client.as_channel()
4699 }
4700}
4701
4702#[cfg(target_os = "fuchsia")]
4703impl PrimarySynchronousProxy {
4704 pub fn new(channel: fidl::Channel) -> Self {
4705 let protocol_name = <PrimaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4706 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4707 }
4708
4709 pub fn into_channel(self) -> fidl::Channel {
4710 self.client.into_channel()
4711 }
4712
4713 pub fn wait_for_event(
4716 &self,
4717 deadline: zx::MonotonicInstant,
4718 ) -> Result<PrimaryEvent, fidl::Error> {
4719 PrimaryEvent::decode(self.client.wait_for_event(deadline)?)
4720 }
4721
4722 pub fn r#import_object2(
4723 &self,
4724 mut object: fidl::Handle,
4725 mut object_type: ObjectType,
4726 mut object_id: u64,
4727 ) -> Result<(), fidl::Error> {
4728 self.client.send::<PrimaryImportObject2Request>(
4729 (object, object_type, object_id),
4730 0x774ef4bc434f6b40,
4731 fidl::encoding::DynamicFlags::empty(),
4732 )
4733 }
4734
4735 pub fn r#import_object(
4737 &self,
4738 mut payload: PrimaryImportObjectRequest,
4739 ) -> Result<(), fidl::Error> {
4740 self.client.send::<PrimaryImportObjectRequest>(
4741 &mut payload,
4742 0x5f5a247abb1d9354,
4743 fidl::encoding::DynamicFlags::empty(),
4744 )
4745 }
4746
4747 pub fn r#release_object(
4749 &self,
4750 mut object_id: u64,
4751 mut object_type: ObjectType,
4752 ) -> Result<(), fidl::Error> {
4753 self.client.send::<PrimaryReleaseObjectRequest>(
4754 (object_id, object_type),
4755 0x4a65d5885da5e88f,
4756 fidl::encoding::DynamicFlags::empty(),
4757 )
4758 }
4759
4760 pub fn r#create_context(&self, mut context_id: u32) -> Result<(), fidl::Error> {
4763 self.client.send::<PrimaryCreateContextRequest>(
4764 (context_id,),
4765 0x5a9a91c8b88b5da4,
4766 fidl::encoding::DynamicFlags::empty(),
4767 )
4768 }
4769
4770 pub fn r#destroy_context(&self, mut context_id: u32) -> Result<(), fidl::Error> {
4772 self.client.send::<PrimaryDestroyContextRequest>(
4773 (context_id,),
4774 0x26b626e6be162ef0,
4775 fidl::encoding::DynamicFlags::empty(),
4776 )
4777 }
4778
4779 pub fn r#execute_command(
4785 &self,
4786 mut context_id: u32,
4787 mut resources: &[BufferRange],
4788 mut command_buffers: &[CommandBuffer],
4789 mut wait_semaphores: &[u64],
4790 mut signal_semaphores: &[u64],
4791 mut flags: CommandBufferFlags,
4792 ) -> Result<(), fidl::Error> {
4793 self.client.send::<PrimaryExecuteCommandRequest>(
4794 (context_id, resources, command_buffers, wait_semaphores, signal_semaphores, flags),
4795 0xf2799643aadb0db,
4796 fidl::encoding::DynamicFlags::empty(),
4797 )
4798 }
4799
4800 pub fn r#execute_immediate_commands(
4804 &self,
4805 mut context_id: u32,
4806 mut command_data: &[u8],
4807 mut semaphores: &[u64],
4808 ) -> Result<(), fidl::Error> {
4809 self.client.send::<PrimaryExecuteImmediateCommandsRequest>(
4810 (context_id, command_data, semaphores),
4811 0x3d7e0dcdbfd4b61f,
4812 fidl::encoding::DynamicFlags::empty(),
4813 )
4814 }
4815
4816 pub fn r#execute_inline_commands(
4820 &self,
4821 mut context_id: u32,
4822 mut commands: &[InlineCommand],
4823 ) -> Result<(), fidl::Error> {
4824 self.client.send::<PrimaryExecuteInlineCommandsRequest>(
4825 (context_id, commands),
4826 0x766d5c86f35468a6,
4827 fidl::encoding::DynamicFlags::empty(),
4828 )
4829 }
4830
4831 pub fn r#flush(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
4834 let _response =
4835 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
4836 (),
4837 0x54ccb5572d886039,
4838 fidl::encoding::DynamicFlags::empty(),
4839 ___deadline,
4840 )?;
4841 Ok(_response)
4842 }
4843
4844 pub fn r#map_buffer(&self, mut payload: &PrimaryMapBufferRequest) -> Result<(), fidl::Error> {
4847 self.client.send::<PrimaryMapBufferRequest>(
4848 payload,
4849 0x56baa5d2092c8e33,
4850 fidl::encoding::DynamicFlags::empty(),
4851 )
4852 }
4853
4854 pub fn r#unmap_buffer(
4857 &self,
4858 mut payload: &PrimaryUnmapBufferRequest,
4859 ) -> Result<(), fidl::Error> {
4860 self.client.send::<PrimaryUnmapBufferRequest>(
4861 payload,
4862 0x305188ebd8bcd95c,
4863 fidl::encoding::DynamicFlags::empty(),
4864 )
4865 }
4866
4867 pub fn r#buffer_range_op2(
4869 &self,
4870 mut op: BufferOp,
4871 mut range: &BufferRange,
4872 ) -> Result<(), fidl::Error> {
4873 self.client.send::<PrimaryBufferRangeOp2Request>(
4874 (op, range),
4875 0x4175c8dfef355396,
4876 fidl::encoding::DynamicFlags::empty(),
4877 )
4878 }
4879
4880 pub fn r#enable_flow_control(&self) -> Result<(), fidl::Error> {
4882 self.client.send::<fidl::encoding::EmptyPayload>(
4883 (),
4884 0x8b5e68f3ee0b22e,
4885 fidl::encoding::DynamicFlags::empty(),
4886 )
4887 }
4888
4889 pub fn r#enable_performance_counter_access(
4893 &self,
4894 mut access_token: fidl::Event,
4895 ) -> Result<(), fidl::Error> {
4896 self.client.send::<PrimaryEnablePerformanceCounterAccessRequest>(
4897 (access_token,),
4898 0x51b369ac16588831,
4899 fidl::encoding::DynamicFlags::empty(),
4900 )
4901 }
4902
4903 pub fn r#is_performance_counter_access_allowed(
4905 &self,
4906 ___deadline: zx::MonotonicInstant,
4907 ) -> Result<bool, fidl::Error> {
4908 let _response = self.client.send_query::<
4909 fidl::encoding::EmptyPayload,
4910 PrimaryIsPerformanceCounterAccessAllowedResponse,
4911 >(
4912 (),
4913 0x1933b70c06cc5702,
4914 fidl::encoding::DynamicFlags::empty(),
4915 ___deadline,
4916 )?;
4917 Ok(_response.enabled)
4918 }
4919
4920 pub fn r#enable_performance_counters(&self, mut counters: &[u64]) -> Result<(), fidl::Error> {
4925 self.client.send::<PrimaryEnablePerformanceCountersRequest>(
4926 (counters,),
4927 0x52c4db74b601aaa7,
4928 fidl::encoding::DynamicFlags::empty(),
4929 )
4930 }
4931
4932 pub fn r#create_performance_counter_buffer_pool(
4936 &self,
4937 mut pool_id: u64,
4938 mut event_channel: fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
4939 ) -> Result<(), fidl::Error> {
4940 self.client.send::<PrimaryCreatePerformanceCounterBufferPoolRequest>(
4941 (pool_id, event_channel),
4942 0x48ccf6519bbbc638,
4943 fidl::encoding::DynamicFlags::empty(),
4944 )
4945 }
4946
4947 pub fn r#release_performance_counter_buffer_pool(
4950 &self,
4951 mut pool_id: u64,
4952 ) -> Result<(), fidl::Error> {
4953 self.client.send::<PrimaryReleasePerformanceCounterBufferPoolRequest>(
4954 (pool_id,),
4955 0x18374c4b3ef0b4da,
4956 fidl::encoding::DynamicFlags::empty(),
4957 )
4958 }
4959
4960 pub fn r#add_performance_counter_buffer_offsets_to_pool(
4969 &self,
4970 mut pool_id: u64,
4971 mut offsets: &[BufferRange],
4972 ) -> Result<(), fidl::Error> {
4973 self.client.send::<PrimaryAddPerformanceCounterBufferOffsetsToPoolRequest>(
4974 (pool_id, offsets),
4975 0x1f7889571111386b,
4976 fidl::encoding::DynamicFlags::empty(),
4977 )
4978 }
4979
4980 pub fn r#remove_performance_counter_buffer_from_pool(
4985 &self,
4986 mut pool_id: u64,
4987 mut buffer_id: u64,
4988 ) -> Result<(), fidl::Error> {
4989 self.client.send::<PrimaryRemovePerformanceCounterBufferFromPoolRequest>(
4990 (pool_id, buffer_id),
4991 0xbf1275f5a36258e,
4992 fidl::encoding::DynamicFlags::empty(),
4993 )
4994 }
4995
4996 pub fn r#dump_performance_counters(
5001 &self,
5002 mut pool_id: u64,
5003 mut trigger_id: u32,
5004 ) -> Result<(), fidl::Error> {
5005 self.client.send::<PrimaryDumpPerformanceCountersRequest>(
5006 (pool_id, trigger_id),
5007 0x250b29340be28807,
5008 fidl::encoding::DynamicFlags::empty(),
5009 )
5010 }
5011
5012 pub fn r#clear_performance_counters(&self, mut counters: &[u64]) -> Result<(), fidl::Error> {
5016 self.client.send::<PrimaryClearPerformanceCountersRequest>(
5017 (counters,),
5018 0x236831822eff741a,
5019 fidl::encoding::DynamicFlags::empty(),
5020 )
5021 }
5022}
5023
5024#[cfg(target_os = "fuchsia")]
5025impl From<PrimarySynchronousProxy> for zx::Handle {
5026 fn from(value: PrimarySynchronousProxy) -> Self {
5027 value.into_channel().into()
5028 }
5029}
5030
5031#[cfg(target_os = "fuchsia")]
5032impl From<fidl::Channel> for PrimarySynchronousProxy {
5033 fn from(value: fidl::Channel) -> Self {
5034 Self::new(value)
5035 }
5036}
5037
5038#[derive(Debug, Clone)]
5039pub struct PrimaryProxy {
5040 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5041}
5042
5043impl fidl::endpoints::Proxy for PrimaryProxy {
5044 type Protocol = PrimaryMarker;
5045
5046 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5047 Self::new(inner)
5048 }
5049
5050 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5051 self.client.into_channel().map_err(|client| Self { client })
5052 }
5053
5054 fn as_channel(&self) -> &::fidl::AsyncChannel {
5055 self.client.as_channel()
5056 }
5057}
5058
5059impl PrimaryProxy {
5060 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5062 let protocol_name = <PrimaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5063 Self { client: fidl::client::Client::new(channel, protocol_name) }
5064 }
5065
5066 pub fn take_event_stream(&self) -> PrimaryEventStream {
5072 PrimaryEventStream { event_receiver: self.client.take_event_receiver() }
5073 }
5074
5075 pub fn r#import_object2(
5076 &self,
5077 mut object: fidl::Handle,
5078 mut object_type: ObjectType,
5079 mut object_id: u64,
5080 ) -> Result<(), fidl::Error> {
5081 PrimaryProxyInterface::r#import_object2(self, object, object_type, object_id)
5082 }
5083
5084 pub fn r#import_object(
5086 &self,
5087 mut payload: PrimaryImportObjectRequest,
5088 ) -> Result<(), fidl::Error> {
5089 PrimaryProxyInterface::r#import_object(self, payload)
5090 }
5091
5092 pub fn r#release_object(
5094 &self,
5095 mut object_id: u64,
5096 mut object_type: ObjectType,
5097 ) -> Result<(), fidl::Error> {
5098 PrimaryProxyInterface::r#release_object(self, object_id, object_type)
5099 }
5100
5101 pub fn r#create_context(&self, mut context_id: u32) -> Result<(), fidl::Error> {
5104 PrimaryProxyInterface::r#create_context(self, context_id)
5105 }
5106
5107 pub fn r#destroy_context(&self, mut context_id: u32) -> Result<(), fidl::Error> {
5109 PrimaryProxyInterface::r#destroy_context(self, context_id)
5110 }
5111
5112 pub fn r#execute_command(
5118 &self,
5119 mut context_id: u32,
5120 mut resources: &[BufferRange],
5121 mut command_buffers: &[CommandBuffer],
5122 mut wait_semaphores: &[u64],
5123 mut signal_semaphores: &[u64],
5124 mut flags: CommandBufferFlags,
5125 ) -> Result<(), fidl::Error> {
5126 PrimaryProxyInterface::r#execute_command(
5127 self,
5128 context_id,
5129 resources,
5130 command_buffers,
5131 wait_semaphores,
5132 signal_semaphores,
5133 flags,
5134 )
5135 }
5136
5137 pub fn r#execute_immediate_commands(
5141 &self,
5142 mut context_id: u32,
5143 mut command_data: &[u8],
5144 mut semaphores: &[u64],
5145 ) -> Result<(), fidl::Error> {
5146 PrimaryProxyInterface::r#execute_immediate_commands(
5147 self,
5148 context_id,
5149 command_data,
5150 semaphores,
5151 )
5152 }
5153
5154 pub fn r#execute_inline_commands(
5158 &self,
5159 mut context_id: u32,
5160 mut commands: &[InlineCommand],
5161 ) -> Result<(), fidl::Error> {
5162 PrimaryProxyInterface::r#execute_inline_commands(self, context_id, commands)
5163 }
5164
5165 pub fn r#flush(
5168 &self,
5169 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5170 PrimaryProxyInterface::r#flush(self)
5171 }
5172
5173 pub fn r#map_buffer(&self, mut payload: &PrimaryMapBufferRequest) -> Result<(), fidl::Error> {
5176 PrimaryProxyInterface::r#map_buffer(self, payload)
5177 }
5178
5179 pub fn r#unmap_buffer(
5182 &self,
5183 mut payload: &PrimaryUnmapBufferRequest,
5184 ) -> Result<(), fidl::Error> {
5185 PrimaryProxyInterface::r#unmap_buffer(self, payload)
5186 }
5187
5188 pub fn r#buffer_range_op2(
5190 &self,
5191 mut op: BufferOp,
5192 mut range: &BufferRange,
5193 ) -> Result<(), fidl::Error> {
5194 PrimaryProxyInterface::r#buffer_range_op2(self, op, range)
5195 }
5196
5197 pub fn r#enable_flow_control(&self) -> Result<(), fidl::Error> {
5199 PrimaryProxyInterface::r#enable_flow_control(self)
5200 }
5201
5202 pub fn r#enable_performance_counter_access(
5206 &self,
5207 mut access_token: fidl::Event,
5208 ) -> Result<(), fidl::Error> {
5209 PrimaryProxyInterface::r#enable_performance_counter_access(self, access_token)
5210 }
5211
5212 pub fn r#is_performance_counter_access_allowed(
5214 &self,
5215 ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
5216 PrimaryProxyInterface::r#is_performance_counter_access_allowed(self)
5217 }
5218
5219 pub fn r#enable_performance_counters(&self, mut counters: &[u64]) -> Result<(), fidl::Error> {
5224 PrimaryProxyInterface::r#enable_performance_counters(self, counters)
5225 }
5226
5227 pub fn r#create_performance_counter_buffer_pool(
5231 &self,
5232 mut pool_id: u64,
5233 mut event_channel: fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
5234 ) -> Result<(), fidl::Error> {
5235 PrimaryProxyInterface::r#create_performance_counter_buffer_pool(
5236 self,
5237 pool_id,
5238 event_channel,
5239 )
5240 }
5241
5242 pub fn r#release_performance_counter_buffer_pool(
5245 &self,
5246 mut pool_id: u64,
5247 ) -> Result<(), fidl::Error> {
5248 PrimaryProxyInterface::r#release_performance_counter_buffer_pool(self, pool_id)
5249 }
5250
5251 pub fn r#add_performance_counter_buffer_offsets_to_pool(
5260 &self,
5261 mut pool_id: u64,
5262 mut offsets: &[BufferRange],
5263 ) -> Result<(), fidl::Error> {
5264 PrimaryProxyInterface::r#add_performance_counter_buffer_offsets_to_pool(
5265 self, pool_id, offsets,
5266 )
5267 }
5268
5269 pub fn r#remove_performance_counter_buffer_from_pool(
5274 &self,
5275 mut pool_id: u64,
5276 mut buffer_id: u64,
5277 ) -> Result<(), fidl::Error> {
5278 PrimaryProxyInterface::r#remove_performance_counter_buffer_from_pool(
5279 self, pool_id, buffer_id,
5280 )
5281 }
5282
5283 pub fn r#dump_performance_counters(
5288 &self,
5289 mut pool_id: u64,
5290 mut trigger_id: u32,
5291 ) -> Result<(), fidl::Error> {
5292 PrimaryProxyInterface::r#dump_performance_counters(self, pool_id, trigger_id)
5293 }
5294
5295 pub fn r#clear_performance_counters(&self, mut counters: &[u64]) -> Result<(), fidl::Error> {
5299 PrimaryProxyInterface::r#clear_performance_counters(self, counters)
5300 }
5301}
5302
5303impl PrimaryProxyInterface for PrimaryProxy {
5304 fn r#import_object2(
5305 &self,
5306 mut object: fidl::Handle,
5307 mut object_type: ObjectType,
5308 mut object_id: u64,
5309 ) -> Result<(), fidl::Error> {
5310 self.client.send::<PrimaryImportObject2Request>(
5311 (object, object_type, object_id),
5312 0x774ef4bc434f6b40,
5313 fidl::encoding::DynamicFlags::empty(),
5314 )
5315 }
5316
5317 fn r#import_object(&self, mut payload: PrimaryImportObjectRequest) -> Result<(), fidl::Error> {
5318 self.client.send::<PrimaryImportObjectRequest>(
5319 &mut payload,
5320 0x5f5a247abb1d9354,
5321 fidl::encoding::DynamicFlags::empty(),
5322 )
5323 }
5324
5325 fn r#release_object(
5326 &self,
5327 mut object_id: u64,
5328 mut object_type: ObjectType,
5329 ) -> Result<(), fidl::Error> {
5330 self.client.send::<PrimaryReleaseObjectRequest>(
5331 (object_id, object_type),
5332 0x4a65d5885da5e88f,
5333 fidl::encoding::DynamicFlags::empty(),
5334 )
5335 }
5336
5337 fn r#create_context(&self, mut context_id: u32) -> Result<(), fidl::Error> {
5338 self.client.send::<PrimaryCreateContextRequest>(
5339 (context_id,),
5340 0x5a9a91c8b88b5da4,
5341 fidl::encoding::DynamicFlags::empty(),
5342 )
5343 }
5344
5345 fn r#destroy_context(&self, mut context_id: u32) -> Result<(), fidl::Error> {
5346 self.client.send::<PrimaryDestroyContextRequest>(
5347 (context_id,),
5348 0x26b626e6be162ef0,
5349 fidl::encoding::DynamicFlags::empty(),
5350 )
5351 }
5352
5353 fn r#execute_command(
5354 &self,
5355 mut context_id: u32,
5356 mut resources: &[BufferRange],
5357 mut command_buffers: &[CommandBuffer],
5358 mut wait_semaphores: &[u64],
5359 mut signal_semaphores: &[u64],
5360 mut flags: CommandBufferFlags,
5361 ) -> Result<(), fidl::Error> {
5362 self.client.send::<PrimaryExecuteCommandRequest>(
5363 (context_id, resources, command_buffers, wait_semaphores, signal_semaphores, flags),
5364 0xf2799643aadb0db,
5365 fidl::encoding::DynamicFlags::empty(),
5366 )
5367 }
5368
5369 fn r#execute_immediate_commands(
5370 &self,
5371 mut context_id: u32,
5372 mut command_data: &[u8],
5373 mut semaphores: &[u64],
5374 ) -> Result<(), fidl::Error> {
5375 self.client.send::<PrimaryExecuteImmediateCommandsRequest>(
5376 (context_id, command_data, semaphores),
5377 0x3d7e0dcdbfd4b61f,
5378 fidl::encoding::DynamicFlags::empty(),
5379 )
5380 }
5381
5382 fn r#execute_inline_commands(
5383 &self,
5384 mut context_id: u32,
5385 mut commands: &[InlineCommand],
5386 ) -> Result<(), fidl::Error> {
5387 self.client.send::<PrimaryExecuteInlineCommandsRequest>(
5388 (context_id, commands),
5389 0x766d5c86f35468a6,
5390 fidl::encoding::DynamicFlags::empty(),
5391 )
5392 }
5393
5394 type FlushResponseFut =
5395 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5396 fn r#flush(&self) -> Self::FlushResponseFut {
5397 fn _decode(
5398 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5399 ) -> Result<(), fidl::Error> {
5400 let _response = fidl::client::decode_transaction_body::<
5401 fidl::encoding::EmptyPayload,
5402 fidl::encoding::DefaultFuchsiaResourceDialect,
5403 0x54ccb5572d886039,
5404 >(_buf?)?;
5405 Ok(_response)
5406 }
5407 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
5408 (),
5409 0x54ccb5572d886039,
5410 fidl::encoding::DynamicFlags::empty(),
5411 _decode,
5412 )
5413 }
5414
5415 fn r#map_buffer(&self, mut payload: &PrimaryMapBufferRequest) -> Result<(), fidl::Error> {
5416 self.client.send::<PrimaryMapBufferRequest>(
5417 payload,
5418 0x56baa5d2092c8e33,
5419 fidl::encoding::DynamicFlags::empty(),
5420 )
5421 }
5422
5423 fn r#unmap_buffer(&self, mut payload: &PrimaryUnmapBufferRequest) -> Result<(), fidl::Error> {
5424 self.client.send::<PrimaryUnmapBufferRequest>(
5425 payload,
5426 0x305188ebd8bcd95c,
5427 fidl::encoding::DynamicFlags::empty(),
5428 )
5429 }
5430
5431 fn r#buffer_range_op2(
5432 &self,
5433 mut op: BufferOp,
5434 mut range: &BufferRange,
5435 ) -> Result<(), fidl::Error> {
5436 self.client.send::<PrimaryBufferRangeOp2Request>(
5437 (op, range),
5438 0x4175c8dfef355396,
5439 fidl::encoding::DynamicFlags::empty(),
5440 )
5441 }
5442
5443 fn r#enable_flow_control(&self) -> Result<(), fidl::Error> {
5444 self.client.send::<fidl::encoding::EmptyPayload>(
5445 (),
5446 0x8b5e68f3ee0b22e,
5447 fidl::encoding::DynamicFlags::empty(),
5448 )
5449 }
5450
5451 fn r#enable_performance_counter_access(
5452 &self,
5453 mut access_token: fidl::Event,
5454 ) -> Result<(), fidl::Error> {
5455 self.client.send::<PrimaryEnablePerformanceCounterAccessRequest>(
5456 (access_token,),
5457 0x51b369ac16588831,
5458 fidl::encoding::DynamicFlags::empty(),
5459 )
5460 }
5461
5462 type IsPerformanceCounterAccessAllowedResponseFut =
5463 fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
5464 fn r#is_performance_counter_access_allowed(
5465 &self,
5466 ) -> Self::IsPerformanceCounterAccessAllowedResponseFut {
5467 fn _decode(
5468 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5469 ) -> Result<bool, fidl::Error> {
5470 let _response = fidl::client::decode_transaction_body::<
5471 PrimaryIsPerformanceCounterAccessAllowedResponse,
5472 fidl::encoding::DefaultFuchsiaResourceDialect,
5473 0x1933b70c06cc5702,
5474 >(_buf?)?;
5475 Ok(_response.enabled)
5476 }
5477 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
5478 (),
5479 0x1933b70c06cc5702,
5480 fidl::encoding::DynamicFlags::empty(),
5481 _decode,
5482 )
5483 }
5484
5485 fn r#enable_performance_counters(&self, mut counters: &[u64]) -> Result<(), fidl::Error> {
5486 self.client.send::<PrimaryEnablePerformanceCountersRequest>(
5487 (counters,),
5488 0x52c4db74b601aaa7,
5489 fidl::encoding::DynamicFlags::empty(),
5490 )
5491 }
5492
5493 fn r#create_performance_counter_buffer_pool(
5494 &self,
5495 mut pool_id: u64,
5496 mut event_channel: fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
5497 ) -> Result<(), fidl::Error> {
5498 self.client.send::<PrimaryCreatePerformanceCounterBufferPoolRequest>(
5499 (pool_id, event_channel),
5500 0x48ccf6519bbbc638,
5501 fidl::encoding::DynamicFlags::empty(),
5502 )
5503 }
5504
5505 fn r#release_performance_counter_buffer_pool(
5506 &self,
5507 mut pool_id: u64,
5508 ) -> Result<(), fidl::Error> {
5509 self.client.send::<PrimaryReleasePerformanceCounterBufferPoolRequest>(
5510 (pool_id,),
5511 0x18374c4b3ef0b4da,
5512 fidl::encoding::DynamicFlags::empty(),
5513 )
5514 }
5515
5516 fn r#add_performance_counter_buffer_offsets_to_pool(
5517 &self,
5518 mut pool_id: u64,
5519 mut offsets: &[BufferRange],
5520 ) -> Result<(), fidl::Error> {
5521 self.client.send::<PrimaryAddPerformanceCounterBufferOffsetsToPoolRequest>(
5522 (pool_id, offsets),
5523 0x1f7889571111386b,
5524 fidl::encoding::DynamicFlags::empty(),
5525 )
5526 }
5527
5528 fn r#remove_performance_counter_buffer_from_pool(
5529 &self,
5530 mut pool_id: u64,
5531 mut buffer_id: u64,
5532 ) -> Result<(), fidl::Error> {
5533 self.client.send::<PrimaryRemovePerformanceCounterBufferFromPoolRequest>(
5534 (pool_id, buffer_id),
5535 0xbf1275f5a36258e,
5536 fidl::encoding::DynamicFlags::empty(),
5537 )
5538 }
5539
5540 fn r#dump_performance_counters(
5541 &self,
5542 mut pool_id: u64,
5543 mut trigger_id: u32,
5544 ) -> Result<(), fidl::Error> {
5545 self.client.send::<PrimaryDumpPerformanceCountersRequest>(
5546 (pool_id, trigger_id),
5547 0x250b29340be28807,
5548 fidl::encoding::DynamicFlags::empty(),
5549 )
5550 }
5551
5552 fn r#clear_performance_counters(&self, mut counters: &[u64]) -> Result<(), fidl::Error> {
5553 self.client.send::<PrimaryClearPerformanceCountersRequest>(
5554 (counters,),
5555 0x236831822eff741a,
5556 fidl::encoding::DynamicFlags::empty(),
5557 )
5558 }
5559}
5560
5561pub struct PrimaryEventStream {
5562 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5563}
5564
5565impl std::marker::Unpin for PrimaryEventStream {}
5566
5567impl futures::stream::FusedStream for PrimaryEventStream {
5568 fn is_terminated(&self) -> bool {
5569 self.event_receiver.is_terminated()
5570 }
5571}
5572
5573impl futures::Stream for PrimaryEventStream {
5574 type Item = Result<PrimaryEvent, fidl::Error>;
5575
5576 fn poll_next(
5577 mut self: std::pin::Pin<&mut Self>,
5578 cx: &mut std::task::Context<'_>,
5579 ) -> std::task::Poll<Option<Self::Item>> {
5580 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5581 &mut self.event_receiver,
5582 cx
5583 )?) {
5584 Some(buf) => std::task::Poll::Ready(Some(PrimaryEvent::decode(buf))),
5585 None => std::task::Poll::Ready(None),
5586 }
5587 }
5588}
5589
5590#[derive(Debug)]
5591pub enum PrimaryEvent {
5592 OnNotifyMessagesConsumed { count: u64 },
5593 OnNotifyMemoryImported { bytes: u64 },
5594}
5595
5596impl PrimaryEvent {
5597 #[allow(irrefutable_let_patterns)]
5598 pub fn into_on_notify_messages_consumed(self) -> Option<u64> {
5599 if let PrimaryEvent::OnNotifyMessagesConsumed { count } = self {
5600 Some((count))
5601 } else {
5602 None
5603 }
5604 }
5605 #[allow(irrefutable_let_patterns)]
5606 pub fn into_on_notify_memory_imported(self) -> Option<u64> {
5607 if let PrimaryEvent::OnNotifyMemoryImported { bytes } = self {
5608 Some((bytes))
5609 } else {
5610 None
5611 }
5612 }
5613
5614 fn decode(
5616 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5617 ) -> Result<PrimaryEvent, fidl::Error> {
5618 let (bytes, _handles) = buf.split_mut();
5619 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5620 debug_assert_eq!(tx_header.tx_id, 0);
5621 match tx_header.ordinal {
5622 0x5e8dd0b0b753ac43 => {
5623 let mut out = fidl::new_empty!(
5624 PrimaryOnNotifyMessagesConsumedRequest,
5625 fidl::encoding::DefaultFuchsiaResourceDialect
5626 );
5627 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryOnNotifyMessagesConsumedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
5628 Ok((PrimaryEvent::OnNotifyMessagesConsumed { count: out.count }))
5629 }
5630 0x50524b7a3503aba6 => {
5631 let mut out = fidl::new_empty!(
5632 PrimaryOnNotifyMemoryImportedRequest,
5633 fidl::encoding::DefaultFuchsiaResourceDialect
5634 );
5635 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryOnNotifyMemoryImportedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
5636 Ok((PrimaryEvent::OnNotifyMemoryImported { bytes: out.bytes }))
5637 }
5638 _ => Err(fidl::Error::UnknownOrdinal {
5639 ordinal: tx_header.ordinal,
5640 protocol_name: <PrimaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5641 }),
5642 }
5643 }
5644}
5645
5646pub struct PrimaryRequestStream {
5648 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5649 is_terminated: bool,
5650}
5651
5652impl std::marker::Unpin for PrimaryRequestStream {}
5653
5654impl futures::stream::FusedStream for PrimaryRequestStream {
5655 fn is_terminated(&self) -> bool {
5656 self.is_terminated
5657 }
5658}
5659
5660impl fidl::endpoints::RequestStream for PrimaryRequestStream {
5661 type Protocol = PrimaryMarker;
5662 type ControlHandle = PrimaryControlHandle;
5663
5664 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5665 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5666 }
5667
5668 fn control_handle(&self) -> Self::ControlHandle {
5669 PrimaryControlHandle { inner: self.inner.clone() }
5670 }
5671
5672 fn into_inner(
5673 self,
5674 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5675 {
5676 (self.inner, self.is_terminated)
5677 }
5678
5679 fn from_inner(
5680 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5681 is_terminated: bool,
5682 ) -> Self {
5683 Self { inner, is_terminated }
5684 }
5685}
5686
5687impl futures::Stream for PrimaryRequestStream {
5688 type Item = Result<PrimaryRequest, fidl::Error>;
5689
5690 fn poll_next(
5691 mut self: std::pin::Pin<&mut Self>,
5692 cx: &mut std::task::Context<'_>,
5693 ) -> std::task::Poll<Option<Self::Item>> {
5694 let this = &mut *self;
5695 if this.inner.check_shutdown(cx) {
5696 this.is_terminated = true;
5697 return std::task::Poll::Ready(None);
5698 }
5699 if this.is_terminated {
5700 panic!("polled PrimaryRequestStream after completion");
5701 }
5702 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5703 |bytes, handles| {
5704 match this.inner.channel().read_etc(cx, bytes, handles) {
5705 std::task::Poll::Ready(Ok(())) => {}
5706 std::task::Poll::Pending => return std::task::Poll::Pending,
5707 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5708 this.is_terminated = true;
5709 return std::task::Poll::Ready(None);
5710 }
5711 std::task::Poll::Ready(Err(e)) => {
5712 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5713 e.into(),
5714 ))))
5715 }
5716 }
5717
5718 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5720
5721 std::task::Poll::Ready(Some(match header.ordinal {
5722 0x774ef4bc434f6b40 => {
5723 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5724 let mut req = fidl::new_empty!(
5725 PrimaryImportObject2Request,
5726 fidl::encoding::DefaultFuchsiaResourceDialect
5727 );
5728 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryImportObject2Request>(&header, _body_bytes, handles, &mut req)?;
5729 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5730 Ok(PrimaryRequest::ImportObject2 {
5731 object: req.object,
5732 object_type: req.object_type,
5733 object_id: req.object_id,
5734
5735 control_handle,
5736 })
5737 }
5738 0x5f5a247abb1d9354 => {
5739 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5740 let mut req = fidl::new_empty!(
5741 PrimaryImportObjectRequest,
5742 fidl::encoding::DefaultFuchsiaResourceDialect
5743 );
5744 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryImportObjectRequest>(&header, _body_bytes, handles, &mut req)?;
5745 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5746 Ok(PrimaryRequest::ImportObject { payload: req, control_handle })
5747 }
5748 0x4a65d5885da5e88f => {
5749 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5750 let mut req = fidl::new_empty!(
5751 PrimaryReleaseObjectRequest,
5752 fidl::encoding::DefaultFuchsiaResourceDialect
5753 );
5754 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryReleaseObjectRequest>(&header, _body_bytes, handles, &mut req)?;
5755 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5756 Ok(PrimaryRequest::ReleaseObject {
5757 object_id: req.object_id,
5758 object_type: req.object_type,
5759
5760 control_handle,
5761 })
5762 }
5763 0x5a9a91c8b88b5da4 => {
5764 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5765 let mut req = fidl::new_empty!(
5766 PrimaryCreateContextRequest,
5767 fidl::encoding::DefaultFuchsiaResourceDialect
5768 );
5769 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryCreateContextRequest>(&header, _body_bytes, handles, &mut req)?;
5770 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5771 Ok(PrimaryRequest::CreateContext {
5772 context_id: req.context_id,
5773
5774 control_handle,
5775 })
5776 }
5777 0x26b626e6be162ef0 => {
5778 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5779 let mut req = fidl::new_empty!(
5780 PrimaryDestroyContextRequest,
5781 fidl::encoding::DefaultFuchsiaResourceDialect
5782 );
5783 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryDestroyContextRequest>(&header, _body_bytes, handles, &mut req)?;
5784 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5785 Ok(PrimaryRequest::DestroyContext {
5786 context_id: req.context_id,
5787
5788 control_handle,
5789 })
5790 }
5791 0xf2799643aadb0db => {
5792 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5793 let mut req = fidl::new_empty!(
5794 PrimaryExecuteCommandRequest,
5795 fidl::encoding::DefaultFuchsiaResourceDialect
5796 );
5797 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryExecuteCommandRequest>(&header, _body_bytes, handles, &mut req)?;
5798 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5799 Ok(PrimaryRequest::ExecuteCommand {
5800 context_id: req.context_id,
5801 resources: req.resources,
5802 command_buffers: req.command_buffers,
5803 wait_semaphores: req.wait_semaphores,
5804 signal_semaphores: req.signal_semaphores,
5805 flags: req.flags,
5806
5807 control_handle,
5808 })
5809 }
5810 0x3d7e0dcdbfd4b61f => {
5811 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5812 let mut req = fidl::new_empty!(
5813 PrimaryExecuteImmediateCommandsRequest,
5814 fidl::encoding::DefaultFuchsiaResourceDialect
5815 );
5816 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryExecuteImmediateCommandsRequest>(&header, _body_bytes, handles, &mut req)?;
5817 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5818 Ok(PrimaryRequest::ExecuteImmediateCommands {
5819 context_id: req.context_id,
5820 command_data: req.command_data,
5821 semaphores: req.semaphores,
5822
5823 control_handle,
5824 })
5825 }
5826 0x766d5c86f35468a6 => {
5827 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5828 let mut req = fidl::new_empty!(
5829 PrimaryExecuteInlineCommandsRequest,
5830 fidl::encoding::DefaultFuchsiaResourceDialect
5831 );
5832 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryExecuteInlineCommandsRequest>(&header, _body_bytes, handles, &mut req)?;
5833 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5834 Ok(PrimaryRequest::ExecuteInlineCommands {
5835 context_id: req.context_id,
5836 commands: req.commands,
5837
5838 control_handle,
5839 })
5840 }
5841 0x54ccb5572d886039 => {
5842 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5843 let mut req = fidl::new_empty!(
5844 fidl::encoding::EmptyPayload,
5845 fidl::encoding::DefaultFuchsiaResourceDialect
5846 );
5847 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5848 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5849 Ok(PrimaryRequest::Flush {
5850 responder: PrimaryFlushResponder {
5851 control_handle: std::mem::ManuallyDrop::new(control_handle),
5852 tx_id: header.tx_id,
5853 },
5854 })
5855 }
5856 0x56baa5d2092c8e33 => {
5857 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5858 let mut req = fidl::new_empty!(
5859 PrimaryMapBufferRequest,
5860 fidl::encoding::DefaultFuchsiaResourceDialect
5861 );
5862 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryMapBufferRequest>(&header, _body_bytes, handles, &mut req)?;
5863 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5864 Ok(PrimaryRequest::MapBuffer { payload: req, control_handle })
5865 }
5866 0x305188ebd8bcd95c => {
5867 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5868 let mut req = fidl::new_empty!(
5869 PrimaryUnmapBufferRequest,
5870 fidl::encoding::DefaultFuchsiaResourceDialect
5871 );
5872 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryUnmapBufferRequest>(&header, _body_bytes, handles, &mut req)?;
5873 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5874 Ok(PrimaryRequest::UnmapBuffer { payload: req, control_handle })
5875 }
5876 0x4175c8dfef355396 => {
5877 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5878 let mut req = fidl::new_empty!(
5879 PrimaryBufferRangeOp2Request,
5880 fidl::encoding::DefaultFuchsiaResourceDialect
5881 );
5882 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryBufferRangeOp2Request>(&header, _body_bytes, handles, &mut req)?;
5883 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5884 Ok(PrimaryRequest::BufferRangeOp2 {
5885 op: req.op,
5886 range: req.range,
5887
5888 control_handle,
5889 })
5890 }
5891 0x8b5e68f3ee0b22e => {
5892 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5893 let mut req = fidl::new_empty!(
5894 fidl::encoding::EmptyPayload,
5895 fidl::encoding::DefaultFuchsiaResourceDialect
5896 );
5897 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5898 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5899 Ok(PrimaryRequest::EnableFlowControl { control_handle })
5900 }
5901 0x51b369ac16588831 => {
5902 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5903 let mut req = fidl::new_empty!(
5904 PrimaryEnablePerformanceCounterAccessRequest,
5905 fidl::encoding::DefaultFuchsiaResourceDialect
5906 );
5907 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryEnablePerformanceCounterAccessRequest>(&header, _body_bytes, handles, &mut req)?;
5908 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5909 Ok(PrimaryRequest::EnablePerformanceCounterAccess {
5910 access_token: req.access_token,
5911
5912 control_handle,
5913 })
5914 }
5915 0x1933b70c06cc5702 => {
5916 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5917 let mut req = fidl::new_empty!(
5918 fidl::encoding::EmptyPayload,
5919 fidl::encoding::DefaultFuchsiaResourceDialect
5920 );
5921 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5922 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5923 Ok(PrimaryRequest::IsPerformanceCounterAccessAllowed {
5924 responder: PrimaryIsPerformanceCounterAccessAllowedResponder {
5925 control_handle: std::mem::ManuallyDrop::new(control_handle),
5926 tx_id: header.tx_id,
5927 },
5928 })
5929 }
5930 0x52c4db74b601aaa7 => {
5931 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5932 let mut req = fidl::new_empty!(
5933 PrimaryEnablePerformanceCountersRequest,
5934 fidl::encoding::DefaultFuchsiaResourceDialect
5935 );
5936 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryEnablePerformanceCountersRequest>(&header, _body_bytes, handles, &mut req)?;
5937 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5938 Ok(PrimaryRequest::EnablePerformanceCounters {
5939 counters: req.counters,
5940
5941 control_handle,
5942 })
5943 }
5944 0x48ccf6519bbbc638 => {
5945 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5946 let mut req = fidl::new_empty!(
5947 PrimaryCreatePerformanceCounterBufferPoolRequest,
5948 fidl::encoding::DefaultFuchsiaResourceDialect
5949 );
5950 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryCreatePerformanceCounterBufferPoolRequest>(&header, _body_bytes, handles, &mut req)?;
5951 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5952 Ok(PrimaryRequest::CreatePerformanceCounterBufferPool {
5953 pool_id: req.pool_id,
5954 event_channel: req.event_channel,
5955
5956 control_handle,
5957 })
5958 }
5959 0x18374c4b3ef0b4da => {
5960 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5961 let mut req = fidl::new_empty!(
5962 PrimaryReleasePerformanceCounterBufferPoolRequest,
5963 fidl::encoding::DefaultFuchsiaResourceDialect
5964 );
5965 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryReleasePerformanceCounterBufferPoolRequest>(&header, _body_bytes, handles, &mut req)?;
5966 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5967 Ok(PrimaryRequest::ReleasePerformanceCounterBufferPool {
5968 pool_id: req.pool_id,
5969
5970 control_handle,
5971 })
5972 }
5973 0x1f7889571111386b => {
5974 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5975 let mut req = fidl::new_empty!(
5976 PrimaryAddPerformanceCounterBufferOffsetsToPoolRequest,
5977 fidl::encoding::DefaultFuchsiaResourceDialect
5978 );
5979 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryAddPerformanceCounterBufferOffsetsToPoolRequest>(&header, _body_bytes, handles, &mut req)?;
5980 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5981 Ok(PrimaryRequest::AddPerformanceCounterBufferOffsetsToPool {
5982 pool_id: req.pool_id,
5983 offsets: req.offsets,
5984
5985 control_handle,
5986 })
5987 }
5988 0xbf1275f5a36258e => {
5989 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5990 let mut req = fidl::new_empty!(
5991 PrimaryRemovePerformanceCounterBufferFromPoolRequest,
5992 fidl::encoding::DefaultFuchsiaResourceDialect
5993 );
5994 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryRemovePerformanceCounterBufferFromPoolRequest>(&header, _body_bytes, handles, &mut req)?;
5995 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
5996 Ok(PrimaryRequest::RemovePerformanceCounterBufferFromPool {
5997 pool_id: req.pool_id,
5998 buffer_id: req.buffer_id,
5999
6000 control_handle,
6001 })
6002 }
6003 0x250b29340be28807 => {
6004 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6005 let mut req = fidl::new_empty!(
6006 PrimaryDumpPerformanceCountersRequest,
6007 fidl::encoding::DefaultFuchsiaResourceDialect
6008 );
6009 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryDumpPerformanceCountersRequest>(&header, _body_bytes, handles, &mut req)?;
6010 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
6011 Ok(PrimaryRequest::DumpPerformanceCounters {
6012 pool_id: req.pool_id,
6013 trigger_id: req.trigger_id,
6014
6015 control_handle,
6016 })
6017 }
6018 0x236831822eff741a => {
6019 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6020 let mut req = fidl::new_empty!(
6021 PrimaryClearPerformanceCountersRequest,
6022 fidl::encoding::DefaultFuchsiaResourceDialect
6023 );
6024 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PrimaryClearPerformanceCountersRequest>(&header, _body_bytes, handles, &mut req)?;
6025 let control_handle = PrimaryControlHandle { inner: this.inner.clone() };
6026 Ok(PrimaryRequest::ClearPerformanceCounters {
6027 counters: req.counters,
6028
6029 control_handle,
6030 })
6031 }
6032 _ => Err(fidl::Error::UnknownOrdinal {
6033 ordinal: header.ordinal,
6034 protocol_name:
6035 <PrimaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6036 }),
6037 }))
6038 },
6039 )
6040 }
6041}
6042
6043#[derive(Debug)]
6046pub enum PrimaryRequest {
6047 ImportObject2 {
6048 object: fidl::Handle,
6049 object_type: ObjectType,
6050 object_id: u64,
6051 control_handle: PrimaryControlHandle,
6052 },
6053 ImportObject { payload: PrimaryImportObjectRequest, control_handle: PrimaryControlHandle },
6055 ReleaseObject { object_id: u64, object_type: ObjectType, control_handle: PrimaryControlHandle },
6057 CreateContext { context_id: u32, control_handle: PrimaryControlHandle },
6060 DestroyContext { context_id: u32, control_handle: PrimaryControlHandle },
6062 ExecuteCommand {
6068 context_id: u32,
6069 resources: Vec<BufferRange>,
6070 command_buffers: Vec<CommandBuffer>,
6071 wait_semaphores: Vec<u64>,
6072 signal_semaphores: Vec<u64>,
6073 flags: CommandBufferFlags,
6074 control_handle: PrimaryControlHandle,
6075 },
6076 ExecuteImmediateCommands {
6080 context_id: u32,
6081 command_data: Vec<u8>,
6082 semaphores: Vec<u64>,
6083 control_handle: PrimaryControlHandle,
6084 },
6085 ExecuteInlineCommands {
6089 context_id: u32,
6090 commands: Vec<InlineCommand>,
6091 control_handle: PrimaryControlHandle,
6092 },
6093 Flush { responder: PrimaryFlushResponder },
6096 MapBuffer { payload: PrimaryMapBufferRequest, control_handle: PrimaryControlHandle },
6099 UnmapBuffer { payload: PrimaryUnmapBufferRequest, control_handle: PrimaryControlHandle },
6102 BufferRangeOp2 { op: BufferOp, range: BufferRange, control_handle: PrimaryControlHandle },
6104 EnableFlowControl { control_handle: PrimaryControlHandle },
6106 EnablePerformanceCounterAccess {
6110 access_token: fidl::Event,
6111 control_handle: PrimaryControlHandle,
6112 },
6113 IsPerformanceCounterAccessAllowed {
6115 responder: PrimaryIsPerformanceCounterAccessAllowedResponder,
6116 },
6117 EnablePerformanceCounters { counters: Vec<u64>, control_handle: PrimaryControlHandle },
6122 CreatePerformanceCounterBufferPool {
6126 pool_id: u64,
6127 event_channel: fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
6128 control_handle: PrimaryControlHandle,
6129 },
6130 ReleasePerformanceCounterBufferPool { pool_id: u64, control_handle: PrimaryControlHandle },
6133 AddPerformanceCounterBufferOffsetsToPool {
6142 pool_id: u64,
6143 offsets: Vec<BufferRange>,
6144 control_handle: PrimaryControlHandle,
6145 },
6146 RemovePerformanceCounterBufferFromPool {
6151 pool_id: u64,
6152 buffer_id: u64,
6153 control_handle: PrimaryControlHandle,
6154 },
6155 DumpPerformanceCounters { pool_id: u64, trigger_id: u32, control_handle: PrimaryControlHandle },
6160 ClearPerformanceCounters { counters: Vec<u64>, control_handle: PrimaryControlHandle },
6164}
6165
6166impl PrimaryRequest {
6167 #[allow(irrefutable_let_patterns)]
6168 pub fn into_import_object2(
6169 self,
6170 ) -> Option<(fidl::Handle, ObjectType, u64, PrimaryControlHandle)> {
6171 if let PrimaryRequest::ImportObject2 { object, object_type, object_id, control_handle } =
6172 self
6173 {
6174 Some((object, object_type, object_id, control_handle))
6175 } else {
6176 None
6177 }
6178 }
6179
6180 #[allow(irrefutable_let_patterns)]
6181 pub fn into_import_object(self) -> Option<(PrimaryImportObjectRequest, PrimaryControlHandle)> {
6182 if let PrimaryRequest::ImportObject { payload, control_handle } = self {
6183 Some((payload, control_handle))
6184 } else {
6185 None
6186 }
6187 }
6188
6189 #[allow(irrefutable_let_patterns)]
6190 pub fn into_release_object(self) -> Option<(u64, ObjectType, PrimaryControlHandle)> {
6191 if let PrimaryRequest::ReleaseObject { object_id, object_type, control_handle } = self {
6192 Some((object_id, object_type, control_handle))
6193 } else {
6194 None
6195 }
6196 }
6197
6198 #[allow(irrefutable_let_patterns)]
6199 pub fn into_create_context(self) -> Option<(u32, PrimaryControlHandle)> {
6200 if let PrimaryRequest::CreateContext { context_id, control_handle } = self {
6201 Some((context_id, control_handle))
6202 } else {
6203 None
6204 }
6205 }
6206
6207 #[allow(irrefutable_let_patterns)]
6208 pub fn into_destroy_context(self) -> Option<(u32, PrimaryControlHandle)> {
6209 if let PrimaryRequest::DestroyContext { context_id, control_handle } = self {
6210 Some((context_id, control_handle))
6211 } else {
6212 None
6213 }
6214 }
6215
6216 #[allow(irrefutable_let_patterns)]
6217 pub fn into_execute_command(
6218 self,
6219 ) -> Option<(
6220 u32,
6221 Vec<BufferRange>,
6222 Vec<CommandBuffer>,
6223 Vec<u64>,
6224 Vec<u64>,
6225 CommandBufferFlags,
6226 PrimaryControlHandle,
6227 )> {
6228 if let PrimaryRequest::ExecuteCommand {
6229 context_id,
6230 resources,
6231 command_buffers,
6232 wait_semaphores,
6233 signal_semaphores,
6234 flags,
6235 control_handle,
6236 } = self
6237 {
6238 Some((
6239 context_id,
6240 resources,
6241 command_buffers,
6242 wait_semaphores,
6243 signal_semaphores,
6244 flags,
6245 control_handle,
6246 ))
6247 } else {
6248 None
6249 }
6250 }
6251
6252 #[allow(irrefutable_let_patterns)]
6253 pub fn into_execute_immediate_commands(
6254 self,
6255 ) -> Option<(u32, Vec<u8>, Vec<u64>, PrimaryControlHandle)> {
6256 if let PrimaryRequest::ExecuteImmediateCommands {
6257 context_id,
6258 command_data,
6259 semaphores,
6260 control_handle,
6261 } = self
6262 {
6263 Some((context_id, command_data, semaphores, control_handle))
6264 } else {
6265 None
6266 }
6267 }
6268
6269 #[allow(irrefutable_let_patterns)]
6270 pub fn into_execute_inline_commands(
6271 self,
6272 ) -> Option<(u32, Vec<InlineCommand>, PrimaryControlHandle)> {
6273 if let PrimaryRequest::ExecuteInlineCommands { context_id, commands, control_handle } = self
6274 {
6275 Some((context_id, commands, control_handle))
6276 } else {
6277 None
6278 }
6279 }
6280
6281 #[allow(irrefutable_let_patterns)]
6282 pub fn into_flush(self) -> Option<(PrimaryFlushResponder)> {
6283 if let PrimaryRequest::Flush { responder } = self {
6284 Some((responder))
6285 } else {
6286 None
6287 }
6288 }
6289
6290 #[allow(irrefutable_let_patterns)]
6291 pub fn into_map_buffer(self) -> Option<(PrimaryMapBufferRequest, PrimaryControlHandle)> {
6292 if let PrimaryRequest::MapBuffer { payload, control_handle } = self {
6293 Some((payload, control_handle))
6294 } else {
6295 None
6296 }
6297 }
6298
6299 #[allow(irrefutable_let_patterns)]
6300 pub fn into_unmap_buffer(self) -> Option<(PrimaryUnmapBufferRequest, PrimaryControlHandle)> {
6301 if let PrimaryRequest::UnmapBuffer { payload, control_handle } = self {
6302 Some((payload, control_handle))
6303 } else {
6304 None
6305 }
6306 }
6307
6308 #[allow(irrefutable_let_patterns)]
6309 pub fn into_buffer_range_op2(self) -> Option<(BufferOp, BufferRange, PrimaryControlHandle)> {
6310 if let PrimaryRequest::BufferRangeOp2 { op, range, control_handle } = self {
6311 Some((op, range, control_handle))
6312 } else {
6313 None
6314 }
6315 }
6316
6317 #[allow(irrefutable_let_patterns)]
6318 pub fn into_enable_flow_control(self) -> Option<(PrimaryControlHandle)> {
6319 if let PrimaryRequest::EnableFlowControl { control_handle } = self {
6320 Some((control_handle))
6321 } else {
6322 None
6323 }
6324 }
6325
6326 #[allow(irrefutable_let_patterns)]
6327 pub fn into_enable_performance_counter_access(
6328 self,
6329 ) -> Option<(fidl::Event, PrimaryControlHandle)> {
6330 if let PrimaryRequest::EnablePerformanceCounterAccess { access_token, control_handle } =
6331 self
6332 {
6333 Some((access_token, control_handle))
6334 } else {
6335 None
6336 }
6337 }
6338
6339 #[allow(irrefutable_let_patterns)]
6340 pub fn into_is_performance_counter_access_allowed(
6341 self,
6342 ) -> Option<(PrimaryIsPerformanceCounterAccessAllowedResponder)> {
6343 if let PrimaryRequest::IsPerformanceCounterAccessAllowed { responder } = self {
6344 Some((responder))
6345 } else {
6346 None
6347 }
6348 }
6349
6350 #[allow(irrefutable_let_patterns)]
6351 pub fn into_enable_performance_counters(self) -> Option<(Vec<u64>, PrimaryControlHandle)> {
6352 if let PrimaryRequest::EnablePerformanceCounters { counters, control_handle } = self {
6353 Some((counters, control_handle))
6354 } else {
6355 None
6356 }
6357 }
6358
6359 #[allow(irrefutable_let_patterns)]
6360 pub fn into_create_performance_counter_buffer_pool(
6361 self,
6362 ) -> Option<(
6363 u64,
6364 fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
6365 PrimaryControlHandle,
6366 )> {
6367 if let PrimaryRequest::CreatePerformanceCounterBufferPool {
6368 pool_id,
6369 event_channel,
6370 control_handle,
6371 } = self
6372 {
6373 Some((pool_id, event_channel, control_handle))
6374 } else {
6375 None
6376 }
6377 }
6378
6379 #[allow(irrefutable_let_patterns)]
6380 pub fn into_release_performance_counter_buffer_pool(
6381 self,
6382 ) -> Option<(u64, PrimaryControlHandle)> {
6383 if let PrimaryRequest::ReleasePerformanceCounterBufferPool { pool_id, control_handle } =
6384 self
6385 {
6386 Some((pool_id, control_handle))
6387 } else {
6388 None
6389 }
6390 }
6391
6392 #[allow(irrefutable_let_patterns)]
6393 pub fn into_add_performance_counter_buffer_offsets_to_pool(
6394 self,
6395 ) -> Option<(u64, Vec<BufferRange>, PrimaryControlHandle)> {
6396 if let PrimaryRequest::AddPerformanceCounterBufferOffsetsToPool {
6397 pool_id,
6398 offsets,
6399 control_handle,
6400 } = self
6401 {
6402 Some((pool_id, offsets, control_handle))
6403 } else {
6404 None
6405 }
6406 }
6407
6408 #[allow(irrefutable_let_patterns)]
6409 pub fn into_remove_performance_counter_buffer_from_pool(
6410 self,
6411 ) -> Option<(u64, u64, PrimaryControlHandle)> {
6412 if let PrimaryRequest::RemovePerformanceCounterBufferFromPool {
6413 pool_id,
6414 buffer_id,
6415 control_handle,
6416 } = self
6417 {
6418 Some((pool_id, buffer_id, control_handle))
6419 } else {
6420 None
6421 }
6422 }
6423
6424 #[allow(irrefutable_let_patterns)]
6425 pub fn into_dump_performance_counters(self) -> Option<(u64, u32, PrimaryControlHandle)> {
6426 if let PrimaryRequest::DumpPerformanceCounters { pool_id, trigger_id, control_handle } =
6427 self
6428 {
6429 Some((pool_id, trigger_id, control_handle))
6430 } else {
6431 None
6432 }
6433 }
6434
6435 #[allow(irrefutable_let_patterns)]
6436 pub fn into_clear_performance_counters(self) -> Option<(Vec<u64>, PrimaryControlHandle)> {
6437 if let PrimaryRequest::ClearPerformanceCounters { counters, control_handle } = self {
6438 Some((counters, control_handle))
6439 } else {
6440 None
6441 }
6442 }
6443
6444 pub fn method_name(&self) -> &'static str {
6446 match *self {
6447 PrimaryRequest::ImportObject2 { .. } => "import_object2",
6448 PrimaryRequest::ImportObject { .. } => "import_object",
6449 PrimaryRequest::ReleaseObject { .. } => "release_object",
6450 PrimaryRequest::CreateContext { .. } => "create_context",
6451 PrimaryRequest::DestroyContext { .. } => "destroy_context",
6452 PrimaryRequest::ExecuteCommand { .. } => "execute_command",
6453 PrimaryRequest::ExecuteImmediateCommands { .. } => "execute_immediate_commands",
6454 PrimaryRequest::ExecuteInlineCommands { .. } => "execute_inline_commands",
6455 PrimaryRequest::Flush { .. } => "flush",
6456 PrimaryRequest::MapBuffer { .. } => "map_buffer",
6457 PrimaryRequest::UnmapBuffer { .. } => "unmap_buffer",
6458 PrimaryRequest::BufferRangeOp2 { .. } => "buffer_range_op2",
6459 PrimaryRequest::EnableFlowControl { .. } => "enable_flow_control",
6460 PrimaryRequest::EnablePerformanceCounterAccess { .. } => {
6461 "enable_performance_counter_access"
6462 }
6463 PrimaryRequest::IsPerformanceCounterAccessAllowed { .. } => {
6464 "is_performance_counter_access_allowed"
6465 }
6466 PrimaryRequest::EnablePerformanceCounters { .. } => "enable_performance_counters",
6467 PrimaryRequest::CreatePerformanceCounterBufferPool { .. } => {
6468 "create_performance_counter_buffer_pool"
6469 }
6470 PrimaryRequest::ReleasePerformanceCounterBufferPool { .. } => {
6471 "release_performance_counter_buffer_pool"
6472 }
6473 PrimaryRequest::AddPerformanceCounterBufferOffsetsToPool { .. } => {
6474 "add_performance_counter_buffer_offsets_to_pool"
6475 }
6476 PrimaryRequest::RemovePerformanceCounterBufferFromPool { .. } => {
6477 "remove_performance_counter_buffer_from_pool"
6478 }
6479 PrimaryRequest::DumpPerformanceCounters { .. } => "dump_performance_counters",
6480 PrimaryRequest::ClearPerformanceCounters { .. } => "clear_performance_counters",
6481 }
6482 }
6483}
6484
6485#[derive(Debug, Clone)]
6486pub struct PrimaryControlHandle {
6487 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6488}
6489
6490impl fidl::endpoints::ControlHandle for PrimaryControlHandle {
6491 fn shutdown(&self) {
6492 self.inner.shutdown()
6493 }
6494 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6495 self.inner.shutdown_with_epitaph(status)
6496 }
6497
6498 fn is_closed(&self) -> bool {
6499 self.inner.channel().is_closed()
6500 }
6501 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6502 self.inner.channel().on_closed()
6503 }
6504
6505 #[cfg(target_os = "fuchsia")]
6506 fn signal_peer(
6507 &self,
6508 clear_mask: zx::Signals,
6509 set_mask: zx::Signals,
6510 ) -> Result<(), zx_status::Status> {
6511 use fidl::Peered;
6512 self.inner.channel().signal_peer(clear_mask, set_mask)
6513 }
6514}
6515
6516impl PrimaryControlHandle {
6517 pub fn send_on_notify_messages_consumed(&self, mut count: u64) -> Result<(), fidl::Error> {
6518 self.inner.send::<PrimaryOnNotifyMessagesConsumedRequest>(
6519 (count,),
6520 0,
6521 0x5e8dd0b0b753ac43,
6522 fidl::encoding::DynamicFlags::empty(),
6523 )
6524 }
6525
6526 pub fn send_on_notify_memory_imported(&self, mut bytes: u64) -> Result<(), fidl::Error> {
6527 self.inner.send::<PrimaryOnNotifyMemoryImportedRequest>(
6528 (bytes,),
6529 0,
6530 0x50524b7a3503aba6,
6531 fidl::encoding::DynamicFlags::empty(),
6532 )
6533 }
6534}
6535
6536#[must_use = "FIDL methods require a response to be sent"]
6537#[derive(Debug)]
6538pub struct PrimaryFlushResponder {
6539 control_handle: std::mem::ManuallyDrop<PrimaryControlHandle>,
6540 tx_id: u32,
6541}
6542
6543impl std::ops::Drop for PrimaryFlushResponder {
6547 fn drop(&mut self) {
6548 self.control_handle.shutdown();
6549 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6551 }
6552}
6553
6554impl fidl::endpoints::Responder for PrimaryFlushResponder {
6555 type ControlHandle = PrimaryControlHandle;
6556
6557 fn control_handle(&self) -> &PrimaryControlHandle {
6558 &self.control_handle
6559 }
6560
6561 fn drop_without_shutdown(mut self) {
6562 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6564 std::mem::forget(self);
6566 }
6567}
6568
6569impl PrimaryFlushResponder {
6570 pub fn send(self) -> Result<(), fidl::Error> {
6574 let _result = self.send_raw();
6575 if _result.is_err() {
6576 self.control_handle.shutdown();
6577 }
6578 self.drop_without_shutdown();
6579 _result
6580 }
6581
6582 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
6584 let _result = self.send_raw();
6585 self.drop_without_shutdown();
6586 _result
6587 }
6588
6589 fn send_raw(&self) -> Result<(), fidl::Error> {
6590 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
6591 (),
6592 self.tx_id,
6593 0x54ccb5572d886039,
6594 fidl::encoding::DynamicFlags::empty(),
6595 )
6596 }
6597}
6598
6599#[must_use = "FIDL methods require a response to be sent"]
6600#[derive(Debug)]
6601pub struct PrimaryIsPerformanceCounterAccessAllowedResponder {
6602 control_handle: std::mem::ManuallyDrop<PrimaryControlHandle>,
6603 tx_id: u32,
6604}
6605
6606impl std::ops::Drop for PrimaryIsPerformanceCounterAccessAllowedResponder {
6610 fn drop(&mut self) {
6611 self.control_handle.shutdown();
6612 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6614 }
6615}
6616
6617impl fidl::endpoints::Responder for PrimaryIsPerformanceCounterAccessAllowedResponder {
6618 type ControlHandle = PrimaryControlHandle;
6619
6620 fn control_handle(&self) -> &PrimaryControlHandle {
6621 &self.control_handle
6622 }
6623
6624 fn drop_without_shutdown(mut self) {
6625 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6627 std::mem::forget(self);
6629 }
6630}
6631
6632impl PrimaryIsPerformanceCounterAccessAllowedResponder {
6633 pub fn send(self, mut enabled: bool) -> Result<(), fidl::Error> {
6637 let _result = self.send_raw(enabled);
6638 if _result.is_err() {
6639 self.control_handle.shutdown();
6640 }
6641 self.drop_without_shutdown();
6642 _result
6643 }
6644
6645 pub fn send_no_shutdown_on_err(self, mut enabled: bool) -> Result<(), fidl::Error> {
6647 let _result = self.send_raw(enabled);
6648 self.drop_without_shutdown();
6649 _result
6650 }
6651
6652 fn send_raw(&self, mut enabled: bool) -> Result<(), fidl::Error> {
6653 self.control_handle.inner.send::<PrimaryIsPerformanceCounterAccessAllowedResponse>(
6654 (enabled,),
6655 self.tx_id,
6656 0x1933b70c06cc5702,
6657 fidl::encoding::DynamicFlags::empty(),
6658 )
6659 }
6660}
6661
6662#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6663pub struct TestDeviceMarker;
6664
6665impl fidl::endpoints::ProtocolMarker for TestDeviceMarker {
6666 type Proxy = TestDeviceProxy;
6667 type RequestStream = TestDeviceRequestStream;
6668 #[cfg(target_os = "fuchsia")]
6669 type SynchronousProxy = TestDeviceSynchronousProxy;
6670
6671 const DEBUG_NAME: &'static str = "(anonymous) TestDevice";
6672}
6673
6674pub trait TestDeviceProxyInterface: Send + Sync {
6675 type QueryResponseFut: std::future::Future<Output = Result<DeviceQueryResult, fidl::Error>>
6676 + Send;
6677 fn r#query(&self, query_id: QueryId) -> Self::QueryResponseFut;
6678 fn r#connect2(
6679 &self,
6680 client_id: u64,
6681 primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
6682 notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
6683 ) -> Result<(), fidl::Error>;
6684 fn r#dump_state(&self, dump_type: u32) -> Result<(), fidl::Error>;
6685 type GetIcdListResponseFut: std::future::Future<Output = Result<Vec<IcdInfo>, fidl::Error>>
6686 + Send;
6687 fn r#get_icd_list(&self) -> Self::GetIcdListResponseFut;
6688 type GetUnitTestStatusResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
6689 fn r#get_unit_test_status(&self) -> Self::GetUnitTestStatusResponseFut;
6690}
6691#[derive(Debug)]
6692#[cfg(target_os = "fuchsia")]
6693pub struct TestDeviceSynchronousProxy {
6694 client: fidl::client::sync::Client,
6695}
6696
6697#[cfg(target_os = "fuchsia")]
6698impl fidl::endpoints::SynchronousProxy for TestDeviceSynchronousProxy {
6699 type Proxy = TestDeviceProxy;
6700 type Protocol = TestDeviceMarker;
6701
6702 fn from_channel(inner: fidl::Channel) -> Self {
6703 Self::new(inner)
6704 }
6705
6706 fn into_channel(self) -> fidl::Channel {
6707 self.client.into_channel()
6708 }
6709
6710 fn as_channel(&self) -> &fidl::Channel {
6711 self.client.as_channel()
6712 }
6713}
6714
6715#[cfg(target_os = "fuchsia")]
6716impl TestDeviceSynchronousProxy {
6717 pub fn new(channel: fidl::Channel) -> Self {
6718 let protocol_name = <TestDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6719 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6720 }
6721
6722 pub fn into_channel(self) -> fidl::Channel {
6723 self.client.into_channel()
6724 }
6725
6726 pub fn wait_for_event(
6729 &self,
6730 deadline: zx::MonotonicInstant,
6731 ) -> Result<TestDeviceEvent, fidl::Error> {
6732 TestDeviceEvent::decode(self.client.wait_for_event(deadline)?)
6733 }
6734
6735 pub fn r#query(
6737 &self,
6738 mut query_id: QueryId,
6739 ___deadline: zx::MonotonicInstant,
6740 ) -> Result<DeviceQueryResult, fidl::Error> {
6741 let _response = self
6742 .client
6743 .send_query::<DeviceQueryRequest, fidl::encoding::ResultType<DeviceQueryResponse, i32>>(
6744 (query_id,),
6745 0x627d4c6093b078e7,
6746 fidl::encoding::DynamicFlags::empty(),
6747 ___deadline,
6748 )?;
6749 Ok(_response.map(|x| x))
6750 }
6751
6752 pub fn r#connect2(
6757 &self,
6758 mut client_id: u64,
6759 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
6760 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
6761 ) -> Result<(), fidl::Error> {
6762 self.client.send::<DeviceConnect2Request>(
6763 (client_id, primary_channel, notification_channel),
6764 0x3a5b134714c67914,
6765 fidl::encoding::DynamicFlags::empty(),
6766 )
6767 }
6768
6769 pub fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
6771 self.client.send::<DiagnosticDeviceDumpStateRequest>(
6772 (dump_type,),
6773 0x5420df493d4fa915,
6774 fidl::encoding::DynamicFlags::empty(),
6775 )
6776 }
6777
6778 pub fn r#get_icd_list(
6781 &self,
6782 ___deadline: zx::MonotonicInstant,
6783 ) -> Result<Vec<IcdInfo>, fidl::Error> {
6784 let _response = self
6785 .client
6786 .send_query::<fidl::encoding::EmptyPayload, IcdLoaderDeviceGetIcdListResponse>(
6787 (),
6788 0x7673e76395008257,
6789 fidl::encoding::DynamicFlags::empty(),
6790 ___deadline,
6791 )?;
6792 Ok(_response.icd_list)
6793 }
6794
6795 pub fn r#get_unit_test_status(
6796 &self,
6797 ___deadline: zx::MonotonicInstant,
6798 ) -> Result<i32, fidl::Error> {
6799 let _response = self
6800 .client
6801 .send_query::<fidl::encoding::EmptyPayload, TestDeviceGetUnitTestStatusResponse>(
6802 (),
6803 0x3ebcd9c409c248f1,
6804 fidl::encoding::DynamicFlags::empty(),
6805 ___deadline,
6806 )?;
6807 Ok(_response.status)
6808 }
6809}
6810
6811#[cfg(target_os = "fuchsia")]
6812impl From<TestDeviceSynchronousProxy> for zx::Handle {
6813 fn from(value: TestDeviceSynchronousProxy) -> Self {
6814 value.into_channel().into()
6815 }
6816}
6817
6818#[cfg(target_os = "fuchsia")]
6819impl From<fidl::Channel> for TestDeviceSynchronousProxy {
6820 fn from(value: fidl::Channel) -> Self {
6821 Self::new(value)
6822 }
6823}
6824
6825#[derive(Debug, Clone)]
6826pub struct TestDeviceProxy {
6827 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6828}
6829
6830impl fidl::endpoints::Proxy for TestDeviceProxy {
6831 type Protocol = TestDeviceMarker;
6832
6833 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6834 Self::new(inner)
6835 }
6836
6837 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6838 self.client.into_channel().map_err(|client| Self { client })
6839 }
6840
6841 fn as_channel(&self) -> &::fidl::AsyncChannel {
6842 self.client.as_channel()
6843 }
6844}
6845
6846impl TestDeviceProxy {
6847 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6849 let protocol_name = <TestDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6850 Self { client: fidl::client::Client::new(channel, protocol_name) }
6851 }
6852
6853 pub fn take_event_stream(&self) -> TestDeviceEventStream {
6859 TestDeviceEventStream { event_receiver: self.client.take_event_receiver() }
6860 }
6861
6862 pub fn r#query(
6864 &self,
6865 mut query_id: QueryId,
6866 ) -> fidl::client::QueryResponseFut<
6867 DeviceQueryResult,
6868 fidl::encoding::DefaultFuchsiaResourceDialect,
6869 > {
6870 TestDeviceProxyInterface::r#query(self, query_id)
6871 }
6872
6873 pub fn r#connect2(
6878 &self,
6879 mut client_id: u64,
6880 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
6881 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
6882 ) -> Result<(), fidl::Error> {
6883 TestDeviceProxyInterface::r#connect2(self, client_id, primary_channel, notification_channel)
6884 }
6885
6886 pub fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
6888 TestDeviceProxyInterface::r#dump_state(self, dump_type)
6889 }
6890
6891 pub fn r#get_icd_list(
6894 &self,
6895 ) -> fidl::client::QueryResponseFut<Vec<IcdInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>
6896 {
6897 TestDeviceProxyInterface::r#get_icd_list(self)
6898 }
6899
6900 pub fn r#get_unit_test_status(
6901 &self,
6902 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
6903 TestDeviceProxyInterface::r#get_unit_test_status(self)
6904 }
6905}
6906
6907impl TestDeviceProxyInterface for TestDeviceProxy {
6908 type QueryResponseFut = fidl::client::QueryResponseFut<
6909 DeviceQueryResult,
6910 fidl::encoding::DefaultFuchsiaResourceDialect,
6911 >;
6912 fn r#query(&self, mut query_id: QueryId) -> Self::QueryResponseFut {
6913 fn _decode(
6914 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6915 ) -> Result<DeviceQueryResult, fidl::Error> {
6916 let _response = fidl::client::decode_transaction_body::<
6917 fidl::encoding::ResultType<DeviceQueryResponse, i32>,
6918 fidl::encoding::DefaultFuchsiaResourceDialect,
6919 0x627d4c6093b078e7,
6920 >(_buf?)?;
6921 Ok(_response.map(|x| x))
6922 }
6923 self.client.send_query_and_decode::<DeviceQueryRequest, DeviceQueryResult>(
6924 (query_id,),
6925 0x627d4c6093b078e7,
6926 fidl::encoding::DynamicFlags::empty(),
6927 _decode,
6928 )
6929 }
6930
6931 fn r#connect2(
6932 &self,
6933 mut client_id: u64,
6934 mut primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
6935 mut notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
6936 ) -> Result<(), fidl::Error> {
6937 self.client.send::<DeviceConnect2Request>(
6938 (client_id, primary_channel, notification_channel),
6939 0x3a5b134714c67914,
6940 fidl::encoding::DynamicFlags::empty(),
6941 )
6942 }
6943
6944 fn r#dump_state(&self, mut dump_type: u32) -> Result<(), fidl::Error> {
6945 self.client.send::<DiagnosticDeviceDumpStateRequest>(
6946 (dump_type,),
6947 0x5420df493d4fa915,
6948 fidl::encoding::DynamicFlags::empty(),
6949 )
6950 }
6951
6952 type GetIcdListResponseFut =
6953 fidl::client::QueryResponseFut<Vec<IcdInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>;
6954 fn r#get_icd_list(&self) -> Self::GetIcdListResponseFut {
6955 fn _decode(
6956 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6957 ) -> Result<Vec<IcdInfo>, fidl::Error> {
6958 let _response = fidl::client::decode_transaction_body::<
6959 IcdLoaderDeviceGetIcdListResponse,
6960 fidl::encoding::DefaultFuchsiaResourceDialect,
6961 0x7673e76395008257,
6962 >(_buf?)?;
6963 Ok(_response.icd_list)
6964 }
6965 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<IcdInfo>>(
6966 (),
6967 0x7673e76395008257,
6968 fidl::encoding::DynamicFlags::empty(),
6969 _decode,
6970 )
6971 }
6972
6973 type GetUnitTestStatusResponseFut =
6974 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
6975 fn r#get_unit_test_status(&self) -> Self::GetUnitTestStatusResponseFut {
6976 fn _decode(
6977 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6978 ) -> Result<i32, fidl::Error> {
6979 let _response = fidl::client::decode_transaction_body::<
6980 TestDeviceGetUnitTestStatusResponse,
6981 fidl::encoding::DefaultFuchsiaResourceDialect,
6982 0x3ebcd9c409c248f1,
6983 >(_buf?)?;
6984 Ok(_response.status)
6985 }
6986 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
6987 (),
6988 0x3ebcd9c409c248f1,
6989 fidl::encoding::DynamicFlags::empty(),
6990 _decode,
6991 )
6992 }
6993}
6994
6995pub struct TestDeviceEventStream {
6996 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6997}
6998
6999impl std::marker::Unpin for TestDeviceEventStream {}
7000
7001impl futures::stream::FusedStream for TestDeviceEventStream {
7002 fn is_terminated(&self) -> bool {
7003 self.event_receiver.is_terminated()
7004 }
7005}
7006
7007impl futures::Stream for TestDeviceEventStream {
7008 type Item = Result<TestDeviceEvent, fidl::Error>;
7009
7010 fn poll_next(
7011 mut self: std::pin::Pin<&mut Self>,
7012 cx: &mut std::task::Context<'_>,
7013 ) -> std::task::Poll<Option<Self::Item>> {
7014 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7015 &mut self.event_receiver,
7016 cx
7017 )?) {
7018 Some(buf) => std::task::Poll::Ready(Some(TestDeviceEvent::decode(buf))),
7019 None => std::task::Poll::Ready(None),
7020 }
7021 }
7022}
7023
7024#[derive(Debug)]
7025pub enum TestDeviceEvent {}
7026
7027impl TestDeviceEvent {
7028 fn decode(
7030 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7031 ) -> Result<TestDeviceEvent, fidl::Error> {
7032 let (bytes, _handles) = buf.split_mut();
7033 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7034 debug_assert_eq!(tx_header.tx_id, 0);
7035 match tx_header.ordinal {
7036 _ => Err(fidl::Error::UnknownOrdinal {
7037 ordinal: tx_header.ordinal,
7038 protocol_name: <TestDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7039 }),
7040 }
7041 }
7042}
7043
7044pub struct TestDeviceRequestStream {
7046 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7047 is_terminated: bool,
7048}
7049
7050impl std::marker::Unpin for TestDeviceRequestStream {}
7051
7052impl futures::stream::FusedStream for TestDeviceRequestStream {
7053 fn is_terminated(&self) -> bool {
7054 self.is_terminated
7055 }
7056}
7057
7058impl fidl::endpoints::RequestStream for TestDeviceRequestStream {
7059 type Protocol = TestDeviceMarker;
7060 type ControlHandle = TestDeviceControlHandle;
7061
7062 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7063 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7064 }
7065
7066 fn control_handle(&self) -> Self::ControlHandle {
7067 TestDeviceControlHandle { inner: self.inner.clone() }
7068 }
7069
7070 fn into_inner(
7071 self,
7072 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7073 {
7074 (self.inner, self.is_terminated)
7075 }
7076
7077 fn from_inner(
7078 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7079 is_terminated: bool,
7080 ) -> Self {
7081 Self { inner, is_terminated }
7082 }
7083}
7084
7085impl futures::Stream for TestDeviceRequestStream {
7086 type Item = Result<TestDeviceRequest, fidl::Error>;
7087
7088 fn poll_next(
7089 mut self: std::pin::Pin<&mut Self>,
7090 cx: &mut std::task::Context<'_>,
7091 ) -> std::task::Poll<Option<Self::Item>> {
7092 let this = &mut *self;
7093 if this.inner.check_shutdown(cx) {
7094 this.is_terminated = true;
7095 return std::task::Poll::Ready(None);
7096 }
7097 if this.is_terminated {
7098 panic!("polled TestDeviceRequestStream after completion");
7099 }
7100 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7101 |bytes, handles| {
7102 match this.inner.channel().read_etc(cx, bytes, handles) {
7103 std::task::Poll::Ready(Ok(())) => {}
7104 std::task::Poll::Pending => return std::task::Poll::Pending,
7105 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7106 this.is_terminated = true;
7107 return std::task::Poll::Ready(None);
7108 }
7109 std::task::Poll::Ready(Err(e)) => {
7110 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7111 e.into(),
7112 ))))
7113 }
7114 }
7115
7116 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7118
7119 std::task::Poll::Ready(Some(match header.ordinal {
7120 0x627d4c6093b078e7 => {
7121 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7122 let mut req = fidl::new_empty!(
7123 DeviceQueryRequest,
7124 fidl::encoding::DefaultFuchsiaResourceDialect
7125 );
7126 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceQueryRequest>(&header, _body_bytes, handles, &mut req)?;
7127 let control_handle = TestDeviceControlHandle { inner: this.inner.clone() };
7128 Ok(TestDeviceRequest::Query {
7129 query_id: req.query_id,
7130
7131 responder: TestDeviceQueryResponder {
7132 control_handle: std::mem::ManuallyDrop::new(control_handle),
7133 tx_id: header.tx_id,
7134 },
7135 })
7136 }
7137 0x3a5b134714c67914 => {
7138 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7139 let mut req = fidl::new_empty!(
7140 DeviceConnect2Request,
7141 fidl::encoding::DefaultFuchsiaResourceDialect
7142 );
7143 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceConnect2Request>(&header, _body_bytes, handles, &mut req)?;
7144 let control_handle = TestDeviceControlHandle { inner: this.inner.clone() };
7145 Ok(TestDeviceRequest::Connect2 {
7146 client_id: req.client_id,
7147 primary_channel: req.primary_channel,
7148 notification_channel: req.notification_channel,
7149
7150 control_handle,
7151 })
7152 }
7153 0x5420df493d4fa915 => {
7154 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7155 let mut req = fidl::new_empty!(
7156 DiagnosticDeviceDumpStateRequest,
7157 fidl::encoding::DefaultFuchsiaResourceDialect
7158 );
7159 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DiagnosticDeviceDumpStateRequest>(&header, _body_bytes, handles, &mut req)?;
7160 let control_handle = TestDeviceControlHandle { inner: this.inner.clone() };
7161 Ok(TestDeviceRequest::DumpState {
7162 dump_type: req.dump_type,
7163
7164 control_handle,
7165 })
7166 }
7167 0x7673e76395008257 => {
7168 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7169 let mut req = fidl::new_empty!(
7170 fidl::encoding::EmptyPayload,
7171 fidl::encoding::DefaultFuchsiaResourceDialect
7172 );
7173 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7174 let control_handle = TestDeviceControlHandle { inner: this.inner.clone() };
7175 Ok(TestDeviceRequest::GetIcdList {
7176 responder: TestDeviceGetIcdListResponder {
7177 control_handle: std::mem::ManuallyDrop::new(control_handle),
7178 tx_id: header.tx_id,
7179 },
7180 })
7181 }
7182 0x3ebcd9c409c248f1 => {
7183 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7184 let mut req = fidl::new_empty!(
7185 fidl::encoding::EmptyPayload,
7186 fidl::encoding::DefaultFuchsiaResourceDialect
7187 );
7188 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7189 let control_handle = TestDeviceControlHandle { inner: this.inner.clone() };
7190 Ok(TestDeviceRequest::GetUnitTestStatus {
7191 responder: TestDeviceGetUnitTestStatusResponder {
7192 control_handle: std::mem::ManuallyDrop::new(control_handle),
7193 tx_id: header.tx_id,
7194 },
7195 })
7196 }
7197 _ => Err(fidl::Error::UnknownOrdinal {
7198 ordinal: header.ordinal,
7199 protocol_name:
7200 <TestDeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7201 }),
7202 }))
7203 },
7204 )
7205 }
7206}
7207
7208#[derive(Debug)]
7210pub enum TestDeviceRequest {
7211 Query {
7213 query_id: QueryId,
7214 responder: TestDeviceQueryResponder,
7215 },
7216 Connect2 {
7221 client_id: u64,
7222 primary_channel: fidl::endpoints::ServerEnd<PrimaryMarker>,
7223 notification_channel: fidl::endpoints::ServerEnd<NotificationMarker>,
7224 control_handle: TestDeviceControlHandle,
7225 },
7226 DumpState {
7228 dump_type: u32,
7229 control_handle: TestDeviceControlHandle,
7230 },
7231 GetIcdList {
7234 responder: TestDeviceGetIcdListResponder,
7235 },
7236 GetUnitTestStatus {
7237 responder: TestDeviceGetUnitTestStatusResponder,
7238 },
7239}
7240
7241impl TestDeviceRequest {
7242 #[allow(irrefutable_let_patterns)]
7243 pub fn into_query(self) -> Option<(QueryId, TestDeviceQueryResponder)> {
7244 if let TestDeviceRequest::Query { query_id, responder } = self {
7245 Some((query_id, responder))
7246 } else {
7247 None
7248 }
7249 }
7250
7251 #[allow(irrefutable_let_patterns)]
7252 pub fn into_connect2(
7253 self,
7254 ) -> Option<(
7255 u64,
7256 fidl::endpoints::ServerEnd<PrimaryMarker>,
7257 fidl::endpoints::ServerEnd<NotificationMarker>,
7258 TestDeviceControlHandle,
7259 )> {
7260 if let TestDeviceRequest::Connect2 {
7261 client_id,
7262 primary_channel,
7263 notification_channel,
7264 control_handle,
7265 } = self
7266 {
7267 Some((client_id, primary_channel, notification_channel, control_handle))
7268 } else {
7269 None
7270 }
7271 }
7272
7273 #[allow(irrefutable_let_patterns)]
7274 pub fn into_dump_state(self) -> Option<(u32, TestDeviceControlHandle)> {
7275 if let TestDeviceRequest::DumpState { dump_type, control_handle } = self {
7276 Some((dump_type, control_handle))
7277 } else {
7278 None
7279 }
7280 }
7281
7282 #[allow(irrefutable_let_patterns)]
7283 pub fn into_get_icd_list(self) -> Option<(TestDeviceGetIcdListResponder)> {
7284 if let TestDeviceRequest::GetIcdList { responder } = self {
7285 Some((responder))
7286 } else {
7287 None
7288 }
7289 }
7290
7291 #[allow(irrefutable_let_patterns)]
7292 pub fn into_get_unit_test_status(self) -> Option<(TestDeviceGetUnitTestStatusResponder)> {
7293 if let TestDeviceRequest::GetUnitTestStatus { responder } = self {
7294 Some((responder))
7295 } else {
7296 None
7297 }
7298 }
7299
7300 pub fn method_name(&self) -> &'static str {
7302 match *self {
7303 TestDeviceRequest::Query { .. } => "query",
7304 TestDeviceRequest::Connect2 { .. } => "connect2",
7305 TestDeviceRequest::DumpState { .. } => "dump_state",
7306 TestDeviceRequest::GetIcdList { .. } => "get_icd_list",
7307 TestDeviceRequest::GetUnitTestStatus { .. } => "get_unit_test_status",
7308 }
7309 }
7310}
7311
7312#[derive(Debug, Clone)]
7313pub struct TestDeviceControlHandle {
7314 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7315}
7316
7317impl fidl::endpoints::ControlHandle for TestDeviceControlHandle {
7318 fn shutdown(&self) {
7319 self.inner.shutdown()
7320 }
7321 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7322 self.inner.shutdown_with_epitaph(status)
7323 }
7324
7325 fn is_closed(&self) -> bool {
7326 self.inner.channel().is_closed()
7327 }
7328 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7329 self.inner.channel().on_closed()
7330 }
7331
7332 #[cfg(target_os = "fuchsia")]
7333 fn signal_peer(
7334 &self,
7335 clear_mask: zx::Signals,
7336 set_mask: zx::Signals,
7337 ) -> Result<(), zx_status::Status> {
7338 use fidl::Peered;
7339 self.inner.channel().signal_peer(clear_mask, set_mask)
7340 }
7341}
7342
7343impl TestDeviceControlHandle {}
7344
7345#[must_use = "FIDL methods require a response to be sent"]
7346#[derive(Debug)]
7347pub struct TestDeviceQueryResponder {
7348 control_handle: std::mem::ManuallyDrop<TestDeviceControlHandle>,
7349 tx_id: u32,
7350}
7351
7352impl std::ops::Drop for TestDeviceQueryResponder {
7356 fn drop(&mut self) {
7357 self.control_handle.shutdown();
7358 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7360 }
7361}
7362
7363impl fidl::endpoints::Responder for TestDeviceQueryResponder {
7364 type ControlHandle = TestDeviceControlHandle;
7365
7366 fn control_handle(&self) -> &TestDeviceControlHandle {
7367 &self.control_handle
7368 }
7369
7370 fn drop_without_shutdown(mut self) {
7371 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7373 std::mem::forget(self);
7375 }
7376}
7377
7378impl TestDeviceQueryResponder {
7379 pub fn send(self, mut result: Result<DeviceQueryResponse, i32>) -> Result<(), fidl::Error> {
7383 let _result = self.send_raw(result);
7384 if _result.is_err() {
7385 self.control_handle.shutdown();
7386 }
7387 self.drop_without_shutdown();
7388 _result
7389 }
7390
7391 pub fn send_no_shutdown_on_err(
7393 self,
7394 mut result: Result<DeviceQueryResponse, i32>,
7395 ) -> Result<(), fidl::Error> {
7396 let _result = self.send_raw(result);
7397 self.drop_without_shutdown();
7398 _result
7399 }
7400
7401 fn send_raw(&self, mut result: Result<DeviceQueryResponse, i32>) -> Result<(), fidl::Error> {
7402 self.control_handle.inner.send::<fidl::encoding::ResultType<DeviceQueryResponse, i32>>(
7403 result.as_mut().map_err(|e| *e),
7404 self.tx_id,
7405 0x627d4c6093b078e7,
7406 fidl::encoding::DynamicFlags::empty(),
7407 )
7408 }
7409}
7410
7411#[must_use = "FIDL methods require a response to be sent"]
7412#[derive(Debug)]
7413pub struct TestDeviceGetIcdListResponder {
7414 control_handle: std::mem::ManuallyDrop<TestDeviceControlHandle>,
7415 tx_id: u32,
7416}
7417
7418impl std::ops::Drop for TestDeviceGetIcdListResponder {
7422 fn drop(&mut self) {
7423 self.control_handle.shutdown();
7424 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7426 }
7427}
7428
7429impl fidl::endpoints::Responder for TestDeviceGetIcdListResponder {
7430 type ControlHandle = TestDeviceControlHandle;
7431
7432 fn control_handle(&self) -> &TestDeviceControlHandle {
7433 &self.control_handle
7434 }
7435
7436 fn drop_without_shutdown(mut self) {
7437 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7439 std::mem::forget(self);
7441 }
7442}
7443
7444impl TestDeviceGetIcdListResponder {
7445 pub fn send(self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
7449 let _result = self.send_raw(icd_list);
7450 if _result.is_err() {
7451 self.control_handle.shutdown();
7452 }
7453 self.drop_without_shutdown();
7454 _result
7455 }
7456
7457 pub fn send_no_shutdown_on_err(self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
7459 let _result = self.send_raw(icd_list);
7460 self.drop_without_shutdown();
7461 _result
7462 }
7463
7464 fn send_raw(&self, mut icd_list: &[IcdInfo]) -> Result<(), fidl::Error> {
7465 self.control_handle.inner.send::<IcdLoaderDeviceGetIcdListResponse>(
7466 (icd_list,),
7467 self.tx_id,
7468 0x7673e76395008257,
7469 fidl::encoding::DynamicFlags::empty(),
7470 )
7471 }
7472}
7473
7474#[must_use = "FIDL methods require a response to be sent"]
7475#[derive(Debug)]
7476pub struct TestDeviceGetUnitTestStatusResponder {
7477 control_handle: std::mem::ManuallyDrop<TestDeviceControlHandle>,
7478 tx_id: u32,
7479}
7480
7481impl std::ops::Drop for TestDeviceGetUnitTestStatusResponder {
7485 fn drop(&mut self) {
7486 self.control_handle.shutdown();
7487 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7489 }
7490}
7491
7492impl fidl::endpoints::Responder for TestDeviceGetUnitTestStatusResponder {
7493 type ControlHandle = TestDeviceControlHandle;
7494
7495 fn control_handle(&self) -> &TestDeviceControlHandle {
7496 &self.control_handle
7497 }
7498
7499 fn drop_without_shutdown(mut self) {
7500 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7502 std::mem::forget(self);
7504 }
7505}
7506
7507impl TestDeviceGetUnitTestStatusResponder {
7508 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
7512 let _result = self.send_raw(status);
7513 if _result.is_err() {
7514 self.control_handle.shutdown();
7515 }
7516 self.drop_without_shutdown();
7517 _result
7518 }
7519
7520 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
7522 let _result = self.send_raw(status);
7523 self.drop_without_shutdown();
7524 _result
7525 }
7526
7527 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
7528 self.control_handle.inner.send::<TestDeviceGetUnitTestStatusResponse>(
7529 (status,),
7530 self.tx_id,
7531 0x3ebcd9c409c248f1,
7532 fidl::encoding::DynamicFlags::empty(),
7533 )
7534 }
7535}
7536
7537#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7538pub struct DependencyInjectionServiceMarker;
7539
7540#[cfg(target_os = "fuchsia")]
7541impl fidl::endpoints::ServiceMarker for DependencyInjectionServiceMarker {
7542 type Proxy = DependencyInjectionServiceProxy;
7543 type Request = DependencyInjectionServiceRequest;
7544 const SERVICE_NAME: &'static str = "fuchsia.gpu.magma.DependencyInjectionService";
7545}
7546
7547#[cfg(target_os = "fuchsia")]
7550pub enum DependencyInjectionServiceRequest {
7551 Device(DependencyInjectionRequestStream),
7552}
7553
7554#[cfg(target_os = "fuchsia")]
7555impl fidl::endpoints::ServiceRequest for DependencyInjectionServiceRequest {
7556 type Service = DependencyInjectionServiceMarker;
7557
7558 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
7559 match name {
7560 "device" => Self::Device(
7561 <DependencyInjectionRequestStream as fidl::endpoints::RequestStream>::from_channel(
7562 _channel,
7563 ),
7564 ),
7565 _ => panic!("no such member protocol name for service DependencyInjectionService"),
7566 }
7567 }
7568
7569 fn member_names() -> &'static [&'static str] {
7570 &["device"]
7571 }
7572}
7573#[cfg(target_os = "fuchsia")]
7574pub struct DependencyInjectionServiceProxy(
7575 #[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>,
7576);
7577
7578#[cfg(target_os = "fuchsia")]
7579impl fidl::endpoints::ServiceProxy for DependencyInjectionServiceProxy {
7580 type Service = DependencyInjectionServiceMarker;
7581
7582 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
7583 Self(opener)
7584 }
7585}
7586
7587#[cfg(target_os = "fuchsia")]
7588impl DependencyInjectionServiceProxy {
7589 pub fn connect_to_device(&self) -> Result<DependencyInjectionProxy, fidl::Error> {
7590 let (proxy, server_end) = fidl::endpoints::create_proxy::<DependencyInjectionMarker>();
7591 self.connect_channel_to_device(server_end)?;
7592 Ok(proxy)
7593 }
7594
7595 pub fn connect_to_device_sync(
7598 &self,
7599 ) -> Result<DependencyInjectionSynchronousProxy, fidl::Error> {
7600 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DependencyInjectionMarker>();
7601 self.connect_channel_to_device(server_end)?;
7602 Ok(proxy)
7603 }
7604
7605 pub fn connect_channel_to_device(
7608 &self,
7609 server_end: fidl::endpoints::ServerEnd<DependencyInjectionMarker>,
7610 ) -> Result<(), fidl::Error> {
7611 self.0.open_member("device", server_end.into_channel())
7612 }
7613
7614 pub fn instance_name(&self) -> &str {
7615 self.0.instance_name()
7616 }
7617}
7618
7619#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7620pub struct PerformanceCounterServiceMarker;
7621
7622#[cfg(target_os = "fuchsia")]
7623impl fidl::endpoints::ServiceMarker for PerformanceCounterServiceMarker {
7624 type Proxy = PerformanceCounterServiceProxy;
7625 type Request = PerformanceCounterServiceRequest;
7626 const SERVICE_NAME: &'static str = "fuchsia.gpu.magma.PerformanceCounterService";
7627}
7628
7629#[cfg(target_os = "fuchsia")]
7632pub enum PerformanceCounterServiceRequest {
7633 Access(PerformanceCounterAccessRequestStream),
7634}
7635
7636#[cfg(target_os = "fuchsia")]
7637impl fidl::endpoints::ServiceRequest for PerformanceCounterServiceRequest {
7638 type Service = PerformanceCounterServiceMarker;
7639
7640 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
7641 match name {
7642 "access" => Self::Access(
7643 <PerformanceCounterAccessRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
7644 ),
7645 _ => panic!("no such member protocol name for service PerformanceCounterService"),
7646 }
7647 }
7648
7649 fn member_names() -> &'static [&'static str] {
7650 &["access"]
7651 }
7652}
7653#[cfg(target_os = "fuchsia")]
7654pub struct PerformanceCounterServiceProxy(
7655 #[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>,
7656);
7657
7658#[cfg(target_os = "fuchsia")]
7659impl fidl::endpoints::ServiceProxy for PerformanceCounterServiceProxy {
7660 type Service = PerformanceCounterServiceMarker;
7661
7662 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
7663 Self(opener)
7664 }
7665}
7666
7667#[cfg(target_os = "fuchsia")]
7668impl PerformanceCounterServiceProxy {
7669 pub fn connect_to_access(&self) -> Result<PerformanceCounterAccessProxy, fidl::Error> {
7670 let (proxy, server_end) = fidl::endpoints::create_proxy::<PerformanceCounterAccessMarker>();
7671 self.connect_channel_to_access(server_end)?;
7672 Ok(proxy)
7673 }
7674
7675 pub fn connect_to_access_sync(
7678 &self,
7679 ) -> Result<PerformanceCounterAccessSynchronousProxy, fidl::Error> {
7680 let (proxy, server_end) =
7681 fidl::endpoints::create_sync_proxy::<PerformanceCounterAccessMarker>();
7682 self.connect_channel_to_access(server_end)?;
7683 Ok(proxy)
7684 }
7685
7686 pub fn connect_channel_to_access(
7689 &self,
7690 server_end: fidl::endpoints::ServerEnd<PerformanceCounterAccessMarker>,
7691 ) -> Result<(), fidl::Error> {
7692 self.0.open_member("access", server_end.into_channel())
7693 }
7694
7695 pub fn instance_name(&self) -> &str {
7696 self.0.instance_name()
7697 }
7698}
7699
7700#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7701pub struct ServiceMarker;
7702
7703#[cfg(target_os = "fuchsia")]
7704impl fidl::endpoints::ServiceMarker for ServiceMarker {
7705 type Proxy = ServiceProxy;
7706 type Request = ServiceRequest;
7707 const SERVICE_NAME: &'static str = "fuchsia.gpu.magma.Service";
7708}
7709
7710#[cfg(target_os = "fuchsia")]
7713pub enum ServiceRequest {
7714 Device(CombinedDeviceRequestStream),
7715 PowerElementProvider(PowerElementProviderRequestStream),
7716}
7717
7718#[cfg(target_os = "fuchsia")]
7719impl fidl::endpoints::ServiceRequest for ServiceRequest {
7720 type Service = ServiceMarker;
7721
7722 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
7723 match name {
7724 "device" => Self::Device(
7725 <CombinedDeviceRequestStream as fidl::endpoints::RequestStream>::from_channel(
7726 _channel,
7727 ),
7728 ),
7729 "power_element_provider" => Self::PowerElementProvider(
7730 <PowerElementProviderRequestStream as fidl::endpoints::RequestStream>::from_channel(
7731 _channel,
7732 ),
7733 ),
7734 _ => panic!("no such member protocol name for service Service"),
7735 }
7736 }
7737
7738 fn member_names() -> &'static [&'static str] {
7739 &["device", "power_element_provider"]
7740 }
7741}
7742#[cfg(target_os = "fuchsia")]
7743pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
7744
7745#[cfg(target_os = "fuchsia")]
7746impl fidl::endpoints::ServiceProxy for ServiceProxy {
7747 type Service = ServiceMarker;
7748
7749 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
7750 Self(opener)
7751 }
7752}
7753
7754#[cfg(target_os = "fuchsia")]
7755impl ServiceProxy {
7756 pub fn connect_to_device(&self) -> Result<CombinedDeviceProxy, fidl::Error> {
7757 let (proxy, server_end) = fidl::endpoints::create_proxy::<CombinedDeviceMarker>();
7758 self.connect_channel_to_device(server_end)?;
7759 Ok(proxy)
7760 }
7761
7762 pub fn connect_to_device_sync(&self) -> Result<CombinedDeviceSynchronousProxy, fidl::Error> {
7765 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CombinedDeviceMarker>();
7766 self.connect_channel_to_device(server_end)?;
7767 Ok(proxy)
7768 }
7769
7770 pub fn connect_channel_to_device(
7773 &self,
7774 server_end: fidl::endpoints::ServerEnd<CombinedDeviceMarker>,
7775 ) -> Result<(), fidl::Error> {
7776 self.0.open_member("device", server_end.into_channel())
7777 }
7778 pub fn connect_to_power_element_provider(
7779 &self,
7780 ) -> Result<PowerElementProviderProxy, fidl::Error> {
7781 let (proxy, server_end) = fidl::endpoints::create_proxy::<PowerElementProviderMarker>();
7782 self.connect_channel_to_power_element_provider(server_end)?;
7783 Ok(proxy)
7784 }
7785
7786 pub fn connect_to_power_element_provider_sync(
7789 &self,
7790 ) -> Result<PowerElementProviderSynchronousProxy, fidl::Error> {
7791 let (proxy, server_end) =
7792 fidl::endpoints::create_sync_proxy::<PowerElementProviderMarker>();
7793 self.connect_channel_to_power_element_provider(server_end)?;
7794 Ok(proxy)
7795 }
7796
7797 pub fn connect_channel_to_power_element_provider(
7800 &self,
7801 server_end: fidl::endpoints::ServerEnd<PowerElementProviderMarker>,
7802 ) -> Result<(), fidl::Error> {
7803 self.0.open_member("power_element_provider", server_end.into_channel())
7804 }
7805
7806 pub fn instance_name(&self) -> &str {
7807 self.0.instance_name()
7808 }
7809}
7810
7811mod internal {
7812 use super::*;
7813
7814 impl fidl::encoding::ResourceTypeMarker for DependencyInjectionSetMemoryPressureProviderRequest {
7815 type Borrowed<'a> = &'a mut Self;
7816 fn take_or_borrow<'a>(
7817 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7818 ) -> Self::Borrowed<'a> {
7819 value
7820 }
7821 }
7822
7823 unsafe impl fidl::encoding::TypeMarker for DependencyInjectionSetMemoryPressureProviderRequest {
7824 type Owned = Self;
7825
7826 #[inline(always)]
7827 fn inline_align(_context: fidl::encoding::Context) -> usize {
7828 4
7829 }
7830
7831 #[inline(always)]
7832 fn inline_size(_context: fidl::encoding::Context) -> usize {
7833 4
7834 }
7835 }
7836
7837 unsafe impl
7838 fidl::encoding::Encode<
7839 DependencyInjectionSetMemoryPressureProviderRequest,
7840 fidl::encoding::DefaultFuchsiaResourceDialect,
7841 > for &mut DependencyInjectionSetMemoryPressureProviderRequest
7842 {
7843 #[inline]
7844 unsafe fn encode(
7845 self,
7846 encoder: &mut fidl::encoding::Encoder<
7847 '_,
7848 fidl::encoding::DefaultFuchsiaResourceDialect,
7849 >,
7850 offset: usize,
7851 _depth: fidl::encoding::Depth,
7852 ) -> fidl::Result<()> {
7853 encoder
7854 .debug_check_bounds::<DependencyInjectionSetMemoryPressureProviderRequest>(offset);
7855 fidl::encoding::Encode::<
7857 DependencyInjectionSetMemoryPressureProviderRequest,
7858 fidl::encoding::DefaultFuchsiaResourceDialect,
7859 >::encode(
7860 (<fidl::encoding::Endpoint<
7861 fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
7862 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7863 &mut self.provider
7864 ),),
7865 encoder,
7866 offset,
7867 _depth,
7868 )
7869 }
7870 }
7871 unsafe impl<
7872 T0: fidl::encoding::Encode<
7873 fidl::encoding::Endpoint<
7874 fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
7875 >,
7876 fidl::encoding::DefaultFuchsiaResourceDialect,
7877 >,
7878 >
7879 fidl::encoding::Encode<
7880 DependencyInjectionSetMemoryPressureProviderRequest,
7881 fidl::encoding::DefaultFuchsiaResourceDialect,
7882 > for (T0,)
7883 {
7884 #[inline]
7885 unsafe fn encode(
7886 self,
7887 encoder: &mut fidl::encoding::Encoder<
7888 '_,
7889 fidl::encoding::DefaultFuchsiaResourceDialect,
7890 >,
7891 offset: usize,
7892 depth: fidl::encoding::Depth,
7893 ) -> fidl::Result<()> {
7894 encoder
7895 .debug_check_bounds::<DependencyInjectionSetMemoryPressureProviderRequest>(offset);
7896 self.0.encode(encoder, offset + 0, depth)?;
7900 Ok(())
7901 }
7902 }
7903
7904 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7905 for DependencyInjectionSetMemoryPressureProviderRequest
7906 {
7907 #[inline(always)]
7908 fn new_empty() -> Self {
7909 Self {
7910 provider: fidl::new_empty!(
7911 fidl::encoding::Endpoint<
7912 fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
7913 >,
7914 fidl::encoding::DefaultFuchsiaResourceDialect
7915 ),
7916 }
7917 }
7918
7919 #[inline]
7920 unsafe fn decode(
7921 &mut self,
7922 decoder: &mut fidl::encoding::Decoder<
7923 '_,
7924 fidl::encoding::DefaultFuchsiaResourceDialect,
7925 >,
7926 offset: usize,
7927 _depth: fidl::encoding::Depth,
7928 ) -> fidl::Result<()> {
7929 decoder.debug_check_bounds::<Self>(offset);
7930 fidl::decode!(
7932 fidl::encoding::Endpoint<
7933 fidl::endpoints::ClientEnd<fidl_fuchsia_memorypressure::ProviderMarker>,
7934 >,
7935 fidl::encoding::DefaultFuchsiaResourceDialect,
7936 &mut self.provider,
7937 decoder,
7938 offset + 0,
7939 _depth
7940 )?;
7941 Ok(())
7942 }
7943 }
7944
7945 impl fidl::encoding::ResourceTypeMarker for DeviceConnect2Request {
7946 type Borrowed<'a> = &'a mut Self;
7947 fn take_or_borrow<'a>(
7948 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7949 ) -> Self::Borrowed<'a> {
7950 value
7951 }
7952 }
7953
7954 unsafe impl fidl::encoding::TypeMarker for DeviceConnect2Request {
7955 type Owned = Self;
7956
7957 #[inline(always)]
7958 fn inline_align(_context: fidl::encoding::Context) -> usize {
7959 8
7960 }
7961
7962 #[inline(always)]
7963 fn inline_size(_context: fidl::encoding::Context) -> usize {
7964 16
7965 }
7966 }
7967
7968 unsafe impl
7969 fidl::encoding::Encode<DeviceConnect2Request, fidl::encoding::DefaultFuchsiaResourceDialect>
7970 for &mut DeviceConnect2Request
7971 {
7972 #[inline]
7973 unsafe fn encode(
7974 self,
7975 encoder: &mut fidl::encoding::Encoder<
7976 '_,
7977 fidl::encoding::DefaultFuchsiaResourceDialect,
7978 >,
7979 offset: usize,
7980 _depth: fidl::encoding::Depth,
7981 ) -> fidl::Result<()> {
7982 encoder.debug_check_bounds::<DeviceConnect2Request>(offset);
7983 fidl::encoding::Encode::<DeviceConnect2Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7985 (
7986 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.client_id),
7987 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PrimaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.primary_channel),
7988 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NotificationMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.notification_channel),
7989 ),
7990 encoder, offset, _depth
7991 )
7992 }
7993 }
7994 unsafe impl<
7995 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
7996 T1: fidl::encoding::Encode<
7997 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PrimaryMarker>>,
7998 fidl::encoding::DefaultFuchsiaResourceDialect,
7999 >,
8000 T2: fidl::encoding::Encode<
8001 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NotificationMarker>>,
8002 fidl::encoding::DefaultFuchsiaResourceDialect,
8003 >,
8004 >
8005 fidl::encoding::Encode<DeviceConnect2Request, fidl::encoding::DefaultFuchsiaResourceDialect>
8006 for (T0, T1, T2)
8007 {
8008 #[inline]
8009 unsafe fn encode(
8010 self,
8011 encoder: &mut fidl::encoding::Encoder<
8012 '_,
8013 fidl::encoding::DefaultFuchsiaResourceDialect,
8014 >,
8015 offset: usize,
8016 depth: fidl::encoding::Depth,
8017 ) -> fidl::Result<()> {
8018 encoder.debug_check_bounds::<DeviceConnect2Request>(offset);
8019 self.0.encode(encoder, offset + 0, depth)?;
8023 self.1.encode(encoder, offset + 8, depth)?;
8024 self.2.encode(encoder, offset + 12, depth)?;
8025 Ok(())
8026 }
8027 }
8028
8029 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8030 for DeviceConnect2Request
8031 {
8032 #[inline(always)]
8033 fn new_empty() -> Self {
8034 Self {
8035 client_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
8036 primary_channel: fidl::new_empty!(
8037 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PrimaryMarker>>,
8038 fidl::encoding::DefaultFuchsiaResourceDialect
8039 ),
8040 notification_channel: fidl::new_empty!(
8041 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NotificationMarker>>,
8042 fidl::encoding::DefaultFuchsiaResourceDialect
8043 ),
8044 }
8045 }
8046
8047 #[inline]
8048 unsafe fn decode(
8049 &mut self,
8050 decoder: &mut fidl::encoding::Decoder<
8051 '_,
8052 fidl::encoding::DefaultFuchsiaResourceDialect,
8053 >,
8054 offset: usize,
8055 _depth: fidl::encoding::Depth,
8056 ) -> fidl::Result<()> {
8057 decoder.debug_check_bounds::<Self>(offset);
8058 fidl::decode!(
8060 u64,
8061 fidl::encoding::DefaultFuchsiaResourceDialect,
8062 &mut self.client_id,
8063 decoder,
8064 offset + 0,
8065 _depth
8066 )?;
8067 fidl::decode!(
8068 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PrimaryMarker>>,
8069 fidl::encoding::DefaultFuchsiaResourceDialect,
8070 &mut self.primary_channel,
8071 decoder,
8072 offset + 8,
8073 _depth
8074 )?;
8075 fidl::decode!(
8076 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NotificationMarker>>,
8077 fidl::encoding::DefaultFuchsiaResourceDialect,
8078 &mut self.notification_channel,
8079 decoder,
8080 offset + 12,
8081 _depth
8082 )?;
8083 Ok(())
8084 }
8085 }
8086
8087 impl fidl::encoding::ResourceTypeMarker
8088 for PerformanceCounterAccessGetPerformanceCountTokenResponse
8089 {
8090 type Borrowed<'a> = &'a mut Self;
8091 fn take_or_borrow<'a>(
8092 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8093 ) -> Self::Borrowed<'a> {
8094 value
8095 }
8096 }
8097
8098 unsafe impl fidl::encoding::TypeMarker
8099 for PerformanceCounterAccessGetPerformanceCountTokenResponse
8100 {
8101 type Owned = Self;
8102
8103 #[inline(always)]
8104 fn inline_align(_context: fidl::encoding::Context) -> usize {
8105 4
8106 }
8107
8108 #[inline(always)]
8109 fn inline_size(_context: fidl::encoding::Context) -> usize {
8110 4
8111 }
8112 }
8113
8114 unsafe impl
8115 fidl::encoding::Encode<
8116 PerformanceCounterAccessGetPerformanceCountTokenResponse,
8117 fidl::encoding::DefaultFuchsiaResourceDialect,
8118 > for &mut PerformanceCounterAccessGetPerformanceCountTokenResponse
8119 {
8120 #[inline]
8121 unsafe fn encode(
8122 self,
8123 encoder: &mut fidl::encoding::Encoder<
8124 '_,
8125 fidl::encoding::DefaultFuchsiaResourceDialect,
8126 >,
8127 offset: usize,
8128 _depth: fidl::encoding::Depth,
8129 ) -> fidl::Result<()> {
8130 encoder.debug_check_bounds::<PerformanceCounterAccessGetPerformanceCountTokenResponse>(
8131 offset,
8132 );
8133 fidl::encoding::Encode::<
8135 PerformanceCounterAccessGetPerformanceCountTokenResponse,
8136 fidl::encoding::DefaultFuchsiaResourceDialect,
8137 >::encode(
8138 (<fidl::encoding::HandleType<
8139 fidl::Event,
8140 { fidl::ObjectType::EVENT.into_raw() },
8141 2147483648,
8142 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8143 &mut self.access_token
8144 ),),
8145 encoder,
8146 offset,
8147 _depth,
8148 )
8149 }
8150 }
8151 unsafe impl<
8152 T0: fidl::encoding::Encode<
8153 fidl::encoding::HandleType<
8154 fidl::Event,
8155 { fidl::ObjectType::EVENT.into_raw() },
8156 2147483648,
8157 >,
8158 fidl::encoding::DefaultFuchsiaResourceDialect,
8159 >,
8160 >
8161 fidl::encoding::Encode<
8162 PerformanceCounterAccessGetPerformanceCountTokenResponse,
8163 fidl::encoding::DefaultFuchsiaResourceDialect,
8164 > for (T0,)
8165 {
8166 #[inline]
8167 unsafe fn encode(
8168 self,
8169 encoder: &mut fidl::encoding::Encoder<
8170 '_,
8171 fidl::encoding::DefaultFuchsiaResourceDialect,
8172 >,
8173 offset: usize,
8174 depth: fidl::encoding::Depth,
8175 ) -> fidl::Result<()> {
8176 encoder.debug_check_bounds::<PerformanceCounterAccessGetPerformanceCountTokenResponse>(
8177 offset,
8178 );
8179 self.0.encode(encoder, offset + 0, depth)?;
8183 Ok(())
8184 }
8185 }
8186
8187 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8188 for PerformanceCounterAccessGetPerformanceCountTokenResponse
8189 {
8190 #[inline(always)]
8191 fn new_empty() -> Self {
8192 Self {
8193 access_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8194 }
8195 }
8196
8197 #[inline]
8198 unsafe fn decode(
8199 &mut self,
8200 decoder: &mut fidl::encoding::Decoder<
8201 '_,
8202 fidl::encoding::DefaultFuchsiaResourceDialect,
8203 >,
8204 offset: usize,
8205 _depth: fidl::encoding::Depth,
8206 ) -> fidl::Result<()> {
8207 decoder.debug_check_bounds::<Self>(offset);
8208 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.access_token, decoder, offset + 0, _depth)?;
8210 Ok(())
8211 }
8212 }
8213
8214 impl fidl::encoding::ResourceTypeMarker for PowerElementProviderGetPowerGoalsResponse {
8215 type Borrowed<'a> = &'a mut Self;
8216 fn take_or_borrow<'a>(
8217 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8218 ) -> Self::Borrowed<'a> {
8219 value
8220 }
8221 }
8222
8223 unsafe impl fidl::encoding::TypeMarker for PowerElementProviderGetPowerGoalsResponse {
8224 type Owned = Self;
8225
8226 #[inline(always)]
8227 fn inline_align(_context: fidl::encoding::Context) -> usize {
8228 8
8229 }
8230
8231 #[inline(always)]
8232 fn inline_size(_context: fidl::encoding::Context) -> usize {
8233 16
8234 }
8235 }
8236
8237 unsafe impl
8238 fidl::encoding::Encode<
8239 PowerElementProviderGetPowerGoalsResponse,
8240 fidl::encoding::DefaultFuchsiaResourceDialect,
8241 > for &mut PowerElementProviderGetPowerGoalsResponse
8242 {
8243 #[inline]
8244 unsafe fn encode(
8245 self,
8246 encoder: &mut fidl::encoding::Encoder<
8247 '_,
8248 fidl::encoding::DefaultFuchsiaResourceDialect,
8249 >,
8250 offset: usize,
8251 _depth: fidl::encoding::Depth,
8252 ) -> fidl::Result<()> {
8253 encoder.debug_check_bounds::<PowerElementProviderGetPowerGoalsResponse>(offset);
8254 fidl::encoding::Encode::<PowerElementProviderGetPowerGoalsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8256 (
8257 <fidl::encoding::UnboundedVector<PowerGoal> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.goals),
8258 ),
8259 encoder, offset, _depth
8260 )
8261 }
8262 }
8263 unsafe impl<
8264 T0: fidl::encoding::Encode<
8265 fidl::encoding::UnboundedVector<PowerGoal>,
8266 fidl::encoding::DefaultFuchsiaResourceDialect,
8267 >,
8268 >
8269 fidl::encoding::Encode<
8270 PowerElementProviderGetPowerGoalsResponse,
8271 fidl::encoding::DefaultFuchsiaResourceDialect,
8272 > for (T0,)
8273 {
8274 #[inline]
8275 unsafe fn encode(
8276 self,
8277 encoder: &mut fidl::encoding::Encoder<
8278 '_,
8279 fidl::encoding::DefaultFuchsiaResourceDialect,
8280 >,
8281 offset: usize,
8282 depth: fidl::encoding::Depth,
8283 ) -> fidl::Result<()> {
8284 encoder.debug_check_bounds::<PowerElementProviderGetPowerGoalsResponse>(offset);
8285 self.0.encode(encoder, offset + 0, depth)?;
8289 Ok(())
8290 }
8291 }
8292
8293 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8294 for PowerElementProviderGetPowerGoalsResponse
8295 {
8296 #[inline(always)]
8297 fn new_empty() -> Self {
8298 Self {
8299 goals: fidl::new_empty!(
8300 fidl::encoding::UnboundedVector<PowerGoal>,
8301 fidl::encoding::DefaultFuchsiaResourceDialect
8302 ),
8303 }
8304 }
8305
8306 #[inline]
8307 unsafe fn decode(
8308 &mut self,
8309 decoder: &mut fidl::encoding::Decoder<
8310 '_,
8311 fidl::encoding::DefaultFuchsiaResourceDialect,
8312 >,
8313 offset: usize,
8314 _depth: fidl::encoding::Depth,
8315 ) -> fidl::Result<()> {
8316 decoder.debug_check_bounds::<Self>(offset);
8317 fidl::decode!(
8319 fidl::encoding::UnboundedVector<PowerGoal>,
8320 fidl::encoding::DefaultFuchsiaResourceDialect,
8321 &mut self.goals,
8322 decoder,
8323 offset + 0,
8324 _depth
8325 )?;
8326 Ok(())
8327 }
8328 }
8329
8330 impl fidl::encoding::ResourceTypeMarker for PrimaryCreatePerformanceCounterBufferPoolRequest {
8331 type Borrowed<'a> = &'a mut Self;
8332 fn take_or_borrow<'a>(
8333 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8334 ) -> Self::Borrowed<'a> {
8335 value
8336 }
8337 }
8338
8339 unsafe impl fidl::encoding::TypeMarker for PrimaryCreatePerformanceCounterBufferPoolRequest {
8340 type Owned = Self;
8341
8342 #[inline(always)]
8343 fn inline_align(_context: fidl::encoding::Context) -> usize {
8344 8
8345 }
8346
8347 #[inline(always)]
8348 fn inline_size(_context: fidl::encoding::Context) -> usize {
8349 16
8350 }
8351 }
8352
8353 unsafe impl
8354 fidl::encoding::Encode<
8355 PrimaryCreatePerformanceCounterBufferPoolRequest,
8356 fidl::encoding::DefaultFuchsiaResourceDialect,
8357 > for &mut PrimaryCreatePerformanceCounterBufferPoolRequest
8358 {
8359 #[inline]
8360 unsafe fn encode(
8361 self,
8362 encoder: &mut fidl::encoding::Encoder<
8363 '_,
8364 fidl::encoding::DefaultFuchsiaResourceDialect,
8365 >,
8366 offset: usize,
8367 _depth: fidl::encoding::Depth,
8368 ) -> fidl::Result<()> {
8369 encoder.debug_check_bounds::<PrimaryCreatePerformanceCounterBufferPoolRequest>(offset);
8370 fidl::encoding::Encode::<
8372 PrimaryCreatePerformanceCounterBufferPoolRequest,
8373 fidl::encoding::DefaultFuchsiaResourceDialect,
8374 >::encode(
8375 (
8376 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pool_id),
8377 <fidl::encoding::Endpoint<
8378 fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
8379 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8380 &mut self.event_channel,
8381 ),
8382 ),
8383 encoder,
8384 offset,
8385 _depth,
8386 )
8387 }
8388 }
8389 unsafe impl<
8390 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
8391 T1: fidl::encoding::Encode<
8392 fidl::encoding::Endpoint<
8393 fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
8394 >,
8395 fidl::encoding::DefaultFuchsiaResourceDialect,
8396 >,
8397 >
8398 fidl::encoding::Encode<
8399 PrimaryCreatePerformanceCounterBufferPoolRequest,
8400 fidl::encoding::DefaultFuchsiaResourceDialect,
8401 > for (T0, T1)
8402 {
8403 #[inline]
8404 unsafe fn encode(
8405 self,
8406 encoder: &mut fidl::encoding::Encoder<
8407 '_,
8408 fidl::encoding::DefaultFuchsiaResourceDialect,
8409 >,
8410 offset: usize,
8411 depth: fidl::encoding::Depth,
8412 ) -> fidl::Result<()> {
8413 encoder.debug_check_bounds::<PrimaryCreatePerformanceCounterBufferPoolRequest>(offset);
8414 unsafe {
8417 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8418 (ptr as *mut u64).write_unaligned(0);
8419 }
8420 self.0.encode(encoder, offset + 0, depth)?;
8422 self.1.encode(encoder, offset + 8, depth)?;
8423 Ok(())
8424 }
8425 }
8426
8427 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8428 for PrimaryCreatePerformanceCounterBufferPoolRequest
8429 {
8430 #[inline(always)]
8431 fn new_empty() -> Self {
8432 Self {
8433 pool_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
8434 event_channel: fidl::new_empty!(
8435 fidl::encoding::Endpoint<
8436 fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
8437 >,
8438 fidl::encoding::DefaultFuchsiaResourceDialect
8439 ),
8440 }
8441 }
8442
8443 #[inline]
8444 unsafe fn decode(
8445 &mut self,
8446 decoder: &mut fidl::encoding::Decoder<
8447 '_,
8448 fidl::encoding::DefaultFuchsiaResourceDialect,
8449 >,
8450 offset: usize,
8451 _depth: fidl::encoding::Depth,
8452 ) -> fidl::Result<()> {
8453 decoder.debug_check_bounds::<Self>(offset);
8454 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8456 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8457 let mask = 0xffffffff00000000u64;
8458 let maskedval = padval & mask;
8459 if maskedval != 0 {
8460 return Err(fidl::Error::NonZeroPadding {
8461 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8462 });
8463 }
8464 fidl::decode!(
8465 u64,
8466 fidl::encoding::DefaultFuchsiaResourceDialect,
8467 &mut self.pool_id,
8468 decoder,
8469 offset + 0,
8470 _depth
8471 )?;
8472 fidl::decode!(
8473 fidl::encoding::Endpoint<
8474 fidl::endpoints::ServerEnd<PerformanceCounterEventsMarker>,
8475 >,
8476 fidl::encoding::DefaultFuchsiaResourceDialect,
8477 &mut self.event_channel,
8478 decoder,
8479 offset + 8,
8480 _depth
8481 )?;
8482 Ok(())
8483 }
8484 }
8485
8486 impl fidl::encoding::ResourceTypeMarker for PrimaryEnablePerformanceCounterAccessRequest {
8487 type Borrowed<'a> = &'a mut Self;
8488 fn take_or_borrow<'a>(
8489 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8490 ) -> Self::Borrowed<'a> {
8491 value
8492 }
8493 }
8494
8495 unsafe impl fidl::encoding::TypeMarker for PrimaryEnablePerformanceCounterAccessRequest {
8496 type Owned = Self;
8497
8498 #[inline(always)]
8499 fn inline_align(_context: fidl::encoding::Context) -> usize {
8500 4
8501 }
8502
8503 #[inline(always)]
8504 fn inline_size(_context: fidl::encoding::Context) -> usize {
8505 4
8506 }
8507 }
8508
8509 unsafe impl
8510 fidl::encoding::Encode<
8511 PrimaryEnablePerformanceCounterAccessRequest,
8512 fidl::encoding::DefaultFuchsiaResourceDialect,
8513 > for &mut PrimaryEnablePerformanceCounterAccessRequest
8514 {
8515 #[inline]
8516 unsafe fn encode(
8517 self,
8518 encoder: &mut fidl::encoding::Encoder<
8519 '_,
8520 fidl::encoding::DefaultFuchsiaResourceDialect,
8521 >,
8522 offset: usize,
8523 _depth: fidl::encoding::Depth,
8524 ) -> fidl::Result<()> {
8525 encoder.debug_check_bounds::<PrimaryEnablePerformanceCounterAccessRequest>(offset);
8526 fidl::encoding::Encode::<
8528 PrimaryEnablePerformanceCounterAccessRequest,
8529 fidl::encoding::DefaultFuchsiaResourceDialect,
8530 >::encode(
8531 (<fidl::encoding::HandleType<
8532 fidl::Event,
8533 { fidl::ObjectType::EVENT.into_raw() },
8534 2147483648,
8535 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8536 &mut self.access_token
8537 ),),
8538 encoder,
8539 offset,
8540 _depth,
8541 )
8542 }
8543 }
8544 unsafe impl<
8545 T0: fidl::encoding::Encode<
8546 fidl::encoding::HandleType<
8547 fidl::Event,
8548 { fidl::ObjectType::EVENT.into_raw() },
8549 2147483648,
8550 >,
8551 fidl::encoding::DefaultFuchsiaResourceDialect,
8552 >,
8553 >
8554 fidl::encoding::Encode<
8555 PrimaryEnablePerformanceCounterAccessRequest,
8556 fidl::encoding::DefaultFuchsiaResourceDialect,
8557 > for (T0,)
8558 {
8559 #[inline]
8560 unsafe fn encode(
8561 self,
8562 encoder: &mut fidl::encoding::Encoder<
8563 '_,
8564 fidl::encoding::DefaultFuchsiaResourceDialect,
8565 >,
8566 offset: usize,
8567 depth: fidl::encoding::Depth,
8568 ) -> fidl::Result<()> {
8569 encoder.debug_check_bounds::<PrimaryEnablePerformanceCounterAccessRequest>(offset);
8570 self.0.encode(encoder, offset + 0, depth)?;
8574 Ok(())
8575 }
8576 }
8577
8578 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8579 for PrimaryEnablePerformanceCounterAccessRequest
8580 {
8581 #[inline(always)]
8582 fn new_empty() -> Self {
8583 Self {
8584 access_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8585 }
8586 }
8587
8588 #[inline]
8589 unsafe fn decode(
8590 &mut self,
8591 decoder: &mut fidl::encoding::Decoder<
8592 '_,
8593 fidl::encoding::DefaultFuchsiaResourceDialect,
8594 >,
8595 offset: usize,
8596 _depth: fidl::encoding::Depth,
8597 ) -> fidl::Result<()> {
8598 decoder.debug_check_bounds::<Self>(offset);
8599 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.access_token, decoder, offset + 0, _depth)?;
8601 Ok(())
8602 }
8603 }
8604
8605 impl fidl::encoding::ResourceTypeMarker for PrimaryImportObject2Request {
8606 type Borrowed<'a> = &'a mut Self;
8607 fn take_or_borrow<'a>(
8608 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8609 ) -> Self::Borrowed<'a> {
8610 value
8611 }
8612 }
8613
8614 unsafe impl fidl::encoding::TypeMarker for PrimaryImportObject2Request {
8615 type Owned = Self;
8616
8617 #[inline(always)]
8618 fn inline_align(_context: fidl::encoding::Context) -> usize {
8619 8
8620 }
8621
8622 #[inline(always)]
8623 fn inline_size(_context: fidl::encoding::Context) -> usize {
8624 16
8625 }
8626 }
8627
8628 unsafe impl
8629 fidl::encoding::Encode<
8630 PrimaryImportObject2Request,
8631 fidl::encoding::DefaultFuchsiaResourceDialect,
8632 > for &mut PrimaryImportObject2Request
8633 {
8634 #[inline]
8635 unsafe fn encode(
8636 self,
8637 encoder: &mut fidl::encoding::Encoder<
8638 '_,
8639 fidl::encoding::DefaultFuchsiaResourceDialect,
8640 >,
8641 offset: usize,
8642 _depth: fidl::encoding::Depth,
8643 ) -> fidl::Result<()> {
8644 encoder.debug_check_bounds::<PrimaryImportObject2Request>(offset);
8645 fidl::encoding::Encode::<
8647 PrimaryImportObject2Request,
8648 fidl::encoding::DefaultFuchsiaResourceDialect,
8649 >::encode(
8650 (
8651 <fidl::encoding::HandleType<
8652 fidl::Handle,
8653 { fidl::ObjectType::NONE.into_raw() },
8654 2147483648,
8655 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8656 &mut self.object
8657 ),
8658 <ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.object_type),
8659 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.object_id),
8660 ),
8661 encoder,
8662 offset,
8663 _depth,
8664 )
8665 }
8666 }
8667 unsafe impl<
8668 T0: fidl::encoding::Encode<
8669 fidl::encoding::HandleType<
8670 fidl::Handle,
8671 { fidl::ObjectType::NONE.into_raw() },
8672 2147483648,
8673 >,
8674 fidl::encoding::DefaultFuchsiaResourceDialect,
8675 >,
8676 T1: fidl::encoding::Encode<ObjectType, fidl::encoding::DefaultFuchsiaResourceDialect>,
8677 T2: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
8678 >
8679 fidl::encoding::Encode<
8680 PrimaryImportObject2Request,
8681 fidl::encoding::DefaultFuchsiaResourceDialect,
8682 > for (T0, T1, T2)
8683 {
8684 #[inline]
8685 unsafe fn encode(
8686 self,
8687 encoder: &mut fidl::encoding::Encoder<
8688 '_,
8689 fidl::encoding::DefaultFuchsiaResourceDialect,
8690 >,
8691 offset: usize,
8692 depth: fidl::encoding::Depth,
8693 ) -> fidl::Result<()> {
8694 encoder.debug_check_bounds::<PrimaryImportObject2Request>(offset);
8695 self.0.encode(encoder, offset + 0, depth)?;
8699 self.1.encode(encoder, offset + 4, depth)?;
8700 self.2.encode(encoder, offset + 8, depth)?;
8701 Ok(())
8702 }
8703 }
8704
8705 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8706 for PrimaryImportObject2Request
8707 {
8708 #[inline(always)]
8709 fn new_empty() -> Self {
8710 Self {
8711 object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8712 object_type: fidl::new_empty!(
8713 ObjectType,
8714 fidl::encoding::DefaultFuchsiaResourceDialect
8715 ),
8716 object_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
8717 }
8718 }
8719
8720 #[inline]
8721 unsafe fn decode(
8722 &mut self,
8723 decoder: &mut fidl::encoding::Decoder<
8724 '_,
8725 fidl::encoding::DefaultFuchsiaResourceDialect,
8726 >,
8727 offset: usize,
8728 _depth: fidl::encoding::Depth,
8729 ) -> fidl::Result<()> {
8730 decoder.debug_check_bounds::<Self>(offset);
8731 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 0, _depth)?;
8733 fidl::decode!(
8734 ObjectType,
8735 fidl::encoding::DefaultFuchsiaResourceDialect,
8736 &mut self.object_type,
8737 decoder,
8738 offset + 4,
8739 _depth
8740 )?;
8741 fidl::decode!(
8742 u64,
8743 fidl::encoding::DefaultFuchsiaResourceDialect,
8744 &mut self.object_id,
8745 decoder,
8746 offset + 8,
8747 _depth
8748 )?;
8749 Ok(())
8750 }
8751 }
8752
8753 impl PowerElementProviderGetClockSpeedLevelResponse {
8754 #[inline(always)]
8755 fn max_ordinal_present(&self) -> u64 {
8756 if let Some(_) = self.actual_hz {
8757 return 3;
8758 }
8759 if let Some(_) = self.level {
8760 return 2;
8761 }
8762 if let Some(_) = self.token {
8763 return 1;
8764 }
8765 0
8766 }
8767 }
8768
8769 impl fidl::encoding::ResourceTypeMarker for PowerElementProviderGetClockSpeedLevelResponse {
8770 type Borrowed<'a> = &'a mut Self;
8771 fn take_or_borrow<'a>(
8772 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8773 ) -> Self::Borrowed<'a> {
8774 value
8775 }
8776 }
8777
8778 unsafe impl fidl::encoding::TypeMarker for PowerElementProviderGetClockSpeedLevelResponse {
8779 type Owned = Self;
8780
8781 #[inline(always)]
8782 fn inline_align(_context: fidl::encoding::Context) -> usize {
8783 8
8784 }
8785
8786 #[inline(always)]
8787 fn inline_size(_context: fidl::encoding::Context) -> usize {
8788 16
8789 }
8790 }
8791
8792 unsafe impl
8793 fidl::encoding::Encode<
8794 PowerElementProviderGetClockSpeedLevelResponse,
8795 fidl::encoding::DefaultFuchsiaResourceDialect,
8796 > for &mut PowerElementProviderGetClockSpeedLevelResponse
8797 {
8798 unsafe fn encode(
8799 self,
8800 encoder: &mut fidl::encoding::Encoder<
8801 '_,
8802 fidl::encoding::DefaultFuchsiaResourceDialect,
8803 >,
8804 offset: usize,
8805 mut depth: fidl::encoding::Depth,
8806 ) -> fidl::Result<()> {
8807 encoder.debug_check_bounds::<PowerElementProviderGetClockSpeedLevelResponse>(offset);
8808 let max_ordinal: u64 = self.max_ordinal_present();
8810 encoder.write_num(max_ordinal, offset);
8811 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8812 if max_ordinal == 0 {
8814 return Ok(());
8815 }
8816 depth.increment()?;
8817 let envelope_size = 8;
8818 let bytes_len = max_ordinal as usize * envelope_size;
8819 #[allow(unused_variables)]
8820 let offset = encoder.out_of_line_offset(bytes_len);
8821 let mut _prev_end_offset: usize = 0;
8822 if 1 > max_ordinal {
8823 return Ok(());
8824 }
8825
8826 let cur_offset: usize = (1 - 1) * envelope_size;
8829
8830 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8832
8833 fidl::encoding::encode_in_envelope_optional::<
8838 fidl::encoding::HandleType<
8839 fidl::Event,
8840 { fidl::ObjectType::EVENT.into_raw() },
8841 2147483648,
8842 >,
8843 fidl::encoding::DefaultFuchsiaResourceDialect,
8844 >(
8845 self.token.as_mut().map(
8846 <fidl::encoding::HandleType<
8847 fidl::Event,
8848 { fidl::ObjectType::EVENT.into_raw() },
8849 2147483648,
8850 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8851 ),
8852 encoder,
8853 offset + cur_offset,
8854 depth,
8855 )?;
8856
8857 _prev_end_offset = cur_offset + envelope_size;
8858 if 2 > max_ordinal {
8859 return Ok(());
8860 }
8861
8862 let cur_offset: usize = (2 - 1) * envelope_size;
8865
8866 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8868
8869 fidl::encoding::encode_in_envelope_optional::<
8874 u8,
8875 fidl::encoding::DefaultFuchsiaResourceDialect,
8876 >(
8877 self.level.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
8878 encoder,
8879 offset + cur_offset,
8880 depth,
8881 )?;
8882
8883 _prev_end_offset = cur_offset + envelope_size;
8884 if 3 > max_ordinal {
8885 return Ok(());
8886 }
8887
8888 let cur_offset: usize = (3 - 1) * envelope_size;
8891
8892 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8894
8895 fidl::encoding::encode_in_envelope_optional::<
8900 u64,
8901 fidl::encoding::DefaultFuchsiaResourceDialect,
8902 >(
8903 self.actual_hz.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8904 encoder,
8905 offset + cur_offset,
8906 depth,
8907 )?;
8908
8909 _prev_end_offset = cur_offset + envelope_size;
8910
8911 Ok(())
8912 }
8913 }
8914
8915 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8916 for PowerElementProviderGetClockSpeedLevelResponse
8917 {
8918 #[inline(always)]
8919 fn new_empty() -> Self {
8920 Self::default()
8921 }
8922
8923 unsafe fn decode(
8924 &mut self,
8925 decoder: &mut fidl::encoding::Decoder<
8926 '_,
8927 fidl::encoding::DefaultFuchsiaResourceDialect,
8928 >,
8929 offset: usize,
8930 mut depth: fidl::encoding::Depth,
8931 ) -> fidl::Result<()> {
8932 decoder.debug_check_bounds::<Self>(offset);
8933 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8934 None => return Err(fidl::Error::NotNullable),
8935 Some(len) => len,
8936 };
8937 if len == 0 {
8939 return Ok(());
8940 };
8941 depth.increment()?;
8942 let envelope_size = 8;
8943 let bytes_len = len * envelope_size;
8944 let offset = decoder.out_of_line_offset(bytes_len)?;
8945 let mut _next_ordinal_to_read = 0;
8947 let mut next_offset = offset;
8948 let end_offset = offset + bytes_len;
8949 _next_ordinal_to_read += 1;
8950 if next_offset >= end_offset {
8951 return Ok(());
8952 }
8953
8954 while _next_ordinal_to_read < 1 {
8956 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8957 _next_ordinal_to_read += 1;
8958 next_offset += envelope_size;
8959 }
8960
8961 let next_out_of_line = decoder.next_out_of_line();
8962 let handles_before = decoder.remaining_handles();
8963 if let Some((inlined, num_bytes, num_handles)) =
8964 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8965 {
8966 let member_inline_size = <fidl::encoding::HandleType<
8967 fidl::Event,
8968 { fidl::ObjectType::EVENT.into_raw() },
8969 2147483648,
8970 > as fidl::encoding::TypeMarker>::inline_size(
8971 decoder.context
8972 );
8973 if inlined != (member_inline_size <= 4) {
8974 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8975 }
8976 let inner_offset;
8977 let mut inner_depth = depth.clone();
8978 if inlined {
8979 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8980 inner_offset = next_offset;
8981 } else {
8982 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8983 inner_depth.increment()?;
8984 }
8985 let val_ref =
8986 self.token.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
8987 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
8988 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8989 {
8990 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8991 }
8992 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8993 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8994 }
8995 }
8996
8997 next_offset += envelope_size;
8998 _next_ordinal_to_read += 1;
8999 if next_offset >= end_offset {
9000 return Ok(());
9001 }
9002
9003 while _next_ordinal_to_read < 2 {
9005 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9006 _next_ordinal_to_read += 1;
9007 next_offset += envelope_size;
9008 }
9009
9010 let next_out_of_line = decoder.next_out_of_line();
9011 let handles_before = decoder.remaining_handles();
9012 if let Some((inlined, num_bytes, num_handles)) =
9013 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9014 {
9015 let member_inline_size =
9016 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9017 if inlined != (member_inline_size <= 4) {
9018 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9019 }
9020 let inner_offset;
9021 let mut inner_depth = depth.clone();
9022 if inlined {
9023 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9024 inner_offset = next_offset;
9025 } else {
9026 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9027 inner_depth.increment()?;
9028 }
9029 let val_ref = self.level.get_or_insert_with(|| {
9030 fidl::new_empty!(u8, fidl::encoding::DefaultFuchsiaResourceDialect)
9031 });
9032 fidl::decode!(
9033 u8,
9034 fidl::encoding::DefaultFuchsiaResourceDialect,
9035 val_ref,
9036 decoder,
9037 inner_offset,
9038 inner_depth
9039 )?;
9040 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9041 {
9042 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9043 }
9044 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9045 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9046 }
9047 }
9048
9049 next_offset += envelope_size;
9050 _next_ordinal_to_read += 1;
9051 if next_offset >= end_offset {
9052 return Ok(());
9053 }
9054
9055 while _next_ordinal_to_read < 3 {
9057 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9058 _next_ordinal_to_read += 1;
9059 next_offset += envelope_size;
9060 }
9061
9062 let next_out_of_line = decoder.next_out_of_line();
9063 let handles_before = decoder.remaining_handles();
9064 if let Some((inlined, num_bytes, num_handles)) =
9065 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9066 {
9067 let member_inline_size =
9068 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9069 if inlined != (member_inline_size <= 4) {
9070 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9071 }
9072 let inner_offset;
9073 let mut inner_depth = depth.clone();
9074 if inlined {
9075 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9076 inner_offset = next_offset;
9077 } else {
9078 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9079 inner_depth.increment()?;
9080 }
9081 let val_ref = self.actual_hz.get_or_insert_with(|| {
9082 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
9083 });
9084 fidl::decode!(
9085 u64,
9086 fidl::encoding::DefaultFuchsiaResourceDialect,
9087 val_ref,
9088 decoder,
9089 inner_offset,
9090 inner_depth
9091 )?;
9092 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9093 {
9094 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9095 }
9096 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9097 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9098 }
9099 }
9100
9101 next_offset += envelope_size;
9102
9103 while next_offset < end_offset {
9105 _next_ordinal_to_read += 1;
9106 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9107 next_offset += envelope_size;
9108 }
9109
9110 Ok(())
9111 }
9112 }
9113
9114 impl PowerElementProviderSetClockLimitResponse {
9115 #[inline(always)]
9116 fn max_ordinal_present(&self) -> u64 {
9117 if let Some(_) = self.actual_hz {
9118 return 2;
9119 }
9120 if let Some(_) = self.handle {
9121 return 1;
9122 }
9123 0
9124 }
9125 }
9126
9127 impl fidl::encoding::ResourceTypeMarker for PowerElementProviderSetClockLimitResponse {
9128 type Borrowed<'a> = &'a mut Self;
9129 fn take_or_borrow<'a>(
9130 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9131 ) -> Self::Borrowed<'a> {
9132 value
9133 }
9134 }
9135
9136 unsafe impl fidl::encoding::TypeMarker for PowerElementProviderSetClockLimitResponse {
9137 type Owned = Self;
9138
9139 #[inline(always)]
9140 fn inline_align(_context: fidl::encoding::Context) -> usize {
9141 8
9142 }
9143
9144 #[inline(always)]
9145 fn inline_size(_context: fidl::encoding::Context) -> usize {
9146 16
9147 }
9148 }
9149
9150 unsafe impl
9151 fidl::encoding::Encode<
9152 PowerElementProviderSetClockLimitResponse,
9153 fidl::encoding::DefaultFuchsiaResourceDialect,
9154 > for &mut PowerElementProviderSetClockLimitResponse
9155 {
9156 unsafe fn encode(
9157 self,
9158 encoder: &mut fidl::encoding::Encoder<
9159 '_,
9160 fidl::encoding::DefaultFuchsiaResourceDialect,
9161 >,
9162 offset: usize,
9163 mut depth: fidl::encoding::Depth,
9164 ) -> fidl::Result<()> {
9165 encoder.debug_check_bounds::<PowerElementProviderSetClockLimitResponse>(offset);
9166 let max_ordinal: u64 = self.max_ordinal_present();
9168 encoder.write_num(max_ordinal, offset);
9169 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9170 if max_ordinal == 0 {
9172 return Ok(());
9173 }
9174 depth.increment()?;
9175 let envelope_size = 8;
9176 let bytes_len = max_ordinal as usize * envelope_size;
9177 #[allow(unused_variables)]
9178 let offset = encoder.out_of_line_offset(bytes_len);
9179 let mut _prev_end_offset: usize = 0;
9180 if 1 > max_ordinal {
9181 return Ok(());
9182 }
9183
9184 let cur_offset: usize = (1 - 1) * envelope_size;
9187
9188 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9190
9191 fidl::encoding::encode_in_envelope_optional::<
9196 fidl::encoding::HandleType<
9197 fidl::EventPair,
9198 { fidl::ObjectType::EVENTPAIR.into_raw() },
9199 2147483648,
9200 >,
9201 fidl::encoding::DefaultFuchsiaResourceDialect,
9202 >(
9203 self.handle.as_mut().map(
9204 <fidl::encoding::HandleType<
9205 fidl::EventPair,
9206 { fidl::ObjectType::EVENTPAIR.into_raw() },
9207 2147483648,
9208 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9209 ),
9210 encoder,
9211 offset + cur_offset,
9212 depth,
9213 )?;
9214
9215 _prev_end_offset = cur_offset + envelope_size;
9216 if 2 > max_ordinal {
9217 return Ok(());
9218 }
9219
9220 let cur_offset: usize = (2 - 1) * envelope_size;
9223
9224 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9226
9227 fidl::encoding::encode_in_envelope_optional::<
9232 u64,
9233 fidl::encoding::DefaultFuchsiaResourceDialect,
9234 >(
9235 self.actual_hz.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9236 encoder,
9237 offset + cur_offset,
9238 depth,
9239 )?;
9240
9241 _prev_end_offset = cur_offset + envelope_size;
9242
9243 Ok(())
9244 }
9245 }
9246
9247 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9248 for PowerElementProviderSetClockLimitResponse
9249 {
9250 #[inline(always)]
9251 fn new_empty() -> Self {
9252 Self::default()
9253 }
9254
9255 unsafe fn decode(
9256 &mut self,
9257 decoder: &mut fidl::encoding::Decoder<
9258 '_,
9259 fidl::encoding::DefaultFuchsiaResourceDialect,
9260 >,
9261 offset: usize,
9262 mut depth: fidl::encoding::Depth,
9263 ) -> fidl::Result<()> {
9264 decoder.debug_check_bounds::<Self>(offset);
9265 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9266 None => return Err(fidl::Error::NotNullable),
9267 Some(len) => len,
9268 };
9269 if len == 0 {
9271 return Ok(());
9272 };
9273 depth.increment()?;
9274 let envelope_size = 8;
9275 let bytes_len = len * envelope_size;
9276 let offset = decoder.out_of_line_offset(bytes_len)?;
9277 let mut _next_ordinal_to_read = 0;
9279 let mut next_offset = offset;
9280 let end_offset = offset + bytes_len;
9281 _next_ordinal_to_read += 1;
9282 if next_offset >= end_offset {
9283 return Ok(());
9284 }
9285
9286 while _next_ordinal_to_read < 1 {
9288 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9289 _next_ordinal_to_read += 1;
9290 next_offset += envelope_size;
9291 }
9292
9293 let next_out_of_line = decoder.next_out_of_line();
9294 let handles_before = decoder.remaining_handles();
9295 if let Some((inlined, num_bytes, num_handles)) =
9296 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9297 {
9298 let member_inline_size = <fidl::encoding::HandleType<
9299 fidl::EventPair,
9300 { fidl::ObjectType::EVENTPAIR.into_raw() },
9301 2147483648,
9302 > as fidl::encoding::TypeMarker>::inline_size(
9303 decoder.context
9304 );
9305 if inlined != (member_inline_size <= 4) {
9306 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9307 }
9308 let inner_offset;
9309 let mut inner_depth = depth.clone();
9310 if inlined {
9311 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9312 inner_offset = next_offset;
9313 } else {
9314 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9315 inner_depth.increment()?;
9316 }
9317 let val_ref =
9318 self.handle.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
9319 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9320 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9321 {
9322 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9323 }
9324 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9325 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9326 }
9327 }
9328
9329 next_offset += envelope_size;
9330 _next_ordinal_to_read += 1;
9331 if next_offset >= end_offset {
9332 return Ok(());
9333 }
9334
9335 while _next_ordinal_to_read < 2 {
9337 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9338 _next_ordinal_to_read += 1;
9339 next_offset += envelope_size;
9340 }
9341
9342 let next_out_of_line = decoder.next_out_of_line();
9343 let handles_before = decoder.remaining_handles();
9344 if let Some((inlined, num_bytes, num_handles)) =
9345 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9346 {
9347 let member_inline_size =
9348 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9349 if inlined != (member_inline_size <= 4) {
9350 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9351 }
9352 let inner_offset;
9353 let mut inner_depth = depth.clone();
9354 if inlined {
9355 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9356 inner_offset = next_offset;
9357 } else {
9358 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9359 inner_depth.increment()?;
9360 }
9361 let val_ref = self.actual_hz.get_or_insert_with(|| {
9362 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
9363 });
9364 fidl::decode!(
9365 u64,
9366 fidl::encoding::DefaultFuchsiaResourceDialect,
9367 val_ref,
9368 decoder,
9369 inner_offset,
9370 inner_depth
9371 )?;
9372 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9373 {
9374 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9375 }
9376 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9377 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9378 }
9379 }
9380
9381 next_offset += envelope_size;
9382
9383 while next_offset < end_offset {
9385 _next_ordinal_to_read += 1;
9386 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9387 next_offset += envelope_size;
9388 }
9389
9390 Ok(())
9391 }
9392 }
9393
9394 impl PowerGoal {
9395 #[inline(always)]
9396 fn max_ordinal_present(&self) -> u64 {
9397 if let Some(_) = self.token {
9398 return 2;
9399 }
9400 if let Some(_) = self.type_ {
9401 return 1;
9402 }
9403 0
9404 }
9405 }
9406
9407 impl fidl::encoding::ResourceTypeMarker for PowerGoal {
9408 type Borrowed<'a> = &'a mut Self;
9409 fn take_or_borrow<'a>(
9410 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9411 ) -> Self::Borrowed<'a> {
9412 value
9413 }
9414 }
9415
9416 unsafe impl fidl::encoding::TypeMarker for PowerGoal {
9417 type Owned = Self;
9418
9419 #[inline(always)]
9420 fn inline_align(_context: fidl::encoding::Context) -> usize {
9421 8
9422 }
9423
9424 #[inline(always)]
9425 fn inline_size(_context: fidl::encoding::Context) -> usize {
9426 16
9427 }
9428 }
9429
9430 unsafe impl fidl::encoding::Encode<PowerGoal, fidl::encoding::DefaultFuchsiaResourceDialect>
9431 for &mut PowerGoal
9432 {
9433 unsafe fn encode(
9434 self,
9435 encoder: &mut fidl::encoding::Encoder<
9436 '_,
9437 fidl::encoding::DefaultFuchsiaResourceDialect,
9438 >,
9439 offset: usize,
9440 mut depth: fidl::encoding::Depth,
9441 ) -> fidl::Result<()> {
9442 encoder.debug_check_bounds::<PowerGoal>(offset);
9443 let max_ordinal: u64 = self.max_ordinal_present();
9445 encoder.write_num(max_ordinal, offset);
9446 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9447 if max_ordinal == 0 {
9449 return Ok(());
9450 }
9451 depth.increment()?;
9452 let envelope_size = 8;
9453 let bytes_len = max_ordinal as usize * envelope_size;
9454 #[allow(unused_variables)]
9455 let offset = encoder.out_of_line_offset(bytes_len);
9456 let mut _prev_end_offset: usize = 0;
9457 if 1 > max_ordinal {
9458 return Ok(());
9459 }
9460
9461 let cur_offset: usize = (1 - 1) * envelope_size;
9464
9465 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9467
9468 fidl::encoding::encode_in_envelope_optional::<
9473 PowerGoalType,
9474 fidl::encoding::DefaultFuchsiaResourceDialect,
9475 >(
9476 self.type_.as_ref().map(<PowerGoalType as fidl::encoding::ValueTypeMarker>::borrow),
9477 encoder,
9478 offset + cur_offset,
9479 depth,
9480 )?;
9481
9482 _prev_end_offset = cur_offset + envelope_size;
9483 if 2 > max_ordinal {
9484 return Ok(());
9485 }
9486
9487 let cur_offset: usize = (2 - 1) * envelope_size;
9490
9491 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9493
9494 fidl::encoding::encode_in_envelope_optional::<
9499 fidl::encoding::HandleType<
9500 fidl::Event,
9501 { fidl::ObjectType::EVENT.into_raw() },
9502 2147483648,
9503 >,
9504 fidl::encoding::DefaultFuchsiaResourceDialect,
9505 >(
9506 self.token.as_mut().map(
9507 <fidl::encoding::HandleType<
9508 fidl::Event,
9509 { fidl::ObjectType::EVENT.into_raw() },
9510 2147483648,
9511 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9512 ),
9513 encoder,
9514 offset + cur_offset,
9515 depth,
9516 )?;
9517
9518 _prev_end_offset = cur_offset + envelope_size;
9519
9520 Ok(())
9521 }
9522 }
9523
9524 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for PowerGoal {
9525 #[inline(always)]
9526 fn new_empty() -> Self {
9527 Self::default()
9528 }
9529
9530 unsafe fn decode(
9531 &mut self,
9532 decoder: &mut fidl::encoding::Decoder<
9533 '_,
9534 fidl::encoding::DefaultFuchsiaResourceDialect,
9535 >,
9536 offset: usize,
9537 mut depth: fidl::encoding::Depth,
9538 ) -> fidl::Result<()> {
9539 decoder.debug_check_bounds::<Self>(offset);
9540 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9541 None => return Err(fidl::Error::NotNullable),
9542 Some(len) => len,
9543 };
9544 if len == 0 {
9546 return Ok(());
9547 };
9548 depth.increment()?;
9549 let envelope_size = 8;
9550 let bytes_len = len * envelope_size;
9551 let offset = decoder.out_of_line_offset(bytes_len)?;
9552 let mut _next_ordinal_to_read = 0;
9554 let mut next_offset = offset;
9555 let end_offset = offset + bytes_len;
9556 _next_ordinal_to_read += 1;
9557 if next_offset >= end_offset {
9558 return Ok(());
9559 }
9560
9561 while _next_ordinal_to_read < 1 {
9563 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9564 _next_ordinal_to_read += 1;
9565 next_offset += envelope_size;
9566 }
9567
9568 let next_out_of_line = decoder.next_out_of_line();
9569 let handles_before = decoder.remaining_handles();
9570 if let Some((inlined, num_bytes, num_handles)) =
9571 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9572 {
9573 let member_inline_size =
9574 <PowerGoalType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9575 if inlined != (member_inline_size <= 4) {
9576 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9577 }
9578 let inner_offset;
9579 let mut inner_depth = depth.clone();
9580 if inlined {
9581 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9582 inner_offset = next_offset;
9583 } else {
9584 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9585 inner_depth.increment()?;
9586 }
9587 let val_ref = self.type_.get_or_insert_with(|| {
9588 fidl::new_empty!(PowerGoalType, fidl::encoding::DefaultFuchsiaResourceDialect)
9589 });
9590 fidl::decode!(
9591 PowerGoalType,
9592 fidl::encoding::DefaultFuchsiaResourceDialect,
9593 val_ref,
9594 decoder,
9595 inner_offset,
9596 inner_depth
9597 )?;
9598 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9599 {
9600 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9601 }
9602 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9603 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9604 }
9605 }
9606
9607 next_offset += envelope_size;
9608 _next_ordinal_to_read += 1;
9609 if next_offset >= end_offset {
9610 return Ok(());
9611 }
9612
9613 while _next_ordinal_to_read < 2 {
9615 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9616 _next_ordinal_to_read += 1;
9617 next_offset += envelope_size;
9618 }
9619
9620 let next_out_of_line = decoder.next_out_of_line();
9621 let handles_before = decoder.remaining_handles();
9622 if let Some((inlined, num_bytes, num_handles)) =
9623 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9624 {
9625 let member_inline_size = <fidl::encoding::HandleType<
9626 fidl::Event,
9627 { fidl::ObjectType::EVENT.into_raw() },
9628 2147483648,
9629 > as fidl::encoding::TypeMarker>::inline_size(
9630 decoder.context
9631 );
9632 if inlined != (member_inline_size <= 4) {
9633 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9634 }
9635 let inner_offset;
9636 let mut inner_depth = depth.clone();
9637 if inlined {
9638 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9639 inner_offset = next_offset;
9640 } else {
9641 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9642 inner_depth.increment()?;
9643 }
9644 let val_ref =
9645 self.token.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
9646 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9647 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9648 {
9649 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9650 }
9651 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9652 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9653 }
9654 }
9655
9656 next_offset += envelope_size;
9657
9658 while next_offset < end_offset {
9660 _next_ordinal_to_read += 1;
9661 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9662 next_offset += envelope_size;
9663 }
9664
9665 Ok(())
9666 }
9667 }
9668
9669 impl PrimaryImportObjectRequest {
9670 #[inline(always)]
9671 fn max_ordinal_present(&self) -> u64 {
9672 if let Some(_) = self.flags {
9673 return 4;
9674 }
9675 if let Some(_) = self.object_id {
9676 return 3;
9677 }
9678 if let Some(_) = self.object_type {
9679 return 2;
9680 }
9681 if let Some(_) = self.object {
9682 return 1;
9683 }
9684 0
9685 }
9686 }
9687
9688 impl fidl::encoding::ResourceTypeMarker for PrimaryImportObjectRequest {
9689 type Borrowed<'a> = &'a mut Self;
9690 fn take_or_borrow<'a>(
9691 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9692 ) -> Self::Borrowed<'a> {
9693 value
9694 }
9695 }
9696
9697 unsafe impl fidl::encoding::TypeMarker for PrimaryImportObjectRequest {
9698 type Owned = Self;
9699
9700 #[inline(always)]
9701 fn inline_align(_context: fidl::encoding::Context) -> usize {
9702 8
9703 }
9704
9705 #[inline(always)]
9706 fn inline_size(_context: fidl::encoding::Context) -> usize {
9707 16
9708 }
9709 }
9710
9711 unsafe impl
9712 fidl::encoding::Encode<
9713 PrimaryImportObjectRequest,
9714 fidl::encoding::DefaultFuchsiaResourceDialect,
9715 > for &mut PrimaryImportObjectRequest
9716 {
9717 unsafe fn encode(
9718 self,
9719 encoder: &mut fidl::encoding::Encoder<
9720 '_,
9721 fidl::encoding::DefaultFuchsiaResourceDialect,
9722 >,
9723 offset: usize,
9724 mut depth: fidl::encoding::Depth,
9725 ) -> fidl::Result<()> {
9726 encoder.debug_check_bounds::<PrimaryImportObjectRequest>(offset);
9727 let max_ordinal: u64 = self.max_ordinal_present();
9729 encoder.write_num(max_ordinal, offset);
9730 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9731 if max_ordinal == 0 {
9733 return Ok(());
9734 }
9735 depth.increment()?;
9736 let envelope_size = 8;
9737 let bytes_len = max_ordinal as usize * envelope_size;
9738 #[allow(unused_variables)]
9739 let offset = encoder.out_of_line_offset(bytes_len);
9740 let mut _prev_end_offset: usize = 0;
9741 if 1 > max_ordinal {
9742 return Ok(());
9743 }
9744
9745 let cur_offset: usize = (1 - 1) * envelope_size;
9748
9749 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9751
9752 fidl::encoding::encode_in_envelope_optional::<
9757 Object,
9758 fidl::encoding::DefaultFuchsiaResourceDialect,
9759 >(
9760 self.object
9761 .as_mut()
9762 .map(<Object as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9763 encoder,
9764 offset + cur_offset,
9765 depth,
9766 )?;
9767
9768 _prev_end_offset = cur_offset + envelope_size;
9769 if 2 > max_ordinal {
9770 return Ok(());
9771 }
9772
9773 let cur_offset: usize = (2 - 1) * envelope_size;
9776
9777 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9779
9780 fidl::encoding::encode_in_envelope_optional::<
9785 ObjectType,
9786 fidl::encoding::DefaultFuchsiaResourceDialect,
9787 >(
9788 self.object_type
9789 .as_ref()
9790 .map(<ObjectType as fidl::encoding::ValueTypeMarker>::borrow),
9791 encoder,
9792 offset + cur_offset,
9793 depth,
9794 )?;
9795
9796 _prev_end_offset = cur_offset + envelope_size;
9797 if 3 > max_ordinal {
9798 return Ok(());
9799 }
9800
9801 let cur_offset: usize = (3 - 1) * envelope_size;
9804
9805 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9807
9808 fidl::encoding::encode_in_envelope_optional::<
9813 u64,
9814 fidl::encoding::DefaultFuchsiaResourceDialect,
9815 >(
9816 self.object_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9817 encoder,
9818 offset + cur_offset,
9819 depth,
9820 )?;
9821
9822 _prev_end_offset = cur_offset + envelope_size;
9823 if 4 > max_ordinal {
9824 return Ok(());
9825 }
9826
9827 let cur_offset: usize = (4 - 1) * envelope_size;
9830
9831 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9833
9834 fidl::encoding::encode_in_envelope_optional::<
9839 ImportFlags,
9840 fidl::encoding::DefaultFuchsiaResourceDialect,
9841 >(
9842 self.flags.as_ref().map(<ImportFlags as fidl::encoding::ValueTypeMarker>::borrow),
9843 encoder,
9844 offset + cur_offset,
9845 depth,
9846 )?;
9847
9848 _prev_end_offset = cur_offset + envelope_size;
9849
9850 Ok(())
9851 }
9852 }
9853
9854 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9855 for PrimaryImportObjectRequest
9856 {
9857 #[inline(always)]
9858 fn new_empty() -> Self {
9859 Self::default()
9860 }
9861
9862 unsafe fn decode(
9863 &mut self,
9864 decoder: &mut fidl::encoding::Decoder<
9865 '_,
9866 fidl::encoding::DefaultFuchsiaResourceDialect,
9867 >,
9868 offset: usize,
9869 mut depth: fidl::encoding::Depth,
9870 ) -> fidl::Result<()> {
9871 decoder.debug_check_bounds::<Self>(offset);
9872 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9873 None => return Err(fidl::Error::NotNullable),
9874 Some(len) => len,
9875 };
9876 if len == 0 {
9878 return Ok(());
9879 };
9880 depth.increment()?;
9881 let envelope_size = 8;
9882 let bytes_len = len * envelope_size;
9883 let offset = decoder.out_of_line_offset(bytes_len)?;
9884 let mut _next_ordinal_to_read = 0;
9886 let mut next_offset = offset;
9887 let end_offset = offset + bytes_len;
9888 _next_ordinal_to_read += 1;
9889 if next_offset >= end_offset {
9890 return Ok(());
9891 }
9892
9893 while _next_ordinal_to_read < 1 {
9895 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9896 _next_ordinal_to_read += 1;
9897 next_offset += envelope_size;
9898 }
9899
9900 let next_out_of_line = decoder.next_out_of_line();
9901 let handles_before = decoder.remaining_handles();
9902 if let Some((inlined, num_bytes, num_handles)) =
9903 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9904 {
9905 let member_inline_size =
9906 <Object as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9907 if inlined != (member_inline_size <= 4) {
9908 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9909 }
9910 let inner_offset;
9911 let mut inner_depth = depth.clone();
9912 if inlined {
9913 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9914 inner_offset = next_offset;
9915 } else {
9916 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9917 inner_depth.increment()?;
9918 }
9919 let val_ref = self.object.get_or_insert_with(|| {
9920 fidl::new_empty!(Object, fidl::encoding::DefaultFuchsiaResourceDialect)
9921 });
9922 fidl::decode!(
9923 Object,
9924 fidl::encoding::DefaultFuchsiaResourceDialect,
9925 val_ref,
9926 decoder,
9927 inner_offset,
9928 inner_depth
9929 )?;
9930 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9931 {
9932 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9933 }
9934 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9935 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9936 }
9937 }
9938
9939 next_offset += envelope_size;
9940 _next_ordinal_to_read += 1;
9941 if next_offset >= end_offset {
9942 return Ok(());
9943 }
9944
9945 while _next_ordinal_to_read < 2 {
9947 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9948 _next_ordinal_to_read += 1;
9949 next_offset += envelope_size;
9950 }
9951
9952 let next_out_of_line = decoder.next_out_of_line();
9953 let handles_before = decoder.remaining_handles();
9954 if let Some((inlined, num_bytes, num_handles)) =
9955 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9956 {
9957 let member_inline_size =
9958 <ObjectType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9959 if inlined != (member_inline_size <= 4) {
9960 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9961 }
9962 let inner_offset;
9963 let mut inner_depth = depth.clone();
9964 if inlined {
9965 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9966 inner_offset = next_offset;
9967 } else {
9968 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9969 inner_depth.increment()?;
9970 }
9971 let val_ref = self.object_type.get_or_insert_with(|| {
9972 fidl::new_empty!(ObjectType, fidl::encoding::DefaultFuchsiaResourceDialect)
9973 });
9974 fidl::decode!(
9975 ObjectType,
9976 fidl::encoding::DefaultFuchsiaResourceDialect,
9977 val_ref,
9978 decoder,
9979 inner_offset,
9980 inner_depth
9981 )?;
9982 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9983 {
9984 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9985 }
9986 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9987 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9988 }
9989 }
9990
9991 next_offset += envelope_size;
9992 _next_ordinal_to_read += 1;
9993 if next_offset >= end_offset {
9994 return Ok(());
9995 }
9996
9997 while _next_ordinal_to_read < 3 {
9999 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10000 _next_ordinal_to_read += 1;
10001 next_offset += envelope_size;
10002 }
10003
10004 let next_out_of_line = decoder.next_out_of_line();
10005 let handles_before = decoder.remaining_handles();
10006 if let Some((inlined, num_bytes, num_handles)) =
10007 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10008 {
10009 let member_inline_size =
10010 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10011 if inlined != (member_inline_size <= 4) {
10012 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10013 }
10014 let inner_offset;
10015 let mut inner_depth = depth.clone();
10016 if inlined {
10017 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10018 inner_offset = next_offset;
10019 } else {
10020 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10021 inner_depth.increment()?;
10022 }
10023 let val_ref = self.object_id.get_or_insert_with(|| {
10024 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
10025 });
10026 fidl::decode!(
10027 u64,
10028 fidl::encoding::DefaultFuchsiaResourceDialect,
10029 val_ref,
10030 decoder,
10031 inner_offset,
10032 inner_depth
10033 )?;
10034 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10035 {
10036 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10037 }
10038 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10039 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10040 }
10041 }
10042
10043 next_offset += envelope_size;
10044 _next_ordinal_to_read += 1;
10045 if next_offset >= end_offset {
10046 return Ok(());
10047 }
10048
10049 while _next_ordinal_to_read < 4 {
10051 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10052 _next_ordinal_to_read += 1;
10053 next_offset += envelope_size;
10054 }
10055
10056 let next_out_of_line = decoder.next_out_of_line();
10057 let handles_before = decoder.remaining_handles();
10058 if let Some((inlined, num_bytes, num_handles)) =
10059 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10060 {
10061 let member_inline_size =
10062 <ImportFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10063 if inlined != (member_inline_size <= 4) {
10064 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10065 }
10066 let inner_offset;
10067 let mut inner_depth = depth.clone();
10068 if inlined {
10069 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10070 inner_offset = next_offset;
10071 } else {
10072 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10073 inner_depth.increment()?;
10074 }
10075 let val_ref = self.flags.get_or_insert_with(|| {
10076 fidl::new_empty!(ImportFlags, fidl::encoding::DefaultFuchsiaResourceDialect)
10077 });
10078 fidl::decode!(
10079 ImportFlags,
10080 fidl::encoding::DefaultFuchsiaResourceDialect,
10081 val_ref,
10082 decoder,
10083 inner_offset,
10084 inner_depth
10085 )?;
10086 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10087 {
10088 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10089 }
10090 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10091 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10092 }
10093 }
10094
10095 next_offset += envelope_size;
10096
10097 while next_offset < end_offset {
10099 _next_ordinal_to_read += 1;
10100 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10101 next_offset += envelope_size;
10102 }
10103
10104 Ok(())
10105 }
10106 }
10107
10108 impl fidl::encoding::ResourceTypeMarker for DeviceQueryResponse {
10109 type Borrowed<'a> = &'a mut Self;
10110 fn take_or_borrow<'a>(
10111 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10112 ) -> Self::Borrowed<'a> {
10113 value
10114 }
10115 }
10116
10117 unsafe impl fidl::encoding::TypeMarker for DeviceQueryResponse {
10118 type Owned = Self;
10119
10120 #[inline(always)]
10121 fn inline_align(_context: fidl::encoding::Context) -> usize {
10122 8
10123 }
10124
10125 #[inline(always)]
10126 fn inline_size(_context: fidl::encoding::Context) -> usize {
10127 16
10128 }
10129 }
10130
10131 unsafe impl
10132 fidl::encoding::Encode<DeviceQueryResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
10133 for &mut DeviceQueryResponse
10134 {
10135 #[inline]
10136 unsafe fn encode(
10137 self,
10138 encoder: &mut fidl::encoding::Encoder<
10139 '_,
10140 fidl::encoding::DefaultFuchsiaResourceDialect,
10141 >,
10142 offset: usize,
10143 _depth: fidl::encoding::Depth,
10144 ) -> fidl::Result<()> {
10145 encoder.debug_check_bounds::<DeviceQueryResponse>(offset);
10146 encoder.write_num::<u64>(self.ordinal(), offset);
10147 match self {
10148 DeviceQueryResponse::SimpleResult(ref val) => fidl::encoding::encode_in_envelope::<
10149 u64,
10150 fidl::encoding::DefaultFuchsiaResourceDialect,
10151 >(
10152 <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
10153 encoder,
10154 offset + 8,
10155 _depth,
10156 ),
10157 DeviceQueryResponse::BufferResult(ref mut val) => {
10158 fidl::encoding::encode_in_envelope::<
10159 fidl::encoding::HandleType<
10160 fidl::Vmo,
10161 { fidl::ObjectType::VMO.into_raw() },
10162 2147483648,
10163 >,
10164 fidl::encoding::DefaultFuchsiaResourceDialect,
10165 >(
10166 <fidl::encoding::HandleType<
10167 fidl::Vmo,
10168 { fidl::ObjectType::VMO.into_raw() },
10169 2147483648,
10170 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10171 val
10172 ),
10173 encoder,
10174 offset + 8,
10175 _depth,
10176 )
10177 }
10178 }
10179 }
10180 }
10181
10182 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10183 for DeviceQueryResponse
10184 {
10185 #[inline(always)]
10186 fn new_empty() -> Self {
10187 Self::SimpleResult(fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect))
10188 }
10189
10190 #[inline]
10191 unsafe fn decode(
10192 &mut self,
10193 decoder: &mut fidl::encoding::Decoder<
10194 '_,
10195 fidl::encoding::DefaultFuchsiaResourceDialect,
10196 >,
10197 offset: usize,
10198 mut depth: fidl::encoding::Depth,
10199 ) -> fidl::Result<()> {
10200 decoder.debug_check_bounds::<Self>(offset);
10201 #[allow(unused_variables)]
10202 let next_out_of_line = decoder.next_out_of_line();
10203 let handles_before = decoder.remaining_handles();
10204 let (ordinal, inlined, num_bytes, num_handles) =
10205 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10206
10207 let member_inline_size = match ordinal {
10208 1 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10209 2 => <fidl::encoding::HandleType<
10210 fidl::Vmo,
10211 { fidl::ObjectType::VMO.into_raw() },
10212 2147483648,
10213 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10214 _ => return Err(fidl::Error::UnknownUnionTag),
10215 };
10216
10217 if inlined != (member_inline_size <= 4) {
10218 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10219 }
10220 let _inner_offset;
10221 if inlined {
10222 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10223 _inner_offset = offset + 8;
10224 } else {
10225 depth.increment()?;
10226 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10227 }
10228 match ordinal {
10229 1 => {
10230 #[allow(irrefutable_let_patterns)]
10231 if let DeviceQueryResponse::SimpleResult(_) = self {
10232 } else {
10234 *self = DeviceQueryResponse::SimpleResult(fidl::new_empty!(
10236 u64,
10237 fidl::encoding::DefaultFuchsiaResourceDialect
10238 ));
10239 }
10240 #[allow(irrefutable_let_patterns)]
10241 if let DeviceQueryResponse::SimpleResult(ref mut val) = self {
10242 fidl::decode!(
10243 u64,
10244 fidl::encoding::DefaultFuchsiaResourceDialect,
10245 val,
10246 decoder,
10247 _inner_offset,
10248 depth
10249 )?;
10250 } else {
10251 unreachable!()
10252 }
10253 }
10254 2 => {
10255 #[allow(irrefutable_let_patterns)]
10256 if let DeviceQueryResponse::BufferResult(_) = self {
10257 } else {
10259 *self = DeviceQueryResponse::BufferResult(
10261 fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10262 );
10263 }
10264 #[allow(irrefutable_let_patterns)]
10265 if let DeviceQueryResponse::BufferResult(ref mut val) = self {
10266 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
10267 } else {
10268 unreachable!()
10269 }
10270 }
10271 ordinal => panic!("unexpected ordinal {:?}", ordinal),
10272 }
10273 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10274 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10275 }
10276 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10277 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10278 }
10279 Ok(())
10280 }
10281 }
10282
10283 impl fidl::encoding::ResourceTypeMarker for Object {
10284 type Borrowed<'a> = &'a mut Self;
10285 fn take_or_borrow<'a>(
10286 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10287 ) -> Self::Borrowed<'a> {
10288 value
10289 }
10290 }
10291
10292 unsafe impl fidl::encoding::TypeMarker for Object {
10293 type Owned = Self;
10294
10295 #[inline(always)]
10296 fn inline_align(_context: fidl::encoding::Context) -> usize {
10297 8
10298 }
10299
10300 #[inline(always)]
10301 fn inline_size(_context: fidl::encoding::Context) -> usize {
10302 16
10303 }
10304 }
10305
10306 unsafe impl fidl::encoding::Encode<Object, fidl::encoding::DefaultFuchsiaResourceDialect>
10307 for &mut Object
10308 {
10309 #[inline]
10310 unsafe fn encode(
10311 self,
10312 encoder: &mut fidl::encoding::Encoder<
10313 '_,
10314 fidl::encoding::DefaultFuchsiaResourceDialect,
10315 >,
10316 offset: usize,
10317 _depth: fidl::encoding::Depth,
10318 ) -> fidl::Result<()> {
10319 encoder.debug_check_bounds::<Object>(offset);
10320 encoder.write_num::<u64>(self.ordinal(), offset);
10321 match self {
10322 Object::Semaphore(ref mut val) => fidl::encoding::encode_in_envelope::<
10323 fidl::encoding::HandleType<
10324 fidl::Event,
10325 { fidl::ObjectType::EVENT.into_raw() },
10326 2147483648,
10327 >,
10328 fidl::encoding::DefaultFuchsiaResourceDialect,
10329 >(
10330 <fidl::encoding::HandleType<
10331 fidl::Event,
10332 { fidl::ObjectType::EVENT.into_raw() },
10333 2147483648,
10334 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10335 val
10336 ),
10337 encoder,
10338 offset + 8,
10339 _depth,
10340 ),
10341 Object::Buffer(ref mut val) => fidl::encoding::encode_in_envelope::<
10342 fidl::encoding::HandleType<
10343 fidl::Vmo,
10344 { fidl::ObjectType::VMO.into_raw() },
10345 2147483648,
10346 >,
10347 fidl::encoding::DefaultFuchsiaResourceDialect,
10348 >(
10349 <fidl::encoding::HandleType<
10350 fidl::Vmo,
10351 { fidl::ObjectType::VMO.into_raw() },
10352 2147483648,
10353 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10354 val
10355 ),
10356 encoder,
10357 offset + 8,
10358 _depth,
10359 ),
10360 Object::VmoSemaphore(ref mut val) => fidl::encoding::encode_in_envelope::<
10361 fidl::encoding::HandleType<
10362 fidl::Vmo,
10363 { fidl::ObjectType::VMO.into_raw() },
10364 2147483648,
10365 >,
10366 fidl::encoding::DefaultFuchsiaResourceDialect,
10367 >(
10368 <fidl::encoding::HandleType<
10369 fidl::Vmo,
10370 { fidl::ObjectType::VMO.into_raw() },
10371 2147483648,
10372 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10373 val
10374 ),
10375 encoder,
10376 offset + 8,
10377 _depth,
10378 ),
10379 Object::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
10380 }
10381 }
10382 }
10383
10384 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Object {
10385 #[inline(always)]
10386 fn new_empty() -> Self {
10387 Self::__SourceBreaking { unknown_ordinal: 0 }
10388 }
10389
10390 #[inline]
10391 unsafe fn decode(
10392 &mut self,
10393 decoder: &mut fidl::encoding::Decoder<
10394 '_,
10395 fidl::encoding::DefaultFuchsiaResourceDialect,
10396 >,
10397 offset: usize,
10398 mut depth: fidl::encoding::Depth,
10399 ) -> fidl::Result<()> {
10400 decoder.debug_check_bounds::<Self>(offset);
10401 #[allow(unused_variables)]
10402 let next_out_of_line = decoder.next_out_of_line();
10403 let handles_before = decoder.remaining_handles();
10404 let (ordinal, inlined, num_bytes, num_handles) =
10405 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10406
10407 let member_inline_size = match ordinal {
10408 1 => <fidl::encoding::HandleType<
10409 fidl::Event,
10410 { fidl::ObjectType::EVENT.into_raw() },
10411 2147483648,
10412 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10413 2 => <fidl::encoding::HandleType<
10414 fidl::Vmo,
10415 { fidl::ObjectType::VMO.into_raw() },
10416 2147483648,
10417 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10418 3 => <fidl::encoding::HandleType<
10419 fidl::Vmo,
10420 { fidl::ObjectType::VMO.into_raw() },
10421 2147483648,
10422 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10423 0 => return Err(fidl::Error::UnknownUnionTag),
10424 _ => num_bytes as usize,
10425 };
10426
10427 if inlined != (member_inline_size <= 4) {
10428 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10429 }
10430 let _inner_offset;
10431 if inlined {
10432 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10433 _inner_offset = offset + 8;
10434 } else {
10435 depth.increment()?;
10436 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10437 }
10438 match ordinal {
10439 1 => {
10440 #[allow(irrefutable_let_patterns)]
10441 if let Object::Semaphore(_) = self {
10442 } else {
10444 *self = Object::Semaphore(
10446 fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10447 );
10448 }
10449 #[allow(irrefutable_let_patterns)]
10450 if let Object::Semaphore(ref mut val) = self {
10451 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
10452 } else {
10453 unreachable!()
10454 }
10455 }
10456 2 => {
10457 #[allow(irrefutable_let_patterns)]
10458 if let Object::Buffer(_) = self {
10459 } else {
10461 *self = Object::Buffer(
10463 fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10464 );
10465 }
10466 #[allow(irrefutable_let_patterns)]
10467 if let Object::Buffer(ref mut val) = self {
10468 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
10469 } else {
10470 unreachable!()
10471 }
10472 }
10473 3 => {
10474 #[allow(irrefutable_let_patterns)]
10475 if let Object::VmoSemaphore(_) = self {
10476 } else {
10478 *self = Object::VmoSemaphore(
10480 fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10481 );
10482 }
10483 #[allow(irrefutable_let_patterns)]
10484 if let Object::VmoSemaphore(ref mut val) = self {
10485 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
10486 } else {
10487 unreachable!()
10488 }
10489 }
10490 #[allow(deprecated)]
10491 ordinal => {
10492 for _ in 0..num_handles {
10493 decoder.drop_next_handle()?;
10494 }
10495 *self = Object::__SourceBreaking { unknown_ordinal: ordinal };
10496 }
10497 }
10498 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10499 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10500 }
10501 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10502 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10503 }
10504 Ok(())
10505 }
10506 }
10507}