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_kernel_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct CounterGetInspectVmoResponse {
16 pub status: i32,
17 pub buffer: fidl_fuchsia_mem::Buffer,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for CounterGetInspectVmoResponse
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct CpuResourceGetResponse {
27 pub resource: fidl::Resource,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CpuResourceGetResponse {}
31
32#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33pub struct DebugResourceGetResponse {
34 pub resource: fidl::Resource,
35}
36
37impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DebugResourceGetResponse {}
38
39#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
40pub struct DebuglogResourceGetResponse {
41 pub resource: fidl::Resource,
42}
43
44impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
45 for DebuglogResourceGetResponse
46{
47}
48
49#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
50pub struct EnergyInfoResourceGetResponse {
51 pub resource: fidl::Resource,
52}
53
54impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
55 for EnergyInfoResourceGetResponse
56{
57}
58
59#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
60pub struct HypervisorResourceGetResponse {
61 pub resource: fidl::Resource,
62}
63
64impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
65 for HypervisorResourceGetResponse
66{
67}
68
69#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct InfoResourceGetResponse {
71 pub resource: fidl::Resource,
72}
73
74impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InfoResourceGetResponse {}
75
76#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
77pub struct IommuResourceGetResponse {
78 pub resource: fidl::Resource,
79}
80
81impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for IommuResourceGetResponse {}
82
83#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
84pub struct IoportResourceGetResponse {
85 pub resource: fidl::Resource,
86}
87
88impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for IoportResourceGetResponse {}
89
90#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
91pub struct IrqResourceGetResponse {
92 pub resource: fidl::Resource,
93}
94
95impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for IrqResourceGetResponse {}
96
97#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
98pub struct MexecResourceGetResponse {
99 pub resource: fidl::Resource,
100}
101
102impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for MexecResourceGetResponse {}
103
104#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105pub struct MmioResourceGetResponse {
106 pub resource: fidl::Resource,
107}
108
109impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for MmioResourceGetResponse {}
110
111#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
112pub struct MsiResourceGetResponse {
113 pub resource: fidl::Resource,
114}
115
116impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for MsiResourceGetResponse {}
117
118#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
119pub struct PowerResourceGetResponse {
120 pub resource: fidl::Resource,
121}
122
123impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PowerResourceGetResponse {}
124
125#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
126pub struct ProfileResourceGetResponse {
127 pub resource: fidl::Resource,
128}
129
130impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
131 for ProfileResourceGetResponse
132{
133}
134
135#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
136pub struct RootJobGetResponse {
137 pub job: fidl::Job,
138}
139
140impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RootJobGetResponse {}
141
142#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
143pub struct SmcResourceGetResponse {
144 pub resource: fidl::Resource,
145}
146
147impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SmcResourceGetResponse {}
148
149#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
150pub struct StallResourceGetResponse {
151 pub resource: fidl::Resource,
152}
153
154impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StallResourceGetResponse {}
155
156#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157pub struct TracingResourceGetResponse {
158 pub resource: fidl::Resource,
159}
160
161impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
162 for TracingResourceGetResponse
163{
164}
165
166#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
167pub struct VmexResourceGetResponse {
168 pub resource: fidl::Resource,
169}
170
171impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VmexResourceGetResponse {}
172
173#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
174pub struct CounterMarker;
175
176impl fidl::endpoints::ProtocolMarker for CounterMarker {
177 type Proxy = CounterProxy;
178 type RequestStream = CounterRequestStream;
179 #[cfg(target_os = "fuchsia")]
180 type SynchronousProxy = CounterSynchronousProxy;
181
182 const DEBUG_NAME: &'static str = "fuchsia.kernel.Counter";
183}
184impl fidl::endpoints::DiscoverableProtocolMarker for CounterMarker {}
185
186pub trait CounterProxyInterface: Send + Sync {
187 type GetInspectVmoResponseFut: std::future::Future<Output = Result<(i32, fidl_fuchsia_mem::Buffer), fidl::Error>>
188 + Send;
189 fn r#get_inspect_vmo(&self) -> Self::GetInspectVmoResponseFut;
190 type UpdateInspectVmoResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
191 fn r#update_inspect_vmo(&self) -> Self::UpdateInspectVmoResponseFut;
192}
193#[derive(Debug)]
194#[cfg(target_os = "fuchsia")]
195pub struct CounterSynchronousProxy {
196 client: fidl::client::sync::Client,
197}
198
199#[cfg(target_os = "fuchsia")]
200impl fidl::endpoints::SynchronousProxy for CounterSynchronousProxy {
201 type Proxy = CounterProxy;
202 type Protocol = CounterMarker;
203
204 fn from_channel(inner: fidl::Channel) -> Self {
205 Self::new(inner)
206 }
207
208 fn into_channel(self) -> fidl::Channel {
209 self.client.into_channel()
210 }
211
212 fn as_channel(&self) -> &fidl::Channel {
213 self.client.as_channel()
214 }
215}
216
217#[cfg(target_os = "fuchsia")]
218impl CounterSynchronousProxy {
219 pub fn new(channel: fidl::Channel) -> Self {
220 let protocol_name = <CounterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
221 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
222 }
223
224 pub fn into_channel(self) -> fidl::Channel {
225 self.client.into_channel()
226 }
227
228 pub fn wait_for_event(
231 &self,
232 deadline: zx::MonotonicInstant,
233 ) -> Result<CounterEvent, fidl::Error> {
234 CounterEvent::decode(self.client.wait_for_event(deadline)?)
235 }
236
237 pub fn r#get_inspect_vmo(
240 &self,
241 ___deadline: zx::MonotonicInstant,
242 ) -> Result<(i32, fidl_fuchsia_mem::Buffer), fidl::Error> {
243 let _response =
244 self.client.send_query::<fidl::encoding::EmptyPayload, CounterGetInspectVmoResponse>(
245 (),
246 0x6ea9b2e6b2791b81,
247 fidl::encoding::DynamicFlags::empty(),
248 ___deadline,
249 )?;
250 Ok((_response.status, _response.buffer))
251 }
252
253 pub fn r#update_inspect_vmo(
257 &self,
258 ___deadline: zx::MonotonicInstant,
259 ) -> Result<i32, fidl::Error> {
260 let _response = self
261 .client
262 .send_query::<fidl::encoding::EmptyPayload, CounterUpdateInspectVmoResponse>(
263 (),
264 0x1d25eb7995a0539f,
265 fidl::encoding::DynamicFlags::empty(),
266 ___deadline,
267 )?;
268 Ok(_response.status)
269 }
270}
271
272#[cfg(target_os = "fuchsia")]
273impl From<CounterSynchronousProxy> for zx::Handle {
274 fn from(value: CounterSynchronousProxy) -> Self {
275 value.into_channel().into()
276 }
277}
278
279#[cfg(target_os = "fuchsia")]
280impl From<fidl::Channel> for CounterSynchronousProxy {
281 fn from(value: fidl::Channel) -> Self {
282 Self::new(value)
283 }
284}
285
286#[derive(Debug, Clone)]
287pub struct CounterProxy {
288 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
289}
290
291impl fidl::endpoints::Proxy for CounterProxy {
292 type Protocol = CounterMarker;
293
294 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
295 Self::new(inner)
296 }
297
298 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
299 self.client.into_channel().map_err(|client| Self { client })
300 }
301
302 fn as_channel(&self) -> &::fidl::AsyncChannel {
303 self.client.as_channel()
304 }
305}
306
307impl CounterProxy {
308 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
310 let protocol_name = <CounterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
311 Self { client: fidl::client::Client::new(channel, protocol_name) }
312 }
313
314 pub fn take_event_stream(&self) -> CounterEventStream {
320 CounterEventStream { event_receiver: self.client.take_event_receiver() }
321 }
322
323 pub fn r#get_inspect_vmo(
326 &self,
327 ) -> fidl::client::QueryResponseFut<
328 (i32, fidl_fuchsia_mem::Buffer),
329 fidl::encoding::DefaultFuchsiaResourceDialect,
330 > {
331 CounterProxyInterface::r#get_inspect_vmo(self)
332 }
333
334 pub fn r#update_inspect_vmo(
338 &self,
339 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
340 CounterProxyInterface::r#update_inspect_vmo(self)
341 }
342}
343
344impl CounterProxyInterface for CounterProxy {
345 type GetInspectVmoResponseFut = fidl::client::QueryResponseFut<
346 (i32, fidl_fuchsia_mem::Buffer),
347 fidl::encoding::DefaultFuchsiaResourceDialect,
348 >;
349 fn r#get_inspect_vmo(&self) -> Self::GetInspectVmoResponseFut {
350 fn _decode(
351 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
352 ) -> Result<(i32, fidl_fuchsia_mem::Buffer), fidl::Error> {
353 let _response = fidl::client::decode_transaction_body::<
354 CounterGetInspectVmoResponse,
355 fidl::encoding::DefaultFuchsiaResourceDialect,
356 0x6ea9b2e6b2791b81,
357 >(_buf?)?;
358 Ok((_response.status, _response.buffer))
359 }
360 self.client
361 .send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, fidl_fuchsia_mem::Buffer)>(
362 (),
363 0x6ea9b2e6b2791b81,
364 fidl::encoding::DynamicFlags::empty(),
365 _decode,
366 )
367 }
368
369 type UpdateInspectVmoResponseFut =
370 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
371 fn r#update_inspect_vmo(&self) -> Self::UpdateInspectVmoResponseFut {
372 fn _decode(
373 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
374 ) -> Result<i32, fidl::Error> {
375 let _response = fidl::client::decode_transaction_body::<
376 CounterUpdateInspectVmoResponse,
377 fidl::encoding::DefaultFuchsiaResourceDialect,
378 0x1d25eb7995a0539f,
379 >(_buf?)?;
380 Ok(_response.status)
381 }
382 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
383 (),
384 0x1d25eb7995a0539f,
385 fidl::encoding::DynamicFlags::empty(),
386 _decode,
387 )
388 }
389}
390
391pub struct CounterEventStream {
392 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
393}
394
395impl std::marker::Unpin for CounterEventStream {}
396
397impl futures::stream::FusedStream for CounterEventStream {
398 fn is_terminated(&self) -> bool {
399 self.event_receiver.is_terminated()
400 }
401}
402
403impl futures::Stream for CounterEventStream {
404 type Item = Result<CounterEvent, fidl::Error>;
405
406 fn poll_next(
407 mut self: std::pin::Pin<&mut Self>,
408 cx: &mut std::task::Context<'_>,
409 ) -> std::task::Poll<Option<Self::Item>> {
410 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
411 &mut self.event_receiver,
412 cx
413 )?) {
414 Some(buf) => std::task::Poll::Ready(Some(CounterEvent::decode(buf))),
415 None => std::task::Poll::Ready(None),
416 }
417 }
418}
419
420#[derive(Debug)]
421pub enum CounterEvent {}
422
423impl CounterEvent {
424 fn decode(
426 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
427 ) -> Result<CounterEvent, fidl::Error> {
428 let (bytes, _handles) = buf.split_mut();
429 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
430 debug_assert_eq!(tx_header.tx_id, 0);
431 match tx_header.ordinal {
432 _ => Err(fidl::Error::UnknownOrdinal {
433 ordinal: tx_header.ordinal,
434 protocol_name: <CounterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
435 }),
436 }
437 }
438}
439
440pub struct CounterRequestStream {
442 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
443 is_terminated: bool,
444}
445
446impl std::marker::Unpin for CounterRequestStream {}
447
448impl futures::stream::FusedStream for CounterRequestStream {
449 fn is_terminated(&self) -> bool {
450 self.is_terminated
451 }
452}
453
454impl fidl::endpoints::RequestStream for CounterRequestStream {
455 type Protocol = CounterMarker;
456 type ControlHandle = CounterControlHandle;
457
458 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
459 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
460 }
461
462 fn control_handle(&self) -> Self::ControlHandle {
463 CounterControlHandle { inner: self.inner.clone() }
464 }
465
466 fn into_inner(
467 self,
468 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
469 {
470 (self.inner, self.is_terminated)
471 }
472
473 fn from_inner(
474 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
475 is_terminated: bool,
476 ) -> Self {
477 Self { inner, is_terminated }
478 }
479}
480
481impl futures::Stream for CounterRequestStream {
482 type Item = Result<CounterRequest, fidl::Error>;
483
484 fn poll_next(
485 mut self: std::pin::Pin<&mut Self>,
486 cx: &mut std::task::Context<'_>,
487 ) -> std::task::Poll<Option<Self::Item>> {
488 let this = &mut *self;
489 if this.inner.check_shutdown(cx) {
490 this.is_terminated = true;
491 return std::task::Poll::Ready(None);
492 }
493 if this.is_terminated {
494 panic!("polled CounterRequestStream after completion");
495 }
496 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
497 |bytes, handles| {
498 match this.inner.channel().read_etc(cx, bytes, handles) {
499 std::task::Poll::Ready(Ok(())) => {}
500 std::task::Poll::Pending => return std::task::Poll::Pending,
501 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
502 this.is_terminated = true;
503 return std::task::Poll::Ready(None);
504 }
505 std::task::Poll::Ready(Err(e)) => {
506 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
507 e.into(),
508 ))))
509 }
510 }
511
512 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
514
515 std::task::Poll::Ready(Some(match header.ordinal {
516 0x6ea9b2e6b2791b81 => {
517 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
518 let mut req = fidl::new_empty!(
519 fidl::encoding::EmptyPayload,
520 fidl::encoding::DefaultFuchsiaResourceDialect
521 );
522 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
523 let control_handle = CounterControlHandle { inner: this.inner.clone() };
524 Ok(CounterRequest::GetInspectVmo {
525 responder: CounterGetInspectVmoResponder {
526 control_handle: std::mem::ManuallyDrop::new(control_handle),
527 tx_id: header.tx_id,
528 },
529 })
530 }
531 0x1d25eb7995a0539f => {
532 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
533 let mut req = fidl::new_empty!(
534 fidl::encoding::EmptyPayload,
535 fidl::encoding::DefaultFuchsiaResourceDialect
536 );
537 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
538 let control_handle = CounterControlHandle { inner: this.inner.clone() };
539 Ok(CounterRequest::UpdateInspectVmo {
540 responder: CounterUpdateInspectVmoResponder {
541 control_handle: std::mem::ManuallyDrop::new(control_handle),
542 tx_id: header.tx_id,
543 },
544 })
545 }
546 _ => Err(fidl::Error::UnknownOrdinal {
547 ordinal: header.ordinal,
548 protocol_name:
549 <CounterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
550 }),
551 }))
552 },
553 )
554 }
555}
556
557#[derive(Debug)]
559pub enum CounterRequest {
560 GetInspectVmo { responder: CounterGetInspectVmoResponder },
563 UpdateInspectVmo { responder: CounterUpdateInspectVmoResponder },
567}
568
569impl CounterRequest {
570 #[allow(irrefutable_let_patterns)]
571 pub fn into_get_inspect_vmo(self) -> Option<(CounterGetInspectVmoResponder)> {
572 if let CounterRequest::GetInspectVmo { responder } = self {
573 Some((responder))
574 } else {
575 None
576 }
577 }
578
579 #[allow(irrefutable_let_patterns)]
580 pub fn into_update_inspect_vmo(self) -> Option<(CounterUpdateInspectVmoResponder)> {
581 if let CounterRequest::UpdateInspectVmo { responder } = self {
582 Some((responder))
583 } else {
584 None
585 }
586 }
587
588 pub fn method_name(&self) -> &'static str {
590 match *self {
591 CounterRequest::GetInspectVmo { .. } => "get_inspect_vmo",
592 CounterRequest::UpdateInspectVmo { .. } => "update_inspect_vmo",
593 }
594 }
595}
596
597#[derive(Debug, Clone)]
598pub struct CounterControlHandle {
599 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
600}
601
602impl fidl::endpoints::ControlHandle for CounterControlHandle {
603 fn shutdown(&self) {
604 self.inner.shutdown()
605 }
606 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
607 self.inner.shutdown_with_epitaph(status)
608 }
609
610 fn is_closed(&self) -> bool {
611 self.inner.channel().is_closed()
612 }
613 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
614 self.inner.channel().on_closed()
615 }
616
617 #[cfg(target_os = "fuchsia")]
618 fn signal_peer(
619 &self,
620 clear_mask: zx::Signals,
621 set_mask: zx::Signals,
622 ) -> Result<(), zx_status::Status> {
623 use fidl::Peered;
624 self.inner.channel().signal_peer(clear_mask, set_mask)
625 }
626}
627
628impl CounterControlHandle {}
629
630#[must_use = "FIDL methods require a response to be sent"]
631#[derive(Debug)]
632pub struct CounterGetInspectVmoResponder {
633 control_handle: std::mem::ManuallyDrop<CounterControlHandle>,
634 tx_id: u32,
635}
636
637impl std::ops::Drop for CounterGetInspectVmoResponder {
641 fn drop(&mut self) {
642 self.control_handle.shutdown();
643 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
645 }
646}
647
648impl fidl::endpoints::Responder for CounterGetInspectVmoResponder {
649 type ControlHandle = CounterControlHandle;
650
651 fn control_handle(&self) -> &CounterControlHandle {
652 &self.control_handle
653 }
654
655 fn drop_without_shutdown(mut self) {
656 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
658 std::mem::forget(self);
660 }
661}
662
663impl CounterGetInspectVmoResponder {
664 pub fn send(
668 self,
669 mut status: i32,
670 mut buffer: fidl_fuchsia_mem::Buffer,
671 ) -> Result<(), fidl::Error> {
672 let _result = self.send_raw(status, buffer);
673 if _result.is_err() {
674 self.control_handle.shutdown();
675 }
676 self.drop_without_shutdown();
677 _result
678 }
679
680 pub fn send_no_shutdown_on_err(
682 self,
683 mut status: i32,
684 mut buffer: fidl_fuchsia_mem::Buffer,
685 ) -> Result<(), fidl::Error> {
686 let _result = self.send_raw(status, buffer);
687 self.drop_without_shutdown();
688 _result
689 }
690
691 fn send_raw(
692 &self,
693 mut status: i32,
694 mut buffer: fidl_fuchsia_mem::Buffer,
695 ) -> Result<(), fidl::Error> {
696 self.control_handle.inner.send::<CounterGetInspectVmoResponse>(
697 (status, &mut buffer),
698 self.tx_id,
699 0x6ea9b2e6b2791b81,
700 fidl::encoding::DynamicFlags::empty(),
701 )
702 }
703}
704
705#[must_use = "FIDL methods require a response to be sent"]
706#[derive(Debug)]
707pub struct CounterUpdateInspectVmoResponder {
708 control_handle: std::mem::ManuallyDrop<CounterControlHandle>,
709 tx_id: u32,
710}
711
712impl std::ops::Drop for CounterUpdateInspectVmoResponder {
716 fn drop(&mut self) {
717 self.control_handle.shutdown();
718 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
720 }
721}
722
723impl fidl::endpoints::Responder for CounterUpdateInspectVmoResponder {
724 type ControlHandle = CounterControlHandle;
725
726 fn control_handle(&self) -> &CounterControlHandle {
727 &self.control_handle
728 }
729
730 fn drop_without_shutdown(mut self) {
731 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
733 std::mem::forget(self);
735 }
736}
737
738impl CounterUpdateInspectVmoResponder {
739 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
743 let _result = self.send_raw(status);
744 if _result.is_err() {
745 self.control_handle.shutdown();
746 }
747 self.drop_without_shutdown();
748 _result
749 }
750
751 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
753 let _result = self.send_raw(status);
754 self.drop_without_shutdown();
755 _result
756 }
757
758 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
759 self.control_handle.inner.send::<CounterUpdateInspectVmoResponse>(
760 (status,),
761 self.tx_id,
762 0x1d25eb7995a0539f,
763 fidl::encoding::DynamicFlags::empty(),
764 )
765 }
766}
767
768#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
769pub struct CpuResourceMarker;
770
771impl fidl::endpoints::ProtocolMarker for CpuResourceMarker {
772 type Proxy = CpuResourceProxy;
773 type RequestStream = CpuResourceRequestStream;
774 #[cfg(target_os = "fuchsia")]
775 type SynchronousProxy = CpuResourceSynchronousProxy;
776
777 const DEBUG_NAME: &'static str = "fuchsia.kernel.CpuResource";
778}
779impl fidl::endpoints::DiscoverableProtocolMarker for CpuResourceMarker {}
780
781pub trait CpuResourceProxyInterface: Send + Sync {
782 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
783 fn r#get(&self) -> Self::GetResponseFut;
784}
785#[derive(Debug)]
786#[cfg(target_os = "fuchsia")]
787pub struct CpuResourceSynchronousProxy {
788 client: fidl::client::sync::Client,
789}
790
791#[cfg(target_os = "fuchsia")]
792impl fidl::endpoints::SynchronousProxy for CpuResourceSynchronousProxy {
793 type Proxy = CpuResourceProxy;
794 type Protocol = CpuResourceMarker;
795
796 fn from_channel(inner: fidl::Channel) -> Self {
797 Self::new(inner)
798 }
799
800 fn into_channel(self) -> fidl::Channel {
801 self.client.into_channel()
802 }
803
804 fn as_channel(&self) -> &fidl::Channel {
805 self.client.as_channel()
806 }
807}
808
809#[cfg(target_os = "fuchsia")]
810impl CpuResourceSynchronousProxy {
811 pub fn new(channel: fidl::Channel) -> Self {
812 let protocol_name = <CpuResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
813 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
814 }
815
816 pub fn into_channel(self) -> fidl::Channel {
817 self.client.into_channel()
818 }
819
820 pub fn wait_for_event(
823 &self,
824 deadline: zx::MonotonicInstant,
825 ) -> Result<CpuResourceEvent, fidl::Error> {
826 CpuResourceEvent::decode(self.client.wait_for_event(deadline)?)
827 }
828
829 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
831 let _response =
832 self.client.send_query::<fidl::encoding::EmptyPayload, CpuResourceGetResponse>(
833 (),
834 0x41e1103acf4215e4,
835 fidl::encoding::DynamicFlags::empty(),
836 ___deadline,
837 )?;
838 Ok(_response.resource)
839 }
840}
841
842#[cfg(target_os = "fuchsia")]
843impl From<CpuResourceSynchronousProxy> for zx::Handle {
844 fn from(value: CpuResourceSynchronousProxy) -> Self {
845 value.into_channel().into()
846 }
847}
848
849#[cfg(target_os = "fuchsia")]
850impl From<fidl::Channel> for CpuResourceSynchronousProxy {
851 fn from(value: fidl::Channel) -> Self {
852 Self::new(value)
853 }
854}
855
856#[derive(Debug, Clone)]
857pub struct CpuResourceProxy {
858 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
859}
860
861impl fidl::endpoints::Proxy for CpuResourceProxy {
862 type Protocol = CpuResourceMarker;
863
864 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
865 Self::new(inner)
866 }
867
868 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
869 self.client.into_channel().map_err(|client| Self { client })
870 }
871
872 fn as_channel(&self) -> &::fidl::AsyncChannel {
873 self.client.as_channel()
874 }
875}
876
877impl CpuResourceProxy {
878 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
880 let protocol_name = <CpuResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
881 Self { client: fidl::client::Client::new(channel, protocol_name) }
882 }
883
884 pub fn take_event_stream(&self) -> CpuResourceEventStream {
890 CpuResourceEventStream { event_receiver: self.client.take_event_receiver() }
891 }
892
893 pub fn r#get(
895 &self,
896 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
897 {
898 CpuResourceProxyInterface::r#get(self)
899 }
900}
901
902impl CpuResourceProxyInterface for CpuResourceProxy {
903 type GetResponseFut = fidl::client::QueryResponseFut<
904 fidl::Resource,
905 fidl::encoding::DefaultFuchsiaResourceDialect,
906 >;
907 fn r#get(&self) -> Self::GetResponseFut {
908 fn _decode(
909 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
910 ) -> Result<fidl::Resource, fidl::Error> {
911 let _response = fidl::client::decode_transaction_body::<
912 CpuResourceGetResponse,
913 fidl::encoding::DefaultFuchsiaResourceDialect,
914 0x41e1103acf4215e4,
915 >(_buf?)?;
916 Ok(_response.resource)
917 }
918 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
919 (),
920 0x41e1103acf4215e4,
921 fidl::encoding::DynamicFlags::empty(),
922 _decode,
923 )
924 }
925}
926
927pub struct CpuResourceEventStream {
928 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
929}
930
931impl std::marker::Unpin for CpuResourceEventStream {}
932
933impl futures::stream::FusedStream for CpuResourceEventStream {
934 fn is_terminated(&self) -> bool {
935 self.event_receiver.is_terminated()
936 }
937}
938
939impl futures::Stream for CpuResourceEventStream {
940 type Item = Result<CpuResourceEvent, fidl::Error>;
941
942 fn poll_next(
943 mut self: std::pin::Pin<&mut Self>,
944 cx: &mut std::task::Context<'_>,
945 ) -> std::task::Poll<Option<Self::Item>> {
946 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
947 &mut self.event_receiver,
948 cx
949 )?) {
950 Some(buf) => std::task::Poll::Ready(Some(CpuResourceEvent::decode(buf))),
951 None => std::task::Poll::Ready(None),
952 }
953 }
954}
955
956#[derive(Debug)]
957pub enum CpuResourceEvent {}
958
959impl CpuResourceEvent {
960 fn decode(
962 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
963 ) -> Result<CpuResourceEvent, fidl::Error> {
964 let (bytes, _handles) = buf.split_mut();
965 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
966 debug_assert_eq!(tx_header.tx_id, 0);
967 match tx_header.ordinal {
968 _ => Err(fidl::Error::UnknownOrdinal {
969 ordinal: tx_header.ordinal,
970 protocol_name: <CpuResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
971 }),
972 }
973 }
974}
975
976pub struct CpuResourceRequestStream {
978 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
979 is_terminated: bool,
980}
981
982impl std::marker::Unpin for CpuResourceRequestStream {}
983
984impl futures::stream::FusedStream for CpuResourceRequestStream {
985 fn is_terminated(&self) -> bool {
986 self.is_terminated
987 }
988}
989
990impl fidl::endpoints::RequestStream for CpuResourceRequestStream {
991 type Protocol = CpuResourceMarker;
992 type ControlHandle = CpuResourceControlHandle;
993
994 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
995 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
996 }
997
998 fn control_handle(&self) -> Self::ControlHandle {
999 CpuResourceControlHandle { inner: self.inner.clone() }
1000 }
1001
1002 fn into_inner(
1003 self,
1004 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1005 {
1006 (self.inner, self.is_terminated)
1007 }
1008
1009 fn from_inner(
1010 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1011 is_terminated: bool,
1012 ) -> Self {
1013 Self { inner, is_terminated }
1014 }
1015}
1016
1017impl futures::Stream for CpuResourceRequestStream {
1018 type Item = Result<CpuResourceRequest, fidl::Error>;
1019
1020 fn poll_next(
1021 mut self: std::pin::Pin<&mut Self>,
1022 cx: &mut std::task::Context<'_>,
1023 ) -> std::task::Poll<Option<Self::Item>> {
1024 let this = &mut *self;
1025 if this.inner.check_shutdown(cx) {
1026 this.is_terminated = true;
1027 return std::task::Poll::Ready(None);
1028 }
1029 if this.is_terminated {
1030 panic!("polled CpuResourceRequestStream after completion");
1031 }
1032 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1033 |bytes, handles| {
1034 match this.inner.channel().read_etc(cx, bytes, handles) {
1035 std::task::Poll::Ready(Ok(())) => {}
1036 std::task::Poll::Pending => return std::task::Poll::Pending,
1037 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1038 this.is_terminated = true;
1039 return std::task::Poll::Ready(None);
1040 }
1041 std::task::Poll::Ready(Err(e)) => {
1042 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1043 e.into(),
1044 ))))
1045 }
1046 }
1047
1048 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1050
1051 std::task::Poll::Ready(Some(match header.ordinal {
1052 0x41e1103acf4215e4 => {
1053 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1054 let mut req = fidl::new_empty!(
1055 fidl::encoding::EmptyPayload,
1056 fidl::encoding::DefaultFuchsiaResourceDialect
1057 );
1058 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1059 let control_handle = CpuResourceControlHandle { inner: this.inner.clone() };
1060 Ok(CpuResourceRequest::Get {
1061 responder: CpuResourceGetResponder {
1062 control_handle: std::mem::ManuallyDrop::new(control_handle),
1063 tx_id: header.tx_id,
1064 },
1065 })
1066 }
1067 _ => Err(fidl::Error::UnknownOrdinal {
1068 ordinal: header.ordinal,
1069 protocol_name:
1070 <CpuResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1071 }),
1072 }))
1073 },
1074 )
1075 }
1076}
1077
1078#[derive(Debug)]
1081pub enum CpuResourceRequest {
1082 Get { responder: CpuResourceGetResponder },
1084}
1085
1086impl CpuResourceRequest {
1087 #[allow(irrefutable_let_patterns)]
1088 pub fn into_get(self) -> Option<(CpuResourceGetResponder)> {
1089 if let CpuResourceRequest::Get { responder } = self {
1090 Some((responder))
1091 } else {
1092 None
1093 }
1094 }
1095
1096 pub fn method_name(&self) -> &'static str {
1098 match *self {
1099 CpuResourceRequest::Get { .. } => "get",
1100 }
1101 }
1102}
1103
1104#[derive(Debug, Clone)]
1105pub struct CpuResourceControlHandle {
1106 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1107}
1108
1109impl fidl::endpoints::ControlHandle for CpuResourceControlHandle {
1110 fn shutdown(&self) {
1111 self.inner.shutdown()
1112 }
1113 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1114 self.inner.shutdown_with_epitaph(status)
1115 }
1116
1117 fn is_closed(&self) -> bool {
1118 self.inner.channel().is_closed()
1119 }
1120 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1121 self.inner.channel().on_closed()
1122 }
1123
1124 #[cfg(target_os = "fuchsia")]
1125 fn signal_peer(
1126 &self,
1127 clear_mask: zx::Signals,
1128 set_mask: zx::Signals,
1129 ) -> Result<(), zx_status::Status> {
1130 use fidl::Peered;
1131 self.inner.channel().signal_peer(clear_mask, set_mask)
1132 }
1133}
1134
1135impl CpuResourceControlHandle {}
1136
1137#[must_use = "FIDL methods require a response to be sent"]
1138#[derive(Debug)]
1139pub struct CpuResourceGetResponder {
1140 control_handle: std::mem::ManuallyDrop<CpuResourceControlHandle>,
1141 tx_id: u32,
1142}
1143
1144impl std::ops::Drop for CpuResourceGetResponder {
1148 fn drop(&mut self) {
1149 self.control_handle.shutdown();
1150 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1152 }
1153}
1154
1155impl fidl::endpoints::Responder for CpuResourceGetResponder {
1156 type ControlHandle = CpuResourceControlHandle;
1157
1158 fn control_handle(&self) -> &CpuResourceControlHandle {
1159 &self.control_handle
1160 }
1161
1162 fn drop_without_shutdown(mut self) {
1163 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1165 std::mem::forget(self);
1167 }
1168}
1169
1170impl CpuResourceGetResponder {
1171 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
1175 let _result = self.send_raw(resource);
1176 if _result.is_err() {
1177 self.control_handle.shutdown();
1178 }
1179 self.drop_without_shutdown();
1180 _result
1181 }
1182
1183 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
1185 let _result = self.send_raw(resource);
1186 self.drop_without_shutdown();
1187 _result
1188 }
1189
1190 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
1191 self.control_handle.inner.send::<CpuResourceGetResponse>(
1192 (resource,),
1193 self.tx_id,
1194 0x41e1103acf4215e4,
1195 fidl::encoding::DynamicFlags::empty(),
1196 )
1197 }
1198}
1199
1200#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1201pub struct DebugBrokerMarker;
1202
1203impl fidl::endpoints::ProtocolMarker for DebugBrokerMarker {
1204 type Proxy = DebugBrokerProxy;
1205 type RequestStream = DebugBrokerRequestStream;
1206 #[cfg(target_os = "fuchsia")]
1207 type SynchronousProxy = DebugBrokerSynchronousProxy;
1208
1209 const DEBUG_NAME: &'static str = "fuchsia.kernel.DebugBroker";
1210}
1211impl fidl::endpoints::DiscoverableProtocolMarker for DebugBrokerMarker {}
1212
1213pub trait DebugBrokerProxyInterface: Send + Sync {
1214 type SendDebugCommandResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1215 fn r#send_debug_command(&self, command: &str) -> Self::SendDebugCommandResponseFut;
1216 type SetTracingEnabledResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
1217 fn r#set_tracing_enabled(&self, enabled: bool) -> Self::SetTracingEnabledResponseFut;
1218}
1219#[derive(Debug)]
1220#[cfg(target_os = "fuchsia")]
1221pub struct DebugBrokerSynchronousProxy {
1222 client: fidl::client::sync::Client,
1223}
1224
1225#[cfg(target_os = "fuchsia")]
1226impl fidl::endpoints::SynchronousProxy for DebugBrokerSynchronousProxy {
1227 type Proxy = DebugBrokerProxy;
1228 type Protocol = DebugBrokerMarker;
1229
1230 fn from_channel(inner: fidl::Channel) -> Self {
1231 Self::new(inner)
1232 }
1233
1234 fn into_channel(self) -> fidl::Channel {
1235 self.client.into_channel()
1236 }
1237
1238 fn as_channel(&self) -> &fidl::Channel {
1239 self.client.as_channel()
1240 }
1241}
1242
1243#[cfg(target_os = "fuchsia")]
1244impl DebugBrokerSynchronousProxy {
1245 pub fn new(channel: fidl::Channel) -> Self {
1246 let protocol_name = <DebugBrokerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1247 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1248 }
1249
1250 pub fn into_channel(self) -> fidl::Channel {
1251 self.client.into_channel()
1252 }
1253
1254 pub fn wait_for_event(
1257 &self,
1258 deadline: zx::MonotonicInstant,
1259 ) -> Result<DebugBrokerEvent, fidl::Error> {
1260 DebugBrokerEvent::decode(self.client.wait_for_event(deadline)?)
1261 }
1262
1263 pub fn r#send_debug_command(
1266 &self,
1267 mut command: &str,
1268 ___deadline: zx::MonotonicInstant,
1269 ) -> Result<i32, fidl::Error> {
1270 let _response = self
1271 .client
1272 .send_query::<DebugBrokerSendDebugCommandRequest, DebugBrokerSendDebugCommandResponse>(
1273 (command,),
1274 0x1ee270f83b5d6ff6,
1275 fidl::encoding::DynamicFlags::empty(),
1276 ___deadline,
1277 )?;
1278 Ok(_response.status)
1279 }
1280
1281 pub fn r#set_tracing_enabled(
1283 &self,
1284 mut enabled: bool,
1285 ___deadline: zx::MonotonicInstant,
1286 ) -> Result<i32, fidl::Error> {
1287 let _response = self.client.send_query::<
1288 DebugBrokerSetTracingEnabledRequest,
1289 DebugBrokerSetTracingEnabledResponse,
1290 >(
1291 (enabled,),
1292 0x12e368d05329b30e,
1293 fidl::encoding::DynamicFlags::empty(),
1294 ___deadline,
1295 )?;
1296 Ok(_response.status)
1297 }
1298}
1299
1300#[cfg(target_os = "fuchsia")]
1301impl From<DebugBrokerSynchronousProxy> for zx::Handle {
1302 fn from(value: DebugBrokerSynchronousProxy) -> Self {
1303 value.into_channel().into()
1304 }
1305}
1306
1307#[cfg(target_os = "fuchsia")]
1308impl From<fidl::Channel> for DebugBrokerSynchronousProxy {
1309 fn from(value: fidl::Channel) -> Self {
1310 Self::new(value)
1311 }
1312}
1313
1314#[derive(Debug, Clone)]
1315pub struct DebugBrokerProxy {
1316 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1317}
1318
1319impl fidl::endpoints::Proxy for DebugBrokerProxy {
1320 type Protocol = DebugBrokerMarker;
1321
1322 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1323 Self::new(inner)
1324 }
1325
1326 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1327 self.client.into_channel().map_err(|client| Self { client })
1328 }
1329
1330 fn as_channel(&self) -> &::fidl::AsyncChannel {
1331 self.client.as_channel()
1332 }
1333}
1334
1335impl DebugBrokerProxy {
1336 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1338 let protocol_name = <DebugBrokerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1339 Self { client: fidl::client::Client::new(channel, protocol_name) }
1340 }
1341
1342 pub fn take_event_stream(&self) -> DebugBrokerEventStream {
1348 DebugBrokerEventStream { event_receiver: self.client.take_event_receiver() }
1349 }
1350
1351 pub fn r#send_debug_command(
1354 &self,
1355 mut command: &str,
1356 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1357 DebugBrokerProxyInterface::r#send_debug_command(self, command)
1358 }
1359
1360 pub fn r#set_tracing_enabled(
1362 &self,
1363 mut enabled: bool,
1364 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
1365 DebugBrokerProxyInterface::r#set_tracing_enabled(self, enabled)
1366 }
1367}
1368
1369impl DebugBrokerProxyInterface for DebugBrokerProxy {
1370 type SendDebugCommandResponseFut =
1371 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1372 fn r#send_debug_command(&self, mut command: &str) -> Self::SendDebugCommandResponseFut {
1373 fn _decode(
1374 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1375 ) -> Result<i32, fidl::Error> {
1376 let _response = fidl::client::decode_transaction_body::<
1377 DebugBrokerSendDebugCommandResponse,
1378 fidl::encoding::DefaultFuchsiaResourceDialect,
1379 0x1ee270f83b5d6ff6,
1380 >(_buf?)?;
1381 Ok(_response.status)
1382 }
1383 self.client.send_query_and_decode::<DebugBrokerSendDebugCommandRequest, i32>(
1384 (command,),
1385 0x1ee270f83b5d6ff6,
1386 fidl::encoding::DynamicFlags::empty(),
1387 _decode,
1388 )
1389 }
1390
1391 type SetTracingEnabledResponseFut =
1392 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1393 fn r#set_tracing_enabled(&self, mut enabled: bool) -> Self::SetTracingEnabledResponseFut {
1394 fn _decode(
1395 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1396 ) -> Result<i32, fidl::Error> {
1397 let _response = fidl::client::decode_transaction_body::<
1398 DebugBrokerSetTracingEnabledResponse,
1399 fidl::encoding::DefaultFuchsiaResourceDialect,
1400 0x12e368d05329b30e,
1401 >(_buf?)?;
1402 Ok(_response.status)
1403 }
1404 self.client.send_query_and_decode::<DebugBrokerSetTracingEnabledRequest, i32>(
1405 (enabled,),
1406 0x12e368d05329b30e,
1407 fidl::encoding::DynamicFlags::empty(),
1408 _decode,
1409 )
1410 }
1411}
1412
1413pub struct DebugBrokerEventStream {
1414 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1415}
1416
1417impl std::marker::Unpin for DebugBrokerEventStream {}
1418
1419impl futures::stream::FusedStream for DebugBrokerEventStream {
1420 fn is_terminated(&self) -> bool {
1421 self.event_receiver.is_terminated()
1422 }
1423}
1424
1425impl futures::Stream for DebugBrokerEventStream {
1426 type Item = Result<DebugBrokerEvent, fidl::Error>;
1427
1428 fn poll_next(
1429 mut self: std::pin::Pin<&mut Self>,
1430 cx: &mut std::task::Context<'_>,
1431 ) -> std::task::Poll<Option<Self::Item>> {
1432 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1433 &mut self.event_receiver,
1434 cx
1435 )?) {
1436 Some(buf) => std::task::Poll::Ready(Some(DebugBrokerEvent::decode(buf))),
1437 None => std::task::Poll::Ready(None),
1438 }
1439 }
1440}
1441
1442#[derive(Debug)]
1443pub enum DebugBrokerEvent {}
1444
1445impl DebugBrokerEvent {
1446 fn decode(
1448 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1449 ) -> Result<DebugBrokerEvent, fidl::Error> {
1450 let (bytes, _handles) = buf.split_mut();
1451 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1452 debug_assert_eq!(tx_header.tx_id, 0);
1453 match tx_header.ordinal {
1454 _ => Err(fidl::Error::UnknownOrdinal {
1455 ordinal: tx_header.ordinal,
1456 protocol_name: <DebugBrokerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1457 }),
1458 }
1459 }
1460}
1461
1462pub struct DebugBrokerRequestStream {
1464 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1465 is_terminated: bool,
1466}
1467
1468impl std::marker::Unpin for DebugBrokerRequestStream {}
1469
1470impl futures::stream::FusedStream for DebugBrokerRequestStream {
1471 fn is_terminated(&self) -> bool {
1472 self.is_terminated
1473 }
1474}
1475
1476impl fidl::endpoints::RequestStream for DebugBrokerRequestStream {
1477 type Protocol = DebugBrokerMarker;
1478 type ControlHandle = DebugBrokerControlHandle;
1479
1480 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1481 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1482 }
1483
1484 fn control_handle(&self) -> Self::ControlHandle {
1485 DebugBrokerControlHandle { inner: self.inner.clone() }
1486 }
1487
1488 fn into_inner(
1489 self,
1490 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1491 {
1492 (self.inner, self.is_terminated)
1493 }
1494
1495 fn from_inner(
1496 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1497 is_terminated: bool,
1498 ) -> Self {
1499 Self { inner, is_terminated }
1500 }
1501}
1502
1503impl futures::Stream for DebugBrokerRequestStream {
1504 type Item = Result<DebugBrokerRequest, fidl::Error>;
1505
1506 fn poll_next(
1507 mut self: std::pin::Pin<&mut Self>,
1508 cx: &mut std::task::Context<'_>,
1509 ) -> std::task::Poll<Option<Self::Item>> {
1510 let this = &mut *self;
1511 if this.inner.check_shutdown(cx) {
1512 this.is_terminated = true;
1513 return std::task::Poll::Ready(None);
1514 }
1515 if this.is_terminated {
1516 panic!("polled DebugBrokerRequestStream after completion");
1517 }
1518 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1519 |bytes, handles| {
1520 match this.inner.channel().read_etc(cx, bytes, handles) {
1521 std::task::Poll::Ready(Ok(())) => {}
1522 std::task::Poll::Pending => return std::task::Poll::Pending,
1523 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1524 this.is_terminated = true;
1525 return std::task::Poll::Ready(None);
1526 }
1527 std::task::Poll::Ready(Err(e)) => {
1528 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1529 e.into(),
1530 ))))
1531 }
1532 }
1533
1534 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1536
1537 std::task::Poll::Ready(Some(match header.ordinal {
1538 0x1ee270f83b5d6ff6 => {
1539 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1540 let mut req = fidl::new_empty!(
1541 DebugBrokerSendDebugCommandRequest,
1542 fidl::encoding::DefaultFuchsiaResourceDialect
1543 );
1544 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugBrokerSendDebugCommandRequest>(&header, _body_bytes, handles, &mut req)?;
1545 let control_handle = DebugBrokerControlHandle { inner: this.inner.clone() };
1546 Ok(DebugBrokerRequest::SendDebugCommand {
1547 command: req.command,
1548
1549 responder: DebugBrokerSendDebugCommandResponder {
1550 control_handle: std::mem::ManuallyDrop::new(control_handle),
1551 tx_id: header.tx_id,
1552 },
1553 })
1554 }
1555 0x12e368d05329b30e => {
1556 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1557 let mut req = fidl::new_empty!(
1558 DebugBrokerSetTracingEnabledRequest,
1559 fidl::encoding::DefaultFuchsiaResourceDialect
1560 );
1561 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugBrokerSetTracingEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
1562 let control_handle = DebugBrokerControlHandle { inner: this.inner.clone() };
1563 Ok(DebugBrokerRequest::SetTracingEnabled {
1564 enabled: req.enabled,
1565
1566 responder: DebugBrokerSetTracingEnabledResponder {
1567 control_handle: std::mem::ManuallyDrop::new(control_handle),
1568 tx_id: header.tx_id,
1569 },
1570 })
1571 }
1572 _ => Err(fidl::Error::UnknownOrdinal {
1573 ordinal: header.ordinal,
1574 protocol_name:
1575 <DebugBrokerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1576 }),
1577 }))
1578 },
1579 )
1580 }
1581}
1582
1583#[derive(Debug)]
1585pub enum DebugBrokerRequest {
1586 SendDebugCommand { command: String, responder: DebugBrokerSendDebugCommandResponder },
1589 SetTracingEnabled { enabled: bool, responder: DebugBrokerSetTracingEnabledResponder },
1591}
1592
1593impl DebugBrokerRequest {
1594 #[allow(irrefutable_let_patterns)]
1595 pub fn into_send_debug_command(self) -> Option<(String, DebugBrokerSendDebugCommandResponder)> {
1596 if let DebugBrokerRequest::SendDebugCommand { command, responder } = self {
1597 Some((command, responder))
1598 } else {
1599 None
1600 }
1601 }
1602
1603 #[allow(irrefutable_let_patterns)]
1604 pub fn into_set_tracing_enabled(self) -> Option<(bool, DebugBrokerSetTracingEnabledResponder)> {
1605 if let DebugBrokerRequest::SetTracingEnabled { enabled, responder } = self {
1606 Some((enabled, responder))
1607 } else {
1608 None
1609 }
1610 }
1611
1612 pub fn method_name(&self) -> &'static str {
1614 match *self {
1615 DebugBrokerRequest::SendDebugCommand { .. } => "send_debug_command",
1616 DebugBrokerRequest::SetTracingEnabled { .. } => "set_tracing_enabled",
1617 }
1618 }
1619}
1620
1621#[derive(Debug, Clone)]
1622pub struct DebugBrokerControlHandle {
1623 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1624}
1625
1626impl fidl::endpoints::ControlHandle for DebugBrokerControlHandle {
1627 fn shutdown(&self) {
1628 self.inner.shutdown()
1629 }
1630 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1631 self.inner.shutdown_with_epitaph(status)
1632 }
1633
1634 fn is_closed(&self) -> bool {
1635 self.inner.channel().is_closed()
1636 }
1637 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1638 self.inner.channel().on_closed()
1639 }
1640
1641 #[cfg(target_os = "fuchsia")]
1642 fn signal_peer(
1643 &self,
1644 clear_mask: zx::Signals,
1645 set_mask: zx::Signals,
1646 ) -> Result<(), zx_status::Status> {
1647 use fidl::Peered;
1648 self.inner.channel().signal_peer(clear_mask, set_mask)
1649 }
1650}
1651
1652impl DebugBrokerControlHandle {}
1653
1654#[must_use = "FIDL methods require a response to be sent"]
1655#[derive(Debug)]
1656pub struct DebugBrokerSendDebugCommandResponder {
1657 control_handle: std::mem::ManuallyDrop<DebugBrokerControlHandle>,
1658 tx_id: u32,
1659}
1660
1661impl std::ops::Drop for DebugBrokerSendDebugCommandResponder {
1665 fn drop(&mut self) {
1666 self.control_handle.shutdown();
1667 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1669 }
1670}
1671
1672impl fidl::endpoints::Responder for DebugBrokerSendDebugCommandResponder {
1673 type ControlHandle = DebugBrokerControlHandle;
1674
1675 fn control_handle(&self) -> &DebugBrokerControlHandle {
1676 &self.control_handle
1677 }
1678
1679 fn drop_without_shutdown(mut self) {
1680 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1682 std::mem::forget(self);
1684 }
1685}
1686
1687impl DebugBrokerSendDebugCommandResponder {
1688 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
1692 let _result = self.send_raw(status);
1693 if _result.is_err() {
1694 self.control_handle.shutdown();
1695 }
1696 self.drop_without_shutdown();
1697 _result
1698 }
1699
1700 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
1702 let _result = self.send_raw(status);
1703 self.drop_without_shutdown();
1704 _result
1705 }
1706
1707 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
1708 self.control_handle.inner.send::<DebugBrokerSendDebugCommandResponse>(
1709 (status,),
1710 self.tx_id,
1711 0x1ee270f83b5d6ff6,
1712 fidl::encoding::DynamicFlags::empty(),
1713 )
1714 }
1715}
1716
1717#[must_use = "FIDL methods require a response to be sent"]
1718#[derive(Debug)]
1719pub struct DebugBrokerSetTracingEnabledResponder {
1720 control_handle: std::mem::ManuallyDrop<DebugBrokerControlHandle>,
1721 tx_id: u32,
1722}
1723
1724impl std::ops::Drop for DebugBrokerSetTracingEnabledResponder {
1728 fn drop(&mut self) {
1729 self.control_handle.shutdown();
1730 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1732 }
1733}
1734
1735impl fidl::endpoints::Responder for DebugBrokerSetTracingEnabledResponder {
1736 type ControlHandle = DebugBrokerControlHandle;
1737
1738 fn control_handle(&self) -> &DebugBrokerControlHandle {
1739 &self.control_handle
1740 }
1741
1742 fn drop_without_shutdown(mut self) {
1743 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1745 std::mem::forget(self);
1747 }
1748}
1749
1750impl DebugBrokerSetTracingEnabledResponder {
1751 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
1755 let _result = self.send_raw(status);
1756 if _result.is_err() {
1757 self.control_handle.shutdown();
1758 }
1759 self.drop_without_shutdown();
1760 _result
1761 }
1762
1763 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
1765 let _result = self.send_raw(status);
1766 self.drop_without_shutdown();
1767 _result
1768 }
1769
1770 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
1771 self.control_handle.inner.send::<DebugBrokerSetTracingEnabledResponse>(
1772 (status,),
1773 self.tx_id,
1774 0x12e368d05329b30e,
1775 fidl::encoding::DynamicFlags::empty(),
1776 )
1777 }
1778}
1779
1780#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1781pub struct DebugResourceMarker;
1782
1783impl fidl::endpoints::ProtocolMarker for DebugResourceMarker {
1784 type Proxy = DebugResourceProxy;
1785 type RequestStream = DebugResourceRequestStream;
1786 #[cfg(target_os = "fuchsia")]
1787 type SynchronousProxy = DebugResourceSynchronousProxy;
1788
1789 const DEBUG_NAME: &'static str = "fuchsia.kernel.DebugResource";
1790}
1791impl fidl::endpoints::DiscoverableProtocolMarker for DebugResourceMarker {}
1792
1793pub trait DebugResourceProxyInterface: Send + Sync {
1794 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
1795 fn r#get(&self) -> Self::GetResponseFut;
1796}
1797#[derive(Debug)]
1798#[cfg(target_os = "fuchsia")]
1799pub struct DebugResourceSynchronousProxy {
1800 client: fidl::client::sync::Client,
1801}
1802
1803#[cfg(target_os = "fuchsia")]
1804impl fidl::endpoints::SynchronousProxy for DebugResourceSynchronousProxy {
1805 type Proxy = DebugResourceProxy;
1806 type Protocol = DebugResourceMarker;
1807
1808 fn from_channel(inner: fidl::Channel) -> Self {
1809 Self::new(inner)
1810 }
1811
1812 fn into_channel(self) -> fidl::Channel {
1813 self.client.into_channel()
1814 }
1815
1816 fn as_channel(&self) -> &fidl::Channel {
1817 self.client.as_channel()
1818 }
1819}
1820
1821#[cfg(target_os = "fuchsia")]
1822impl DebugResourceSynchronousProxy {
1823 pub fn new(channel: fidl::Channel) -> Self {
1824 let protocol_name = <DebugResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1825 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1826 }
1827
1828 pub fn into_channel(self) -> fidl::Channel {
1829 self.client.into_channel()
1830 }
1831
1832 pub fn wait_for_event(
1835 &self,
1836 deadline: zx::MonotonicInstant,
1837 ) -> Result<DebugResourceEvent, fidl::Error> {
1838 DebugResourceEvent::decode(self.client.wait_for_event(deadline)?)
1839 }
1840
1841 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
1843 let _response =
1844 self.client.send_query::<fidl::encoding::EmptyPayload, DebugResourceGetResponse>(
1845 (),
1846 0x1d79d77ea12a6474,
1847 fidl::encoding::DynamicFlags::empty(),
1848 ___deadline,
1849 )?;
1850 Ok(_response.resource)
1851 }
1852}
1853
1854#[cfg(target_os = "fuchsia")]
1855impl From<DebugResourceSynchronousProxy> for zx::Handle {
1856 fn from(value: DebugResourceSynchronousProxy) -> Self {
1857 value.into_channel().into()
1858 }
1859}
1860
1861#[cfg(target_os = "fuchsia")]
1862impl From<fidl::Channel> for DebugResourceSynchronousProxy {
1863 fn from(value: fidl::Channel) -> Self {
1864 Self::new(value)
1865 }
1866}
1867
1868#[derive(Debug, Clone)]
1869pub struct DebugResourceProxy {
1870 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1871}
1872
1873impl fidl::endpoints::Proxy for DebugResourceProxy {
1874 type Protocol = DebugResourceMarker;
1875
1876 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1877 Self::new(inner)
1878 }
1879
1880 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1881 self.client.into_channel().map_err(|client| Self { client })
1882 }
1883
1884 fn as_channel(&self) -> &::fidl::AsyncChannel {
1885 self.client.as_channel()
1886 }
1887}
1888
1889impl DebugResourceProxy {
1890 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1892 let protocol_name = <DebugResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1893 Self { client: fidl::client::Client::new(channel, protocol_name) }
1894 }
1895
1896 pub fn take_event_stream(&self) -> DebugResourceEventStream {
1902 DebugResourceEventStream { event_receiver: self.client.take_event_receiver() }
1903 }
1904
1905 pub fn r#get(
1907 &self,
1908 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
1909 {
1910 DebugResourceProxyInterface::r#get(self)
1911 }
1912}
1913
1914impl DebugResourceProxyInterface for DebugResourceProxy {
1915 type GetResponseFut = fidl::client::QueryResponseFut<
1916 fidl::Resource,
1917 fidl::encoding::DefaultFuchsiaResourceDialect,
1918 >;
1919 fn r#get(&self) -> Self::GetResponseFut {
1920 fn _decode(
1921 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1922 ) -> Result<fidl::Resource, fidl::Error> {
1923 let _response = fidl::client::decode_transaction_body::<
1924 DebugResourceGetResponse,
1925 fidl::encoding::DefaultFuchsiaResourceDialect,
1926 0x1d79d77ea12a6474,
1927 >(_buf?)?;
1928 Ok(_response.resource)
1929 }
1930 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
1931 (),
1932 0x1d79d77ea12a6474,
1933 fidl::encoding::DynamicFlags::empty(),
1934 _decode,
1935 )
1936 }
1937}
1938
1939pub struct DebugResourceEventStream {
1940 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1941}
1942
1943impl std::marker::Unpin for DebugResourceEventStream {}
1944
1945impl futures::stream::FusedStream for DebugResourceEventStream {
1946 fn is_terminated(&self) -> bool {
1947 self.event_receiver.is_terminated()
1948 }
1949}
1950
1951impl futures::Stream for DebugResourceEventStream {
1952 type Item = Result<DebugResourceEvent, fidl::Error>;
1953
1954 fn poll_next(
1955 mut self: std::pin::Pin<&mut Self>,
1956 cx: &mut std::task::Context<'_>,
1957 ) -> std::task::Poll<Option<Self::Item>> {
1958 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1959 &mut self.event_receiver,
1960 cx
1961 )?) {
1962 Some(buf) => std::task::Poll::Ready(Some(DebugResourceEvent::decode(buf))),
1963 None => std::task::Poll::Ready(None),
1964 }
1965 }
1966}
1967
1968#[derive(Debug)]
1969pub enum DebugResourceEvent {}
1970
1971impl DebugResourceEvent {
1972 fn decode(
1974 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1975 ) -> Result<DebugResourceEvent, fidl::Error> {
1976 let (bytes, _handles) = buf.split_mut();
1977 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1978 debug_assert_eq!(tx_header.tx_id, 0);
1979 match tx_header.ordinal {
1980 _ => Err(fidl::Error::UnknownOrdinal {
1981 ordinal: tx_header.ordinal,
1982 protocol_name: <DebugResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1983 }),
1984 }
1985 }
1986}
1987
1988pub struct DebugResourceRequestStream {
1990 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1991 is_terminated: bool,
1992}
1993
1994impl std::marker::Unpin for DebugResourceRequestStream {}
1995
1996impl futures::stream::FusedStream for DebugResourceRequestStream {
1997 fn is_terminated(&self) -> bool {
1998 self.is_terminated
1999 }
2000}
2001
2002impl fidl::endpoints::RequestStream for DebugResourceRequestStream {
2003 type Protocol = DebugResourceMarker;
2004 type ControlHandle = DebugResourceControlHandle;
2005
2006 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2007 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2008 }
2009
2010 fn control_handle(&self) -> Self::ControlHandle {
2011 DebugResourceControlHandle { inner: self.inner.clone() }
2012 }
2013
2014 fn into_inner(
2015 self,
2016 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2017 {
2018 (self.inner, self.is_terminated)
2019 }
2020
2021 fn from_inner(
2022 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2023 is_terminated: bool,
2024 ) -> Self {
2025 Self { inner, is_terminated }
2026 }
2027}
2028
2029impl futures::Stream for DebugResourceRequestStream {
2030 type Item = Result<DebugResourceRequest, fidl::Error>;
2031
2032 fn poll_next(
2033 mut self: std::pin::Pin<&mut Self>,
2034 cx: &mut std::task::Context<'_>,
2035 ) -> std::task::Poll<Option<Self::Item>> {
2036 let this = &mut *self;
2037 if this.inner.check_shutdown(cx) {
2038 this.is_terminated = true;
2039 return std::task::Poll::Ready(None);
2040 }
2041 if this.is_terminated {
2042 panic!("polled DebugResourceRequestStream after completion");
2043 }
2044 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2045 |bytes, handles| {
2046 match this.inner.channel().read_etc(cx, bytes, handles) {
2047 std::task::Poll::Ready(Ok(())) => {}
2048 std::task::Poll::Pending => return std::task::Poll::Pending,
2049 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2050 this.is_terminated = true;
2051 return std::task::Poll::Ready(None);
2052 }
2053 std::task::Poll::Ready(Err(e)) => {
2054 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2055 e.into(),
2056 ))))
2057 }
2058 }
2059
2060 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2062
2063 std::task::Poll::Ready(Some(match header.ordinal {
2064 0x1d79d77ea12a6474 => {
2065 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2066 let mut req = fidl::new_empty!(
2067 fidl::encoding::EmptyPayload,
2068 fidl::encoding::DefaultFuchsiaResourceDialect
2069 );
2070 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2071 let control_handle =
2072 DebugResourceControlHandle { inner: this.inner.clone() };
2073 Ok(DebugResourceRequest::Get {
2074 responder: DebugResourceGetResponder {
2075 control_handle: std::mem::ManuallyDrop::new(control_handle),
2076 tx_id: header.tx_id,
2077 },
2078 })
2079 }
2080 _ => Err(fidl::Error::UnknownOrdinal {
2081 ordinal: header.ordinal,
2082 protocol_name:
2083 <DebugResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2084 }),
2085 }))
2086 },
2087 )
2088 }
2089}
2090
2091#[derive(Debug)]
2094pub enum DebugResourceRequest {
2095 Get { responder: DebugResourceGetResponder },
2097}
2098
2099impl DebugResourceRequest {
2100 #[allow(irrefutable_let_patterns)]
2101 pub fn into_get(self) -> Option<(DebugResourceGetResponder)> {
2102 if let DebugResourceRequest::Get { responder } = self {
2103 Some((responder))
2104 } else {
2105 None
2106 }
2107 }
2108
2109 pub fn method_name(&self) -> &'static str {
2111 match *self {
2112 DebugResourceRequest::Get { .. } => "get",
2113 }
2114 }
2115}
2116
2117#[derive(Debug, Clone)]
2118pub struct DebugResourceControlHandle {
2119 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2120}
2121
2122impl fidl::endpoints::ControlHandle for DebugResourceControlHandle {
2123 fn shutdown(&self) {
2124 self.inner.shutdown()
2125 }
2126 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2127 self.inner.shutdown_with_epitaph(status)
2128 }
2129
2130 fn is_closed(&self) -> bool {
2131 self.inner.channel().is_closed()
2132 }
2133 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2134 self.inner.channel().on_closed()
2135 }
2136
2137 #[cfg(target_os = "fuchsia")]
2138 fn signal_peer(
2139 &self,
2140 clear_mask: zx::Signals,
2141 set_mask: zx::Signals,
2142 ) -> Result<(), zx_status::Status> {
2143 use fidl::Peered;
2144 self.inner.channel().signal_peer(clear_mask, set_mask)
2145 }
2146}
2147
2148impl DebugResourceControlHandle {}
2149
2150#[must_use = "FIDL methods require a response to be sent"]
2151#[derive(Debug)]
2152pub struct DebugResourceGetResponder {
2153 control_handle: std::mem::ManuallyDrop<DebugResourceControlHandle>,
2154 tx_id: u32,
2155}
2156
2157impl std::ops::Drop for DebugResourceGetResponder {
2161 fn drop(&mut self) {
2162 self.control_handle.shutdown();
2163 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2165 }
2166}
2167
2168impl fidl::endpoints::Responder for DebugResourceGetResponder {
2169 type ControlHandle = DebugResourceControlHandle;
2170
2171 fn control_handle(&self) -> &DebugResourceControlHandle {
2172 &self.control_handle
2173 }
2174
2175 fn drop_without_shutdown(mut self) {
2176 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2178 std::mem::forget(self);
2180 }
2181}
2182
2183impl DebugResourceGetResponder {
2184 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
2188 let _result = self.send_raw(resource);
2189 if _result.is_err() {
2190 self.control_handle.shutdown();
2191 }
2192 self.drop_without_shutdown();
2193 _result
2194 }
2195
2196 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
2198 let _result = self.send_raw(resource);
2199 self.drop_without_shutdown();
2200 _result
2201 }
2202
2203 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
2204 self.control_handle.inner.send::<DebugResourceGetResponse>(
2205 (resource,),
2206 self.tx_id,
2207 0x1d79d77ea12a6474,
2208 fidl::encoding::DynamicFlags::empty(),
2209 )
2210 }
2211}
2212
2213#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2214pub struct DebuglogResourceMarker;
2215
2216impl fidl::endpoints::ProtocolMarker for DebuglogResourceMarker {
2217 type Proxy = DebuglogResourceProxy;
2218 type RequestStream = DebuglogResourceRequestStream;
2219 #[cfg(target_os = "fuchsia")]
2220 type SynchronousProxy = DebuglogResourceSynchronousProxy;
2221
2222 const DEBUG_NAME: &'static str = "fuchsia.kernel.DebuglogResource";
2223}
2224impl fidl::endpoints::DiscoverableProtocolMarker for DebuglogResourceMarker {}
2225
2226pub trait DebuglogResourceProxyInterface: Send + Sync {
2227 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
2228 fn r#get(&self) -> Self::GetResponseFut;
2229}
2230#[derive(Debug)]
2231#[cfg(target_os = "fuchsia")]
2232pub struct DebuglogResourceSynchronousProxy {
2233 client: fidl::client::sync::Client,
2234}
2235
2236#[cfg(target_os = "fuchsia")]
2237impl fidl::endpoints::SynchronousProxy for DebuglogResourceSynchronousProxy {
2238 type Proxy = DebuglogResourceProxy;
2239 type Protocol = DebuglogResourceMarker;
2240
2241 fn from_channel(inner: fidl::Channel) -> Self {
2242 Self::new(inner)
2243 }
2244
2245 fn into_channel(self) -> fidl::Channel {
2246 self.client.into_channel()
2247 }
2248
2249 fn as_channel(&self) -> &fidl::Channel {
2250 self.client.as_channel()
2251 }
2252}
2253
2254#[cfg(target_os = "fuchsia")]
2255impl DebuglogResourceSynchronousProxy {
2256 pub fn new(channel: fidl::Channel) -> Self {
2257 let protocol_name = <DebuglogResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2258 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2259 }
2260
2261 pub fn into_channel(self) -> fidl::Channel {
2262 self.client.into_channel()
2263 }
2264
2265 pub fn wait_for_event(
2268 &self,
2269 deadline: zx::MonotonicInstant,
2270 ) -> Result<DebuglogResourceEvent, fidl::Error> {
2271 DebuglogResourceEvent::decode(self.client.wait_for_event(deadline)?)
2272 }
2273
2274 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
2276 let _response =
2277 self.client.send_query::<fidl::encoding::EmptyPayload, DebuglogResourceGetResponse>(
2278 (),
2279 0x6e78c1ff74765225,
2280 fidl::encoding::DynamicFlags::empty(),
2281 ___deadline,
2282 )?;
2283 Ok(_response.resource)
2284 }
2285}
2286
2287#[cfg(target_os = "fuchsia")]
2288impl From<DebuglogResourceSynchronousProxy> for zx::Handle {
2289 fn from(value: DebuglogResourceSynchronousProxy) -> Self {
2290 value.into_channel().into()
2291 }
2292}
2293
2294#[cfg(target_os = "fuchsia")]
2295impl From<fidl::Channel> for DebuglogResourceSynchronousProxy {
2296 fn from(value: fidl::Channel) -> Self {
2297 Self::new(value)
2298 }
2299}
2300
2301#[derive(Debug, Clone)]
2302pub struct DebuglogResourceProxy {
2303 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2304}
2305
2306impl fidl::endpoints::Proxy for DebuglogResourceProxy {
2307 type Protocol = DebuglogResourceMarker;
2308
2309 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2310 Self::new(inner)
2311 }
2312
2313 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2314 self.client.into_channel().map_err(|client| Self { client })
2315 }
2316
2317 fn as_channel(&self) -> &::fidl::AsyncChannel {
2318 self.client.as_channel()
2319 }
2320}
2321
2322impl DebuglogResourceProxy {
2323 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2325 let protocol_name = <DebuglogResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2326 Self { client: fidl::client::Client::new(channel, protocol_name) }
2327 }
2328
2329 pub fn take_event_stream(&self) -> DebuglogResourceEventStream {
2335 DebuglogResourceEventStream { event_receiver: self.client.take_event_receiver() }
2336 }
2337
2338 pub fn r#get(
2340 &self,
2341 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
2342 {
2343 DebuglogResourceProxyInterface::r#get(self)
2344 }
2345}
2346
2347impl DebuglogResourceProxyInterface for DebuglogResourceProxy {
2348 type GetResponseFut = fidl::client::QueryResponseFut<
2349 fidl::Resource,
2350 fidl::encoding::DefaultFuchsiaResourceDialect,
2351 >;
2352 fn r#get(&self) -> Self::GetResponseFut {
2353 fn _decode(
2354 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2355 ) -> Result<fidl::Resource, fidl::Error> {
2356 let _response = fidl::client::decode_transaction_body::<
2357 DebuglogResourceGetResponse,
2358 fidl::encoding::DefaultFuchsiaResourceDialect,
2359 0x6e78c1ff74765225,
2360 >(_buf?)?;
2361 Ok(_response.resource)
2362 }
2363 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
2364 (),
2365 0x6e78c1ff74765225,
2366 fidl::encoding::DynamicFlags::empty(),
2367 _decode,
2368 )
2369 }
2370}
2371
2372pub struct DebuglogResourceEventStream {
2373 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2374}
2375
2376impl std::marker::Unpin for DebuglogResourceEventStream {}
2377
2378impl futures::stream::FusedStream for DebuglogResourceEventStream {
2379 fn is_terminated(&self) -> bool {
2380 self.event_receiver.is_terminated()
2381 }
2382}
2383
2384impl futures::Stream for DebuglogResourceEventStream {
2385 type Item = Result<DebuglogResourceEvent, fidl::Error>;
2386
2387 fn poll_next(
2388 mut self: std::pin::Pin<&mut Self>,
2389 cx: &mut std::task::Context<'_>,
2390 ) -> std::task::Poll<Option<Self::Item>> {
2391 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2392 &mut self.event_receiver,
2393 cx
2394 )?) {
2395 Some(buf) => std::task::Poll::Ready(Some(DebuglogResourceEvent::decode(buf))),
2396 None => std::task::Poll::Ready(None),
2397 }
2398 }
2399}
2400
2401#[derive(Debug)]
2402pub enum DebuglogResourceEvent {}
2403
2404impl DebuglogResourceEvent {
2405 fn decode(
2407 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2408 ) -> Result<DebuglogResourceEvent, fidl::Error> {
2409 let (bytes, _handles) = buf.split_mut();
2410 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2411 debug_assert_eq!(tx_header.tx_id, 0);
2412 match tx_header.ordinal {
2413 _ => Err(fidl::Error::UnknownOrdinal {
2414 ordinal: tx_header.ordinal,
2415 protocol_name:
2416 <DebuglogResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2417 }),
2418 }
2419 }
2420}
2421
2422pub struct DebuglogResourceRequestStream {
2424 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2425 is_terminated: bool,
2426}
2427
2428impl std::marker::Unpin for DebuglogResourceRequestStream {}
2429
2430impl futures::stream::FusedStream for DebuglogResourceRequestStream {
2431 fn is_terminated(&self) -> bool {
2432 self.is_terminated
2433 }
2434}
2435
2436impl fidl::endpoints::RequestStream for DebuglogResourceRequestStream {
2437 type Protocol = DebuglogResourceMarker;
2438 type ControlHandle = DebuglogResourceControlHandle;
2439
2440 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2441 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2442 }
2443
2444 fn control_handle(&self) -> Self::ControlHandle {
2445 DebuglogResourceControlHandle { inner: self.inner.clone() }
2446 }
2447
2448 fn into_inner(
2449 self,
2450 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2451 {
2452 (self.inner, self.is_terminated)
2453 }
2454
2455 fn from_inner(
2456 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2457 is_terminated: bool,
2458 ) -> Self {
2459 Self { inner, is_terminated }
2460 }
2461}
2462
2463impl futures::Stream for DebuglogResourceRequestStream {
2464 type Item = Result<DebuglogResourceRequest, fidl::Error>;
2465
2466 fn poll_next(
2467 mut self: std::pin::Pin<&mut Self>,
2468 cx: &mut std::task::Context<'_>,
2469 ) -> std::task::Poll<Option<Self::Item>> {
2470 let this = &mut *self;
2471 if this.inner.check_shutdown(cx) {
2472 this.is_terminated = true;
2473 return std::task::Poll::Ready(None);
2474 }
2475 if this.is_terminated {
2476 panic!("polled DebuglogResourceRequestStream after completion");
2477 }
2478 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2479 |bytes, handles| {
2480 match this.inner.channel().read_etc(cx, bytes, handles) {
2481 std::task::Poll::Ready(Ok(())) => {}
2482 std::task::Poll::Pending => return std::task::Poll::Pending,
2483 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2484 this.is_terminated = true;
2485 return std::task::Poll::Ready(None);
2486 }
2487 std::task::Poll::Ready(Err(e)) => {
2488 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2489 e.into(),
2490 ))))
2491 }
2492 }
2493
2494 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2496
2497 std::task::Poll::Ready(Some(match header.ordinal {
2498 0x6e78c1ff74765225 => {
2499 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2500 let mut req = fidl::new_empty!(
2501 fidl::encoding::EmptyPayload,
2502 fidl::encoding::DefaultFuchsiaResourceDialect
2503 );
2504 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2505 let control_handle =
2506 DebuglogResourceControlHandle { inner: this.inner.clone() };
2507 Ok(DebuglogResourceRequest::Get {
2508 responder: DebuglogResourceGetResponder {
2509 control_handle: std::mem::ManuallyDrop::new(control_handle),
2510 tx_id: header.tx_id,
2511 },
2512 })
2513 }
2514 _ => Err(fidl::Error::UnknownOrdinal {
2515 ordinal: header.ordinal,
2516 protocol_name:
2517 <DebuglogResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2518 }),
2519 }))
2520 },
2521 )
2522 }
2523}
2524
2525#[derive(Debug)]
2528pub enum DebuglogResourceRequest {
2529 Get { responder: DebuglogResourceGetResponder },
2531}
2532
2533impl DebuglogResourceRequest {
2534 #[allow(irrefutable_let_patterns)]
2535 pub fn into_get(self) -> Option<(DebuglogResourceGetResponder)> {
2536 if let DebuglogResourceRequest::Get { responder } = self {
2537 Some((responder))
2538 } else {
2539 None
2540 }
2541 }
2542
2543 pub fn method_name(&self) -> &'static str {
2545 match *self {
2546 DebuglogResourceRequest::Get { .. } => "get",
2547 }
2548 }
2549}
2550
2551#[derive(Debug, Clone)]
2552pub struct DebuglogResourceControlHandle {
2553 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2554}
2555
2556impl fidl::endpoints::ControlHandle for DebuglogResourceControlHandle {
2557 fn shutdown(&self) {
2558 self.inner.shutdown()
2559 }
2560 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2561 self.inner.shutdown_with_epitaph(status)
2562 }
2563
2564 fn is_closed(&self) -> bool {
2565 self.inner.channel().is_closed()
2566 }
2567 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2568 self.inner.channel().on_closed()
2569 }
2570
2571 #[cfg(target_os = "fuchsia")]
2572 fn signal_peer(
2573 &self,
2574 clear_mask: zx::Signals,
2575 set_mask: zx::Signals,
2576 ) -> Result<(), zx_status::Status> {
2577 use fidl::Peered;
2578 self.inner.channel().signal_peer(clear_mask, set_mask)
2579 }
2580}
2581
2582impl DebuglogResourceControlHandle {}
2583
2584#[must_use = "FIDL methods require a response to be sent"]
2585#[derive(Debug)]
2586pub struct DebuglogResourceGetResponder {
2587 control_handle: std::mem::ManuallyDrop<DebuglogResourceControlHandle>,
2588 tx_id: u32,
2589}
2590
2591impl std::ops::Drop for DebuglogResourceGetResponder {
2595 fn drop(&mut self) {
2596 self.control_handle.shutdown();
2597 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2599 }
2600}
2601
2602impl fidl::endpoints::Responder for DebuglogResourceGetResponder {
2603 type ControlHandle = DebuglogResourceControlHandle;
2604
2605 fn control_handle(&self) -> &DebuglogResourceControlHandle {
2606 &self.control_handle
2607 }
2608
2609 fn drop_without_shutdown(mut self) {
2610 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2612 std::mem::forget(self);
2614 }
2615}
2616
2617impl DebuglogResourceGetResponder {
2618 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
2622 let _result = self.send_raw(resource);
2623 if _result.is_err() {
2624 self.control_handle.shutdown();
2625 }
2626 self.drop_without_shutdown();
2627 _result
2628 }
2629
2630 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
2632 let _result = self.send_raw(resource);
2633 self.drop_without_shutdown();
2634 _result
2635 }
2636
2637 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
2638 self.control_handle.inner.send::<DebuglogResourceGetResponse>(
2639 (resource,),
2640 self.tx_id,
2641 0x6e78c1ff74765225,
2642 fidl::encoding::DynamicFlags::empty(),
2643 )
2644 }
2645}
2646
2647#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2648pub struct EnergyInfoResourceMarker;
2649
2650impl fidl::endpoints::ProtocolMarker for EnergyInfoResourceMarker {
2651 type Proxy = EnergyInfoResourceProxy;
2652 type RequestStream = EnergyInfoResourceRequestStream;
2653 #[cfg(target_os = "fuchsia")]
2654 type SynchronousProxy = EnergyInfoResourceSynchronousProxy;
2655
2656 const DEBUG_NAME: &'static str = "fuchsia.kernel.EnergyInfoResource";
2657}
2658impl fidl::endpoints::DiscoverableProtocolMarker for EnergyInfoResourceMarker {}
2659
2660pub trait EnergyInfoResourceProxyInterface: Send + Sync {
2661 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
2662 fn r#get(&self) -> Self::GetResponseFut;
2663}
2664#[derive(Debug)]
2665#[cfg(target_os = "fuchsia")]
2666pub struct EnergyInfoResourceSynchronousProxy {
2667 client: fidl::client::sync::Client,
2668}
2669
2670#[cfg(target_os = "fuchsia")]
2671impl fidl::endpoints::SynchronousProxy for EnergyInfoResourceSynchronousProxy {
2672 type Proxy = EnergyInfoResourceProxy;
2673 type Protocol = EnergyInfoResourceMarker;
2674
2675 fn from_channel(inner: fidl::Channel) -> Self {
2676 Self::new(inner)
2677 }
2678
2679 fn into_channel(self) -> fidl::Channel {
2680 self.client.into_channel()
2681 }
2682
2683 fn as_channel(&self) -> &fidl::Channel {
2684 self.client.as_channel()
2685 }
2686}
2687
2688#[cfg(target_os = "fuchsia")]
2689impl EnergyInfoResourceSynchronousProxy {
2690 pub fn new(channel: fidl::Channel) -> Self {
2691 let protocol_name =
2692 <EnergyInfoResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2693 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2694 }
2695
2696 pub fn into_channel(self) -> fidl::Channel {
2697 self.client.into_channel()
2698 }
2699
2700 pub fn wait_for_event(
2703 &self,
2704 deadline: zx::MonotonicInstant,
2705 ) -> Result<EnergyInfoResourceEvent, fidl::Error> {
2706 EnergyInfoResourceEvent::decode(self.client.wait_for_event(deadline)?)
2707 }
2708
2709 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
2711 let _response =
2712 self.client.send_query::<fidl::encoding::EmptyPayload, EnergyInfoResourceGetResponse>(
2713 (),
2714 0x5f5cc9f0745f61d0,
2715 fidl::encoding::DynamicFlags::empty(),
2716 ___deadline,
2717 )?;
2718 Ok(_response.resource)
2719 }
2720}
2721
2722#[cfg(target_os = "fuchsia")]
2723impl From<EnergyInfoResourceSynchronousProxy> for zx::Handle {
2724 fn from(value: EnergyInfoResourceSynchronousProxy) -> Self {
2725 value.into_channel().into()
2726 }
2727}
2728
2729#[cfg(target_os = "fuchsia")]
2730impl From<fidl::Channel> for EnergyInfoResourceSynchronousProxy {
2731 fn from(value: fidl::Channel) -> Self {
2732 Self::new(value)
2733 }
2734}
2735
2736#[derive(Debug, Clone)]
2737pub struct EnergyInfoResourceProxy {
2738 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2739}
2740
2741impl fidl::endpoints::Proxy for EnergyInfoResourceProxy {
2742 type Protocol = EnergyInfoResourceMarker;
2743
2744 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2745 Self::new(inner)
2746 }
2747
2748 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2749 self.client.into_channel().map_err(|client| Self { client })
2750 }
2751
2752 fn as_channel(&self) -> &::fidl::AsyncChannel {
2753 self.client.as_channel()
2754 }
2755}
2756
2757impl EnergyInfoResourceProxy {
2758 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2760 let protocol_name =
2761 <EnergyInfoResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2762 Self { client: fidl::client::Client::new(channel, protocol_name) }
2763 }
2764
2765 pub fn take_event_stream(&self) -> EnergyInfoResourceEventStream {
2771 EnergyInfoResourceEventStream { event_receiver: self.client.take_event_receiver() }
2772 }
2773
2774 pub fn r#get(
2776 &self,
2777 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
2778 {
2779 EnergyInfoResourceProxyInterface::r#get(self)
2780 }
2781}
2782
2783impl EnergyInfoResourceProxyInterface for EnergyInfoResourceProxy {
2784 type GetResponseFut = fidl::client::QueryResponseFut<
2785 fidl::Resource,
2786 fidl::encoding::DefaultFuchsiaResourceDialect,
2787 >;
2788 fn r#get(&self) -> Self::GetResponseFut {
2789 fn _decode(
2790 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2791 ) -> Result<fidl::Resource, fidl::Error> {
2792 let _response = fidl::client::decode_transaction_body::<
2793 EnergyInfoResourceGetResponse,
2794 fidl::encoding::DefaultFuchsiaResourceDialect,
2795 0x5f5cc9f0745f61d0,
2796 >(_buf?)?;
2797 Ok(_response.resource)
2798 }
2799 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
2800 (),
2801 0x5f5cc9f0745f61d0,
2802 fidl::encoding::DynamicFlags::empty(),
2803 _decode,
2804 )
2805 }
2806}
2807
2808pub struct EnergyInfoResourceEventStream {
2809 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2810}
2811
2812impl std::marker::Unpin for EnergyInfoResourceEventStream {}
2813
2814impl futures::stream::FusedStream for EnergyInfoResourceEventStream {
2815 fn is_terminated(&self) -> bool {
2816 self.event_receiver.is_terminated()
2817 }
2818}
2819
2820impl futures::Stream for EnergyInfoResourceEventStream {
2821 type Item = Result<EnergyInfoResourceEvent, fidl::Error>;
2822
2823 fn poll_next(
2824 mut self: std::pin::Pin<&mut Self>,
2825 cx: &mut std::task::Context<'_>,
2826 ) -> std::task::Poll<Option<Self::Item>> {
2827 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2828 &mut self.event_receiver,
2829 cx
2830 )?) {
2831 Some(buf) => std::task::Poll::Ready(Some(EnergyInfoResourceEvent::decode(buf))),
2832 None => std::task::Poll::Ready(None),
2833 }
2834 }
2835}
2836
2837#[derive(Debug)]
2838pub enum EnergyInfoResourceEvent {}
2839
2840impl EnergyInfoResourceEvent {
2841 fn decode(
2843 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2844 ) -> Result<EnergyInfoResourceEvent, fidl::Error> {
2845 let (bytes, _handles) = buf.split_mut();
2846 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2847 debug_assert_eq!(tx_header.tx_id, 0);
2848 match tx_header.ordinal {
2849 _ => Err(fidl::Error::UnknownOrdinal {
2850 ordinal: tx_header.ordinal,
2851 protocol_name:
2852 <EnergyInfoResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2853 }),
2854 }
2855 }
2856}
2857
2858pub struct EnergyInfoResourceRequestStream {
2860 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2861 is_terminated: bool,
2862}
2863
2864impl std::marker::Unpin for EnergyInfoResourceRequestStream {}
2865
2866impl futures::stream::FusedStream for EnergyInfoResourceRequestStream {
2867 fn is_terminated(&self) -> bool {
2868 self.is_terminated
2869 }
2870}
2871
2872impl fidl::endpoints::RequestStream for EnergyInfoResourceRequestStream {
2873 type Protocol = EnergyInfoResourceMarker;
2874 type ControlHandle = EnergyInfoResourceControlHandle;
2875
2876 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2877 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2878 }
2879
2880 fn control_handle(&self) -> Self::ControlHandle {
2881 EnergyInfoResourceControlHandle { inner: self.inner.clone() }
2882 }
2883
2884 fn into_inner(
2885 self,
2886 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2887 {
2888 (self.inner, self.is_terminated)
2889 }
2890
2891 fn from_inner(
2892 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2893 is_terminated: bool,
2894 ) -> Self {
2895 Self { inner, is_terminated }
2896 }
2897}
2898
2899impl futures::Stream for EnergyInfoResourceRequestStream {
2900 type Item = Result<EnergyInfoResourceRequest, fidl::Error>;
2901
2902 fn poll_next(
2903 mut self: std::pin::Pin<&mut Self>,
2904 cx: &mut std::task::Context<'_>,
2905 ) -> std::task::Poll<Option<Self::Item>> {
2906 let this = &mut *self;
2907 if this.inner.check_shutdown(cx) {
2908 this.is_terminated = true;
2909 return std::task::Poll::Ready(None);
2910 }
2911 if this.is_terminated {
2912 panic!("polled EnergyInfoResourceRequestStream after completion");
2913 }
2914 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2915 |bytes, handles| {
2916 match this.inner.channel().read_etc(cx, bytes, handles) {
2917 std::task::Poll::Ready(Ok(())) => {}
2918 std::task::Poll::Pending => return std::task::Poll::Pending,
2919 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2920 this.is_terminated = true;
2921 return std::task::Poll::Ready(None);
2922 }
2923 std::task::Poll::Ready(Err(e)) => {
2924 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2925 e.into(),
2926 ))))
2927 }
2928 }
2929
2930 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2932
2933 std::task::Poll::Ready(Some(match header.ordinal {
2934 0x5f5cc9f0745f61d0 => {
2935 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2936 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2937 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2938 let control_handle = EnergyInfoResourceControlHandle {
2939 inner: this.inner.clone(),
2940 };
2941 Ok(EnergyInfoResourceRequest::Get {
2942 responder: EnergyInfoResourceGetResponder {
2943 control_handle: std::mem::ManuallyDrop::new(control_handle),
2944 tx_id: header.tx_id,
2945 },
2946 })
2947 }
2948 _ => Err(fidl::Error::UnknownOrdinal {
2949 ordinal: header.ordinal,
2950 protocol_name: <EnergyInfoResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2951 }),
2952 }))
2953 },
2954 )
2955 }
2956}
2957
2958#[derive(Debug)]
2961pub enum EnergyInfoResourceRequest {
2962 Get { responder: EnergyInfoResourceGetResponder },
2964}
2965
2966impl EnergyInfoResourceRequest {
2967 #[allow(irrefutable_let_patterns)]
2968 pub fn into_get(self) -> Option<(EnergyInfoResourceGetResponder)> {
2969 if let EnergyInfoResourceRequest::Get { responder } = self {
2970 Some((responder))
2971 } else {
2972 None
2973 }
2974 }
2975
2976 pub fn method_name(&self) -> &'static str {
2978 match *self {
2979 EnergyInfoResourceRequest::Get { .. } => "get",
2980 }
2981 }
2982}
2983
2984#[derive(Debug, Clone)]
2985pub struct EnergyInfoResourceControlHandle {
2986 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2987}
2988
2989impl fidl::endpoints::ControlHandle for EnergyInfoResourceControlHandle {
2990 fn shutdown(&self) {
2991 self.inner.shutdown()
2992 }
2993 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2994 self.inner.shutdown_with_epitaph(status)
2995 }
2996
2997 fn is_closed(&self) -> bool {
2998 self.inner.channel().is_closed()
2999 }
3000 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3001 self.inner.channel().on_closed()
3002 }
3003
3004 #[cfg(target_os = "fuchsia")]
3005 fn signal_peer(
3006 &self,
3007 clear_mask: zx::Signals,
3008 set_mask: zx::Signals,
3009 ) -> Result<(), zx_status::Status> {
3010 use fidl::Peered;
3011 self.inner.channel().signal_peer(clear_mask, set_mask)
3012 }
3013}
3014
3015impl EnergyInfoResourceControlHandle {}
3016
3017#[must_use = "FIDL methods require a response to be sent"]
3018#[derive(Debug)]
3019pub struct EnergyInfoResourceGetResponder {
3020 control_handle: std::mem::ManuallyDrop<EnergyInfoResourceControlHandle>,
3021 tx_id: u32,
3022}
3023
3024impl std::ops::Drop for EnergyInfoResourceGetResponder {
3028 fn drop(&mut self) {
3029 self.control_handle.shutdown();
3030 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3032 }
3033}
3034
3035impl fidl::endpoints::Responder for EnergyInfoResourceGetResponder {
3036 type ControlHandle = EnergyInfoResourceControlHandle;
3037
3038 fn control_handle(&self) -> &EnergyInfoResourceControlHandle {
3039 &self.control_handle
3040 }
3041
3042 fn drop_without_shutdown(mut self) {
3043 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3045 std::mem::forget(self);
3047 }
3048}
3049
3050impl EnergyInfoResourceGetResponder {
3051 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3055 let _result = self.send_raw(resource);
3056 if _result.is_err() {
3057 self.control_handle.shutdown();
3058 }
3059 self.drop_without_shutdown();
3060 _result
3061 }
3062
3063 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3065 let _result = self.send_raw(resource);
3066 self.drop_without_shutdown();
3067 _result
3068 }
3069
3070 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3071 self.control_handle.inner.send::<EnergyInfoResourceGetResponse>(
3072 (resource,),
3073 self.tx_id,
3074 0x5f5cc9f0745f61d0,
3075 fidl::encoding::DynamicFlags::empty(),
3076 )
3077 }
3078}
3079
3080#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3081pub struct HypervisorResourceMarker;
3082
3083impl fidl::endpoints::ProtocolMarker for HypervisorResourceMarker {
3084 type Proxy = HypervisorResourceProxy;
3085 type RequestStream = HypervisorResourceRequestStream;
3086 #[cfg(target_os = "fuchsia")]
3087 type SynchronousProxy = HypervisorResourceSynchronousProxy;
3088
3089 const DEBUG_NAME: &'static str = "fuchsia.kernel.HypervisorResource";
3090}
3091impl fidl::endpoints::DiscoverableProtocolMarker for HypervisorResourceMarker {}
3092
3093pub trait HypervisorResourceProxyInterface: Send + Sync {
3094 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
3095 fn r#get(&self) -> Self::GetResponseFut;
3096}
3097#[derive(Debug)]
3098#[cfg(target_os = "fuchsia")]
3099pub struct HypervisorResourceSynchronousProxy {
3100 client: fidl::client::sync::Client,
3101}
3102
3103#[cfg(target_os = "fuchsia")]
3104impl fidl::endpoints::SynchronousProxy for HypervisorResourceSynchronousProxy {
3105 type Proxy = HypervisorResourceProxy;
3106 type Protocol = HypervisorResourceMarker;
3107
3108 fn from_channel(inner: fidl::Channel) -> Self {
3109 Self::new(inner)
3110 }
3111
3112 fn into_channel(self) -> fidl::Channel {
3113 self.client.into_channel()
3114 }
3115
3116 fn as_channel(&self) -> &fidl::Channel {
3117 self.client.as_channel()
3118 }
3119}
3120
3121#[cfg(target_os = "fuchsia")]
3122impl HypervisorResourceSynchronousProxy {
3123 pub fn new(channel: fidl::Channel) -> Self {
3124 let protocol_name =
3125 <HypervisorResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3126 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3127 }
3128
3129 pub fn into_channel(self) -> fidl::Channel {
3130 self.client.into_channel()
3131 }
3132
3133 pub fn wait_for_event(
3136 &self,
3137 deadline: zx::MonotonicInstant,
3138 ) -> Result<HypervisorResourceEvent, fidl::Error> {
3139 HypervisorResourceEvent::decode(self.client.wait_for_event(deadline)?)
3140 }
3141
3142 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
3144 let _response =
3145 self.client.send_query::<fidl::encoding::EmptyPayload, HypervisorResourceGetResponse>(
3146 (),
3147 0x1c312131d3b824a2,
3148 fidl::encoding::DynamicFlags::empty(),
3149 ___deadline,
3150 )?;
3151 Ok(_response.resource)
3152 }
3153}
3154
3155#[cfg(target_os = "fuchsia")]
3156impl From<HypervisorResourceSynchronousProxy> for zx::Handle {
3157 fn from(value: HypervisorResourceSynchronousProxy) -> Self {
3158 value.into_channel().into()
3159 }
3160}
3161
3162#[cfg(target_os = "fuchsia")]
3163impl From<fidl::Channel> for HypervisorResourceSynchronousProxy {
3164 fn from(value: fidl::Channel) -> Self {
3165 Self::new(value)
3166 }
3167}
3168
3169#[derive(Debug, Clone)]
3170pub struct HypervisorResourceProxy {
3171 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3172}
3173
3174impl fidl::endpoints::Proxy for HypervisorResourceProxy {
3175 type Protocol = HypervisorResourceMarker;
3176
3177 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3178 Self::new(inner)
3179 }
3180
3181 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3182 self.client.into_channel().map_err(|client| Self { client })
3183 }
3184
3185 fn as_channel(&self) -> &::fidl::AsyncChannel {
3186 self.client.as_channel()
3187 }
3188}
3189
3190impl HypervisorResourceProxy {
3191 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3193 let protocol_name =
3194 <HypervisorResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3195 Self { client: fidl::client::Client::new(channel, protocol_name) }
3196 }
3197
3198 pub fn take_event_stream(&self) -> HypervisorResourceEventStream {
3204 HypervisorResourceEventStream { event_receiver: self.client.take_event_receiver() }
3205 }
3206
3207 pub fn r#get(
3209 &self,
3210 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
3211 {
3212 HypervisorResourceProxyInterface::r#get(self)
3213 }
3214}
3215
3216impl HypervisorResourceProxyInterface for HypervisorResourceProxy {
3217 type GetResponseFut = fidl::client::QueryResponseFut<
3218 fidl::Resource,
3219 fidl::encoding::DefaultFuchsiaResourceDialect,
3220 >;
3221 fn r#get(&self) -> Self::GetResponseFut {
3222 fn _decode(
3223 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3224 ) -> Result<fidl::Resource, fidl::Error> {
3225 let _response = fidl::client::decode_transaction_body::<
3226 HypervisorResourceGetResponse,
3227 fidl::encoding::DefaultFuchsiaResourceDialect,
3228 0x1c312131d3b824a2,
3229 >(_buf?)?;
3230 Ok(_response.resource)
3231 }
3232 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
3233 (),
3234 0x1c312131d3b824a2,
3235 fidl::encoding::DynamicFlags::empty(),
3236 _decode,
3237 )
3238 }
3239}
3240
3241pub struct HypervisorResourceEventStream {
3242 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3243}
3244
3245impl std::marker::Unpin for HypervisorResourceEventStream {}
3246
3247impl futures::stream::FusedStream for HypervisorResourceEventStream {
3248 fn is_terminated(&self) -> bool {
3249 self.event_receiver.is_terminated()
3250 }
3251}
3252
3253impl futures::Stream for HypervisorResourceEventStream {
3254 type Item = Result<HypervisorResourceEvent, fidl::Error>;
3255
3256 fn poll_next(
3257 mut self: std::pin::Pin<&mut Self>,
3258 cx: &mut std::task::Context<'_>,
3259 ) -> std::task::Poll<Option<Self::Item>> {
3260 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3261 &mut self.event_receiver,
3262 cx
3263 )?) {
3264 Some(buf) => std::task::Poll::Ready(Some(HypervisorResourceEvent::decode(buf))),
3265 None => std::task::Poll::Ready(None),
3266 }
3267 }
3268}
3269
3270#[derive(Debug)]
3271pub enum HypervisorResourceEvent {}
3272
3273impl HypervisorResourceEvent {
3274 fn decode(
3276 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3277 ) -> Result<HypervisorResourceEvent, fidl::Error> {
3278 let (bytes, _handles) = buf.split_mut();
3279 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3280 debug_assert_eq!(tx_header.tx_id, 0);
3281 match tx_header.ordinal {
3282 _ => Err(fidl::Error::UnknownOrdinal {
3283 ordinal: tx_header.ordinal,
3284 protocol_name:
3285 <HypervisorResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3286 }),
3287 }
3288 }
3289}
3290
3291pub struct HypervisorResourceRequestStream {
3293 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3294 is_terminated: bool,
3295}
3296
3297impl std::marker::Unpin for HypervisorResourceRequestStream {}
3298
3299impl futures::stream::FusedStream for HypervisorResourceRequestStream {
3300 fn is_terminated(&self) -> bool {
3301 self.is_terminated
3302 }
3303}
3304
3305impl fidl::endpoints::RequestStream for HypervisorResourceRequestStream {
3306 type Protocol = HypervisorResourceMarker;
3307 type ControlHandle = HypervisorResourceControlHandle;
3308
3309 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3310 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3311 }
3312
3313 fn control_handle(&self) -> Self::ControlHandle {
3314 HypervisorResourceControlHandle { inner: self.inner.clone() }
3315 }
3316
3317 fn into_inner(
3318 self,
3319 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3320 {
3321 (self.inner, self.is_terminated)
3322 }
3323
3324 fn from_inner(
3325 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3326 is_terminated: bool,
3327 ) -> Self {
3328 Self { inner, is_terminated }
3329 }
3330}
3331
3332impl futures::Stream for HypervisorResourceRequestStream {
3333 type Item = Result<HypervisorResourceRequest, fidl::Error>;
3334
3335 fn poll_next(
3336 mut self: std::pin::Pin<&mut Self>,
3337 cx: &mut std::task::Context<'_>,
3338 ) -> std::task::Poll<Option<Self::Item>> {
3339 let this = &mut *self;
3340 if this.inner.check_shutdown(cx) {
3341 this.is_terminated = true;
3342 return std::task::Poll::Ready(None);
3343 }
3344 if this.is_terminated {
3345 panic!("polled HypervisorResourceRequestStream after completion");
3346 }
3347 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3348 |bytes, handles| {
3349 match this.inner.channel().read_etc(cx, bytes, handles) {
3350 std::task::Poll::Ready(Ok(())) => {}
3351 std::task::Poll::Pending => return std::task::Poll::Pending,
3352 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3353 this.is_terminated = true;
3354 return std::task::Poll::Ready(None);
3355 }
3356 std::task::Poll::Ready(Err(e)) => {
3357 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3358 e.into(),
3359 ))))
3360 }
3361 }
3362
3363 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3365
3366 std::task::Poll::Ready(Some(match header.ordinal {
3367 0x1c312131d3b824a2 => {
3368 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3369 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3370 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3371 let control_handle = HypervisorResourceControlHandle {
3372 inner: this.inner.clone(),
3373 };
3374 Ok(HypervisorResourceRequest::Get {
3375 responder: HypervisorResourceGetResponder {
3376 control_handle: std::mem::ManuallyDrop::new(control_handle),
3377 tx_id: header.tx_id,
3378 },
3379 })
3380 }
3381 _ => Err(fidl::Error::UnknownOrdinal {
3382 ordinal: header.ordinal,
3383 protocol_name: <HypervisorResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3384 }),
3385 }))
3386 },
3387 )
3388 }
3389}
3390
3391#[derive(Debug)]
3393pub enum HypervisorResourceRequest {
3394 Get { responder: HypervisorResourceGetResponder },
3396}
3397
3398impl HypervisorResourceRequest {
3399 #[allow(irrefutable_let_patterns)]
3400 pub fn into_get(self) -> Option<(HypervisorResourceGetResponder)> {
3401 if let HypervisorResourceRequest::Get { responder } = self {
3402 Some((responder))
3403 } else {
3404 None
3405 }
3406 }
3407
3408 pub fn method_name(&self) -> &'static str {
3410 match *self {
3411 HypervisorResourceRequest::Get { .. } => "get",
3412 }
3413 }
3414}
3415
3416#[derive(Debug, Clone)]
3417pub struct HypervisorResourceControlHandle {
3418 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3419}
3420
3421impl fidl::endpoints::ControlHandle for HypervisorResourceControlHandle {
3422 fn shutdown(&self) {
3423 self.inner.shutdown()
3424 }
3425 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3426 self.inner.shutdown_with_epitaph(status)
3427 }
3428
3429 fn is_closed(&self) -> bool {
3430 self.inner.channel().is_closed()
3431 }
3432 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3433 self.inner.channel().on_closed()
3434 }
3435
3436 #[cfg(target_os = "fuchsia")]
3437 fn signal_peer(
3438 &self,
3439 clear_mask: zx::Signals,
3440 set_mask: zx::Signals,
3441 ) -> Result<(), zx_status::Status> {
3442 use fidl::Peered;
3443 self.inner.channel().signal_peer(clear_mask, set_mask)
3444 }
3445}
3446
3447impl HypervisorResourceControlHandle {}
3448
3449#[must_use = "FIDL methods require a response to be sent"]
3450#[derive(Debug)]
3451pub struct HypervisorResourceGetResponder {
3452 control_handle: std::mem::ManuallyDrop<HypervisorResourceControlHandle>,
3453 tx_id: u32,
3454}
3455
3456impl std::ops::Drop for HypervisorResourceGetResponder {
3460 fn drop(&mut self) {
3461 self.control_handle.shutdown();
3462 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3464 }
3465}
3466
3467impl fidl::endpoints::Responder for HypervisorResourceGetResponder {
3468 type ControlHandle = HypervisorResourceControlHandle;
3469
3470 fn control_handle(&self) -> &HypervisorResourceControlHandle {
3471 &self.control_handle
3472 }
3473
3474 fn drop_without_shutdown(mut self) {
3475 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3477 std::mem::forget(self);
3479 }
3480}
3481
3482impl HypervisorResourceGetResponder {
3483 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3487 let _result = self.send_raw(resource);
3488 if _result.is_err() {
3489 self.control_handle.shutdown();
3490 }
3491 self.drop_without_shutdown();
3492 _result
3493 }
3494
3495 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3497 let _result = self.send_raw(resource);
3498 self.drop_without_shutdown();
3499 _result
3500 }
3501
3502 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3503 self.control_handle.inner.send::<HypervisorResourceGetResponse>(
3504 (resource,),
3505 self.tx_id,
3506 0x1c312131d3b824a2,
3507 fidl::encoding::DynamicFlags::empty(),
3508 )
3509 }
3510}
3511
3512#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3513pub struct InfoResourceMarker;
3514
3515impl fidl::endpoints::ProtocolMarker for InfoResourceMarker {
3516 type Proxy = InfoResourceProxy;
3517 type RequestStream = InfoResourceRequestStream;
3518 #[cfg(target_os = "fuchsia")]
3519 type SynchronousProxy = InfoResourceSynchronousProxy;
3520
3521 const DEBUG_NAME: &'static str = "fuchsia.kernel.InfoResource";
3522}
3523impl fidl::endpoints::DiscoverableProtocolMarker for InfoResourceMarker {}
3524
3525pub trait InfoResourceProxyInterface: Send + Sync {
3526 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
3527 fn r#get(&self) -> Self::GetResponseFut;
3528}
3529#[derive(Debug)]
3530#[cfg(target_os = "fuchsia")]
3531pub struct InfoResourceSynchronousProxy {
3532 client: fidl::client::sync::Client,
3533}
3534
3535#[cfg(target_os = "fuchsia")]
3536impl fidl::endpoints::SynchronousProxy for InfoResourceSynchronousProxy {
3537 type Proxy = InfoResourceProxy;
3538 type Protocol = InfoResourceMarker;
3539
3540 fn from_channel(inner: fidl::Channel) -> Self {
3541 Self::new(inner)
3542 }
3543
3544 fn into_channel(self) -> fidl::Channel {
3545 self.client.into_channel()
3546 }
3547
3548 fn as_channel(&self) -> &fidl::Channel {
3549 self.client.as_channel()
3550 }
3551}
3552
3553#[cfg(target_os = "fuchsia")]
3554impl InfoResourceSynchronousProxy {
3555 pub fn new(channel: fidl::Channel) -> Self {
3556 let protocol_name = <InfoResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3557 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3558 }
3559
3560 pub fn into_channel(self) -> fidl::Channel {
3561 self.client.into_channel()
3562 }
3563
3564 pub fn wait_for_event(
3567 &self,
3568 deadline: zx::MonotonicInstant,
3569 ) -> Result<InfoResourceEvent, fidl::Error> {
3570 InfoResourceEvent::decode(self.client.wait_for_event(deadline)?)
3571 }
3572
3573 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
3575 let _response =
3576 self.client.send_query::<fidl::encoding::EmptyPayload, InfoResourceGetResponse>(
3577 (),
3578 0x1de8edcb4abc2067,
3579 fidl::encoding::DynamicFlags::empty(),
3580 ___deadline,
3581 )?;
3582 Ok(_response.resource)
3583 }
3584}
3585
3586#[cfg(target_os = "fuchsia")]
3587impl From<InfoResourceSynchronousProxy> for zx::Handle {
3588 fn from(value: InfoResourceSynchronousProxy) -> Self {
3589 value.into_channel().into()
3590 }
3591}
3592
3593#[cfg(target_os = "fuchsia")]
3594impl From<fidl::Channel> for InfoResourceSynchronousProxy {
3595 fn from(value: fidl::Channel) -> Self {
3596 Self::new(value)
3597 }
3598}
3599
3600#[derive(Debug, Clone)]
3601pub struct InfoResourceProxy {
3602 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3603}
3604
3605impl fidl::endpoints::Proxy for InfoResourceProxy {
3606 type Protocol = InfoResourceMarker;
3607
3608 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3609 Self::new(inner)
3610 }
3611
3612 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3613 self.client.into_channel().map_err(|client| Self { client })
3614 }
3615
3616 fn as_channel(&self) -> &::fidl::AsyncChannel {
3617 self.client.as_channel()
3618 }
3619}
3620
3621impl InfoResourceProxy {
3622 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3624 let protocol_name = <InfoResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3625 Self { client: fidl::client::Client::new(channel, protocol_name) }
3626 }
3627
3628 pub fn take_event_stream(&self) -> InfoResourceEventStream {
3634 InfoResourceEventStream { event_receiver: self.client.take_event_receiver() }
3635 }
3636
3637 pub fn r#get(
3639 &self,
3640 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
3641 {
3642 InfoResourceProxyInterface::r#get(self)
3643 }
3644}
3645
3646impl InfoResourceProxyInterface for InfoResourceProxy {
3647 type GetResponseFut = fidl::client::QueryResponseFut<
3648 fidl::Resource,
3649 fidl::encoding::DefaultFuchsiaResourceDialect,
3650 >;
3651 fn r#get(&self) -> Self::GetResponseFut {
3652 fn _decode(
3653 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3654 ) -> Result<fidl::Resource, fidl::Error> {
3655 let _response = fidl::client::decode_transaction_body::<
3656 InfoResourceGetResponse,
3657 fidl::encoding::DefaultFuchsiaResourceDialect,
3658 0x1de8edcb4abc2067,
3659 >(_buf?)?;
3660 Ok(_response.resource)
3661 }
3662 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
3663 (),
3664 0x1de8edcb4abc2067,
3665 fidl::encoding::DynamicFlags::empty(),
3666 _decode,
3667 )
3668 }
3669}
3670
3671pub struct InfoResourceEventStream {
3672 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3673}
3674
3675impl std::marker::Unpin for InfoResourceEventStream {}
3676
3677impl futures::stream::FusedStream for InfoResourceEventStream {
3678 fn is_terminated(&self) -> bool {
3679 self.event_receiver.is_terminated()
3680 }
3681}
3682
3683impl futures::Stream for InfoResourceEventStream {
3684 type Item = Result<InfoResourceEvent, fidl::Error>;
3685
3686 fn poll_next(
3687 mut self: std::pin::Pin<&mut Self>,
3688 cx: &mut std::task::Context<'_>,
3689 ) -> std::task::Poll<Option<Self::Item>> {
3690 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3691 &mut self.event_receiver,
3692 cx
3693 )?) {
3694 Some(buf) => std::task::Poll::Ready(Some(InfoResourceEvent::decode(buf))),
3695 None => std::task::Poll::Ready(None),
3696 }
3697 }
3698}
3699
3700#[derive(Debug)]
3701pub enum InfoResourceEvent {}
3702
3703impl InfoResourceEvent {
3704 fn decode(
3706 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3707 ) -> Result<InfoResourceEvent, fidl::Error> {
3708 let (bytes, _handles) = buf.split_mut();
3709 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3710 debug_assert_eq!(tx_header.tx_id, 0);
3711 match tx_header.ordinal {
3712 _ => Err(fidl::Error::UnknownOrdinal {
3713 ordinal: tx_header.ordinal,
3714 protocol_name: <InfoResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3715 }),
3716 }
3717 }
3718}
3719
3720pub struct InfoResourceRequestStream {
3722 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3723 is_terminated: bool,
3724}
3725
3726impl std::marker::Unpin for InfoResourceRequestStream {}
3727
3728impl futures::stream::FusedStream for InfoResourceRequestStream {
3729 fn is_terminated(&self) -> bool {
3730 self.is_terminated
3731 }
3732}
3733
3734impl fidl::endpoints::RequestStream for InfoResourceRequestStream {
3735 type Protocol = InfoResourceMarker;
3736 type ControlHandle = InfoResourceControlHandle;
3737
3738 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3739 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3740 }
3741
3742 fn control_handle(&self) -> Self::ControlHandle {
3743 InfoResourceControlHandle { inner: self.inner.clone() }
3744 }
3745
3746 fn into_inner(
3747 self,
3748 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3749 {
3750 (self.inner, self.is_terminated)
3751 }
3752
3753 fn from_inner(
3754 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3755 is_terminated: bool,
3756 ) -> Self {
3757 Self { inner, is_terminated }
3758 }
3759}
3760
3761impl futures::Stream for InfoResourceRequestStream {
3762 type Item = Result<InfoResourceRequest, fidl::Error>;
3763
3764 fn poll_next(
3765 mut self: std::pin::Pin<&mut Self>,
3766 cx: &mut std::task::Context<'_>,
3767 ) -> std::task::Poll<Option<Self::Item>> {
3768 let this = &mut *self;
3769 if this.inner.check_shutdown(cx) {
3770 this.is_terminated = true;
3771 return std::task::Poll::Ready(None);
3772 }
3773 if this.is_terminated {
3774 panic!("polled InfoResourceRequestStream after completion");
3775 }
3776 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3777 |bytes, handles| {
3778 match this.inner.channel().read_etc(cx, bytes, handles) {
3779 std::task::Poll::Ready(Ok(())) => {}
3780 std::task::Poll::Pending => return std::task::Poll::Pending,
3781 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3782 this.is_terminated = true;
3783 return std::task::Poll::Ready(None);
3784 }
3785 std::task::Poll::Ready(Err(e)) => {
3786 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3787 e.into(),
3788 ))))
3789 }
3790 }
3791
3792 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3794
3795 std::task::Poll::Ready(Some(match header.ordinal {
3796 0x1de8edcb4abc2067 => {
3797 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3798 let mut req = fidl::new_empty!(
3799 fidl::encoding::EmptyPayload,
3800 fidl::encoding::DefaultFuchsiaResourceDialect
3801 );
3802 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3803 let control_handle =
3804 InfoResourceControlHandle { inner: this.inner.clone() };
3805 Ok(InfoResourceRequest::Get {
3806 responder: InfoResourceGetResponder {
3807 control_handle: std::mem::ManuallyDrop::new(control_handle),
3808 tx_id: header.tx_id,
3809 },
3810 })
3811 }
3812 _ => Err(fidl::Error::UnknownOrdinal {
3813 ordinal: header.ordinal,
3814 protocol_name:
3815 <InfoResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3816 }),
3817 }))
3818 },
3819 )
3820 }
3821}
3822
3823#[derive(Debug)]
3826pub enum InfoResourceRequest {
3827 Get { responder: InfoResourceGetResponder },
3829}
3830
3831impl InfoResourceRequest {
3832 #[allow(irrefutable_let_patterns)]
3833 pub fn into_get(self) -> Option<(InfoResourceGetResponder)> {
3834 if let InfoResourceRequest::Get { responder } = self {
3835 Some((responder))
3836 } else {
3837 None
3838 }
3839 }
3840
3841 pub fn method_name(&self) -> &'static str {
3843 match *self {
3844 InfoResourceRequest::Get { .. } => "get",
3845 }
3846 }
3847}
3848
3849#[derive(Debug, Clone)]
3850pub struct InfoResourceControlHandle {
3851 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3852}
3853
3854impl fidl::endpoints::ControlHandle for InfoResourceControlHandle {
3855 fn shutdown(&self) {
3856 self.inner.shutdown()
3857 }
3858 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3859 self.inner.shutdown_with_epitaph(status)
3860 }
3861
3862 fn is_closed(&self) -> bool {
3863 self.inner.channel().is_closed()
3864 }
3865 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3866 self.inner.channel().on_closed()
3867 }
3868
3869 #[cfg(target_os = "fuchsia")]
3870 fn signal_peer(
3871 &self,
3872 clear_mask: zx::Signals,
3873 set_mask: zx::Signals,
3874 ) -> Result<(), zx_status::Status> {
3875 use fidl::Peered;
3876 self.inner.channel().signal_peer(clear_mask, set_mask)
3877 }
3878}
3879
3880impl InfoResourceControlHandle {}
3881
3882#[must_use = "FIDL methods require a response to be sent"]
3883#[derive(Debug)]
3884pub struct InfoResourceGetResponder {
3885 control_handle: std::mem::ManuallyDrop<InfoResourceControlHandle>,
3886 tx_id: u32,
3887}
3888
3889impl std::ops::Drop for InfoResourceGetResponder {
3893 fn drop(&mut self) {
3894 self.control_handle.shutdown();
3895 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3897 }
3898}
3899
3900impl fidl::endpoints::Responder for InfoResourceGetResponder {
3901 type ControlHandle = InfoResourceControlHandle;
3902
3903 fn control_handle(&self) -> &InfoResourceControlHandle {
3904 &self.control_handle
3905 }
3906
3907 fn drop_without_shutdown(mut self) {
3908 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3910 std::mem::forget(self);
3912 }
3913}
3914
3915impl InfoResourceGetResponder {
3916 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3920 let _result = self.send_raw(resource);
3921 if _result.is_err() {
3922 self.control_handle.shutdown();
3923 }
3924 self.drop_without_shutdown();
3925 _result
3926 }
3927
3928 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3930 let _result = self.send_raw(resource);
3931 self.drop_without_shutdown();
3932 _result
3933 }
3934
3935 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
3936 self.control_handle.inner.send::<InfoResourceGetResponse>(
3937 (resource,),
3938 self.tx_id,
3939 0x1de8edcb4abc2067,
3940 fidl::encoding::DynamicFlags::empty(),
3941 )
3942 }
3943}
3944
3945#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3946pub struct IommuResourceMarker;
3947
3948impl fidl::endpoints::ProtocolMarker for IommuResourceMarker {
3949 type Proxy = IommuResourceProxy;
3950 type RequestStream = IommuResourceRequestStream;
3951 #[cfg(target_os = "fuchsia")]
3952 type SynchronousProxy = IommuResourceSynchronousProxy;
3953
3954 const DEBUG_NAME: &'static str = "fuchsia.kernel.IommuResource";
3955}
3956impl fidl::endpoints::DiscoverableProtocolMarker for IommuResourceMarker {}
3957
3958pub trait IommuResourceProxyInterface: Send + Sync {
3959 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
3960 fn r#get(&self) -> Self::GetResponseFut;
3961}
3962#[derive(Debug)]
3963#[cfg(target_os = "fuchsia")]
3964pub struct IommuResourceSynchronousProxy {
3965 client: fidl::client::sync::Client,
3966}
3967
3968#[cfg(target_os = "fuchsia")]
3969impl fidl::endpoints::SynchronousProxy for IommuResourceSynchronousProxy {
3970 type Proxy = IommuResourceProxy;
3971 type Protocol = IommuResourceMarker;
3972
3973 fn from_channel(inner: fidl::Channel) -> Self {
3974 Self::new(inner)
3975 }
3976
3977 fn into_channel(self) -> fidl::Channel {
3978 self.client.into_channel()
3979 }
3980
3981 fn as_channel(&self) -> &fidl::Channel {
3982 self.client.as_channel()
3983 }
3984}
3985
3986#[cfg(target_os = "fuchsia")]
3987impl IommuResourceSynchronousProxy {
3988 pub fn new(channel: fidl::Channel) -> Self {
3989 let protocol_name = <IommuResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3990 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3991 }
3992
3993 pub fn into_channel(self) -> fidl::Channel {
3994 self.client.into_channel()
3995 }
3996
3997 pub fn wait_for_event(
4000 &self,
4001 deadline: zx::MonotonicInstant,
4002 ) -> Result<IommuResourceEvent, fidl::Error> {
4003 IommuResourceEvent::decode(self.client.wait_for_event(deadline)?)
4004 }
4005
4006 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
4008 let _response =
4009 self.client.send_query::<fidl::encoding::EmptyPayload, IommuResourceGetResponse>(
4010 (),
4011 0x5af309b619aa7c5b,
4012 fidl::encoding::DynamicFlags::empty(),
4013 ___deadline,
4014 )?;
4015 Ok(_response.resource)
4016 }
4017}
4018
4019#[cfg(target_os = "fuchsia")]
4020impl From<IommuResourceSynchronousProxy> for zx::Handle {
4021 fn from(value: IommuResourceSynchronousProxy) -> Self {
4022 value.into_channel().into()
4023 }
4024}
4025
4026#[cfg(target_os = "fuchsia")]
4027impl From<fidl::Channel> for IommuResourceSynchronousProxy {
4028 fn from(value: fidl::Channel) -> Self {
4029 Self::new(value)
4030 }
4031}
4032
4033#[derive(Debug, Clone)]
4034pub struct IommuResourceProxy {
4035 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4036}
4037
4038impl fidl::endpoints::Proxy for IommuResourceProxy {
4039 type Protocol = IommuResourceMarker;
4040
4041 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4042 Self::new(inner)
4043 }
4044
4045 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4046 self.client.into_channel().map_err(|client| Self { client })
4047 }
4048
4049 fn as_channel(&self) -> &::fidl::AsyncChannel {
4050 self.client.as_channel()
4051 }
4052}
4053
4054impl IommuResourceProxy {
4055 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4057 let protocol_name = <IommuResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4058 Self { client: fidl::client::Client::new(channel, protocol_name) }
4059 }
4060
4061 pub fn take_event_stream(&self) -> IommuResourceEventStream {
4067 IommuResourceEventStream { event_receiver: self.client.take_event_receiver() }
4068 }
4069
4070 pub fn r#get(
4072 &self,
4073 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
4074 {
4075 IommuResourceProxyInterface::r#get(self)
4076 }
4077}
4078
4079impl IommuResourceProxyInterface for IommuResourceProxy {
4080 type GetResponseFut = fidl::client::QueryResponseFut<
4081 fidl::Resource,
4082 fidl::encoding::DefaultFuchsiaResourceDialect,
4083 >;
4084 fn r#get(&self) -> Self::GetResponseFut {
4085 fn _decode(
4086 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4087 ) -> Result<fidl::Resource, fidl::Error> {
4088 let _response = fidl::client::decode_transaction_body::<
4089 IommuResourceGetResponse,
4090 fidl::encoding::DefaultFuchsiaResourceDialect,
4091 0x5af309b619aa7c5b,
4092 >(_buf?)?;
4093 Ok(_response.resource)
4094 }
4095 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
4096 (),
4097 0x5af309b619aa7c5b,
4098 fidl::encoding::DynamicFlags::empty(),
4099 _decode,
4100 )
4101 }
4102}
4103
4104pub struct IommuResourceEventStream {
4105 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4106}
4107
4108impl std::marker::Unpin for IommuResourceEventStream {}
4109
4110impl futures::stream::FusedStream for IommuResourceEventStream {
4111 fn is_terminated(&self) -> bool {
4112 self.event_receiver.is_terminated()
4113 }
4114}
4115
4116impl futures::Stream for IommuResourceEventStream {
4117 type Item = Result<IommuResourceEvent, fidl::Error>;
4118
4119 fn poll_next(
4120 mut self: std::pin::Pin<&mut Self>,
4121 cx: &mut std::task::Context<'_>,
4122 ) -> std::task::Poll<Option<Self::Item>> {
4123 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4124 &mut self.event_receiver,
4125 cx
4126 )?) {
4127 Some(buf) => std::task::Poll::Ready(Some(IommuResourceEvent::decode(buf))),
4128 None => std::task::Poll::Ready(None),
4129 }
4130 }
4131}
4132
4133#[derive(Debug)]
4134pub enum IommuResourceEvent {}
4135
4136impl IommuResourceEvent {
4137 fn decode(
4139 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4140 ) -> Result<IommuResourceEvent, fidl::Error> {
4141 let (bytes, _handles) = buf.split_mut();
4142 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4143 debug_assert_eq!(tx_header.tx_id, 0);
4144 match tx_header.ordinal {
4145 _ => Err(fidl::Error::UnknownOrdinal {
4146 ordinal: tx_header.ordinal,
4147 protocol_name: <IommuResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4148 }),
4149 }
4150 }
4151}
4152
4153pub struct IommuResourceRequestStream {
4155 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4156 is_terminated: bool,
4157}
4158
4159impl std::marker::Unpin for IommuResourceRequestStream {}
4160
4161impl futures::stream::FusedStream for IommuResourceRequestStream {
4162 fn is_terminated(&self) -> bool {
4163 self.is_terminated
4164 }
4165}
4166
4167impl fidl::endpoints::RequestStream for IommuResourceRequestStream {
4168 type Protocol = IommuResourceMarker;
4169 type ControlHandle = IommuResourceControlHandle;
4170
4171 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4172 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4173 }
4174
4175 fn control_handle(&self) -> Self::ControlHandle {
4176 IommuResourceControlHandle { inner: self.inner.clone() }
4177 }
4178
4179 fn into_inner(
4180 self,
4181 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4182 {
4183 (self.inner, self.is_terminated)
4184 }
4185
4186 fn from_inner(
4187 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4188 is_terminated: bool,
4189 ) -> Self {
4190 Self { inner, is_terminated }
4191 }
4192}
4193
4194impl futures::Stream for IommuResourceRequestStream {
4195 type Item = Result<IommuResourceRequest, fidl::Error>;
4196
4197 fn poll_next(
4198 mut self: std::pin::Pin<&mut Self>,
4199 cx: &mut std::task::Context<'_>,
4200 ) -> std::task::Poll<Option<Self::Item>> {
4201 let this = &mut *self;
4202 if this.inner.check_shutdown(cx) {
4203 this.is_terminated = true;
4204 return std::task::Poll::Ready(None);
4205 }
4206 if this.is_terminated {
4207 panic!("polled IommuResourceRequestStream after completion");
4208 }
4209 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4210 |bytes, handles| {
4211 match this.inner.channel().read_etc(cx, bytes, handles) {
4212 std::task::Poll::Ready(Ok(())) => {}
4213 std::task::Poll::Pending => return std::task::Poll::Pending,
4214 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4215 this.is_terminated = true;
4216 return std::task::Poll::Ready(None);
4217 }
4218 std::task::Poll::Ready(Err(e)) => {
4219 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4220 e.into(),
4221 ))))
4222 }
4223 }
4224
4225 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4227
4228 std::task::Poll::Ready(Some(match header.ordinal {
4229 0x5af309b619aa7c5b => {
4230 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4231 let mut req = fidl::new_empty!(
4232 fidl::encoding::EmptyPayload,
4233 fidl::encoding::DefaultFuchsiaResourceDialect
4234 );
4235 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4236 let control_handle =
4237 IommuResourceControlHandle { inner: this.inner.clone() };
4238 Ok(IommuResourceRequest::Get {
4239 responder: IommuResourceGetResponder {
4240 control_handle: std::mem::ManuallyDrop::new(control_handle),
4241 tx_id: header.tx_id,
4242 },
4243 })
4244 }
4245 _ => Err(fidl::Error::UnknownOrdinal {
4246 ordinal: header.ordinal,
4247 protocol_name:
4248 <IommuResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4249 }),
4250 }))
4251 },
4252 )
4253 }
4254}
4255
4256#[derive(Debug)]
4259pub enum IommuResourceRequest {
4260 Get { responder: IommuResourceGetResponder },
4262}
4263
4264impl IommuResourceRequest {
4265 #[allow(irrefutable_let_patterns)]
4266 pub fn into_get(self) -> Option<(IommuResourceGetResponder)> {
4267 if let IommuResourceRequest::Get { responder } = self {
4268 Some((responder))
4269 } else {
4270 None
4271 }
4272 }
4273
4274 pub fn method_name(&self) -> &'static str {
4276 match *self {
4277 IommuResourceRequest::Get { .. } => "get",
4278 }
4279 }
4280}
4281
4282#[derive(Debug, Clone)]
4283pub struct IommuResourceControlHandle {
4284 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4285}
4286
4287impl fidl::endpoints::ControlHandle for IommuResourceControlHandle {
4288 fn shutdown(&self) {
4289 self.inner.shutdown()
4290 }
4291 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4292 self.inner.shutdown_with_epitaph(status)
4293 }
4294
4295 fn is_closed(&self) -> bool {
4296 self.inner.channel().is_closed()
4297 }
4298 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4299 self.inner.channel().on_closed()
4300 }
4301
4302 #[cfg(target_os = "fuchsia")]
4303 fn signal_peer(
4304 &self,
4305 clear_mask: zx::Signals,
4306 set_mask: zx::Signals,
4307 ) -> Result<(), zx_status::Status> {
4308 use fidl::Peered;
4309 self.inner.channel().signal_peer(clear_mask, set_mask)
4310 }
4311}
4312
4313impl IommuResourceControlHandle {}
4314
4315#[must_use = "FIDL methods require a response to be sent"]
4316#[derive(Debug)]
4317pub struct IommuResourceGetResponder {
4318 control_handle: std::mem::ManuallyDrop<IommuResourceControlHandle>,
4319 tx_id: u32,
4320}
4321
4322impl std::ops::Drop for IommuResourceGetResponder {
4326 fn drop(&mut self) {
4327 self.control_handle.shutdown();
4328 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4330 }
4331}
4332
4333impl fidl::endpoints::Responder for IommuResourceGetResponder {
4334 type ControlHandle = IommuResourceControlHandle;
4335
4336 fn control_handle(&self) -> &IommuResourceControlHandle {
4337 &self.control_handle
4338 }
4339
4340 fn drop_without_shutdown(mut self) {
4341 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4343 std::mem::forget(self);
4345 }
4346}
4347
4348impl IommuResourceGetResponder {
4349 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
4353 let _result = self.send_raw(resource);
4354 if _result.is_err() {
4355 self.control_handle.shutdown();
4356 }
4357 self.drop_without_shutdown();
4358 _result
4359 }
4360
4361 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
4363 let _result = self.send_raw(resource);
4364 self.drop_without_shutdown();
4365 _result
4366 }
4367
4368 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
4369 self.control_handle.inner.send::<IommuResourceGetResponse>(
4370 (resource,),
4371 self.tx_id,
4372 0x5af309b619aa7c5b,
4373 fidl::encoding::DynamicFlags::empty(),
4374 )
4375 }
4376}
4377
4378#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4379pub struct IoportResourceMarker;
4380
4381impl fidl::endpoints::ProtocolMarker for IoportResourceMarker {
4382 type Proxy = IoportResourceProxy;
4383 type RequestStream = IoportResourceRequestStream;
4384 #[cfg(target_os = "fuchsia")]
4385 type SynchronousProxy = IoportResourceSynchronousProxy;
4386
4387 const DEBUG_NAME: &'static str = "fuchsia.kernel.IoportResource";
4388}
4389impl fidl::endpoints::DiscoverableProtocolMarker for IoportResourceMarker {}
4390
4391pub trait IoportResourceProxyInterface: Send + Sync {
4392 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
4393 fn r#get(&self) -> Self::GetResponseFut;
4394}
4395#[derive(Debug)]
4396#[cfg(target_os = "fuchsia")]
4397pub struct IoportResourceSynchronousProxy {
4398 client: fidl::client::sync::Client,
4399}
4400
4401#[cfg(target_os = "fuchsia")]
4402impl fidl::endpoints::SynchronousProxy for IoportResourceSynchronousProxy {
4403 type Proxy = IoportResourceProxy;
4404 type Protocol = IoportResourceMarker;
4405
4406 fn from_channel(inner: fidl::Channel) -> Self {
4407 Self::new(inner)
4408 }
4409
4410 fn into_channel(self) -> fidl::Channel {
4411 self.client.into_channel()
4412 }
4413
4414 fn as_channel(&self) -> &fidl::Channel {
4415 self.client.as_channel()
4416 }
4417}
4418
4419#[cfg(target_os = "fuchsia")]
4420impl IoportResourceSynchronousProxy {
4421 pub fn new(channel: fidl::Channel) -> Self {
4422 let protocol_name = <IoportResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4423 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4424 }
4425
4426 pub fn into_channel(self) -> fidl::Channel {
4427 self.client.into_channel()
4428 }
4429
4430 pub fn wait_for_event(
4433 &self,
4434 deadline: zx::MonotonicInstant,
4435 ) -> Result<IoportResourceEvent, fidl::Error> {
4436 IoportResourceEvent::decode(self.client.wait_for_event(deadline)?)
4437 }
4438
4439 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
4441 let _response =
4442 self.client.send_query::<fidl::encoding::EmptyPayload, IoportResourceGetResponse>(
4443 (),
4444 0x4db20876b537c52b,
4445 fidl::encoding::DynamicFlags::empty(),
4446 ___deadline,
4447 )?;
4448 Ok(_response.resource)
4449 }
4450}
4451
4452#[cfg(target_os = "fuchsia")]
4453impl From<IoportResourceSynchronousProxy> for zx::Handle {
4454 fn from(value: IoportResourceSynchronousProxy) -> Self {
4455 value.into_channel().into()
4456 }
4457}
4458
4459#[cfg(target_os = "fuchsia")]
4460impl From<fidl::Channel> for IoportResourceSynchronousProxy {
4461 fn from(value: fidl::Channel) -> Self {
4462 Self::new(value)
4463 }
4464}
4465
4466#[derive(Debug, Clone)]
4467pub struct IoportResourceProxy {
4468 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4469}
4470
4471impl fidl::endpoints::Proxy for IoportResourceProxy {
4472 type Protocol = IoportResourceMarker;
4473
4474 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4475 Self::new(inner)
4476 }
4477
4478 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4479 self.client.into_channel().map_err(|client| Self { client })
4480 }
4481
4482 fn as_channel(&self) -> &::fidl::AsyncChannel {
4483 self.client.as_channel()
4484 }
4485}
4486
4487impl IoportResourceProxy {
4488 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4490 let protocol_name = <IoportResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4491 Self { client: fidl::client::Client::new(channel, protocol_name) }
4492 }
4493
4494 pub fn take_event_stream(&self) -> IoportResourceEventStream {
4500 IoportResourceEventStream { event_receiver: self.client.take_event_receiver() }
4501 }
4502
4503 pub fn r#get(
4505 &self,
4506 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
4507 {
4508 IoportResourceProxyInterface::r#get(self)
4509 }
4510}
4511
4512impl IoportResourceProxyInterface for IoportResourceProxy {
4513 type GetResponseFut = fidl::client::QueryResponseFut<
4514 fidl::Resource,
4515 fidl::encoding::DefaultFuchsiaResourceDialect,
4516 >;
4517 fn r#get(&self) -> Self::GetResponseFut {
4518 fn _decode(
4519 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4520 ) -> Result<fidl::Resource, fidl::Error> {
4521 let _response = fidl::client::decode_transaction_body::<
4522 IoportResourceGetResponse,
4523 fidl::encoding::DefaultFuchsiaResourceDialect,
4524 0x4db20876b537c52b,
4525 >(_buf?)?;
4526 Ok(_response.resource)
4527 }
4528 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
4529 (),
4530 0x4db20876b537c52b,
4531 fidl::encoding::DynamicFlags::empty(),
4532 _decode,
4533 )
4534 }
4535}
4536
4537pub struct IoportResourceEventStream {
4538 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4539}
4540
4541impl std::marker::Unpin for IoportResourceEventStream {}
4542
4543impl futures::stream::FusedStream for IoportResourceEventStream {
4544 fn is_terminated(&self) -> bool {
4545 self.event_receiver.is_terminated()
4546 }
4547}
4548
4549impl futures::Stream for IoportResourceEventStream {
4550 type Item = Result<IoportResourceEvent, fidl::Error>;
4551
4552 fn poll_next(
4553 mut self: std::pin::Pin<&mut Self>,
4554 cx: &mut std::task::Context<'_>,
4555 ) -> std::task::Poll<Option<Self::Item>> {
4556 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4557 &mut self.event_receiver,
4558 cx
4559 )?) {
4560 Some(buf) => std::task::Poll::Ready(Some(IoportResourceEvent::decode(buf))),
4561 None => std::task::Poll::Ready(None),
4562 }
4563 }
4564}
4565
4566#[derive(Debug)]
4567pub enum IoportResourceEvent {}
4568
4569impl IoportResourceEvent {
4570 fn decode(
4572 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4573 ) -> Result<IoportResourceEvent, fidl::Error> {
4574 let (bytes, _handles) = buf.split_mut();
4575 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4576 debug_assert_eq!(tx_header.tx_id, 0);
4577 match tx_header.ordinal {
4578 _ => Err(fidl::Error::UnknownOrdinal {
4579 ordinal: tx_header.ordinal,
4580 protocol_name:
4581 <IoportResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4582 }),
4583 }
4584 }
4585}
4586
4587pub struct IoportResourceRequestStream {
4589 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4590 is_terminated: bool,
4591}
4592
4593impl std::marker::Unpin for IoportResourceRequestStream {}
4594
4595impl futures::stream::FusedStream for IoportResourceRequestStream {
4596 fn is_terminated(&self) -> bool {
4597 self.is_terminated
4598 }
4599}
4600
4601impl fidl::endpoints::RequestStream for IoportResourceRequestStream {
4602 type Protocol = IoportResourceMarker;
4603 type ControlHandle = IoportResourceControlHandle;
4604
4605 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4606 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4607 }
4608
4609 fn control_handle(&self) -> Self::ControlHandle {
4610 IoportResourceControlHandle { inner: self.inner.clone() }
4611 }
4612
4613 fn into_inner(
4614 self,
4615 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4616 {
4617 (self.inner, self.is_terminated)
4618 }
4619
4620 fn from_inner(
4621 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4622 is_terminated: bool,
4623 ) -> Self {
4624 Self { inner, is_terminated }
4625 }
4626}
4627
4628impl futures::Stream for IoportResourceRequestStream {
4629 type Item = Result<IoportResourceRequest, fidl::Error>;
4630
4631 fn poll_next(
4632 mut self: std::pin::Pin<&mut Self>,
4633 cx: &mut std::task::Context<'_>,
4634 ) -> std::task::Poll<Option<Self::Item>> {
4635 let this = &mut *self;
4636 if this.inner.check_shutdown(cx) {
4637 this.is_terminated = true;
4638 return std::task::Poll::Ready(None);
4639 }
4640 if this.is_terminated {
4641 panic!("polled IoportResourceRequestStream after completion");
4642 }
4643 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4644 |bytes, handles| {
4645 match this.inner.channel().read_etc(cx, bytes, handles) {
4646 std::task::Poll::Ready(Ok(())) => {}
4647 std::task::Poll::Pending => return std::task::Poll::Pending,
4648 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4649 this.is_terminated = true;
4650 return std::task::Poll::Ready(None);
4651 }
4652 std::task::Poll::Ready(Err(e)) => {
4653 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4654 e.into(),
4655 ))))
4656 }
4657 }
4658
4659 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4661
4662 std::task::Poll::Ready(Some(match header.ordinal {
4663 0x4db20876b537c52b => {
4664 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4665 let mut req = fidl::new_empty!(
4666 fidl::encoding::EmptyPayload,
4667 fidl::encoding::DefaultFuchsiaResourceDialect
4668 );
4669 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4670 let control_handle =
4671 IoportResourceControlHandle { inner: this.inner.clone() };
4672 Ok(IoportResourceRequest::Get {
4673 responder: IoportResourceGetResponder {
4674 control_handle: std::mem::ManuallyDrop::new(control_handle),
4675 tx_id: header.tx_id,
4676 },
4677 })
4678 }
4679 _ => Err(fidl::Error::UnknownOrdinal {
4680 ordinal: header.ordinal,
4681 protocol_name:
4682 <IoportResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4683 }),
4684 }))
4685 },
4686 )
4687 }
4688}
4689
4690#[derive(Debug)]
4692pub enum IoportResourceRequest {
4693 Get { responder: IoportResourceGetResponder },
4695}
4696
4697impl IoportResourceRequest {
4698 #[allow(irrefutable_let_patterns)]
4699 pub fn into_get(self) -> Option<(IoportResourceGetResponder)> {
4700 if let IoportResourceRequest::Get { responder } = self {
4701 Some((responder))
4702 } else {
4703 None
4704 }
4705 }
4706
4707 pub fn method_name(&self) -> &'static str {
4709 match *self {
4710 IoportResourceRequest::Get { .. } => "get",
4711 }
4712 }
4713}
4714
4715#[derive(Debug, Clone)]
4716pub struct IoportResourceControlHandle {
4717 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4718}
4719
4720impl fidl::endpoints::ControlHandle for IoportResourceControlHandle {
4721 fn shutdown(&self) {
4722 self.inner.shutdown()
4723 }
4724 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4725 self.inner.shutdown_with_epitaph(status)
4726 }
4727
4728 fn is_closed(&self) -> bool {
4729 self.inner.channel().is_closed()
4730 }
4731 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4732 self.inner.channel().on_closed()
4733 }
4734
4735 #[cfg(target_os = "fuchsia")]
4736 fn signal_peer(
4737 &self,
4738 clear_mask: zx::Signals,
4739 set_mask: zx::Signals,
4740 ) -> Result<(), zx_status::Status> {
4741 use fidl::Peered;
4742 self.inner.channel().signal_peer(clear_mask, set_mask)
4743 }
4744}
4745
4746impl IoportResourceControlHandle {}
4747
4748#[must_use = "FIDL methods require a response to be sent"]
4749#[derive(Debug)]
4750pub struct IoportResourceGetResponder {
4751 control_handle: std::mem::ManuallyDrop<IoportResourceControlHandle>,
4752 tx_id: u32,
4753}
4754
4755impl std::ops::Drop for IoportResourceGetResponder {
4759 fn drop(&mut self) {
4760 self.control_handle.shutdown();
4761 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4763 }
4764}
4765
4766impl fidl::endpoints::Responder for IoportResourceGetResponder {
4767 type ControlHandle = IoportResourceControlHandle;
4768
4769 fn control_handle(&self) -> &IoportResourceControlHandle {
4770 &self.control_handle
4771 }
4772
4773 fn drop_without_shutdown(mut self) {
4774 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4776 std::mem::forget(self);
4778 }
4779}
4780
4781impl IoportResourceGetResponder {
4782 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
4786 let _result = self.send_raw(resource);
4787 if _result.is_err() {
4788 self.control_handle.shutdown();
4789 }
4790 self.drop_without_shutdown();
4791 _result
4792 }
4793
4794 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
4796 let _result = self.send_raw(resource);
4797 self.drop_without_shutdown();
4798 _result
4799 }
4800
4801 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
4802 self.control_handle.inner.send::<IoportResourceGetResponse>(
4803 (resource,),
4804 self.tx_id,
4805 0x4db20876b537c52b,
4806 fidl::encoding::DynamicFlags::empty(),
4807 )
4808 }
4809}
4810
4811#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4812pub struct IrqResourceMarker;
4813
4814impl fidl::endpoints::ProtocolMarker for IrqResourceMarker {
4815 type Proxy = IrqResourceProxy;
4816 type RequestStream = IrqResourceRequestStream;
4817 #[cfg(target_os = "fuchsia")]
4818 type SynchronousProxy = IrqResourceSynchronousProxy;
4819
4820 const DEBUG_NAME: &'static str = "fuchsia.kernel.IrqResource";
4821}
4822impl fidl::endpoints::DiscoverableProtocolMarker for IrqResourceMarker {}
4823
4824pub trait IrqResourceProxyInterface: Send + Sync {
4825 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
4826 fn r#get(&self) -> Self::GetResponseFut;
4827}
4828#[derive(Debug)]
4829#[cfg(target_os = "fuchsia")]
4830pub struct IrqResourceSynchronousProxy {
4831 client: fidl::client::sync::Client,
4832}
4833
4834#[cfg(target_os = "fuchsia")]
4835impl fidl::endpoints::SynchronousProxy for IrqResourceSynchronousProxy {
4836 type Proxy = IrqResourceProxy;
4837 type Protocol = IrqResourceMarker;
4838
4839 fn from_channel(inner: fidl::Channel) -> Self {
4840 Self::new(inner)
4841 }
4842
4843 fn into_channel(self) -> fidl::Channel {
4844 self.client.into_channel()
4845 }
4846
4847 fn as_channel(&self) -> &fidl::Channel {
4848 self.client.as_channel()
4849 }
4850}
4851
4852#[cfg(target_os = "fuchsia")]
4853impl IrqResourceSynchronousProxy {
4854 pub fn new(channel: fidl::Channel) -> Self {
4855 let protocol_name = <IrqResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4856 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4857 }
4858
4859 pub fn into_channel(self) -> fidl::Channel {
4860 self.client.into_channel()
4861 }
4862
4863 pub fn wait_for_event(
4866 &self,
4867 deadline: zx::MonotonicInstant,
4868 ) -> Result<IrqResourceEvent, fidl::Error> {
4869 IrqResourceEvent::decode(self.client.wait_for_event(deadline)?)
4870 }
4871
4872 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
4874 let _response =
4875 self.client.send_query::<fidl::encoding::EmptyPayload, IrqResourceGetResponse>(
4876 (),
4877 0x491be54504b041e9,
4878 fidl::encoding::DynamicFlags::empty(),
4879 ___deadline,
4880 )?;
4881 Ok(_response.resource)
4882 }
4883}
4884
4885#[cfg(target_os = "fuchsia")]
4886impl From<IrqResourceSynchronousProxy> for zx::Handle {
4887 fn from(value: IrqResourceSynchronousProxy) -> Self {
4888 value.into_channel().into()
4889 }
4890}
4891
4892#[cfg(target_os = "fuchsia")]
4893impl From<fidl::Channel> for IrqResourceSynchronousProxy {
4894 fn from(value: fidl::Channel) -> Self {
4895 Self::new(value)
4896 }
4897}
4898
4899#[derive(Debug, Clone)]
4900pub struct IrqResourceProxy {
4901 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4902}
4903
4904impl fidl::endpoints::Proxy for IrqResourceProxy {
4905 type Protocol = IrqResourceMarker;
4906
4907 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4908 Self::new(inner)
4909 }
4910
4911 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4912 self.client.into_channel().map_err(|client| Self { client })
4913 }
4914
4915 fn as_channel(&self) -> &::fidl::AsyncChannel {
4916 self.client.as_channel()
4917 }
4918}
4919
4920impl IrqResourceProxy {
4921 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4923 let protocol_name = <IrqResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4924 Self { client: fidl::client::Client::new(channel, protocol_name) }
4925 }
4926
4927 pub fn take_event_stream(&self) -> IrqResourceEventStream {
4933 IrqResourceEventStream { event_receiver: self.client.take_event_receiver() }
4934 }
4935
4936 pub fn r#get(
4938 &self,
4939 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
4940 {
4941 IrqResourceProxyInterface::r#get(self)
4942 }
4943}
4944
4945impl IrqResourceProxyInterface for IrqResourceProxy {
4946 type GetResponseFut = fidl::client::QueryResponseFut<
4947 fidl::Resource,
4948 fidl::encoding::DefaultFuchsiaResourceDialect,
4949 >;
4950 fn r#get(&self) -> Self::GetResponseFut {
4951 fn _decode(
4952 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4953 ) -> Result<fidl::Resource, fidl::Error> {
4954 let _response = fidl::client::decode_transaction_body::<
4955 IrqResourceGetResponse,
4956 fidl::encoding::DefaultFuchsiaResourceDialect,
4957 0x491be54504b041e9,
4958 >(_buf?)?;
4959 Ok(_response.resource)
4960 }
4961 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
4962 (),
4963 0x491be54504b041e9,
4964 fidl::encoding::DynamicFlags::empty(),
4965 _decode,
4966 )
4967 }
4968}
4969
4970pub struct IrqResourceEventStream {
4971 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4972}
4973
4974impl std::marker::Unpin for IrqResourceEventStream {}
4975
4976impl futures::stream::FusedStream for IrqResourceEventStream {
4977 fn is_terminated(&self) -> bool {
4978 self.event_receiver.is_terminated()
4979 }
4980}
4981
4982impl futures::Stream for IrqResourceEventStream {
4983 type Item = Result<IrqResourceEvent, fidl::Error>;
4984
4985 fn poll_next(
4986 mut self: std::pin::Pin<&mut Self>,
4987 cx: &mut std::task::Context<'_>,
4988 ) -> std::task::Poll<Option<Self::Item>> {
4989 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4990 &mut self.event_receiver,
4991 cx
4992 )?) {
4993 Some(buf) => std::task::Poll::Ready(Some(IrqResourceEvent::decode(buf))),
4994 None => std::task::Poll::Ready(None),
4995 }
4996 }
4997}
4998
4999#[derive(Debug)]
5000pub enum IrqResourceEvent {}
5001
5002impl IrqResourceEvent {
5003 fn decode(
5005 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5006 ) -> Result<IrqResourceEvent, fidl::Error> {
5007 let (bytes, _handles) = buf.split_mut();
5008 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5009 debug_assert_eq!(tx_header.tx_id, 0);
5010 match tx_header.ordinal {
5011 _ => Err(fidl::Error::UnknownOrdinal {
5012 ordinal: tx_header.ordinal,
5013 protocol_name: <IrqResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5014 }),
5015 }
5016 }
5017}
5018
5019pub struct IrqResourceRequestStream {
5021 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5022 is_terminated: bool,
5023}
5024
5025impl std::marker::Unpin for IrqResourceRequestStream {}
5026
5027impl futures::stream::FusedStream for IrqResourceRequestStream {
5028 fn is_terminated(&self) -> bool {
5029 self.is_terminated
5030 }
5031}
5032
5033impl fidl::endpoints::RequestStream for IrqResourceRequestStream {
5034 type Protocol = IrqResourceMarker;
5035 type ControlHandle = IrqResourceControlHandle;
5036
5037 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5038 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5039 }
5040
5041 fn control_handle(&self) -> Self::ControlHandle {
5042 IrqResourceControlHandle { inner: self.inner.clone() }
5043 }
5044
5045 fn into_inner(
5046 self,
5047 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5048 {
5049 (self.inner, self.is_terminated)
5050 }
5051
5052 fn from_inner(
5053 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5054 is_terminated: bool,
5055 ) -> Self {
5056 Self { inner, is_terminated }
5057 }
5058}
5059
5060impl futures::Stream for IrqResourceRequestStream {
5061 type Item = Result<IrqResourceRequest, fidl::Error>;
5062
5063 fn poll_next(
5064 mut self: std::pin::Pin<&mut Self>,
5065 cx: &mut std::task::Context<'_>,
5066 ) -> std::task::Poll<Option<Self::Item>> {
5067 let this = &mut *self;
5068 if this.inner.check_shutdown(cx) {
5069 this.is_terminated = true;
5070 return std::task::Poll::Ready(None);
5071 }
5072 if this.is_terminated {
5073 panic!("polled IrqResourceRequestStream after completion");
5074 }
5075 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5076 |bytes, handles| {
5077 match this.inner.channel().read_etc(cx, bytes, handles) {
5078 std::task::Poll::Ready(Ok(())) => {}
5079 std::task::Poll::Pending => return std::task::Poll::Pending,
5080 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5081 this.is_terminated = true;
5082 return std::task::Poll::Ready(None);
5083 }
5084 std::task::Poll::Ready(Err(e)) => {
5085 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5086 e.into(),
5087 ))))
5088 }
5089 }
5090
5091 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5093
5094 std::task::Poll::Ready(Some(match header.ordinal {
5095 0x491be54504b041e9 => {
5096 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5097 let mut req = fidl::new_empty!(
5098 fidl::encoding::EmptyPayload,
5099 fidl::encoding::DefaultFuchsiaResourceDialect
5100 );
5101 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5102 let control_handle = IrqResourceControlHandle { inner: this.inner.clone() };
5103 Ok(IrqResourceRequest::Get {
5104 responder: IrqResourceGetResponder {
5105 control_handle: std::mem::ManuallyDrop::new(control_handle),
5106 tx_id: header.tx_id,
5107 },
5108 })
5109 }
5110 _ => Err(fidl::Error::UnknownOrdinal {
5111 ordinal: header.ordinal,
5112 protocol_name:
5113 <IrqResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5114 }),
5115 }))
5116 },
5117 )
5118 }
5119}
5120
5121#[derive(Debug)]
5123pub enum IrqResourceRequest {
5124 Get { responder: IrqResourceGetResponder },
5126}
5127
5128impl IrqResourceRequest {
5129 #[allow(irrefutable_let_patterns)]
5130 pub fn into_get(self) -> Option<(IrqResourceGetResponder)> {
5131 if let IrqResourceRequest::Get { responder } = self {
5132 Some((responder))
5133 } else {
5134 None
5135 }
5136 }
5137
5138 pub fn method_name(&self) -> &'static str {
5140 match *self {
5141 IrqResourceRequest::Get { .. } => "get",
5142 }
5143 }
5144}
5145
5146#[derive(Debug, Clone)]
5147pub struct IrqResourceControlHandle {
5148 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5149}
5150
5151impl fidl::endpoints::ControlHandle for IrqResourceControlHandle {
5152 fn shutdown(&self) {
5153 self.inner.shutdown()
5154 }
5155 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5156 self.inner.shutdown_with_epitaph(status)
5157 }
5158
5159 fn is_closed(&self) -> bool {
5160 self.inner.channel().is_closed()
5161 }
5162 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5163 self.inner.channel().on_closed()
5164 }
5165
5166 #[cfg(target_os = "fuchsia")]
5167 fn signal_peer(
5168 &self,
5169 clear_mask: zx::Signals,
5170 set_mask: zx::Signals,
5171 ) -> Result<(), zx_status::Status> {
5172 use fidl::Peered;
5173 self.inner.channel().signal_peer(clear_mask, set_mask)
5174 }
5175}
5176
5177impl IrqResourceControlHandle {}
5178
5179#[must_use = "FIDL methods require a response to be sent"]
5180#[derive(Debug)]
5181pub struct IrqResourceGetResponder {
5182 control_handle: std::mem::ManuallyDrop<IrqResourceControlHandle>,
5183 tx_id: u32,
5184}
5185
5186impl std::ops::Drop for IrqResourceGetResponder {
5190 fn drop(&mut self) {
5191 self.control_handle.shutdown();
5192 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5194 }
5195}
5196
5197impl fidl::endpoints::Responder for IrqResourceGetResponder {
5198 type ControlHandle = IrqResourceControlHandle;
5199
5200 fn control_handle(&self) -> &IrqResourceControlHandle {
5201 &self.control_handle
5202 }
5203
5204 fn drop_without_shutdown(mut self) {
5205 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5207 std::mem::forget(self);
5209 }
5210}
5211
5212impl IrqResourceGetResponder {
5213 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
5217 let _result = self.send_raw(resource);
5218 if _result.is_err() {
5219 self.control_handle.shutdown();
5220 }
5221 self.drop_without_shutdown();
5222 _result
5223 }
5224
5225 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
5227 let _result = self.send_raw(resource);
5228 self.drop_without_shutdown();
5229 _result
5230 }
5231
5232 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
5233 self.control_handle.inner.send::<IrqResourceGetResponse>(
5234 (resource,),
5235 self.tx_id,
5236 0x491be54504b041e9,
5237 fidl::encoding::DynamicFlags::empty(),
5238 )
5239 }
5240}
5241
5242#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5243pub struct MexecResourceMarker;
5244
5245impl fidl::endpoints::ProtocolMarker for MexecResourceMarker {
5246 type Proxy = MexecResourceProxy;
5247 type RequestStream = MexecResourceRequestStream;
5248 #[cfg(target_os = "fuchsia")]
5249 type SynchronousProxy = MexecResourceSynchronousProxy;
5250
5251 const DEBUG_NAME: &'static str = "fuchsia.kernel.MexecResource";
5252}
5253impl fidl::endpoints::DiscoverableProtocolMarker for MexecResourceMarker {}
5254
5255pub trait MexecResourceProxyInterface: Send + Sync {
5256 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
5257 fn r#get(&self) -> Self::GetResponseFut;
5258}
5259#[derive(Debug)]
5260#[cfg(target_os = "fuchsia")]
5261pub struct MexecResourceSynchronousProxy {
5262 client: fidl::client::sync::Client,
5263}
5264
5265#[cfg(target_os = "fuchsia")]
5266impl fidl::endpoints::SynchronousProxy for MexecResourceSynchronousProxy {
5267 type Proxy = MexecResourceProxy;
5268 type Protocol = MexecResourceMarker;
5269
5270 fn from_channel(inner: fidl::Channel) -> Self {
5271 Self::new(inner)
5272 }
5273
5274 fn into_channel(self) -> fidl::Channel {
5275 self.client.into_channel()
5276 }
5277
5278 fn as_channel(&self) -> &fidl::Channel {
5279 self.client.as_channel()
5280 }
5281}
5282
5283#[cfg(target_os = "fuchsia")]
5284impl MexecResourceSynchronousProxy {
5285 pub fn new(channel: fidl::Channel) -> Self {
5286 let protocol_name = <MexecResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5287 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5288 }
5289
5290 pub fn into_channel(self) -> fidl::Channel {
5291 self.client.into_channel()
5292 }
5293
5294 pub fn wait_for_event(
5297 &self,
5298 deadline: zx::MonotonicInstant,
5299 ) -> Result<MexecResourceEvent, fidl::Error> {
5300 MexecResourceEvent::decode(self.client.wait_for_event(deadline)?)
5301 }
5302
5303 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
5305 let _response =
5306 self.client.send_query::<fidl::encoding::EmptyPayload, MexecResourceGetResponse>(
5307 (),
5308 0xff93e6722900f54,
5309 fidl::encoding::DynamicFlags::empty(),
5310 ___deadline,
5311 )?;
5312 Ok(_response.resource)
5313 }
5314}
5315
5316#[cfg(target_os = "fuchsia")]
5317impl From<MexecResourceSynchronousProxy> for zx::Handle {
5318 fn from(value: MexecResourceSynchronousProxy) -> Self {
5319 value.into_channel().into()
5320 }
5321}
5322
5323#[cfg(target_os = "fuchsia")]
5324impl From<fidl::Channel> for MexecResourceSynchronousProxy {
5325 fn from(value: fidl::Channel) -> Self {
5326 Self::new(value)
5327 }
5328}
5329
5330#[derive(Debug, Clone)]
5331pub struct MexecResourceProxy {
5332 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5333}
5334
5335impl fidl::endpoints::Proxy for MexecResourceProxy {
5336 type Protocol = MexecResourceMarker;
5337
5338 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5339 Self::new(inner)
5340 }
5341
5342 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5343 self.client.into_channel().map_err(|client| Self { client })
5344 }
5345
5346 fn as_channel(&self) -> &::fidl::AsyncChannel {
5347 self.client.as_channel()
5348 }
5349}
5350
5351impl MexecResourceProxy {
5352 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5354 let protocol_name = <MexecResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5355 Self { client: fidl::client::Client::new(channel, protocol_name) }
5356 }
5357
5358 pub fn take_event_stream(&self) -> MexecResourceEventStream {
5364 MexecResourceEventStream { event_receiver: self.client.take_event_receiver() }
5365 }
5366
5367 pub fn r#get(
5369 &self,
5370 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
5371 {
5372 MexecResourceProxyInterface::r#get(self)
5373 }
5374}
5375
5376impl MexecResourceProxyInterface for MexecResourceProxy {
5377 type GetResponseFut = fidl::client::QueryResponseFut<
5378 fidl::Resource,
5379 fidl::encoding::DefaultFuchsiaResourceDialect,
5380 >;
5381 fn r#get(&self) -> Self::GetResponseFut {
5382 fn _decode(
5383 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5384 ) -> Result<fidl::Resource, fidl::Error> {
5385 let _response = fidl::client::decode_transaction_body::<
5386 MexecResourceGetResponse,
5387 fidl::encoding::DefaultFuchsiaResourceDialect,
5388 0xff93e6722900f54,
5389 >(_buf?)?;
5390 Ok(_response.resource)
5391 }
5392 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
5393 (),
5394 0xff93e6722900f54,
5395 fidl::encoding::DynamicFlags::empty(),
5396 _decode,
5397 )
5398 }
5399}
5400
5401pub struct MexecResourceEventStream {
5402 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5403}
5404
5405impl std::marker::Unpin for MexecResourceEventStream {}
5406
5407impl futures::stream::FusedStream for MexecResourceEventStream {
5408 fn is_terminated(&self) -> bool {
5409 self.event_receiver.is_terminated()
5410 }
5411}
5412
5413impl futures::Stream for MexecResourceEventStream {
5414 type Item = Result<MexecResourceEvent, fidl::Error>;
5415
5416 fn poll_next(
5417 mut self: std::pin::Pin<&mut Self>,
5418 cx: &mut std::task::Context<'_>,
5419 ) -> std::task::Poll<Option<Self::Item>> {
5420 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5421 &mut self.event_receiver,
5422 cx
5423 )?) {
5424 Some(buf) => std::task::Poll::Ready(Some(MexecResourceEvent::decode(buf))),
5425 None => std::task::Poll::Ready(None),
5426 }
5427 }
5428}
5429
5430#[derive(Debug)]
5431pub enum MexecResourceEvent {}
5432
5433impl MexecResourceEvent {
5434 fn decode(
5436 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5437 ) -> Result<MexecResourceEvent, fidl::Error> {
5438 let (bytes, _handles) = buf.split_mut();
5439 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5440 debug_assert_eq!(tx_header.tx_id, 0);
5441 match tx_header.ordinal {
5442 _ => Err(fidl::Error::UnknownOrdinal {
5443 ordinal: tx_header.ordinal,
5444 protocol_name: <MexecResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5445 }),
5446 }
5447 }
5448}
5449
5450pub struct MexecResourceRequestStream {
5452 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5453 is_terminated: bool,
5454}
5455
5456impl std::marker::Unpin for MexecResourceRequestStream {}
5457
5458impl futures::stream::FusedStream for MexecResourceRequestStream {
5459 fn is_terminated(&self) -> bool {
5460 self.is_terminated
5461 }
5462}
5463
5464impl fidl::endpoints::RequestStream for MexecResourceRequestStream {
5465 type Protocol = MexecResourceMarker;
5466 type ControlHandle = MexecResourceControlHandle;
5467
5468 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5469 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5470 }
5471
5472 fn control_handle(&self) -> Self::ControlHandle {
5473 MexecResourceControlHandle { inner: self.inner.clone() }
5474 }
5475
5476 fn into_inner(
5477 self,
5478 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5479 {
5480 (self.inner, self.is_terminated)
5481 }
5482
5483 fn from_inner(
5484 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5485 is_terminated: bool,
5486 ) -> Self {
5487 Self { inner, is_terminated }
5488 }
5489}
5490
5491impl futures::Stream for MexecResourceRequestStream {
5492 type Item = Result<MexecResourceRequest, fidl::Error>;
5493
5494 fn poll_next(
5495 mut self: std::pin::Pin<&mut Self>,
5496 cx: &mut std::task::Context<'_>,
5497 ) -> std::task::Poll<Option<Self::Item>> {
5498 let this = &mut *self;
5499 if this.inner.check_shutdown(cx) {
5500 this.is_terminated = true;
5501 return std::task::Poll::Ready(None);
5502 }
5503 if this.is_terminated {
5504 panic!("polled MexecResourceRequestStream after completion");
5505 }
5506 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5507 |bytes, handles| {
5508 match this.inner.channel().read_etc(cx, bytes, handles) {
5509 std::task::Poll::Ready(Ok(())) => {}
5510 std::task::Poll::Pending => return std::task::Poll::Pending,
5511 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5512 this.is_terminated = true;
5513 return std::task::Poll::Ready(None);
5514 }
5515 std::task::Poll::Ready(Err(e)) => {
5516 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5517 e.into(),
5518 ))))
5519 }
5520 }
5521
5522 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5524
5525 std::task::Poll::Ready(Some(match header.ordinal {
5526 0xff93e6722900f54 => {
5527 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5528 let mut req = fidl::new_empty!(
5529 fidl::encoding::EmptyPayload,
5530 fidl::encoding::DefaultFuchsiaResourceDialect
5531 );
5532 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5533 let control_handle =
5534 MexecResourceControlHandle { inner: this.inner.clone() };
5535 Ok(MexecResourceRequest::Get {
5536 responder: MexecResourceGetResponder {
5537 control_handle: std::mem::ManuallyDrop::new(control_handle),
5538 tx_id: header.tx_id,
5539 },
5540 })
5541 }
5542 _ => Err(fidl::Error::UnknownOrdinal {
5543 ordinal: header.ordinal,
5544 protocol_name:
5545 <MexecResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5546 }),
5547 }))
5548 },
5549 )
5550 }
5551}
5552
5553#[derive(Debug)]
5556pub enum MexecResourceRequest {
5557 Get { responder: MexecResourceGetResponder },
5559}
5560
5561impl MexecResourceRequest {
5562 #[allow(irrefutable_let_patterns)]
5563 pub fn into_get(self) -> Option<(MexecResourceGetResponder)> {
5564 if let MexecResourceRequest::Get { responder } = self {
5565 Some((responder))
5566 } else {
5567 None
5568 }
5569 }
5570
5571 pub fn method_name(&self) -> &'static str {
5573 match *self {
5574 MexecResourceRequest::Get { .. } => "get",
5575 }
5576 }
5577}
5578
5579#[derive(Debug, Clone)]
5580pub struct MexecResourceControlHandle {
5581 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5582}
5583
5584impl fidl::endpoints::ControlHandle for MexecResourceControlHandle {
5585 fn shutdown(&self) {
5586 self.inner.shutdown()
5587 }
5588 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5589 self.inner.shutdown_with_epitaph(status)
5590 }
5591
5592 fn is_closed(&self) -> bool {
5593 self.inner.channel().is_closed()
5594 }
5595 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5596 self.inner.channel().on_closed()
5597 }
5598
5599 #[cfg(target_os = "fuchsia")]
5600 fn signal_peer(
5601 &self,
5602 clear_mask: zx::Signals,
5603 set_mask: zx::Signals,
5604 ) -> Result<(), zx_status::Status> {
5605 use fidl::Peered;
5606 self.inner.channel().signal_peer(clear_mask, set_mask)
5607 }
5608}
5609
5610impl MexecResourceControlHandle {}
5611
5612#[must_use = "FIDL methods require a response to be sent"]
5613#[derive(Debug)]
5614pub struct MexecResourceGetResponder {
5615 control_handle: std::mem::ManuallyDrop<MexecResourceControlHandle>,
5616 tx_id: u32,
5617}
5618
5619impl std::ops::Drop for MexecResourceGetResponder {
5623 fn drop(&mut self) {
5624 self.control_handle.shutdown();
5625 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5627 }
5628}
5629
5630impl fidl::endpoints::Responder for MexecResourceGetResponder {
5631 type ControlHandle = MexecResourceControlHandle;
5632
5633 fn control_handle(&self) -> &MexecResourceControlHandle {
5634 &self.control_handle
5635 }
5636
5637 fn drop_without_shutdown(mut self) {
5638 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5640 std::mem::forget(self);
5642 }
5643}
5644
5645impl MexecResourceGetResponder {
5646 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
5650 let _result = self.send_raw(resource);
5651 if _result.is_err() {
5652 self.control_handle.shutdown();
5653 }
5654 self.drop_without_shutdown();
5655 _result
5656 }
5657
5658 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
5660 let _result = self.send_raw(resource);
5661 self.drop_without_shutdown();
5662 _result
5663 }
5664
5665 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
5666 self.control_handle.inner.send::<MexecResourceGetResponse>(
5667 (resource,),
5668 self.tx_id,
5669 0xff93e6722900f54,
5670 fidl::encoding::DynamicFlags::empty(),
5671 )
5672 }
5673}
5674
5675#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5676pub struct MmioResourceMarker;
5677
5678impl fidl::endpoints::ProtocolMarker for MmioResourceMarker {
5679 type Proxy = MmioResourceProxy;
5680 type RequestStream = MmioResourceRequestStream;
5681 #[cfg(target_os = "fuchsia")]
5682 type SynchronousProxy = MmioResourceSynchronousProxy;
5683
5684 const DEBUG_NAME: &'static str = "fuchsia.kernel.MmioResource";
5685}
5686impl fidl::endpoints::DiscoverableProtocolMarker for MmioResourceMarker {}
5687
5688pub trait MmioResourceProxyInterface: Send + Sync {
5689 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
5690 fn r#get(&self) -> Self::GetResponseFut;
5691}
5692#[derive(Debug)]
5693#[cfg(target_os = "fuchsia")]
5694pub struct MmioResourceSynchronousProxy {
5695 client: fidl::client::sync::Client,
5696}
5697
5698#[cfg(target_os = "fuchsia")]
5699impl fidl::endpoints::SynchronousProxy for MmioResourceSynchronousProxy {
5700 type Proxy = MmioResourceProxy;
5701 type Protocol = MmioResourceMarker;
5702
5703 fn from_channel(inner: fidl::Channel) -> Self {
5704 Self::new(inner)
5705 }
5706
5707 fn into_channel(self) -> fidl::Channel {
5708 self.client.into_channel()
5709 }
5710
5711 fn as_channel(&self) -> &fidl::Channel {
5712 self.client.as_channel()
5713 }
5714}
5715
5716#[cfg(target_os = "fuchsia")]
5717impl MmioResourceSynchronousProxy {
5718 pub fn new(channel: fidl::Channel) -> Self {
5719 let protocol_name = <MmioResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5720 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5721 }
5722
5723 pub fn into_channel(self) -> fidl::Channel {
5724 self.client.into_channel()
5725 }
5726
5727 pub fn wait_for_event(
5730 &self,
5731 deadline: zx::MonotonicInstant,
5732 ) -> Result<MmioResourceEvent, fidl::Error> {
5733 MmioResourceEvent::decode(self.client.wait_for_event(deadline)?)
5734 }
5735
5736 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
5738 let _response =
5739 self.client.send_query::<fidl::encoding::EmptyPayload, MmioResourceGetResponse>(
5740 (),
5741 0x66747b9c5a6dfe7b,
5742 fidl::encoding::DynamicFlags::empty(),
5743 ___deadline,
5744 )?;
5745 Ok(_response.resource)
5746 }
5747}
5748
5749#[cfg(target_os = "fuchsia")]
5750impl From<MmioResourceSynchronousProxy> for zx::Handle {
5751 fn from(value: MmioResourceSynchronousProxy) -> Self {
5752 value.into_channel().into()
5753 }
5754}
5755
5756#[cfg(target_os = "fuchsia")]
5757impl From<fidl::Channel> for MmioResourceSynchronousProxy {
5758 fn from(value: fidl::Channel) -> Self {
5759 Self::new(value)
5760 }
5761}
5762
5763#[derive(Debug, Clone)]
5764pub struct MmioResourceProxy {
5765 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5766}
5767
5768impl fidl::endpoints::Proxy for MmioResourceProxy {
5769 type Protocol = MmioResourceMarker;
5770
5771 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5772 Self::new(inner)
5773 }
5774
5775 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5776 self.client.into_channel().map_err(|client| Self { client })
5777 }
5778
5779 fn as_channel(&self) -> &::fidl::AsyncChannel {
5780 self.client.as_channel()
5781 }
5782}
5783
5784impl MmioResourceProxy {
5785 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5787 let protocol_name = <MmioResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5788 Self { client: fidl::client::Client::new(channel, protocol_name) }
5789 }
5790
5791 pub fn take_event_stream(&self) -> MmioResourceEventStream {
5797 MmioResourceEventStream { event_receiver: self.client.take_event_receiver() }
5798 }
5799
5800 pub fn r#get(
5802 &self,
5803 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
5804 {
5805 MmioResourceProxyInterface::r#get(self)
5806 }
5807}
5808
5809impl MmioResourceProxyInterface for MmioResourceProxy {
5810 type GetResponseFut = fidl::client::QueryResponseFut<
5811 fidl::Resource,
5812 fidl::encoding::DefaultFuchsiaResourceDialect,
5813 >;
5814 fn r#get(&self) -> Self::GetResponseFut {
5815 fn _decode(
5816 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5817 ) -> Result<fidl::Resource, fidl::Error> {
5818 let _response = fidl::client::decode_transaction_body::<
5819 MmioResourceGetResponse,
5820 fidl::encoding::DefaultFuchsiaResourceDialect,
5821 0x66747b9c5a6dfe7b,
5822 >(_buf?)?;
5823 Ok(_response.resource)
5824 }
5825 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
5826 (),
5827 0x66747b9c5a6dfe7b,
5828 fidl::encoding::DynamicFlags::empty(),
5829 _decode,
5830 )
5831 }
5832}
5833
5834pub struct MmioResourceEventStream {
5835 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5836}
5837
5838impl std::marker::Unpin for MmioResourceEventStream {}
5839
5840impl futures::stream::FusedStream for MmioResourceEventStream {
5841 fn is_terminated(&self) -> bool {
5842 self.event_receiver.is_terminated()
5843 }
5844}
5845
5846impl futures::Stream for MmioResourceEventStream {
5847 type Item = Result<MmioResourceEvent, fidl::Error>;
5848
5849 fn poll_next(
5850 mut self: std::pin::Pin<&mut Self>,
5851 cx: &mut std::task::Context<'_>,
5852 ) -> std::task::Poll<Option<Self::Item>> {
5853 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5854 &mut self.event_receiver,
5855 cx
5856 )?) {
5857 Some(buf) => std::task::Poll::Ready(Some(MmioResourceEvent::decode(buf))),
5858 None => std::task::Poll::Ready(None),
5859 }
5860 }
5861}
5862
5863#[derive(Debug)]
5864pub enum MmioResourceEvent {}
5865
5866impl MmioResourceEvent {
5867 fn decode(
5869 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5870 ) -> Result<MmioResourceEvent, fidl::Error> {
5871 let (bytes, _handles) = buf.split_mut();
5872 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5873 debug_assert_eq!(tx_header.tx_id, 0);
5874 match tx_header.ordinal {
5875 _ => Err(fidl::Error::UnknownOrdinal {
5876 ordinal: tx_header.ordinal,
5877 protocol_name: <MmioResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5878 }),
5879 }
5880 }
5881}
5882
5883pub struct MmioResourceRequestStream {
5885 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5886 is_terminated: bool,
5887}
5888
5889impl std::marker::Unpin for MmioResourceRequestStream {}
5890
5891impl futures::stream::FusedStream for MmioResourceRequestStream {
5892 fn is_terminated(&self) -> bool {
5893 self.is_terminated
5894 }
5895}
5896
5897impl fidl::endpoints::RequestStream for MmioResourceRequestStream {
5898 type Protocol = MmioResourceMarker;
5899 type ControlHandle = MmioResourceControlHandle;
5900
5901 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5902 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5903 }
5904
5905 fn control_handle(&self) -> Self::ControlHandle {
5906 MmioResourceControlHandle { inner: self.inner.clone() }
5907 }
5908
5909 fn into_inner(
5910 self,
5911 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5912 {
5913 (self.inner, self.is_terminated)
5914 }
5915
5916 fn from_inner(
5917 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5918 is_terminated: bool,
5919 ) -> Self {
5920 Self { inner, is_terminated }
5921 }
5922}
5923
5924impl futures::Stream for MmioResourceRequestStream {
5925 type Item = Result<MmioResourceRequest, fidl::Error>;
5926
5927 fn poll_next(
5928 mut self: std::pin::Pin<&mut Self>,
5929 cx: &mut std::task::Context<'_>,
5930 ) -> std::task::Poll<Option<Self::Item>> {
5931 let this = &mut *self;
5932 if this.inner.check_shutdown(cx) {
5933 this.is_terminated = true;
5934 return std::task::Poll::Ready(None);
5935 }
5936 if this.is_terminated {
5937 panic!("polled MmioResourceRequestStream after completion");
5938 }
5939 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5940 |bytes, handles| {
5941 match this.inner.channel().read_etc(cx, bytes, handles) {
5942 std::task::Poll::Ready(Ok(())) => {}
5943 std::task::Poll::Pending => return std::task::Poll::Pending,
5944 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5945 this.is_terminated = true;
5946 return std::task::Poll::Ready(None);
5947 }
5948 std::task::Poll::Ready(Err(e)) => {
5949 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5950 e.into(),
5951 ))))
5952 }
5953 }
5954
5955 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5957
5958 std::task::Poll::Ready(Some(match header.ordinal {
5959 0x66747b9c5a6dfe7b => {
5960 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5961 let mut req = fidl::new_empty!(
5962 fidl::encoding::EmptyPayload,
5963 fidl::encoding::DefaultFuchsiaResourceDialect
5964 );
5965 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5966 let control_handle =
5967 MmioResourceControlHandle { inner: this.inner.clone() };
5968 Ok(MmioResourceRequest::Get {
5969 responder: MmioResourceGetResponder {
5970 control_handle: std::mem::ManuallyDrop::new(control_handle),
5971 tx_id: header.tx_id,
5972 },
5973 })
5974 }
5975 _ => Err(fidl::Error::UnknownOrdinal {
5976 ordinal: header.ordinal,
5977 protocol_name:
5978 <MmioResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5979 }),
5980 }))
5981 },
5982 )
5983 }
5984}
5985
5986#[derive(Debug)]
5988pub enum MmioResourceRequest {
5989 Get { responder: MmioResourceGetResponder },
5991}
5992
5993impl MmioResourceRequest {
5994 #[allow(irrefutable_let_patterns)]
5995 pub fn into_get(self) -> Option<(MmioResourceGetResponder)> {
5996 if let MmioResourceRequest::Get { responder } = self {
5997 Some((responder))
5998 } else {
5999 None
6000 }
6001 }
6002
6003 pub fn method_name(&self) -> &'static str {
6005 match *self {
6006 MmioResourceRequest::Get { .. } => "get",
6007 }
6008 }
6009}
6010
6011#[derive(Debug, Clone)]
6012pub struct MmioResourceControlHandle {
6013 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6014}
6015
6016impl fidl::endpoints::ControlHandle for MmioResourceControlHandle {
6017 fn shutdown(&self) {
6018 self.inner.shutdown()
6019 }
6020 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6021 self.inner.shutdown_with_epitaph(status)
6022 }
6023
6024 fn is_closed(&self) -> bool {
6025 self.inner.channel().is_closed()
6026 }
6027 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6028 self.inner.channel().on_closed()
6029 }
6030
6031 #[cfg(target_os = "fuchsia")]
6032 fn signal_peer(
6033 &self,
6034 clear_mask: zx::Signals,
6035 set_mask: zx::Signals,
6036 ) -> Result<(), zx_status::Status> {
6037 use fidl::Peered;
6038 self.inner.channel().signal_peer(clear_mask, set_mask)
6039 }
6040}
6041
6042impl MmioResourceControlHandle {}
6043
6044#[must_use = "FIDL methods require a response to be sent"]
6045#[derive(Debug)]
6046pub struct MmioResourceGetResponder {
6047 control_handle: std::mem::ManuallyDrop<MmioResourceControlHandle>,
6048 tx_id: u32,
6049}
6050
6051impl std::ops::Drop for MmioResourceGetResponder {
6055 fn drop(&mut self) {
6056 self.control_handle.shutdown();
6057 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6059 }
6060}
6061
6062impl fidl::endpoints::Responder for MmioResourceGetResponder {
6063 type ControlHandle = MmioResourceControlHandle;
6064
6065 fn control_handle(&self) -> &MmioResourceControlHandle {
6066 &self.control_handle
6067 }
6068
6069 fn drop_without_shutdown(mut self) {
6070 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6072 std::mem::forget(self);
6074 }
6075}
6076
6077impl MmioResourceGetResponder {
6078 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6082 let _result = self.send_raw(resource);
6083 if _result.is_err() {
6084 self.control_handle.shutdown();
6085 }
6086 self.drop_without_shutdown();
6087 _result
6088 }
6089
6090 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6092 let _result = self.send_raw(resource);
6093 self.drop_without_shutdown();
6094 _result
6095 }
6096
6097 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6098 self.control_handle.inner.send::<MmioResourceGetResponse>(
6099 (resource,),
6100 self.tx_id,
6101 0x66747b9c5a6dfe7b,
6102 fidl::encoding::DynamicFlags::empty(),
6103 )
6104 }
6105}
6106
6107#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6108pub struct MsiResourceMarker;
6109
6110impl fidl::endpoints::ProtocolMarker for MsiResourceMarker {
6111 type Proxy = MsiResourceProxy;
6112 type RequestStream = MsiResourceRequestStream;
6113 #[cfg(target_os = "fuchsia")]
6114 type SynchronousProxy = MsiResourceSynchronousProxy;
6115
6116 const DEBUG_NAME: &'static str = "fuchsia.kernel.MsiResource";
6117}
6118impl fidl::endpoints::DiscoverableProtocolMarker for MsiResourceMarker {}
6119
6120pub trait MsiResourceProxyInterface: Send + Sync {
6121 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
6122 fn r#get(&self) -> Self::GetResponseFut;
6123}
6124#[derive(Debug)]
6125#[cfg(target_os = "fuchsia")]
6126pub struct MsiResourceSynchronousProxy {
6127 client: fidl::client::sync::Client,
6128}
6129
6130#[cfg(target_os = "fuchsia")]
6131impl fidl::endpoints::SynchronousProxy for MsiResourceSynchronousProxy {
6132 type Proxy = MsiResourceProxy;
6133 type Protocol = MsiResourceMarker;
6134
6135 fn from_channel(inner: fidl::Channel) -> Self {
6136 Self::new(inner)
6137 }
6138
6139 fn into_channel(self) -> fidl::Channel {
6140 self.client.into_channel()
6141 }
6142
6143 fn as_channel(&self) -> &fidl::Channel {
6144 self.client.as_channel()
6145 }
6146}
6147
6148#[cfg(target_os = "fuchsia")]
6149impl MsiResourceSynchronousProxy {
6150 pub fn new(channel: fidl::Channel) -> Self {
6151 let protocol_name = <MsiResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6152 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6153 }
6154
6155 pub fn into_channel(self) -> fidl::Channel {
6156 self.client.into_channel()
6157 }
6158
6159 pub fn wait_for_event(
6162 &self,
6163 deadline: zx::MonotonicInstant,
6164 ) -> Result<MsiResourceEvent, fidl::Error> {
6165 MsiResourceEvent::decode(self.client.wait_for_event(deadline)?)
6166 }
6167
6168 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
6170 let _response =
6171 self.client.send_query::<fidl::encoding::EmptyPayload, MsiResourceGetResponse>(
6172 (),
6173 0x360a97e47e8c4f1f,
6174 fidl::encoding::DynamicFlags::empty(),
6175 ___deadline,
6176 )?;
6177 Ok(_response.resource)
6178 }
6179}
6180
6181#[cfg(target_os = "fuchsia")]
6182impl From<MsiResourceSynchronousProxy> for zx::Handle {
6183 fn from(value: MsiResourceSynchronousProxy) -> Self {
6184 value.into_channel().into()
6185 }
6186}
6187
6188#[cfg(target_os = "fuchsia")]
6189impl From<fidl::Channel> for MsiResourceSynchronousProxy {
6190 fn from(value: fidl::Channel) -> Self {
6191 Self::new(value)
6192 }
6193}
6194
6195#[derive(Debug, Clone)]
6196pub struct MsiResourceProxy {
6197 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6198}
6199
6200impl fidl::endpoints::Proxy for MsiResourceProxy {
6201 type Protocol = MsiResourceMarker;
6202
6203 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6204 Self::new(inner)
6205 }
6206
6207 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6208 self.client.into_channel().map_err(|client| Self { client })
6209 }
6210
6211 fn as_channel(&self) -> &::fidl::AsyncChannel {
6212 self.client.as_channel()
6213 }
6214}
6215
6216impl MsiResourceProxy {
6217 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6219 let protocol_name = <MsiResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6220 Self { client: fidl::client::Client::new(channel, protocol_name) }
6221 }
6222
6223 pub fn take_event_stream(&self) -> MsiResourceEventStream {
6229 MsiResourceEventStream { event_receiver: self.client.take_event_receiver() }
6230 }
6231
6232 pub fn r#get(
6234 &self,
6235 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
6236 {
6237 MsiResourceProxyInterface::r#get(self)
6238 }
6239}
6240
6241impl MsiResourceProxyInterface for MsiResourceProxy {
6242 type GetResponseFut = fidl::client::QueryResponseFut<
6243 fidl::Resource,
6244 fidl::encoding::DefaultFuchsiaResourceDialect,
6245 >;
6246 fn r#get(&self) -> Self::GetResponseFut {
6247 fn _decode(
6248 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6249 ) -> Result<fidl::Resource, fidl::Error> {
6250 let _response = fidl::client::decode_transaction_body::<
6251 MsiResourceGetResponse,
6252 fidl::encoding::DefaultFuchsiaResourceDialect,
6253 0x360a97e47e8c4f1f,
6254 >(_buf?)?;
6255 Ok(_response.resource)
6256 }
6257 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
6258 (),
6259 0x360a97e47e8c4f1f,
6260 fidl::encoding::DynamicFlags::empty(),
6261 _decode,
6262 )
6263 }
6264}
6265
6266pub struct MsiResourceEventStream {
6267 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6268}
6269
6270impl std::marker::Unpin for MsiResourceEventStream {}
6271
6272impl futures::stream::FusedStream for MsiResourceEventStream {
6273 fn is_terminated(&self) -> bool {
6274 self.event_receiver.is_terminated()
6275 }
6276}
6277
6278impl futures::Stream for MsiResourceEventStream {
6279 type Item = Result<MsiResourceEvent, fidl::Error>;
6280
6281 fn poll_next(
6282 mut self: std::pin::Pin<&mut Self>,
6283 cx: &mut std::task::Context<'_>,
6284 ) -> std::task::Poll<Option<Self::Item>> {
6285 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6286 &mut self.event_receiver,
6287 cx
6288 )?) {
6289 Some(buf) => std::task::Poll::Ready(Some(MsiResourceEvent::decode(buf))),
6290 None => std::task::Poll::Ready(None),
6291 }
6292 }
6293}
6294
6295#[derive(Debug)]
6296pub enum MsiResourceEvent {}
6297
6298impl MsiResourceEvent {
6299 fn decode(
6301 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6302 ) -> Result<MsiResourceEvent, fidl::Error> {
6303 let (bytes, _handles) = buf.split_mut();
6304 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6305 debug_assert_eq!(tx_header.tx_id, 0);
6306 match tx_header.ordinal {
6307 _ => Err(fidl::Error::UnknownOrdinal {
6308 ordinal: tx_header.ordinal,
6309 protocol_name: <MsiResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6310 }),
6311 }
6312 }
6313}
6314
6315pub struct MsiResourceRequestStream {
6317 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6318 is_terminated: bool,
6319}
6320
6321impl std::marker::Unpin for MsiResourceRequestStream {}
6322
6323impl futures::stream::FusedStream for MsiResourceRequestStream {
6324 fn is_terminated(&self) -> bool {
6325 self.is_terminated
6326 }
6327}
6328
6329impl fidl::endpoints::RequestStream for MsiResourceRequestStream {
6330 type Protocol = MsiResourceMarker;
6331 type ControlHandle = MsiResourceControlHandle;
6332
6333 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6334 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6335 }
6336
6337 fn control_handle(&self) -> Self::ControlHandle {
6338 MsiResourceControlHandle { inner: self.inner.clone() }
6339 }
6340
6341 fn into_inner(
6342 self,
6343 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6344 {
6345 (self.inner, self.is_terminated)
6346 }
6347
6348 fn from_inner(
6349 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6350 is_terminated: bool,
6351 ) -> Self {
6352 Self { inner, is_terminated }
6353 }
6354}
6355
6356impl futures::Stream for MsiResourceRequestStream {
6357 type Item = Result<MsiResourceRequest, fidl::Error>;
6358
6359 fn poll_next(
6360 mut self: std::pin::Pin<&mut Self>,
6361 cx: &mut std::task::Context<'_>,
6362 ) -> std::task::Poll<Option<Self::Item>> {
6363 let this = &mut *self;
6364 if this.inner.check_shutdown(cx) {
6365 this.is_terminated = true;
6366 return std::task::Poll::Ready(None);
6367 }
6368 if this.is_terminated {
6369 panic!("polled MsiResourceRequestStream after completion");
6370 }
6371 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6372 |bytes, handles| {
6373 match this.inner.channel().read_etc(cx, bytes, handles) {
6374 std::task::Poll::Ready(Ok(())) => {}
6375 std::task::Poll::Pending => return std::task::Poll::Pending,
6376 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6377 this.is_terminated = true;
6378 return std::task::Poll::Ready(None);
6379 }
6380 std::task::Poll::Ready(Err(e)) => {
6381 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6382 e.into(),
6383 ))))
6384 }
6385 }
6386
6387 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6389
6390 std::task::Poll::Ready(Some(match header.ordinal {
6391 0x360a97e47e8c4f1f => {
6392 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6393 let mut req = fidl::new_empty!(
6394 fidl::encoding::EmptyPayload,
6395 fidl::encoding::DefaultFuchsiaResourceDialect
6396 );
6397 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6398 let control_handle = MsiResourceControlHandle { inner: this.inner.clone() };
6399 Ok(MsiResourceRequest::Get {
6400 responder: MsiResourceGetResponder {
6401 control_handle: std::mem::ManuallyDrop::new(control_handle),
6402 tx_id: header.tx_id,
6403 },
6404 })
6405 }
6406 _ => Err(fidl::Error::UnknownOrdinal {
6407 ordinal: header.ordinal,
6408 protocol_name:
6409 <MsiResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6410 }),
6411 }))
6412 },
6413 )
6414 }
6415}
6416
6417#[derive(Debug)]
6420pub enum MsiResourceRequest {
6421 Get { responder: MsiResourceGetResponder },
6423}
6424
6425impl MsiResourceRequest {
6426 #[allow(irrefutable_let_patterns)]
6427 pub fn into_get(self) -> Option<(MsiResourceGetResponder)> {
6428 if let MsiResourceRequest::Get { responder } = self {
6429 Some((responder))
6430 } else {
6431 None
6432 }
6433 }
6434
6435 pub fn method_name(&self) -> &'static str {
6437 match *self {
6438 MsiResourceRequest::Get { .. } => "get",
6439 }
6440 }
6441}
6442
6443#[derive(Debug, Clone)]
6444pub struct MsiResourceControlHandle {
6445 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6446}
6447
6448impl fidl::endpoints::ControlHandle for MsiResourceControlHandle {
6449 fn shutdown(&self) {
6450 self.inner.shutdown()
6451 }
6452 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6453 self.inner.shutdown_with_epitaph(status)
6454 }
6455
6456 fn is_closed(&self) -> bool {
6457 self.inner.channel().is_closed()
6458 }
6459 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6460 self.inner.channel().on_closed()
6461 }
6462
6463 #[cfg(target_os = "fuchsia")]
6464 fn signal_peer(
6465 &self,
6466 clear_mask: zx::Signals,
6467 set_mask: zx::Signals,
6468 ) -> Result<(), zx_status::Status> {
6469 use fidl::Peered;
6470 self.inner.channel().signal_peer(clear_mask, set_mask)
6471 }
6472}
6473
6474impl MsiResourceControlHandle {}
6475
6476#[must_use = "FIDL methods require a response to be sent"]
6477#[derive(Debug)]
6478pub struct MsiResourceGetResponder {
6479 control_handle: std::mem::ManuallyDrop<MsiResourceControlHandle>,
6480 tx_id: u32,
6481}
6482
6483impl std::ops::Drop for MsiResourceGetResponder {
6487 fn drop(&mut self) {
6488 self.control_handle.shutdown();
6489 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6491 }
6492}
6493
6494impl fidl::endpoints::Responder for MsiResourceGetResponder {
6495 type ControlHandle = MsiResourceControlHandle;
6496
6497 fn control_handle(&self) -> &MsiResourceControlHandle {
6498 &self.control_handle
6499 }
6500
6501 fn drop_without_shutdown(mut self) {
6502 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6504 std::mem::forget(self);
6506 }
6507}
6508
6509impl MsiResourceGetResponder {
6510 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6514 let _result = self.send_raw(resource);
6515 if _result.is_err() {
6516 self.control_handle.shutdown();
6517 }
6518 self.drop_without_shutdown();
6519 _result
6520 }
6521
6522 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6524 let _result = self.send_raw(resource);
6525 self.drop_without_shutdown();
6526 _result
6527 }
6528
6529 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6530 self.control_handle.inner.send::<MsiResourceGetResponse>(
6531 (resource,),
6532 self.tx_id,
6533 0x360a97e47e8c4f1f,
6534 fidl::encoding::DynamicFlags::empty(),
6535 )
6536 }
6537}
6538
6539#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6540pub struct PowerResourceMarker;
6541
6542impl fidl::endpoints::ProtocolMarker for PowerResourceMarker {
6543 type Proxy = PowerResourceProxy;
6544 type RequestStream = PowerResourceRequestStream;
6545 #[cfg(target_os = "fuchsia")]
6546 type SynchronousProxy = PowerResourceSynchronousProxy;
6547
6548 const DEBUG_NAME: &'static str = "fuchsia.kernel.PowerResource";
6549}
6550impl fidl::endpoints::DiscoverableProtocolMarker for PowerResourceMarker {}
6551
6552pub trait PowerResourceProxyInterface: Send + Sync {
6553 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
6554 fn r#get(&self) -> Self::GetResponseFut;
6555}
6556#[derive(Debug)]
6557#[cfg(target_os = "fuchsia")]
6558pub struct PowerResourceSynchronousProxy {
6559 client: fidl::client::sync::Client,
6560}
6561
6562#[cfg(target_os = "fuchsia")]
6563impl fidl::endpoints::SynchronousProxy for PowerResourceSynchronousProxy {
6564 type Proxy = PowerResourceProxy;
6565 type Protocol = PowerResourceMarker;
6566
6567 fn from_channel(inner: fidl::Channel) -> Self {
6568 Self::new(inner)
6569 }
6570
6571 fn into_channel(self) -> fidl::Channel {
6572 self.client.into_channel()
6573 }
6574
6575 fn as_channel(&self) -> &fidl::Channel {
6576 self.client.as_channel()
6577 }
6578}
6579
6580#[cfg(target_os = "fuchsia")]
6581impl PowerResourceSynchronousProxy {
6582 pub fn new(channel: fidl::Channel) -> Self {
6583 let protocol_name = <PowerResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6584 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6585 }
6586
6587 pub fn into_channel(self) -> fidl::Channel {
6588 self.client.into_channel()
6589 }
6590
6591 pub fn wait_for_event(
6594 &self,
6595 deadline: zx::MonotonicInstant,
6596 ) -> Result<PowerResourceEvent, fidl::Error> {
6597 PowerResourceEvent::decode(self.client.wait_for_event(deadline)?)
6598 }
6599
6600 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
6602 let _response =
6603 self.client.send_query::<fidl::encoding::EmptyPayload, PowerResourceGetResponse>(
6604 (),
6605 0x2b8df8ca24d1e866,
6606 fidl::encoding::DynamicFlags::empty(),
6607 ___deadline,
6608 )?;
6609 Ok(_response.resource)
6610 }
6611}
6612
6613#[cfg(target_os = "fuchsia")]
6614impl From<PowerResourceSynchronousProxy> for zx::Handle {
6615 fn from(value: PowerResourceSynchronousProxy) -> Self {
6616 value.into_channel().into()
6617 }
6618}
6619
6620#[cfg(target_os = "fuchsia")]
6621impl From<fidl::Channel> for PowerResourceSynchronousProxy {
6622 fn from(value: fidl::Channel) -> Self {
6623 Self::new(value)
6624 }
6625}
6626
6627#[derive(Debug, Clone)]
6628pub struct PowerResourceProxy {
6629 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6630}
6631
6632impl fidl::endpoints::Proxy for PowerResourceProxy {
6633 type Protocol = PowerResourceMarker;
6634
6635 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6636 Self::new(inner)
6637 }
6638
6639 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6640 self.client.into_channel().map_err(|client| Self { client })
6641 }
6642
6643 fn as_channel(&self) -> &::fidl::AsyncChannel {
6644 self.client.as_channel()
6645 }
6646}
6647
6648impl PowerResourceProxy {
6649 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6651 let protocol_name = <PowerResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6652 Self { client: fidl::client::Client::new(channel, protocol_name) }
6653 }
6654
6655 pub fn take_event_stream(&self) -> PowerResourceEventStream {
6661 PowerResourceEventStream { event_receiver: self.client.take_event_receiver() }
6662 }
6663
6664 pub fn r#get(
6666 &self,
6667 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
6668 {
6669 PowerResourceProxyInterface::r#get(self)
6670 }
6671}
6672
6673impl PowerResourceProxyInterface for PowerResourceProxy {
6674 type GetResponseFut = fidl::client::QueryResponseFut<
6675 fidl::Resource,
6676 fidl::encoding::DefaultFuchsiaResourceDialect,
6677 >;
6678 fn r#get(&self) -> Self::GetResponseFut {
6679 fn _decode(
6680 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6681 ) -> Result<fidl::Resource, fidl::Error> {
6682 let _response = fidl::client::decode_transaction_body::<
6683 PowerResourceGetResponse,
6684 fidl::encoding::DefaultFuchsiaResourceDialect,
6685 0x2b8df8ca24d1e866,
6686 >(_buf?)?;
6687 Ok(_response.resource)
6688 }
6689 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
6690 (),
6691 0x2b8df8ca24d1e866,
6692 fidl::encoding::DynamicFlags::empty(),
6693 _decode,
6694 )
6695 }
6696}
6697
6698pub struct PowerResourceEventStream {
6699 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6700}
6701
6702impl std::marker::Unpin for PowerResourceEventStream {}
6703
6704impl futures::stream::FusedStream for PowerResourceEventStream {
6705 fn is_terminated(&self) -> bool {
6706 self.event_receiver.is_terminated()
6707 }
6708}
6709
6710impl futures::Stream for PowerResourceEventStream {
6711 type Item = Result<PowerResourceEvent, fidl::Error>;
6712
6713 fn poll_next(
6714 mut self: std::pin::Pin<&mut Self>,
6715 cx: &mut std::task::Context<'_>,
6716 ) -> std::task::Poll<Option<Self::Item>> {
6717 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6718 &mut self.event_receiver,
6719 cx
6720 )?) {
6721 Some(buf) => std::task::Poll::Ready(Some(PowerResourceEvent::decode(buf))),
6722 None => std::task::Poll::Ready(None),
6723 }
6724 }
6725}
6726
6727#[derive(Debug)]
6728pub enum PowerResourceEvent {}
6729
6730impl PowerResourceEvent {
6731 fn decode(
6733 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6734 ) -> Result<PowerResourceEvent, fidl::Error> {
6735 let (bytes, _handles) = buf.split_mut();
6736 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6737 debug_assert_eq!(tx_header.tx_id, 0);
6738 match tx_header.ordinal {
6739 _ => Err(fidl::Error::UnknownOrdinal {
6740 ordinal: tx_header.ordinal,
6741 protocol_name: <PowerResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6742 }),
6743 }
6744 }
6745}
6746
6747pub struct PowerResourceRequestStream {
6749 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6750 is_terminated: bool,
6751}
6752
6753impl std::marker::Unpin for PowerResourceRequestStream {}
6754
6755impl futures::stream::FusedStream for PowerResourceRequestStream {
6756 fn is_terminated(&self) -> bool {
6757 self.is_terminated
6758 }
6759}
6760
6761impl fidl::endpoints::RequestStream for PowerResourceRequestStream {
6762 type Protocol = PowerResourceMarker;
6763 type ControlHandle = PowerResourceControlHandle;
6764
6765 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6766 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6767 }
6768
6769 fn control_handle(&self) -> Self::ControlHandle {
6770 PowerResourceControlHandle { inner: self.inner.clone() }
6771 }
6772
6773 fn into_inner(
6774 self,
6775 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6776 {
6777 (self.inner, self.is_terminated)
6778 }
6779
6780 fn from_inner(
6781 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6782 is_terminated: bool,
6783 ) -> Self {
6784 Self { inner, is_terminated }
6785 }
6786}
6787
6788impl futures::Stream for PowerResourceRequestStream {
6789 type Item = Result<PowerResourceRequest, fidl::Error>;
6790
6791 fn poll_next(
6792 mut self: std::pin::Pin<&mut Self>,
6793 cx: &mut std::task::Context<'_>,
6794 ) -> std::task::Poll<Option<Self::Item>> {
6795 let this = &mut *self;
6796 if this.inner.check_shutdown(cx) {
6797 this.is_terminated = true;
6798 return std::task::Poll::Ready(None);
6799 }
6800 if this.is_terminated {
6801 panic!("polled PowerResourceRequestStream after completion");
6802 }
6803 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6804 |bytes, handles| {
6805 match this.inner.channel().read_etc(cx, bytes, handles) {
6806 std::task::Poll::Ready(Ok(())) => {}
6807 std::task::Poll::Pending => return std::task::Poll::Pending,
6808 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6809 this.is_terminated = true;
6810 return std::task::Poll::Ready(None);
6811 }
6812 std::task::Poll::Ready(Err(e)) => {
6813 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6814 e.into(),
6815 ))))
6816 }
6817 }
6818
6819 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6821
6822 std::task::Poll::Ready(Some(match header.ordinal {
6823 0x2b8df8ca24d1e866 => {
6824 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6825 let mut req = fidl::new_empty!(
6826 fidl::encoding::EmptyPayload,
6827 fidl::encoding::DefaultFuchsiaResourceDialect
6828 );
6829 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6830 let control_handle =
6831 PowerResourceControlHandle { inner: this.inner.clone() };
6832 Ok(PowerResourceRequest::Get {
6833 responder: PowerResourceGetResponder {
6834 control_handle: std::mem::ManuallyDrop::new(control_handle),
6835 tx_id: header.tx_id,
6836 },
6837 })
6838 }
6839 _ => Err(fidl::Error::UnknownOrdinal {
6840 ordinal: header.ordinal,
6841 protocol_name:
6842 <PowerResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6843 }),
6844 }))
6845 },
6846 )
6847 }
6848}
6849
6850#[derive(Debug)]
6853pub enum PowerResourceRequest {
6854 Get { responder: PowerResourceGetResponder },
6856}
6857
6858impl PowerResourceRequest {
6859 #[allow(irrefutable_let_patterns)]
6860 pub fn into_get(self) -> Option<(PowerResourceGetResponder)> {
6861 if let PowerResourceRequest::Get { responder } = self {
6862 Some((responder))
6863 } else {
6864 None
6865 }
6866 }
6867
6868 pub fn method_name(&self) -> &'static str {
6870 match *self {
6871 PowerResourceRequest::Get { .. } => "get",
6872 }
6873 }
6874}
6875
6876#[derive(Debug, Clone)]
6877pub struct PowerResourceControlHandle {
6878 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6879}
6880
6881impl fidl::endpoints::ControlHandle for PowerResourceControlHandle {
6882 fn shutdown(&self) {
6883 self.inner.shutdown()
6884 }
6885 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6886 self.inner.shutdown_with_epitaph(status)
6887 }
6888
6889 fn is_closed(&self) -> bool {
6890 self.inner.channel().is_closed()
6891 }
6892 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6893 self.inner.channel().on_closed()
6894 }
6895
6896 #[cfg(target_os = "fuchsia")]
6897 fn signal_peer(
6898 &self,
6899 clear_mask: zx::Signals,
6900 set_mask: zx::Signals,
6901 ) -> Result<(), zx_status::Status> {
6902 use fidl::Peered;
6903 self.inner.channel().signal_peer(clear_mask, set_mask)
6904 }
6905}
6906
6907impl PowerResourceControlHandle {}
6908
6909#[must_use = "FIDL methods require a response to be sent"]
6910#[derive(Debug)]
6911pub struct PowerResourceGetResponder {
6912 control_handle: std::mem::ManuallyDrop<PowerResourceControlHandle>,
6913 tx_id: u32,
6914}
6915
6916impl std::ops::Drop for PowerResourceGetResponder {
6920 fn drop(&mut self) {
6921 self.control_handle.shutdown();
6922 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6924 }
6925}
6926
6927impl fidl::endpoints::Responder for PowerResourceGetResponder {
6928 type ControlHandle = PowerResourceControlHandle;
6929
6930 fn control_handle(&self) -> &PowerResourceControlHandle {
6931 &self.control_handle
6932 }
6933
6934 fn drop_without_shutdown(mut self) {
6935 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6937 std::mem::forget(self);
6939 }
6940}
6941
6942impl PowerResourceGetResponder {
6943 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6947 let _result = self.send_raw(resource);
6948 if _result.is_err() {
6949 self.control_handle.shutdown();
6950 }
6951 self.drop_without_shutdown();
6952 _result
6953 }
6954
6955 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6957 let _result = self.send_raw(resource);
6958 self.drop_without_shutdown();
6959 _result
6960 }
6961
6962 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
6963 self.control_handle.inner.send::<PowerResourceGetResponse>(
6964 (resource,),
6965 self.tx_id,
6966 0x2b8df8ca24d1e866,
6967 fidl::encoding::DynamicFlags::empty(),
6968 )
6969 }
6970}
6971
6972#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6973pub struct ProfileResourceMarker;
6974
6975impl fidl::endpoints::ProtocolMarker for ProfileResourceMarker {
6976 type Proxy = ProfileResourceProxy;
6977 type RequestStream = ProfileResourceRequestStream;
6978 #[cfg(target_os = "fuchsia")]
6979 type SynchronousProxy = ProfileResourceSynchronousProxy;
6980
6981 const DEBUG_NAME: &'static str = "fuchsia.kernel.ProfileResource";
6982}
6983impl fidl::endpoints::DiscoverableProtocolMarker for ProfileResourceMarker {}
6984
6985pub trait ProfileResourceProxyInterface: Send + Sync {
6986 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
6987 fn r#get(&self) -> Self::GetResponseFut;
6988}
6989#[derive(Debug)]
6990#[cfg(target_os = "fuchsia")]
6991pub struct ProfileResourceSynchronousProxy {
6992 client: fidl::client::sync::Client,
6993}
6994
6995#[cfg(target_os = "fuchsia")]
6996impl fidl::endpoints::SynchronousProxy for ProfileResourceSynchronousProxy {
6997 type Proxy = ProfileResourceProxy;
6998 type Protocol = ProfileResourceMarker;
6999
7000 fn from_channel(inner: fidl::Channel) -> Self {
7001 Self::new(inner)
7002 }
7003
7004 fn into_channel(self) -> fidl::Channel {
7005 self.client.into_channel()
7006 }
7007
7008 fn as_channel(&self) -> &fidl::Channel {
7009 self.client.as_channel()
7010 }
7011}
7012
7013#[cfg(target_os = "fuchsia")]
7014impl ProfileResourceSynchronousProxy {
7015 pub fn new(channel: fidl::Channel) -> Self {
7016 let protocol_name = <ProfileResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7017 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7018 }
7019
7020 pub fn into_channel(self) -> fidl::Channel {
7021 self.client.into_channel()
7022 }
7023
7024 pub fn wait_for_event(
7027 &self,
7028 deadline: zx::MonotonicInstant,
7029 ) -> Result<ProfileResourceEvent, fidl::Error> {
7030 ProfileResourceEvent::decode(self.client.wait_for_event(deadline)?)
7031 }
7032
7033 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
7035 let _response =
7036 self.client.send_query::<fidl::encoding::EmptyPayload, ProfileResourceGetResponse>(
7037 (),
7038 0x3003a0c14de1fa86,
7039 fidl::encoding::DynamicFlags::empty(),
7040 ___deadline,
7041 )?;
7042 Ok(_response.resource)
7043 }
7044}
7045
7046#[cfg(target_os = "fuchsia")]
7047impl From<ProfileResourceSynchronousProxy> for zx::Handle {
7048 fn from(value: ProfileResourceSynchronousProxy) -> Self {
7049 value.into_channel().into()
7050 }
7051}
7052
7053#[cfg(target_os = "fuchsia")]
7054impl From<fidl::Channel> for ProfileResourceSynchronousProxy {
7055 fn from(value: fidl::Channel) -> Self {
7056 Self::new(value)
7057 }
7058}
7059
7060#[derive(Debug, Clone)]
7061pub struct ProfileResourceProxy {
7062 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7063}
7064
7065impl fidl::endpoints::Proxy for ProfileResourceProxy {
7066 type Protocol = ProfileResourceMarker;
7067
7068 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7069 Self::new(inner)
7070 }
7071
7072 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7073 self.client.into_channel().map_err(|client| Self { client })
7074 }
7075
7076 fn as_channel(&self) -> &::fidl::AsyncChannel {
7077 self.client.as_channel()
7078 }
7079}
7080
7081impl ProfileResourceProxy {
7082 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7084 let protocol_name = <ProfileResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7085 Self { client: fidl::client::Client::new(channel, protocol_name) }
7086 }
7087
7088 pub fn take_event_stream(&self) -> ProfileResourceEventStream {
7094 ProfileResourceEventStream { event_receiver: self.client.take_event_receiver() }
7095 }
7096
7097 pub fn r#get(
7099 &self,
7100 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
7101 {
7102 ProfileResourceProxyInterface::r#get(self)
7103 }
7104}
7105
7106impl ProfileResourceProxyInterface for ProfileResourceProxy {
7107 type GetResponseFut = fidl::client::QueryResponseFut<
7108 fidl::Resource,
7109 fidl::encoding::DefaultFuchsiaResourceDialect,
7110 >;
7111 fn r#get(&self) -> Self::GetResponseFut {
7112 fn _decode(
7113 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7114 ) -> Result<fidl::Resource, fidl::Error> {
7115 let _response = fidl::client::decode_transaction_body::<
7116 ProfileResourceGetResponse,
7117 fidl::encoding::DefaultFuchsiaResourceDialect,
7118 0x3003a0c14de1fa86,
7119 >(_buf?)?;
7120 Ok(_response.resource)
7121 }
7122 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
7123 (),
7124 0x3003a0c14de1fa86,
7125 fidl::encoding::DynamicFlags::empty(),
7126 _decode,
7127 )
7128 }
7129}
7130
7131pub struct ProfileResourceEventStream {
7132 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7133}
7134
7135impl std::marker::Unpin for ProfileResourceEventStream {}
7136
7137impl futures::stream::FusedStream for ProfileResourceEventStream {
7138 fn is_terminated(&self) -> bool {
7139 self.event_receiver.is_terminated()
7140 }
7141}
7142
7143impl futures::Stream for ProfileResourceEventStream {
7144 type Item = Result<ProfileResourceEvent, fidl::Error>;
7145
7146 fn poll_next(
7147 mut self: std::pin::Pin<&mut Self>,
7148 cx: &mut std::task::Context<'_>,
7149 ) -> std::task::Poll<Option<Self::Item>> {
7150 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7151 &mut self.event_receiver,
7152 cx
7153 )?) {
7154 Some(buf) => std::task::Poll::Ready(Some(ProfileResourceEvent::decode(buf))),
7155 None => std::task::Poll::Ready(None),
7156 }
7157 }
7158}
7159
7160#[derive(Debug)]
7161pub enum ProfileResourceEvent {}
7162
7163impl ProfileResourceEvent {
7164 fn decode(
7166 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7167 ) -> Result<ProfileResourceEvent, fidl::Error> {
7168 let (bytes, _handles) = buf.split_mut();
7169 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7170 debug_assert_eq!(tx_header.tx_id, 0);
7171 match tx_header.ordinal {
7172 _ => Err(fidl::Error::UnknownOrdinal {
7173 ordinal: tx_header.ordinal,
7174 protocol_name:
7175 <ProfileResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7176 }),
7177 }
7178 }
7179}
7180
7181pub struct ProfileResourceRequestStream {
7183 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7184 is_terminated: bool,
7185}
7186
7187impl std::marker::Unpin for ProfileResourceRequestStream {}
7188
7189impl futures::stream::FusedStream for ProfileResourceRequestStream {
7190 fn is_terminated(&self) -> bool {
7191 self.is_terminated
7192 }
7193}
7194
7195impl fidl::endpoints::RequestStream for ProfileResourceRequestStream {
7196 type Protocol = ProfileResourceMarker;
7197 type ControlHandle = ProfileResourceControlHandle;
7198
7199 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7200 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7201 }
7202
7203 fn control_handle(&self) -> Self::ControlHandle {
7204 ProfileResourceControlHandle { inner: self.inner.clone() }
7205 }
7206
7207 fn into_inner(
7208 self,
7209 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7210 {
7211 (self.inner, self.is_terminated)
7212 }
7213
7214 fn from_inner(
7215 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7216 is_terminated: bool,
7217 ) -> Self {
7218 Self { inner, is_terminated }
7219 }
7220}
7221
7222impl futures::Stream for ProfileResourceRequestStream {
7223 type Item = Result<ProfileResourceRequest, fidl::Error>;
7224
7225 fn poll_next(
7226 mut self: std::pin::Pin<&mut Self>,
7227 cx: &mut std::task::Context<'_>,
7228 ) -> std::task::Poll<Option<Self::Item>> {
7229 let this = &mut *self;
7230 if this.inner.check_shutdown(cx) {
7231 this.is_terminated = true;
7232 return std::task::Poll::Ready(None);
7233 }
7234 if this.is_terminated {
7235 panic!("polled ProfileResourceRequestStream after completion");
7236 }
7237 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7238 |bytes, handles| {
7239 match this.inner.channel().read_etc(cx, bytes, handles) {
7240 std::task::Poll::Ready(Ok(())) => {}
7241 std::task::Poll::Pending => return std::task::Poll::Pending,
7242 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7243 this.is_terminated = true;
7244 return std::task::Poll::Ready(None);
7245 }
7246 std::task::Poll::Ready(Err(e)) => {
7247 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7248 e.into(),
7249 ))))
7250 }
7251 }
7252
7253 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7255
7256 std::task::Poll::Ready(Some(match header.ordinal {
7257 0x3003a0c14de1fa86 => {
7258 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7259 let mut req = fidl::new_empty!(
7260 fidl::encoding::EmptyPayload,
7261 fidl::encoding::DefaultFuchsiaResourceDialect
7262 );
7263 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7264 let control_handle =
7265 ProfileResourceControlHandle { inner: this.inner.clone() };
7266 Ok(ProfileResourceRequest::Get {
7267 responder: ProfileResourceGetResponder {
7268 control_handle: std::mem::ManuallyDrop::new(control_handle),
7269 tx_id: header.tx_id,
7270 },
7271 })
7272 }
7273 _ => Err(fidl::Error::UnknownOrdinal {
7274 ordinal: header.ordinal,
7275 protocol_name:
7276 <ProfileResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7277 }),
7278 }))
7279 },
7280 )
7281 }
7282}
7283
7284#[derive(Debug)]
7287pub enum ProfileResourceRequest {
7288 Get { responder: ProfileResourceGetResponder },
7290}
7291
7292impl ProfileResourceRequest {
7293 #[allow(irrefutable_let_patterns)]
7294 pub fn into_get(self) -> Option<(ProfileResourceGetResponder)> {
7295 if let ProfileResourceRequest::Get { responder } = self {
7296 Some((responder))
7297 } else {
7298 None
7299 }
7300 }
7301
7302 pub fn method_name(&self) -> &'static str {
7304 match *self {
7305 ProfileResourceRequest::Get { .. } => "get",
7306 }
7307 }
7308}
7309
7310#[derive(Debug, Clone)]
7311pub struct ProfileResourceControlHandle {
7312 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7313}
7314
7315impl fidl::endpoints::ControlHandle for ProfileResourceControlHandle {
7316 fn shutdown(&self) {
7317 self.inner.shutdown()
7318 }
7319 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7320 self.inner.shutdown_with_epitaph(status)
7321 }
7322
7323 fn is_closed(&self) -> bool {
7324 self.inner.channel().is_closed()
7325 }
7326 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7327 self.inner.channel().on_closed()
7328 }
7329
7330 #[cfg(target_os = "fuchsia")]
7331 fn signal_peer(
7332 &self,
7333 clear_mask: zx::Signals,
7334 set_mask: zx::Signals,
7335 ) -> Result<(), zx_status::Status> {
7336 use fidl::Peered;
7337 self.inner.channel().signal_peer(clear_mask, set_mask)
7338 }
7339}
7340
7341impl ProfileResourceControlHandle {}
7342
7343#[must_use = "FIDL methods require a response to be sent"]
7344#[derive(Debug)]
7345pub struct ProfileResourceGetResponder {
7346 control_handle: std::mem::ManuallyDrop<ProfileResourceControlHandle>,
7347 tx_id: u32,
7348}
7349
7350impl std::ops::Drop for ProfileResourceGetResponder {
7354 fn drop(&mut self) {
7355 self.control_handle.shutdown();
7356 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7358 }
7359}
7360
7361impl fidl::endpoints::Responder for ProfileResourceGetResponder {
7362 type ControlHandle = ProfileResourceControlHandle;
7363
7364 fn control_handle(&self) -> &ProfileResourceControlHandle {
7365 &self.control_handle
7366 }
7367
7368 fn drop_without_shutdown(mut self) {
7369 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7371 std::mem::forget(self);
7373 }
7374}
7375
7376impl ProfileResourceGetResponder {
7377 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
7381 let _result = self.send_raw(resource);
7382 if _result.is_err() {
7383 self.control_handle.shutdown();
7384 }
7385 self.drop_without_shutdown();
7386 _result
7387 }
7388
7389 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
7391 let _result = self.send_raw(resource);
7392 self.drop_without_shutdown();
7393 _result
7394 }
7395
7396 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
7397 self.control_handle.inner.send::<ProfileResourceGetResponse>(
7398 (resource,),
7399 self.tx_id,
7400 0x3003a0c14de1fa86,
7401 fidl::encoding::DynamicFlags::empty(),
7402 )
7403 }
7404}
7405
7406#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7407pub struct RootJobMarker;
7408
7409impl fidl::endpoints::ProtocolMarker for RootJobMarker {
7410 type Proxy = RootJobProxy;
7411 type RequestStream = RootJobRequestStream;
7412 #[cfg(target_os = "fuchsia")]
7413 type SynchronousProxy = RootJobSynchronousProxy;
7414
7415 const DEBUG_NAME: &'static str = "fuchsia.kernel.RootJob";
7416}
7417impl fidl::endpoints::DiscoverableProtocolMarker for RootJobMarker {}
7418
7419pub trait RootJobProxyInterface: Send + Sync {
7420 type GetResponseFut: std::future::Future<Output = Result<fidl::Job, fidl::Error>> + Send;
7421 fn r#get(&self) -> Self::GetResponseFut;
7422}
7423#[derive(Debug)]
7424#[cfg(target_os = "fuchsia")]
7425pub struct RootJobSynchronousProxy {
7426 client: fidl::client::sync::Client,
7427}
7428
7429#[cfg(target_os = "fuchsia")]
7430impl fidl::endpoints::SynchronousProxy for RootJobSynchronousProxy {
7431 type Proxy = RootJobProxy;
7432 type Protocol = RootJobMarker;
7433
7434 fn from_channel(inner: fidl::Channel) -> Self {
7435 Self::new(inner)
7436 }
7437
7438 fn into_channel(self) -> fidl::Channel {
7439 self.client.into_channel()
7440 }
7441
7442 fn as_channel(&self) -> &fidl::Channel {
7443 self.client.as_channel()
7444 }
7445}
7446
7447#[cfg(target_os = "fuchsia")]
7448impl RootJobSynchronousProxy {
7449 pub fn new(channel: fidl::Channel) -> Self {
7450 let protocol_name = <RootJobMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7451 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7452 }
7453
7454 pub fn into_channel(self) -> fidl::Channel {
7455 self.client.into_channel()
7456 }
7457
7458 pub fn wait_for_event(
7461 &self,
7462 deadline: zx::MonotonicInstant,
7463 ) -> Result<RootJobEvent, fidl::Error> {
7464 RootJobEvent::decode(self.client.wait_for_event(deadline)?)
7465 }
7466
7467 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Job, fidl::Error> {
7469 let _response =
7470 self.client.send_query::<fidl::encoding::EmptyPayload, RootJobGetResponse>(
7471 (),
7472 0x73acb63f93d53eac,
7473 fidl::encoding::DynamicFlags::empty(),
7474 ___deadline,
7475 )?;
7476 Ok(_response.job)
7477 }
7478}
7479
7480#[cfg(target_os = "fuchsia")]
7481impl From<RootJobSynchronousProxy> for zx::Handle {
7482 fn from(value: RootJobSynchronousProxy) -> Self {
7483 value.into_channel().into()
7484 }
7485}
7486
7487#[cfg(target_os = "fuchsia")]
7488impl From<fidl::Channel> for RootJobSynchronousProxy {
7489 fn from(value: fidl::Channel) -> Self {
7490 Self::new(value)
7491 }
7492}
7493
7494#[derive(Debug, Clone)]
7495pub struct RootJobProxy {
7496 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7497}
7498
7499impl fidl::endpoints::Proxy for RootJobProxy {
7500 type Protocol = RootJobMarker;
7501
7502 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7503 Self::new(inner)
7504 }
7505
7506 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7507 self.client.into_channel().map_err(|client| Self { client })
7508 }
7509
7510 fn as_channel(&self) -> &::fidl::AsyncChannel {
7511 self.client.as_channel()
7512 }
7513}
7514
7515impl RootJobProxy {
7516 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7518 let protocol_name = <RootJobMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7519 Self { client: fidl::client::Client::new(channel, protocol_name) }
7520 }
7521
7522 pub fn take_event_stream(&self) -> RootJobEventStream {
7528 RootJobEventStream { event_receiver: self.client.take_event_receiver() }
7529 }
7530
7531 pub fn r#get(
7533 &self,
7534 ) -> fidl::client::QueryResponseFut<fidl::Job, fidl::encoding::DefaultFuchsiaResourceDialect>
7535 {
7536 RootJobProxyInterface::r#get(self)
7537 }
7538}
7539
7540impl RootJobProxyInterface for RootJobProxy {
7541 type GetResponseFut =
7542 fidl::client::QueryResponseFut<fidl::Job, fidl::encoding::DefaultFuchsiaResourceDialect>;
7543 fn r#get(&self) -> Self::GetResponseFut {
7544 fn _decode(
7545 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7546 ) -> Result<fidl::Job, fidl::Error> {
7547 let _response = fidl::client::decode_transaction_body::<
7548 RootJobGetResponse,
7549 fidl::encoding::DefaultFuchsiaResourceDialect,
7550 0x73acb63f93d53eac,
7551 >(_buf?)?;
7552 Ok(_response.job)
7553 }
7554 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Job>(
7555 (),
7556 0x73acb63f93d53eac,
7557 fidl::encoding::DynamicFlags::empty(),
7558 _decode,
7559 )
7560 }
7561}
7562
7563pub struct RootJobEventStream {
7564 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7565}
7566
7567impl std::marker::Unpin for RootJobEventStream {}
7568
7569impl futures::stream::FusedStream for RootJobEventStream {
7570 fn is_terminated(&self) -> bool {
7571 self.event_receiver.is_terminated()
7572 }
7573}
7574
7575impl futures::Stream for RootJobEventStream {
7576 type Item = Result<RootJobEvent, fidl::Error>;
7577
7578 fn poll_next(
7579 mut self: std::pin::Pin<&mut Self>,
7580 cx: &mut std::task::Context<'_>,
7581 ) -> std::task::Poll<Option<Self::Item>> {
7582 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7583 &mut self.event_receiver,
7584 cx
7585 )?) {
7586 Some(buf) => std::task::Poll::Ready(Some(RootJobEvent::decode(buf))),
7587 None => std::task::Poll::Ready(None),
7588 }
7589 }
7590}
7591
7592#[derive(Debug)]
7593pub enum RootJobEvent {}
7594
7595impl RootJobEvent {
7596 fn decode(
7598 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7599 ) -> Result<RootJobEvent, fidl::Error> {
7600 let (bytes, _handles) = buf.split_mut();
7601 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7602 debug_assert_eq!(tx_header.tx_id, 0);
7603 match tx_header.ordinal {
7604 _ => Err(fidl::Error::UnknownOrdinal {
7605 ordinal: tx_header.ordinal,
7606 protocol_name: <RootJobMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7607 }),
7608 }
7609 }
7610}
7611
7612pub struct RootJobRequestStream {
7614 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7615 is_terminated: bool,
7616}
7617
7618impl std::marker::Unpin for RootJobRequestStream {}
7619
7620impl futures::stream::FusedStream for RootJobRequestStream {
7621 fn is_terminated(&self) -> bool {
7622 self.is_terminated
7623 }
7624}
7625
7626impl fidl::endpoints::RequestStream for RootJobRequestStream {
7627 type Protocol = RootJobMarker;
7628 type ControlHandle = RootJobControlHandle;
7629
7630 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7631 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7632 }
7633
7634 fn control_handle(&self) -> Self::ControlHandle {
7635 RootJobControlHandle { inner: self.inner.clone() }
7636 }
7637
7638 fn into_inner(
7639 self,
7640 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7641 {
7642 (self.inner, self.is_terminated)
7643 }
7644
7645 fn from_inner(
7646 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7647 is_terminated: bool,
7648 ) -> Self {
7649 Self { inner, is_terminated }
7650 }
7651}
7652
7653impl futures::Stream for RootJobRequestStream {
7654 type Item = Result<RootJobRequest, fidl::Error>;
7655
7656 fn poll_next(
7657 mut self: std::pin::Pin<&mut Self>,
7658 cx: &mut std::task::Context<'_>,
7659 ) -> std::task::Poll<Option<Self::Item>> {
7660 let this = &mut *self;
7661 if this.inner.check_shutdown(cx) {
7662 this.is_terminated = true;
7663 return std::task::Poll::Ready(None);
7664 }
7665 if this.is_terminated {
7666 panic!("polled RootJobRequestStream after completion");
7667 }
7668 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7669 |bytes, handles| {
7670 match this.inner.channel().read_etc(cx, bytes, handles) {
7671 std::task::Poll::Ready(Ok(())) => {}
7672 std::task::Poll::Pending => return std::task::Poll::Pending,
7673 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7674 this.is_terminated = true;
7675 return std::task::Poll::Ready(None);
7676 }
7677 std::task::Poll::Ready(Err(e)) => {
7678 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7679 e.into(),
7680 ))))
7681 }
7682 }
7683
7684 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7686
7687 std::task::Poll::Ready(Some(match header.ordinal {
7688 0x73acb63f93d53eac => {
7689 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7690 let mut req = fidl::new_empty!(
7691 fidl::encoding::EmptyPayload,
7692 fidl::encoding::DefaultFuchsiaResourceDialect
7693 );
7694 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7695 let control_handle = RootJobControlHandle { inner: this.inner.clone() };
7696 Ok(RootJobRequest::Get {
7697 responder: RootJobGetResponder {
7698 control_handle: std::mem::ManuallyDrop::new(control_handle),
7699 tx_id: header.tx_id,
7700 },
7701 })
7702 }
7703 _ => Err(fidl::Error::UnknownOrdinal {
7704 ordinal: header.ordinal,
7705 protocol_name:
7706 <RootJobMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7707 }),
7708 }))
7709 },
7710 )
7711 }
7712}
7713
7714#[derive(Debug)]
7718pub enum RootJobRequest {
7719 Get { responder: RootJobGetResponder },
7721}
7722
7723impl RootJobRequest {
7724 #[allow(irrefutable_let_patterns)]
7725 pub fn into_get(self) -> Option<(RootJobGetResponder)> {
7726 if let RootJobRequest::Get { responder } = self {
7727 Some((responder))
7728 } else {
7729 None
7730 }
7731 }
7732
7733 pub fn method_name(&self) -> &'static str {
7735 match *self {
7736 RootJobRequest::Get { .. } => "get",
7737 }
7738 }
7739}
7740
7741#[derive(Debug, Clone)]
7742pub struct RootJobControlHandle {
7743 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7744}
7745
7746impl fidl::endpoints::ControlHandle for RootJobControlHandle {
7747 fn shutdown(&self) {
7748 self.inner.shutdown()
7749 }
7750 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7751 self.inner.shutdown_with_epitaph(status)
7752 }
7753
7754 fn is_closed(&self) -> bool {
7755 self.inner.channel().is_closed()
7756 }
7757 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7758 self.inner.channel().on_closed()
7759 }
7760
7761 #[cfg(target_os = "fuchsia")]
7762 fn signal_peer(
7763 &self,
7764 clear_mask: zx::Signals,
7765 set_mask: zx::Signals,
7766 ) -> Result<(), zx_status::Status> {
7767 use fidl::Peered;
7768 self.inner.channel().signal_peer(clear_mask, set_mask)
7769 }
7770}
7771
7772impl RootJobControlHandle {}
7773
7774#[must_use = "FIDL methods require a response to be sent"]
7775#[derive(Debug)]
7776pub struct RootJobGetResponder {
7777 control_handle: std::mem::ManuallyDrop<RootJobControlHandle>,
7778 tx_id: u32,
7779}
7780
7781impl std::ops::Drop for RootJobGetResponder {
7785 fn drop(&mut self) {
7786 self.control_handle.shutdown();
7787 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7789 }
7790}
7791
7792impl fidl::endpoints::Responder for RootJobGetResponder {
7793 type ControlHandle = RootJobControlHandle;
7794
7795 fn control_handle(&self) -> &RootJobControlHandle {
7796 &self.control_handle
7797 }
7798
7799 fn drop_without_shutdown(mut self) {
7800 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7802 std::mem::forget(self);
7804 }
7805}
7806
7807impl RootJobGetResponder {
7808 pub fn send(self, mut job: fidl::Job) -> Result<(), fidl::Error> {
7812 let _result = self.send_raw(job);
7813 if _result.is_err() {
7814 self.control_handle.shutdown();
7815 }
7816 self.drop_without_shutdown();
7817 _result
7818 }
7819
7820 pub fn send_no_shutdown_on_err(self, mut job: fidl::Job) -> Result<(), fidl::Error> {
7822 let _result = self.send_raw(job);
7823 self.drop_without_shutdown();
7824 _result
7825 }
7826
7827 fn send_raw(&self, mut job: fidl::Job) -> Result<(), fidl::Error> {
7828 self.control_handle.inner.send::<RootJobGetResponse>(
7829 (job,),
7830 self.tx_id,
7831 0x73acb63f93d53eac,
7832 fidl::encoding::DynamicFlags::empty(),
7833 )
7834 }
7835}
7836
7837#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7838pub struct RootJobForInspectMarker;
7839
7840impl fidl::endpoints::ProtocolMarker for RootJobForInspectMarker {
7841 type Proxy = RootJobForInspectProxy;
7842 type RequestStream = RootJobForInspectRequestStream;
7843 #[cfg(target_os = "fuchsia")]
7844 type SynchronousProxy = RootJobForInspectSynchronousProxy;
7845
7846 const DEBUG_NAME: &'static str = "fuchsia.kernel.RootJobForInspect";
7847}
7848impl fidl::endpoints::DiscoverableProtocolMarker for RootJobForInspectMarker {}
7849
7850pub trait RootJobForInspectProxyInterface: Send + Sync {
7851 type GetResponseFut: std::future::Future<Output = Result<fidl::Job, fidl::Error>> + Send;
7852 fn r#get(&self) -> Self::GetResponseFut;
7853}
7854#[derive(Debug)]
7855#[cfg(target_os = "fuchsia")]
7856pub struct RootJobForInspectSynchronousProxy {
7857 client: fidl::client::sync::Client,
7858}
7859
7860#[cfg(target_os = "fuchsia")]
7861impl fidl::endpoints::SynchronousProxy for RootJobForInspectSynchronousProxy {
7862 type Proxy = RootJobForInspectProxy;
7863 type Protocol = RootJobForInspectMarker;
7864
7865 fn from_channel(inner: fidl::Channel) -> Self {
7866 Self::new(inner)
7867 }
7868
7869 fn into_channel(self) -> fidl::Channel {
7870 self.client.into_channel()
7871 }
7872
7873 fn as_channel(&self) -> &fidl::Channel {
7874 self.client.as_channel()
7875 }
7876}
7877
7878#[cfg(target_os = "fuchsia")]
7879impl RootJobForInspectSynchronousProxy {
7880 pub fn new(channel: fidl::Channel) -> Self {
7881 let protocol_name =
7882 <RootJobForInspectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7883 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7884 }
7885
7886 pub fn into_channel(self) -> fidl::Channel {
7887 self.client.into_channel()
7888 }
7889
7890 pub fn wait_for_event(
7893 &self,
7894 deadline: zx::MonotonicInstant,
7895 ) -> Result<RootJobForInspectEvent, fidl::Error> {
7896 RootJobForInspectEvent::decode(self.client.wait_for_event(deadline)?)
7897 }
7898
7899 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Job, fidl::Error> {
7901 let _response =
7902 self.client.send_query::<fidl::encoding::EmptyPayload, RootJobGetResponse>(
7903 (),
7904 0x73acb63f93d53eac,
7905 fidl::encoding::DynamicFlags::empty(),
7906 ___deadline,
7907 )?;
7908 Ok(_response.job)
7909 }
7910}
7911
7912#[cfg(target_os = "fuchsia")]
7913impl From<RootJobForInspectSynchronousProxy> for zx::Handle {
7914 fn from(value: RootJobForInspectSynchronousProxy) -> Self {
7915 value.into_channel().into()
7916 }
7917}
7918
7919#[cfg(target_os = "fuchsia")]
7920impl From<fidl::Channel> for RootJobForInspectSynchronousProxy {
7921 fn from(value: fidl::Channel) -> Self {
7922 Self::new(value)
7923 }
7924}
7925
7926#[derive(Debug, Clone)]
7927pub struct RootJobForInspectProxy {
7928 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7929}
7930
7931impl fidl::endpoints::Proxy for RootJobForInspectProxy {
7932 type Protocol = RootJobForInspectMarker;
7933
7934 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7935 Self::new(inner)
7936 }
7937
7938 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7939 self.client.into_channel().map_err(|client| Self { client })
7940 }
7941
7942 fn as_channel(&self) -> &::fidl::AsyncChannel {
7943 self.client.as_channel()
7944 }
7945}
7946
7947impl RootJobForInspectProxy {
7948 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7950 let protocol_name =
7951 <RootJobForInspectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7952 Self { client: fidl::client::Client::new(channel, protocol_name) }
7953 }
7954
7955 pub fn take_event_stream(&self) -> RootJobForInspectEventStream {
7961 RootJobForInspectEventStream { event_receiver: self.client.take_event_receiver() }
7962 }
7963
7964 pub fn r#get(
7966 &self,
7967 ) -> fidl::client::QueryResponseFut<fidl::Job, fidl::encoding::DefaultFuchsiaResourceDialect>
7968 {
7969 RootJobForInspectProxyInterface::r#get(self)
7970 }
7971}
7972
7973impl RootJobForInspectProxyInterface for RootJobForInspectProxy {
7974 type GetResponseFut =
7975 fidl::client::QueryResponseFut<fidl::Job, fidl::encoding::DefaultFuchsiaResourceDialect>;
7976 fn r#get(&self) -> Self::GetResponseFut {
7977 fn _decode(
7978 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7979 ) -> Result<fidl::Job, fidl::Error> {
7980 let _response = fidl::client::decode_transaction_body::<
7981 RootJobGetResponse,
7982 fidl::encoding::DefaultFuchsiaResourceDialect,
7983 0x73acb63f93d53eac,
7984 >(_buf?)?;
7985 Ok(_response.job)
7986 }
7987 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Job>(
7988 (),
7989 0x73acb63f93d53eac,
7990 fidl::encoding::DynamicFlags::empty(),
7991 _decode,
7992 )
7993 }
7994}
7995
7996pub struct RootJobForInspectEventStream {
7997 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7998}
7999
8000impl std::marker::Unpin for RootJobForInspectEventStream {}
8001
8002impl futures::stream::FusedStream for RootJobForInspectEventStream {
8003 fn is_terminated(&self) -> bool {
8004 self.event_receiver.is_terminated()
8005 }
8006}
8007
8008impl futures::Stream for RootJobForInspectEventStream {
8009 type Item = Result<RootJobForInspectEvent, fidl::Error>;
8010
8011 fn poll_next(
8012 mut self: std::pin::Pin<&mut Self>,
8013 cx: &mut std::task::Context<'_>,
8014 ) -> std::task::Poll<Option<Self::Item>> {
8015 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8016 &mut self.event_receiver,
8017 cx
8018 )?) {
8019 Some(buf) => std::task::Poll::Ready(Some(RootJobForInspectEvent::decode(buf))),
8020 None => std::task::Poll::Ready(None),
8021 }
8022 }
8023}
8024
8025#[derive(Debug)]
8026pub enum RootJobForInspectEvent {}
8027
8028impl RootJobForInspectEvent {
8029 fn decode(
8031 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8032 ) -> Result<RootJobForInspectEvent, fidl::Error> {
8033 let (bytes, _handles) = buf.split_mut();
8034 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8035 debug_assert_eq!(tx_header.tx_id, 0);
8036 match tx_header.ordinal {
8037 _ => Err(fidl::Error::UnknownOrdinal {
8038 ordinal: tx_header.ordinal,
8039 protocol_name:
8040 <RootJobForInspectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8041 }),
8042 }
8043 }
8044}
8045
8046pub struct RootJobForInspectRequestStream {
8048 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8049 is_terminated: bool,
8050}
8051
8052impl std::marker::Unpin for RootJobForInspectRequestStream {}
8053
8054impl futures::stream::FusedStream for RootJobForInspectRequestStream {
8055 fn is_terminated(&self) -> bool {
8056 self.is_terminated
8057 }
8058}
8059
8060impl fidl::endpoints::RequestStream for RootJobForInspectRequestStream {
8061 type Protocol = RootJobForInspectMarker;
8062 type ControlHandle = RootJobForInspectControlHandle;
8063
8064 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8065 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8066 }
8067
8068 fn control_handle(&self) -> Self::ControlHandle {
8069 RootJobForInspectControlHandle { inner: self.inner.clone() }
8070 }
8071
8072 fn into_inner(
8073 self,
8074 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8075 {
8076 (self.inner, self.is_terminated)
8077 }
8078
8079 fn from_inner(
8080 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8081 is_terminated: bool,
8082 ) -> Self {
8083 Self { inner, is_terminated }
8084 }
8085}
8086
8087impl futures::Stream for RootJobForInspectRequestStream {
8088 type Item = Result<RootJobForInspectRequest, fidl::Error>;
8089
8090 fn poll_next(
8091 mut self: std::pin::Pin<&mut Self>,
8092 cx: &mut std::task::Context<'_>,
8093 ) -> std::task::Poll<Option<Self::Item>> {
8094 let this = &mut *self;
8095 if this.inner.check_shutdown(cx) {
8096 this.is_terminated = true;
8097 return std::task::Poll::Ready(None);
8098 }
8099 if this.is_terminated {
8100 panic!("polled RootJobForInspectRequestStream after completion");
8101 }
8102 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8103 |bytes, handles| {
8104 match this.inner.channel().read_etc(cx, bytes, handles) {
8105 std::task::Poll::Ready(Ok(())) => {}
8106 std::task::Poll::Pending => return std::task::Poll::Pending,
8107 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8108 this.is_terminated = true;
8109 return std::task::Poll::Ready(None);
8110 }
8111 std::task::Poll::Ready(Err(e)) => {
8112 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8113 e.into(),
8114 ))))
8115 }
8116 }
8117
8118 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8120
8121 std::task::Poll::Ready(Some(match header.ordinal {
8122 0x73acb63f93d53eac => {
8123 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8124 let mut req = fidl::new_empty!(
8125 fidl::encoding::EmptyPayload,
8126 fidl::encoding::DefaultFuchsiaResourceDialect
8127 );
8128 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8129 let control_handle =
8130 RootJobForInspectControlHandle { inner: this.inner.clone() };
8131 Ok(RootJobForInspectRequest::Get {
8132 responder: RootJobForInspectGetResponder {
8133 control_handle: std::mem::ManuallyDrop::new(control_handle),
8134 tx_id: header.tx_id,
8135 },
8136 })
8137 }
8138 _ => Err(fidl::Error::UnknownOrdinal {
8139 ordinal: header.ordinal,
8140 protocol_name:
8141 <RootJobForInspectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8142 }),
8143 }))
8144 },
8145 )
8146 }
8147}
8148
8149#[derive(Debug)]
8152pub enum RootJobForInspectRequest {
8153 Get { responder: RootJobForInspectGetResponder },
8155}
8156
8157impl RootJobForInspectRequest {
8158 #[allow(irrefutable_let_patterns)]
8159 pub fn into_get(self) -> Option<(RootJobForInspectGetResponder)> {
8160 if let RootJobForInspectRequest::Get { responder } = self {
8161 Some((responder))
8162 } else {
8163 None
8164 }
8165 }
8166
8167 pub fn method_name(&self) -> &'static str {
8169 match *self {
8170 RootJobForInspectRequest::Get { .. } => "get",
8171 }
8172 }
8173}
8174
8175#[derive(Debug, Clone)]
8176pub struct RootJobForInspectControlHandle {
8177 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8178}
8179
8180impl fidl::endpoints::ControlHandle for RootJobForInspectControlHandle {
8181 fn shutdown(&self) {
8182 self.inner.shutdown()
8183 }
8184 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8185 self.inner.shutdown_with_epitaph(status)
8186 }
8187
8188 fn is_closed(&self) -> bool {
8189 self.inner.channel().is_closed()
8190 }
8191 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8192 self.inner.channel().on_closed()
8193 }
8194
8195 #[cfg(target_os = "fuchsia")]
8196 fn signal_peer(
8197 &self,
8198 clear_mask: zx::Signals,
8199 set_mask: zx::Signals,
8200 ) -> Result<(), zx_status::Status> {
8201 use fidl::Peered;
8202 self.inner.channel().signal_peer(clear_mask, set_mask)
8203 }
8204}
8205
8206impl RootJobForInspectControlHandle {}
8207
8208#[must_use = "FIDL methods require a response to be sent"]
8209#[derive(Debug)]
8210pub struct RootJobForInspectGetResponder {
8211 control_handle: std::mem::ManuallyDrop<RootJobForInspectControlHandle>,
8212 tx_id: u32,
8213}
8214
8215impl std::ops::Drop for RootJobForInspectGetResponder {
8219 fn drop(&mut self) {
8220 self.control_handle.shutdown();
8221 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8223 }
8224}
8225
8226impl fidl::endpoints::Responder for RootJobForInspectGetResponder {
8227 type ControlHandle = RootJobForInspectControlHandle;
8228
8229 fn control_handle(&self) -> &RootJobForInspectControlHandle {
8230 &self.control_handle
8231 }
8232
8233 fn drop_without_shutdown(mut self) {
8234 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8236 std::mem::forget(self);
8238 }
8239}
8240
8241impl RootJobForInspectGetResponder {
8242 pub fn send(self, mut job: fidl::Job) -> Result<(), fidl::Error> {
8246 let _result = self.send_raw(job);
8247 if _result.is_err() {
8248 self.control_handle.shutdown();
8249 }
8250 self.drop_without_shutdown();
8251 _result
8252 }
8253
8254 pub fn send_no_shutdown_on_err(self, mut job: fidl::Job) -> Result<(), fidl::Error> {
8256 let _result = self.send_raw(job);
8257 self.drop_without_shutdown();
8258 _result
8259 }
8260
8261 fn send_raw(&self, mut job: fidl::Job) -> Result<(), fidl::Error> {
8262 self.control_handle.inner.send::<RootJobGetResponse>(
8263 (job,),
8264 self.tx_id,
8265 0x73acb63f93d53eac,
8266 fidl::encoding::DynamicFlags::empty(),
8267 )
8268 }
8269}
8270
8271#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8272pub struct SmcResourceMarker;
8273
8274impl fidl::endpoints::ProtocolMarker for SmcResourceMarker {
8275 type Proxy = SmcResourceProxy;
8276 type RequestStream = SmcResourceRequestStream;
8277 #[cfg(target_os = "fuchsia")]
8278 type SynchronousProxy = SmcResourceSynchronousProxy;
8279
8280 const DEBUG_NAME: &'static str = "fuchsia.kernel.SmcResource";
8281}
8282impl fidl::endpoints::DiscoverableProtocolMarker for SmcResourceMarker {}
8283
8284pub trait SmcResourceProxyInterface: Send + Sync {
8285 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
8286 fn r#get(&self) -> Self::GetResponseFut;
8287}
8288#[derive(Debug)]
8289#[cfg(target_os = "fuchsia")]
8290pub struct SmcResourceSynchronousProxy {
8291 client: fidl::client::sync::Client,
8292}
8293
8294#[cfg(target_os = "fuchsia")]
8295impl fidl::endpoints::SynchronousProxy for SmcResourceSynchronousProxy {
8296 type Proxy = SmcResourceProxy;
8297 type Protocol = SmcResourceMarker;
8298
8299 fn from_channel(inner: fidl::Channel) -> Self {
8300 Self::new(inner)
8301 }
8302
8303 fn into_channel(self) -> fidl::Channel {
8304 self.client.into_channel()
8305 }
8306
8307 fn as_channel(&self) -> &fidl::Channel {
8308 self.client.as_channel()
8309 }
8310}
8311
8312#[cfg(target_os = "fuchsia")]
8313impl SmcResourceSynchronousProxy {
8314 pub fn new(channel: fidl::Channel) -> Self {
8315 let protocol_name = <SmcResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8316 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8317 }
8318
8319 pub fn into_channel(self) -> fidl::Channel {
8320 self.client.into_channel()
8321 }
8322
8323 pub fn wait_for_event(
8326 &self,
8327 deadline: zx::MonotonicInstant,
8328 ) -> Result<SmcResourceEvent, fidl::Error> {
8329 SmcResourceEvent::decode(self.client.wait_for_event(deadline)?)
8330 }
8331
8332 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
8334 let _response =
8335 self.client.send_query::<fidl::encoding::EmptyPayload, SmcResourceGetResponse>(
8336 (),
8337 0x392cbd495b84ede7,
8338 fidl::encoding::DynamicFlags::empty(),
8339 ___deadline,
8340 )?;
8341 Ok(_response.resource)
8342 }
8343}
8344
8345#[cfg(target_os = "fuchsia")]
8346impl From<SmcResourceSynchronousProxy> for zx::Handle {
8347 fn from(value: SmcResourceSynchronousProxy) -> Self {
8348 value.into_channel().into()
8349 }
8350}
8351
8352#[cfg(target_os = "fuchsia")]
8353impl From<fidl::Channel> for SmcResourceSynchronousProxy {
8354 fn from(value: fidl::Channel) -> Self {
8355 Self::new(value)
8356 }
8357}
8358
8359#[derive(Debug, Clone)]
8360pub struct SmcResourceProxy {
8361 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8362}
8363
8364impl fidl::endpoints::Proxy for SmcResourceProxy {
8365 type Protocol = SmcResourceMarker;
8366
8367 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8368 Self::new(inner)
8369 }
8370
8371 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8372 self.client.into_channel().map_err(|client| Self { client })
8373 }
8374
8375 fn as_channel(&self) -> &::fidl::AsyncChannel {
8376 self.client.as_channel()
8377 }
8378}
8379
8380impl SmcResourceProxy {
8381 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8383 let protocol_name = <SmcResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8384 Self { client: fidl::client::Client::new(channel, protocol_name) }
8385 }
8386
8387 pub fn take_event_stream(&self) -> SmcResourceEventStream {
8393 SmcResourceEventStream { event_receiver: self.client.take_event_receiver() }
8394 }
8395
8396 pub fn r#get(
8398 &self,
8399 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
8400 {
8401 SmcResourceProxyInterface::r#get(self)
8402 }
8403}
8404
8405impl SmcResourceProxyInterface for SmcResourceProxy {
8406 type GetResponseFut = fidl::client::QueryResponseFut<
8407 fidl::Resource,
8408 fidl::encoding::DefaultFuchsiaResourceDialect,
8409 >;
8410 fn r#get(&self) -> Self::GetResponseFut {
8411 fn _decode(
8412 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8413 ) -> Result<fidl::Resource, fidl::Error> {
8414 let _response = fidl::client::decode_transaction_body::<
8415 SmcResourceGetResponse,
8416 fidl::encoding::DefaultFuchsiaResourceDialect,
8417 0x392cbd495b84ede7,
8418 >(_buf?)?;
8419 Ok(_response.resource)
8420 }
8421 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
8422 (),
8423 0x392cbd495b84ede7,
8424 fidl::encoding::DynamicFlags::empty(),
8425 _decode,
8426 )
8427 }
8428}
8429
8430pub struct SmcResourceEventStream {
8431 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8432}
8433
8434impl std::marker::Unpin for SmcResourceEventStream {}
8435
8436impl futures::stream::FusedStream for SmcResourceEventStream {
8437 fn is_terminated(&self) -> bool {
8438 self.event_receiver.is_terminated()
8439 }
8440}
8441
8442impl futures::Stream for SmcResourceEventStream {
8443 type Item = Result<SmcResourceEvent, fidl::Error>;
8444
8445 fn poll_next(
8446 mut self: std::pin::Pin<&mut Self>,
8447 cx: &mut std::task::Context<'_>,
8448 ) -> std::task::Poll<Option<Self::Item>> {
8449 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8450 &mut self.event_receiver,
8451 cx
8452 )?) {
8453 Some(buf) => std::task::Poll::Ready(Some(SmcResourceEvent::decode(buf))),
8454 None => std::task::Poll::Ready(None),
8455 }
8456 }
8457}
8458
8459#[derive(Debug)]
8460pub enum SmcResourceEvent {}
8461
8462impl SmcResourceEvent {
8463 fn decode(
8465 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8466 ) -> Result<SmcResourceEvent, fidl::Error> {
8467 let (bytes, _handles) = buf.split_mut();
8468 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8469 debug_assert_eq!(tx_header.tx_id, 0);
8470 match tx_header.ordinal {
8471 _ => Err(fidl::Error::UnknownOrdinal {
8472 ordinal: tx_header.ordinal,
8473 protocol_name: <SmcResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8474 }),
8475 }
8476 }
8477}
8478
8479pub struct SmcResourceRequestStream {
8481 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8482 is_terminated: bool,
8483}
8484
8485impl std::marker::Unpin for SmcResourceRequestStream {}
8486
8487impl futures::stream::FusedStream for SmcResourceRequestStream {
8488 fn is_terminated(&self) -> bool {
8489 self.is_terminated
8490 }
8491}
8492
8493impl fidl::endpoints::RequestStream for SmcResourceRequestStream {
8494 type Protocol = SmcResourceMarker;
8495 type ControlHandle = SmcResourceControlHandle;
8496
8497 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8498 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8499 }
8500
8501 fn control_handle(&self) -> Self::ControlHandle {
8502 SmcResourceControlHandle { inner: self.inner.clone() }
8503 }
8504
8505 fn into_inner(
8506 self,
8507 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8508 {
8509 (self.inner, self.is_terminated)
8510 }
8511
8512 fn from_inner(
8513 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8514 is_terminated: bool,
8515 ) -> Self {
8516 Self { inner, is_terminated }
8517 }
8518}
8519
8520impl futures::Stream for SmcResourceRequestStream {
8521 type Item = Result<SmcResourceRequest, fidl::Error>;
8522
8523 fn poll_next(
8524 mut self: std::pin::Pin<&mut Self>,
8525 cx: &mut std::task::Context<'_>,
8526 ) -> std::task::Poll<Option<Self::Item>> {
8527 let this = &mut *self;
8528 if this.inner.check_shutdown(cx) {
8529 this.is_terminated = true;
8530 return std::task::Poll::Ready(None);
8531 }
8532 if this.is_terminated {
8533 panic!("polled SmcResourceRequestStream after completion");
8534 }
8535 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8536 |bytes, handles| {
8537 match this.inner.channel().read_etc(cx, bytes, handles) {
8538 std::task::Poll::Ready(Ok(())) => {}
8539 std::task::Poll::Pending => return std::task::Poll::Pending,
8540 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8541 this.is_terminated = true;
8542 return std::task::Poll::Ready(None);
8543 }
8544 std::task::Poll::Ready(Err(e)) => {
8545 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8546 e.into(),
8547 ))))
8548 }
8549 }
8550
8551 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8553
8554 std::task::Poll::Ready(Some(match header.ordinal {
8555 0x392cbd495b84ede7 => {
8556 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8557 let mut req = fidl::new_empty!(
8558 fidl::encoding::EmptyPayload,
8559 fidl::encoding::DefaultFuchsiaResourceDialect
8560 );
8561 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8562 let control_handle = SmcResourceControlHandle { inner: this.inner.clone() };
8563 Ok(SmcResourceRequest::Get {
8564 responder: SmcResourceGetResponder {
8565 control_handle: std::mem::ManuallyDrop::new(control_handle),
8566 tx_id: header.tx_id,
8567 },
8568 })
8569 }
8570 _ => Err(fidl::Error::UnknownOrdinal {
8571 ordinal: header.ordinal,
8572 protocol_name:
8573 <SmcResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8574 }),
8575 }))
8576 },
8577 )
8578 }
8579}
8580
8581#[derive(Debug)]
8583pub enum SmcResourceRequest {
8584 Get { responder: SmcResourceGetResponder },
8586}
8587
8588impl SmcResourceRequest {
8589 #[allow(irrefutable_let_patterns)]
8590 pub fn into_get(self) -> Option<(SmcResourceGetResponder)> {
8591 if let SmcResourceRequest::Get { responder } = self {
8592 Some((responder))
8593 } else {
8594 None
8595 }
8596 }
8597
8598 pub fn method_name(&self) -> &'static str {
8600 match *self {
8601 SmcResourceRequest::Get { .. } => "get",
8602 }
8603 }
8604}
8605
8606#[derive(Debug, Clone)]
8607pub struct SmcResourceControlHandle {
8608 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8609}
8610
8611impl fidl::endpoints::ControlHandle for SmcResourceControlHandle {
8612 fn shutdown(&self) {
8613 self.inner.shutdown()
8614 }
8615 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8616 self.inner.shutdown_with_epitaph(status)
8617 }
8618
8619 fn is_closed(&self) -> bool {
8620 self.inner.channel().is_closed()
8621 }
8622 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8623 self.inner.channel().on_closed()
8624 }
8625
8626 #[cfg(target_os = "fuchsia")]
8627 fn signal_peer(
8628 &self,
8629 clear_mask: zx::Signals,
8630 set_mask: zx::Signals,
8631 ) -> Result<(), zx_status::Status> {
8632 use fidl::Peered;
8633 self.inner.channel().signal_peer(clear_mask, set_mask)
8634 }
8635}
8636
8637impl SmcResourceControlHandle {}
8638
8639#[must_use = "FIDL methods require a response to be sent"]
8640#[derive(Debug)]
8641pub struct SmcResourceGetResponder {
8642 control_handle: std::mem::ManuallyDrop<SmcResourceControlHandle>,
8643 tx_id: u32,
8644}
8645
8646impl std::ops::Drop for SmcResourceGetResponder {
8650 fn drop(&mut self) {
8651 self.control_handle.shutdown();
8652 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8654 }
8655}
8656
8657impl fidl::endpoints::Responder for SmcResourceGetResponder {
8658 type ControlHandle = SmcResourceControlHandle;
8659
8660 fn control_handle(&self) -> &SmcResourceControlHandle {
8661 &self.control_handle
8662 }
8663
8664 fn drop_without_shutdown(mut self) {
8665 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8667 std::mem::forget(self);
8669 }
8670}
8671
8672impl SmcResourceGetResponder {
8673 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
8677 let _result = self.send_raw(resource);
8678 if _result.is_err() {
8679 self.control_handle.shutdown();
8680 }
8681 self.drop_without_shutdown();
8682 _result
8683 }
8684
8685 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
8687 let _result = self.send_raw(resource);
8688 self.drop_without_shutdown();
8689 _result
8690 }
8691
8692 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
8693 self.control_handle.inner.send::<SmcResourceGetResponse>(
8694 (resource,),
8695 self.tx_id,
8696 0x392cbd495b84ede7,
8697 fidl::encoding::DynamicFlags::empty(),
8698 )
8699 }
8700}
8701
8702#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8703pub struct StallResourceMarker;
8704
8705impl fidl::endpoints::ProtocolMarker for StallResourceMarker {
8706 type Proxy = StallResourceProxy;
8707 type RequestStream = StallResourceRequestStream;
8708 #[cfg(target_os = "fuchsia")]
8709 type SynchronousProxy = StallResourceSynchronousProxy;
8710
8711 const DEBUG_NAME: &'static str = "fuchsia.kernel.StallResource";
8712}
8713impl fidl::endpoints::DiscoverableProtocolMarker for StallResourceMarker {}
8714
8715pub trait StallResourceProxyInterface: Send + Sync {
8716 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
8717 fn r#get(&self) -> Self::GetResponseFut;
8718}
8719#[derive(Debug)]
8720#[cfg(target_os = "fuchsia")]
8721pub struct StallResourceSynchronousProxy {
8722 client: fidl::client::sync::Client,
8723}
8724
8725#[cfg(target_os = "fuchsia")]
8726impl fidl::endpoints::SynchronousProxy for StallResourceSynchronousProxy {
8727 type Proxy = StallResourceProxy;
8728 type Protocol = StallResourceMarker;
8729
8730 fn from_channel(inner: fidl::Channel) -> Self {
8731 Self::new(inner)
8732 }
8733
8734 fn into_channel(self) -> fidl::Channel {
8735 self.client.into_channel()
8736 }
8737
8738 fn as_channel(&self) -> &fidl::Channel {
8739 self.client.as_channel()
8740 }
8741}
8742
8743#[cfg(target_os = "fuchsia")]
8744impl StallResourceSynchronousProxy {
8745 pub fn new(channel: fidl::Channel) -> Self {
8746 let protocol_name = <StallResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8747 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8748 }
8749
8750 pub fn into_channel(self) -> fidl::Channel {
8751 self.client.into_channel()
8752 }
8753
8754 pub fn wait_for_event(
8757 &self,
8758 deadline: zx::MonotonicInstant,
8759 ) -> Result<StallResourceEvent, fidl::Error> {
8760 StallResourceEvent::decode(self.client.wait_for_event(deadline)?)
8761 }
8762
8763 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
8765 let _response =
8766 self.client.send_query::<fidl::encoding::EmptyPayload, StallResourceGetResponse>(
8767 (),
8768 0x5edf4c8629a9781a,
8769 fidl::encoding::DynamicFlags::empty(),
8770 ___deadline,
8771 )?;
8772 Ok(_response.resource)
8773 }
8774}
8775
8776#[cfg(target_os = "fuchsia")]
8777impl From<StallResourceSynchronousProxy> for zx::Handle {
8778 fn from(value: StallResourceSynchronousProxy) -> Self {
8779 value.into_channel().into()
8780 }
8781}
8782
8783#[cfg(target_os = "fuchsia")]
8784impl From<fidl::Channel> for StallResourceSynchronousProxy {
8785 fn from(value: fidl::Channel) -> Self {
8786 Self::new(value)
8787 }
8788}
8789
8790#[derive(Debug, Clone)]
8791pub struct StallResourceProxy {
8792 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8793}
8794
8795impl fidl::endpoints::Proxy for StallResourceProxy {
8796 type Protocol = StallResourceMarker;
8797
8798 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8799 Self::new(inner)
8800 }
8801
8802 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8803 self.client.into_channel().map_err(|client| Self { client })
8804 }
8805
8806 fn as_channel(&self) -> &::fidl::AsyncChannel {
8807 self.client.as_channel()
8808 }
8809}
8810
8811impl StallResourceProxy {
8812 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8814 let protocol_name = <StallResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8815 Self { client: fidl::client::Client::new(channel, protocol_name) }
8816 }
8817
8818 pub fn take_event_stream(&self) -> StallResourceEventStream {
8824 StallResourceEventStream { event_receiver: self.client.take_event_receiver() }
8825 }
8826
8827 pub fn r#get(
8829 &self,
8830 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
8831 {
8832 StallResourceProxyInterface::r#get(self)
8833 }
8834}
8835
8836impl StallResourceProxyInterface for StallResourceProxy {
8837 type GetResponseFut = fidl::client::QueryResponseFut<
8838 fidl::Resource,
8839 fidl::encoding::DefaultFuchsiaResourceDialect,
8840 >;
8841 fn r#get(&self) -> Self::GetResponseFut {
8842 fn _decode(
8843 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8844 ) -> Result<fidl::Resource, fidl::Error> {
8845 let _response = fidl::client::decode_transaction_body::<
8846 StallResourceGetResponse,
8847 fidl::encoding::DefaultFuchsiaResourceDialect,
8848 0x5edf4c8629a9781a,
8849 >(_buf?)?;
8850 Ok(_response.resource)
8851 }
8852 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
8853 (),
8854 0x5edf4c8629a9781a,
8855 fidl::encoding::DynamicFlags::empty(),
8856 _decode,
8857 )
8858 }
8859}
8860
8861pub struct StallResourceEventStream {
8862 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8863}
8864
8865impl std::marker::Unpin for StallResourceEventStream {}
8866
8867impl futures::stream::FusedStream for StallResourceEventStream {
8868 fn is_terminated(&self) -> bool {
8869 self.event_receiver.is_terminated()
8870 }
8871}
8872
8873impl futures::Stream for StallResourceEventStream {
8874 type Item = Result<StallResourceEvent, fidl::Error>;
8875
8876 fn poll_next(
8877 mut self: std::pin::Pin<&mut Self>,
8878 cx: &mut std::task::Context<'_>,
8879 ) -> std::task::Poll<Option<Self::Item>> {
8880 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8881 &mut self.event_receiver,
8882 cx
8883 )?) {
8884 Some(buf) => std::task::Poll::Ready(Some(StallResourceEvent::decode(buf))),
8885 None => std::task::Poll::Ready(None),
8886 }
8887 }
8888}
8889
8890#[derive(Debug)]
8891pub enum StallResourceEvent {}
8892
8893impl StallResourceEvent {
8894 fn decode(
8896 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8897 ) -> Result<StallResourceEvent, fidl::Error> {
8898 let (bytes, _handles) = buf.split_mut();
8899 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8900 debug_assert_eq!(tx_header.tx_id, 0);
8901 match tx_header.ordinal {
8902 _ => Err(fidl::Error::UnknownOrdinal {
8903 ordinal: tx_header.ordinal,
8904 protocol_name: <StallResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8905 }),
8906 }
8907 }
8908}
8909
8910pub struct StallResourceRequestStream {
8912 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8913 is_terminated: bool,
8914}
8915
8916impl std::marker::Unpin for StallResourceRequestStream {}
8917
8918impl futures::stream::FusedStream for StallResourceRequestStream {
8919 fn is_terminated(&self) -> bool {
8920 self.is_terminated
8921 }
8922}
8923
8924impl fidl::endpoints::RequestStream for StallResourceRequestStream {
8925 type Protocol = StallResourceMarker;
8926 type ControlHandle = StallResourceControlHandle;
8927
8928 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8929 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8930 }
8931
8932 fn control_handle(&self) -> Self::ControlHandle {
8933 StallResourceControlHandle { inner: self.inner.clone() }
8934 }
8935
8936 fn into_inner(
8937 self,
8938 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8939 {
8940 (self.inner, self.is_terminated)
8941 }
8942
8943 fn from_inner(
8944 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8945 is_terminated: bool,
8946 ) -> Self {
8947 Self { inner, is_terminated }
8948 }
8949}
8950
8951impl futures::Stream for StallResourceRequestStream {
8952 type Item = Result<StallResourceRequest, fidl::Error>;
8953
8954 fn poll_next(
8955 mut self: std::pin::Pin<&mut Self>,
8956 cx: &mut std::task::Context<'_>,
8957 ) -> std::task::Poll<Option<Self::Item>> {
8958 let this = &mut *self;
8959 if this.inner.check_shutdown(cx) {
8960 this.is_terminated = true;
8961 return std::task::Poll::Ready(None);
8962 }
8963 if this.is_terminated {
8964 panic!("polled StallResourceRequestStream after completion");
8965 }
8966 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8967 |bytes, handles| {
8968 match this.inner.channel().read_etc(cx, bytes, handles) {
8969 std::task::Poll::Ready(Ok(())) => {}
8970 std::task::Poll::Pending => return std::task::Poll::Pending,
8971 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8972 this.is_terminated = true;
8973 return std::task::Poll::Ready(None);
8974 }
8975 std::task::Poll::Ready(Err(e)) => {
8976 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8977 e.into(),
8978 ))))
8979 }
8980 }
8981
8982 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8984
8985 std::task::Poll::Ready(Some(match header.ordinal {
8986 0x5edf4c8629a9781a => {
8987 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8988 let mut req = fidl::new_empty!(
8989 fidl::encoding::EmptyPayload,
8990 fidl::encoding::DefaultFuchsiaResourceDialect
8991 );
8992 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8993 let control_handle =
8994 StallResourceControlHandle { inner: this.inner.clone() };
8995 Ok(StallResourceRequest::Get {
8996 responder: StallResourceGetResponder {
8997 control_handle: std::mem::ManuallyDrop::new(control_handle),
8998 tx_id: header.tx_id,
8999 },
9000 })
9001 }
9002 _ => Err(fidl::Error::UnknownOrdinal {
9003 ordinal: header.ordinal,
9004 protocol_name:
9005 <StallResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9006 }),
9007 }))
9008 },
9009 )
9010 }
9011}
9012
9013#[derive(Debug)]
9017pub enum StallResourceRequest {
9018 Get { responder: StallResourceGetResponder },
9020}
9021
9022impl StallResourceRequest {
9023 #[allow(irrefutable_let_patterns)]
9024 pub fn into_get(self) -> Option<(StallResourceGetResponder)> {
9025 if let StallResourceRequest::Get { responder } = self {
9026 Some((responder))
9027 } else {
9028 None
9029 }
9030 }
9031
9032 pub fn method_name(&self) -> &'static str {
9034 match *self {
9035 StallResourceRequest::Get { .. } => "get",
9036 }
9037 }
9038}
9039
9040#[derive(Debug, Clone)]
9041pub struct StallResourceControlHandle {
9042 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9043}
9044
9045impl fidl::endpoints::ControlHandle for StallResourceControlHandle {
9046 fn shutdown(&self) {
9047 self.inner.shutdown()
9048 }
9049 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9050 self.inner.shutdown_with_epitaph(status)
9051 }
9052
9053 fn is_closed(&self) -> bool {
9054 self.inner.channel().is_closed()
9055 }
9056 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9057 self.inner.channel().on_closed()
9058 }
9059
9060 #[cfg(target_os = "fuchsia")]
9061 fn signal_peer(
9062 &self,
9063 clear_mask: zx::Signals,
9064 set_mask: zx::Signals,
9065 ) -> Result<(), zx_status::Status> {
9066 use fidl::Peered;
9067 self.inner.channel().signal_peer(clear_mask, set_mask)
9068 }
9069}
9070
9071impl StallResourceControlHandle {}
9072
9073#[must_use = "FIDL methods require a response to be sent"]
9074#[derive(Debug)]
9075pub struct StallResourceGetResponder {
9076 control_handle: std::mem::ManuallyDrop<StallResourceControlHandle>,
9077 tx_id: u32,
9078}
9079
9080impl std::ops::Drop for StallResourceGetResponder {
9084 fn drop(&mut self) {
9085 self.control_handle.shutdown();
9086 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9088 }
9089}
9090
9091impl fidl::endpoints::Responder for StallResourceGetResponder {
9092 type ControlHandle = StallResourceControlHandle;
9093
9094 fn control_handle(&self) -> &StallResourceControlHandle {
9095 &self.control_handle
9096 }
9097
9098 fn drop_without_shutdown(mut self) {
9099 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9101 std::mem::forget(self);
9103 }
9104}
9105
9106impl StallResourceGetResponder {
9107 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
9111 let _result = self.send_raw(resource);
9112 if _result.is_err() {
9113 self.control_handle.shutdown();
9114 }
9115 self.drop_without_shutdown();
9116 _result
9117 }
9118
9119 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
9121 let _result = self.send_raw(resource);
9122 self.drop_without_shutdown();
9123 _result
9124 }
9125
9126 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
9127 self.control_handle.inner.send::<StallResourceGetResponse>(
9128 (resource,),
9129 self.tx_id,
9130 0x5edf4c8629a9781a,
9131 fidl::encoding::DynamicFlags::empty(),
9132 )
9133 }
9134}
9135
9136#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9137pub struct StatsMarker;
9138
9139impl fidl::endpoints::ProtocolMarker for StatsMarker {
9140 type Proxy = StatsProxy;
9141 type RequestStream = StatsRequestStream;
9142 #[cfg(target_os = "fuchsia")]
9143 type SynchronousProxy = StatsSynchronousProxy;
9144
9145 const DEBUG_NAME: &'static str = "fuchsia.kernel.Stats";
9146}
9147impl fidl::endpoints::DiscoverableProtocolMarker for StatsMarker {}
9148
9149pub trait StatsProxyInterface: Send + Sync {
9150 type GetMemoryStatsResponseFut: std::future::Future<Output = Result<MemoryStats, fidl::Error>>
9151 + Send;
9152 fn r#get_memory_stats(&self) -> Self::GetMemoryStatsResponseFut;
9153 type GetMemoryStatsExtendedResponseFut: std::future::Future<Output = Result<MemoryStatsExtended, fidl::Error>>
9154 + Send;
9155 fn r#get_memory_stats_extended(&self) -> Self::GetMemoryStatsExtendedResponseFut;
9156 type GetMemoryStatsCompressionResponseFut: std::future::Future<Output = Result<MemoryStatsCompression, fidl::Error>>
9157 + Send;
9158 fn r#get_memory_stats_compression(&self) -> Self::GetMemoryStatsCompressionResponseFut;
9159 type GetCpuStatsResponseFut: std::future::Future<Output = Result<CpuStats, fidl::Error>> + Send;
9160 fn r#get_cpu_stats(&self) -> Self::GetCpuStatsResponseFut;
9161 type GetCpuLoadResponseFut: std::future::Future<Output = Result<Vec<f32>, fidl::Error>> + Send;
9162 fn r#get_cpu_load(&self, duration: i64) -> Self::GetCpuLoadResponseFut;
9163}
9164#[derive(Debug)]
9165#[cfg(target_os = "fuchsia")]
9166pub struct StatsSynchronousProxy {
9167 client: fidl::client::sync::Client,
9168}
9169
9170#[cfg(target_os = "fuchsia")]
9171impl fidl::endpoints::SynchronousProxy for StatsSynchronousProxy {
9172 type Proxy = StatsProxy;
9173 type Protocol = StatsMarker;
9174
9175 fn from_channel(inner: fidl::Channel) -> Self {
9176 Self::new(inner)
9177 }
9178
9179 fn into_channel(self) -> fidl::Channel {
9180 self.client.into_channel()
9181 }
9182
9183 fn as_channel(&self) -> &fidl::Channel {
9184 self.client.as_channel()
9185 }
9186}
9187
9188#[cfg(target_os = "fuchsia")]
9189impl StatsSynchronousProxy {
9190 pub fn new(channel: fidl::Channel) -> Self {
9191 let protocol_name = <StatsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9192 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9193 }
9194
9195 pub fn into_channel(self) -> fidl::Channel {
9196 self.client.into_channel()
9197 }
9198
9199 pub fn wait_for_event(
9202 &self,
9203 deadline: zx::MonotonicInstant,
9204 ) -> Result<StatsEvent, fidl::Error> {
9205 StatsEvent::decode(self.client.wait_for_event(deadline)?)
9206 }
9207
9208 pub fn r#get_memory_stats(
9209 &self,
9210 ___deadline: zx::MonotonicInstant,
9211 ) -> Result<MemoryStats, fidl::Error> {
9212 let _response =
9213 self.client.send_query::<fidl::encoding::EmptyPayload, StatsGetMemoryStatsResponse>(
9214 (),
9215 0x686677932ae41074,
9216 fidl::encoding::DynamicFlags::empty(),
9217 ___deadline,
9218 )?;
9219 Ok(_response.stats)
9220 }
9221
9222 pub fn r#get_memory_stats_extended(
9223 &self,
9224 ___deadline: zx::MonotonicInstant,
9225 ) -> Result<MemoryStatsExtended, fidl::Error> {
9226 let _response = self
9227 .client
9228 .send_query::<fidl::encoding::EmptyPayload, StatsGetMemoryStatsExtendedResponse>(
9229 (),
9230 0x60faa0f8aa38c29f,
9231 fidl::encoding::DynamicFlags::empty(),
9232 ___deadline,
9233 )?;
9234 Ok(_response.stats)
9235 }
9236
9237 pub fn r#get_memory_stats_compression(
9238 &self,
9239 ___deadline: zx::MonotonicInstant,
9240 ) -> Result<MemoryStatsCompression, fidl::Error> {
9241 let _response =
9242 self.client.send_query::<fidl::encoding::EmptyPayload, MemoryStatsCompression>(
9243 (),
9244 0x544a09995befb531,
9245 fidl::encoding::DynamicFlags::empty(),
9246 ___deadline,
9247 )?;
9248 Ok(_response)
9249 }
9250
9251 pub fn r#get_cpu_stats(
9252 &self,
9253 ___deadline: zx::MonotonicInstant,
9254 ) -> Result<CpuStats, fidl::Error> {
9255 let _response =
9256 self.client.send_query::<fidl::encoding::EmptyPayload, StatsGetCpuStatsResponse>(
9257 (),
9258 0x470e2684ca1ca19e,
9259 fidl::encoding::DynamicFlags::empty(),
9260 ___deadline,
9261 )?;
9262 Ok(_response.stats)
9263 }
9264
9265 pub fn r#get_cpu_load(
9271 &self,
9272 mut duration: i64,
9273 ___deadline: zx::MonotonicInstant,
9274 ) -> Result<Vec<f32>, fidl::Error> {
9275 let _response = self.client.send_query::<StatsGetCpuLoadRequest, StatsGetCpuLoadResponse>(
9276 (duration,),
9277 0x4c8f0f05e7034666,
9278 fidl::encoding::DynamicFlags::empty(),
9279 ___deadline,
9280 )?;
9281 Ok(_response.per_cpu_load)
9282 }
9283}
9284
9285#[cfg(target_os = "fuchsia")]
9286impl From<StatsSynchronousProxy> for zx::Handle {
9287 fn from(value: StatsSynchronousProxy) -> Self {
9288 value.into_channel().into()
9289 }
9290}
9291
9292#[cfg(target_os = "fuchsia")]
9293impl From<fidl::Channel> for StatsSynchronousProxy {
9294 fn from(value: fidl::Channel) -> Self {
9295 Self::new(value)
9296 }
9297}
9298
9299#[derive(Debug, Clone)]
9300pub struct StatsProxy {
9301 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9302}
9303
9304impl fidl::endpoints::Proxy for StatsProxy {
9305 type Protocol = StatsMarker;
9306
9307 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9308 Self::new(inner)
9309 }
9310
9311 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9312 self.client.into_channel().map_err(|client| Self { client })
9313 }
9314
9315 fn as_channel(&self) -> &::fidl::AsyncChannel {
9316 self.client.as_channel()
9317 }
9318}
9319
9320impl StatsProxy {
9321 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9323 let protocol_name = <StatsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9324 Self { client: fidl::client::Client::new(channel, protocol_name) }
9325 }
9326
9327 pub fn take_event_stream(&self) -> StatsEventStream {
9333 StatsEventStream { event_receiver: self.client.take_event_receiver() }
9334 }
9335
9336 pub fn r#get_memory_stats(
9337 &self,
9338 ) -> fidl::client::QueryResponseFut<MemoryStats, fidl::encoding::DefaultFuchsiaResourceDialect>
9339 {
9340 StatsProxyInterface::r#get_memory_stats(self)
9341 }
9342
9343 pub fn r#get_memory_stats_extended(
9344 &self,
9345 ) -> fidl::client::QueryResponseFut<
9346 MemoryStatsExtended,
9347 fidl::encoding::DefaultFuchsiaResourceDialect,
9348 > {
9349 StatsProxyInterface::r#get_memory_stats_extended(self)
9350 }
9351
9352 pub fn r#get_memory_stats_compression(
9353 &self,
9354 ) -> fidl::client::QueryResponseFut<
9355 MemoryStatsCompression,
9356 fidl::encoding::DefaultFuchsiaResourceDialect,
9357 > {
9358 StatsProxyInterface::r#get_memory_stats_compression(self)
9359 }
9360
9361 pub fn r#get_cpu_stats(
9362 &self,
9363 ) -> fidl::client::QueryResponseFut<CpuStats, fidl::encoding::DefaultFuchsiaResourceDialect>
9364 {
9365 StatsProxyInterface::r#get_cpu_stats(self)
9366 }
9367
9368 pub fn r#get_cpu_load(
9374 &self,
9375 mut duration: i64,
9376 ) -> fidl::client::QueryResponseFut<Vec<f32>, fidl::encoding::DefaultFuchsiaResourceDialect>
9377 {
9378 StatsProxyInterface::r#get_cpu_load(self, duration)
9379 }
9380}
9381
9382impl StatsProxyInterface for StatsProxy {
9383 type GetMemoryStatsResponseFut =
9384 fidl::client::QueryResponseFut<MemoryStats, fidl::encoding::DefaultFuchsiaResourceDialect>;
9385 fn r#get_memory_stats(&self) -> Self::GetMemoryStatsResponseFut {
9386 fn _decode(
9387 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9388 ) -> Result<MemoryStats, fidl::Error> {
9389 let _response = fidl::client::decode_transaction_body::<
9390 StatsGetMemoryStatsResponse,
9391 fidl::encoding::DefaultFuchsiaResourceDialect,
9392 0x686677932ae41074,
9393 >(_buf?)?;
9394 Ok(_response.stats)
9395 }
9396 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, MemoryStats>(
9397 (),
9398 0x686677932ae41074,
9399 fidl::encoding::DynamicFlags::empty(),
9400 _decode,
9401 )
9402 }
9403
9404 type GetMemoryStatsExtendedResponseFut = fidl::client::QueryResponseFut<
9405 MemoryStatsExtended,
9406 fidl::encoding::DefaultFuchsiaResourceDialect,
9407 >;
9408 fn r#get_memory_stats_extended(&self) -> Self::GetMemoryStatsExtendedResponseFut {
9409 fn _decode(
9410 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9411 ) -> Result<MemoryStatsExtended, fidl::Error> {
9412 let _response = fidl::client::decode_transaction_body::<
9413 StatsGetMemoryStatsExtendedResponse,
9414 fidl::encoding::DefaultFuchsiaResourceDialect,
9415 0x60faa0f8aa38c29f,
9416 >(_buf?)?;
9417 Ok(_response.stats)
9418 }
9419 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, MemoryStatsExtended>(
9420 (),
9421 0x60faa0f8aa38c29f,
9422 fidl::encoding::DynamicFlags::empty(),
9423 _decode,
9424 )
9425 }
9426
9427 type GetMemoryStatsCompressionResponseFut = fidl::client::QueryResponseFut<
9428 MemoryStatsCompression,
9429 fidl::encoding::DefaultFuchsiaResourceDialect,
9430 >;
9431 fn r#get_memory_stats_compression(&self) -> Self::GetMemoryStatsCompressionResponseFut {
9432 fn _decode(
9433 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9434 ) -> Result<MemoryStatsCompression, fidl::Error> {
9435 let _response = fidl::client::decode_transaction_body::<
9436 MemoryStatsCompression,
9437 fidl::encoding::DefaultFuchsiaResourceDialect,
9438 0x544a09995befb531,
9439 >(_buf?)?;
9440 Ok(_response)
9441 }
9442 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, MemoryStatsCompression>(
9443 (),
9444 0x544a09995befb531,
9445 fidl::encoding::DynamicFlags::empty(),
9446 _decode,
9447 )
9448 }
9449
9450 type GetCpuStatsResponseFut =
9451 fidl::client::QueryResponseFut<CpuStats, fidl::encoding::DefaultFuchsiaResourceDialect>;
9452 fn r#get_cpu_stats(&self) -> Self::GetCpuStatsResponseFut {
9453 fn _decode(
9454 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9455 ) -> Result<CpuStats, fidl::Error> {
9456 let _response = fidl::client::decode_transaction_body::<
9457 StatsGetCpuStatsResponse,
9458 fidl::encoding::DefaultFuchsiaResourceDialect,
9459 0x470e2684ca1ca19e,
9460 >(_buf?)?;
9461 Ok(_response.stats)
9462 }
9463 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CpuStats>(
9464 (),
9465 0x470e2684ca1ca19e,
9466 fidl::encoding::DynamicFlags::empty(),
9467 _decode,
9468 )
9469 }
9470
9471 type GetCpuLoadResponseFut =
9472 fidl::client::QueryResponseFut<Vec<f32>, fidl::encoding::DefaultFuchsiaResourceDialect>;
9473 fn r#get_cpu_load(&self, mut duration: i64) -> Self::GetCpuLoadResponseFut {
9474 fn _decode(
9475 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9476 ) -> Result<Vec<f32>, fidl::Error> {
9477 let _response = fidl::client::decode_transaction_body::<
9478 StatsGetCpuLoadResponse,
9479 fidl::encoding::DefaultFuchsiaResourceDialect,
9480 0x4c8f0f05e7034666,
9481 >(_buf?)?;
9482 Ok(_response.per_cpu_load)
9483 }
9484 self.client.send_query_and_decode::<StatsGetCpuLoadRequest, Vec<f32>>(
9485 (duration,),
9486 0x4c8f0f05e7034666,
9487 fidl::encoding::DynamicFlags::empty(),
9488 _decode,
9489 )
9490 }
9491}
9492
9493pub struct StatsEventStream {
9494 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9495}
9496
9497impl std::marker::Unpin for StatsEventStream {}
9498
9499impl futures::stream::FusedStream for StatsEventStream {
9500 fn is_terminated(&self) -> bool {
9501 self.event_receiver.is_terminated()
9502 }
9503}
9504
9505impl futures::Stream for StatsEventStream {
9506 type Item = Result<StatsEvent, fidl::Error>;
9507
9508 fn poll_next(
9509 mut self: std::pin::Pin<&mut Self>,
9510 cx: &mut std::task::Context<'_>,
9511 ) -> std::task::Poll<Option<Self::Item>> {
9512 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9513 &mut self.event_receiver,
9514 cx
9515 )?) {
9516 Some(buf) => std::task::Poll::Ready(Some(StatsEvent::decode(buf))),
9517 None => std::task::Poll::Ready(None),
9518 }
9519 }
9520}
9521
9522#[derive(Debug)]
9523pub enum StatsEvent {}
9524
9525impl StatsEvent {
9526 fn decode(
9528 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9529 ) -> Result<StatsEvent, fidl::Error> {
9530 let (bytes, _handles) = buf.split_mut();
9531 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9532 debug_assert_eq!(tx_header.tx_id, 0);
9533 match tx_header.ordinal {
9534 _ => Err(fidl::Error::UnknownOrdinal {
9535 ordinal: tx_header.ordinal,
9536 protocol_name: <StatsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9537 }),
9538 }
9539 }
9540}
9541
9542pub struct StatsRequestStream {
9544 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9545 is_terminated: bool,
9546}
9547
9548impl std::marker::Unpin for StatsRequestStream {}
9549
9550impl futures::stream::FusedStream for StatsRequestStream {
9551 fn is_terminated(&self) -> bool {
9552 self.is_terminated
9553 }
9554}
9555
9556impl fidl::endpoints::RequestStream for StatsRequestStream {
9557 type Protocol = StatsMarker;
9558 type ControlHandle = StatsControlHandle;
9559
9560 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9561 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9562 }
9563
9564 fn control_handle(&self) -> Self::ControlHandle {
9565 StatsControlHandle { inner: self.inner.clone() }
9566 }
9567
9568 fn into_inner(
9569 self,
9570 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9571 {
9572 (self.inner, self.is_terminated)
9573 }
9574
9575 fn from_inner(
9576 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9577 is_terminated: bool,
9578 ) -> Self {
9579 Self { inner, is_terminated }
9580 }
9581}
9582
9583impl futures::Stream for StatsRequestStream {
9584 type Item = Result<StatsRequest, fidl::Error>;
9585
9586 fn poll_next(
9587 mut self: std::pin::Pin<&mut Self>,
9588 cx: &mut std::task::Context<'_>,
9589 ) -> std::task::Poll<Option<Self::Item>> {
9590 let this = &mut *self;
9591 if this.inner.check_shutdown(cx) {
9592 this.is_terminated = true;
9593 return std::task::Poll::Ready(None);
9594 }
9595 if this.is_terminated {
9596 panic!("polled StatsRequestStream after completion");
9597 }
9598 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9599 |bytes, handles| {
9600 match this.inner.channel().read_etc(cx, bytes, handles) {
9601 std::task::Poll::Ready(Ok(())) => {}
9602 std::task::Poll::Pending => return std::task::Poll::Pending,
9603 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9604 this.is_terminated = true;
9605 return std::task::Poll::Ready(None);
9606 }
9607 std::task::Poll::Ready(Err(e)) => {
9608 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9609 e.into(),
9610 ))))
9611 }
9612 }
9613
9614 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9616
9617 std::task::Poll::Ready(Some(match header.ordinal {
9618 0x686677932ae41074 => {
9619 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9620 let mut req = fidl::new_empty!(
9621 fidl::encoding::EmptyPayload,
9622 fidl::encoding::DefaultFuchsiaResourceDialect
9623 );
9624 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9625 let control_handle = StatsControlHandle { inner: this.inner.clone() };
9626 Ok(StatsRequest::GetMemoryStats {
9627 responder: StatsGetMemoryStatsResponder {
9628 control_handle: std::mem::ManuallyDrop::new(control_handle),
9629 tx_id: header.tx_id,
9630 },
9631 })
9632 }
9633 0x60faa0f8aa38c29f => {
9634 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9635 let mut req = fidl::new_empty!(
9636 fidl::encoding::EmptyPayload,
9637 fidl::encoding::DefaultFuchsiaResourceDialect
9638 );
9639 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9640 let control_handle = StatsControlHandle { inner: this.inner.clone() };
9641 Ok(StatsRequest::GetMemoryStatsExtended {
9642 responder: StatsGetMemoryStatsExtendedResponder {
9643 control_handle: std::mem::ManuallyDrop::new(control_handle),
9644 tx_id: header.tx_id,
9645 },
9646 })
9647 }
9648 0x544a09995befb531 => {
9649 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9650 let mut req = fidl::new_empty!(
9651 fidl::encoding::EmptyPayload,
9652 fidl::encoding::DefaultFuchsiaResourceDialect
9653 );
9654 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9655 let control_handle = StatsControlHandle { inner: this.inner.clone() };
9656 Ok(StatsRequest::GetMemoryStatsCompression {
9657 responder: StatsGetMemoryStatsCompressionResponder {
9658 control_handle: std::mem::ManuallyDrop::new(control_handle),
9659 tx_id: header.tx_id,
9660 },
9661 })
9662 }
9663 0x470e2684ca1ca19e => {
9664 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9665 let mut req = fidl::new_empty!(
9666 fidl::encoding::EmptyPayload,
9667 fidl::encoding::DefaultFuchsiaResourceDialect
9668 );
9669 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9670 let control_handle = StatsControlHandle { inner: this.inner.clone() };
9671 Ok(StatsRequest::GetCpuStats {
9672 responder: StatsGetCpuStatsResponder {
9673 control_handle: std::mem::ManuallyDrop::new(control_handle),
9674 tx_id: header.tx_id,
9675 },
9676 })
9677 }
9678 0x4c8f0f05e7034666 => {
9679 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9680 let mut req = fidl::new_empty!(
9681 StatsGetCpuLoadRequest,
9682 fidl::encoding::DefaultFuchsiaResourceDialect
9683 );
9684 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StatsGetCpuLoadRequest>(&header, _body_bytes, handles, &mut req)?;
9685 let control_handle = StatsControlHandle { inner: this.inner.clone() };
9686 Ok(StatsRequest::GetCpuLoad {
9687 duration: req.duration,
9688
9689 responder: StatsGetCpuLoadResponder {
9690 control_handle: std::mem::ManuallyDrop::new(control_handle),
9691 tx_id: header.tx_id,
9692 },
9693 })
9694 }
9695 _ => Err(fidl::Error::UnknownOrdinal {
9696 ordinal: header.ordinal,
9697 protocol_name: <StatsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9698 }),
9699 }))
9700 },
9701 )
9702 }
9703}
9704
9705#[derive(Debug)]
9711pub enum StatsRequest {
9712 GetMemoryStats {
9713 responder: StatsGetMemoryStatsResponder,
9714 },
9715 GetMemoryStatsExtended {
9716 responder: StatsGetMemoryStatsExtendedResponder,
9717 },
9718 GetMemoryStatsCompression {
9719 responder: StatsGetMemoryStatsCompressionResponder,
9720 },
9721 GetCpuStats {
9722 responder: StatsGetCpuStatsResponder,
9723 },
9724 GetCpuLoad {
9730 duration: i64,
9731 responder: StatsGetCpuLoadResponder,
9732 },
9733}
9734
9735impl StatsRequest {
9736 #[allow(irrefutable_let_patterns)]
9737 pub fn into_get_memory_stats(self) -> Option<(StatsGetMemoryStatsResponder)> {
9738 if let StatsRequest::GetMemoryStats { responder } = self {
9739 Some((responder))
9740 } else {
9741 None
9742 }
9743 }
9744
9745 #[allow(irrefutable_let_patterns)]
9746 pub fn into_get_memory_stats_extended(self) -> Option<(StatsGetMemoryStatsExtendedResponder)> {
9747 if let StatsRequest::GetMemoryStatsExtended { responder } = self {
9748 Some((responder))
9749 } else {
9750 None
9751 }
9752 }
9753
9754 #[allow(irrefutable_let_patterns)]
9755 pub fn into_get_memory_stats_compression(
9756 self,
9757 ) -> Option<(StatsGetMemoryStatsCompressionResponder)> {
9758 if let StatsRequest::GetMemoryStatsCompression { responder } = self {
9759 Some((responder))
9760 } else {
9761 None
9762 }
9763 }
9764
9765 #[allow(irrefutable_let_patterns)]
9766 pub fn into_get_cpu_stats(self) -> Option<(StatsGetCpuStatsResponder)> {
9767 if let StatsRequest::GetCpuStats { responder } = self {
9768 Some((responder))
9769 } else {
9770 None
9771 }
9772 }
9773
9774 #[allow(irrefutable_let_patterns)]
9775 pub fn into_get_cpu_load(self) -> Option<(i64, StatsGetCpuLoadResponder)> {
9776 if let StatsRequest::GetCpuLoad { duration, responder } = self {
9777 Some((duration, responder))
9778 } else {
9779 None
9780 }
9781 }
9782
9783 pub fn method_name(&self) -> &'static str {
9785 match *self {
9786 StatsRequest::GetMemoryStats { .. } => "get_memory_stats",
9787 StatsRequest::GetMemoryStatsExtended { .. } => "get_memory_stats_extended",
9788 StatsRequest::GetMemoryStatsCompression { .. } => "get_memory_stats_compression",
9789 StatsRequest::GetCpuStats { .. } => "get_cpu_stats",
9790 StatsRequest::GetCpuLoad { .. } => "get_cpu_load",
9791 }
9792 }
9793}
9794
9795#[derive(Debug, Clone)]
9796pub struct StatsControlHandle {
9797 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9798}
9799
9800impl fidl::endpoints::ControlHandle for StatsControlHandle {
9801 fn shutdown(&self) {
9802 self.inner.shutdown()
9803 }
9804 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9805 self.inner.shutdown_with_epitaph(status)
9806 }
9807
9808 fn is_closed(&self) -> bool {
9809 self.inner.channel().is_closed()
9810 }
9811 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9812 self.inner.channel().on_closed()
9813 }
9814
9815 #[cfg(target_os = "fuchsia")]
9816 fn signal_peer(
9817 &self,
9818 clear_mask: zx::Signals,
9819 set_mask: zx::Signals,
9820 ) -> Result<(), zx_status::Status> {
9821 use fidl::Peered;
9822 self.inner.channel().signal_peer(clear_mask, set_mask)
9823 }
9824}
9825
9826impl StatsControlHandle {}
9827
9828#[must_use = "FIDL methods require a response to be sent"]
9829#[derive(Debug)]
9830pub struct StatsGetMemoryStatsResponder {
9831 control_handle: std::mem::ManuallyDrop<StatsControlHandle>,
9832 tx_id: u32,
9833}
9834
9835impl std::ops::Drop for StatsGetMemoryStatsResponder {
9839 fn drop(&mut self) {
9840 self.control_handle.shutdown();
9841 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9843 }
9844}
9845
9846impl fidl::endpoints::Responder for StatsGetMemoryStatsResponder {
9847 type ControlHandle = StatsControlHandle;
9848
9849 fn control_handle(&self) -> &StatsControlHandle {
9850 &self.control_handle
9851 }
9852
9853 fn drop_without_shutdown(mut self) {
9854 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9856 std::mem::forget(self);
9858 }
9859}
9860
9861impl StatsGetMemoryStatsResponder {
9862 pub fn send(self, mut stats: &MemoryStats) -> Result<(), fidl::Error> {
9866 let _result = self.send_raw(stats);
9867 if _result.is_err() {
9868 self.control_handle.shutdown();
9869 }
9870 self.drop_without_shutdown();
9871 _result
9872 }
9873
9874 pub fn send_no_shutdown_on_err(self, mut stats: &MemoryStats) -> Result<(), fidl::Error> {
9876 let _result = self.send_raw(stats);
9877 self.drop_without_shutdown();
9878 _result
9879 }
9880
9881 fn send_raw(&self, mut stats: &MemoryStats) -> Result<(), fidl::Error> {
9882 self.control_handle.inner.send::<StatsGetMemoryStatsResponse>(
9883 (stats,),
9884 self.tx_id,
9885 0x686677932ae41074,
9886 fidl::encoding::DynamicFlags::empty(),
9887 )
9888 }
9889}
9890
9891#[must_use = "FIDL methods require a response to be sent"]
9892#[derive(Debug)]
9893pub struct StatsGetMemoryStatsExtendedResponder {
9894 control_handle: std::mem::ManuallyDrop<StatsControlHandle>,
9895 tx_id: u32,
9896}
9897
9898impl std::ops::Drop for StatsGetMemoryStatsExtendedResponder {
9902 fn drop(&mut self) {
9903 self.control_handle.shutdown();
9904 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9906 }
9907}
9908
9909impl fidl::endpoints::Responder for StatsGetMemoryStatsExtendedResponder {
9910 type ControlHandle = StatsControlHandle;
9911
9912 fn control_handle(&self) -> &StatsControlHandle {
9913 &self.control_handle
9914 }
9915
9916 fn drop_without_shutdown(mut self) {
9917 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9919 std::mem::forget(self);
9921 }
9922}
9923
9924impl StatsGetMemoryStatsExtendedResponder {
9925 pub fn send(self, mut stats: &MemoryStatsExtended) -> Result<(), fidl::Error> {
9929 let _result = self.send_raw(stats);
9930 if _result.is_err() {
9931 self.control_handle.shutdown();
9932 }
9933 self.drop_without_shutdown();
9934 _result
9935 }
9936
9937 pub fn send_no_shutdown_on_err(
9939 self,
9940 mut stats: &MemoryStatsExtended,
9941 ) -> Result<(), fidl::Error> {
9942 let _result = self.send_raw(stats);
9943 self.drop_without_shutdown();
9944 _result
9945 }
9946
9947 fn send_raw(&self, mut stats: &MemoryStatsExtended) -> Result<(), fidl::Error> {
9948 self.control_handle.inner.send::<StatsGetMemoryStatsExtendedResponse>(
9949 (stats,),
9950 self.tx_id,
9951 0x60faa0f8aa38c29f,
9952 fidl::encoding::DynamicFlags::empty(),
9953 )
9954 }
9955}
9956
9957#[must_use = "FIDL methods require a response to be sent"]
9958#[derive(Debug)]
9959pub struct StatsGetMemoryStatsCompressionResponder {
9960 control_handle: std::mem::ManuallyDrop<StatsControlHandle>,
9961 tx_id: u32,
9962}
9963
9964impl std::ops::Drop for StatsGetMemoryStatsCompressionResponder {
9968 fn drop(&mut self) {
9969 self.control_handle.shutdown();
9970 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9972 }
9973}
9974
9975impl fidl::endpoints::Responder for StatsGetMemoryStatsCompressionResponder {
9976 type ControlHandle = StatsControlHandle;
9977
9978 fn control_handle(&self) -> &StatsControlHandle {
9979 &self.control_handle
9980 }
9981
9982 fn drop_without_shutdown(mut self) {
9983 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9985 std::mem::forget(self);
9987 }
9988}
9989
9990impl StatsGetMemoryStatsCompressionResponder {
9991 pub fn send(self, mut payload: &MemoryStatsCompression) -> Result<(), fidl::Error> {
9995 let _result = self.send_raw(payload);
9996 if _result.is_err() {
9997 self.control_handle.shutdown();
9998 }
9999 self.drop_without_shutdown();
10000 _result
10001 }
10002
10003 pub fn send_no_shutdown_on_err(
10005 self,
10006 mut payload: &MemoryStatsCompression,
10007 ) -> Result<(), fidl::Error> {
10008 let _result = self.send_raw(payload);
10009 self.drop_without_shutdown();
10010 _result
10011 }
10012
10013 fn send_raw(&self, mut payload: &MemoryStatsCompression) -> Result<(), fidl::Error> {
10014 self.control_handle.inner.send::<MemoryStatsCompression>(
10015 payload,
10016 self.tx_id,
10017 0x544a09995befb531,
10018 fidl::encoding::DynamicFlags::empty(),
10019 )
10020 }
10021}
10022
10023#[must_use = "FIDL methods require a response to be sent"]
10024#[derive(Debug)]
10025pub struct StatsGetCpuStatsResponder {
10026 control_handle: std::mem::ManuallyDrop<StatsControlHandle>,
10027 tx_id: u32,
10028}
10029
10030impl std::ops::Drop for StatsGetCpuStatsResponder {
10034 fn drop(&mut self) {
10035 self.control_handle.shutdown();
10036 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10038 }
10039}
10040
10041impl fidl::endpoints::Responder for StatsGetCpuStatsResponder {
10042 type ControlHandle = StatsControlHandle;
10043
10044 fn control_handle(&self) -> &StatsControlHandle {
10045 &self.control_handle
10046 }
10047
10048 fn drop_without_shutdown(mut self) {
10049 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10051 std::mem::forget(self);
10053 }
10054}
10055
10056impl StatsGetCpuStatsResponder {
10057 pub fn send(self, mut stats: &CpuStats) -> Result<(), fidl::Error> {
10061 let _result = self.send_raw(stats);
10062 if _result.is_err() {
10063 self.control_handle.shutdown();
10064 }
10065 self.drop_without_shutdown();
10066 _result
10067 }
10068
10069 pub fn send_no_shutdown_on_err(self, mut stats: &CpuStats) -> Result<(), fidl::Error> {
10071 let _result = self.send_raw(stats);
10072 self.drop_without_shutdown();
10073 _result
10074 }
10075
10076 fn send_raw(&self, mut stats: &CpuStats) -> Result<(), fidl::Error> {
10077 self.control_handle.inner.send::<StatsGetCpuStatsResponse>(
10078 (stats,),
10079 self.tx_id,
10080 0x470e2684ca1ca19e,
10081 fidl::encoding::DynamicFlags::empty(),
10082 )
10083 }
10084}
10085
10086#[must_use = "FIDL methods require a response to be sent"]
10087#[derive(Debug)]
10088pub struct StatsGetCpuLoadResponder {
10089 control_handle: std::mem::ManuallyDrop<StatsControlHandle>,
10090 tx_id: u32,
10091}
10092
10093impl std::ops::Drop for StatsGetCpuLoadResponder {
10097 fn drop(&mut self) {
10098 self.control_handle.shutdown();
10099 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10101 }
10102}
10103
10104impl fidl::endpoints::Responder for StatsGetCpuLoadResponder {
10105 type ControlHandle = StatsControlHandle;
10106
10107 fn control_handle(&self) -> &StatsControlHandle {
10108 &self.control_handle
10109 }
10110
10111 fn drop_without_shutdown(mut self) {
10112 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10114 std::mem::forget(self);
10116 }
10117}
10118
10119impl StatsGetCpuLoadResponder {
10120 pub fn send(self, mut per_cpu_load: &[f32]) -> Result<(), fidl::Error> {
10124 let _result = self.send_raw(per_cpu_load);
10125 if _result.is_err() {
10126 self.control_handle.shutdown();
10127 }
10128 self.drop_without_shutdown();
10129 _result
10130 }
10131
10132 pub fn send_no_shutdown_on_err(self, mut per_cpu_load: &[f32]) -> Result<(), fidl::Error> {
10134 let _result = self.send_raw(per_cpu_load);
10135 self.drop_without_shutdown();
10136 _result
10137 }
10138
10139 fn send_raw(&self, mut per_cpu_load: &[f32]) -> Result<(), fidl::Error> {
10140 self.control_handle.inner.send::<StatsGetCpuLoadResponse>(
10141 (per_cpu_load,),
10142 self.tx_id,
10143 0x4c8f0f05e7034666,
10144 fidl::encoding::DynamicFlags::empty(),
10145 )
10146 }
10147}
10148
10149#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10150pub struct TracingResourceMarker;
10151
10152impl fidl::endpoints::ProtocolMarker for TracingResourceMarker {
10153 type Proxy = TracingResourceProxy;
10154 type RequestStream = TracingResourceRequestStream;
10155 #[cfg(target_os = "fuchsia")]
10156 type SynchronousProxy = TracingResourceSynchronousProxy;
10157
10158 const DEBUG_NAME: &'static str = "fuchsia.kernel.TracingResource";
10159}
10160impl fidl::endpoints::DiscoverableProtocolMarker for TracingResourceMarker {}
10161
10162pub trait TracingResourceProxyInterface: Send + Sync {
10163 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
10164 fn r#get(&self) -> Self::GetResponseFut;
10165}
10166#[derive(Debug)]
10167#[cfg(target_os = "fuchsia")]
10168pub struct TracingResourceSynchronousProxy {
10169 client: fidl::client::sync::Client,
10170}
10171
10172#[cfg(target_os = "fuchsia")]
10173impl fidl::endpoints::SynchronousProxy for TracingResourceSynchronousProxy {
10174 type Proxy = TracingResourceProxy;
10175 type Protocol = TracingResourceMarker;
10176
10177 fn from_channel(inner: fidl::Channel) -> Self {
10178 Self::new(inner)
10179 }
10180
10181 fn into_channel(self) -> fidl::Channel {
10182 self.client.into_channel()
10183 }
10184
10185 fn as_channel(&self) -> &fidl::Channel {
10186 self.client.as_channel()
10187 }
10188}
10189
10190#[cfg(target_os = "fuchsia")]
10191impl TracingResourceSynchronousProxy {
10192 pub fn new(channel: fidl::Channel) -> Self {
10193 let protocol_name = <TracingResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10194 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10195 }
10196
10197 pub fn into_channel(self) -> fidl::Channel {
10198 self.client.into_channel()
10199 }
10200
10201 pub fn wait_for_event(
10204 &self,
10205 deadline: zx::MonotonicInstant,
10206 ) -> Result<TracingResourceEvent, fidl::Error> {
10207 TracingResourceEvent::decode(self.client.wait_for_event(deadline)?)
10208 }
10209
10210 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
10212 let _response =
10213 self.client.send_query::<fidl::encoding::EmptyPayload, TracingResourceGetResponse>(
10214 (),
10215 0x299bc179aa54c6aa,
10216 fidl::encoding::DynamicFlags::empty(),
10217 ___deadline,
10218 )?;
10219 Ok(_response.resource)
10220 }
10221}
10222
10223#[cfg(target_os = "fuchsia")]
10224impl From<TracingResourceSynchronousProxy> for zx::Handle {
10225 fn from(value: TracingResourceSynchronousProxy) -> Self {
10226 value.into_channel().into()
10227 }
10228}
10229
10230#[cfg(target_os = "fuchsia")]
10231impl From<fidl::Channel> for TracingResourceSynchronousProxy {
10232 fn from(value: fidl::Channel) -> Self {
10233 Self::new(value)
10234 }
10235}
10236
10237#[derive(Debug, Clone)]
10238pub struct TracingResourceProxy {
10239 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10240}
10241
10242impl fidl::endpoints::Proxy for TracingResourceProxy {
10243 type Protocol = TracingResourceMarker;
10244
10245 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10246 Self::new(inner)
10247 }
10248
10249 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10250 self.client.into_channel().map_err(|client| Self { client })
10251 }
10252
10253 fn as_channel(&self) -> &::fidl::AsyncChannel {
10254 self.client.as_channel()
10255 }
10256}
10257
10258impl TracingResourceProxy {
10259 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10261 let protocol_name = <TracingResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10262 Self { client: fidl::client::Client::new(channel, protocol_name) }
10263 }
10264
10265 pub fn take_event_stream(&self) -> TracingResourceEventStream {
10271 TracingResourceEventStream { event_receiver: self.client.take_event_receiver() }
10272 }
10273
10274 pub fn r#get(
10276 &self,
10277 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
10278 {
10279 TracingResourceProxyInterface::r#get(self)
10280 }
10281}
10282
10283impl TracingResourceProxyInterface for TracingResourceProxy {
10284 type GetResponseFut = fidl::client::QueryResponseFut<
10285 fidl::Resource,
10286 fidl::encoding::DefaultFuchsiaResourceDialect,
10287 >;
10288 fn r#get(&self) -> Self::GetResponseFut {
10289 fn _decode(
10290 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10291 ) -> Result<fidl::Resource, fidl::Error> {
10292 let _response = fidl::client::decode_transaction_body::<
10293 TracingResourceGetResponse,
10294 fidl::encoding::DefaultFuchsiaResourceDialect,
10295 0x299bc179aa54c6aa,
10296 >(_buf?)?;
10297 Ok(_response.resource)
10298 }
10299 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
10300 (),
10301 0x299bc179aa54c6aa,
10302 fidl::encoding::DynamicFlags::empty(),
10303 _decode,
10304 )
10305 }
10306}
10307
10308pub struct TracingResourceEventStream {
10309 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10310}
10311
10312impl std::marker::Unpin for TracingResourceEventStream {}
10313
10314impl futures::stream::FusedStream for TracingResourceEventStream {
10315 fn is_terminated(&self) -> bool {
10316 self.event_receiver.is_terminated()
10317 }
10318}
10319
10320impl futures::Stream for TracingResourceEventStream {
10321 type Item = Result<TracingResourceEvent, fidl::Error>;
10322
10323 fn poll_next(
10324 mut self: std::pin::Pin<&mut Self>,
10325 cx: &mut std::task::Context<'_>,
10326 ) -> std::task::Poll<Option<Self::Item>> {
10327 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10328 &mut self.event_receiver,
10329 cx
10330 )?) {
10331 Some(buf) => std::task::Poll::Ready(Some(TracingResourceEvent::decode(buf))),
10332 None => std::task::Poll::Ready(None),
10333 }
10334 }
10335}
10336
10337#[derive(Debug)]
10338pub enum TracingResourceEvent {}
10339
10340impl TracingResourceEvent {
10341 fn decode(
10343 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10344 ) -> Result<TracingResourceEvent, fidl::Error> {
10345 let (bytes, _handles) = buf.split_mut();
10346 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10347 debug_assert_eq!(tx_header.tx_id, 0);
10348 match tx_header.ordinal {
10349 _ => Err(fidl::Error::UnknownOrdinal {
10350 ordinal: tx_header.ordinal,
10351 protocol_name:
10352 <TracingResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10353 }),
10354 }
10355 }
10356}
10357
10358pub struct TracingResourceRequestStream {
10360 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10361 is_terminated: bool,
10362}
10363
10364impl std::marker::Unpin for TracingResourceRequestStream {}
10365
10366impl futures::stream::FusedStream for TracingResourceRequestStream {
10367 fn is_terminated(&self) -> bool {
10368 self.is_terminated
10369 }
10370}
10371
10372impl fidl::endpoints::RequestStream for TracingResourceRequestStream {
10373 type Protocol = TracingResourceMarker;
10374 type ControlHandle = TracingResourceControlHandle;
10375
10376 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10377 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10378 }
10379
10380 fn control_handle(&self) -> Self::ControlHandle {
10381 TracingResourceControlHandle { inner: self.inner.clone() }
10382 }
10383
10384 fn into_inner(
10385 self,
10386 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10387 {
10388 (self.inner, self.is_terminated)
10389 }
10390
10391 fn from_inner(
10392 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10393 is_terminated: bool,
10394 ) -> Self {
10395 Self { inner, is_terminated }
10396 }
10397}
10398
10399impl futures::Stream for TracingResourceRequestStream {
10400 type Item = Result<TracingResourceRequest, fidl::Error>;
10401
10402 fn poll_next(
10403 mut self: std::pin::Pin<&mut Self>,
10404 cx: &mut std::task::Context<'_>,
10405 ) -> std::task::Poll<Option<Self::Item>> {
10406 let this = &mut *self;
10407 if this.inner.check_shutdown(cx) {
10408 this.is_terminated = true;
10409 return std::task::Poll::Ready(None);
10410 }
10411 if this.is_terminated {
10412 panic!("polled TracingResourceRequestStream after completion");
10413 }
10414 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10415 |bytes, handles| {
10416 match this.inner.channel().read_etc(cx, bytes, handles) {
10417 std::task::Poll::Ready(Ok(())) => {}
10418 std::task::Poll::Pending => return std::task::Poll::Pending,
10419 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10420 this.is_terminated = true;
10421 return std::task::Poll::Ready(None);
10422 }
10423 std::task::Poll::Ready(Err(e)) => {
10424 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10425 e.into(),
10426 ))))
10427 }
10428 }
10429
10430 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10432
10433 std::task::Poll::Ready(Some(match header.ordinal {
10434 0x299bc179aa54c6aa => {
10435 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10436 let mut req = fidl::new_empty!(
10437 fidl::encoding::EmptyPayload,
10438 fidl::encoding::DefaultFuchsiaResourceDialect
10439 );
10440 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10441 let control_handle =
10442 TracingResourceControlHandle { inner: this.inner.clone() };
10443 Ok(TracingResourceRequest::Get {
10444 responder: TracingResourceGetResponder {
10445 control_handle: std::mem::ManuallyDrop::new(control_handle),
10446 tx_id: header.tx_id,
10447 },
10448 })
10449 }
10450 _ => Err(fidl::Error::UnknownOrdinal {
10451 ordinal: header.ordinal,
10452 protocol_name:
10453 <TracingResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10454 }),
10455 }))
10456 },
10457 )
10458 }
10459}
10460
10461#[derive(Debug)]
10464pub enum TracingResourceRequest {
10465 Get { responder: TracingResourceGetResponder },
10467}
10468
10469impl TracingResourceRequest {
10470 #[allow(irrefutable_let_patterns)]
10471 pub fn into_get(self) -> Option<(TracingResourceGetResponder)> {
10472 if let TracingResourceRequest::Get { responder } = self {
10473 Some((responder))
10474 } else {
10475 None
10476 }
10477 }
10478
10479 pub fn method_name(&self) -> &'static str {
10481 match *self {
10482 TracingResourceRequest::Get { .. } => "get",
10483 }
10484 }
10485}
10486
10487#[derive(Debug, Clone)]
10488pub struct TracingResourceControlHandle {
10489 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10490}
10491
10492impl fidl::endpoints::ControlHandle for TracingResourceControlHandle {
10493 fn shutdown(&self) {
10494 self.inner.shutdown()
10495 }
10496 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10497 self.inner.shutdown_with_epitaph(status)
10498 }
10499
10500 fn is_closed(&self) -> bool {
10501 self.inner.channel().is_closed()
10502 }
10503 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10504 self.inner.channel().on_closed()
10505 }
10506
10507 #[cfg(target_os = "fuchsia")]
10508 fn signal_peer(
10509 &self,
10510 clear_mask: zx::Signals,
10511 set_mask: zx::Signals,
10512 ) -> Result<(), zx_status::Status> {
10513 use fidl::Peered;
10514 self.inner.channel().signal_peer(clear_mask, set_mask)
10515 }
10516}
10517
10518impl TracingResourceControlHandle {}
10519
10520#[must_use = "FIDL methods require a response to be sent"]
10521#[derive(Debug)]
10522pub struct TracingResourceGetResponder {
10523 control_handle: std::mem::ManuallyDrop<TracingResourceControlHandle>,
10524 tx_id: u32,
10525}
10526
10527impl std::ops::Drop for TracingResourceGetResponder {
10531 fn drop(&mut self) {
10532 self.control_handle.shutdown();
10533 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10535 }
10536}
10537
10538impl fidl::endpoints::Responder for TracingResourceGetResponder {
10539 type ControlHandle = TracingResourceControlHandle;
10540
10541 fn control_handle(&self) -> &TracingResourceControlHandle {
10542 &self.control_handle
10543 }
10544
10545 fn drop_without_shutdown(mut self) {
10546 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10548 std::mem::forget(self);
10550 }
10551}
10552
10553impl TracingResourceGetResponder {
10554 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
10558 let _result = self.send_raw(resource);
10559 if _result.is_err() {
10560 self.control_handle.shutdown();
10561 }
10562 self.drop_without_shutdown();
10563 _result
10564 }
10565
10566 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
10568 let _result = self.send_raw(resource);
10569 self.drop_without_shutdown();
10570 _result
10571 }
10572
10573 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
10574 self.control_handle.inner.send::<TracingResourceGetResponse>(
10575 (resource,),
10576 self.tx_id,
10577 0x299bc179aa54c6aa,
10578 fidl::encoding::DynamicFlags::empty(),
10579 )
10580 }
10581}
10582
10583#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10584pub struct VmexResourceMarker;
10585
10586impl fidl::endpoints::ProtocolMarker for VmexResourceMarker {
10587 type Proxy = VmexResourceProxy;
10588 type RequestStream = VmexResourceRequestStream;
10589 #[cfg(target_os = "fuchsia")]
10590 type SynchronousProxy = VmexResourceSynchronousProxy;
10591
10592 const DEBUG_NAME: &'static str = "fuchsia.kernel.VmexResource";
10593}
10594impl fidl::endpoints::DiscoverableProtocolMarker for VmexResourceMarker {}
10595
10596pub trait VmexResourceProxyInterface: Send + Sync {
10597 type GetResponseFut: std::future::Future<Output = Result<fidl::Resource, fidl::Error>> + Send;
10598 fn r#get(&self) -> Self::GetResponseFut;
10599}
10600#[derive(Debug)]
10601#[cfg(target_os = "fuchsia")]
10602pub struct VmexResourceSynchronousProxy {
10603 client: fidl::client::sync::Client,
10604}
10605
10606#[cfg(target_os = "fuchsia")]
10607impl fidl::endpoints::SynchronousProxy for VmexResourceSynchronousProxy {
10608 type Proxy = VmexResourceProxy;
10609 type Protocol = VmexResourceMarker;
10610
10611 fn from_channel(inner: fidl::Channel) -> Self {
10612 Self::new(inner)
10613 }
10614
10615 fn into_channel(self) -> fidl::Channel {
10616 self.client.into_channel()
10617 }
10618
10619 fn as_channel(&self) -> &fidl::Channel {
10620 self.client.as_channel()
10621 }
10622}
10623
10624#[cfg(target_os = "fuchsia")]
10625impl VmexResourceSynchronousProxy {
10626 pub fn new(channel: fidl::Channel) -> Self {
10627 let protocol_name = <VmexResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10628 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10629 }
10630
10631 pub fn into_channel(self) -> fidl::Channel {
10632 self.client.into_channel()
10633 }
10634
10635 pub fn wait_for_event(
10638 &self,
10639 deadline: zx::MonotonicInstant,
10640 ) -> Result<VmexResourceEvent, fidl::Error> {
10641 VmexResourceEvent::decode(self.client.wait_for_event(deadline)?)
10642 }
10643
10644 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::Resource, fidl::Error> {
10646 let _response =
10647 self.client.send_query::<fidl::encoding::EmptyPayload, VmexResourceGetResponse>(
10648 (),
10649 0x33db32deed650699,
10650 fidl::encoding::DynamicFlags::empty(),
10651 ___deadline,
10652 )?;
10653 Ok(_response.resource)
10654 }
10655}
10656
10657#[cfg(target_os = "fuchsia")]
10658impl From<VmexResourceSynchronousProxy> for zx::Handle {
10659 fn from(value: VmexResourceSynchronousProxy) -> Self {
10660 value.into_channel().into()
10661 }
10662}
10663
10664#[cfg(target_os = "fuchsia")]
10665impl From<fidl::Channel> for VmexResourceSynchronousProxy {
10666 fn from(value: fidl::Channel) -> Self {
10667 Self::new(value)
10668 }
10669}
10670
10671#[derive(Debug, Clone)]
10672pub struct VmexResourceProxy {
10673 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10674}
10675
10676impl fidl::endpoints::Proxy for VmexResourceProxy {
10677 type Protocol = VmexResourceMarker;
10678
10679 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10680 Self::new(inner)
10681 }
10682
10683 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10684 self.client.into_channel().map_err(|client| Self { client })
10685 }
10686
10687 fn as_channel(&self) -> &::fidl::AsyncChannel {
10688 self.client.as_channel()
10689 }
10690}
10691
10692impl VmexResourceProxy {
10693 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10695 let protocol_name = <VmexResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10696 Self { client: fidl::client::Client::new(channel, protocol_name) }
10697 }
10698
10699 pub fn take_event_stream(&self) -> VmexResourceEventStream {
10705 VmexResourceEventStream { event_receiver: self.client.take_event_receiver() }
10706 }
10707
10708 pub fn r#get(
10710 &self,
10711 ) -> fidl::client::QueryResponseFut<fidl::Resource, fidl::encoding::DefaultFuchsiaResourceDialect>
10712 {
10713 VmexResourceProxyInterface::r#get(self)
10714 }
10715}
10716
10717impl VmexResourceProxyInterface for VmexResourceProxy {
10718 type GetResponseFut = fidl::client::QueryResponseFut<
10719 fidl::Resource,
10720 fidl::encoding::DefaultFuchsiaResourceDialect,
10721 >;
10722 fn r#get(&self) -> Self::GetResponseFut {
10723 fn _decode(
10724 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10725 ) -> Result<fidl::Resource, fidl::Error> {
10726 let _response = fidl::client::decode_transaction_body::<
10727 VmexResourceGetResponse,
10728 fidl::encoding::DefaultFuchsiaResourceDialect,
10729 0x33db32deed650699,
10730 >(_buf?)?;
10731 Ok(_response.resource)
10732 }
10733 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Resource>(
10734 (),
10735 0x33db32deed650699,
10736 fidl::encoding::DynamicFlags::empty(),
10737 _decode,
10738 )
10739 }
10740}
10741
10742pub struct VmexResourceEventStream {
10743 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10744}
10745
10746impl std::marker::Unpin for VmexResourceEventStream {}
10747
10748impl futures::stream::FusedStream for VmexResourceEventStream {
10749 fn is_terminated(&self) -> bool {
10750 self.event_receiver.is_terminated()
10751 }
10752}
10753
10754impl futures::Stream for VmexResourceEventStream {
10755 type Item = Result<VmexResourceEvent, fidl::Error>;
10756
10757 fn poll_next(
10758 mut self: std::pin::Pin<&mut Self>,
10759 cx: &mut std::task::Context<'_>,
10760 ) -> std::task::Poll<Option<Self::Item>> {
10761 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10762 &mut self.event_receiver,
10763 cx
10764 )?) {
10765 Some(buf) => std::task::Poll::Ready(Some(VmexResourceEvent::decode(buf))),
10766 None => std::task::Poll::Ready(None),
10767 }
10768 }
10769}
10770
10771#[derive(Debug)]
10772pub enum VmexResourceEvent {}
10773
10774impl VmexResourceEvent {
10775 fn decode(
10777 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10778 ) -> Result<VmexResourceEvent, fidl::Error> {
10779 let (bytes, _handles) = buf.split_mut();
10780 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10781 debug_assert_eq!(tx_header.tx_id, 0);
10782 match tx_header.ordinal {
10783 _ => Err(fidl::Error::UnknownOrdinal {
10784 ordinal: tx_header.ordinal,
10785 protocol_name: <VmexResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10786 }),
10787 }
10788 }
10789}
10790
10791pub struct VmexResourceRequestStream {
10793 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10794 is_terminated: bool,
10795}
10796
10797impl std::marker::Unpin for VmexResourceRequestStream {}
10798
10799impl futures::stream::FusedStream for VmexResourceRequestStream {
10800 fn is_terminated(&self) -> bool {
10801 self.is_terminated
10802 }
10803}
10804
10805impl fidl::endpoints::RequestStream for VmexResourceRequestStream {
10806 type Protocol = VmexResourceMarker;
10807 type ControlHandle = VmexResourceControlHandle;
10808
10809 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10810 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10811 }
10812
10813 fn control_handle(&self) -> Self::ControlHandle {
10814 VmexResourceControlHandle { inner: self.inner.clone() }
10815 }
10816
10817 fn into_inner(
10818 self,
10819 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10820 {
10821 (self.inner, self.is_terminated)
10822 }
10823
10824 fn from_inner(
10825 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10826 is_terminated: bool,
10827 ) -> Self {
10828 Self { inner, is_terminated }
10829 }
10830}
10831
10832impl futures::Stream for VmexResourceRequestStream {
10833 type Item = Result<VmexResourceRequest, fidl::Error>;
10834
10835 fn poll_next(
10836 mut self: std::pin::Pin<&mut Self>,
10837 cx: &mut std::task::Context<'_>,
10838 ) -> std::task::Poll<Option<Self::Item>> {
10839 let this = &mut *self;
10840 if this.inner.check_shutdown(cx) {
10841 this.is_terminated = true;
10842 return std::task::Poll::Ready(None);
10843 }
10844 if this.is_terminated {
10845 panic!("polled VmexResourceRequestStream after completion");
10846 }
10847 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10848 |bytes, handles| {
10849 match this.inner.channel().read_etc(cx, bytes, handles) {
10850 std::task::Poll::Ready(Ok(())) => {}
10851 std::task::Poll::Pending => return std::task::Poll::Pending,
10852 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10853 this.is_terminated = true;
10854 return std::task::Poll::Ready(None);
10855 }
10856 std::task::Poll::Ready(Err(e)) => {
10857 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10858 e.into(),
10859 ))))
10860 }
10861 }
10862
10863 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10865
10866 std::task::Poll::Ready(Some(match header.ordinal {
10867 0x33db32deed650699 => {
10868 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10869 let mut req = fidl::new_empty!(
10870 fidl::encoding::EmptyPayload,
10871 fidl::encoding::DefaultFuchsiaResourceDialect
10872 );
10873 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10874 let control_handle =
10875 VmexResourceControlHandle { inner: this.inner.clone() };
10876 Ok(VmexResourceRequest::Get {
10877 responder: VmexResourceGetResponder {
10878 control_handle: std::mem::ManuallyDrop::new(control_handle),
10879 tx_id: header.tx_id,
10880 },
10881 })
10882 }
10883 _ => Err(fidl::Error::UnknownOrdinal {
10884 ordinal: header.ordinal,
10885 protocol_name:
10886 <VmexResourceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10887 }),
10888 }))
10889 },
10890 )
10891 }
10892}
10893
10894#[derive(Debug)]
10898pub enum VmexResourceRequest {
10899 Get { responder: VmexResourceGetResponder },
10901}
10902
10903impl VmexResourceRequest {
10904 #[allow(irrefutable_let_patterns)]
10905 pub fn into_get(self) -> Option<(VmexResourceGetResponder)> {
10906 if let VmexResourceRequest::Get { responder } = self {
10907 Some((responder))
10908 } else {
10909 None
10910 }
10911 }
10912
10913 pub fn method_name(&self) -> &'static str {
10915 match *self {
10916 VmexResourceRequest::Get { .. } => "get",
10917 }
10918 }
10919}
10920
10921#[derive(Debug, Clone)]
10922pub struct VmexResourceControlHandle {
10923 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10924}
10925
10926impl fidl::endpoints::ControlHandle for VmexResourceControlHandle {
10927 fn shutdown(&self) {
10928 self.inner.shutdown()
10929 }
10930 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10931 self.inner.shutdown_with_epitaph(status)
10932 }
10933
10934 fn is_closed(&self) -> bool {
10935 self.inner.channel().is_closed()
10936 }
10937 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10938 self.inner.channel().on_closed()
10939 }
10940
10941 #[cfg(target_os = "fuchsia")]
10942 fn signal_peer(
10943 &self,
10944 clear_mask: zx::Signals,
10945 set_mask: zx::Signals,
10946 ) -> Result<(), zx_status::Status> {
10947 use fidl::Peered;
10948 self.inner.channel().signal_peer(clear_mask, set_mask)
10949 }
10950}
10951
10952impl VmexResourceControlHandle {}
10953
10954#[must_use = "FIDL methods require a response to be sent"]
10955#[derive(Debug)]
10956pub struct VmexResourceGetResponder {
10957 control_handle: std::mem::ManuallyDrop<VmexResourceControlHandle>,
10958 tx_id: u32,
10959}
10960
10961impl std::ops::Drop for VmexResourceGetResponder {
10965 fn drop(&mut self) {
10966 self.control_handle.shutdown();
10967 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10969 }
10970}
10971
10972impl fidl::endpoints::Responder for VmexResourceGetResponder {
10973 type ControlHandle = VmexResourceControlHandle;
10974
10975 fn control_handle(&self) -> &VmexResourceControlHandle {
10976 &self.control_handle
10977 }
10978
10979 fn drop_without_shutdown(mut self) {
10980 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10982 std::mem::forget(self);
10984 }
10985}
10986
10987impl VmexResourceGetResponder {
10988 pub fn send(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
10992 let _result = self.send_raw(resource);
10993 if _result.is_err() {
10994 self.control_handle.shutdown();
10995 }
10996 self.drop_without_shutdown();
10997 _result
10998 }
10999
11000 pub fn send_no_shutdown_on_err(self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
11002 let _result = self.send_raw(resource);
11003 self.drop_without_shutdown();
11004 _result
11005 }
11006
11007 fn send_raw(&self, mut resource: fidl::Resource) -> Result<(), fidl::Error> {
11008 self.control_handle.inner.send::<VmexResourceGetResponse>(
11009 (resource,),
11010 self.tx_id,
11011 0x33db32deed650699,
11012 fidl::encoding::DynamicFlags::empty(),
11013 )
11014 }
11015}
11016
11017mod internal {
11018 use super::*;
11019
11020 impl fidl::encoding::ResourceTypeMarker for CounterGetInspectVmoResponse {
11021 type Borrowed<'a> = &'a mut Self;
11022 fn take_or_borrow<'a>(
11023 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11024 ) -> Self::Borrowed<'a> {
11025 value
11026 }
11027 }
11028
11029 unsafe impl fidl::encoding::TypeMarker for CounterGetInspectVmoResponse {
11030 type Owned = Self;
11031
11032 #[inline(always)]
11033 fn inline_align(_context: fidl::encoding::Context) -> usize {
11034 8
11035 }
11036
11037 #[inline(always)]
11038 fn inline_size(_context: fidl::encoding::Context) -> usize {
11039 24
11040 }
11041 }
11042
11043 unsafe impl
11044 fidl::encoding::Encode<
11045 CounterGetInspectVmoResponse,
11046 fidl::encoding::DefaultFuchsiaResourceDialect,
11047 > for &mut CounterGetInspectVmoResponse
11048 {
11049 #[inline]
11050 unsafe fn encode(
11051 self,
11052 encoder: &mut fidl::encoding::Encoder<
11053 '_,
11054 fidl::encoding::DefaultFuchsiaResourceDialect,
11055 >,
11056 offset: usize,
11057 _depth: fidl::encoding::Depth,
11058 ) -> fidl::Result<()> {
11059 encoder.debug_check_bounds::<CounterGetInspectVmoResponse>(offset);
11060 fidl::encoding::Encode::<CounterGetInspectVmoResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11062 (
11063 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
11064 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.buffer),
11065 ),
11066 encoder, offset, _depth
11067 )
11068 }
11069 }
11070 unsafe impl<
11071 T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
11072 T1: fidl::encoding::Encode<
11073 fidl_fuchsia_mem::Buffer,
11074 fidl::encoding::DefaultFuchsiaResourceDialect,
11075 >,
11076 >
11077 fidl::encoding::Encode<
11078 CounterGetInspectVmoResponse,
11079 fidl::encoding::DefaultFuchsiaResourceDialect,
11080 > for (T0, T1)
11081 {
11082 #[inline]
11083 unsafe fn encode(
11084 self,
11085 encoder: &mut fidl::encoding::Encoder<
11086 '_,
11087 fidl::encoding::DefaultFuchsiaResourceDialect,
11088 >,
11089 offset: usize,
11090 depth: fidl::encoding::Depth,
11091 ) -> fidl::Result<()> {
11092 encoder.debug_check_bounds::<CounterGetInspectVmoResponse>(offset);
11093 unsafe {
11096 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11097 (ptr as *mut u64).write_unaligned(0);
11098 }
11099 self.0.encode(encoder, offset + 0, depth)?;
11101 self.1.encode(encoder, offset + 8, depth)?;
11102 Ok(())
11103 }
11104 }
11105
11106 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11107 for CounterGetInspectVmoResponse
11108 {
11109 #[inline(always)]
11110 fn new_empty() -> Self {
11111 Self {
11112 status: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
11113 buffer: fidl::new_empty!(
11114 fidl_fuchsia_mem::Buffer,
11115 fidl::encoding::DefaultFuchsiaResourceDialect
11116 ),
11117 }
11118 }
11119
11120 #[inline]
11121 unsafe fn decode(
11122 &mut self,
11123 decoder: &mut fidl::encoding::Decoder<
11124 '_,
11125 fidl::encoding::DefaultFuchsiaResourceDialect,
11126 >,
11127 offset: usize,
11128 _depth: fidl::encoding::Depth,
11129 ) -> fidl::Result<()> {
11130 decoder.debug_check_bounds::<Self>(offset);
11131 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11133 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11134 let mask = 0xffffffff00000000u64;
11135 let maskedval = padval & mask;
11136 if maskedval != 0 {
11137 return Err(fidl::Error::NonZeroPadding {
11138 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11139 });
11140 }
11141 fidl::decode!(
11142 i32,
11143 fidl::encoding::DefaultFuchsiaResourceDialect,
11144 &mut self.status,
11145 decoder,
11146 offset + 0,
11147 _depth
11148 )?;
11149 fidl::decode!(
11150 fidl_fuchsia_mem::Buffer,
11151 fidl::encoding::DefaultFuchsiaResourceDialect,
11152 &mut self.buffer,
11153 decoder,
11154 offset + 8,
11155 _depth
11156 )?;
11157 Ok(())
11158 }
11159 }
11160
11161 impl fidl::encoding::ResourceTypeMarker for CpuResourceGetResponse {
11162 type Borrowed<'a> = &'a mut Self;
11163 fn take_or_borrow<'a>(
11164 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11165 ) -> Self::Borrowed<'a> {
11166 value
11167 }
11168 }
11169
11170 unsafe impl fidl::encoding::TypeMarker for CpuResourceGetResponse {
11171 type Owned = Self;
11172
11173 #[inline(always)]
11174 fn inline_align(_context: fidl::encoding::Context) -> usize {
11175 4
11176 }
11177
11178 #[inline(always)]
11179 fn inline_size(_context: fidl::encoding::Context) -> usize {
11180 4
11181 }
11182 }
11183
11184 unsafe impl
11185 fidl::encoding::Encode<
11186 CpuResourceGetResponse,
11187 fidl::encoding::DefaultFuchsiaResourceDialect,
11188 > for &mut CpuResourceGetResponse
11189 {
11190 #[inline]
11191 unsafe fn encode(
11192 self,
11193 encoder: &mut fidl::encoding::Encoder<
11194 '_,
11195 fidl::encoding::DefaultFuchsiaResourceDialect,
11196 >,
11197 offset: usize,
11198 _depth: fidl::encoding::Depth,
11199 ) -> fidl::Result<()> {
11200 encoder.debug_check_bounds::<CpuResourceGetResponse>(offset);
11201 fidl::encoding::Encode::<
11203 CpuResourceGetResponse,
11204 fidl::encoding::DefaultFuchsiaResourceDialect,
11205 >::encode(
11206 (<fidl::encoding::HandleType<
11207 fidl::Resource,
11208 { fidl::ObjectType::RESOURCE.into_raw() },
11209 2147483648,
11210 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11211 &mut self.resource
11212 ),),
11213 encoder,
11214 offset,
11215 _depth,
11216 )
11217 }
11218 }
11219 unsafe impl<
11220 T0: fidl::encoding::Encode<
11221 fidl::encoding::HandleType<
11222 fidl::Resource,
11223 { fidl::ObjectType::RESOURCE.into_raw() },
11224 2147483648,
11225 >,
11226 fidl::encoding::DefaultFuchsiaResourceDialect,
11227 >,
11228 >
11229 fidl::encoding::Encode<
11230 CpuResourceGetResponse,
11231 fidl::encoding::DefaultFuchsiaResourceDialect,
11232 > for (T0,)
11233 {
11234 #[inline]
11235 unsafe fn encode(
11236 self,
11237 encoder: &mut fidl::encoding::Encoder<
11238 '_,
11239 fidl::encoding::DefaultFuchsiaResourceDialect,
11240 >,
11241 offset: usize,
11242 depth: fidl::encoding::Depth,
11243 ) -> fidl::Result<()> {
11244 encoder.debug_check_bounds::<CpuResourceGetResponse>(offset);
11245 self.0.encode(encoder, offset + 0, depth)?;
11249 Ok(())
11250 }
11251 }
11252
11253 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11254 for CpuResourceGetResponse
11255 {
11256 #[inline(always)]
11257 fn new_empty() -> Self {
11258 Self {
11259 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11260 }
11261 }
11262
11263 #[inline]
11264 unsafe fn decode(
11265 &mut self,
11266 decoder: &mut fidl::encoding::Decoder<
11267 '_,
11268 fidl::encoding::DefaultFuchsiaResourceDialect,
11269 >,
11270 offset: usize,
11271 _depth: fidl::encoding::Depth,
11272 ) -> fidl::Result<()> {
11273 decoder.debug_check_bounds::<Self>(offset);
11274 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
11276 Ok(())
11277 }
11278 }
11279
11280 impl fidl::encoding::ResourceTypeMarker for DebugResourceGetResponse {
11281 type Borrowed<'a> = &'a mut Self;
11282 fn take_or_borrow<'a>(
11283 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11284 ) -> Self::Borrowed<'a> {
11285 value
11286 }
11287 }
11288
11289 unsafe impl fidl::encoding::TypeMarker for DebugResourceGetResponse {
11290 type Owned = Self;
11291
11292 #[inline(always)]
11293 fn inline_align(_context: fidl::encoding::Context) -> usize {
11294 4
11295 }
11296
11297 #[inline(always)]
11298 fn inline_size(_context: fidl::encoding::Context) -> usize {
11299 4
11300 }
11301 }
11302
11303 unsafe impl
11304 fidl::encoding::Encode<
11305 DebugResourceGetResponse,
11306 fidl::encoding::DefaultFuchsiaResourceDialect,
11307 > for &mut DebugResourceGetResponse
11308 {
11309 #[inline]
11310 unsafe fn encode(
11311 self,
11312 encoder: &mut fidl::encoding::Encoder<
11313 '_,
11314 fidl::encoding::DefaultFuchsiaResourceDialect,
11315 >,
11316 offset: usize,
11317 _depth: fidl::encoding::Depth,
11318 ) -> fidl::Result<()> {
11319 encoder.debug_check_bounds::<DebugResourceGetResponse>(offset);
11320 fidl::encoding::Encode::<
11322 DebugResourceGetResponse,
11323 fidl::encoding::DefaultFuchsiaResourceDialect,
11324 >::encode(
11325 (<fidl::encoding::HandleType<
11326 fidl::Resource,
11327 { fidl::ObjectType::RESOURCE.into_raw() },
11328 2147483648,
11329 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11330 &mut self.resource
11331 ),),
11332 encoder,
11333 offset,
11334 _depth,
11335 )
11336 }
11337 }
11338 unsafe impl<
11339 T0: fidl::encoding::Encode<
11340 fidl::encoding::HandleType<
11341 fidl::Resource,
11342 { fidl::ObjectType::RESOURCE.into_raw() },
11343 2147483648,
11344 >,
11345 fidl::encoding::DefaultFuchsiaResourceDialect,
11346 >,
11347 >
11348 fidl::encoding::Encode<
11349 DebugResourceGetResponse,
11350 fidl::encoding::DefaultFuchsiaResourceDialect,
11351 > for (T0,)
11352 {
11353 #[inline]
11354 unsafe fn encode(
11355 self,
11356 encoder: &mut fidl::encoding::Encoder<
11357 '_,
11358 fidl::encoding::DefaultFuchsiaResourceDialect,
11359 >,
11360 offset: usize,
11361 depth: fidl::encoding::Depth,
11362 ) -> fidl::Result<()> {
11363 encoder.debug_check_bounds::<DebugResourceGetResponse>(offset);
11364 self.0.encode(encoder, offset + 0, depth)?;
11368 Ok(())
11369 }
11370 }
11371
11372 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11373 for DebugResourceGetResponse
11374 {
11375 #[inline(always)]
11376 fn new_empty() -> Self {
11377 Self {
11378 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11379 }
11380 }
11381
11382 #[inline]
11383 unsafe fn decode(
11384 &mut self,
11385 decoder: &mut fidl::encoding::Decoder<
11386 '_,
11387 fidl::encoding::DefaultFuchsiaResourceDialect,
11388 >,
11389 offset: usize,
11390 _depth: fidl::encoding::Depth,
11391 ) -> fidl::Result<()> {
11392 decoder.debug_check_bounds::<Self>(offset);
11393 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
11395 Ok(())
11396 }
11397 }
11398
11399 impl fidl::encoding::ResourceTypeMarker for DebuglogResourceGetResponse {
11400 type Borrowed<'a> = &'a mut Self;
11401 fn take_or_borrow<'a>(
11402 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11403 ) -> Self::Borrowed<'a> {
11404 value
11405 }
11406 }
11407
11408 unsafe impl fidl::encoding::TypeMarker for DebuglogResourceGetResponse {
11409 type Owned = Self;
11410
11411 #[inline(always)]
11412 fn inline_align(_context: fidl::encoding::Context) -> usize {
11413 4
11414 }
11415
11416 #[inline(always)]
11417 fn inline_size(_context: fidl::encoding::Context) -> usize {
11418 4
11419 }
11420 }
11421
11422 unsafe impl
11423 fidl::encoding::Encode<
11424 DebuglogResourceGetResponse,
11425 fidl::encoding::DefaultFuchsiaResourceDialect,
11426 > for &mut DebuglogResourceGetResponse
11427 {
11428 #[inline]
11429 unsafe fn encode(
11430 self,
11431 encoder: &mut fidl::encoding::Encoder<
11432 '_,
11433 fidl::encoding::DefaultFuchsiaResourceDialect,
11434 >,
11435 offset: usize,
11436 _depth: fidl::encoding::Depth,
11437 ) -> fidl::Result<()> {
11438 encoder.debug_check_bounds::<DebuglogResourceGetResponse>(offset);
11439 fidl::encoding::Encode::<
11441 DebuglogResourceGetResponse,
11442 fidl::encoding::DefaultFuchsiaResourceDialect,
11443 >::encode(
11444 (<fidl::encoding::HandleType<
11445 fidl::Resource,
11446 { fidl::ObjectType::RESOURCE.into_raw() },
11447 2147483648,
11448 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11449 &mut self.resource
11450 ),),
11451 encoder,
11452 offset,
11453 _depth,
11454 )
11455 }
11456 }
11457 unsafe impl<
11458 T0: fidl::encoding::Encode<
11459 fidl::encoding::HandleType<
11460 fidl::Resource,
11461 { fidl::ObjectType::RESOURCE.into_raw() },
11462 2147483648,
11463 >,
11464 fidl::encoding::DefaultFuchsiaResourceDialect,
11465 >,
11466 >
11467 fidl::encoding::Encode<
11468 DebuglogResourceGetResponse,
11469 fidl::encoding::DefaultFuchsiaResourceDialect,
11470 > for (T0,)
11471 {
11472 #[inline]
11473 unsafe fn encode(
11474 self,
11475 encoder: &mut fidl::encoding::Encoder<
11476 '_,
11477 fidl::encoding::DefaultFuchsiaResourceDialect,
11478 >,
11479 offset: usize,
11480 depth: fidl::encoding::Depth,
11481 ) -> fidl::Result<()> {
11482 encoder.debug_check_bounds::<DebuglogResourceGetResponse>(offset);
11483 self.0.encode(encoder, offset + 0, depth)?;
11487 Ok(())
11488 }
11489 }
11490
11491 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11492 for DebuglogResourceGetResponse
11493 {
11494 #[inline(always)]
11495 fn new_empty() -> Self {
11496 Self {
11497 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11498 }
11499 }
11500
11501 #[inline]
11502 unsafe fn decode(
11503 &mut self,
11504 decoder: &mut fidl::encoding::Decoder<
11505 '_,
11506 fidl::encoding::DefaultFuchsiaResourceDialect,
11507 >,
11508 offset: usize,
11509 _depth: fidl::encoding::Depth,
11510 ) -> fidl::Result<()> {
11511 decoder.debug_check_bounds::<Self>(offset);
11512 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
11514 Ok(())
11515 }
11516 }
11517
11518 impl fidl::encoding::ResourceTypeMarker for EnergyInfoResourceGetResponse {
11519 type Borrowed<'a> = &'a mut Self;
11520 fn take_or_borrow<'a>(
11521 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11522 ) -> Self::Borrowed<'a> {
11523 value
11524 }
11525 }
11526
11527 unsafe impl fidl::encoding::TypeMarker for EnergyInfoResourceGetResponse {
11528 type Owned = Self;
11529
11530 #[inline(always)]
11531 fn inline_align(_context: fidl::encoding::Context) -> usize {
11532 4
11533 }
11534
11535 #[inline(always)]
11536 fn inline_size(_context: fidl::encoding::Context) -> usize {
11537 4
11538 }
11539 }
11540
11541 unsafe impl
11542 fidl::encoding::Encode<
11543 EnergyInfoResourceGetResponse,
11544 fidl::encoding::DefaultFuchsiaResourceDialect,
11545 > for &mut EnergyInfoResourceGetResponse
11546 {
11547 #[inline]
11548 unsafe fn encode(
11549 self,
11550 encoder: &mut fidl::encoding::Encoder<
11551 '_,
11552 fidl::encoding::DefaultFuchsiaResourceDialect,
11553 >,
11554 offset: usize,
11555 _depth: fidl::encoding::Depth,
11556 ) -> fidl::Result<()> {
11557 encoder.debug_check_bounds::<EnergyInfoResourceGetResponse>(offset);
11558 fidl::encoding::Encode::<
11560 EnergyInfoResourceGetResponse,
11561 fidl::encoding::DefaultFuchsiaResourceDialect,
11562 >::encode(
11563 (<fidl::encoding::HandleType<
11564 fidl::Resource,
11565 { fidl::ObjectType::RESOURCE.into_raw() },
11566 2147483648,
11567 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11568 &mut self.resource
11569 ),),
11570 encoder,
11571 offset,
11572 _depth,
11573 )
11574 }
11575 }
11576 unsafe impl<
11577 T0: fidl::encoding::Encode<
11578 fidl::encoding::HandleType<
11579 fidl::Resource,
11580 { fidl::ObjectType::RESOURCE.into_raw() },
11581 2147483648,
11582 >,
11583 fidl::encoding::DefaultFuchsiaResourceDialect,
11584 >,
11585 >
11586 fidl::encoding::Encode<
11587 EnergyInfoResourceGetResponse,
11588 fidl::encoding::DefaultFuchsiaResourceDialect,
11589 > for (T0,)
11590 {
11591 #[inline]
11592 unsafe fn encode(
11593 self,
11594 encoder: &mut fidl::encoding::Encoder<
11595 '_,
11596 fidl::encoding::DefaultFuchsiaResourceDialect,
11597 >,
11598 offset: usize,
11599 depth: fidl::encoding::Depth,
11600 ) -> fidl::Result<()> {
11601 encoder.debug_check_bounds::<EnergyInfoResourceGetResponse>(offset);
11602 self.0.encode(encoder, offset + 0, depth)?;
11606 Ok(())
11607 }
11608 }
11609
11610 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11611 for EnergyInfoResourceGetResponse
11612 {
11613 #[inline(always)]
11614 fn new_empty() -> Self {
11615 Self {
11616 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11617 }
11618 }
11619
11620 #[inline]
11621 unsafe fn decode(
11622 &mut self,
11623 decoder: &mut fidl::encoding::Decoder<
11624 '_,
11625 fidl::encoding::DefaultFuchsiaResourceDialect,
11626 >,
11627 offset: usize,
11628 _depth: fidl::encoding::Depth,
11629 ) -> fidl::Result<()> {
11630 decoder.debug_check_bounds::<Self>(offset);
11631 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
11633 Ok(())
11634 }
11635 }
11636
11637 impl fidl::encoding::ResourceTypeMarker for HypervisorResourceGetResponse {
11638 type Borrowed<'a> = &'a mut Self;
11639 fn take_or_borrow<'a>(
11640 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11641 ) -> Self::Borrowed<'a> {
11642 value
11643 }
11644 }
11645
11646 unsafe impl fidl::encoding::TypeMarker for HypervisorResourceGetResponse {
11647 type Owned = Self;
11648
11649 #[inline(always)]
11650 fn inline_align(_context: fidl::encoding::Context) -> usize {
11651 4
11652 }
11653
11654 #[inline(always)]
11655 fn inline_size(_context: fidl::encoding::Context) -> usize {
11656 4
11657 }
11658 }
11659
11660 unsafe impl
11661 fidl::encoding::Encode<
11662 HypervisorResourceGetResponse,
11663 fidl::encoding::DefaultFuchsiaResourceDialect,
11664 > for &mut HypervisorResourceGetResponse
11665 {
11666 #[inline]
11667 unsafe fn encode(
11668 self,
11669 encoder: &mut fidl::encoding::Encoder<
11670 '_,
11671 fidl::encoding::DefaultFuchsiaResourceDialect,
11672 >,
11673 offset: usize,
11674 _depth: fidl::encoding::Depth,
11675 ) -> fidl::Result<()> {
11676 encoder.debug_check_bounds::<HypervisorResourceGetResponse>(offset);
11677 fidl::encoding::Encode::<
11679 HypervisorResourceGetResponse,
11680 fidl::encoding::DefaultFuchsiaResourceDialect,
11681 >::encode(
11682 (<fidl::encoding::HandleType<
11683 fidl::Resource,
11684 { fidl::ObjectType::RESOURCE.into_raw() },
11685 2147483648,
11686 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11687 &mut self.resource
11688 ),),
11689 encoder,
11690 offset,
11691 _depth,
11692 )
11693 }
11694 }
11695 unsafe impl<
11696 T0: fidl::encoding::Encode<
11697 fidl::encoding::HandleType<
11698 fidl::Resource,
11699 { fidl::ObjectType::RESOURCE.into_raw() },
11700 2147483648,
11701 >,
11702 fidl::encoding::DefaultFuchsiaResourceDialect,
11703 >,
11704 >
11705 fidl::encoding::Encode<
11706 HypervisorResourceGetResponse,
11707 fidl::encoding::DefaultFuchsiaResourceDialect,
11708 > for (T0,)
11709 {
11710 #[inline]
11711 unsafe fn encode(
11712 self,
11713 encoder: &mut fidl::encoding::Encoder<
11714 '_,
11715 fidl::encoding::DefaultFuchsiaResourceDialect,
11716 >,
11717 offset: usize,
11718 depth: fidl::encoding::Depth,
11719 ) -> fidl::Result<()> {
11720 encoder.debug_check_bounds::<HypervisorResourceGetResponse>(offset);
11721 self.0.encode(encoder, offset + 0, depth)?;
11725 Ok(())
11726 }
11727 }
11728
11729 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11730 for HypervisorResourceGetResponse
11731 {
11732 #[inline(always)]
11733 fn new_empty() -> Self {
11734 Self {
11735 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11736 }
11737 }
11738
11739 #[inline]
11740 unsafe fn decode(
11741 &mut self,
11742 decoder: &mut fidl::encoding::Decoder<
11743 '_,
11744 fidl::encoding::DefaultFuchsiaResourceDialect,
11745 >,
11746 offset: usize,
11747 _depth: fidl::encoding::Depth,
11748 ) -> fidl::Result<()> {
11749 decoder.debug_check_bounds::<Self>(offset);
11750 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
11752 Ok(())
11753 }
11754 }
11755
11756 impl fidl::encoding::ResourceTypeMarker for InfoResourceGetResponse {
11757 type Borrowed<'a> = &'a mut Self;
11758 fn take_or_borrow<'a>(
11759 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11760 ) -> Self::Borrowed<'a> {
11761 value
11762 }
11763 }
11764
11765 unsafe impl fidl::encoding::TypeMarker for InfoResourceGetResponse {
11766 type Owned = Self;
11767
11768 #[inline(always)]
11769 fn inline_align(_context: fidl::encoding::Context) -> usize {
11770 4
11771 }
11772
11773 #[inline(always)]
11774 fn inline_size(_context: fidl::encoding::Context) -> usize {
11775 4
11776 }
11777 }
11778
11779 unsafe impl
11780 fidl::encoding::Encode<
11781 InfoResourceGetResponse,
11782 fidl::encoding::DefaultFuchsiaResourceDialect,
11783 > for &mut InfoResourceGetResponse
11784 {
11785 #[inline]
11786 unsafe fn encode(
11787 self,
11788 encoder: &mut fidl::encoding::Encoder<
11789 '_,
11790 fidl::encoding::DefaultFuchsiaResourceDialect,
11791 >,
11792 offset: usize,
11793 _depth: fidl::encoding::Depth,
11794 ) -> fidl::Result<()> {
11795 encoder.debug_check_bounds::<InfoResourceGetResponse>(offset);
11796 fidl::encoding::Encode::<
11798 InfoResourceGetResponse,
11799 fidl::encoding::DefaultFuchsiaResourceDialect,
11800 >::encode(
11801 (<fidl::encoding::HandleType<
11802 fidl::Resource,
11803 { fidl::ObjectType::RESOURCE.into_raw() },
11804 2147483648,
11805 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11806 &mut self.resource
11807 ),),
11808 encoder,
11809 offset,
11810 _depth,
11811 )
11812 }
11813 }
11814 unsafe impl<
11815 T0: fidl::encoding::Encode<
11816 fidl::encoding::HandleType<
11817 fidl::Resource,
11818 { fidl::ObjectType::RESOURCE.into_raw() },
11819 2147483648,
11820 >,
11821 fidl::encoding::DefaultFuchsiaResourceDialect,
11822 >,
11823 >
11824 fidl::encoding::Encode<
11825 InfoResourceGetResponse,
11826 fidl::encoding::DefaultFuchsiaResourceDialect,
11827 > for (T0,)
11828 {
11829 #[inline]
11830 unsafe fn encode(
11831 self,
11832 encoder: &mut fidl::encoding::Encoder<
11833 '_,
11834 fidl::encoding::DefaultFuchsiaResourceDialect,
11835 >,
11836 offset: usize,
11837 depth: fidl::encoding::Depth,
11838 ) -> fidl::Result<()> {
11839 encoder.debug_check_bounds::<InfoResourceGetResponse>(offset);
11840 self.0.encode(encoder, offset + 0, depth)?;
11844 Ok(())
11845 }
11846 }
11847
11848 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11849 for InfoResourceGetResponse
11850 {
11851 #[inline(always)]
11852 fn new_empty() -> Self {
11853 Self {
11854 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11855 }
11856 }
11857
11858 #[inline]
11859 unsafe fn decode(
11860 &mut self,
11861 decoder: &mut fidl::encoding::Decoder<
11862 '_,
11863 fidl::encoding::DefaultFuchsiaResourceDialect,
11864 >,
11865 offset: usize,
11866 _depth: fidl::encoding::Depth,
11867 ) -> fidl::Result<()> {
11868 decoder.debug_check_bounds::<Self>(offset);
11869 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
11871 Ok(())
11872 }
11873 }
11874
11875 impl fidl::encoding::ResourceTypeMarker for IommuResourceGetResponse {
11876 type Borrowed<'a> = &'a mut Self;
11877 fn take_or_borrow<'a>(
11878 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11879 ) -> Self::Borrowed<'a> {
11880 value
11881 }
11882 }
11883
11884 unsafe impl fidl::encoding::TypeMarker for IommuResourceGetResponse {
11885 type Owned = Self;
11886
11887 #[inline(always)]
11888 fn inline_align(_context: fidl::encoding::Context) -> usize {
11889 4
11890 }
11891
11892 #[inline(always)]
11893 fn inline_size(_context: fidl::encoding::Context) -> usize {
11894 4
11895 }
11896 }
11897
11898 unsafe impl
11899 fidl::encoding::Encode<
11900 IommuResourceGetResponse,
11901 fidl::encoding::DefaultFuchsiaResourceDialect,
11902 > for &mut IommuResourceGetResponse
11903 {
11904 #[inline]
11905 unsafe fn encode(
11906 self,
11907 encoder: &mut fidl::encoding::Encoder<
11908 '_,
11909 fidl::encoding::DefaultFuchsiaResourceDialect,
11910 >,
11911 offset: usize,
11912 _depth: fidl::encoding::Depth,
11913 ) -> fidl::Result<()> {
11914 encoder.debug_check_bounds::<IommuResourceGetResponse>(offset);
11915 fidl::encoding::Encode::<
11917 IommuResourceGetResponse,
11918 fidl::encoding::DefaultFuchsiaResourceDialect,
11919 >::encode(
11920 (<fidl::encoding::HandleType<
11921 fidl::Resource,
11922 { fidl::ObjectType::RESOURCE.into_raw() },
11923 2147483648,
11924 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11925 &mut self.resource
11926 ),),
11927 encoder,
11928 offset,
11929 _depth,
11930 )
11931 }
11932 }
11933 unsafe impl<
11934 T0: fidl::encoding::Encode<
11935 fidl::encoding::HandleType<
11936 fidl::Resource,
11937 { fidl::ObjectType::RESOURCE.into_raw() },
11938 2147483648,
11939 >,
11940 fidl::encoding::DefaultFuchsiaResourceDialect,
11941 >,
11942 >
11943 fidl::encoding::Encode<
11944 IommuResourceGetResponse,
11945 fidl::encoding::DefaultFuchsiaResourceDialect,
11946 > for (T0,)
11947 {
11948 #[inline]
11949 unsafe fn encode(
11950 self,
11951 encoder: &mut fidl::encoding::Encoder<
11952 '_,
11953 fidl::encoding::DefaultFuchsiaResourceDialect,
11954 >,
11955 offset: usize,
11956 depth: fidl::encoding::Depth,
11957 ) -> fidl::Result<()> {
11958 encoder.debug_check_bounds::<IommuResourceGetResponse>(offset);
11959 self.0.encode(encoder, offset + 0, depth)?;
11963 Ok(())
11964 }
11965 }
11966
11967 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11968 for IommuResourceGetResponse
11969 {
11970 #[inline(always)]
11971 fn new_empty() -> Self {
11972 Self {
11973 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11974 }
11975 }
11976
11977 #[inline]
11978 unsafe fn decode(
11979 &mut self,
11980 decoder: &mut fidl::encoding::Decoder<
11981 '_,
11982 fidl::encoding::DefaultFuchsiaResourceDialect,
11983 >,
11984 offset: usize,
11985 _depth: fidl::encoding::Depth,
11986 ) -> fidl::Result<()> {
11987 decoder.debug_check_bounds::<Self>(offset);
11988 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
11990 Ok(())
11991 }
11992 }
11993
11994 impl fidl::encoding::ResourceTypeMarker for IoportResourceGetResponse {
11995 type Borrowed<'a> = &'a mut Self;
11996 fn take_or_borrow<'a>(
11997 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11998 ) -> Self::Borrowed<'a> {
11999 value
12000 }
12001 }
12002
12003 unsafe impl fidl::encoding::TypeMarker for IoportResourceGetResponse {
12004 type Owned = Self;
12005
12006 #[inline(always)]
12007 fn inline_align(_context: fidl::encoding::Context) -> usize {
12008 4
12009 }
12010
12011 #[inline(always)]
12012 fn inline_size(_context: fidl::encoding::Context) -> usize {
12013 4
12014 }
12015 }
12016
12017 unsafe impl
12018 fidl::encoding::Encode<
12019 IoportResourceGetResponse,
12020 fidl::encoding::DefaultFuchsiaResourceDialect,
12021 > for &mut IoportResourceGetResponse
12022 {
12023 #[inline]
12024 unsafe fn encode(
12025 self,
12026 encoder: &mut fidl::encoding::Encoder<
12027 '_,
12028 fidl::encoding::DefaultFuchsiaResourceDialect,
12029 >,
12030 offset: usize,
12031 _depth: fidl::encoding::Depth,
12032 ) -> fidl::Result<()> {
12033 encoder.debug_check_bounds::<IoportResourceGetResponse>(offset);
12034 fidl::encoding::Encode::<
12036 IoportResourceGetResponse,
12037 fidl::encoding::DefaultFuchsiaResourceDialect,
12038 >::encode(
12039 (<fidl::encoding::HandleType<
12040 fidl::Resource,
12041 { fidl::ObjectType::RESOURCE.into_raw() },
12042 2147483648,
12043 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12044 &mut self.resource
12045 ),),
12046 encoder,
12047 offset,
12048 _depth,
12049 )
12050 }
12051 }
12052 unsafe impl<
12053 T0: fidl::encoding::Encode<
12054 fidl::encoding::HandleType<
12055 fidl::Resource,
12056 { fidl::ObjectType::RESOURCE.into_raw() },
12057 2147483648,
12058 >,
12059 fidl::encoding::DefaultFuchsiaResourceDialect,
12060 >,
12061 >
12062 fidl::encoding::Encode<
12063 IoportResourceGetResponse,
12064 fidl::encoding::DefaultFuchsiaResourceDialect,
12065 > for (T0,)
12066 {
12067 #[inline]
12068 unsafe fn encode(
12069 self,
12070 encoder: &mut fidl::encoding::Encoder<
12071 '_,
12072 fidl::encoding::DefaultFuchsiaResourceDialect,
12073 >,
12074 offset: usize,
12075 depth: fidl::encoding::Depth,
12076 ) -> fidl::Result<()> {
12077 encoder.debug_check_bounds::<IoportResourceGetResponse>(offset);
12078 self.0.encode(encoder, offset + 0, depth)?;
12082 Ok(())
12083 }
12084 }
12085
12086 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12087 for IoportResourceGetResponse
12088 {
12089 #[inline(always)]
12090 fn new_empty() -> Self {
12091 Self {
12092 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12093 }
12094 }
12095
12096 #[inline]
12097 unsafe fn decode(
12098 &mut self,
12099 decoder: &mut fidl::encoding::Decoder<
12100 '_,
12101 fidl::encoding::DefaultFuchsiaResourceDialect,
12102 >,
12103 offset: usize,
12104 _depth: fidl::encoding::Depth,
12105 ) -> fidl::Result<()> {
12106 decoder.debug_check_bounds::<Self>(offset);
12107 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
12109 Ok(())
12110 }
12111 }
12112
12113 impl fidl::encoding::ResourceTypeMarker for IrqResourceGetResponse {
12114 type Borrowed<'a> = &'a mut Self;
12115 fn take_or_borrow<'a>(
12116 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12117 ) -> Self::Borrowed<'a> {
12118 value
12119 }
12120 }
12121
12122 unsafe impl fidl::encoding::TypeMarker for IrqResourceGetResponse {
12123 type Owned = Self;
12124
12125 #[inline(always)]
12126 fn inline_align(_context: fidl::encoding::Context) -> usize {
12127 4
12128 }
12129
12130 #[inline(always)]
12131 fn inline_size(_context: fidl::encoding::Context) -> usize {
12132 4
12133 }
12134 }
12135
12136 unsafe impl
12137 fidl::encoding::Encode<
12138 IrqResourceGetResponse,
12139 fidl::encoding::DefaultFuchsiaResourceDialect,
12140 > for &mut IrqResourceGetResponse
12141 {
12142 #[inline]
12143 unsafe fn encode(
12144 self,
12145 encoder: &mut fidl::encoding::Encoder<
12146 '_,
12147 fidl::encoding::DefaultFuchsiaResourceDialect,
12148 >,
12149 offset: usize,
12150 _depth: fidl::encoding::Depth,
12151 ) -> fidl::Result<()> {
12152 encoder.debug_check_bounds::<IrqResourceGetResponse>(offset);
12153 fidl::encoding::Encode::<
12155 IrqResourceGetResponse,
12156 fidl::encoding::DefaultFuchsiaResourceDialect,
12157 >::encode(
12158 (<fidl::encoding::HandleType<
12159 fidl::Resource,
12160 { fidl::ObjectType::RESOURCE.into_raw() },
12161 2147483648,
12162 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12163 &mut self.resource
12164 ),),
12165 encoder,
12166 offset,
12167 _depth,
12168 )
12169 }
12170 }
12171 unsafe impl<
12172 T0: fidl::encoding::Encode<
12173 fidl::encoding::HandleType<
12174 fidl::Resource,
12175 { fidl::ObjectType::RESOURCE.into_raw() },
12176 2147483648,
12177 >,
12178 fidl::encoding::DefaultFuchsiaResourceDialect,
12179 >,
12180 >
12181 fidl::encoding::Encode<
12182 IrqResourceGetResponse,
12183 fidl::encoding::DefaultFuchsiaResourceDialect,
12184 > for (T0,)
12185 {
12186 #[inline]
12187 unsafe fn encode(
12188 self,
12189 encoder: &mut fidl::encoding::Encoder<
12190 '_,
12191 fidl::encoding::DefaultFuchsiaResourceDialect,
12192 >,
12193 offset: usize,
12194 depth: fidl::encoding::Depth,
12195 ) -> fidl::Result<()> {
12196 encoder.debug_check_bounds::<IrqResourceGetResponse>(offset);
12197 self.0.encode(encoder, offset + 0, depth)?;
12201 Ok(())
12202 }
12203 }
12204
12205 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12206 for IrqResourceGetResponse
12207 {
12208 #[inline(always)]
12209 fn new_empty() -> Self {
12210 Self {
12211 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12212 }
12213 }
12214
12215 #[inline]
12216 unsafe fn decode(
12217 &mut self,
12218 decoder: &mut fidl::encoding::Decoder<
12219 '_,
12220 fidl::encoding::DefaultFuchsiaResourceDialect,
12221 >,
12222 offset: usize,
12223 _depth: fidl::encoding::Depth,
12224 ) -> fidl::Result<()> {
12225 decoder.debug_check_bounds::<Self>(offset);
12226 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
12228 Ok(())
12229 }
12230 }
12231
12232 impl fidl::encoding::ResourceTypeMarker for MexecResourceGetResponse {
12233 type Borrowed<'a> = &'a mut Self;
12234 fn take_or_borrow<'a>(
12235 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12236 ) -> Self::Borrowed<'a> {
12237 value
12238 }
12239 }
12240
12241 unsafe impl fidl::encoding::TypeMarker for MexecResourceGetResponse {
12242 type Owned = Self;
12243
12244 #[inline(always)]
12245 fn inline_align(_context: fidl::encoding::Context) -> usize {
12246 4
12247 }
12248
12249 #[inline(always)]
12250 fn inline_size(_context: fidl::encoding::Context) -> usize {
12251 4
12252 }
12253 }
12254
12255 unsafe impl
12256 fidl::encoding::Encode<
12257 MexecResourceGetResponse,
12258 fidl::encoding::DefaultFuchsiaResourceDialect,
12259 > for &mut MexecResourceGetResponse
12260 {
12261 #[inline]
12262 unsafe fn encode(
12263 self,
12264 encoder: &mut fidl::encoding::Encoder<
12265 '_,
12266 fidl::encoding::DefaultFuchsiaResourceDialect,
12267 >,
12268 offset: usize,
12269 _depth: fidl::encoding::Depth,
12270 ) -> fidl::Result<()> {
12271 encoder.debug_check_bounds::<MexecResourceGetResponse>(offset);
12272 fidl::encoding::Encode::<
12274 MexecResourceGetResponse,
12275 fidl::encoding::DefaultFuchsiaResourceDialect,
12276 >::encode(
12277 (<fidl::encoding::HandleType<
12278 fidl::Resource,
12279 { fidl::ObjectType::RESOURCE.into_raw() },
12280 2147483648,
12281 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12282 &mut self.resource
12283 ),),
12284 encoder,
12285 offset,
12286 _depth,
12287 )
12288 }
12289 }
12290 unsafe impl<
12291 T0: fidl::encoding::Encode<
12292 fidl::encoding::HandleType<
12293 fidl::Resource,
12294 { fidl::ObjectType::RESOURCE.into_raw() },
12295 2147483648,
12296 >,
12297 fidl::encoding::DefaultFuchsiaResourceDialect,
12298 >,
12299 >
12300 fidl::encoding::Encode<
12301 MexecResourceGetResponse,
12302 fidl::encoding::DefaultFuchsiaResourceDialect,
12303 > for (T0,)
12304 {
12305 #[inline]
12306 unsafe fn encode(
12307 self,
12308 encoder: &mut fidl::encoding::Encoder<
12309 '_,
12310 fidl::encoding::DefaultFuchsiaResourceDialect,
12311 >,
12312 offset: usize,
12313 depth: fidl::encoding::Depth,
12314 ) -> fidl::Result<()> {
12315 encoder.debug_check_bounds::<MexecResourceGetResponse>(offset);
12316 self.0.encode(encoder, offset + 0, depth)?;
12320 Ok(())
12321 }
12322 }
12323
12324 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12325 for MexecResourceGetResponse
12326 {
12327 #[inline(always)]
12328 fn new_empty() -> Self {
12329 Self {
12330 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12331 }
12332 }
12333
12334 #[inline]
12335 unsafe fn decode(
12336 &mut self,
12337 decoder: &mut fidl::encoding::Decoder<
12338 '_,
12339 fidl::encoding::DefaultFuchsiaResourceDialect,
12340 >,
12341 offset: usize,
12342 _depth: fidl::encoding::Depth,
12343 ) -> fidl::Result<()> {
12344 decoder.debug_check_bounds::<Self>(offset);
12345 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
12347 Ok(())
12348 }
12349 }
12350
12351 impl fidl::encoding::ResourceTypeMarker for MmioResourceGetResponse {
12352 type Borrowed<'a> = &'a mut Self;
12353 fn take_or_borrow<'a>(
12354 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12355 ) -> Self::Borrowed<'a> {
12356 value
12357 }
12358 }
12359
12360 unsafe impl fidl::encoding::TypeMarker for MmioResourceGetResponse {
12361 type Owned = Self;
12362
12363 #[inline(always)]
12364 fn inline_align(_context: fidl::encoding::Context) -> usize {
12365 4
12366 }
12367
12368 #[inline(always)]
12369 fn inline_size(_context: fidl::encoding::Context) -> usize {
12370 4
12371 }
12372 }
12373
12374 unsafe impl
12375 fidl::encoding::Encode<
12376 MmioResourceGetResponse,
12377 fidl::encoding::DefaultFuchsiaResourceDialect,
12378 > for &mut MmioResourceGetResponse
12379 {
12380 #[inline]
12381 unsafe fn encode(
12382 self,
12383 encoder: &mut fidl::encoding::Encoder<
12384 '_,
12385 fidl::encoding::DefaultFuchsiaResourceDialect,
12386 >,
12387 offset: usize,
12388 _depth: fidl::encoding::Depth,
12389 ) -> fidl::Result<()> {
12390 encoder.debug_check_bounds::<MmioResourceGetResponse>(offset);
12391 fidl::encoding::Encode::<
12393 MmioResourceGetResponse,
12394 fidl::encoding::DefaultFuchsiaResourceDialect,
12395 >::encode(
12396 (<fidl::encoding::HandleType<
12397 fidl::Resource,
12398 { fidl::ObjectType::RESOURCE.into_raw() },
12399 2147483648,
12400 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12401 &mut self.resource
12402 ),),
12403 encoder,
12404 offset,
12405 _depth,
12406 )
12407 }
12408 }
12409 unsafe impl<
12410 T0: fidl::encoding::Encode<
12411 fidl::encoding::HandleType<
12412 fidl::Resource,
12413 { fidl::ObjectType::RESOURCE.into_raw() },
12414 2147483648,
12415 >,
12416 fidl::encoding::DefaultFuchsiaResourceDialect,
12417 >,
12418 >
12419 fidl::encoding::Encode<
12420 MmioResourceGetResponse,
12421 fidl::encoding::DefaultFuchsiaResourceDialect,
12422 > for (T0,)
12423 {
12424 #[inline]
12425 unsafe fn encode(
12426 self,
12427 encoder: &mut fidl::encoding::Encoder<
12428 '_,
12429 fidl::encoding::DefaultFuchsiaResourceDialect,
12430 >,
12431 offset: usize,
12432 depth: fidl::encoding::Depth,
12433 ) -> fidl::Result<()> {
12434 encoder.debug_check_bounds::<MmioResourceGetResponse>(offset);
12435 self.0.encode(encoder, offset + 0, depth)?;
12439 Ok(())
12440 }
12441 }
12442
12443 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12444 for MmioResourceGetResponse
12445 {
12446 #[inline(always)]
12447 fn new_empty() -> Self {
12448 Self {
12449 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12450 }
12451 }
12452
12453 #[inline]
12454 unsafe fn decode(
12455 &mut self,
12456 decoder: &mut fidl::encoding::Decoder<
12457 '_,
12458 fidl::encoding::DefaultFuchsiaResourceDialect,
12459 >,
12460 offset: usize,
12461 _depth: fidl::encoding::Depth,
12462 ) -> fidl::Result<()> {
12463 decoder.debug_check_bounds::<Self>(offset);
12464 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
12466 Ok(())
12467 }
12468 }
12469
12470 impl fidl::encoding::ResourceTypeMarker for MsiResourceGetResponse {
12471 type Borrowed<'a> = &'a mut Self;
12472 fn take_or_borrow<'a>(
12473 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12474 ) -> Self::Borrowed<'a> {
12475 value
12476 }
12477 }
12478
12479 unsafe impl fidl::encoding::TypeMarker for MsiResourceGetResponse {
12480 type Owned = Self;
12481
12482 #[inline(always)]
12483 fn inline_align(_context: fidl::encoding::Context) -> usize {
12484 4
12485 }
12486
12487 #[inline(always)]
12488 fn inline_size(_context: fidl::encoding::Context) -> usize {
12489 4
12490 }
12491 }
12492
12493 unsafe impl
12494 fidl::encoding::Encode<
12495 MsiResourceGetResponse,
12496 fidl::encoding::DefaultFuchsiaResourceDialect,
12497 > for &mut MsiResourceGetResponse
12498 {
12499 #[inline]
12500 unsafe fn encode(
12501 self,
12502 encoder: &mut fidl::encoding::Encoder<
12503 '_,
12504 fidl::encoding::DefaultFuchsiaResourceDialect,
12505 >,
12506 offset: usize,
12507 _depth: fidl::encoding::Depth,
12508 ) -> fidl::Result<()> {
12509 encoder.debug_check_bounds::<MsiResourceGetResponse>(offset);
12510 fidl::encoding::Encode::<
12512 MsiResourceGetResponse,
12513 fidl::encoding::DefaultFuchsiaResourceDialect,
12514 >::encode(
12515 (<fidl::encoding::HandleType<
12516 fidl::Resource,
12517 { fidl::ObjectType::RESOURCE.into_raw() },
12518 2147483648,
12519 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12520 &mut self.resource
12521 ),),
12522 encoder,
12523 offset,
12524 _depth,
12525 )
12526 }
12527 }
12528 unsafe impl<
12529 T0: fidl::encoding::Encode<
12530 fidl::encoding::HandleType<
12531 fidl::Resource,
12532 { fidl::ObjectType::RESOURCE.into_raw() },
12533 2147483648,
12534 >,
12535 fidl::encoding::DefaultFuchsiaResourceDialect,
12536 >,
12537 >
12538 fidl::encoding::Encode<
12539 MsiResourceGetResponse,
12540 fidl::encoding::DefaultFuchsiaResourceDialect,
12541 > for (T0,)
12542 {
12543 #[inline]
12544 unsafe fn encode(
12545 self,
12546 encoder: &mut fidl::encoding::Encoder<
12547 '_,
12548 fidl::encoding::DefaultFuchsiaResourceDialect,
12549 >,
12550 offset: usize,
12551 depth: fidl::encoding::Depth,
12552 ) -> fidl::Result<()> {
12553 encoder.debug_check_bounds::<MsiResourceGetResponse>(offset);
12554 self.0.encode(encoder, offset + 0, depth)?;
12558 Ok(())
12559 }
12560 }
12561
12562 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12563 for MsiResourceGetResponse
12564 {
12565 #[inline(always)]
12566 fn new_empty() -> Self {
12567 Self {
12568 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12569 }
12570 }
12571
12572 #[inline]
12573 unsafe fn decode(
12574 &mut self,
12575 decoder: &mut fidl::encoding::Decoder<
12576 '_,
12577 fidl::encoding::DefaultFuchsiaResourceDialect,
12578 >,
12579 offset: usize,
12580 _depth: fidl::encoding::Depth,
12581 ) -> fidl::Result<()> {
12582 decoder.debug_check_bounds::<Self>(offset);
12583 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
12585 Ok(())
12586 }
12587 }
12588
12589 impl fidl::encoding::ResourceTypeMarker for PowerResourceGetResponse {
12590 type Borrowed<'a> = &'a mut Self;
12591 fn take_or_borrow<'a>(
12592 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12593 ) -> Self::Borrowed<'a> {
12594 value
12595 }
12596 }
12597
12598 unsafe impl fidl::encoding::TypeMarker for PowerResourceGetResponse {
12599 type Owned = Self;
12600
12601 #[inline(always)]
12602 fn inline_align(_context: fidl::encoding::Context) -> usize {
12603 4
12604 }
12605
12606 #[inline(always)]
12607 fn inline_size(_context: fidl::encoding::Context) -> usize {
12608 4
12609 }
12610 }
12611
12612 unsafe impl
12613 fidl::encoding::Encode<
12614 PowerResourceGetResponse,
12615 fidl::encoding::DefaultFuchsiaResourceDialect,
12616 > for &mut PowerResourceGetResponse
12617 {
12618 #[inline]
12619 unsafe fn encode(
12620 self,
12621 encoder: &mut fidl::encoding::Encoder<
12622 '_,
12623 fidl::encoding::DefaultFuchsiaResourceDialect,
12624 >,
12625 offset: usize,
12626 _depth: fidl::encoding::Depth,
12627 ) -> fidl::Result<()> {
12628 encoder.debug_check_bounds::<PowerResourceGetResponse>(offset);
12629 fidl::encoding::Encode::<
12631 PowerResourceGetResponse,
12632 fidl::encoding::DefaultFuchsiaResourceDialect,
12633 >::encode(
12634 (<fidl::encoding::HandleType<
12635 fidl::Resource,
12636 { fidl::ObjectType::RESOURCE.into_raw() },
12637 2147483648,
12638 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12639 &mut self.resource
12640 ),),
12641 encoder,
12642 offset,
12643 _depth,
12644 )
12645 }
12646 }
12647 unsafe impl<
12648 T0: fidl::encoding::Encode<
12649 fidl::encoding::HandleType<
12650 fidl::Resource,
12651 { fidl::ObjectType::RESOURCE.into_raw() },
12652 2147483648,
12653 >,
12654 fidl::encoding::DefaultFuchsiaResourceDialect,
12655 >,
12656 >
12657 fidl::encoding::Encode<
12658 PowerResourceGetResponse,
12659 fidl::encoding::DefaultFuchsiaResourceDialect,
12660 > for (T0,)
12661 {
12662 #[inline]
12663 unsafe fn encode(
12664 self,
12665 encoder: &mut fidl::encoding::Encoder<
12666 '_,
12667 fidl::encoding::DefaultFuchsiaResourceDialect,
12668 >,
12669 offset: usize,
12670 depth: fidl::encoding::Depth,
12671 ) -> fidl::Result<()> {
12672 encoder.debug_check_bounds::<PowerResourceGetResponse>(offset);
12673 self.0.encode(encoder, offset + 0, depth)?;
12677 Ok(())
12678 }
12679 }
12680
12681 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12682 for PowerResourceGetResponse
12683 {
12684 #[inline(always)]
12685 fn new_empty() -> Self {
12686 Self {
12687 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12688 }
12689 }
12690
12691 #[inline]
12692 unsafe fn decode(
12693 &mut self,
12694 decoder: &mut fidl::encoding::Decoder<
12695 '_,
12696 fidl::encoding::DefaultFuchsiaResourceDialect,
12697 >,
12698 offset: usize,
12699 _depth: fidl::encoding::Depth,
12700 ) -> fidl::Result<()> {
12701 decoder.debug_check_bounds::<Self>(offset);
12702 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
12704 Ok(())
12705 }
12706 }
12707
12708 impl fidl::encoding::ResourceTypeMarker for ProfileResourceGetResponse {
12709 type Borrowed<'a> = &'a mut Self;
12710 fn take_or_borrow<'a>(
12711 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12712 ) -> Self::Borrowed<'a> {
12713 value
12714 }
12715 }
12716
12717 unsafe impl fidl::encoding::TypeMarker for ProfileResourceGetResponse {
12718 type Owned = Self;
12719
12720 #[inline(always)]
12721 fn inline_align(_context: fidl::encoding::Context) -> usize {
12722 4
12723 }
12724
12725 #[inline(always)]
12726 fn inline_size(_context: fidl::encoding::Context) -> usize {
12727 4
12728 }
12729 }
12730
12731 unsafe impl
12732 fidl::encoding::Encode<
12733 ProfileResourceGetResponse,
12734 fidl::encoding::DefaultFuchsiaResourceDialect,
12735 > for &mut ProfileResourceGetResponse
12736 {
12737 #[inline]
12738 unsafe fn encode(
12739 self,
12740 encoder: &mut fidl::encoding::Encoder<
12741 '_,
12742 fidl::encoding::DefaultFuchsiaResourceDialect,
12743 >,
12744 offset: usize,
12745 _depth: fidl::encoding::Depth,
12746 ) -> fidl::Result<()> {
12747 encoder.debug_check_bounds::<ProfileResourceGetResponse>(offset);
12748 fidl::encoding::Encode::<
12750 ProfileResourceGetResponse,
12751 fidl::encoding::DefaultFuchsiaResourceDialect,
12752 >::encode(
12753 (<fidl::encoding::HandleType<
12754 fidl::Resource,
12755 { fidl::ObjectType::RESOURCE.into_raw() },
12756 2147483648,
12757 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12758 &mut self.resource
12759 ),),
12760 encoder,
12761 offset,
12762 _depth,
12763 )
12764 }
12765 }
12766 unsafe impl<
12767 T0: fidl::encoding::Encode<
12768 fidl::encoding::HandleType<
12769 fidl::Resource,
12770 { fidl::ObjectType::RESOURCE.into_raw() },
12771 2147483648,
12772 >,
12773 fidl::encoding::DefaultFuchsiaResourceDialect,
12774 >,
12775 >
12776 fidl::encoding::Encode<
12777 ProfileResourceGetResponse,
12778 fidl::encoding::DefaultFuchsiaResourceDialect,
12779 > for (T0,)
12780 {
12781 #[inline]
12782 unsafe fn encode(
12783 self,
12784 encoder: &mut fidl::encoding::Encoder<
12785 '_,
12786 fidl::encoding::DefaultFuchsiaResourceDialect,
12787 >,
12788 offset: usize,
12789 depth: fidl::encoding::Depth,
12790 ) -> fidl::Result<()> {
12791 encoder.debug_check_bounds::<ProfileResourceGetResponse>(offset);
12792 self.0.encode(encoder, offset + 0, depth)?;
12796 Ok(())
12797 }
12798 }
12799
12800 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12801 for ProfileResourceGetResponse
12802 {
12803 #[inline(always)]
12804 fn new_empty() -> Self {
12805 Self {
12806 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12807 }
12808 }
12809
12810 #[inline]
12811 unsafe fn decode(
12812 &mut self,
12813 decoder: &mut fidl::encoding::Decoder<
12814 '_,
12815 fidl::encoding::DefaultFuchsiaResourceDialect,
12816 >,
12817 offset: usize,
12818 _depth: fidl::encoding::Depth,
12819 ) -> fidl::Result<()> {
12820 decoder.debug_check_bounds::<Self>(offset);
12821 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
12823 Ok(())
12824 }
12825 }
12826
12827 impl fidl::encoding::ResourceTypeMarker for RootJobGetResponse {
12828 type Borrowed<'a> = &'a mut Self;
12829 fn take_or_borrow<'a>(
12830 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12831 ) -> Self::Borrowed<'a> {
12832 value
12833 }
12834 }
12835
12836 unsafe impl fidl::encoding::TypeMarker for RootJobGetResponse {
12837 type Owned = Self;
12838
12839 #[inline(always)]
12840 fn inline_align(_context: fidl::encoding::Context) -> usize {
12841 4
12842 }
12843
12844 #[inline(always)]
12845 fn inline_size(_context: fidl::encoding::Context) -> usize {
12846 4
12847 }
12848 }
12849
12850 unsafe impl
12851 fidl::encoding::Encode<RootJobGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
12852 for &mut RootJobGetResponse
12853 {
12854 #[inline]
12855 unsafe fn encode(
12856 self,
12857 encoder: &mut fidl::encoding::Encoder<
12858 '_,
12859 fidl::encoding::DefaultFuchsiaResourceDialect,
12860 >,
12861 offset: usize,
12862 _depth: fidl::encoding::Depth,
12863 ) -> fidl::Result<()> {
12864 encoder.debug_check_bounds::<RootJobGetResponse>(offset);
12865 fidl::encoding::Encode::<
12867 RootJobGetResponse,
12868 fidl::encoding::DefaultFuchsiaResourceDialect,
12869 >::encode(
12870 (<fidl::encoding::HandleType<
12871 fidl::Job,
12872 { fidl::ObjectType::JOB.into_raw() },
12873 2147483648,
12874 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12875 &mut self.job
12876 ),),
12877 encoder,
12878 offset,
12879 _depth,
12880 )
12881 }
12882 }
12883 unsafe impl<
12884 T0: fidl::encoding::Encode<
12885 fidl::encoding::HandleType<
12886 fidl::Job,
12887 { fidl::ObjectType::JOB.into_raw() },
12888 2147483648,
12889 >,
12890 fidl::encoding::DefaultFuchsiaResourceDialect,
12891 >,
12892 >
12893 fidl::encoding::Encode<RootJobGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
12894 for (T0,)
12895 {
12896 #[inline]
12897 unsafe fn encode(
12898 self,
12899 encoder: &mut fidl::encoding::Encoder<
12900 '_,
12901 fidl::encoding::DefaultFuchsiaResourceDialect,
12902 >,
12903 offset: usize,
12904 depth: fidl::encoding::Depth,
12905 ) -> fidl::Result<()> {
12906 encoder.debug_check_bounds::<RootJobGetResponse>(offset);
12907 self.0.encode(encoder, offset + 0, depth)?;
12911 Ok(())
12912 }
12913 }
12914
12915 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12916 for RootJobGetResponse
12917 {
12918 #[inline(always)]
12919 fn new_empty() -> Self {
12920 Self {
12921 job: fidl::new_empty!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12922 }
12923 }
12924
12925 #[inline]
12926 unsafe fn decode(
12927 &mut self,
12928 decoder: &mut fidl::encoding::Decoder<
12929 '_,
12930 fidl::encoding::DefaultFuchsiaResourceDialect,
12931 >,
12932 offset: usize,
12933 _depth: fidl::encoding::Depth,
12934 ) -> fidl::Result<()> {
12935 decoder.debug_check_bounds::<Self>(offset);
12936 fidl::decode!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.job, decoder, offset + 0, _depth)?;
12938 Ok(())
12939 }
12940 }
12941
12942 impl fidl::encoding::ResourceTypeMarker for SmcResourceGetResponse {
12943 type Borrowed<'a> = &'a mut Self;
12944 fn take_or_borrow<'a>(
12945 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12946 ) -> Self::Borrowed<'a> {
12947 value
12948 }
12949 }
12950
12951 unsafe impl fidl::encoding::TypeMarker for SmcResourceGetResponse {
12952 type Owned = Self;
12953
12954 #[inline(always)]
12955 fn inline_align(_context: fidl::encoding::Context) -> usize {
12956 4
12957 }
12958
12959 #[inline(always)]
12960 fn inline_size(_context: fidl::encoding::Context) -> usize {
12961 4
12962 }
12963 }
12964
12965 unsafe impl
12966 fidl::encoding::Encode<
12967 SmcResourceGetResponse,
12968 fidl::encoding::DefaultFuchsiaResourceDialect,
12969 > for &mut SmcResourceGetResponse
12970 {
12971 #[inline]
12972 unsafe fn encode(
12973 self,
12974 encoder: &mut fidl::encoding::Encoder<
12975 '_,
12976 fidl::encoding::DefaultFuchsiaResourceDialect,
12977 >,
12978 offset: usize,
12979 _depth: fidl::encoding::Depth,
12980 ) -> fidl::Result<()> {
12981 encoder.debug_check_bounds::<SmcResourceGetResponse>(offset);
12982 fidl::encoding::Encode::<
12984 SmcResourceGetResponse,
12985 fidl::encoding::DefaultFuchsiaResourceDialect,
12986 >::encode(
12987 (<fidl::encoding::HandleType<
12988 fidl::Resource,
12989 { fidl::ObjectType::RESOURCE.into_raw() },
12990 2147483648,
12991 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12992 &mut self.resource
12993 ),),
12994 encoder,
12995 offset,
12996 _depth,
12997 )
12998 }
12999 }
13000 unsafe impl<
13001 T0: fidl::encoding::Encode<
13002 fidl::encoding::HandleType<
13003 fidl::Resource,
13004 { fidl::ObjectType::RESOURCE.into_raw() },
13005 2147483648,
13006 >,
13007 fidl::encoding::DefaultFuchsiaResourceDialect,
13008 >,
13009 >
13010 fidl::encoding::Encode<
13011 SmcResourceGetResponse,
13012 fidl::encoding::DefaultFuchsiaResourceDialect,
13013 > for (T0,)
13014 {
13015 #[inline]
13016 unsafe fn encode(
13017 self,
13018 encoder: &mut fidl::encoding::Encoder<
13019 '_,
13020 fidl::encoding::DefaultFuchsiaResourceDialect,
13021 >,
13022 offset: usize,
13023 depth: fidl::encoding::Depth,
13024 ) -> fidl::Result<()> {
13025 encoder.debug_check_bounds::<SmcResourceGetResponse>(offset);
13026 self.0.encode(encoder, offset + 0, depth)?;
13030 Ok(())
13031 }
13032 }
13033
13034 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13035 for SmcResourceGetResponse
13036 {
13037 #[inline(always)]
13038 fn new_empty() -> Self {
13039 Self {
13040 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13041 }
13042 }
13043
13044 #[inline]
13045 unsafe fn decode(
13046 &mut self,
13047 decoder: &mut fidl::encoding::Decoder<
13048 '_,
13049 fidl::encoding::DefaultFuchsiaResourceDialect,
13050 >,
13051 offset: usize,
13052 _depth: fidl::encoding::Depth,
13053 ) -> fidl::Result<()> {
13054 decoder.debug_check_bounds::<Self>(offset);
13055 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
13057 Ok(())
13058 }
13059 }
13060
13061 impl fidl::encoding::ResourceTypeMarker for StallResourceGetResponse {
13062 type Borrowed<'a> = &'a mut Self;
13063 fn take_or_borrow<'a>(
13064 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13065 ) -> Self::Borrowed<'a> {
13066 value
13067 }
13068 }
13069
13070 unsafe impl fidl::encoding::TypeMarker for StallResourceGetResponse {
13071 type Owned = Self;
13072
13073 #[inline(always)]
13074 fn inline_align(_context: fidl::encoding::Context) -> usize {
13075 4
13076 }
13077
13078 #[inline(always)]
13079 fn inline_size(_context: fidl::encoding::Context) -> usize {
13080 4
13081 }
13082 }
13083
13084 unsafe impl
13085 fidl::encoding::Encode<
13086 StallResourceGetResponse,
13087 fidl::encoding::DefaultFuchsiaResourceDialect,
13088 > for &mut StallResourceGetResponse
13089 {
13090 #[inline]
13091 unsafe fn encode(
13092 self,
13093 encoder: &mut fidl::encoding::Encoder<
13094 '_,
13095 fidl::encoding::DefaultFuchsiaResourceDialect,
13096 >,
13097 offset: usize,
13098 _depth: fidl::encoding::Depth,
13099 ) -> fidl::Result<()> {
13100 encoder.debug_check_bounds::<StallResourceGetResponse>(offset);
13101 fidl::encoding::Encode::<
13103 StallResourceGetResponse,
13104 fidl::encoding::DefaultFuchsiaResourceDialect,
13105 >::encode(
13106 (<fidl::encoding::HandleType<
13107 fidl::Resource,
13108 { fidl::ObjectType::RESOURCE.into_raw() },
13109 2147483648,
13110 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13111 &mut self.resource
13112 ),),
13113 encoder,
13114 offset,
13115 _depth,
13116 )
13117 }
13118 }
13119 unsafe impl<
13120 T0: fidl::encoding::Encode<
13121 fidl::encoding::HandleType<
13122 fidl::Resource,
13123 { fidl::ObjectType::RESOURCE.into_raw() },
13124 2147483648,
13125 >,
13126 fidl::encoding::DefaultFuchsiaResourceDialect,
13127 >,
13128 >
13129 fidl::encoding::Encode<
13130 StallResourceGetResponse,
13131 fidl::encoding::DefaultFuchsiaResourceDialect,
13132 > for (T0,)
13133 {
13134 #[inline]
13135 unsafe fn encode(
13136 self,
13137 encoder: &mut fidl::encoding::Encoder<
13138 '_,
13139 fidl::encoding::DefaultFuchsiaResourceDialect,
13140 >,
13141 offset: usize,
13142 depth: fidl::encoding::Depth,
13143 ) -> fidl::Result<()> {
13144 encoder.debug_check_bounds::<StallResourceGetResponse>(offset);
13145 self.0.encode(encoder, offset + 0, depth)?;
13149 Ok(())
13150 }
13151 }
13152
13153 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13154 for StallResourceGetResponse
13155 {
13156 #[inline(always)]
13157 fn new_empty() -> Self {
13158 Self {
13159 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13160 }
13161 }
13162
13163 #[inline]
13164 unsafe fn decode(
13165 &mut self,
13166 decoder: &mut fidl::encoding::Decoder<
13167 '_,
13168 fidl::encoding::DefaultFuchsiaResourceDialect,
13169 >,
13170 offset: usize,
13171 _depth: fidl::encoding::Depth,
13172 ) -> fidl::Result<()> {
13173 decoder.debug_check_bounds::<Self>(offset);
13174 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
13176 Ok(())
13177 }
13178 }
13179
13180 impl fidl::encoding::ResourceTypeMarker for TracingResourceGetResponse {
13181 type Borrowed<'a> = &'a mut Self;
13182 fn take_or_borrow<'a>(
13183 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13184 ) -> Self::Borrowed<'a> {
13185 value
13186 }
13187 }
13188
13189 unsafe impl fidl::encoding::TypeMarker for TracingResourceGetResponse {
13190 type Owned = Self;
13191
13192 #[inline(always)]
13193 fn inline_align(_context: fidl::encoding::Context) -> usize {
13194 4
13195 }
13196
13197 #[inline(always)]
13198 fn inline_size(_context: fidl::encoding::Context) -> usize {
13199 4
13200 }
13201 }
13202
13203 unsafe impl
13204 fidl::encoding::Encode<
13205 TracingResourceGetResponse,
13206 fidl::encoding::DefaultFuchsiaResourceDialect,
13207 > for &mut TracingResourceGetResponse
13208 {
13209 #[inline]
13210 unsafe fn encode(
13211 self,
13212 encoder: &mut fidl::encoding::Encoder<
13213 '_,
13214 fidl::encoding::DefaultFuchsiaResourceDialect,
13215 >,
13216 offset: usize,
13217 _depth: fidl::encoding::Depth,
13218 ) -> fidl::Result<()> {
13219 encoder.debug_check_bounds::<TracingResourceGetResponse>(offset);
13220 fidl::encoding::Encode::<
13222 TracingResourceGetResponse,
13223 fidl::encoding::DefaultFuchsiaResourceDialect,
13224 >::encode(
13225 (<fidl::encoding::HandleType<
13226 fidl::Resource,
13227 { fidl::ObjectType::RESOURCE.into_raw() },
13228 2147483648,
13229 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13230 &mut self.resource
13231 ),),
13232 encoder,
13233 offset,
13234 _depth,
13235 )
13236 }
13237 }
13238 unsafe impl<
13239 T0: fidl::encoding::Encode<
13240 fidl::encoding::HandleType<
13241 fidl::Resource,
13242 { fidl::ObjectType::RESOURCE.into_raw() },
13243 2147483648,
13244 >,
13245 fidl::encoding::DefaultFuchsiaResourceDialect,
13246 >,
13247 >
13248 fidl::encoding::Encode<
13249 TracingResourceGetResponse,
13250 fidl::encoding::DefaultFuchsiaResourceDialect,
13251 > for (T0,)
13252 {
13253 #[inline]
13254 unsafe fn encode(
13255 self,
13256 encoder: &mut fidl::encoding::Encoder<
13257 '_,
13258 fidl::encoding::DefaultFuchsiaResourceDialect,
13259 >,
13260 offset: usize,
13261 depth: fidl::encoding::Depth,
13262 ) -> fidl::Result<()> {
13263 encoder.debug_check_bounds::<TracingResourceGetResponse>(offset);
13264 self.0.encode(encoder, offset + 0, depth)?;
13268 Ok(())
13269 }
13270 }
13271
13272 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13273 for TracingResourceGetResponse
13274 {
13275 #[inline(always)]
13276 fn new_empty() -> Self {
13277 Self {
13278 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13279 }
13280 }
13281
13282 #[inline]
13283 unsafe fn decode(
13284 &mut self,
13285 decoder: &mut fidl::encoding::Decoder<
13286 '_,
13287 fidl::encoding::DefaultFuchsiaResourceDialect,
13288 >,
13289 offset: usize,
13290 _depth: fidl::encoding::Depth,
13291 ) -> fidl::Result<()> {
13292 decoder.debug_check_bounds::<Self>(offset);
13293 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
13295 Ok(())
13296 }
13297 }
13298
13299 impl fidl::encoding::ResourceTypeMarker for VmexResourceGetResponse {
13300 type Borrowed<'a> = &'a mut Self;
13301 fn take_or_borrow<'a>(
13302 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13303 ) -> Self::Borrowed<'a> {
13304 value
13305 }
13306 }
13307
13308 unsafe impl fidl::encoding::TypeMarker for VmexResourceGetResponse {
13309 type Owned = Self;
13310
13311 #[inline(always)]
13312 fn inline_align(_context: fidl::encoding::Context) -> usize {
13313 4
13314 }
13315
13316 #[inline(always)]
13317 fn inline_size(_context: fidl::encoding::Context) -> usize {
13318 4
13319 }
13320 }
13321
13322 unsafe impl
13323 fidl::encoding::Encode<
13324 VmexResourceGetResponse,
13325 fidl::encoding::DefaultFuchsiaResourceDialect,
13326 > for &mut VmexResourceGetResponse
13327 {
13328 #[inline]
13329 unsafe fn encode(
13330 self,
13331 encoder: &mut fidl::encoding::Encoder<
13332 '_,
13333 fidl::encoding::DefaultFuchsiaResourceDialect,
13334 >,
13335 offset: usize,
13336 _depth: fidl::encoding::Depth,
13337 ) -> fidl::Result<()> {
13338 encoder.debug_check_bounds::<VmexResourceGetResponse>(offset);
13339 fidl::encoding::Encode::<
13341 VmexResourceGetResponse,
13342 fidl::encoding::DefaultFuchsiaResourceDialect,
13343 >::encode(
13344 (<fidl::encoding::HandleType<
13345 fidl::Resource,
13346 { fidl::ObjectType::RESOURCE.into_raw() },
13347 2147483648,
13348 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13349 &mut self.resource
13350 ),),
13351 encoder,
13352 offset,
13353 _depth,
13354 )
13355 }
13356 }
13357 unsafe impl<
13358 T0: fidl::encoding::Encode<
13359 fidl::encoding::HandleType<
13360 fidl::Resource,
13361 { fidl::ObjectType::RESOURCE.into_raw() },
13362 2147483648,
13363 >,
13364 fidl::encoding::DefaultFuchsiaResourceDialect,
13365 >,
13366 >
13367 fidl::encoding::Encode<
13368 VmexResourceGetResponse,
13369 fidl::encoding::DefaultFuchsiaResourceDialect,
13370 > for (T0,)
13371 {
13372 #[inline]
13373 unsafe fn encode(
13374 self,
13375 encoder: &mut fidl::encoding::Encoder<
13376 '_,
13377 fidl::encoding::DefaultFuchsiaResourceDialect,
13378 >,
13379 offset: usize,
13380 depth: fidl::encoding::Depth,
13381 ) -> fidl::Result<()> {
13382 encoder.debug_check_bounds::<VmexResourceGetResponse>(offset);
13383 self.0.encode(encoder, offset + 0, depth)?;
13387 Ok(())
13388 }
13389 }
13390
13391 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13392 for VmexResourceGetResponse
13393 {
13394 #[inline(always)]
13395 fn new_empty() -> Self {
13396 Self {
13397 resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13398 }
13399 }
13400
13401 #[inline]
13402 unsafe fn decode(
13403 &mut self,
13404 decoder: &mut fidl::encoding::Decoder<
13405 '_,
13406 fidl::encoding::DefaultFuchsiaResourceDialect,
13407 >,
13408 offset: usize,
13409 _depth: fidl::encoding::Depth,
13410 ) -> fidl::Result<()> {
13411 decoder.debug_check_bounds::<Self>(offset);
13412 fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
13414 Ok(())
13415 }
13416 }
13417}