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_test_systemactivitygovernor_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct RealmFactoryCreateRealmExtRequest {
16 pub options: RealmOptions,
17 pub realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for RealmFactoryCreateRealmExtRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct RealmFactoryCreateRealmRequest {
27 pub realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
31 for RealmFactoryCreateRealmRequest
32{
33}
34
35#[derive(Debug, Default, PartialEq)]
37pub struct RealmOptions {
38 pub use_fake_sag: Option<bool>,
41 pub wait_for_suspending_token: Option<bool>,
47 pub use_suspender: Option<bool>,
49 #[doc(hidden)]
50 pub __source_breaking: fidl::marker::SourceBreaking,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmOptions {}
54
55#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
56pub struct RealmFactoryMarker;
57
58impl fidl::endpoints::ProtocolMarker for RealmFactoryMarker {
59 type Proxy = RealmFactoryProxy;
60 type RequestStream = RealmFactoryRequestStream;
61 #[cfg(target_os = "fuchsia")]
62 type SynchronousProxy = RealmFactorySynchronousProxy;
63
64 const DEBUG_NAME: &'static str = "test.systemactivitygovernor.RealmFactory";
65}
66impl fidl::endpoints::DiscoverableProtocolMarker for RealmFactoryMarker {}
67pub type RealmFactoryCreateRealmResult =
68 Result<String, fidl_fuchsia_testing_harness::OperationError>;
69pub type RealmFactoryCreateRealmExtResult =
70 Result<String, fidl_fuchsia_testing_harness::OperationError>;
71
72pub trait RealmFactoryProxyInterface: Send + Sync {
73 type CreateRealmResponseFut: std::future::Future<Output = Result<RealmFactoryCreateRealmResult, fidl::Error>>
74 + Send;
75 fn r#create_realm(
76 &self,
77 realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
78 ) -> Self::CreateRealmResponseFut;
79 type CreateRealmExtResponseFut: std::future::Future<Output = Result<RealmFactoryCreateRealmExtResult, fidl::Error>>
80 + Send;
81 fn r#create_realm_ext(
82 &self,
83 options: RealmOptions,
84 realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
85 ) -> Self::CreateRealmExtResponseFut;
86}
87#[derive(Debug)]
88#[cfg(target_os = "fuchsia")]
89pub struct RealmFactorySynchronousProxy {
90 client: fidl::client::sync::Client,
91}
92
93#[cfg(target_os = "fuchsia")]
94impl fidl::endpoints::SynchronousProxy for RealmFactorySynchronousProxy {
95 type Proxy = RealmFactoryProxy;
96 type Protocol = RealmFactoryMarker;
97
98 fn from_channel(inner: fidl::Channel) -> Self {
99 Self::new(inner)
100 }
101
102 fn into_channel(self) -> fidl::Channel {
103 self.client.into_channel()
104 }
105
106 fn as_channel(&self) -> &fidl::Channel {
107 self.client.as_channel()
108 }
109}
110
111#[cfg(target_os = "fuchsia")]
112impl RealmFactorySynchronousProxy {
113 pub fn new(channel: fidl::Channel) -> Self {
114 let protocol_name = <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
115 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
116 }
117
118 pub fn into_channel(self) -> fidl::Channel {
119 self.client.into_channel()
120 }
121
122 pub fn wait_for_event(
125 &self,
126 deadline: zx::MonotonicInstant,
127 ) -> Result<RealmFactoryEvent, fidl::Error> {
128 RealmFactoryEvent::decode(self.client.wait_for_event(deadline)?)
129 }
130
131 pub fn r#create_realm(
133 &self,
134 mut realm_server: fidl::endpoints::ServerEnd<
135 fidl_fuchsia_testing_harness::RealmProxy_Marker,
136 >,
137 ___deadline: zx::MonotonicInstant,
138 ) -> Result<RealmFactoryCreateRealmResult, fidl::Error> {
139 let _response = self
140 .client
141 .send_query::<RealmFactoryCreateRealmRequest, fidl::encoding::FlexibleResultType<
142 RealmFactoryCreateRealmResponse,
143 fidl_fuchsia_testing_harness::OperationError,
144 >>(
145 (realm_server,),
146 0x3fcb27aa634a2df3,
147 fidl::encoding::DynamicFlags::FLEXIBLE,
148 ___deadline,
149 )?
150 .into_result::<RealmFactoryMarker>("create_realm")?;
151 Ok(_response.map(|x| x.activity_governor_moniker))
152 }
153
154 pub fn r#create_realm_ext(
156 &self,
157 mut options: RealmOptions,
158 mut realm_server: fidl::endpoints::ServerEnd<
159 fidl_fuchsia_testing_harness::RealmProxy_Marker,
160 >,
161 ___deadline: zx::MonotonicInstant,
162 ) -> Result<RealmFactoryCreateRealmExtResult, fidl::Error> {
163 let _response = self
164 .client
165 .send_query::<RealmFactoryCreateRealmExtRequest, fidl::encoding::FlexibleResultType<
166 RealmFactoryCreateRealmExtResponse,
167 fidl_fuchsia_testing_harness::OperationError,
168 >>(
169 (&mut options, realm_server),
170 0x63a655ff630a0db0,
171 fidl::encoding::DynamicFlags::FLEXIBLE,
172 ___deadline,
173 )?
174 .into_result::<RealmFactoryMarker>("create_realm_ext")?;
175 Ok(_response.map(|x| x.activity_governor_moniker))
176 }
177}
178
179#[cfg(target_os = "fuchsia")]
180impl From<RealmFactorySynchronousProxy> for zx::Handle {
181 fn from(value: RealmFactorySynchronousProxy) -> Self {
182 value.into_channel().into()
183 }
184}
185
186#[cfg(target_os = "fuchsia")]
187impl From<fidl::Channel> for RealmFactorySynchronousProxy {
188 fn from(value: fidl::Channel) -> Self {
189 Self::new(value)
190 }
191}
192
193#[derive(Debug, Clone)]
194pub struct RealmFactoryProxy {
195 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
196}
197
198impl fidl::endpoints::Proxy for RealmFactoryProxy {
199 type Protocol = RealmFactoryMarker;
200
201 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
202 Self::new(inner)
203 }
204
205 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
206 self.client.into_channel().map_err(|client| Self { client })
207 }
208
209 fn as_channel(&self) -> &::fidl::AsyncChannel {
210 self.client.as_channel()
211 }
212}
213
214impl RealmFactoryProxy {
215 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
217 let protocol_name = <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
218 Self { client: fidl::client::Client::new(channel, protocol_name) }
219 }
220
221 pub fn take_event_stream(&self) -> RealmFactoryEventStream {
227 RealmFactoryEventStream { event_receiver: self.client.take_event_receiver() }
228 }
229
230 pub fn r#create_realm(
232 &self,
233 mut realm_server: fidl::endpoints::ServerEnd<
234 fidl_fuchsia_testing_harness::RealmProxy_Marker,
235 >,
236 ) -> fidl::client::QueryResponseFut<
237 RealmFactoryCreateRealmResult,
238 fidl::encoding::DefaultFuchsiaResourceDialect,
239 > {
240 RealmFactoryProxyInterface::r#create_realm(self, realm_server)
241 }
242
243 pub fn r#create_realm_ext(
245 &self,
246 mut options: RealmOptions,
247 mut realm_server: fidl::endpoints::ServerEnd<
248 fidl_fuchsia_testing_harness::RealmProxy_Marker,
249 >,
250 ) -> fidl::client::QueryResponseFut<
251 RealmFactoryCreateRealmExtResult,
252 fidl::encoding::DefaultFuchsiaResourceDialect,
253 > {
254 RealmFactoryProxyInterface::r#create_realm_ext(self, options, realm_server)
255 }
256}
257
258impl RealmFactoryProxyInterface for RealmFactoryProxy {
259 type CreateRealmResponseFut = fidl::client::QueryResponseFut<
260 RealmFactoryCreateRealmResult,
261 fidl::encoding::DefaultFuchsiaResourceDialect,
262 >;
263 fn r#create_realm(
264 &self,
265 mut realm_server: fidl::endpoints::ServerEnd<
266 fidl_fuchsia_testing_harness::RealmProxy_Marker,
267 >,
268 ) -> Self::CreateRealmResponseFut {
269 fn _decode(
270 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
271 ) -> Result<RealmFactoryCreateRealmResult, fidl::Error> {
272 let _response = fidl::client::decode_transaction_body::<
273 fidl::encoding::FlexibleResultType<
274 RealmFactoryCreateRealmResponse,
275 fidl_fuchsia_testing_harness::OperationError,
276 >,
277 fidl::encoding::DefaultFuchsiaResourceDialect,
278 0x3fcb27aa634a2df3,
279 >(_buf?)?
280 .into_result::<RealmFactoryMarker>("create_realm")?;
281 Ok(_response.map(|x| x.activity_governor_moniker))
282 }
283 self.client
284 .send_query_and_decode::<RealmFactoryCreateRealmRequest, RealmFactoryCreateRealmResult>(
285 (realm_server,),
286 0x3fcb27aa634a2df3,
287 fidl::encoding::DynamicFlags::FLEXIBLE,
288 _decode,
289 )
290 }
291
292 type CreateRealmExtResponseFut = fidl::client::QueryResponseFut<
293 RealmFactoryCreateRealmExtResult,
294 fidl::encoding::DefaultFuchsiaResourceDialect,
295 >;
296 fn r#create_realm_ext(
297 &self,
298 mut options: RealmOptions,
299 mut realm_server: fidl::endpoints::ServerEnd<
300 fidl_fuchsia_testing_harness::RealmProxy_Marker,
301 >,
302 ) -> Self::CreateRealmExtResponseFut {
303 fn _decode(
304 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
305 ) -> Result<RealmFactoryCreateRealmExtResult, fidl::Error> {
306 let _response = fidl::client::decode_transaction_body::<
307 fidl::encoding::FlexibleResultType<
308 RealmFactoryCreateRealmExtResponse,
309 fidl_fuchsia_testing_harness::OperationError,
310 >,
311 fidl::encoding::DefaultFuchsiaResourceDialect,
312 0x63a655ff630a0db0,
313 >(_buf?)?
314 .into_result::<RealmFactoryMarker>("create_realm_ext")?;
315 Ok(_response.map(|x| x.activity_governor_moniker))
316 }
317 self.client.send_query_and_decode::<
318 RealmFactoryCreateRealmExtRequest,
319 RealmFactoryCreateRealmExtResult,
320 >(
321 (&mut options, realm_server,),
322 0x63a655ff630a0db0,
323 fidl::encoding::DynamicFlags::FLEXIBLE,
324 _decode,
325 )
326 }
327}
328
329pub struct RealmFactoryEventStream {
330 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
331}
332
333impl std::marker::Unpin for RealmFactoryEventStream {}
334
335impl futures::stream::FusedStream for RealmFactoryEventStream {
336 fn is_terminated(&self) -> bool {
337 self.event_receiver.is_terminated()
338 }
339}
340
341impl futures::Stream for RealmFactoryEventStream {
342 type Item = Result<RealmFactoryEvent, fidl::Error>;
343
344 fn poll_next(
345 mut self: std::pin::Pin<&mut Self>,
346 cx: &mut std::task::Context<'_>,
347 ) -> std::task::Poll<Option<Self::Item>> {
348 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
349 &mut self.event_receiver,
350 cx
351 )?) {
352 Some(buf) => std::task::Poll::Ready(Some(RealmFactoryEvent::decode(buf))),
353 None => std::task::Poll::Ready(None),
354 }
355 }
356}
357
358#[derive(Debug)]
359pub enum RealmFactoryEvent {
360 #[non_exhaustive]
361 _UnknownEvent {
362 ordinal: u64,
364 },
365}
366
367impl RealmFactoryEvent {
368 fn decode(
370 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
371 ) -> Result<RealmFactoryEvent, fidl::Error> {
372 let (bytes, _handles) = buf.split_mut();
373 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
374 debug_assert_eq!(tx_header.tx_id, 0);
375 match tx_header.ordinal {
376 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
377 Ok(RealmFactoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
378 }
379 _ => Err(fidl::Error::UnknownOrdinal {
380 ordinal: tx_header.ordinal,
381 protocol_name: <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
382 }),
383 }
384 }
385}
386
387pub struct RealmFactoryRequestStream {
389 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
390 is_terminated: bool,
391}
392
393impl std::marker::Unpin for RealmFactoryRequestStream {}
394
395impl futures::stream::FusedStream for RealmFactoryRequestStream {
396 fn is_terminated(&self) -> bool {
397 self.is_terminated
398 }
399}
400
401impl fidl::endpoints::RequestStream for RealmFactoryRequestStream {
402 type Protocol = RealmFactoryMarker;
403 type ControlHandle = RealmFactoryControlHandle;
404
405 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
406 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
407 }
408
409 fn control_handle(&self) -> Self::ControlHandle {
410 RealmFactoryControlHandle { inner: self.inner.clone() }
411 }
412
413 fn into_inner(
414 self,
415 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
416 {
417 (self.inner, self.is_terminated)
418 }
419
420 fn from_inner(
421 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
422 is_terminated: bool,
423 ) -> Self {
424 Self { inner, is_terminated }
425 }
426}
427
428impl futures::Stream for RealmFactoryRequestStream {
429 type Item = Result<RealmFactoryRequest, fidl::Error>;
430
431 fn poll_next(
432 mut self: std::pin::Pin<&mut Self>,
433 cx: &mut std::task::Context<'_>,
434 ) -> std::task::Poll<Option<Self::Item>> {
435 let this = &mut *self;
436 if this.inner.check_shutdown(cx) {
437 this.is_terminated = true;
438 return std::task::Poll::Ready(None);
439 }
440 if this.is_terminated {
441 panic!("polled RealmFactoryRequestStream after completion");
442 }
443 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
444 |bytes, handles| {
445 match this.inner.channel().read_etc(cx, bytes, handles) {
446 std::task::Poll::Ready(Ok(())) => {}
447 std::task::Poll::Pending => return std::task::Poll::Pending,
448 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
449 this.is_terminated = true;
450 return std::task::Poll::Ready(None);
451 }
452 std::task::Poll::Ready(Err(e)) => {
453 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
454 e.into(),
455 ))))
456 }
457 }
458
459 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
461
462 std::task::Poll::Ready(Some(match header.ordinal {
463 0x3fcb27aa634a2df3 => {
464 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
465 let mut req = fidl::new_empty!(
466 RealmFactoryCreateRealmRequest,
467 fidl::encoding::DefaultFuchsiaResourceDialect
468 );
469 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmFactoryCreateRealmRequest>(&header, _body_bytes, handles, &mut req)?;
470 let control_handle =
471 RealmFactoryControlHandle { inner: this.inner.clone() };
472 Ok(RealmFactoryRequest::CreateRealm {
473 realm_server: req.realm_server,
474
475 responder: RealmFactoryCreateRealmResponder {
476 control_handle: std::mem::ManuallyDrop::new(control_handle),
477 tx_id: header.tx_id,
478 },
479 })
480 }
481 0x63a655ff630a0db0 => {
482 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
483 let mut req = fidl::new_empty!(
484 RealmFactoryCreateRealmExtRequest,
485 fidl::encoding::DefaultFuchsiaResourceDialect
486 );
487 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmFactoryCreateRealmExtRequest>(&header, _body_bytes, handles, &mut req)?;
488 let control_handle =
489 RealmFactoryControlHandle { inner: this.inner.clone() };
490 Ok(RealmFactoryRequest::CreateRealmExt {
491 options: req.options,
492 realm_server: req.realm_server,
493
494 responder: RealmFactoryCreateRealmExtResponder {
495 control_handle: std::mem::ManuallyDrop::new(control_handle),
496 tx_id: header.tx_id,
497 },
498 })
499 }
500 _ if header.tx_id == 0
501 && header
502 .dynamic_flags()
503 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
504 {
505 Ok(RealmFactoryRequest::_UnknownMethod {
506 ordinal: header.ordinal,
507 control_handle: RealmFactoryControlHandle { inner: this.inner.clone() },
508 method_type: fidl::MethodType::OneWay,
509 })
510 }
511 _ if header
512 .dynamic_flags()
513 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
514 {
515 this.inner.send_framework_err(
516 fidl::encoding::FrameworkErr::UnknownMethod,
517 header.tx_id,
518 header.ordinal,
519 header.dynamic_flags(),
520 (bytes, handles),
521 )?;
522 Ok(RealmFactoryRequest::_UnknownMethod {
523 ordinal: header.ordinal,
524 control_handle: RealmFactoryControlHandle { inner: this.inner.clone() },
525 method_type: fidl::MethodType::TwoWay,
526 })
527 }
528 _ => Err(fidl::Error::UnknownOrdinal {
529 ordinal: header.ordinal,
530 protocol_name:
531 <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
532 }),
533 }))
534 },
535 )
536 }
537}
538
539#[derive(Debug)]
540pub enum RealmFactoryRequest {
541 CreateRealm {
543 realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
544 responder: RealmFactoryCreateRealmResponder,
545 },
546 CreateRealmExt {
548 options: RealmOptions,
549 realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
550 responder: RealmFactoryCreateRealmExtResponder,
551 },
552 #[non_exhaustive]
554 _UnknownMethod {
555 ordinal: u64,
557 control_handle: RealmFactoryControlHandle,
558 method_type: fidl::MethodType,
559 },
560}
561
562impl RealmFactoryRequest {
563 #[allow(irrefutable_let_patterns)]
564 pub fn into_create_realm(
565 self,
566 ) -> Option<(
567 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
568 RealmFactoryCreateRealmResponder,
569 )> {
570 if let RealmFactoryRequest::CreateRealm { realm_server, responder } = self {
571 Some((realm_server, responder))
572 } else {
573 None
574 }
575 }
576
577 #[allow(irrefutable_let_patterns)]
578 pub fn into_create_realm_ext(
579 self,
580 ) -> Option<(
581 RealmOptions,
582 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
583 RealmFactoryCreateRealmExtResponder,
584 )> {
585 if let RealmFactoryRequest::CreateRealmExt { options, realm_server, responder } = self {
586 Some((options, realm_server, responder))
587 } else {
588 None
589 }
590 }
591
592 pub fn method_name(&self) -> &'static str {
594 match *self {
595 RealmFactoryRequest::CreateRealm { .. } => "create_realm",
596 RealmFactoryRequest::CreateRealmExt { .. } => "create_realm_ext",
597 RealmFactoryRequest::_UnknownMethod {
598 method_type: fidl::MethodType::OneWay, ..
599 } => "unknown one-way method",
600 RealmFactoryRequest::_UnknownMethod {
601 method_type: fidl::MethodType::TwoWay, ..
602 } => "unknown two-way method",
603 }
604 }
605}
606
607#[derive(Debug, Clone)]
608pub struct RealmFactoryControlHandle {
609 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
610}
611
612impl fidl::endpoints::ControlHandle for RealmFactoryControlHandle {
613 fn shutdown(&self) {
614 self.inner.shutdown()
615 }
616 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
617 self.inner.shutdown_with_epitaph(status)
618 }
619
620 fn is_closed(&self) -> bool {
621 self.inner.channel().is_closed()
622 }
623 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
624 self.inner.channel().on_closed()
625 }
626
627 #[cfg(target_os = "fuchsia")]
628 fn signal_peer(
629 &self,
630 clear_mask: zx::Signals,
631 set_mask: zx::Signals,
632 ) -> Result<(), zx_status::Status> {
633 use fidl::Peered;
634 self.inner.channel().signal_peer(clear_mask, set_mask)
635 }
636}
637
638impl RealmFactoryControlHandle {}
639
640#[must_use = "FIDL methods require a response to be sent"]
641#[derive(Debug)]
642pub struct RealmFactoryCreateRealmResponder {
643 control_handle: std::mem::ManuallyDrop<RealmFactoryControlHandle>,
644 tx_id: u32,
645}
646
647impl std::ops::Drop for RealmFactoryCreateRealmResponder {
651 fn drop(&mut self) {
652 self.control_handle.shutdown();
653 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
655 }
656}
657
658impl fidl::endpoints::Responder for RealmFactoryCreateRealmResponder {
659 type ControlHandle = RealmFactoryControlHandle;
660
661 fn control_handle(&self) -> &RealmFactoryControlHandle {
662 &self.control_handle
663 }
664
665 fn drop_without_shutdown(mut self) {
666 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
668 std::mem::forget(self);
670 }
671}
672
673impl RealmFactoryCreateRealmResponder {
674 pub fn send(
678 self,
679 mut result: Result<&str, fidl_fuchsia_testing_harness::OperationError>,
680 ) -> Result<(), fidl::Error> {
681 let _result = self.send_raw(result);
682 if _result.is_err() {
683 self.control_handle.shutdown();
684 }
685 self.drop_without_shutdown();
686 _result
687 }
688
689 pub fn send_no_shutdown_on_err(
691 self,
692 mut result: Result<&str, fidl_fuchsia_testing_harness::OperationError>,
693 ) -> Result<(), fidl::Error> {
694 let _result = self.send_raw(result);
695 self.drop_without_shutdown();
696 _result
697 }
698
699 fn send_raw(
700 &self,
701 mut result: Result<&str, fidl_fuchsia_testing_harness::OperationError>,
702 ) -> Result<(), fidl::Error> {
703 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
704 RealmFactoryCreateRealmResponse,
705 fidl_fuchsia_testing_harness::OperationError,
706 >>(
707 fidl::encoding::FlexibleResult::new(
708 result.map(|activity_governor_moniker| (activity_governor_moniker,)),
709 ),
710 self.tx_id,
711 0x3fcb27aa634a2df3,
712 fidl::encoding::DynamicFlags::FLEXIBLE,
713 )
714 }
715}
716
717#[must_use = "FIDL methods require a response to be sent"]
718#[derive(Debug)]
719pub struct RealmFactoryCreateRealmExtResponder {
720 control_handle: std::mem::ManuallyDrop<RealmFactoryControlHandle>,
721 tx_id: u32,
722}
723
724impl std::ops::Drop for RealmFactoryCreateRealmExtResponder {
728 fn drop(&mut self) {
729 self.control_handle.shutdown();
730 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
732 }
733}
734
735impl fidl::endpoints::Responder for RealmFactoryCreateRealmExtResponder {
736 type ControlHandle = RealmFactoryControlHandle;
737
738 fn control_handle(&self) -> &RealmFactoryControlHandle {
739 &self.control_handle
740 }
741
742 fn drop_without_shutdown(mut self) {
743 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
745 std::mem::forget(self);
747 }
748}
749
750impl RealmFactoryCreateRealmExtResponder {
751 pub fn send(
755 self,
756 mut result: Result<&str, fidl_fuchsia_testing_harness::OperationError>,
757 ) -> Result<(), fidl::Error> {
758 let _result = self.send_raw(result);
759 if _result.is_err() {
760 self.control_handle.shutdown();
761 }
762 self.drop_without_shutdown();
763 _result
764 }
765
766 pub fn send_no_shutdown_on_err(
768 self,
769 mut result: Result<&str, fidl_fuchsia_testing_harness::OperationError>,
770 ) -> Result<(), fidl::Error> {
771 let _result = self.send_raw(result);
772 self.drop_without_shutdown();
773 _result
774 }
775
776 fn send_raw(
777 &self,
778 mut result: Result<&str, fidl_fuchsia_testing_harness::OperationError>,
779 ) -> Result<(), fidl::Error> {
780 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
781 RealmFactoryCreateRealmExtResponse,
782 fidl_fuchsia_testing_harness::OperationError,
783 >>(
784 fidl::encoding::FlexibleResult::new(
785 result.map(|activity_governor_moniker| (activity_governor_moniker,)),
786 ),
787 self.tx_id,
788 0x63a655ff630a0db0,
789 fidl::encoding::DynamicFlags::FLEXIBLE,
790 )
791 }
792}
793
794mod internal {
795 use super::*;
796
797 impl fidl::encoding::ResourceTypeMarker for RealmFactoryCreateRealmExtRequest {
798 type Borrowed<'a> = &'a mut Self;
799 fn take_or_borrow<'a>(
800 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
801 ) -> Self::Borrowed<'a> {
802 value
803 }
804 }
805
806 unsafe impl fidl::encoding::TypeMarker for RealmFactoryCreateRealmExtRequest {
807 type Owned = Self;
808
809 #[inline(always)]
810 fn inline_align(_context: fidl::encoding::Context) -> usize {
811 8
812 }
813
814 #[inline(always)]
815 fn inline_size(_context: fidl::encoding::Context) -> usize {
816 24
817 }
818 }
819
820 unsafe impl
821 fidl::encoding::Encode<
822 RealmFactoryCreateRealmExtRequest,
823 fidl::encoding::DefaultFuchsiaResourceDialect,
824 > for &mut RealmFactoryCreateRealmExtRequest
825 {
826 #[inline]
827 unsafe fn encode(
828 self,
829 encoder: &mut fidl::encoding::Encoder<
830 '_,
831 fidl::encoding::DefaultFuchsiaResourceDialect,
832 >,
833 offset: usize,
834 _depth: fidl::encoding::Depth,
835 ) -> fidl::Result<()> {
836 encoder.debug_check_bounds::<RealmFactoryCreateRealmExtRequest>(offset);
837 fidl::encoding::Encode::<
839 RealmFactoryCreateRealmExtRequest,
840 fidl::encoding::DefaultFuchsiaResourceDialect,
841 >::encode(
842 (
843 <RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
844 &mut self.options,
845 ),
846 <fidl::encoding::Endpoint<
847 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
848 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
849 &mut self.realm_server,
850 ),
851 ),
852 encoder,
853 offset,
854 _depth,
855 )
856 }
857 }
858 unsafe impl<
859 T0: fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
860 T1: fidl::encoding::Encode<
861 fidl::encoding::Endpoint<
862 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
863 >,
864 fidl::encoding::DefaultFuchsiaResourceDialect,
865 >,
866 >
867 fidl::encoding::Encode<
868 RealmFactoryCreateRealmExtRequest,
869 fidl::encoding::DefaultFuchsiaResourceDialect,
870 > for (T0, T1)
871 {
872 #[inline]
873 unsafe fn encode(
874 self,
875 encoder: &mut fidl::encoding::Encoder<
876 '_,
877 fidl::encoding::DefaultFuchsiaResourceDialect,
878 >,
879 offset: usize,
880 depth: fidl::encoding::Depth,
881 ) -> fidl::Result<()> {
882 encoder.debug_check_bounds::<RealmFactoryCreateRealmExtRequest>(offset);
883 unsafe {
886 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
887 (ptr as *mut u64).write_unaligned(0);
888 }
889 self.0.encode(encoder, offset + 0, depth)?;
891 self.1.encode(encoder, offset + 16, depth)?;
892 Ok(())
893 }
894 }
895
896 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
897 for RealmFactoryCreateRealmExtRequest
898 {
899 #[inline(always)]
900 fn new_empty() -> Self {
901 Self {
902 options: fidl::new_empty!(
903 RealmOptions,
904 fidl::encoding::DefaultFuchsiaResourceDialect
905 ),
906 realm_server: fidl::new_empty!(
907 fidl::encoding::Endpoint<
908 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
909 >,
910 fidl::encoding::DefaultFuchsiaResourceDialect
911 ),
912 }
913 }
914
915 #[inline]
916 unsafe fn decode(
917 &mut self,
918 decoder: &mut fidl::encoding::Decoder<
919 '_,
920 fidl::encoding::DefaultFuchsiaResourceDialect,
921 >,
922 offset: usize,
923 _depth: fidl::encoding::Depth,
924 ) -> fidl::Result<()> {
925 decoder.debug_check_bounds::<Self>(offset);
926 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
928 let padval = unsafe { (ptr as *const u64).read_unaligned() };
929 let mask = 0xffffffff00000000u64;
930 let maskedval = padval & mask;
931 if maskedval != 0 {
932 return Err(fidl::Error::NonZeroPadding {
933 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
934 });
935 }
936 fidl::decode!(
937 RealmOptions,
938 fidl::encoding::DefaultFuchsiaResourceDialect,
939 &mut self.options,
940 decoder,
941 offset + 0,
942 _depth
943 )?;
944 fidl::decode!(
945 fidl::encoding::Endpoint<
946 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
947 >,
948 fidl::encoding::DefaultFuchsiaResourceDialect,
949 &mut self.realm_server,
950 decoder,
951 offset + 16,
952 _depth
953 )?;
954 Ok(())
955 }
956 }
957
958 impl fidl::encoding::ResourceTypeMarker for RealmFactoryCreateRealmRequest {
959 type Borrowed<'a> = &'a mut Self;
960 fn take_or_borrow<'a>(
961 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
962 ) -> Self::Borrowed<'a> {
963 value
964 }
965 }
966
967 unsafe impl fidl::encoding::TypeMarker for RealmFactoryCreateRealmRequest {
968 type Owned = Self;
969
970 #[inline(always)]
971 fn inline_align(_context: fidl::encoding::Context) -> usize {
972 4
973 }
974
975 #[inline(always)]
976 fn inline_size(_context: fidl::encoding::Context) -> usize {
977 4
978 }
979 }
980
981 unsafe impl
982 fidl::encoding::Encode<
983 RealmFactoryCreateRealmRequest,
984 fidl::encoding::DefaultFuchsiaResourceDialect,
985 > for &mut RealmFactoryCreateRealmRequest
986 {
987 #[inline]
988 unsafe fn encode(
989 self,
990 encoder: &mut fidl::encoding::Encoder<
991 '_,
992 fidl::encoding::DefaultFuchsiaResourceDialect,
993 >,
994 offset: usize,
995 _depth: fidl::encoding::Depth,
996 ) -> fidl::Result<()> {
997 encoder.debug_check_bounds::<RealmFactoryCreateRealmRequest>(offset);
998 fidl::encoding::Encode::<
1000 RealmFactoryCreateRealmRequest,
1001 fidl::encoding::DefaultFuchsiaResourceDialect,
1002 >::encode(
1003 (<fidl::encoding::Endpoint<
1004 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
1005 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1006 &mut self.realm_server
1007 ),),
1008 encoder,
1009 offset,
1010 _depth,
1011 )
1012 }
1013 }
1014 unsafe impl<
1015 T0: fidl::encoding::Encode<
1016 fidl::encoding::Endpoint<
1017 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
1018 >,
1019 fidl::encoding::DefaultFuchsiaResourceDialect,
1020 >,
1021 >
1022 fidl::encoding::Encode<
1023 RealmFactoryCreateRealmRequest,
1024 fidl::encoding::DefaultFuchsiaResourceDialect,
1025 > for (T0,)
1026 {
1027 #[inline]
1028 unsafe fn encode(
1029 self,
1030 encoder: &mut fidl::encoding::Encoder<
1031 '_,
1032 fidl::encoding::DefaultFuchsiaResourceDialect,
1033 >,
1034 offset: usize,
1035 depth: fidl::encoding::Depth,
1036 ) -> fidl::Result<()> {
1037 encoder.debug_check_bounds::<RealmFactoryCreateRealmRequest>(offset);
1038 self.0.encode(encoder, offset + 0, depth)?;
1042 Ok(())
1043 }
1044 }
1045
1046 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1047 for RealmFactoryCreateRealmRequest
1048 {
1049 #[inline(always)]
1050 fn new_empty() -> Self {
1051 Self {
1052 realm_server: fidl::new_empty!(
1053 fidl::encoding::Endpoint<
1054 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
1055 >,
1056 fidl::encoding::DefaultFuchsiaResourceDialect
1057 ),
1058 }
1059 }
1060
1061 #[inline]
1062 unsafe fn decode(
1063 &mut self,
1064 decoder: &mut fidl::encoding::Decoder<
1065 '_,
1066 fidl::encoding::DefaultFuchsiaResourceDialect,
1067 >,
1068 offset: usize,
1069 _depth: fidl::encoding::Depth,
1070 ) -> fidl::Result<()> {
1071 decoder.debug_check_bounds::<Self>(offset);
1072 fidl::decode!(
1074 fidl::encoding::Endpoint<
1075 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
1076 >,
1077 fidl::encoding::DefaultFuchsiaResourceDialect,
1078 &mut self.realm_server,
1079 decoder,
1080 offset + 0,
1081 _depth
1082 )?;
1083 Ok(())
1084 }
1085 }
1086
1087 impl RealmOptions {
1088 #[inline(always)]
1089 fn max_ordinal_present(&self) -> u64 {
1090 if let Some(_) = self.use_suspender {
1091 return 3;
1092 }
1093 if let Some(_) = self.wait_for_suspending_token {
1094 return 2;
1095 }
1096 if let Some(_) = self.use_fake_sag {
1097 return 1;
1098 }
1099 0
1100 }
1101 }
1102
1103 impl fidl::encoding::ResourceTypeMarker for RealmOptions {
1104 type Borrowed<'a> = &'a mut Self;
1105 fn take_or_borrow<'a>(
1106 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1107 ) -> Self::Borrowed<'a> {
1108 value
1109 }
1110 }
1111
1112 unsafe impl fidl::encoding::TypeMarker for RealmOptions {
1113 type Owned = Self;
1114
1115 #[inline(always)]
1116 fn inline_align(_context: fidl::encoding::Context) -> usize {
1117 8
1118 }
1119
1120 #[inline(always)]
1121 fn inline_size(_context: fidl::encoding::Context) -> usize {
1122 16
1123 }
1124 }
1125
1126 unsafe impl fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
1127 for &mut RealmOptions
1128 {
1129 unsafe fn encode(
1130 self,
1131 encoder: &mut fidl::encoding::Encoder<
1132 '_,
1133 fidl::encoding::DefaultFuchsiaResourceDialect,
1134 >,
1135 offset: usize,
1136 mut depth: fidl::encoding::Depth,
1137 ) -> fidl::Result<()> {
1138 encoder.debug_check_bounds::<RealmOptions>(offset);
1139 let max_ordinal: u64 = self.max_ordinal_present();
1141 encoder.write_num(max_ordinal, offset);
1142 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1143 if max_ordinal == 0 {
1145 return Ok(());
1146 }
1147 depth.increment()?;
1148 let envelope_size = 8;
1149 let bytes_len = max_ordinal as usize * envelope_size;
1150 #[allow(unused_variables)]
1151 let offset = encoder.out_of_line_offset(bytes_len);
1152 let mut _prev_end_offset: usize = 0;
1153 if 1 > max_ordinal {
1154 return Ok(());
1155 }
1156
1157 let cur_offset: usize = (1 - 1) * envelope_size;
1160
1161 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1163
1164 fidl::encoding::encode_in_envelope_optional::<
1169 bool,
1170 fidl::encoding::DefaultFuchsiaResourceDialect,
1171 >(
1172 self.use_fake_sag.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1173 encoder,
1174 offset + cur_offset,
1175 depth,
1176 )?;
1177
1178 _prev_end_offset = cur_offset + envelope_size;
1179 if 2 > max_ordinal {
1180 return Ok(());
1181 }
1182
1183 let cur_offset: usize = (2 - 1) * envelope_size;
1186
1187 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1189
1190 fidl::encoding::encode_in_envelope_optional::<
1195 bool,
1196 fidl::encoding::DefaultFuchsiaResourceDialect,
1197 >(
1198 self.wait_for_suspending_token
1199 .as_ref()
1200 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1201 encoder,
1202 offset + cur_offset,
1203 depth,
1204 )?;
1205
1206 _prev_end_offset = cur_offset + envelope_size;
1207 if 3 > max_ordinal {
1208 return Ok(());
1209 }
1210
1211 let cur_offset: usize = (3 - 1) * envelope_size;
1214
1215 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1217
1218 fidl::encoding::encode_in_envelope_optional::<
1223 bool,
1224 fidl::encoding::DefaultFuchsiaResourceDialect,
1225 >(
1226 self.use_suspender.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1227 encoder,
1228 offset + cur_offset,
1229 depth,
1230 )?;
1231
1232 _prev_end_offset = cur_offset + envelope_size;
1233
1234 Ok(())
1235 }
1236 }
1237
1238 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RealmOptions {
1239 #[inline(always)]
1240 fn new_empty() -> Self {
1241 Self::default()
1242 }
1243
1244 unsafe fn decode(
1245 &mut self,
1246 decoder: &mut fidl::encoding::Decoder<
1247 '_,
1248 fidl::encoding::DefaultFuchsiaResourceDialect,
1249 >,
1250 offset: usize,
1251 mut depth: fidl::encoding::Depth,
1252 ) -> fidl::Result<()> {
1253 decoder.debug_check_bounds::<Self>(offset);
1254 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1255 None => return Err(fidl::Error::NotNullable),
1256 Some(len) => len,
1257 };
1258 if len == 0 {
1260 return Ok(());
1261 };
1262 depth.increment()?;
1263 let envelope_size = 8;
1264 let bytes_len = len * envelope_size;
1265 let offset = decoder.out_of_line_offset(bytes_len)?;
1266 let mut _next_ordinal_to_read = 0;
1268 let mut next_offset = offset;
1269 let end_offset = offset + bytes_len;
1270 _next_ordinal_to_read += 1;
1271 if next_offset >= end_offset {
1272 return Ok(());
1273 }
1274
1275 while _next_ordinal_to_read < 1 {
1277 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1278 _next_ordinal_to_read += 1;
1279 next_offset += envelope_size;
1280 }
1281
1282 let next_out_of_line = decoder.next_out_of_line();
1283 let handles_before = decoder.remaining_handles();
1284 if let Some((inlined, num_bytes, num_handles)) =
1285 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1286 {
1287 let member_inline_size =
1288 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1289 if inlined != (member_inline_size <= 4) {
1290 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1291 }
1292 let inner_offset;
1293 let mut inner_depth = depth.clone();
1294 if inlined {
1295 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1296 inner_offset = next_offset;
1297 } else {
1298 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1299 inner_depth.increment()?;
1300 }
1301 let val_ref = self.use_fake_sag.get_or_insert_with(|| {
1302 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
1303 });
1304 fidl::decode!(
1305 bool,
1306 fidl::encoding::DefaultFuchsiaResourceDialect,
1307 val_ref,
1308 decoder,
1309 inner_offset,
1310 inner_depth
1311 )?;
1312 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1313 {
1314 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1315 }
1316 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1317 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1318 }
1319 }
1320
1321 next_offset += envelope_size;
1322 _next_ordinal_to_read += 1;
1323 if next_offset >= end_offset {
1324 return Ok(());
1325 }
1326
1327 while _next_ordinal_to_read < 2 {
1329 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1330 _next_ordinal_to_read += 1;
1331 next_offset += envelope_size;
1332 }
1333
1334 let next_out_of_line = decoder.next_out_of_line();
1335 let handles_before = decoder.remaining_handles();
1336 if let Some((inlined, num_bytes, num_handles)) =
1337 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1338 {
1339 let member_inline_size =
1340 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1341 if inlined != (member_inline_size <= 4) {
1342 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1343 }
1344 let inner_offset;
1345 let mut inner_depth = depth.clone();
1346 if inlined {
1347 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1348 inner_offset = next_offset;
1349 } else {
1350 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1351 inner_depth.increment()?;
1352 }
1353 let val_ref = self.wait_for_suspending_token.get_or_insert_with(|| {
1354 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
1355 });
1356 fidl::decode!(
1357 bool,
1358 fidl::encoding::DefaultFuchsiaResourceDialect,
1359 val_ref,
1360 decoder,
1361 inner_offset,
1362 inner_depth
1363 )?;
1364 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1365 {
1366 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1367 }
1368 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1369 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1370 }
1371 }
1372
1373 next_offset += envelope_size;
1374 _next_ordinal_to_read += 1;
1375 if next_offset >= end_offset {
1376 return Ok(());
1377 }
1378
1379 while _next_ordinal_to_read < 3 {
1381 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1382 _next_ordinal_to_read += 1;
1383 next_offset += envelope_size;
1384 }
1385
1386 let next_out_of_line = decoder.next_out_of_line();
1387 let handles_before = decoder.remaining_handles();
1388 if let Some((inlined, num_bytes, num_handles)) =
1389 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1390 {
1391 let member_inline_size =
1392 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1393 if inlined != (member_inline_size <= 4) {
1394 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1395 }
1396 let inner_offset;
1397 let mut inner_depth = depth.clone();
1398 if inlined {
1399 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1400 inner_offset = next_offset;
1401 } else {
1402 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1403 inner_depth.increment()?;
1404 }
1405 let val_ref = self.use_suspender.get_or_insert_with(|| {
1406 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
1407 });
1408 fidl::decode!(
1409 bool,
1410 fidl::encoding::DefaultFuchsiaResourceDialect,
1411 val_ref,
1412 decoder,
1413 inner_offset,
1414 inner_depth
1415 )?;
1416 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1417 {
1418 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1419 }
1420 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1421 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1422 }
1423 }
1424
1425 next_offset += envelope_size;
1426
1427 while next_offset < end_offset {
1429 _next_ordinal_to_read += 1;
1430 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1431 next_offset += envelope_size;
1432 }
1433
1434 Ok(())
1435 }
1436 }
1437}