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_memory_attribution_plugin__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct MemoryMonitorGetSnapshotRequest {
16 pub snapshot: fidl::Socket,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for MemoryMonitorGetSnapshotRequest
21{
22}
23
24#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
25pub struct MemoryMonitorMarker;
26
27impl fidl::endpoints::ProtocolMarker for MemoryMonitorMarker {
28 type Proxy = MemoryMonitorProxy;
29 type RequestStream = MemoryMonitorRequestStream;
30 #[cfg(target_os = "fuchsia")]
31 type SynchronousProxy = MemoryMonitorSynchronousProxy;
32
33 const DEBUG_NAME: &'static str = "fuchsia.memory.attribution.plugin.MemoryMonitor";
34}
35impl fidl::endpoints::DiscoverableProtocolMarker for MemoryMonitorMarker {}
36
37pub trait MemoryMonitorProxyInterface: Send + Sync {
38 fn r#get_snapshot(&self, snapshot: fidl::Socket) -> Result<(), fidl::Error>;
39 type GetSystemStatisticsResponseFut: std::future::Future<Output = Result<MemoryStatistics, fidl::Error>>
40 + Send;
41 fn r#get_system_statistics(&self) -> Self::GetSystemStatisticsResponseFut;
42}
43#[derive(Debug)]
44#[cfg(target_os = "fuchsia")]
45pub struct MemoryMonitorSynchronousProxy {
46 client: fidl::client::sync::Client,
47}
48
49#[cfg(target_os = "fuchsia")]
50impl fidl::endpoints::SynchronousProxy for MemoryMonitorSynchronousProxy {
51 type Proxy = MemoryMonitorProxy;
52 type Protocol = MemoryMonitorMarker;
53
54 fn from_channel(inner: fidl::Channel) -> Self {
55 Self::new(inner)
56 }
57
58 fn into_channel(self) -> fidl::Channel {
59 self.client.into_channel()
60 }
61
62 fn as_channel(&self) -> &fidl::Channel {
63 self.client.as_channel()
64 }
65}
66
67#[cfg(target_os = "fuchsia")]
68impl MemoryMonitorSynchronousProxy {
69 pub fn new(channel: fidl::Channel) -> Self {
70 let protocol_name = <MemoryMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
71 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
72 }
73
74 pub fn into_channel(self) -> fidl::Channel {
75 self.client.into_channel()
76 }
77
78 pub fn wait_for_event(
81 &self,
82 deadline: zx::MonotonicInstant,
83 ) -> Result<MemoryMonitorEvent, fidl::Error> {
84 MemoryMonitorEvent::decode(self.client.wait_for_event(deadline)?)
85 }
86
87 pub fn r#get_snapshot(&self, mut snapshot: fidl::Socket) -> Result<(), fidl::Error> {
88 self.client.send::<MemoryMonitorGetSnapshotRequest>(
89 (snapshot,),
90 0x3af6caa4c6a6fdb7,
91 fidl::encoding::DynamicFlags::FLEXIBLE,
92 )
93 }
94
95 pub fn r#get_system_statistics(
96 &self,
97 ___deadline: zx::MonotonicInstant,
98 ) -> Result<MemoryStatistics, fidl::Error> {
99 let _response = self.client.send_query::<
100 fidl::encoding::EmptyPayload,
101 fidl::encoding::FlexibleType<MemoryMonitorGetSystemStatisticsResponse>,
102 >(
103 (),
104 0x33e3c58dc277f92d,
105 fidl::encoding::DynamicFlags::FLEXIBLE,
106 ___deadline,
107 )?
108 .into_result::<MemoryMonitorMarker>("get_system_statistics")?;
109 Ok(_response.statistics)
110 }
111}
112
113#[cfg(target_os = "fuchsia")]
114impl From<MemoryMonitorSynchronousProxy> for zx::NullableHandle {
115 fn from(value: MemoryMonitorSynchronousProxy) -> Self {
116 value.into_channel().into()
117 }
118}
119
120#[cfg(target_os = "fuchsia")]
121impl From<fidl::Channel> for MemoryMonitorSynchronousProxy {
122 fn from(value: fidl::Channel) -> Self {
123 Self::new(value)
124 }
125}
126
127#[cfg(target_os = "fuchsia")]
128impl fidl::endpoints::FromClient for MemoryMonitorSynchronousProxy {
129 type Protocol = MemoryMonitorMarker;
130
131 fn from_client(value: fidl::endpoints::ClientEnd<MemoryMonitorMarker>) -> Self {
132 Self::new(value.into_channel())
133 }
134}
135
136#[derive(Debug, Clone)]
137pub struct MemoryMonitorProxy {
138 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
139}
140
141impl fidl::endpoints::Proxy for MemoryMonitorProxy {
142 type Protocol = MemoryMonitorMarker;
143
144 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
145 Self::new(inner)
146 }
147
148 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
149 self.client.into_channel().map_err(|client| Self { client })
150 }
151
152 fn as_channel(&self) -> &::fidl::AsyncChannel {
153 self.client.as_channel()
154 }
155}
156
157impl MemoryMonitorProxy {
158 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
160 let protocol_name = <MemoryMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
161 Self { client: fidl::client::Client::new(channel, protocol_name) }
162 }
163
164 pub fn take_event_stream(&self) -> MemoryMonitorEventStream {
170 MemoryMonitorEventStream { event_receiver: self.client.take_event_receiver() }
171 }
172
173 pub fn r#get_snapshot(&self, mut snapshot: fidl::Socket) -> Result<(), fidl::Error> {
174 MemoryMonitorProxyInterface::r#get_snapshot(self, snapshot)
175 }
176
177 pub fn r#get_system_statistics(
178 &self,
179 ) -> fidl::client::QueryResponseFut<
180 MemoryStatistics,
181 fidl::encoding::DefaultFuchsiaResourceDialect,
182 > {
183 MemoryMonitorProxyInterface::r#get_system_statistics(self)
184 }
185}
186
187impl MemoryMonitorProxyInterface for MemoryMonitorProxy {
188 fn r#get_snapshot(&self, mut snapshot: fidl::Socket) -> Result<(), fidl::Error> {
189 self.client.send::<MemoryMonitorGetSnapshotRequest>(
190 (snapshot,),
191 0x3af6caa4c6a6fdb7,
192 fidl::encoding::DynamicFlags::FLEXIBLE,
193 )
194 }
195
196 type GetSystemStatisticsResponseFut = fidl::client::QueryResponseFut<
197 MemoryStatistics,
198 fidl::encoding::DefaultFuchsiaResourceDialect,
199 >;
200 fn r#get_system_statistics(&self) -> Self::GetSystemStatisticsResponseFut {
201 fn _decode(
202 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
203 ) -> Result<MemoryStatistics, fidl::Error> {
204 let _response = fidl::client::decode_transaction_body::<
205 fidl::encoding::FlexibleType<MemoryMonitorGetSystemStatisticsResponse>,
206 fidl::encoding::DefaultFuchsiaResourceDialect,
207 0x33e3c58dc277f92d,
208 >(_buf?)?
209 .into_result::<MemoryMonitorMarker>("get_system_statistics")?;
210 Ok(_response.statistics)
211 }
212 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, MemoryStatistics>(
213 (),
214 0x33e3c58dc277f92d,
215 fidl::encoding::DynamicFlags::FLEXIBLE,
216 _decode,
217 )
218 }
219}
220
221pub struct MemoryMonitorEventStream {
222 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
223}
224
225impl std::marker::Unpin for MemoryMonitorEventStream {}
226
227impl futures::stream::FusedStream for MemoryMonitorEventStream {
228 fn is_terminated(&self) -> bool {
229 self.event_receiver.is_terminated()
230 }
231}
232
233impl futures::Stream for MemoryMonitorEventStream {
234 type Item = Result<MemoryMonitorEvent, fidl::Error>;
235
236 fn poll_next(
237 mut self: std::pin::Pin<&mut Self>,
238 cx: &mut std::task::Context<'_>,
239 ) -> std::task::Poll<Option<Self::Item>> {
240 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
241 &mut self.event_receiver,
242 cx
243 )?) {
244 Some(buf) => std::task::Poll::Ready(Some(MemoryMonitorEvent::decode(buf))),
245 None => std::task::Poll::Ready(None),
246 }
247 }
248}
249
250#[derive(Debug)]
251pub enum MemoryMonitorEvent {
252 #[non_exhaustive]
253 _UnknownEvent {
254 ordinal: u64,
256 },
257}
258
259impl MemoryMonitorEvent {
260 fn decode(
262 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
263 ) -> Result<MemoryMonitorEvent, fidl::Error> {
264 let (bytes, _handles) = buf.split_mut();
265 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
266 debug_assert_eq!(tx_header.tx_id, 0);
267 match tx_header.ordinal {
268 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
269 Ok(MemoryMonitorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
270 }
271 _ => Err(fidl::Error::UnknownOrdinal {
272 ordinal: tx_header.ordinal,
273 protocol_name: <MemoryMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
274 }),
275 }
276 }
277}
278
279pub struct MemoryMonitorRequestStream {
281 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
282 is_terminated: bool,
283}
284
285impl std::marker::Unpin for MemoryMonitorRequestStream {}
286
287impl futures::stream::FusedStream for MemoryMonitorRequestStream {
288 fn is_terminated(&self) -> bool {
289 self.is_terminated
290 }
291}
292
293impl fidl::endpoints::RequestStream for MemoryMonitorRequestStream {
294 type Protocol = MemoryMonitorMarker;
295 type ControlHandle = MemoryMonitorControlHandle;
296
297 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
298 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
299 }
300
301 fn control_handle(&self) -> Self::ControlHandle {
302 MemoryMonitorControlHandle { inner: self.inner.clone() }
303 }
304
305 fn into_inner(
306 self,
307 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
308 {
309 (self.inner, self.is_terminated)
310 }
311
312 fn from_inner(
313 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
314 is_terminated: bool,
315 ) -> Self {
316 Self { inner, is_terminated }
317 }
318}
319
320impl futures::Stream for MemoryMonitorRequestStream {
321 type Item = Result<MemoryMonitorRequest, fidl::Error>;
322
323 fn poll_next(
324 mut self: std::pin::Pin<&mut Self>,
325 cx: &mut std::task::Context<'_>,
326 ) -> std::task::Poll<Option<Self::Item>> {
327 let this = &mut *self;
328 if this.inner.check_shutdown(cx) {
329 this.is_terminated = true;
330 return std::task::Poll::Ready(None);
331 }
332 if this.is_terminated {
333 panic!("polled MemoryMonitorRequestStream after completion");
334 }
335 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
336 |bytes, handles| {
337 match this.inner.channel().read_etc(cx, bytes, handles) {
338 std::task::Poll::Ready(Ok(())) => {}
339 std::task::Poll::Pending => return std::task::Poll::Pending,
340 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
341 this.is_terminated = true;
342 return std::task::Poll::Ready(None);
343 }
344 std::task::Poll::Ready(Err(e)) => {
345 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
346 e.into(),
347 ))));
348 }
349 }
350
351 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
353
354 std::task::Poll::Ready(Some(match header.ordinal {
355 0x3af6caa4c6a6fdb7 => {
356 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
357 let mut req = fidl::new_empty!(
358 MemoryMonitorGetSnapshotRequest,
359 fidl::encoding::DefaultFuchsiaResourceDialect
360 );
361 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MemoryMonitorGetSnapshotRequest>(&header, _body_bytes, handles, &mut req)?;
362 let control_handle =
363 MemoryMonitorControlHandle { inner: this.inner.clone() };
364 Ok(MemoryMonitorRequest::GetSnapshot {
365 snapshot: req.snapshot,
366
367 control_handle,
368 })
369 }
370 0x33e3c58dc277f92d => {
371 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
372 let mut req = fidl::new_empty!(
373 fidl::encoding::EmptyPayload,
374 fidl::encoding::DefaultFuchsiaResourceDialect
375 );
376 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
377 let control_handle =
378 MemoryMonitorControlHandle { inner: this.inner.clone() };
379 Ok(MemoryMonitorRequest::GetSystemStatistics {
380 responder: MemoryMonitorGetSystemStatisticsResponder {
381 control_handle: std::mem::ManuallyDrop::new(control_handle),
382 tx_id: header.tx_id,
383 },
384 })
385 }
386 _ if header.tx_id == 0
387 && header
388 .dynamic_flags()
389 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
390 {
391 Ok(MemoryMonitorRequest::_UnknownMethod {
392 ordinal: header.ordinal,
393 control_handle: MemoryMonitorControlHandle {
394 inner: this.inner.clone(),
395 },
396 method_type: fidl::MethodType::OneWay,
397 })
398 }
399 _ if header
400 .dynamic_flags()
401 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
402 {
403 this.inner.send_framework_err(
404 fidl::encoding::FrameworkErr::UnknownMethod,
405 header.tx_id,
406 header.ordinal,
407 header.dynamic_flags(),
408 (bytes, handles),
409 )?;
410 Ok(MemoryMonitorRequest::_UnknownMethod {
411 ordinal: header.ordinal,
412 control_handle: MemoryMonitorControlHandle {
413 inner: this.inner.clone(),
414 },
415 method_type: fidl::MethodType::TwoWay,
416 })
417 }
418 _ => Err(fidl::Error::UnknownOrdinal {
419 ordinal: header.ordinal,
420 protocol_name:
421 <MemoryMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
422 }),
423 }))
424 },
425 )
426 }
427}
428
429#[derive(Debug)]
430pub enum MemoryMonitorRequest {
431 GetSnapshot {
432 snapshot: fidl::Socket,
433 control_handle: MemoryMonitorControlHandle,
434 },
435 GetSystemStatistics {
436 responder: MemoryMonitorGetSystemStatisticsResponder,
437 },
438 #[non_exhaustive]
440 _UnknownMethod {
441 ordinal: u64,
443 control_handle: MemoryMonitorControlHandle,
444 method_type: fidl::MethodType,
445 },
446}
447
448impl MemoryMonitorRequest {
449 #[allow(irrefutable_let_patterns)]
450 pub fn into_get_snapshot(self) -> Option<(fidl::Socket, MemoryMonitorControlHandle)> {
451 if let MemoryMonitorRequest::GetSnapshot { snapshot, control_handle } = self {
452 Some((snapshot, control_handle))
453 } else {
454 None
455 }
456 }
457
458 #[allow(irrefutable_let_patterns)]
459 pub fn into_get_system_statistics(self) -> Option<(MemoryMonitorGetSystemStatisticsResponder)> {
460 if let MemoryMonitorRequest::GetSystemStatistics { responder } = self {
461 Some((responder))
462 } else {
463 None
464 }
465 }
466
467 pub fn method_name(&self) -> &'static str {
469 match *self {
470 MemoryMonitorRequest::GetSnapshot { .. } => "get_snapshot",
471 MemoryMonitorRequest::GetSystemStatistics { .. } => "get_system_statistics",
472 MemoryMonitorRequest::_UnknownMethod {
473 method_type: fidl::MethodType::OneWay, ..
474 } => "unknown one-way method",
475 MemoryMonitorRequest::_UnknownMethod {
476 method_type: fidl::MethodType::TwoWay, ..
477 } => "unknown two-way method",
478 }
479 }
480}
481
482#[derive(Debug, Clone)]
483pub struct MemoryMonitorControlHandle {
484 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
485}
486
487impl fidl::endpoints::ControlHandle for MemoryMonitorControlHandle {
488 fn shutdown(&self) {
489 self.inner.shutdown()
490 }
491
492 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
493 self.inner.shutdown_with_epitaph(status)
494 }
495
496 fn is_closed(&self) -> bool {
497 self.inner.channel().is_closed()
498 }
499 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
500 self.inner.channel().on_closed()
501 }
502
503 #[cfg(target_os = "fuchsia")]
504 fn signal_peer(
505 &self,
506 clear_mask: zx::Signals,
507 set_mask: zx::Signals,
508 ) -> Result<(), zx_status::Status> {
509 use fidl::Peered;
510 self.inner.channel().signal_peer(clear_mask, set_mask)
511 }
512}
513
514impl MemoryMonitorControlHandle {}
515
516#[must_use = "FIDL methods require a response to be sent"]
517#[derive(Debug)]
518pub struct MemoryMonitorGetSystemStatisticsResponder {
519 control_handle: std::mem::ManuallyDrop<MemoryMonitorControlHandle>,
520 tx_id: u32,
521}
522
523impl std::ops::Drop for MemoryMonitorGetSystemStatisticsResponder {
527 fn drop(&mut self) {
528 self.control_handle.shutdown();
529 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
531 }
532}
533
534impl fidl::endpoints::Responder for MemoryMonitorGetSystemStatisticsResponder {
535 type ControlHandle = MemoryMonitorControlHandle;
536
537 fn control_handle(&self) -> &MemoryMonitorControlHandle {
538 &self.control_handle
539 }
540
541 fn drop_without_shutdown(mut self) {
542 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
544 std::mem::forget(self);
546 }
547}
548
549impl MemoryMonitorGetSystemStatisticsResponder {
550 pub fn send(self, mut statistics: &MemoryStatistics) -> Result<(), fidl::Error> {
554 let _result = self.send_raw(statistics);
555 if _result.is_err() {
556 self.control_handle.shutdown();
557 }
558 self.drop_without_shutdown();
559 _result
560 }
561
562 pub fn send_no_shutdown_on_err(
564 self,
565 mut statistics: &MemoryStatistics,
566 ) -> Result<(), fidl::Error> {
567 let _result = self.send_raw(statistics);
568 self.drop_without_shutdown();
569 _result
570 }
571
572 fn send_raw(&self, mut statistics: &MemoryStatistics) -> Result<(), fidl::Error> {
573 self.control_handle.inner.send::<fidl::encoding::FlexibleType<
574 MemoryMonitorGetSystemStatisticsResponse,
575 >>(
576 fidl::encoding::Flexible::new((statistics,)),
577 self.tx_id,
578 0x33e3c58dc277f92d,
579 fidl::encoding::DynamicFlags::FLEXIBLE,
580 )
581 }
582}
583
584mod internal {
585 use super::*;
586
587 impl fidl::encoding::ResourceTypeMarker for MemoryMonitorGetSnapshotRequest {
588 type Borrowed<'a> = &'a mut Self;
589 fn take_or_borrow<'a>(
590 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
591 ) -> Self::Borrowed<'a> {
592 value
593 }
594 }
595
596 unsafe impl fidl::encoding::TypeMarker for MemoryMonitorGetSnapshotRequest {
597 type Owned = Self;
598
599 #[inline(always)]
600 fn inline_align(_context: fidl::encoding::Context) -> usize {
601 4
602 }
603
604 #[inline(always)]
605 fn inline_size(_context: fidl::encoding::Context) -> usize {
606 4
607 }
608 }
609
610 unsafe impl
611 fidl::encoding::Encode<
612 MemoryMonitorGetSnapshotRequest,
613 fidl::encoding::DefaultFuchsiaResourceDialect,
614 > for &mut MemoryMonitorGetSnapshotRequest
615 {
616 #[inline]
617 unsafe fn encode(
618 self,
619 encoder: &mut fidl::encoding::Encoder<
620 '_,
621 fidl::encoding::DefaultFuchsiaResourceDialect,
622 >,
623 offset: usize,
624 _depth: fidl::encoding::Depth,
625 ) -> fidl::Result<()> {
626 encoder.debug_check_bounds::<MemoryMonitorGetSnapshotRequest>(offset);
627 fidl::encoding::Encode::<
629 MemoryMonitorGetSnapshotRequest,
630 fidl::encoding::DefaultFuchsiaResourceDialect,
631 >::encode(
632 (<fidl::encoding::HandleType<
633 fidl::Socket,
634 { fidl::ObjectType::SOCKET.into_raw() },
635 2147483648,
636 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
637 &mut self.snapshot
638 ),),
639 encoder,
640 offset,
641 _depth,
642 )
643 }
644 }
645 unsafe impl<
646 T0: fidl::encoding::Encode<
647 fidl::encoding::HandleType<
648 fidl::Socket,
649 { fidl::ObjectType::SOCKET.into_raw() },
650 2147483648,
651 >,
652 fidl::encoding::DefaultFuchsiaResourceDialect,
653 >,
654 >
655 fidl::encoding::Encode<
656 MemoryMonitorGetSnapshotRequest,
657 fidl::encoding::DefaultFuchsiaResourceDialect,
658 > for (T0,)
659 {
660 #[inline]
661 unsafe fn encode(
662 self,
663 encoder: &mut fidl::encoding::Encoder<
664 '_,
665 fidl::encoding::DefaultFuchsiaResourceDialect,
666 >,
667 offset: usize,
668 depth: fidl::encoding::Depth,
669 ) -> fidl::Result<()> {
670 encoder.debug_check_bounds::<MemoryMonitorGetSnapshotRequest>(offset);
671 self.0.encode(encoder, offset + 0, depth)?;
675 Ok(())
676 }
677 }
678
679 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
680 for MemoryMonitorGetSnapshotRequest
681 {
682 #[inline(always)]
683 fn new_empty() -> Self {
684 Self {
685 snapshot: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
686 }
687 }
688
689 #[inline]
690 unsafe fn decode(
691 &mut self,
692 decoder: &mut fidl::encoding::Decoder<
693 '_,
694 fidl::encoding::DefaultFuchsiaResourceDialect,
695 >,
696 offset: usize,
697 _depth: fidl::encoding::Depth,
698 ) -> fidl::Result<()> {
699 decoder.debug_check_bounds::<Self>(offset);
700 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.snapshot, decoder, offset + 0, _depth)?;
702 Ok(())
703 }
704 }
705}