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_storage_mapping_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct MappingProviderOpenSessionRequest {
16 pub session: fidl::endpoints::ServerEnd<MappingSessionMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for MappingProviderOpenSessionRequest
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct MappingProviderOpenSessionResponse {
26 pub mapping_vmo: fidl::Vmo,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for MappingProviderOpenSessionResponse
31{
32}
33
34#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35pub struct MappingSessionWriteProfileRequest {
36 pub name: String,
37 pub profile_vmo: fidl::Vmo,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41 for MappingSessionWriteProfileRequest
42{
43}
44
45#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct MappingSessionGetProfileResponse {
47 pub profile_vmo: fidl::Vmo,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
51 for MappingSessionGetProfileResponse
52{
53}
54
55#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
56pub struct MappingProviderMarker;
57
58impl fidl::endpoints::ProtocolMarker for MappingProviderMarker {
59 type Proxy = MappingProviderProxy;
60 type RequestStream = MappingProviderRequestStream;
61 #[cfg(target_os = "fuchsia")]
62 type SynchronousProxy = MappingProviderSynchronousProxy;
63
64 const DEBUG_NAME: &'static str = "fuchsia.storage.mapping.MappingProvider";
65}
66impl fidl::endpoints::DiscoverableProtocolMarker for MappingProviderMarker {}
67pub type MappingProviderOpenSessionResult = Result<fidl::Vmo, i32>;
68
69pub trait MappingProviderProxyInterface: Send + Sync {
70 type OpenSessionResponseFut: std::future::Future<Output = Result<MappingProviderOpenSessionResult, fidl::Error>>
71 + Send;
72 fn r#open_session(
73 &self,
74 session: fidl::endpoints::ServerEnd<MappingSessionMarker>,
75 ) -> Self::OpenSessionResponseFut;
76}
77#[derive(Debug)]
78#[cfg(target_os = "fuchsia")]
79pub struct MappingProviderSynchronousProxy {
80 client: fidl::client::sync::Client,
81}
82
83#[cfg(target_os = "fuchsia")]
84impl fidl::endpoints::SynchronousProxy for MappingProviderSynchronousProxy {
85 type Proxy = MappingProviderProxy;
86 type Protocol = MappingProviderMarker;
87
88 fn from_channel(inner: fidl::Channel) -> Self {
89 Self::new(inner)
90 }
91
92 fn into_channel(self) -> fidl::Channel {
93 self.client.into_channel()
94 }
95
96 fn as_channel(&self) -> &fidl::Channel {
97 self.client.as_channel()
98 }
99}
100
101#[cfg(target_os = "fuchsia")]
102impl MappingProviderSynchronousProxy {
103 pub fn new(channel: fidl::Channel) -> Self {
104 Self { client: fidl::client::sync::Client::new(channel) }
105 }
106
107 pub fn into_channel(self) -> fidl::Channel {
108 self.client.into_channel()
109 }
110
111 pub fn wait_for_event(
114 &self,
115 deadline: zx::MonotonicInstant,
116 ) -> Result<MappingProviderEvent, fidl::Error> {
117 MappingProviderEvent::decode(self.client.wait_for_event::<MappingProviderMarker>(deadline)?)
118 }
119
120 pub fn r#open_session(
122 &self,
123 mut session: fidl::endpoints::ServerEnd<MappingSessionMarker>,
124 ___deadline: zx::MonotonicInstant,
125 ) -> Result<MappingProviderOpenSessionResult, fidl::Error> {
126 let _response = self.client.send_query::<
127 MappingProviderOpenSessionRequest,
128 fidl::encoding::FlexibleResultType<MappingProviderOpenSessionResponse, i32>,
129 MappingProviderMarker,
130 >(
131 (session,),
132 0x392ee248d504919a,
133 fidl::encoding::DynamicFlags::FLEXIBLE,
134 ___deadline,
135 )?
136 .into_result::<MappingProviderMarker>("open_session")?;
137 Ok(_response.map(|x| x.mapping_vmo))
138 }
139}
140
141#[cfg(target_os = "fuchsia")]
142impl From<MappingProviderSynchronousProxy> for zx::NullableHandle {
143 fn from(value: MappingProviderSynchronousProxy) -> Self {
144 value.into_channel().into()
145 }
146}
147
148#[cfg(target_os = "fuchsia")]
149impl From<fidl::Channel> for MappingProviderSynchronousProxy {
150 fn from(value: fidl::Channel) -> Self {
151 Self::new(value)
152 }
153}
154
155#[cfg(target_os = "fuchsia")]
156impl fidl::endpoints::FromClient for MappingProviderSynchronousProxy {
157 type Protocol = MappingProviderMarker;
158
159 fn from_client(value: fidl::endpoints::ClientEnd<MappingProviderMarker>) -> Self {
160 Self::new(value.into_channel())
161 }
162}
163
164#[derive(Debug, Clone)]
165pub struct MappingProviderProxy {
166 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
167}
168
169impl fidl::endpoints::Proxy for MappingProviderProxy {
170 type Protocol = MappingProviderMarker;
171
172 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
173 Self::new(inner)
174 }
175
176 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
177 self.client.into_channel().map_err(|client| Self { client })
178 }
179
180 fn as_channel(&self) -> &::fidl::AsyncChannel {
181 self.client.as_channel()
182 }
183}
184
185impl MappingProviderProxy {
186 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
188 let protocol_name = <MappingProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
189 Self { client: fidl::client::Client::new(channel, protocol_name) }
190 }
191
192 pub fn take_event_stream(&self) -> MappingProviderEventStream {
198 MappingProviderEventStream { event_receiver: self.client.take_event_receiver() }
199 }
200
201 pub fn r#open_session(
203 &self,
204 mut session: fidl::endpoints::ServerEnd<MappingSessionMarker>,
205 ) -> fidl::client::QueryResponseFut<
206 MappingProviderOpenSessionResult,
207 fidl::encoding::DefaultFuchsiaResourceDialect,
208 > {
209 MappingProviderProxyInterface::r#open_session(self, session)
210 }
211}
212
213impl MappingProviderProxyInterface for MappingProviderProxy {
214 type OpenSessionResponseFut = fidl::client::QueryResponseFut<
215 MappingProviderOpenSessionResult,
216 fidl::encoding::DefaultFuchsiaResourceDialect,
217 >;
218 fn r#open_session(
219 &self,
220 mut session: fidl::endpoints::ServerEnd<MappingSessionMarker>,
221 ) -> Self::OpenSessionResponseFut {
222 fn _decode(
223 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
224 ) -> Result<MappingProviderOpenSessionResult, fidl::Error> {
225 let _response = fidl::client::decode_transaction_body::<
226 fidl::encoding::FlexibleResultType<MappingProviderOpenSessionResponse, i32>,
227 fidl::encoding::DefaultFuchsiaResourceDialect,
228 0x392ee248d504919a,
229 >(_buf?)?
230 .into_result::<MappingProviderMarker>("open_session")?;
231 Ok(_response.map(|x| x.mapping_vmo))
232 }
233 self.client.send_query_and_decode::<
234 MappingProviderOpenSessionRequest,
235 MappingProviderOpenSessionResult,
236 >(
237 (session,),
238 0x392ee248d504919a,
239 fidl::encoding::DynamicFlags::FLEXIBLE,
240 _decode,
241 )
242 }
243}
244
245pub struct MappingProviderEventStream {
246 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
247}
248
249impl std::marker::Unpin for MappingProviderEventStream {}
250
251impl futures::stream::FusedStream for MappingProviderEventStream {
252 fn is_terminated(&self) -> bool {
253 self.event_receiver.is_terminated()
254 }
255}
256
257impl futures::Stream for MappingProviderEventStream {
258 type Item = Result<MappingProviderEvent, fidl::Error>;
259
260 fn poll_next(
261 mut self: std::pin::Pin<&mut Self>,
262 cx: &mut std::task::Context<'_>,
263 ) -> std::task::Poll<Option<Self::Item>> {
264 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
265 &mut self.event_receiver,
266 cx
267 )?) {
268 Some(buf) => std::task::Poll::Ready(Some(MappingProviderEvent::decode(buf))),
269 None => std::task::Poll::Ready(None),
270 }
271 }
272}
273
274#[derive(Debug)]
275pub enum MappingProviderEvent {
276 #[non_exhaustive]
277 _UnknownEvent {
278 ordinal: u64,
280 },
281}
282
283impl MappingProviderEvent {
284 fn decode(
286 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
287 ) -> Result<MappingProviderEvent, fidl::Error> {
288 let (bytes, _handles) = buf.split_mut();
289 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
290 debug_assert_eq!(tx_header.tx_id, 0);
291 match tx_header.ordinal {
292 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
293 Ok(MappingProviderEvent::_UnknownEvent { ordinal: tx_header.ordinal })
294 }
295 _ => Err(fidl::Error::UnknownOrdinal {
296 ordinal: tx_header.ordinal,
297 protocol_name:
298 <MappingProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
299 }),
300 }
301 }
302}
303
304pub struct MappingProviderRequestStream {
306 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
307 is_terminated: bool,
308}
309
310impl std::marker::Unpin for MappingProviderRequestStream {}
311
312impl futures::stream::FusedStream for MappingProviderRequestStream {
313 fn is_terminated(&self) -> bool {
314 self.is_terminated
315 }
316}
317
318impl fidl::endpoints::RequestStream for MappingProviderRequestStream {
319 type Protocol = MappingProviderMarker;
320 type ControlHandle = MappingProviderControlHandle;
321
322 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
323 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
324 }
325
326 fn control_handle(&self) -> Self::ControlHandle {
327 MappingProviderControlHandle { inner: self.inner.clone() }
328 }
329
330 fn into_inner(
331 self,
332 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
333 {
334 (self.inner, self.is_terminated)
335 }
336
337 fn from_inner(
338 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
339 is_terminated: bool,
340 ) -> Self {
341 Self { inner, is_terminated }
342 }
343}
344
345impl futures::Stream for MappingProviderRequestStream {
346 type Item = Result<MappingProviderRequest, fidl::Error>;
347
348 fn poll_next(
349 mut self: std::pin::Pin<&mut Self>,
350 cx: &mut std::task::Context<'_>,
351 ) -> std::task::Poll<Option<Self::Item>> {
352 let this = &mut *self;
353 if this.inner.check_shutdown(cx) {
354 this.is_terminated = true;
355 return std::task::Poll::Ready(None);
356 }
357 if this.is_terminated {
358 panic!("polled MappingProviderRequestStream after completion");
359 }
360 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
361 |bytes, handles| {
362 match this.inner.channel().read_etc(cx, bytes, handles) {
363 std::task::Poll::Ready(Ok(())) => {}
364 std::task::Poll::Pending => return std::task::Poll::Pending,
365 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
366 this.is_terminated = true;
367 return std::task::Poll::Ready(None);
368 }
369 std::task::Poll::Ready(Err(e)) => {
370 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
371 e.into(),
372 ))));
373 }
374 }
375
376 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
378
379 std::task::Poll::Ready(Some(match header.ordinal {
380 0x392ee248d504919a => {
381 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
382 let mut req = fidl::new_empty!(
383 MappingProviderOpenSessionRequest,
384 fidl::encoding::DefaultFuchsiaResourceDialect
385 );
386 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MappingProviderOpenSessionRequest>(&header, _body_bytes, handles, &mut req)?;
387 let control_handle =
388 MappingProviderControlHandle { inner: this.inner.clone() };
389 Ok(MappingProviderRequest::OpenSession {
390 session: req.session,
391
392 responder: MappingProviderOpenSessionResponder {
393 control_handle: std::mem::ManuallyDrop::new(control_handle),
394 tx_id: header.tx_id,
395 },
396 })
397 }
398 _ if header.tx_id == 0
399 && header
400 .dynamic_flags()
401 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
402 {
403 Ok(MappingProviderRequest::_UnknownMethod {
404 ordinal: header.ordinal,
405 control_handle: MappingProviderControlHandle {
406 inner: this.inner.clone(),
407 },
408 method_type: fidl::MethodType::OneWay,
409 })
410 }
411 _ if header
412 .dynamic_flags()
413 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
414 {
415 this.inner.send_framework_err(
416 fidl::encoding::FrameworkErr::UnknownMethod,
417 header.tx_id,
418 header.ordinal,
419 header.dynamic_flags(),
420 (bytes, handles),
421 )?;
422 Ok(MappingProviderRequest::_UnknownMethod {
423 ordinal: header.ordinal,
424 control_handle: MappingProviderControlHandle {
425 inner: this.inner.clone(),
426 },
427 method_type: fidl::MethodType::TwoWay,
428 })
429 }
430 _ => Err(fidl::Error::UnknownOrdinal {
431 ordinal: header.ordinal,
432 protocol_name:
433 <MappingProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
434 }),
435 }))
436 },
437 )
438 }
439}
440
441#[derive(Debug)]
442pub enum MappingProviderRequest {
443 OpenSession {
445 session: fidl::endpoints::ServerEnd<MappingSessionMarker>,
446 responder: MappingProviderOpenSessionResponder,
447 },
448 #[non_exhaustive]
450 _UnknownMethod {
451 ordinal: u64,
453 control_handle: MappingProviderControlHandle,
454 method_type: fidl::MethodType,
455 },
456}
457
458impl MappingProviderRequest {
459 #[allow(irrefutable_let_patterns)]
460 pub fn into_open_session(
461 self,
462 ) -> Option<(
463 fidl::endpoints::ServerEnd<MappingSessionMarker>,
464 MappingProviderOpenSessionResponder,
465 )> {
466 if let MappingProviderRequest::OpenSession { session, responder } = self {
467 Some((session, responder))
468 } else {
469 None
470 }
471 }
472
473 pub fn method_name(&self) -> &'static str {
475 match *self {
476 MappingProviderRequest::OpenSession { .. } => "open_session",
477 MappingProviderRequest::_UnknownMethod {
478 method_type: fidl::MethodType::OneWay,
479 ..
480 } => "unknown one-way method",
481 MappingProviderRequest::_UnknownMethod {
482 method_type: fidl::MethodType::TwoWay,
483 ..
484 } => "unknown two-way method",
485 }
486 }
487}
488
489#[derive(Debug, Clone)]
490pub struct MappingProviderControlHandle {
491 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
492}
493
494impl MappingProviderControlHandle {
495 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
496 self.inner.shutdown_with_epitaph(status.into())
497 }
498}
499
500impl fidl::endpoints::ControlHandle for MappingProviderControlHandle {
501 fn shutdown(&self) {
502 self.inner.shutdown()
503 }
504
505 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
506 self.inner.shutdown_with_epitaph(status)
507 }
508
509 fn is_closed(&self) -> bool {
510 self.inner.channel().is_closed()
511 }
512 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
513 self.inner.channel().on_closed()
514 }
515
516 #[cfg(target_os = "fuchsia")]
517 fn signal_peer(
518 &self,
519 clear_mask: zx::Signals,
520 set_mask: zx::Signals,
521 ) -> Result<(), zx_status::Status> {
522 use fidl::Peered;
523 self.inner.channel().signal_peer(clear_mask, set_mask)
524 }
525}
526
527impl MappingProviderControlHandle {}
528
529#[must_use = "FIDL methods require a response to be sent"]
530#[derive(Debug)]
531pub struct MappingProviderOpenSessionResponder {
532 control_handle: std::mem::ManuallyDrop<MappingProviderControlHandle>,
533 tx_id: u32,
534}
535
536impl std::ops::Drop for MappingProviderOpenSessionResponder {
540 fn drop(&mut self) {
541 self.control_handle.shutdown();
542 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
544 }
545}
546
547impl fidl::endpoints::Responder for MappingProviderOpenSessionResponder {
548 type ControlHandle = MappingProviderControlHandle;
549
550 fn control_handle(&self) -> &MappingProviderControlHandle {
551 &self.control_handle
552 }
553
554 fn drop_without_shutdown(mut self) {
555 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
557 std::mem::forget(self);
559 }
560}
561
562impl MappingProviderOpenSessionResponder {
563 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
567 let _result = self.send_raw(result);
568 if _result.is_err() {
569 self.control_handle.shutdown();
570 }
571 self.drop_without_shutdown();
572 _result
573 }
574
575 pub fn send_no_shutdown_on_err(
577 self,
578 mut result: Result<fidl::Vmo, i32>,
579 ) -> Result<(), fidl::Error> {
580 let _result = self.send_raw(result);
581 self.drop_without_shutdown();
582 _result
583 }
584
585 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
586 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
587 MappingProviderOpenSessionResponse,
588 i32,
589 >>(
590 fidl::encoding::FlexibleResult::new(result.map(|mapping_vmo| (mapping_vmo,))),
591 self.tx_id,
592 0x392ee248d504919a,
593 fidl::encoding::DynamicFlags::FLEXIBLE,
594 )
595 }
596}
597
598#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
599pub struct MappingSessionMarker;
600
601impl fidl::endpoints::ProtocolMarker for MappingSessionMarker {
602 type Proxy = MappingSessionProxy;
603 type RequestStream = MappingSessionRequestStream;
604 #[cfg(target_os = "fuchsia")]
605 type SynchronousProxy = MappingSessionSynchronousProxy;
606
607 const DEBUG_NAME: &'static str = "(anonymous) MappingSession";
608}
609pub type MappingSessionOpenResult = Result<u64, i32>;
610pub type MappingSessionCloseResult = Result<(), i32>;
611pub type MappingSessionGetProfileResult = Result<fidl::Vmo, i32>;
612pub type MappingSessionWriteProfileResult = Result<(), i32>;
613
614pub trait MappingSessionProxyInterface: Send + Sync {
615 type OpenResponseFut: std::future::Future<Output = Result<MappingSessionOpenResult, fidl::Error>>
616 + Send;
617 fn r#open(&self, key: u64, identifier: &[u8]) -> Self::OpenResponseFut;
618 type CloseResponseFut: std::future::Future<Output = Result<MappingSessionCloseResult, fidl::Error>>
619 + Send;
620 fn r#close(&self, key: u64) -> Self::CloseResponseFut;
621 type GetProfileResponseFut: std::future::Future<Output = Result<MappingSessionGetProfileResult, fidl::Error>>
622 + Send;
623 fn r#get_profile(&self, name: &str) -> Self::GetProfileResponseFut;
624 type WriteProfileResponseFut: std::future::Future<Output = Result<MappingSessionWriteProfileResult, fidl::Error>>
625 + Send;
626 fn r#write_profile(&self, name: &str, profile_vmo: fidl::Vmo) -> Self::WriteProfileResponseFut;
627}
628#[derive(Debug)]
629#[cfg(target_os = "fuchsia")]
630pub struct MappingSessionSynchronousProxy {
631 client: fidl::client::sync::Client,
632}
633
634#[cfg(target_os = "fuchsia")]
635impl fidl::endpoints::SynchronousProxy for MappingSessionSynchronousProxy {
636 type Proxy = MappingSessionProxy;
637 type Protocol = MappingSessionMarker;
638
639 fn from_channel(inner: fidl::Channel) -> Self {
640 Self::new(inner)
641 }
642
643 fn into_channel(self) -> fidl::Channel {
644 self.client.into_channel()
645 }
646
647 fn as_channel(&self) -> &fidl::Channel {
648 self.client.as_channel()
649 }
650}
651
652#[cfg(target_os = "fuchsia")]
653impl MappingSessionSynchronousProxy {
654 pub fn new(channel: fidl::Channel) -> Self {
655 Self { client: fidl::client::sync::Client::new(channel) }
656 }
657
658 pub fn into_channel(self) -> fidl::Channel {
659 self.client.into_channel()
660 }
661
662 pub fn wait_for_event(
665 &self,
666 deadline: zx::MonotonicInstant,
667 ) -> Result<MappingSessionEvent, fidl::Error> {
668 MappingSessionEvent::decode(self.client.wait_for_event::<MappingSessionMarker>(deadline)?)
669 }
670
671 pub fn r#open(
676 &self,
677 mut key: u64,
678 mut identifier: &[u8],
679 ___deadline: zx::MonotonicInstant,
680 ) -> Result<MappingSessionOpenResult, fidl::Error> {
681 let _response = self.client.send_query::<
682 MappingSessionOpenRequest,
683 fidl::encoding::FlexibleResultType<MappingSessionOpenResponse, i32>,
684 MappingSessionMarker,
685 >(
686 (key, identifier,),
687 0x1b3f5b2b1e68472b,
688 fidl::encoding::DynamicFlags::FLEXIBLE,
689 ___deadline,
690 )?
691 .into_result::<MappingSessionMarker>("open")?;
692 Ok(_response.map(|x| x.size))
693 }
694
695 pub fn r#close(
697 &self,
698 mut key: u64,
699 ___deadline: zx::MonotonicInstant,
700 ) -> Result<MappingSessionCloseResult, fidl::Error> {
701 let _response = self.client.send_query::<
702 MappingSessionCloseRequest,
703 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
704 MappingSessionMarker,
705 >(
706 (key,),
707 0x34708ae0c1044d20,
708 fidl::encoding::DynamicFlags::FLEXIBLE,
709 ___deadline,
710 )?
711 .into_result::<MappingSessionMarker>("close")?;
712 Ok(_response.map(|x| x))
713 }
714
715 pub fn r#get_profile(
718 &self,
719 mut name: &str,
720 ___deadline: zx::MonotonicInstant,
721 ) -> Result<MappingSessionGetProfileResult, fidl::Error> {
722 let _response = self.client.send_query::<
723 MappingSessionGetProfileRequest,
724 fidl::encoding::FlexibleResultType<MappingSessionGetProfileResponse, i32>,
725 MappingSessionMarker,
726 >(
727 (name,),
728 0x282c8645f3a3f77f,
729 fidl::encoding::DynamicFlags::FLEXIBLE,
730 ___deadline,
731 )?
732 .into_result::<MappingSessionMarker>("get_profile")?;
733 Ok(_response.map(|x| x.profile_vmo))
734 }
735
736 pub fn r#write_profile(
738 &self,
739 mut name: &str,
740 mut profile_vmo: fidl::Vmo,
741 ___deadline: zx::MonotonicInstant,
742 ) -> Result<MappingSessionWriteProfileResult, fidl::Error> {
743 let _response = self.client.send_query::<
744 MappingSessionWriteProfileRequest,
745 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
746 MappingSessionMarker,
747 >(
748 (name, profile_vmo,),
749 0x1ee027e4661e86de,
750 fidl::encoding::DynamicFlags::FLEXIBLE,
751 ___deadline,
752 )?
753 .into_result::<MappingSessionMarker>("write_profile")?;
754 Ok(_response.map(|x| x))
755 }
756}
757
758#[cfg(target_os = "fuchsia")]
759impl From<MappingSessionSynchronousProxy> for zx::NullableHandle {
760 fn from(value: MappingSessionSynchronousProxy) -> Self {
761 value.into_channel().into()
762 }
763}
764
765#[cfg(target_os = "fuchsia")]
766impl From<fidl::Channel> for MappingSessionSynchronousProxy {
767 fn from(value: fidl::Channel) -> Self {
768 Self::new(value)
769 }
770}
771
772#[cfg(target_os = "fuchsia")]
773impl fidl::endpoints::FromClient for MappingSessionSynchronousProxy {
774 type Protocol = MappingSessionMarker;
775
776 fn from_client(value: fidl::endpoints::ClientEnd<MappingSessionMarker>) -> Self {
777 Self::new(value.into_channel())
778 }
779}
780
781#[derive(Debug, Clone)]
782pub struct MappingSessionProxy {
783 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
784}
785
786impl fidl::endpoints::Proxy for MappingSessionProxy {
787 type Protocol = MappingSessionMarker;
788
789 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
790 Self::new(inner)
791 }
792
793 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
794 self.client.into_channel().map_err(|client| Self { client })
795 }
796
797 fn as_channel(&self) -> &::fidl::AsyncChannel {
798 self.client.as_channel()
799 }
800}
801
802impl MappingSessionProxy {
803 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
805 let protocol_name = <MappingSessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
806 Self { client: fidl::client::Client::new(channel, protocol_name) }
807 }
808
809 pub fn take_event_stream(&self) -> MappingSessionEventStream {
815 MappingSessionEventStream { event_receiver: self.client.take_event_receiver() }
816 }
817
818 pub fn r#open(
823 &self,
824 mut key: u64,
825 mut identifier: &[u8],
826 ) -> fidl::client::QueryResponseFut<
827 MappingSessionOpenResult,
828 fidl::encoding::DefaultFuchsiaResourceDialect,
829 > {
830 MappingSessionProxyInterface::r#open(self, key, identifier)
831 }
832
833 pub fn r#close(
835 &self,
836 mut key: u64,
837 ) -> fidl::client::QueryResponseFut<
838 MappingSessionCloseResult,
839 fidl::encoding::DefaultFuchsiaResourceDialect,
840 > {
841 MappingSessionProxyInterface::r#close(self, key)
842 }
843
844 pub fn r#get_profile(
847 &self,
848 mut name: &str,
849 ) -> fidl::client::QueryResponseFut<
850 MappingSessionGetProfileResult,
851 fidl::encoding::DefaultFuchsiaResourceDialect,
852 > {
853 MappingSessionProxyInterface::r#get_profile(self, name)
854 }
855
856 pub fn r#write_profile(
858 &self,
859 mut name: &str,
860 mut profile_vmo: fidl::Vmo,
861 ) -> fidl::client::QueryResponseFut<
862 MappingSessionWriteProfileResult,
863 fidl::encoding::DefaultFuchsiaResourceDialect,
864 > {
865 MappingSessionProxyInterface::r#write_profile(self, name, profile_vmo)
866 }
867}
868
869impl MappingSessionProxyInterface for MappingSessionProxy {
870 type OpenResponseFut = fidl::client::QueryResponseFut<
871 MappingSessionOpenResult,
872 fidl::encoding::DefaultFuchsiaResourceDialect,
873 >;
874 fn r#open(&self, mut key: u64, mut identifier: &[u8]) -> Self::OpenResponseFut {
875 fn _decode(
876 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
877 ) -> Result<MappingSessionOpenResult, fidl::Error> {
878 let _response = fidl::client::decode_transaction_body::<
879 fidl::encoding::FlexibleResultType<MappingSessionOpenResponse, i32>,
880 fidl::encoding::DefaultFuchsiaResourceDialect,
881 0x1b3f5b2b1e68472b,
882 >(_buf?)?
883 .into_result::<MappingSessionMarker>("open")?;
884 Ok(_response.map(|x| x.size))
885 }
886 self.client.send_query_and_decode::<MappingSessionOpenRequest, MappingSessionOpenResult>(
887 (key, identifier),
888 0x1b3f5b2b1e68472b,
889 fidl::encoding::DynamicFlags::FLEXIBLE,
890 _decode,
891 )
892 }
893
894 type CloseResponseFut = fidl::client::QueryResponseFut<
895 MappingSessionCloseResult,
896 fidl::encoding::DefaultFuchsiaResourceDialect,
897 >;
898 fn r#close(&self, mut key: u64) -> Self::CloseResponseFut {
899 fn _decode(
900 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
901 ) -> Result<MappingSessionCloseResult, fidl::Error> {
902 let _response = fidl::client::decode_transaction_body::<
903 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
904 fidl::encoding::DefaultFuchsiaResourceDialect,
905 0x34708ae0c1044d20,
906 >(_buf?)?
907 .into_result::<MappingSessionMarker>("close")?;
908 Ok(_response.map(|x| x))
909 }
910 self.client.send_query_and_decode::<MappingSessionCloseRequest, MappingSessionCloseResult>(
911 (key,),
912 0x34708ae0c1044d20,
913 fidl::encoding::DynamicFlags::FLEXIBLE,
914 _decode,
915 )
916 }
917
918 type GetProfileResponseFut = fidl::client::QueryResponseFut<
919 MappingSessionGetProfileResult,
920 fidl::encoding::DefaultFuchsiaResourceDialect,
921 >;
922 fn r#get_profile(&self, mut name: &str) -> Self::GetProfileResponseFut {
923 fn _decode(
924 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
925 ) -> Result<MappingSessionGetProfileResult, fidl::Error> {
926 let _response = fidl::client::decode_transaction_body::<
927 fidl::encoding::FlexibleResultType<MappingSessionGetProfileResponse, i32>,
928 fidl::encoding::DefaultFuchsiaResourceDialect,
929 0x282c8645f3a3f77f,
930 >(_buf?)?
931 .into_result::<MappingSessionMarker>("get_profile")?;
932 Ok(_response.map(|x| x.profile_vmo))
933 }
934 self.client.send_query_and_decode::<
935 MappingSessionGetProfileRequest,
936 MappingSessionGetProfileResult,
937 >(
938 (name,),
939 0x282c8645f3a3f77f,
940 fidl::encoding::DynamicFlags::FLEXIBLE,
941 _decode,
942 )
943 }
944
945 type WriteProfileResponseFut = fidl::client::QueryResponseFut<
946 MappingSessionWriteProfileResult,
947 fidl::encoding::DefaultFuchsiaResourceDialect,
948 >;
949 fn r#write_profile(
950 &self,
951 mut name: &str,
952 mut profile_vmo: fidl::Vmo,
953 ) -> Self::WriteProfileResponseFut {
954 fn _decode(
955 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
956 ) -> Result<MappingSessionWriteProfileResult, fidl::Error> {
957 let _response = fidl::client::decode_transaction_body::<
958 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
959 fidl::encoding::DefaultFuchsiaResourceDialect,
960 0x1ee027e4661e86de,
961 >(_buf?)?
962 .into_result::<MappingSessionMarker>("write_profile")?;
963 Ok(_response.map(|x| x))
964 }
965 self.client.send_query_and_decode::<
966 MappingSessionWriteProfileRequest,
967 MappingSessionWriteProfileResult,
968 >(
969 (name, profile_vmo,),
970 0x1ee027e4661e86de,
971 fidl::encoding::DynamicFlags::FLEXIBLE,
972 _decode,
973 )
974 }
975}
976
977pub struct MappingSessionEventStream {
978 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
979}
980
981impl std::marker::Unpin for MappingSessionEventStream {}
982
983impl futures::stream::FusedStream for MappingSessionEventStream {
984 fn is_terminated(&self) -> bool {
985 self.event_receiver.is_terminated()
986 }
987}
988
989impl futures::Stream for MappingSessionEventStream {
990 type Item = Result<MappingSessionEvent, fidl::Error>;
991
992 fn poll_next(
993 mut self: std::pin::Pin<&mut Self>,
994 cx: &mut std::task::Context<'_>,
995 ) -> std::task::Poll<Option<Self::Item>> {
996 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
997 &mut self.event_receiver,
998 cx
999 )?) {
1000 Some(buf) => std::task::Poll::Ready(Some(MappingSessionEvent::decode(buf))),
1001 None => std::task::Poll::Ready(None),
1002 }
1003 }
1004}
1005
1006#[derive(Debug)]
1007pub enum MappingSessionEvent {
1008 #[non_exhaustive]
1009 _UnknownEvent {
1010 ordinal: u64,
1012 },
1013}
1014
1015impl MappingSessionEvent {
1016 fn decode(
1018 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1019 ) -> Result<MappingSessionEvent, fidl::Error> {
1020 let (bytes, _handles) = buf.split_mut();
1021 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1022 debug_assert_eq!(tx_header.tx_id, 0);
1023 match tx_header.ordinal {
1024 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1025 Ok(MappingSessionEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1026 }
1027 _ => Err(fidl::Error::UnknownOrdinal {
1028 ordinal: tx_header.ordinal,
1029 protocol_name:
1030 <MappingSessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1031 }),
1032 }
1033 }
1034}
1035
1036pub struct MappingSessionRequestStream {
1038 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1039 is_terminated: bool,
1040}
1041
1042impl std::marker::Unpin for MappingSessionRequestStream {}
1043
1044impl futures::stream::FusedStream for MappingSessionRequestStream {
1045 fn is_terminated(&self) -> bool {
1046 self.is_terminated
1047 }
1048}
1049
1050impl fidl::endpoints::RequestStream for MappingSessionRequestStream {
1051 type Protocol = MappingSessionMarker;
1052 type ControlHandle = MappingSessionControlHandle;
1053
1054 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1055 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1056 }
1057
1058 fn control_handle(&self) -> Self::ControlHandle {
1059 MappingSessionControlHandle { inner: self.inner.clone() }
1060 }
1061
1062 fn into_inner(
1063 self,
1064 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1065 {
1066 (self.inner, self.is_terminated)
1067 }
1068
1069 fn from_inner(
1070 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1071 is_terminated: bool,
1072 ) -> Self {
1073 Self { inner, is_terminated }
1074 }
1075}
1076
1077impl futures::Stream for MappingSessionRequestStream {
1078 type Item = Result<MappingSessionRequest, fidl::Error>;
1079
1080 fn poll_next(
1081 mut self: std::pin::Pin<&mut Self>,
1082 cx: &mut std::task::Context<'_>,
1083 ) -> std::task::Poll<Option<Self::Item>> {
1084 let this = &mut *self;
1085 if this.inner.check_shutdown(cx) {
1086 this.is_terminated = true;
1087 return std::task::Poll::Ready(None);
1088 }
1089 if this.is_terminated {
1090 panic!("polled MappingSessionRequestStream after completion");
1091 }
1092 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1093 |bytes, handles| {
1094 match this.inner.channel().read_etc(cx, bytes, handles) {
1095 std::task::Poll::Ready(Ok(())) => {}
1096 std::task::Poll::Pending => return std::task::Poll::Pending,
1097 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1098 this.is_terminated = true;
1099 return std::task::Poll::Ready(None);
1100 }
1101 std::task::Poll::Ready(Err(e)) => {
1102 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1103 e.into(),
1104 ))));
1105 }
1106 }
1107
1108 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1110
1111 std::task::Poll::Ready(Some(match header.ordinal {
1112 0x1b3f5b2b1e68472b => {
1113 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1114 let mut req = fidl::new_empty!(
1115 MappingSessionOpenRequest,
1116 fidl::encoding::DefaultFuchsiaResourceDialect
1117 );
1118 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MappingSessionOpenRequest>(&header, _body_bytes, handles, &mut req)?;
1119 let control_handle =
1120 MappingSessionControlHandle { inner: this.inner.clone() };
1121 Ok(MappingSessionRequest::Open {
1122 key: req.key,
1123 identifier: req.identifier,
1124
1125 responder: MappingSessionOpenResponder {
1126 control_handle: std::mem::ManuallyDrop::new(control_handle),
1127 tx_id: header.tx_id,
1128 },
1129 })
1130 }
1131 0x34708ae0c1044d20 => {
1132 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1133 let mut req = fidl::new_empty!(
1134 MappingSessionCloseRequest,
1135 fidl::encoding::DefaultFuchsiaResourceDialect
1136 );
1137 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MappingSessionCloseRequest>(&header, _body_bytes, handles, &mut req)?;
1138 let control_handle =
1139 MappingSessionControlHandle { inner: this.inner.clone() };
1140 Ok(MappingSessionRequest::Close {
1141 key: req.key,
1142
1143 responder: MappingSessionCloseResponder {
1144 control_handle: std::mem::ManuallyDrop::new(control_handle),
1145 tx_id: header.tx_id,
1146 },
1147 })
1148 }
1149 0x282c8645f3a3f77f => {
1150 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1151 let mut req = fidl::new_empty!(
1152 MappingSessionGetProfileRequest,
1153 fidl::encoding::DefaultFuchsiaResourceDialect
1154 );
1155 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MappingSessionGetProfileRequest>(&header, _body_bytes, handles, &mut req)?;
1156 let control_handle =
1157 MappingSessionControlHandle { inner: this.inner.clone() };
1158 Ok(MappingSessionRequest::GetProfile {
1159 name: req.name,
1160
1161 responder: MappingSessionGetProfileResponder {
1162 control_handle: std::mem::ManuallyDrop::new(control_handle),
1163 tx_id: header.tx_id,
1164 },
1165 })
1166 }
1167 0x1ee027e4661e86de => {
1168 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1169 let mut req = fidl::new_empty!(
1170 MappingSessionWriteProfileRequest,
1171 fidl::encoding::DefaultFuchsiaResourceDialect
1172 );
1173 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MappingSessionWriteProfileRequest>(&header, _body_bytes, handles, &mut req)?;
1174 let control_handle =
1175 MappingSessionControlHandle { inner: this.inner.clone() };
1176 Ok(MappingSessionRequest::WriteProfile {
1177 name: req.name,
1178 profile_vmo: req.profile_vmo,
1179
1180 responder: MappingSessionWriteProfileResponder {
1181 control_handle: std::mem::ManuallyDrop::new(control_handle),
1182 tx_id: header.tx_id,
1183 },
1184 })
1185 }
1186 _ if header.tx_id == 0
1187 && header
1188 .dynamic_flags()
1189 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1190 {
1191 Ok(MappingSessionRequest::_UnknownMethod {
1192 ordinal: header.ordinal,
1193 control_handle: MappingSessionControlHandle {
1194 inner: this.inner.clone(),
1195 },
1196 method_type: fidl::MethodType::OneWay,
1197 })
1198 }
1199 _ if header
1200 .dynamic_flags()
1201 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1202 {
1203 this.inner.send_framework_err(
1204 fidl::encoding::FrameworkErr::UnknownMethod,
1205 header.tx_id,
1206 header.ordinal,
1207 header.dynamic_flags(),
1208 (bytes, handles),
1209 )?;
1210 Ok(MappingSessionRequest::_UnknownMethod {
1211 ordinal: header.ordinal,
1212 control_handle: MappingSessionControlHandle {
1213 inner: this.inner.clone(),
1214 },
1215 method_type: fidl::MethodType::TwoWay,
1216 })
1217 }
1218 _ => Err(fidl::Error::UnknownOrdinal {
1219 ordinal: header.ordinal,
1220 protocol_name:
1221 <MappingSessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1222 }),
1223 }))
1224 },
1225 )
1226 }
1227}
1228
1229#[derive(Debug)]
1230pub enum MappingSessionRequest {
1231 Open { key: u64, identifier: Vec<u8>, responder: MappingSessionOpenResponder },
1236 Close { key: u64, responder: MappingSessionCloseResponder },
1238 GetProfile { name: String, responder: MappingSessionGetProfileResponder },
1241 WriteProfile {
1243 name: String,
1244 profile_vmo: fidl::Vmo,
1245 responder: MappingSessionWriteProfileResponder,
1246 },
1247 #[non_exhaustive]
1249 _UnknownMethod {
1250 ordinal: u64,
1252 control_handle: MappingSessionControlHandle,
1253 method_type: fidl::MethodType,
1254 },
1255}
1256
1257impl MappingSessionRequest {
1258 #[allow(irrefutable_let_patterns)]
1259 pub fn into_open(self) -> Option<(u64, Vec<u8>, MappingSessionOpenResponder)> {
1260 if let MappingSessionRequest::Open { key, identifier, responder } = self {
1261 Some((key, identifier, responder))
1262 } else {
1263 None
1264 }
1265 }
1266
1267 #[allow(irrefutable_let_patterns)]
1268 pub fn into_close(self) -> Option<(u64, MappingSessionCloseResponder)> {
1269 if let MappingSessionRequest::Close { key, responder } = self {
1270 Some((key, responder))
1271 } else {
1272 None
1273 }
1274 }
1275
1276 #[allow(irrefutable_let_patterns)]
1277 pub fn into_get_profile(self) -> Option<(String, MappingSessionGetProfileResponder)> {
1278 if let MappingSessionRequest::GetProfile { name, responder } = self {
1279 Some((name, responder))
1280 } else {
1281 None
1282 }
1283 }
1284
1285 #[allow(irrefutable_let_patterns)]
1286 pub fn into_write_profile(
1287 self,
1288 ) -> Option<(String, fidl::Vmo, MappingSessionWriteProfileResponder)> {
1289 if let MappingSessionRequest::WriteProfile { name, profile_vmo, responder } = self {
1290 Some((name, profile_vmo, responder))
1291 } else {
1292 None
1293 }
1294 }
1295
1296 pub fn method_name(&self) -> &'static str {
1298 match *self {
1299 MappingSessionRequest::Open { .. } => "open",
1300 MappingSessionRequest::Close { .. } => "close",
1301 MappingSessionRequest::GetProfile { .. } => "get_profile",
1302 MappingSessionRequest::WriteProfile { .. } => "write_profile",
1303 MappingSessionRequest::_UnknownMethod {
1304 method_type: fidl::MethodType::OneWay, ..
1305 } => "unknown one-way method",
1306 MappingSessionRequest::_UnknownMethod {
1307 method_type: fidl::MethodType::TwoWay, ..
1308 } => "unknown two-way method",
1309 }
1310 }
1311}
1312
1313#[derive(Debug, Clone)]
1314pub struct MappingSessionControlHandle {
1315 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1316}
1317
1318impl MappingSessionControlHandle {
1319 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1320 self.inner.shutdown_with_epitaph(status.into())
1321 }
1322}
1323
1324impl fidl::endpoints::ControlHandle for MappingSessionControlHandle {
1325 fn shutdown(&self) {
1326 self.inner.shutdown()
1327 }
1328
1329 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1330 self.inner.shutdown_with_epitaph(status)
1331 }
1332
1333 fn is_closed(&self) -> bool {
1334 self.inner.channel().is_closed()
1335 }
1336 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1337 self.inner.channel().on_closed()
1338 }
1339
1340 #[cfg(target_os = "fuchsia")]
1341 fn signal_peer(
1342 &self,
1343 clear_mask: zx::Signals,
1344 set_mask: zx::Signals,
1345 ) -> Result<(), zx_status::Status> {
1346 use fidl::Peered;
1347 self.inner.channel().signal_peer(clear_mask, set_mask)
1348 }
1349}
1350
1351impl MappingSessionControlHandle {}
1352
1353#[must_use = "FIDL methods require a response to be sent"]
1354#[derive(Debug)]
1355pub struct MappingSessionOpenResponder {
1356 control_handle: std::mem::ManuallyDrop<MappingSessionControlHandle>,
1357 tx_id: u32,
1358}
1359
1360impl std::ops::Drop for MappingSessionOpenResponder {
1364 fn drop(&mut self) {
1365 self.control_handle.shutdown();
1366 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1368 }
1369}
1370
1371impl fidl::endpoints::Responder for MappingSessionOpenResponder {
1372 type ControlHandle = MappingSessionControlHandle;
1373
1374 fn control_handle(&self) -> &MappingSessionControlHandle {
1375 &self.control_handle
1376 }
1377
1378 fn drop_without_shutdown(mut self) {
1379 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1381 std::mem::forget(self);
1383 }
1384}
1385
1386impl MappingSessionOpenResponder {
1387 pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
1391 let _result = self.send_raw(result);
1392 if _result.is_err() {
1393 self.control_handle.shutdown();
1394 }
1395 self.drop_without_shutdown();
1396 _result
1397 }
1398
1399 pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
1401 let _result = self.send_raw(result);
1402 self.drop_without_shutdown();
1403 _result
1404 }
1405
1406 fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
1407 self.control_handle
1408 .inner
1409 .send::<fidl::encoding::FlexibleResultType<MappingSessionOpenResponse, i32>>(
1410 fidl::encoding::FlexibleResult::new(result.map(|size| (size,))),
1411 self.tx_id,
1412 0x1b3f5b2b1e68472b,
1413 fidl::encoding::DynamicFlags::FLEXIBLE,
1414 )
1415 }
1416}
1417
1418#[must_use = "FIDL methods require a response to be sent"]
1419#[derive(Debug)]
1420pub struct MappingSessionCloseResponder {
1421 control_handle: std::mem::ManuallyDrop<MappingSessionControlHandle>,
1422 tx_id: u32,
1423}
1424
1425impl std::ops::Drop for MappingSessionCloseResponder {
1429 fn drop(&mut self) {
1430 self.control_handle.shutdown();
1431 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1433 }
1434}
1435
1436impl fidl::endpoints::Responder for MappingSessionCloseResponder {
1437 type ControlHandle = MappingSessionControlHandle;
1438
1439 fn control_handle(&self) -> &MappingSessionControlHandle {
1440 &self.control_handle
1441 }
1442
1443 fn drop_without_shutdown(mut self) {
1444 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1446 std::mem::forget(self);
1448 }
1449}
1450
1451impl MappingSessionCloseResponder {
1452 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1456 let _result = self.send_raw(result);
1457 if _result.is_err() {
1458 self.control_handle.shutdown();
1459 }
1460 self.drop_without_shutdown();
1461 _result
1462 }
1463
1464 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1466 let _result = self.send_raw(result);
1467 self.drop_without_shutdown();
1468 _result
1469 }
1470
1471 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1472 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1473 fidl::encoding::EmptyStruct,
1474 i32,
1475 >>(
1476 fidl::encoding::FlexibleResult::new(result),
1477 self.tx_id,
1478 0x34708ae0c1044d20,
1479 fidl::encoding::DynamicFlags::FLEXIBLE,
1480 )
1481 }
1482}
1483
1484#[must_use = "FIDL methods require a response to be sent"]
1485#[derive(Debug)]
1486pub struct MappingSessionGetProfileResponder {
1487 control_handle: std::mem::ManuallyDrop<MappingSessionControlHandle>,
1488 tx_id: u32,
1489}
1490
1491impl std::ops::Drop for MappingSessionGetProfileResponder {
1495 fn drop(&mut self) {
1496 self.control_handle.shutdown();
1497 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1499 }
1500}
1501
1502impl fidl::endpoints::Responder for MappingSessionGetProfileResponder {
1503 type ControlHandle = MappingSessionControlHandle;
1504
1505 fn control_handle(&self) -> &MappingSessionControlHandle {
1506 &self.control_handle
1507 }
1508
1509 fn drop_without_shutdown(mut self) {
1510 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1512 std::mem::forget(self);
1514 }
1515}
1516
1517impl MappingSessionGetProfileResponder {
1518 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1522 let _result = self.send_raw(result);
1523 if _result.is_err() {
1524 self.control_handle.shutdown();
1525 }
1526 self.drop_without_shutdown();
1527 _result
1528 }
1529
1530 pub fn send_no_shutdown_on_err(
1532 self,
1533 mut result: Result<fidl::Vmo, i32>,
1534 ) -> Result<(), fidl::Error> {
1535 let _result = self.send_raw(result);
1536 self.drop_without_shutdown();
1537 _result
1538 }
1539
1540 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1541 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1542 MappingSessionGetProfileResponse,
1543 i32,
1544 >>(
1545 fidl::encoding::FlexibleResult::new(result.map(|profile_vmo| (profile_vmo,))),
1546 self.tx_id,
1547 0x282c8645f3a3f77f,
1548 fidl::encoding::DynamicFlags::FLEXIBLE,
1549 )
1550 }
1551}
1552
1553#[must_use = "FIDL methods require a response to be sent"]
1554#[derive(Debug)]
1555pub struct MappingSessionWriteProfileResponder {
1556 control_handle: std::mem::ManuallyDrop<MappingSessionControlHandle>,
1557 tx_id: u32,
1558}
1559
1560impl std::ops::Drop for MappingSessionWriteProfileResponder {
1564 fn drop(&mut self) {
1565 self.control_handle.shutdown();
1566 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1568 }
1569}
1570
1571impl fidl::endpoints::Responder for MappingSessionWriteProfileResponder {
1572 type ControlHandle = MappingSessionControlHandle;
1573
1574 fn control_handle(&self) -> &MappingSessionControlHandle {
1575 &self.control_handle
1576 }
1577
1578 fn drop_without_shutdown(mut self) {
1579 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1581 std::mem::forget(self);
1583 }
1584}
1585
1586impl MappingSessionWriteProfileResponder {
1587 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1591 let _result = self.send_raw(result);
1592 if _result.is_err() {
1593 self.control_handle.shutdown();
1594 }
1595 self.drop_without_shutdown();
1596 _result
1597 }
1598
1599 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1601 let _result = self.send_raw(result);
1602 self.drop_without_shutdown();
1603 _result
1604 }
1605
1606 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1607 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1608 fidl::encoding::EmptyStruct,
1609 i32,
1610 >>(
1611 fidl::encoding::FlexibleResult::new(result),
1612 self.tx_id,
1613 0x1ee027e4661e86de,
1614 fidl::encoding::DynamicFlags::FLEXIBLE,
1615 )
1616 }
1617}
1618
1619mod internal {
1620 use super::*;
1621
1622 impl fidl::encoding::ResourceTypeMarker for MappingProviderOpenSessionRequest {
1623 type Borrowed<'a> = &'a mut Self;
1624 fn take_or_borrow<'a>(
1625 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1626 ) -> Self::Borrowed<'a> {
1627 value
1628 }
1629 }
1630
1631 unsafe impl fidl::encoding::TypeMarker for MappingProviderOpenSessionRequest {
1632 type Owned = Self;
1633
1634 #[inline(always)]
1635 fn inline_align(_context: fidl::encoding::Context) -> usize {
1636 4
1637 }
1638
1639 #[inline(always)]
1640 fn inline_size(_context: fidl::encoding::Context) -> usize {
1641 4
1642 }
1643 }
1644
1645 unsafe impl
1646 fidl::encoding::Encode<
1647 MappingProviderOpenSessionRequest,
1648 fidl::encoding::DefaultFuchsiaResourceDialect,
1649 > for &mut MappingProviderOpenSessionRequest
1650 {
1651 #[inline]
1652 unsafe fn encode(
1653 self,
1654 encoder: &mut fidl::encoding::Encoder<
1655 '_,
1656 fidl::encoding::DefaultFuchsiaResourceDialect,
1657 >,
1658 offset: usize,
1659 _depth: fidl::encoding::Depth,
1660 ) -> fidl::Result<()> {
1661 encoder.debug_check_bounds::<MappingProviderOpenSessionRequest>(offset);
1662 fidl::encoding::Encode::<MappingProviderOpenSessionRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1664 (
1665 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MappingSessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
1666 ),
1667 encoder, offset, _depth
1668 )
1669 }
1670 }
1671 unsafe impl<
1672 T0: fidl::encoding::Encode<
1673 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MappingSessionMarker>>,
1674 fidl::encoding::DefaultFuchsiaResourceDialect,
1675 >,
1676 >
1677 fidl::encoding::Encode<
1678 MappingProviderOpenSessionRequest,
1679 fidl::encoding::DefaultFuchsiaResourceDialect,
1680 > for (T0,)
1681 {
1682 #[inline]
1683 unsafe fn encode(
1684 self,
1685 encoder: &mut fidl::encoding::Encoder<
1686 '_,
1687 fidl::encoding::DefaultFuchsiaResourceDialect,
1688 >,
1689 offset: usize,
1690 depth: fidl::encoding::Depth,
1691 ) -> fidl::Result<()> {
1692 encoder.debug_check_bounds::<MappingProviderOpenSessionRequest>(offset);
1693 self.0.encode(encoder, offset + 0, depth)?;
1697 Ok(())
1698 }
1699 }
1700
1701 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1702 for MappingProviderOpenSessionRequest
1703 {
1704 #[inline(always)]
1705 fn new_empty() -> Self {
1706 Self {
1707 session: fidl::new_empty!(
1708 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MappingSessionMarker>>,
1709 fidl::encoding::DefaultFuchsiaResourceDialect
1710 ),
1711 }
1712 }
1713
1714 #[inline]
1715 unsafe fn decode(
1716 &mut self,
1717 decoder: &mut fidl::encoding::Decoder<
1718 '_,
1719 fidl::encoding::DefaultFuchsiaResourceDialect,
1720 >,
1721 offset: usize,
1722 _depth: fidl::encoding::Depth,
1723 ) -> fidl::Result<()> {
1724 decoder.debug_check_bounds::<Self>(offset);
1725 fidl::decode!(
1727 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MappingSessionMarker>>,
1728 fidl::encoding::DefaultFuchsiaResourceDialect,
1729 &mut self.session,
1730 decoder,
1731 offset + 0,
1732 _depth
1733 )?;
1734 Ok(())
1735 }
1736 }
1737
1738 impl fidl::encoding::ResourceTypeMarker for MappingProviderOpenSessionResponse {
1739 type Borrowed<'a> = &'a mut Self;
1740 fn take_or_borrow<'a>(
1741 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1742 ) -> Self::Borrowed<'a> {
1743 value
1744 }
1745 }
1746
1747 unsafe impl fidl::encoding::TypeMarker for MappingProviderOpenSessionResponse {
1748 type Owned = Self;
1749
1750 #[inline(always)]
1751 fn inline_align(_context: fidl::encoding::Context) -> usize {
1752 4
1753 }
1754
1755 #[inline(always)]
1756 fn inline_size(_context: fidl::encoding::Context) -> usize {
1757 4
1758 }
1759 }
1760
1761 unsafe impl
1762 fidl::encoding::Encode<
1763 MappingProviderOpenSessionResponse,
1764 fidl::encoding::DefaultFuchsiaResourceDialect,
1765 > for &mut MappingProviderOpenSessionResponse
1766 {
1767 #[inline]
1768 unsafe fn encode(
1769 self,
1770 encoder: &mut fidl::encoding::Encoder<
1771 '_,
1772 fidl::encoding::DefaultFuchsiaResourceDialect,
1773 >,
1774 offset: usize,
1775 _depth: fidl::encoding::Depth,
1776 ) -> fidl::Result<()> {
1777 encoder.debug_check_bounds::<MappingProviderOpenSessionResponse>(offset);
1778 fidl::encoding::Encode::<
1780 MappingProviderOpenSessionResponse,
1781 fidl::encoding::DefaultFuchsiaResourceDialect,
1782 >::encode(
1783 (<fidl::encoding::HandleType<
1784 fidl::Vmo,
1785 { fidl::ObjectType::VMO.into_raw() },
1786 2147483648,
1787 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1788 &mut self.mapping_vmo
1789 ),),
1790 encoder,
1791 offset,
1792 _depth,
1793 )
1794 }
1795 }
1796 unsafe impl<
1797 T0: fidl::encoding::Encode<
1798 fidl::encoding::HandleType<
1799 fidl::Vmo,
1800 { fidl::ObjectType::VMO.into_raw() },
1801 2147483648,
1802 >,
1803 fidl::encoding::DefaultFuchsiaResourceDialect,
1804 >,
1805 >
1806 fidl::encoding::Encode<
1807 MappingProviderOpenSessionResponse,
1808 fidl::encoding::DefaultFuchsiaResourceDialect,
1809 > for (T0,)
1810 {
1811 #[inline]
1812 unsafe fn encode(
1813 self,
1814 encoder: &mut fidl::encoding::Encoder<
1815 '_,
1816 fidl::encoding::DefaultFuchsiaResourceDialect,
1817 >,
1818 offset: usize,
1819 depth: fidl::encoding::Depth,
1820 ) -> fidl::Result<()> {
1821 encoder.debug_check_bounds::<MappingProviderOpenSessionResponse>(offset);
1822 self.0.encode(encoder, offset + 0, depth)?;
1826 Ok(())
1827 }
1828 }
1829
1830 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1831 for MappingProviderOpenSessionResponse
1832 {
1833 #[inline(always)]
1834 fn new_empty() -> Self {
1835 Self {
1836 mapping_vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1837 }
1838 }
1839
1840 #[inline]
1841 unsafe fn decode(
1842 &mut self,
1843 decoder: &mut fidl::encoding::Decoder<
1844 '_,
1845 fidl::encoding::DefaultFuchsiaResourceDialect,
1846 >,
1847 offset: usize,
1848 _depth: fidl::encoding::Depth,
1849 ) -> fidl::Result<()> {
1850 decoder.debug_check_bounds::<Self>(offset);
1851 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.mapping_vmo, decoder, offset + 0, _depth)?;
1853 Ok(())
1854 }
1855 }
1856
1857 impl fidl::encoding::ResourceTypeMarker for MappingSessionWriteProfileRequest {
1858 type Borrowed<'a> = &'a mut Self;
1859 fn take_or_borrow<'a>(
1860 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1861 ) -> Self::Borrowed<'a> {
1862 value
1863 }
1864 }
1865
1866 unsafe impl fidl::encoding::TypeMarker for MappingSessionWriteProfileRequest {
1867 type Owned = Self;
1868
1869 #[inline(always)]
1870 fn inline_align(_context: fidl::encoding::Context) -> usize {
1871 8
1872 }
1873
1874 #[inline(always)]
1875 fn inline_size(_context: fidl::encoding::Context) -> usize {
1876 24
1877 }
1878 }
1879
1880 unsafe impl
1881 fidl::encoding::Encode<
1882 MappingSessionWriteProfileRequest,
1883 fidl::encoding::DefaultFuchsiaResourceDialect,
1884 > for &mut MappingSessionWriteProfileRequest
1885 {
1886 #[inline]
1887 unsafe fn encode(
1888 self,
1889 encoder: &mut fidl::encoding::Encoder<
1890 '_,
1891 fidl::encoding::DefaultFuchsiaResourceDialect,
1892 >,
1893 offset: usize,
1894 _depth: fidl::encoding::Depth,
1895 ) -> fidl::Result<()> {
1896 encoder.debug_check_bounds::<MappingSessionWriteProfileRequest>(offset);
1897 fidl::encoding::Encode::<
1899 MappingSessionWriteProfileRequest,
1900 fidl::encoding::DefaultFuchsiaResourceDialect,
1901 >::encode(
1902 (
1903 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1904 &self.name,
1905 ),
1906 <fidl::encoding::HandleType<
1907 fidl::Vmo,
1908 { fidl::ObjectType::VMO.into_raw() },
1909 2147483648,
1910 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1911 &mut self.profile_vmo
1912 ),
1913 ),
1914 encoder,
1915 offset,
1916 _depth,
1917 )
1918 }
1919 }
1920 unsafe impl<
1921 T0: fidl::encoding::Encode<
1922 fidl::encoding::UnboundedString,
1923 fidl::encoding::DefaultFuchsiaResourceDialect,
1924 >,
1925 T1: fidl::encoding::Encode<
1926 fidl::encoding::HandleType<
1927 fidl::Vmo,
1928 { fidl::ObjectType::VMO.into_raw() },
1929 2147483648,
1930 >,
1931 fidl::encoding::DefaultFuchsiaResourceDialect,
1932 >,
1933 >
1934 fidl::encoding::Encode<
1935 MappingSessionWriteProfileRequest,
1936 fidl::encoding::DefaultFuchsiaResourceDialect,
1937 > for (T0, T1)
1938 {
1939 #[inline]
1940 unsafe fn encode(
1941 self,
1942 encoder: &mut fidl::encoding::Encoder<
1943 '_,
1944 fidl::encoding::DefaultFuchsiaResourceDialect,
1945 >,
1946 offset: usize,
1947 depth: fidl::encoding::Depth,
1948 ) -> fidl::Result<()> {
1949 encoder.debug_check_bounds::<MappingSessionWriteProfileRequest>(offset);
1950 unsafe {
1953 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1954 (ptr as *mut u64).write_unaligned(0);
1955 }
1956 self.0.encode(encoder, offset + 0, depth)?;
1958 self.1.encode(encoder, offset + 16, depth)?;
1959 Ok(())
1960 }
1961 }
1962
1963 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1964 for MappingSessionWriteProfileRequest
1965 {
1966 #[inline(always)]
1967 fn new_empty() -> Self {
1968 Self {
1969 name: fidl::new_empty!(
1970 fidl::encoding::UnboundedString,
1971 fidl::encoding::DefaultFuchsiaResourceDialect
1972 ),
1973 profile_vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1974 }
1975 }
1976
1977 #[inline]
1978 unsafe fn decode(
1979 &mut self,
1980 decoder: &mut fidl::encoding::Decoder<
1981 '_,
1982 fidl::encoding::DefaultFuchsiaResourceDialect,
1983 >,
1984 offset: usize,
1985 _depth: fidl::encoding::Depth,
1986 ) -> fidl::Result<()> {
1987 decoder.debug_check_bounds::<Self>(offset);
1988 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1990 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1991 let mask = 0xffffffff00000000u64;
1992 let maskedval = padval & mask;
1993 if maskedval != 0 {
1994 return Err(fidl::Error::NonZeroPadding {
1995 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1996 });
1997 }
1998 fidl::decode!(
1999 fidl::encoding::UnboundedString,
2000 fidl::encoding::DefaultFuchsiaResourceDialect,
2001 &mut self.name,
2002 decoder,
2003 offset + 0,
2004 _depth
2005 )?;
2006 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.profile_vmo, decoder, offset + 16, _depth)?;
2007 Ok(())
2008 }
2009 }
2010
2011 impl fidl::encoding::ResourceTypeMarker for MappingSessionGetProfileResponse {
2012 type Borrowed<'a> = &'a mut Self;
2013 fn take_or_borrow<'a>(
2014 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2015 ) -> Self::Borrowed<'a> {
2016 value
2017 }
2018 }
2019
2020 unsafe impl fidl::encoding::TypeMarker for MappingSessionGetProfileResponse {
2021 type Owned = Self;
2022
2023 #[inline(always)]
2024 fn inline_align(_context: fidl::encoding::Context) -> usize {
2025 4
2026 }
2027
2028 #[inline(always)]
2029 fn inline_size(_context: fidl::encoding::Context) -> usize {
2030 4
2031 }
2032 }
2033
2034 unsafe impl
2035 fidl::encoding::Encode<
2036 MappingSessionGetProfileResponse,
2037 fidl::encoding::DefaultFuchsiaResourceDialect,
2038 > for &mut MappingSessionGetProfileResponse
2039 {
2040 #[inline]
2041 unsafe fn encode(
2042 self,
2043 encoder: &mut fidl::encoding::Encoder<
2044 '_,
2045 fidl::encoding::DefaultFuchsiaResourceDialect,
2046 >,
2047 offset: usize,
2048 _depth: fidl::encoding::Depth,
2049 ) -> fidl::Result<()> {
2050 encoder.debug_check_bounds::<MappingSessionGetProfileResponse>(offset);
2051 fidl::encoding::Encode::<
2053 MappingSessionGetProfileResponse,
2054 fidl::encoding::DefaultFuchsiaResourceDialect,
2055 >::encode(
2056 (<fidl::encoding::HandleType<
2057 fidl::Vmo,
2058 { fidl::ObjectType::VMO.into_raw() },
2059 2147483648,
2060 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2061 &mut self.profile_vmo
2062 ),),
2063 encoder,
2064 offset,
2065 _depth,
2066 )
2067 }
2068 }
2069 unsafe impl<
2070 T0: fidl::encoding::Encode<
2071 fidl::encoding::HandleType<
2072 fidl::Vmo,
2073 { fidl::ObjectType::VMO.into_raw() },
2074 2147483648,
2075 >,
2076 fidl::encoding::DefaultFuchsiaResourceDialect,
2077 >,
2078 >
2079 fidl::encoding::Encode<
2080 MappingSessionGetProfileResponse,
2081 fidl::encoding::DefaultFuchsiaResourceDialect,
2082 > for (T0,)
2083 {
2084 #[inline]
2085 unsafe fn encode(
2086 self,
2087 encoder: &mut fidl::encoding::Encoder<
2088 '_,
2089 fidl::encoding::DefaultFuchsiaResourceDialect,
2090 >,
2091 offset: usize,
2092 depth: fidl::encoding::Depth,
2093 ) -> fidl::Result<()> {
2094 encoder.debug_check_bounds::<MappingSessionGetProfileResponse>(offset);
2095 self.0.encode(encoder, offset + 0, depth)?;
2099 Ok(())
2100 }
2101 }
2102
2103 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2104 for MappingSessionGetProfileResponse
2105 {
2106 #[inline(always)]
2107 fn new_empty() -> Self {
2108 Self {
2109 profile_vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2110 }
2111 }
2112
2113 #[inline]
2114 unsafe fn decode(
2115 &mut self,
2116 decoder: &mut fidl::encoding::Decoder<
2117 '_,
2118 fidl::encoding::DefaultFuchsiaResourceDialect,
2119 >,
2120 offset: usize,
2121 _depth: fidl::encoding::Depth,
2122 ) -> fidl::Result<()> {
2123 decoder.debug_check_bounds::<Self>(offset);
2124 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.profile_vmo, decoder, offset + 0, _depth)?;
2126 Ok(())
2127 }
2128 }
2129}