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_driver_test__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct InternalGetBootDirectoryResponse {
16 pub boot_dir: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for InternalGetBootDirectoryResponse
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct InternalGetTestPackageResponse {
26 pub test_pkg_dir: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for InternalGetTestPackageResponse
31{
32}
33
34#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35pub struct ManifestProviderGetManifestResponse {
36 pub manifest: fidl::Stream,
37}
38
39impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
40 for ManifestProviderGetManifestResponse
41{
42}
43
44#[derive(Debug, PartialEq)]
45pub struct RealmStartRequest {
46 pub args: RealmArgs,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmStartRequest {}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct ResourceProviderGetDeviceTreeResponse {
53 pub devicetree: fidl::Vmo,
54}
55
56impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
57 for ResourceProviderGetDeviceTreeResponse
58{
59}
60
61#[derive(Debug, Default, PartialEq)]
63pub struct RealmArgs {
64 pub boot: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
67 pub root_driver: Option<String>,
72 pub driver_tests_enable_all: Option<bool>,
76 pub driver_tests_enable: Option<Vec<String>>,
80 pub driver_tests_disable: Option<Vec<String>>,
86 pub driver_log_level: Option<Vec<DriverLog>>,
89 pub driver_disable: Option<Vec<String>>,
92 pub driver_bind_eager: Option<Vec<String>>,
96 pub board_name: Option<String>,
99 pub offers: Option<Vec<Offer>>,
103 pub exposes: Option<Vec<Expose>>,
107 pub pkg: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
122 pub dtr_offers: Option<Vec<fidl_fuchsia_component_test::Capability>>,
126 pub dtr_exposes: Option<Vec<fidl_fuchsia_component_test::Capability>>,
130 pub test_component: Option<fidl_fuchsia_component_resolution::Component>,
140 pub driver_index_stop_timeout_millis: Option<i64>,
144 pub software_devices: Option<Vec<SoftwareDevice>>,
149 pub boot_driver_components: Option<Vec<String>>,
155 pub devicetree: Option<fidl::Vmo>,
157 pub platform_vid: Option<u32>,
159 pub platform_pid: Option<u32>,
161 #[doc(hidden)]
162 pub __source_breaking: fidl::marker::SourceBreaking,
163}
164
165impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmArgs {}
166
167#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
168pub struct DriverListsMarker;
169
170impl fidl::endpoints::ProtocolMarker for DriverListsMarker {
171 type Proxy = DriverListsProxy;
172 type RequestStream = DriverListsRequestStream;
173 #[cfg(target_os = "fuchsia")]
174 type SynchronousProxy = DriverListsSynchronousProxy;
175
176 const DEBUG_NAME: &'static str = "fuchsia.driver.test.DriverLists";
177}
178impl fidl::endpoints::DiscoverableProtocolMarker for DriverListsMarker {}
179pub type DriverListsGetDriverListsResult = Result<(Vec<String>, Vec<String>), i32>;
180
181pub trait DriverListsProxyInterface: Send + Sync {
182 type GetDriverListsResponseFut: std::future::Future<Output = Result<DriverListsGetDriverListsResult, fidl::Error>>
183 + Send;
184 fn r#get_driver_lists(&self) -> Self::GetDriverListsResponseFut;
185}
186#[derive(Debug)]
187#[cfg(target_os = "fuchsia")]
188pub struct DriverListsSynchronousProxy {
189 client: fidl::client::sync::Client,
190}
191
192#[cfg(target_os = "fuchsia")]
193impl fidl::endpoints::SynchronousProxy for DriverListsSynchronousProxy {
194 type Proxy = DriverListsProxy;
195 type Protocol = DriverListsMarker;
196
197 fn from_channel(inner: fidl::Channel) -> Self {
198 Self::new(inner)
199 }
200
201 fn into_channel(self) -> fidl::Channel {
202 self.client.into_channel()
203 }
204
205 fn as_channel(&self) -> &fidl::Channel {
206 self.client.as_channel()
207 }
208}
209
210#[cfg(target_os = "fuchsia")]
211impl DriverListsSynchronousProxy {
212 pub fn new(channel: fidl::Channel) -> Self {
213 let protocol_name = <DriverListsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
214 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
215 }
216
217 pub fn into_channel(self) -> fidl::Channel {
218 self.client.into_channel()
219 }
220
221 pub fn wait_for_event(
224 &self,
225 deadline: zx::MonotonicInstant,
226 ) -> Result<DriverListsEvent, fidl::Error> {
227 DriverListsEvent::decode(self.client.wait_for_event(deadline)?)
228 }
229
230 pub fn r#get_driver_lists(
231 &self,
232 ___deadline: zx::MonotonicInstant,
233 ) -> Result<DriverListsGetDriverListsResult, fidl::Error> {
234 let _response = self.client.send_query::<
235 fidl::encoding::EmptyPayload,
236 fidl::encoding::ResultType<DriverListsGetDriverListsResponse, i32>,
237 >(
238 (),
239 0x63c3de40e768357,
240 fidl::encoding::DynamicFlags::empty(),
241 ___deadline,
242 )?;
243 Ok(_response.map(|x| (x.boot_drivers, x.base_drivers)))
244 }
245}
246
247#[cfg(target_os = "fuchsia")]
248impl From<DriverListsSynchronousProxy> for zx::Handle {
249 fn from(value: DriverListsSynchronousProxy) -> Self {
250 value.into_channel().into()
251 }
252}
253
254#[cfg(target_os = "fuchsia")]
255impl From<fidl::Channel> for DriverListsSynchronousProxy {
256 fn from(value: fidl::Channel) -> Self {
257 Self::new(value)
258 }
259}
260
261#[cfg(target_os = "fuchsia")]
262impl fidl::endpoints::FromClient for DriverListsSynchronousProxy {
263 type Protocol = DriverListsMarker;
264
265 fn from_client(value: fidl::endpoints::ClientEnd<DriverListsMarker>) -> Self {
266 Self::new(value.into_channel())
267 }
268}
269
270#[derive(Debug, Clone)]
271pub struct DriverListsProxy {
272 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
273}
274
275impl fidl::endpoints::Proxy for DriverListsProxy {
276 type Protocol = DriverListsMarker;
277
278 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
279 Self::new(inner)
280 }
281
282 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
283 self.client.into_channel().map_err(|client| Self { client })
284 }
285
286 fn as_channel(&self) -> &::fidl::AsyncChannel {
287 self.client.as_channel()
288 }
289}
290
291impl DriverListsProxy {
292 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
294 let protocol_name = <DriverListsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
295 Self { client: fidl::client::Client::new(channel, protocol_name) }
296 }
297
298 pub fn take_event_stream(&self) -> DriverListsEventStream {
304 DriverListsEventStream { event_receiver: self.client.take_event_receiver() }
305 }
306
307 pub fn r#get_driver_lists(
308 &self,
309 ) -> fidl::client::QueryResponseFut<
310 DriverListsGetDriverListsResult,
311 fidl::encoding::DefaultFuchsiaResourceDialect,
312 > {
313 DriverListsProxyInterface::r#get_driver_lists(self)
314 }
315}
316
317impl DriverListsProxyInterface for DriverListsProxy {
318 type GetDriverListsResponseFut = fidl::client::QueryResponseFut<
319 DriverListsGetDriverListsResult,
320 fidl::encoding::DefaultFuchsiaResourceDialect,
321 >;
322 fn r#get_driver_lists(&self) -> Self::GetDriverListsResponseFut {
323 fn _decode(
324 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
325 ) -> Result<DriverListsGetDriverListsResult, fidl::Error> {
326 let _response = fidl::client::decode_transaction_body::<
327 fidl::encoding::ResultType<DriverListsGetDriverListsResponse, i32>,
328 fidl::encoding::DefaultFuchsiaResourceDialect,
329 0x63c3de40e768357,
330 >(_buf?)?;
331 Ok(_response.map(|x| (x.boot_drivers, x.base_drivers)))
332 }
333 self.client
334 .send_query_and_decode::<fidl::encoding::EmptyPayload, DriverListsGetDriverListsResult>(
335 (),
336 0x63c3de40e768357,
337 fidl::encoding::DynamicFlags::empty(),
338 _decode,
339 )
340 }
341}
342
343pub struct DriverListsEventStream {
344 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
345}
346
347impl std::marker::Unpin for DriverListsEventStream {}
348
349impl futures::stream::FusedStream for DriverListsEventStream {
350 fn is_terminated(&self) -> bool {
351 self.event_receiver.is_terminated()
352 }
353}
354
355impl futures::Stream for DriverListsEventStream {
356 type Item = Result<DriverListsEvent, fidl::Error>;
357
358 fn poll_next(
359 mut self: std::pin::Pin<&mut Self>,
360 cx: &mut std::task::Context<'_>,
361 ) -> std::task::Poll<Option<Self::Item>> {
362 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
363 &mut self.event_receiver,
364 cx
365 )?) {
366 Some(buf) => std::task::Poll::Ready(Some(DriverListsEvent::decode(buf))),
367 None => std::task::Poll::Ready(None),
368 }
369 }
370}
371
372#[derive(Debug)]
373pub enum DriverListsEvent {}
374
375impl DriverListsEvent {
376 fn decode(
378 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
379 ) -> Result<DriverListsEvent, fidl::Error> {
380 let (bytes, _handles) = buf.split_mut();
381 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
382 debug_assert_eq!(tx_header.tx_id, 0);
383 match tx_header.ordinal {
384 _ => Err(fidl::Error::UnknownOrdinal {
385 ordinal: tx_header.ordinal,
386 protocol_name: <DriverListsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
387 }),
388 }
389 }
390}
391
392pub struct DriverListsRequestStream {
394 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
395 is_terminated: bool,
396}
397
398impl std::marker::Unpin for DriverListsRequestStream {}
399
400impl futures::stream::FusedStream for DriverListsRequestStream {
401 fn is_terminated(&self) -> bool {
402 self.is_terminated
403 }
404}
405
406impl fidl::endpoints::RequestStream for DriverListsRequestStream {
407 type Protocol = DriverListsMarker;
408 type ControlHandle = DriverListsControlHandle;
409
410 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
411 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
412 }
413
414 fn control_handle(&self) -> Self::ControlHandle {
415 DriverListsControlHandle { inner: self.inner.clone() }
416 }
417
418 fn into_inner(
419 self,
420 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
421 {
422 (self.inner, self.is_terminated)
423 }
424
425 fn from_inner(
426 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
427 is_terminated: bool,
428 ) -> Self {
429 Self { inner, is_terminated }
430 }
431}
432
433impl futures::Stream for DriverListsRequestStream {
434 type Item = Result<DriverListsRequest, fidl::Error>;
435
436 fn poll_next(
437 mut self: std::pin::Pin<&mut Self>,
438 cx: &mut std::task::Context<'_>,
439 ) -> std::task::Poll<Option<Self::Item>> {
440 let this = &mut *self;
441 if this.inner.check_shutdown(cx) {
442 this.is_terminated = true;
443 return std::task::Poll::Ready(None);
444 }
445 if this.is_terminated {
446 panic!("polled DriverListsRequestStream after completion");
447 }
448 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
449 |bytes, handles| {
450 match this.inner.channel().read_etc(cx, bytes, handles) {
451 std::task::Poll::Ready(Ok(())) => {}
452 std::task::Poll::Pending => return std::task::Poll::Pending,
453 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
454 this.is_terminated = true;
455 return std::task::Poll::Ready(None);
456 }
457 std::task::Poll::Ready(Err(e)) => {
458 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
459 e.into(),
460 ))));
461 }
462 }
463
464 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
466
467 std::task::Poll::Ready(Some(match header.ordinal {
468 0x63c3de40e768357 => {
469 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
470 let mut req = fidl::new_empty!(
471 fidl::encoding::EmptyPayload,
472 fidl::encoding::DefaultFuchsiaResourceDialect
473 );
474 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
475 let control_handle = DriverListsControlHandle { inner: this.inner.clone() };
476 Ok(DriverListsRequest::GetDriverLists {
477 responder: DriverListsGetDriverListsResponder {
478 control_handle: std::mem::ManuallyDrop::new(control_handle),
479 tx_id: header.tx_id,
480 },
481 })
482 }
483 _ => Err(fidl::Error::UnknownOrdinal {
484 ordinal: header.ordinal,
485 protocol_name:
486 <DriverListsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
487 }),
488 }))
489 },
490 )
491 }
492}
493
494#[derive(Debug)]
497pub enum DriverListsRequest {
498 GetDriverLists { responder: DriverListsGetDriverListsResponder },
499}
500
501impl DriverListsRequest {
502 #[allow(irrefutable_let_patterns)]
503 pub fn into_get_driver_lists(self) -> Option<(DriverListsGetDriverListsResponder)> {
504 if let DriverListsRequest::GetDriverLists { responder } = self {
505 Some((responder))
506 } else {
507 None
508 }
509 }
510
511 pub fn method_name(&self) -> &'static str {
513 match *self {
514 DriverListsRequest::GetDriverLists { .. } => "get_driver_lists",
515 }
516 }
517}
518
519#[derive(Debug, Clone)]
520pub struct DriverListsControlHandle {
521 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
522}
523
524impl fidl::endpoints::ControlHandle for DriverListsControlHandle {
525 fn shutdown(&self) {
526 self.inner.shutdown()
527 }
528 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
529 self.inner.shutdown_with_epitaph(status)
530 }
531
532 fn is_closed(&self) -> bool {
533 self.inner.channel().is_closed()
534 }
535 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
536 self.inner.channel().on_closed()
537 }
538
539 #[cfg(target_os = "fuchsia")]
540 fn signal_peer(
541 &self,
542 clear_mask: zx::Signals,
543 set_mask: zx::Signals,
544 ) -> Result<(), zx_status::Status> {
545 use fidl::Peered;
546 self.inner.channel().signal_peer(clear_mask, set_mask)
547 }
548}
549
550impl DriverListsControlHandle {}
551
552#[must_use = "FIDL methods require a response to be sent"]
553#[derive(Debug)]
554pub struct DriverListsGetDriverListsResponder {
555 control_handle: std::mem::ManuallyDrop<DriverListsControlHandle>,
556 tx_id: u32,
557}
558
559impl std::ops::Drop for DriverListsGetDriverListsResponder {
563 fn drop(&mut self) {
564 self.control_handle.shutdown();
565 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
567 }
568}
569
570impl fidl::endpoints::Responder for DriverListsGetDriverListsResponder {
571 type ControlHandle = DriverListsControlHandle;
572
573 fn control_handle(&self) -> &DriverListsControlHandle {
574 &self.control_handle
575 }
576
577 fn drop_without_shutdown(mut self) {
578 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
580 std::mem::forget(self);
582 }
583}
584
585impl DriverListsGetDriverListsResponder {
586 pub fn send(self, mut result: Result<(&[String], &[String]), i32>) -> Result<(), fidl::Error> {
590 let _result = self.send_raw(result);
591 if _result.is_err() {
592 self.control_handle.shutdown();
593 }
594 self.drop_without_shutdown();
595 _result
596 }
597
598 pub fn send_no_shutdown_on_err(
600 self,
601 mut result: Result<(&[String], &[String]), i32>,
602 ) -> Result<(), fidl::Error> {
603 let _result = self.send_raw(result);
604 self.drop_without_shutdown();
605 _result
606 }
607
608 fn send_raw(&self, mut result: Result<(&[String], &[String]), i32>) -> Result<(), fidl::Error> {
609 self.control_handle
610 .inner
611 .send::<fidl::encoding::ResultType<DriverListsGetDriverListsResponse, i32>>(
612 result,
613 self.tx_id,
614 0x63c3de40e768357,
615 fidl::encoding::DynamicFlags::empty(),
616 )
617 }
618}
619
620#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
621pub struct InternalMarker;
622
623impl fidl::endpoints::ProtocolMarker for InternalMarker {
624 type Proxy = InternalProxy;
625 type RequestStream = InternalRequestStream;
626 #[cfg(target_os = "fuchsia")]
627 type SynchronousProxy = InternalSynchronousProxy;
628
629 const DEBUG_NAME: &'static str = "fuchsia.driver.test.Internal";
630}
631impl fidl::endpoints::DiscoverableProtocolMarker for InternalMarker {}
632pub type InternalGetTestPackageResult =
633 Result<Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, i32>;
634pub type InternalGetTestResolutionContextResult =
635 Result<Option<Box<fidl_fuchsia_component_resolution::Context>>, i32>;
636pub type InternalGetBootDirectoryResult =
637 Result<Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, i32>;
638pub type InternalGetBootDriverOverridesResult = Result<Vec<String>, i32>;
639
640pub trait InternalProxyInterface: Send + Sync {
641 type GetTestPackageResponseFut: std::future::Future<Output = Result<InternalGetTestPackageResult, fidl::Error>>
642 + Send;
643 fn r#get_test_package(&self) -> Self::GetTestPackageResponseFut;
644 type GetTestResolutionContextResponseFut: std::future::Future<Output = Result<InternalGetTestResolutionContextResult, fidl::Error>>
645 + Send;
646 fn r#get_test_resolution_context(&self) -> Self::GetTestResolutionContextResponseFut;
647 type GetBootDirectoryResponseFut: std::future::Future<Output = Result<InternalGetBootDirectoryResult, fidl::Error>>
648 + Send;
649 fn r#get_boot_directory(&self) -> Self::GetBootDirectoryResponseFut;
650 type GetBootDriverOverridesResponseFut: std::future::Future<Output = Result<InternalGetBootDriverOverridesResult, fidl::Error>>
651 + Send;
652 fn r#get_boot_driver_overrides(&self) -> Self::GetBootDriverOverridesResponseFut;
653}
654#[derive(Debug)]
655#[cfg(target_os = "fuchsia")]
656pub struct InternalSynchronousProxy {
657 client: fidl::client::sync::Client,
658}
659
660#[cfg(target_os = "fuchsia")]
661impl fidl::endpoints::SynchronousProxy for InternalSynchronousProxy {
662 type Proxy = InternalProxy;
663 type Protocol = InternalMarker;
664
665 fn from_channel(inner: fidl::Channel) -> Self {
666 Self::new(inner)
667 }
668
669 fn into_channel(self) -> fidl::Channel {
670 self.client.into_channel()
671 }
672
673 fn as_channel(&self) -> &fidl::Channel {
674 self.client.as_channel()
675 }
676}
677
678#[cfg(target_os = "fuchsia")]
679impl InternalSynchronousProxy {
680 pub fn new(channel: fidl::Channel) -> Self {
681 let protocol_name = <InternalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
682 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
683 }
684
685 pub fn into_channel(self) -> fidl::Channel {
686 self.client.into_channel()
687 }
688
689 pub fn wait_for_event(
692 &self,
693 deadline: zx::MonotonicInstant,
694 ) -> Result<InternalEvent, fidl::Error> {
695 InternalEvent::decode(self.client.wait_for_event(deadline)?)
696 }
697
698 pub fn r#get_test_package(
702 &self,
703 ___deadline: zx::MonotonicInstant,
704 ) -> Result<InternalGetTestPackageResult, fidl::Error> {
705 let _response = self.client.send_query::<
706 fidl::encoding::EmptyPayload,
707 fidl::encoding::ResultType<InternalGetTestPackageResponse, i32>,
708 >(
709 (),
710 0x298c1d6e57d57db8,
711 fidl::encoding::DynamicFlags::empty(),
712 ___deadline,
713 )?;
714 Ok(_response.map(|x| x.test_pkg_dir))
715 }
716
717 pub fn r#get_test_resolution_context(
720 &self,
721 ___deadline: zx::MonotonicInstant,
722 ) -> Result<InternalGetTestResolutionContextResult, fidl::Error> {
723 let _response = self.client.send_query::<
724 fidl::encoding::EmptyPayload,
725 fidl::encoding::ResultType<InternalGetTestResolutionContextResponse, i32>,
726 >(
727 (),
728 0x78e5d4f1fefd67b7,
729 fidl::encoding::DynamicFlags::empty(),
730 ___deadline,
731 )?;
732 Ok(_response.map(|x| x.context))
733 }
734
735 pub fn r#get_boot_directory(
739 &self,
740 ___deadline: zx::MonotonicInstant,
741 ) -> Result<InternalGetBootDirectoryResult, fidl::Error> {
742 let _response = self.client.send_query::<
743 fidl::encoding::EmptyPayload,
744 fidl::encoding::ResultType<InternalGetBootDirectoryResponse, i32>,
745 >(
746 (),
747 0x3e1969123c4dfb31,
748 fidl::encoding::DynamicFlags::empty(),
749 ___deadline,
750 )?;
751 Ok(_response.map(|x| x.boot_dir))
752 }
753
754 pub fn r#get_boot_driver_overrides(
755 &self,
756 ___deadline: zx::MonotonicInstant,
757 ) -> Result<InternalGetBootDriverOverridesResult, fidl::Error> {
758 let _response = self.client.send_query::<
759 fidl::encoding::EmptyPayload,
760 fidl::encoding::ResultType<InternalGetBootDriverOverridesResponse, i32>,
761 >(
762 (),
763 0x6a40991d8259e008,
764 fidl::encoding::DynamicFlags::empty(),
765 ___deadline,
766 )?;
767 Ok(_response.map(|x| x.boot_overrides))
768 }
769}
770
771#[cfg(target_os = "fuchsia")]
772impl From<InternalSynchronousProxy> for zx::Handle {
773 fn from(value: InternalSynchronousProxy) -> Self {
774 value.into_channel().into()
775 }
776}
777
778#[cfg(target_os = "fuchsia")]
779impl From<fidl::Channel> for InternalSynchronousProxy {
780 fn from(value: fidl::Channel) -> Self {
781 Self::new(value)
782 }
783}
784
785#[cfg(target_os = "fuchsia")]
786impl fidl::endpoints::FromClient for InternalSynchronousProxy {
787 type Protocol = InternalMarker;
788
789 fn from_client(value: fidl::endpoints::ClientEnd<InternalMarker>) -> Self {
790 Self::new(value.into_channel())
791 }
792}
793
794#[derive(Debug, Clone)]
795pub struct InternalProxy {
796 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
797}
798
799impl fidl::endpoints::Proxy for InternalProxy {
800 type Protocol = InternalMarker;
801
802 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
803 Self::new(inner)
804 }
805
806 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
807 self.client.into_channel().map_err(|client| Self { client })
808 }
809
810 fn as_channel(&self) -> &::fidl::AsyncChannel {
811 self.client.as_channel()
812 }
813}
814
815impl InternalProxy {
816 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
818 let protocol_name = <InternalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
819 Self { client: fidl::client::Client::new(channel, protocol_name) }
820 }
821
822 pub fn take_event_stream(&self) -> InternalEventStream {
828 InternalEventStream { event_receiver: self.client.take_event_receiver() }
829 }
830
831 pub fn r#get_test_package(
835 &self,
836 ) -> fidl::client::QueryResponseFut<
837 InternalGetTestPackageResult,
838 fidl::encoding::DefaultFuchsiaResourceDialect,
839 > {
840 InternalProxyInterface::r#get_test_package(self)
841 }
842
843 pub fn r#get_test_resolution_context(
846 &self,
847 ) -> fidl::client::QueryResponseFut<
848 InternalGetTestResolutionContextResult,
849 fidl::encoding::DefaultFuchsiaResourceDialect,
850 > {
851 InternalProxyInterface::r#get_test_resolution_context(self)
852 }
853
854 pub fn r#get_boot_directory(
858 &self,
859 ) -> fidl::client::QueryResponseFut<
860 InternalGetBootDirectoryResult,
861 fidl::encoding::DefaultFuchsiaResourceDialect,
862 > {
863 InternalProxyInterface::r#get_boot_directory(self)
864 }
865
866 pub fn r#get_boot_driver_overrides(
867 &self,
868 ) -> fidl::client::QueryResponseFut<
869 InternalGetBootDriverOverridesResult,
870 fidl::encoding::DefaultFuchsiaResourceDialect,
871 > {
872 InternalProxyInterface::r#get_boot_driver_overrides(self)
873 }
874}
875
876impl InternalProxyInterface for InternalProxy {
877 type GetTestPackageResponseFut = fidl::client::QueryResponseFut<
878 InternalGetTestPackageResult,
879 fidl::encoding::DefaultFuchsiaResourceDialect,
880 >;
881 fn r#get_test_package(&self) -> Self::GetTestPackageResponseFut {
882 fn _decode(
883 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
884 ) -> Result<InternalGetTestPackageResult, fidl::Error> {
885 let _response = fidl::client::decode_transaction_body::<
886 fidl::encoding::ResultType<InternalGetTestPackageResponse, i32>,
887 fidl::encoding::DefaultFuchsiaResourceDialect,
888 0x298c1d6e57d57db8,
889 >(_buf?)?;
890 Ok(_response.map(|x| x.test_pkg_dir))
891 }
892 self.client
893 .send_query_and_decode::<fidl::encoding::EmptyPayload, InternalGetTestPackageResult>(
894 (),
895 0x298c1d6e57d57db8,
896 fidl::encoding::DynamicFlags::empty(),
897 _decode,
898 )
899 }
900
901 type GetTestResolutionContextResponseFut = fidl::client::QueryResponseFut<
902 InternalGetTestResolutionContextResult,
903 fidl::encoding::DefaultFuchsiaResourceDialect,
904 >;
905 fn r#get_test_resolution_context(&self) -> Self::GetTestResolutionContextResponseFut {
906 fn _decode(
907 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
908 ) -> Result<InternalGetTestResolutionContextResult, fidl::Error> {
909 let _response = fidl::client::decode_transaction_body::<
910 fidl::encoding::ResultType<InternalGetTestResolutionContextResponse, i32>,
911 fidl::encoding::DefaultFuchsiaResourceDialect,
912 0x78e5d4f1fefd67b7,
913 >(_buf?)?;
914 Ok(_response.map(|x| x.context))
915 }
916 self.client.send_query_and_decode::<
917 fidl::encoding::EmptyPayload,
918 InternalGetTestResolutionContextResult,
919 >(
920 (),
921 0x78e5d4f1fefd67b7,
922 fidl::encoding::DynamicFlags::empty(),
923 _decode,
924 )
925 }
926
927 type GetBootDirectoryResponseFut = fidl::client::QueryResponseFut<
928 InternalGetBootDirectoryResult,
929 fidl::encoding::DefaultFuchsiaResourceDialect,
930 >;
931 fn r#get_boot_directory(&self) -> Self::GetBootDirectoryResponseFut {
932 fn _decode(
933 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
934 ) -> Result<InternalGetBootDirectoryResult, fidl::Error> {
935 let _response = fidl::client::decode_transaction_body::<
936 fidl::encoding::ResultType<InternalGetBootDirectoryResponse, i32>,
937 fidl::encoding::DefaultFuchsiaResourceDialect,
938 0x3e1969123c4dfb31,
939 >(_buf?)?;
940 Ok(_response.map(|x| x.boot_dir))
941 }
942 self.client
943 .send_query_and_decode::<fidl::encoding::EmptyPayload, InternalGetBootDirectoryResult>(
944 (),
945 0x3e1969123c4dfb31,
946 fidl::encoding::DynamicFlags::empty(),
947 _decode,
948 )
949 }
950
951 type GetBootDriverOverridesResponseFut = fidl::client::QueryResponseFut<
952 InternalGetBootDriverOverridesResult,
953 fidl::encoding::DefaultFuchsiaResourceDialect,
954 >;
955 fn r#get_boot_driver_overrides(&self) -> Self::GetBootDriverOverridesResponseFut {
956 fn _decode(
957 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
958 ) -> Result<InternalGetBootDriverOverridesResult, fidl::Error> {
959 let _response = fidl::client::decode_transaction_body::<
960 fidl::encoding::ResultType<InternalGetBootDriverOverridesResponse, i32>,
961 fidl::encoding::DefaultFuchsiaResourceDialect,
962 0x6a40991d8259e008,
963 >(_buf?)?;
964 Ok(_response.map(|x| x.boot_overrides))
965 }
966 self.client.send_query_and_decode::<
967 fidl::encoding::EmptyPayload,
968 InternalGetBootDriverOverridesResult,
969 >(
970 (),
971 0x6a40991d8259e008,
972 fidl::encoding::DynamicFlags::empty(),
973 _decode,
974 )
975 }
976}
977
978pub struct InternalEventStream {
979 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
980}
981
982impl std::marker::Unpin for InternalEventStream {}
983
984impl futures::stream::FusedStream for InternalEventStream {
985 fn is_terminated(&self) -> bool {
986 self.event_receiver.is_terminated()
987 }
988}
989
990impl futures::Stream for InternalEventStream {
991 type Item = Result<InternalEvent, fidl::Error>;
992
993 fn poll_next(
994 mut self: std::pin::Pin<&mut Self>,
995 cx: &mut std::task::Context<'_>,
996 ) -> std::task::Poll<Option<Self::Item>> {
997 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
998 &mut self.event_receiver,
999 cx
1000 )?) {
1001 Some(buf) => std::task::Poll::Ready(Some(InternalEvent::decode(buf))),
1002 None => std::task::Poll::Ready(None),
1003 }
1004 }
1005}
1006
1007#[derive(Debug)]
1008pub enum InternalEvent {}
1009
1010impl InternalEvent {
1011 fn decode(
1013 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1014 ) -> Result<InternalEvent, fidl::Error> {
1015 let (bytes, _handles) = buf.split_mut();
1016 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1017 debug_assert_eq!(tx_header.tx_id, 0);
1018 match tx_header.ordinal {
1019 _ => Err(fidl::Error::UnknownOrdinal {
1020 ordinal: tx_header.ordinal,
1021 protocol_name: <InternalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1022 }),
1023 }
1024 }
1025}
1026
1027pub struct InternalRequestStream {
1029 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1030 is_terminated: bool,
1031}
1032
1033impl std::marker::Unpin for InternalRequestStream {}
1034
1035impl futures::stream::FusedStream for InternalRequestStream {
1036 fn is_terminated(&self) -> bool {
1037 self.is_terminated
1038 }
1039}
1040
1041impl fidl::endpoints::RequestStream for InternalRequestStream {
1042 type Protocol = InternalMarker;
1043 type ControlHandle = InternalControlHandle;
1044
1045 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1046 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1047 }
1048
1049 fn control_handle(&self) -> Self::ControlHandle {
1050 InternalControlHandle { inner: self.inner.clone() }
1051 }
1052
1053 fn into_inner(
1054 self,
1055 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1056 {
1057 (self.inner, self.is_terminated)
1058 }
1059
1060 fn from_inner(
1061 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1062 is_terminated: bool,
1063 ) -> Self {
1064 Self { inner, is_terminated }
1065 }
1066}
1067
1068impl futures::Stream for InternalRequestStream {
1069 type Item = Result<InternalRequest, fidl::Error>;
1070
1071 fn poll_next(
1072 mut self: std::pin::Pin<&mut Self>,
1073 cx: &mut std::task::Context<'_>,
1074 ) -> std::task::Poll<Option<Self::Item>> {
1075 let this = &mut *self;
1076 if this.inner.check_shutdown(cx) {
1077 this.is_terminated = true;
1078 return std::task::Poll::Ready(None);
1079 }
1080 if this.is_terminated {
1081 panic!("polled InternalRequestStream after completion");
1082 }
1083 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1084 |bytes, handles| {
1085 match this.inner.channel().read_etc(cx, bytes, handles) {
1086 std::task::Poll::Ready(Ok(())) => {}
1087 std::task::Poll::Pending => return std::task::Poll::Pending,
1088 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1089 this.is_terminated = true;
1090 return std::task::Poll::Ready(None);
1091 }
1092 std::task::Poll::Ready(Err(e)) => {
1093 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1094 e.into(),
1095 ))));
1096 }
1097 }
1098
1099 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1101
1102 std::task::Poll::Ready(Some(match header.ordinal {
1103 0x298c1d6e57d57db8 => {
1104 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1105 let mut req = fidl::new_empty!(
1106 fidl::encoding::EmptyPayload,
1107 fidl::encoding::DefaultFuchsiaResourceDialect
1108 );
1109 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1110 let control_handle = InternalControlHandle { inner: this.inner.clone() };
1111 Ok(InternalRequest::GetTestPackage {
1112 responder: InternalGetTestPackageResponder {
1113 control_handle: std::mem::ManuallyDrop::new(control_handle),
1114 tx_id: header.tx_id,
1115 },
1116 })
1117 }
1118 0x78e5d4f1fefd67b7 => {
1119 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1120 let mut req = fidl::new_empty!(
1121 fidl::encoding::EmptyPayload,
1122 fidl::encoding::DefaultFuchsiaResourceDialect
1123 );
1124 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1125 let control_handle = InternalControlHandle { inner: this.inner.clone() };
1126 Ok(InternalRequest::GetTestResolutionContext {
1127 responder: InternalGetTestResolutionContextResponder {
1128 control_handle: std::mem::ManuallyDrop::new(control_handle),
1129 tx_id: header.tx_id,
1130 },
1131 })
1132 }
1133 0x3e1969123c4dfb31 => {
1134 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1135 let mut req = fidl::new_empty!(
1136 fidl::encoding::EmptyPayload,
1137 fidl::encoding::DefaultFuchsiaResourceDialect
1138 );
1139 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1140 let control_handle = InternalControlHandle { inner: this.inner.clone() };
1141 Ok(InternalRequest::GetBootDirectory {
1142 responder: InternalGetBootDirectoryResponder {
1143 control_handle: std::mem::ManuallyDrop::new(control_handle),
1144 tx_id: header.tx_id,
1145 },
1146 })
1147 }
1148 0x6a40991d8259e008 => {
1149 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1150 let mut req = fidl::new_empty!(
1151 fidl::encoding::EmptyPayload,
1152 fidl::encoding::DefaultFuchsiaResourceDialect
1153 );
1154 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1155 let control_handle = InternalControlHandle { inner: this.inner.clone() };
1156 Ok(InternalRequest::GetBootDriverOverrides {
1157 responder: InternalGetBootDriverOverridesResponder {
1158 control_handle: std::mem::ManuallyDrop::new(control_handle),
1159 tx_id: header.tx_id,
1160 },
1161 })
1162 }
1163 _ => Err(fidl::Error::UnknownOrdinal {
1164 ordinal: header.ordinal,
1165 protocol_name:
1166 <InternalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1167 }),
1168 }))
1169 },
1170 )
1171 }
1172}
1173
1174#[derive(Debug)]
1177pub enum InternalRequest {
1178 GetTestPackage {
1182 responder: InternalGetTestPackageResponder,
1183 },
1184 GetTestResolutionContext {
1187 responder: InternalGetTestResolutionContextResponder,
1188 },
1189 GetBootDirectory {
1193 responder: InternalGetBootDirectoryResponder,
1194 },
1195 GetBootDriverOverrides {
1196 responder: InternalGetBootDriverOverridesResponder,
1197 },
1198}
1199
1200impl InternalRequest {
1201 #[allow(irrefutable_let_patterns)]
1202 pub fn into_get_test_package(self) -> Option<(InternalGetTestPackageResponder)> {
1203 if let InternalRequest::GetTestPackage { responder } = self {
1204 Some((responder))
1205 } else {
1206 None
1207 }
1208 }
1209
1210 #[allow(irrefutable_let_patterns)]
1211 pub fn into_get_test_resolution_context(
1212 self,
1213 ) -> Option<(InternalGetTestResolutionContextResponder)> {
1214 if let InternalRequest::GetTestResolutionContext { responder } = self {
1215 Some((responder))
1216 } else {
1217 None
1218 }
1219 }
1220
1221 #[allow(irrefutable_let_patterns)]
1222 pub fn into_get_boot_directory(self) -> Option<(InternalGetBootDirectoryResponder)> {
1223 if let InternalRequest::GetBootDirectory { responder } = self {
1224 Some((responder))
1225 } else {
1226 None
1227 }
1228 }
1229
1230 #[allow(irrefutable_let_patterns)]
1231 pub fn into_get_boot_driver_overrides(
1232 self,
1233 ) -> Option<(InternalGetBootDriverOverridesResponder)> {
1234 if let InternalRequest::GetBootDriverOverrides { responder } = self {
1235 Some((responder))
1236 } else {
1237 None
1238 }
1239 }
1240
1241 pub fn method_name(&self) -> &'static str {
1243 match *self {
1244 InternalRequest::GetTestPackage { .. } => "get_test_package",
1245 InternalRequest::GetTestResolutionContext { .. } => "get_test_resolution_context",
1246 InternalRequest::GetBootDirectory { .. } => "get_boot_directory",
1247 InternalRequest::GetBootDriverOverrides { .. } => "get_boot_driver_overrides",
1248 }
1249 }
1250}
1251
1252#[derive(Debug, Clone)]
1253pub struct InternalControlHandle {
1254 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1255}
1256
1257impl fidl::endpoints::ControlHandle for InternalControlHandle {
1258 fn shutdown(&self) {
1259 self.inner.shutdown()
1260 }
1261 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1262 self.inner.shutdown_with_epitaph(status)
1263 }
1264
1265 fn is_closed(&self) -> bool {
1266 self.inner.channel().is_closed()
1267 }
1268 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1269 self.inner.channel().on_closed()
1270 }
1271
1272 #[cfg(target_os = "fuchsia")]
1273 fn signal_peer(
1274 &self,
1275 clear_mask: zx::Signals,
1276 set_mask: zx::Signals,
1277 ) -> Result<(), zx_status::Status> {
1278 use fidl::Peered;
1279 self.inner.channel().signal_peer(clear_mask, set_mask)
1280 }
1281}
1282
1283impl InternalControlHandle {}
1284
1285#[must_use = "FIDL methods require a response to be sent"]
1286#[derive(Debug)]
1287pub struct InternalGetTestPackageResponder {
1288 control_handle: std::mem::ManuallyDrop<InternalControlHandle>,
1289 tx_id: u32,
1290}
1291
1292impl std::ops::Drop for InternalGetTestPackageResponder {
1296 fn drop(&mut self) {
1297 self.control_handle.shutdown();
1298 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1300 }
1301}
1302
1303impl fidl::endpoints::Responder for InternalGetTestPackageResponder {
1304 type ControlHandle = InternalControlHandle;
1305
1306 fn control_handle(&self) -> &InternalControlHandle {
1307 &self.control_handle
1308 }
1309
1310 fn drop_without_shutdown(mut self) {
1311 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1313 std::mem::forget(self);
1315 }
1316}
1317
1318impl InternalGetTestPackageResponder {
1319 pub fn send(
1323 self,
1324 mut result: Result<
1325 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1326 i32,
1327 >,
1328 ) -> Result<(), fidl::Error> {
1329 let _result = self.send_raw(result);
1330 if _result.is_err() {
1331 self.control_handle.shutdown();
1332 }
1333 self.drop_without_shutdown();
1334 _result
1335 }
1336
1337 pub fn send_no_shutdown_on_err(
1339 self,
1340 mut result: Result<
1341 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1342 i32,
1343 >,
1344 ) -> Result<(), fidl::Error> {
1345 let _result = self.send_raw(result);
1346 self.drop_without_shutdown();
1347 _result
1348 }
1349
1350 fn send_raw(
1351 &self,
1352 mut result: Result<
1353 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1354 i32,
1355 >,
1356 ) -> Result<(), fidl::Error> {
1357 self.control_handle
1358 .inner
1359 .send::<fidl::encoding::ResultType<InternalGetTestPackageResponse, i32>>(
1360 result.map(|test_pkg_dir| (test_pkg_dir,)),
1361 self.tx_id,
1362 0x298c1d6e57d57db8,
1363 fidl::encoding::DynamicFlags::empty(),
1364 )
1365 }
1366}
1367
1368#[must_use = "FIDL methods require a response to be sent"]
1369#[derive(Debug)]
1370pub struct InternalGetTestResolutionContextResponder {
1371 control_handle: std::mem::ManuallyDrop<InternalControlHandle>,
1372 tx_id: u32,
1373}
1374
1375impl std::ops::Drop for InternalGetTestResolutionContextResponder {
1379 fn drop(&mut self) {
1380 self.control_handle.shutdown();
1381 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1383 }
1384}
1385
1386impl fidl::endpoints::Responder for InternalGetTestResolutionContextResponder {
1387 type ControlHandle = InternalControlHandle;
1388
1389 fn control_handle(&self) -> &InternalControlHandle {
1390 &self.control_handle
1391 }
1392
1393 fn drop_without_shutdown(mut self) {
1394 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1396 std::mem::forget(self);
1398 }
1399}
1400
1401impl InternalGetTestResolutionContextResponder {
1402 pub fn send(
1406 self,
1407 mut result: Result<Option<&fidl_fuchsia_component_resolution::Context>, i32>,
1408 ) -> Result<(), fidl::Error> {
1409 let _result = self.send_raw(result);
1410 if _result.is_err() {
1411 self.control_handle.shutdown();
1412 }
1413 self.drop_without_shutdown();
1414 _result
1415 }
1416
1417 pub fn send_no_shutdown_on_err(
1419 self,
1420 mut result: Result<Option<&fidl_fuchsia_component_resolution::Context>, i32>,
1421 ) -> Result<(), fidl::Error> {
1422 let _result = self.send_raw(result);
1423 self.drop_without_shutdown();
1424 _result
1425 }
1426
1427 fn send_raw(
1428 &self,
1429 mut result: Result<Option<&fidl_fuchsia_component_resolution::Context>, i32>,
1430 ) -> Result<(), fidl::Error> {
1431 self.control_handle.inner.send::<fidl::encoding::ResultType<
1432 InternalGetTestResolutionContextResponse,
1433 i32,
1434 >>(
1435 result.map(|context| (context,)),
1436 self.tx_id,
1437 0x78e5d4f1fefd67b7,
1438 fidl::encoding::DynamicFlags::empty(),
1439 )
1440 }
1441}
1442
1443#[must_use = "FIDL methods require a response to be sent"]
1444#[derive(Debug)]
1445pub struct InternalGetBootDirectoryResponder {
1446 control_handle: std::mem::ManuallyDrop<InternalControlHandle>,
1447 tx_id: u32,
1448}
1449
1450impl std::ops::Drop for InternalGetBootDirectoryResponder {
1454 fn drop(&mut self) {
1455 self.control_handle.shutdown();
1456 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1458 }
1459}
1460
1461impl fidl::endpoints::Responder for InternalGetBootDirectoryResponder {
1462 type ControlHandle = InternalControlHandle;
1463
1464 fn control_handle(&self) -> &InternalControlHandle {
1465 &self.control_handle
1466 }
1467
1468 fn drop_without_shutdown(mut self) {
1469 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1471 std::mem::forget(self);
1473 }
1474}
1475
1476impl InternalGetBootDirectoryResponder {
1477 pub fn send(
1481 self,
1482 mut result: Result<
1483 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1484 i32,
1485 >,
1486 ) -> Result<(), fidl::Error> {
1487 let _result = self.send_raw(result);
1488 if _result.is_err() {
1489 self.control_handle.shutdown();
1490 }
1491 self.drop_without_shutdown();
1492 _result
1493 }
1494
1495 pub fn send_no_shutdown_on_err(
1497 self,
1498 mut result: Result<
1499 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1500 i32,
1501 >,
1502 ) -> Result<(), fidl::Error> {
1503 let _result = self.send_raw(result);
1504 self.drop_without_shutdown();
1505 _result
1506 }
1507
1508 fn send_raw(
1509 &self,
1510 mut result: Result<
1511 Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
1512 i32,
1513 >,
1514 ) -> Result<(), fidl::Error> {
1515 self.control_handle
1516 .inner
1517 .send::<fidl::encoding::ResultType<InternalGetBootDirectoryResponse, i32>>(
1518 result.map(|boot_dir| (boot_dir,)),
1519 self.tx_id,
1520 0x3e1969123c4dfb31,
1521 fidl::encoding::DynamicFlags::empty(),
1522 )
1523 }
1524}
1525
1526#[must_use = "FIDL methods require a response to be sent"]
1527#[derive(Debug)]
1528pub struct InternalGetBootDriverOverridesResponder {
1529 control_handle: std::mem::ManuallyDrop<InternalControlHandle>,
1530 tx_id: u32,
1531}
1532
1533impl std::ops::Drop for InternalGetBootDriverOverridesResponder {
1537 fn drop(&mut self) {
1538 self.control_handle.shutdown();
1539 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1541 }
1542}
1543
1544impl fidl::endpoints::Responder for InternalGetBootDriverOverridesResponder {
1545 type ControlHandle = InternalControlHandle;
1546
1547 fn control_handle(&self) -> &InternalControlHandle {
1548 &self.control_handle
1549 }
1550
1551 fn drop_without_shutdown(mut self) {
1552 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1554 std::mem::forget(self);
1556 }
1557}
1558
1559impl InternalGetBootDriverOverridesResponder {
1560 pub fn send(self, mut result: Result<&[String], i32>) -> Result<(), fidl::Error> {
1564 let _result = self.send_raw(result);
1565 if _result.is_err() {
1566 self.control_handle.shutdown();
1567 }
1568 self.drop_without_shutdown();
1569 _result
1570 }
1571
1572 pub fn send_no_shutdown_on_err(
1574 self,
1575 mut result: Result<&[String], i32>,
1576 ) -> Result<(), fidl::Error> {
1577 let _result = self.send_raw(result);
1578 self.drop_without_shutdown();
1579 _result
1580 }
1581
1582 fn send_raw(&self, mut result: Result<&[String], i32>) -> Result<(), fidl::Error> {
1583 self.control_handle.inner.send::<fidl::encoding::ResultType<
1584 InternalGetBootDriverOverridesResponse,
1585 i32,
1586 >>(
1587 result.map(|boot_overrides| (boot_overrides,)),
1588 self.tx_id,
1589 0x6a40991d8259e008,
1590 fidl::encoding::DynamicFlags::empty(),
1591 )
1592 }
1593}
1594
1595#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1596pub struct ManifestProviderMarker;
1597
1598impl fidl::endpoints::ProtocolMarker for ManifestProviderMarker {
1599 type Proxy = ManifestProviderProxy;
1600 type RequestStream = ManifestProviderRequestStream;
1601 #[cfg(target_os = "fuchsia")]
1602 type SynchronousProxy = ManifestProviderSynchronousProxy;
1603
1604 const DEBUG_NAME: &'static str = "fuchsia.driver.test.ManifestProvider";
1605}
1606impl fidl::endpoints::DiscoverableProtocolMarker for ManifestProviderMarker {}
1607pub type ManifestProviderGetManifestResult = Result<fidl::Stream, i32>;
1608
1609pub trait ManifestProviderProxyInterface: Send + Sync {
1610 type GetManifestResponseFut: std::future::Future<Output = Result<ManifestProviderGetManifestResult, fidl::Error>>
1611 + Send;
1612 fn r#get_manifest(&self) -> Self::GetManifestResponseFut;
1613}
1614#[derive(Debug)]
1615#[cfg(target_os = "fuchsia")]
1616pub struct ManifestProviderSynchronousProxy {
1617 client: fidl::client::sync::Client,
1618}
1619
1620#[cfg(target_os = "fuchsia")]
1621impl fidl::endpoints::SynchronousProxy for ManifestProviderSynchronousProxy {
1622 type Proxy = ManifestProviderProxy;
1623 type Protocol = ManifestProviderMarker;
1624
1625 fn from_channel(inner: fidl::Channel) -> Self {
1626 Self::new(inner)
1627 }
1628
1629 fn into_channel(self) -> fidl::Channel {
1630 self.client.into_channel()
1631 }
1632
1633 fn as_channel(&self) -> &fidl::Channel {
1634 self.client.as_channel()
1635 }
1636}
1637
1638#[cfg(target_os = "fuchsia")]
1639impl ManifestProviderSynchronousProxy {
1640 pub fn new(channel: fidl::Channel) -> Self {
1641 let protocol_name = <ManifestProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1642 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1643 }
1644
1645 pub fn into_channel(self) -> fidl::Channel {
1646 self.client.into_channel()
1647 }
1648
1649 pub fn wait_for_event(
1652 &self,
1653 deadline: zx::MonotonicInstant,
1654 ) -> Result<ManifestProviderEvent, fidl::Error> {
1655 ManifestProviderEvent::decode(self.client.wait_for_event(deadline)?)
1656 }
1657
1658 pub fn r#get_manifest(
1659 &self,
1660 ___deadline: zx::MonotonicInstant,
1661 ) -> Result<ManifestProviderGetManifestResult, fidl::Error> {
1662 let _response = self.client.send_query::<
1663 fidl::encoding::EmptyPayload,
1664 fidl::encoding::ResultType<ManifestProviderGetManifestResponse, i32>,
1665 >(
1666 (),
1667 0x44eaae3b45e860d,
1668 fidl::encoding::DynamicFlags::empty(),
1669 ___deadline,
1670 )?;
1671 Ok(_response.map(|x| x.manifest))
1672 }
1673}
1674
1675#[cfg(target_os = "fuchsia")]
1676impl From<ManifestProviderSynchronousProxy> for zx::Handle {
1677 fn from(value: ManifestProviderSynchronousProxy) -> Self {
1678 value.into_channel().into()
1679 }
1680}
1681
1682#[cfg(target_os = "fuchsia")]
1683impl From<fidl::Channel> for ManifestProviderSynchronousProxy {
1684 fn from(value: fidl::Channel) -> Self {
1685 Self::new(value)
1686 }
1687}
1688
1689#[cfg(target_os = "fuchsia")]
1690impl fidl::endpoints::FromClient for ManifestProviderSynchronousProxy {
1691 type Protocol = ManifestProviderMarker;
1692
1693 fn from_client(value: fidl::endpoints::ClientEnd<ManifestProviderMarker>) -> Self {
1694 Self::new(value.into_channel())
1695 }
1696}
1697
1698#[derive(Debug, Clone)]
1699pub struct ManifestProviderProxy {
1700 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1701}
1702
1703impl fidl::endpoints::Proxy for ManifestProviderProxy {
1704 type Protocol = ManifestProviderMarker;
1705
1706 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1707 Self::new(inner)
1708 }
1709
1710 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1711 self.client.into_channel().map_err(|client| Self { client })
1712 }
1713
1714 fn as_channel(&self) -> &::fidl::AsyncChannel {
1715 self.client.as_channel()
1716 }
1717}
1718
1719impl ManifestProviderProxy {
1720 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1722 let protocol_name = <ManifestProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1723 Self { client: fidl::client::Client::new(channel, protocol_name) }
1724 }
1725
1726 pub fn take_event_stream(&self) -> ManifestProviderEventStream {
1732 ManifestProviderEventStream { event_receiver: self.client.take_event_receiver() }
1733 }
1734
1735 pub fn r#get_manifest(
1736 &self,
1737 ) -> fidl::client::QueryResponseFut<
1738 ManifestProviderGetManifestResult,
1739 fidl::encoding::DefaultFuchsiaResourceDialect,
1740 > {
1741 ManifestProviderProxyInterface::r#get_manifest(self)
1742 }
1743}
1744
1745impl ManifestProviderProxyInterface for ManifestProviderProxy {
1746 type GetManifestResponseFut = fidl::client::QueryResponseFut<
1747 ManifestProviderGetManifestResult,
1748 fidl::encoding::DefaultFuchsiaResourceDialect,
1749 >;
1750 fn r#get_manifest(&self) -> Self::GetManifestResponseFut {
1751 fn _decode(
1752 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1753 ) -> Result<ManifestProviderGetManifestResult, fidl::Error> {
1754 let _response = fidl::client::decode_transaction_body::<
1755 fidl::encoding::ResultType<ManifestProviderGetManifestResponse, i32>,
1756 fidl::encoding::DefaultFuchsiaResourceDialect,
1757 0x44eaae3b45e860d,
1758 >(_buf?)?;
1759 Ok(_response.map(|x| x.manifest))
1760 }
1761 self.client.send_query_and_decode::<
1762 fidl::encoding::EmptyPayload,
1763 ManifestProviderGetManifestResult,
1764 >(
1765 (),
1766 0x44eaae3b45e860d,
1767 fidl::encoding::DynamicFlags::empty(),
1768 _decode,
1769 )
1770 }
1771}
1772
1773pub struct ManifestProviderEventStream {
1774 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1775}
1776
1777impl std::marker::Unpin for ManifestProviderEventStream {}
1778
1779impl futures::stream::FusedStream for ManifestProviderEventStream {
1780 fn is_terminated(&self) -> bool {
1781 self.event_receiver.is_terminated()
1782 }
1783}
1784
1785impl futures::Stream for ManifestProviderEventStream {
1786 type Item = Result<ManifestProviderEvent, fidl::Error>;
1787
1788 fn poll_next(
1789 mut self: std::pin::Pin<&mut Self>,
1790 cx: &mut std::task::Context<'_>,
1791 ) -> std::task::Poll<Option<Self::Item>> {
1792 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1793 &mut self.event_receiver,
1794 cx
1795 )?) {
1796 Some(buf) => std::task::Poll::Ready(Some(ManifestProviderEvent::decode(buf))),
1797 None => std::task::Poll::Ready(None),
1798 }
1799 }
1800}
1801
1802#[derive(Debug)]
1803pub enum ManifestProviderEvent {}
1804
1805impl ManifestProviderEvent {
1806 fn decode(
1808 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1809 ) -> Result<ManifestProviderEvent, fidl::Error> {
1810 let (bytes, _handles) = buf.split_mut();
1811 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1812 debug_assert_eq!(tx_header.tx_id, 0);
1813 match tx_header.ordinal {
1814 _ => Err(fidl::Error::UnknownOrdinal {
1815 ordinal: tx_header.ordinal,
1816 protocol_name:
1817 <ManifestProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1818 }),
1819 }
1820 }
1821}
1822
1823pub struct ManifestProviderRequestStream {
1825 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1826 is_terminated: bool,
1827}
1828
1829impl std::marker::Unpin for ManifestProviderRequestStream {}
1830
1831impl futures::stream::FusedStream for ManifestProviderRequestStream {
1832 fn is_terminated(&self) -> bool {
1833 self.is_terminated
1834 }
1835}
1836
1837impl fidl::endpoints::RequestStream for ManifestProviderRequestStream {
1838 type Protocol = ManifestProviderMarker;
1839 type ControlHandle = ManifestProviderControlHandle;
1840
1841 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1842 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1843 }
1844
1845 fn control_handle(&self) -> Self::ControlHandle {
1846 ManifestProviderControlHandle { inner: self.inner.clone() }
1847 }
1848
1849 fn into_inner(
1850 self,
1851 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1852 {
1853 (self.inner, self.is_terminated)
1854 }
1855
1856 fn from_inner(
1857 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1858 is_terminated: bool,
1859 ) -> Self {
1860 Self { inner, is_terminated }
1861 }
1862}
1863
1864impl futures::Stream for ManifestProviderRequestStream {
1865 type Item = Result<ManifestProviderRequest, fidl::Error>;
1866
1867 fn poll_next(
1868 mut self: std::pin::Pin<&mut Self>,
1869 cx: &mut std::task::Context<'_>,
1870 ) -> std::task::Poll<Option<Self::Item>> {
1871 let this = &mut *self;
1872 if this.inner.check_shutdown(cx) {
1873 this.is_terminated = true;
1874 return std::task::Poll::Ready(None);
1875 }
1876 if this.is_terminated {
1877 panic!("polled ManifestProviderRequestStream after completion");
1878 }
1879 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1880 |bytes, handles| {
1881 match this.inner.channel().read_etc(cx, bytes, handles) {
1882 std::task::Poll::Ready(Ok(())) => {}
1883 std::task::Poll::Pending => return std::task::Poll::Pending,
1884 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1885 this.is_terminated = true;
1886 return std::task::Poll::Ready(None);
1887 }
1888 std::task::Poll::Ready(Err(e)) => {
1889 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1890 e.into(),
1891 ))));
1892 }
1893 }
1894
1895 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1897
1898 std::task::Poll::Ready(Some(match header.ordinal {
1899 0x44eaae3b45e860d => {
1900 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1901 let mut req = fidl::new_empty!(
1902 fidl::encoding::EmptyPayload,
1903 fidl::encoding::DefaultFuchsiaResourceDialect
1904 );
1905 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1906 let control_handle =
1907 ManifestProviderControlHandle { inner: this.inner.clone() };
1908 Ok(ManifestProviderRequest::GetManifest {
1909 responder: ManifestProviderGetManifestResponder {
1910 control_handle: std::mem::ManuallyDrop::new(control_handle),
1911 tx_id: header.tx_id,
1912 },
1913 })
1914 }
1915 _ => Err(fidl::Error::UnknownOrdinal {
1916 ordinal: header.ordinal,
1917 protocol_name:
1918 <ManifestProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1919 }),
1920 }))
1921 },
1922 )
1923 }
1924}
1925
1926#[derive(Debug)]
1927pub enum ManifestProviderRequest {
1928 GetManifest { responder: ManifestProviderGetManifestResponder },
1929}
1930
1931impl ManifestProviderRequest {
1932 #[allow(irrefutable_let_patterns)]
1933 pub fn into_get_manifest(self) -> Option<(ManifestProviderGetManifestResponder)> {
1934 if let ManifestProviderRequest::GetManifest { responder } = self {
1935 Some((responder))
1936 } else {
1937 None
1938 }
1939 }
1940
1941 pub fn method_name(&self) -> &'static str {
1943 match *self {
1944 ManifestProviderRequest::GetManifest { .. } => "get_manifest",
1945 }
1946 }
1947}
1948
1949#[derive(Debug, Clone)]
1950pub struct ManifestProviderControlHandle {
1951 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1952}
1953
1954impl fidl::endpoints::ControlHandle for ManifestProviderControlHandle {
1955 fn shutdown(&self) {
1956 self.inner.shutdown()
1957 }
1958 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1959 self.inner.shutdown_with_epitaph(status)
1960 }
1961
1962 fn is_closed(&self) -> bool {
1963 self.inner.channel().is_closed()
1964 }
1965 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1966 self.inner.channel().on_closed()
1967 }
1968
1969 #[cfg(target_os = "fuchsia")]
1970 fn signal_peer(
1971 &self,
1972 clear_mask: zx::Signals,
1973 set_mask: zx::Signals,
1974 ) -> Result<(), zx_status::Status> {
1975 use fidl::Peered;
1976 self.inner.channel().signal_peer(clear_mask, set_mask)
1977 }
1978}
1979
1980impl ManifestProviderControlHandle {}
1981
1982#[must_use = "FIDL methods require a response to be sent"]
1983#[derive(Debug)]
1984pub struct ManifestProviderGetManifestResponder {
1985 control_handle: std::mem::ManuallyDrop<ManifestProviderControlHandle>,
1986 tx_id: u32,
1987}
1988
1989impl std::ops::Drop for ManifestProviderGetManifestResponder {
1993 fn drop(&mut self) {
1994 self.control_handle.shutdown();
1995 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1997 }
1998}
1999
2000impl fidl::endpoints::Responder for ManifestProviderGetManifestResponder {
2001 type ControlHandle = ManifestProviderControlHandle;
2002
2003 fn control_handle(&self) -> &ManifestProviderControlHandle {
2004 &self.control_handle
2005 }
2006
2007 fn drop_without_shutdown(mut self) {
2008 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2010 std::mem::forget(self);
2012 }
2013}
2014
2015impl ManifestProviderGetManifestResponder {
2016 pub fn send(self, mut result: Result<fidl::Stream, i32>) -> Result<(), fidl::Error> {
2020 let _result = self.send_raw(result);
2021 if _result.is_err() {
2022 self.control_handle.shutdown();
2023 }
2024 self.drop_without_shutdown();
2025 _result
2026 }
2027
2028 pub fn send_no_shutdown_on_err(
2030 self,
2031 mut result: Result<fidl::Stream, i32>,
2032 ) -> Result<(), fidl::Error> {
2033 let _result = self.send_raw(result);
2034 self.drop_without_shutdown();
2035 _result
2036 }
2037
2038 fn send_raw(&self, mut result: Result<fidl::Stream, i32>) -> Result<(), fidl::Error> {
2039 self.control_handle.inner.send::<fidl::encoding::ResultType<
2040 ManifestProviderGetManifestResponse,
2041 i32,
2042 >>(
2043 result.map(|manifest| (manifest,)),
2044 self.tx_id,
2045 0x44eaae3b45e860d,
2046 fidl::encoding::DynamicFlags::empty(),
2047 )
2048 }
2049}
2050
2051#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2052pub struct RealmMarker;
2053
2054impl fidl::endpoints::ProtocolMarker for RealmMarker {
2055 type Proxy = RealmProxy;
2056 type RequestStream = RealmRequestStream;
2057 #[cfg(target_os = "fuchsia")]
2058 type SynchronousProxy = RealmSynchronousProxy;
2059
2060 const DEBUG_NAME: &'static str = "fuchsia.driver.test.Realm";
2061}
2062impl fidl::endpoints::DiscoverableProtocolMarker for RealmMarker {}
2063pub type RealmStartResult = Result<(), i32>;
2064
2065pub trait RealmProxyInterface: Send + Sync {
2066 type StartResponseFut: std::future::Future<Output = Result<RealmStartResult, fidl::Error>>
2067 + Send;
2068 fn r#start(&self, args: RealmArgs) -> Self::StartResponseFut;
2069}
2070#[derive(Debug)]
2071#[cfg(target_os = "fuchsia")]
2072pub struct RealmSynchronousProxy {
2073 client: fidl::client::sync::Client,
2074}
2075
2076#[cfg(target_os = "fuchsia")]
2077impl fidl::endpoints::SynchronousProxy for RealmSynchronousProxy {
2078 type Proxy = RealmProxy;
2079 type Protocol = RealmMarker;
2080
2081 fn from_channel(inner: fidl::Channel) -> Self {
2082 Self::new(inner)
2083 }
2084
2085 fn into_channel(self) -> fidl::Channel {
2086 self.client.into_channel()
2087 }
2088
2089 fn as_channel(&self) -> &fidl::Channel {
2090 self.client.as_channel()
2091 }
2092}
2093
2094#[cfg(target_os = "fuchsia")]
2095impl RealmSynchronousProxy {
2096 pub fn new(channel: fidl::Channel) -> Self {
2097 let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2098 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2099 }
2100
2101 pub fn into_channel(self) -> fidl::Channel {
2102 self.client.into_channel()
2103 }
2104
2105 pub fn wait_for_event(
2108 &self,
2109 deadline: zx::MonotonicInstant,
2110 ) -> Result<RealmEvent, fidl::Error> {
2111 RealmEvent::decode(self.client.wait_for_event(deadline)?)
2112 }
2113
2114 pub fn r#start(
2120 &self,
2121 mut args: RealmArgs,
2122 ___deadline: zx::MonotonicInstant,
2123 ) -> Result<RealmStartResult, fidl::Error> {
2124 let _response = self.client.send_query::<
2125 RealmStartRequest,
2126 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2127 >(
2128 (&mut args,),
2129 0x3dc6949d581e96fa,
2130 fidl::encoding::DynamicFlags::FLEXIBLE,
2131 ___deadline,
2132 )?
2133 .into_result::<RealmMarker>("start")?;
2134 Ok(_response.map(|x| x))
2135 }
2136}
2137
2138#[cfg(target_os = "fuchsia")]
2139impl From<RealmSynchronousProxy> for zx::Handle {
2140 fn from(value: RealmSynchronousProxy) -> Self {
2141 value.into_channel().into()
2142 }
2143}
2144
2145#[cfg(target_os = "fuchsia")]
2146impl From<fidl::Channel> for RealmSynchronousProxy {
2147 fn from(value: fidl::Channel) -> Self {
2148 Self::new(value)
2149 }
2150}
2151
2152#[cfg(target_os = "fuchsia")]
2153impl fidl::endpoints::FromClient for RealmSynchronousProxy {
2154 type Protocol = RealmMarker;
2155
2156 fn from_client(value: fidl::endpoints::ClientEnd<RealmMarker>) -> Self {
2157 Self::new(value.into_channel())
2158 }
2159}
2160
2161#[derive(Debug, Clone)]
2162pub struct RealmProxy {
2163 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2164}
2165
2166impl fidl::endpoints::Proxy for RealmProxy {
2167 type Protocol = RealmMarker;
2168
2169 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2170 Self::new(inner)
2171 }
2172
2173 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2174 self.client.into_channel().map_err(|client| Self { client })
2175 }
2176
2177 fn as_channel(&self) -> &::fidl::AsyncChannel {
2178 self.client.as_channel()
2179 }
2180}
2181
2182impl RealmProxy {
2183 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2185 let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2186 Self { client: fidl::client::Client::new(channel, protocol_name) }
2187 }
2188
2189 pub fn take_event_stream(&self) -> RealmEventStream {
2195 RealmEventStream { event_receiver: self.client.take_event_receiver() }
2196 }
2197
2198 pub fn r#start(
2204 &self,
2205 mut args: RealmArgs,
2206 ) -> fidl::client::QueryResponseFut<
2207 RealmStartResult,
2208 fidl::encoding::DefaultFuchsiaResourceDialect,
2209 > {
2210 RealmProxyInterface::r#start(self, args)
2211 }
2212}
2213
2214impl RealmProxyInterface for RealmProxy {
2215 type StartResponseFut = fidl::client::QueryResponseFut<
2216 RealmStartResult,
2217 fidl::encoding::DefaultFuchsiaResourceDialect,
2218 >;
2219 fn r#start(&self, mut args: RealmArgs) -> Self::StartResponseFut {
2220 fn _decode(
2221 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2222 ) -> Result<RealmStartResult, fidl::Error> {
2223 let _response = fidl::client::decode_transaction_body::<
2224 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2225 fidl::encoding::DefaultFuchsiaResourceDialect,
2226 0x3dc6949d581e96fa,
2227 >(_buf?)?
2228 .into_result::<RealmMarker>("start")?;
2229 Ok(_response.map(|x| x))
2230 }
2231 self.client.send_query_and_decode::<RealmStartRequest, RealmStartResult>(
2232 (&mut args,),
2233 0x3dc6949d581e96fa,
2234 fidl::encoding::DynamicFlags::FLEXIBLE,
2235 _decode,
2236 )
2237 }
2238}
2239
2240pub struct RealmEventStream {
2241 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2242}
2243
2244impl std::marker::Unpin for RealmEventStream {}
2245
2246impl futures::stream::FusedStream for RealmEventStream {
2247 fn is_terminated(&self) -> bool {
2248 self.event_receiver.is_terminated()
2249 }
2250}
2251
2252impl futures::Stream for RealmEventStream {
2253 type Item = Result<RealmEvent, fidl::Error>;
2254
2255 fn poll_next(
2256 mut self: std::pin::Pin<&mut Self>,
2257 cx: &mut std::task::Context<'_>,
2258 ) -> std::task::Poll<Option<Self::Item>> {
2259 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2260 &mut self.event_receiver,
2261 cx
2262 )?) {
2263 Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
2264 None => std::task::Poll::Ready(None),
2265 }
2266 }
2267}
2268
2269#[derive(Debug)]
2270pub enum RealmEvent {
2271 #[non_exhaustive]
2272 _UnknownEvent {
2273 ordinal: u64,
2275 },
2276}
2277
2278impl RealmEvent {
2279 fn decode(
2281 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2282 ) -> Result<RealmEvent, fidl::Error> {
2283 let (bytes, _handles) = buf.split_mut();
2284 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2285 debug_assert_eq!(tx_header.tx_id, 0);
2286 match tx_header.ordinal {
2287 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2288 Ok(RealmEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2289 }
2290 _ => Err(fidl::Error::UnknownOrdinal {
2291 ordinal: tx_header.ordinal,
2292 protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2293 }),
2294 }
2295 }
2296}
2297
2298pub struct RealmRequestStream {
2300 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2301 is_terminated: bool,
2302}
2303
2304impl std::marker::Unpin for RealmRequestStream {}
2305
2306impl futures::stream::FusedStream for RealmRequestStream {
2307 fn is_terminated(&self) -> bool {
2308 self.is_terminated
2309 }
2310}
2311
2312impl fidl::endpoints::RequestStream for RealmRequestStream {
2313 type Protocol = RealmMarker;
2314 type ControlHandle = RealmControlHandle;
2315
2316 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2317 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2318 }
2319
2320 fn control_handle(&self) -> Self::ControlHandle {
2321 RealmControlHandle { inner: self.inner.clone() }
2322 }
2323
2324 fn into_inner(
2325 self,
2326 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2327 {
2328 (self.inner, self.is_terminated)
2329 }
2330
2331 fn from_inner(
2332 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2333 is_terminated: bool,
2334 ) -> Self {
2335 Self { inner, is_terminated }
2336 }
2337}
2338
2339impl futures::Stream for RealmRequestStream {
2340 type Item = Result<RealmRequest, fidl::Error>;
2341
2342 fn poll_next(
2343 mut self: std::pin::Pin<&mut Self>,
2344 cx: &mut std::task::Context<'_>,
2345 ) -> std::task::Poll<Option<Self::Item>> {
2346 let this = &mut *self;
2347 if this.inner.check_shutdown(cx) {
2348 this.is_terminated = true;
2349 return std::task::Poll::Ready(None);
2350 }
2351 if this.is_terminated {
2352 panic!("polled RealmRequestStream after completion");
2353 }
2354 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2355 |bytes, handles| {
2356 match this.inner.channel().read_etc(cx, bytes, handles) {
2357 std::task::Poll::Ready(Ok(())) => {}
2358 std::task::Poll::Pending => return std::task::Poll::Pending,
2359 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2360 this.is_terminated = true;
2361 return std::task::Poll::Ready(None);
2362 }
2363 std::task::Poll::Ready(Err(e)) => {
2364 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2365 e.into(),
2366 ))));
2367 }
2368 }
2369
2370 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2372
2373 std::task::Poll::Ready(Some(match header.ordinal {
2374 0x3dc6949d581e96fa => {
2375 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2376 let mut req = fidl::new_empty!(
2377 RealmStartRequest,
2378 fidl::encoding::DefaultFuchsiaResourceDialect
2379 );
2380 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmStartRequest>(&header, _body_bytes, handles, &mut req)?;
2381 let control_handle = RealmControlHandle { inner: this.inner.clone() };
2382 Ok(RealmRequest::Start {
2383 args: req.args,
2384
2385 responder: RealmStartResponder {
2386 control_handle: std::mem::ManuallyDrop::new(control_handle),
2387 tx_id: header.tx_id,
2388 },
2389 })
2390 }
2391 _ if header.tx_id == 0
2392 && header
2393 .dynamic_flags()
2394 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2395 {
2396 Ok(RealmRequest::_UnknownMethod {
2397 ordinal: header.ordinal,
2398 control_handle: RealmControlHandle { inner: this.inner.clone() },
2399 method_type: fidl::MethodType::OneWay,
2400 })
2401 }
2402 _ if header
2403 .dynamic_flags()
2404 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2405 {
2406 this.inner.send_framework_err(
2407 fidl::encoding::FrameworkErr::UnknownMethod,
2408 header.tx_id,
2409 header.ordinal,
2410 header.dynamic_flags(),
2411 (bytes, handles),
2412 )?;
2413 Ok(RealmRequest::_UnknownMethod {
2414 ordinal: header.ordinal,
2415 control_handle: RealmControlHandle { inner: this.inner.clone() },
2416 method_type: fidl::MethodType::TwoWay,
2417 })
2418 }
2419 _ => Err(fidl::Error::UnknownOrdinal {
2420 ordinal: header.ordinal,
2421 protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2422 }),
2423 }))
2424 },
2425 )
2426 }
2427}
2428
2429#[derive(Debug)]
2432pub enum RealmRequest {
2433 Start { args: RealmArgs, responder: RealmStartResponder },
2439 #[non_exhaustive]
2441 _UnknownMethod {
2442 ordinal: u64,
2444 control_handle: RealmControlHandle,
2445 method_type: fidl::MethodType,
2446 },
2447}
2448
2449impl RealmRequest {
2450 #[allow(irrefutable_let_patterns)]
2451 pub fn into_start(self) -> Option<(RealmArgs, RealmStartResponder)> {
2452 if let RealmRequest::Start { args, responder } = self {
2453 Some((args, responder))
2454 } else {
2455 None
2456 }
2457 }
2458
2459 pub fn method_name(&self) -> &'static str {
2461 match *self {
2462 RealmRequest::Start { .. } => "start",
2463 RealmRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
2464 "unknown one-way method"
2465 }
2466 RealmRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
2467 "unknown two-way method"
2468 }
2469 }
2470 }
2471}
2472
2473#[derive(Debug, Clone)]
2474pub struct RealmControlHandle {
2475 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2476}
2477
2478impl fidl::endpoints::ControlHandle for RealmControlHandle {
2479 fn shutdown(&self) {
2480 self.inner.shutdown()
2481 }
2482 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2483 self.inner.shutdown_with_epitaph(status)
2484 }
2485
2486 fn is_closed(&self) -> bool {
2487 self.inner.channel().is_closed()
2488 }
2489 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2490 self.inner.channel().on_closed()
2491 }
2492
2493 #[cfg(target_os = "fuchsia")]
2494 fn signal_peer(
2495 &self,
2496 clear_mask: zx::Signals,
2497 set_mask: zx::Signals,
2498 ) -> Result<(), zx_status::Status> {
2499 use fidl::Peered;
2500 self.inner.channel().signal_peer(clear_mask, set_mask)
2501 }
2502}
2503
2504impl RealmControlHandle {}
2505
2506#[must_use = "FIDL methods require a response to be sent"]
2507#[derive(Debug)]
2508pub struct RealmStartResponder {
2509 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
2510 tx_id: u32,
2511}
2512
2513impl std::ops::Drop for RealmStartResponder {
2517 fn drop(&mut self) {
2518 self.control_handle.shutdown();
2519 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2521 }
2522}
2523
2524impl fidl::endpoints::Responder for RealmStartResponder {
2525 type ControlHandle = RealmControlHandle;
2526
2527 fn control_handle(&self) -> &RealmControlHandle {
2528 &self.control_handle
2529 }
2530
2531 fn drop_without_shutdown(mut self) {
2532 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2534 std::mem::forget(self);
2536 }
2537}
2538
2539impl RealmStartResponder {
2540 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2544 let _result = self.send_raw(result);
2545 if _result.is_err() {
2546 self.control_handle.shutdown();
2547 }
2548 self.drop_without_shutdown();
2549 _result
2550 }
2551
2552 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2554 let _result = self.send_raw(result);
2555 self.drop_without_shutdown();
2556 _result
2557 }
2558
2559 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2560 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2561 fidl::encoding::EmptyStruct,
2562 i32,
2563 >>(
2564 fidl::encoding::FlexibleResult::new(result),
2565 self.tx_id,
2566 0x3dc6949d581e96fa,
2567 fidl::encoding::DynamicFlags::FLEXIBLE,
2568 )
2569 }
2570}
2571
2572#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2573pub struct ResourceProviderMarker;
2574
2575impl fidl::endpoints::ProtocolMarker for ResourceProviderMarker {
2576 type Proxy = ResourceProviderProxy;
2577 type RequestStream = ResourceProviderRequestStream;
2578 #[cfg(target_os = "fuchsia")]
2579 type SynchronousProxy = ResourceProviderSynchronousProxy;
2580
2581 const DEBUG_NAME: &'static str = "fuchsia.driver.test.ResourceProvider";
2582}
2583impl fidl::endpoints::DiscoverableProtocolMarker for ResourceProviderMarker {}
2584pub type ResourceProviderGetDeviceTreeResult = Result<fidl::Vmo, i32>;
2585
2586pub trait ResourceProviderProxyInterface: Send + Sync {
2587 type GetDeviceTreeResponseFut: std::future::Future<Output = Result<ResourceProviderGetDeviceTreeResult, fidl::Error>>
2588 + Send;
2589 fn r#get_device_tree(&self) -> Self::GetDeviceTreeResponseFut;
2590}
2591#[derive(Debug)]
2592#[cfg(target_os = "fuchsia")]
2593pub struct ResourceProviderSynchronousProxy {
2594 client: fidl::client::sync::Client,
2595}
2596
2597#[cfg(target_os = "fuchsia")]
2598impl fidl::endpoints::SynchronousProxy for ResourceProviderSynchronousProxy {
2599 type Proxy = ResourceProviderProxy;
2600 type Protocol = ResourceProviderMarker;
2601
2602 fn from_channel(inner: fidl::Channel) -> Self {
2603 Self::new(inner)
2604 }
2605
2606 fn into_channel(self) -> fidl::Channel {
2607 self.client.into_channel()
2608 }
2609
2610 fn as_channel(&self) -> &fidl::Channel {
2611 self.client.as_channel()
2612 }
2613}
2614
2615#[cfg(target_os = "fuchsia")]
2616impl ResourceProviderSynchronousProxy {
2617 pub fn new(channel: fidl::Channel) -> Self {
2618 let protocol_name = <ResourceProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2619 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2620 }
2621
2622 pub fn into_channel(self) -> fidl::Channel {
2623 self.client.into_channel()
2624 }
2625
2626 pub fn wait_for_event(
2629 &self,
2630 deadline: zx::MonotonicInstant,
2631 ) -> Result<ResourceProviderEvent, fidl::Error> {
2632 ResourceProviderEvent::decode(self.client.wait_for_event(deadline)?)
2633 }
2634
2635 pub fn r#get_device_tree(
2636 &self,
2637 ___deadline: zx::MonotonicInstant,
2638 ) -> Result<ResourceProviderGetDeviceTreeResult, fidl::Error> {
2639 let _response = self.client.send_query::<
2640 fidl::encoding::EmptyPayload,
2641 fidl::encoding::ResultType<ResourceProviderGetDeviceTreeResponse, i32>,
2642 >(
2643 (),
2644 0x28fafebf621fdb07,
2645 fidl::encoding::DynamicFlags::empty(),
2646 ___deadline,
2647 )?;
2648 Ok(_response.map(|x| x.devicetree))
2649 }
2650}
2651
2652#[cfg(target_os = "fuchsia")]
2653impl From<ResourceProviderSynchronousProxy> for zx::Handle {
2654 fn from(value: ResourceProviderSynchronousProxy) -> Self {
2655 value.into_channel().into()
2656 }
2657}
2658
2659#[cfg(target_os = "fuchsia")]
2660impl From<fidl::Channel> for ResourceProviderSynchronousProxy {
2661 fn from(value: fidl::Channel) -> Self {
2662 Self::new(value)
2663 }
2664}
2665
2666#[cfg(target_os = "fuchsia")]
2667impl fidl::endpoints::FromClient for ResourceProviderSynchronousProxy {
2668 type Protocol = ResourceProviderMarker;
2669
2670 fn from_client(value: fidl::endpoints::ClientEnd<ResourceProviderMarker>) -> Self {
2671 Self::new(value.into_channel())
2672 }
2673}
2674
2675#[derive(Debug, Clone)]
2676pub struct ResourceProviderProxy {
2677 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2678}
2679
2680impl fidl::endpoints::Proxy for ResourceProviderProxy {
2681 type Protocol = ResourceProviderMarker;
2682
2683 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2684 Self::new(inner)
2685 }
2686
2687 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2688 self.client.into_channel().map_err(|client| Self { client })
2689 }
2690
2691 fn as_channel(&self) -> &::fidl::AsyncChannel {
2692 self.client.as_channel()
2693 }
2694}
2695
2696impl ResourceProviderProxy {
2697 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2699 let protocol_name = <ResourceProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2700 Self { client: fidl::client::Client::new(channel, protocol_name) }
2701 }
2702
2703 pub fn take_event_stream(&self) -> ResourceProviderEventStream {
2709 ResourceProviderEventStream { event_receiver: self.client.take_event_receiver() }
2710 }
2711
2712 pub fn r#get_device_tree(
2713 &self,
2714 ) -> fidl::client::QueryResponseFut<
2715 ResourceProviderGetDeviceTreeResult,
2716 fidl::encoding::DefaultFuchsiaResourceDialect,
2717 > {
2718 ResourceProviderProxyInterface::r#get_device_tree(self)
2719 }
2720}
2721
2722impl ResourceProviderProxyInterface for ResourceProviderProxy {
2723 type GetDeviceTreeResponseFut = fidl::client::QueryResponseFut<
2724 ResourceProviderGetDeviceTreeResult,
2725 fidl::encoding::DefaultFuchsiaResourceDialect,
2726 >;
2727 fn r#get_device_tree(&self) -> Self::GetDeviceTreeResponseFut {
2728 fn _decode(
2729 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2730 ) -> Result<ResourceProviderGetDeviceTreeResult, fidl::Error> {
2731 let _response = fidl::client::decode_transaction_body::<
2732 fidl::encoding::ResultType<ResourceProviderGetDeviceTreeResponse, i32>,
2733 fidl::encoding::DefaultFuchsiaResourceDialect,
2734 0x28fafebf621fdb07,
2735 >(_buf?)?;
2736 Ok(_response.map(|x| x.devicetree))
2737 }
2738 self.client.send_query_and_decode::<
2739 fidl::encoding::EmptyPayload,
2740 ResourceProviderGetDeviceTreeResult,
2741 >(
2742 (),
2743 0x28fafebf621fdb07,
2744 fidl::encoding::DynamicFlags::empty(),
2745 _decode,
2746 )
2747 }
2748}
2749
2750pub struct ResourceProviderEventStream {
2751 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2752}
2753
2754impl std::marker::Unpin for ResourceProviderEventStream {}
2755
2756impl futures::stream::FusedStream for ResourceProviderEventStream {
2757 fn is_terminated(&self) -> bool {
2758 self.event_receiver.is_terminated()
2759 }
2760}
2761
2762impl futures::Stream for ResourceProviderEventStream {
2763 type Item = Result<ResourceProviderEvent, fidl::Error>;
2764
2765 fn poll_next(
2766 mut self: std::pin::Pin<&mut Self>,
2767 cx: &mut std::task::Context<'_>,
2768 ) -> std::task::Poll<Option<Self::Item>> {
2769 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2770 &mut self.event_receiver,
2771 cx
2772 )?) {
2773 Some(buf) => std::task::Poll::Ready(Some(ResourceProviderEvent::decode(buf))),
2774 None => std::task::Poll::Ready(None),
2775 }
2776 }
2777}
2778
2779#[derive(Debug)]
2780pub enum ResourceProviderEvent {}
2781
2782impl ResourceProviderEvent {
2783 fn decode(
2785 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2786 ) -> Result<ResourceProviderEvent, fidl::Error> {
2787 let (bytes, _handles) = buf.split_mut();
2788 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2789 debug_assert_eq!(tx_header.tx_id, 0);
2790 match tx_header.ordinal {
2791 _ => Err(fidl::Error::UnknownOrdinal {
2792 ordinal: tx_header.ordinal,
2793 protocol_name:
2794 <ResourceProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2795 }),
2796 }
2797 }
2798}
2799
2800pub struct ResourceProviderRequestStream {
2802 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2803 is_terminated: bool,
2804}
2805
2806impl std::marker::Unpin for ResourceProviderRequestStream {}
2807
2808impl futures::stream::FusedStream for ResourceProviderRequestStream {
2809 fn is_terminated(&self) -> bool {
2810 self.is_terminated
2811 }
2812}
2813
2814impl fidl::endpoints::RequestStream for ResourceProviderRequestStream {
2815 type Protocol = ResourceProviderMarker;
2816 type ControlHandle = ResourceProviderControlHandle;
2817
2818 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2819 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2820 }
2821
2822 fn control_handle(&self) -> Self::ControlHandle {
2823 ResourceProviderControlHandle { inner: self.inner.clone() }
2824 }
2825
2826 fn into_inner(
2827 self,
2828 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2829 {
2830 (self.inner, self.is_terminated)
2831 }
2832
2833 fn from_inner(
2834 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2835 is_terminated: bool,
2836 ) -> Self {
2837 Self { inner, is_terminated }
2838 }
2839}
2840
2841impl futures::Stream for ResourceProviderRequestStream {
2842 type Item = Result<ResourceProviderRequest, fidl::Error>;
2843
2844 fn poll_next(
2845 mut self: std::pin::Pin<&mut Self>,
2846 cx: &mut std::task::Context<'_>,
2847 ) -> std::task::Poll<Option<Self::Item>> {
2848 let this = &mut *self;
2849 if this.inner.check_shutdown(cx) {
2850 this.is_terminated = true;
2851 return std::task::Poll::Ready(None);
2852 }
2853 if this.is_terminated {
2854 panic!("polled ResourceProviderRequestStream after completion");
2855 }
2856 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2857 |bytes, handles| {
2858 match this.inner.channel().read_etc(cx, bytes, handles) {
2859 std::task::Poll::Ready(Ok(())) => {}
2860 std::task::Poll::Pending => return std::task::Poll::Pending,
2861 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2862 this.is_terminated = true;
2863 return std::task::Poll::Ready(None);
2864 }
2865 std::task::Poll::Ready(Err(e)) => {
2866 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2867 e.into(),
2868 ))));
2869 }
2870 }
2871
2872 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2874
2875 std::task::Poll::Ready(Some(match header.ordinal {
2876 0x28fafebf621fdb07 => {
2877 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2878 let mut req = fidl::new_empty!(
2879 fidl::encoding::EmptyPayload,
2880 fidl::encoding::DefaultFuchsiaResourceDialect
2881 );
2882 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2883 let control_handle =
2884 ResourceProviderControlHandle { inner: this.inner.clone() };
2885 Ok(ResourceProviderRequest::GetDeviceTree {
2886 responder: ResourceProviderGetDeviceTreeResponder {
2887 control_handle: std::mem::ManuallyDrop::new(control_handle),
2888 tx_id: header.tx_id,
2889 },
2890 })
2891 }
2892 _ => Err(fidl::Error::UnknownOrdinal {
2893 ordinal: header.ordinal,
2894 protocol_name:
2895 <ResourceProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2896 }),
2897 }))
2898 },
2899 )
2900 }
2901}
2902
2903#[derive(Debug)]
2904pub enum ResourceProviderRequest {
2905 GetDeviceTree { responder: ResourceProviderGetDeviceTreeResponder },
2906}
2907
2908impl ResourceProviderRequest {
2909 #[allow(irrefutable_let_patterns)]
2910 pub fn into_get_device_tree(self) -> Option<(ResourceProviderGetDeviceTreeResponder)> {
2911 if let ResourceProviderRequest::GetDeviceTree { responder } = self {
2912 Some((responder))
2913 } else {
2914 None
2915 }
2916 }
2917
2918 pub fn method_name(&self) -> &'static str {
2920 match *self {
2921 ResourceProviderRequest::GetDeviceTree { .. } => "get_device_tree",
2922 }
2923 }
2924}
2925
2926#[derive(Debug, Clone)]
2927pub struct ResourceProviderControlHandle {
2928 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2929}
2930
2931impl fidl::endpoints::ControlHandle for ResourceProviderControlHandle {
2932 fn shutdown(&self) {
2933 self.inner.shutdown()
2934 }
2935 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2936 self.inner.shutdown_with_epitaph(status)
2937 }
2938
2939 fn is_closed(&self) -> bool {
2940 self.inner.channel().is_closed()
2941 }
2942 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2943 self.inner.channel().on_closed()
2944 }
2945
2946 #[cfg(target_os = "fuchsia")]
2947 fn signal_peer(
2948 &self,
2949 clear_mask: zx::Signals,
2950 set_mask: zx::Signals,
2951 ) -> Result<(), zx_status::Status> {
2952 use fidl::Peered;
2953 self.inner.channel().signal_peer(clear_mask, set_mask)
2954 }
2955}
2956
2957impl ResourceProviderControlHandle {}
2958
2959#[must_use = "FIDL methods require a response to be sent"]
2960#[derive(Debug)]
2961pub struct ResourceProviderGetDeviceTreeResponder {
2962 control_handle: std::mem::ManuallyDrop<ResourceProviderControlHandle>,
2963 tx_id: u32,
2964}
2965
2966impl std::ops::Drop for ResourceProviderGetDeviceTreeResponder {
2970 fn drop(&mut self) {
2971 self.control_handle.shutdown();
2972 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2974 }
2975}
2976
2977impl fidl::endpoints::Responder for ResourceProviderGetDeviceTreeResponder {
2978 type ControlHandle = ResourceProviderControlHandle;
2979
2980 fn control_handle(&self) -> &ResourceProviderControlHandle {
2981 &self.control_handle
2982 }
2983
2984 fn drop_without_shutdown(mut self) {
2985 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2987 std::mem::forget(self);
2989 }
2990}
2991
2992impl ResourceProviderGetDeviceTreeResponder {
2993 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
2997 let _result = self.send_raw(result);
2998 if _result.is_err() {
2999 self.control_handle.shutdown();
3000 }
3001 self.drop_without_shutdown();
3002 _result
3003 }
3004
3005 pub fn send_no_shutdown_on_err(
3007 self,
3008 mut result: Result<fidl::Vmo, i32>,
3009 ) -> Result<(), fidl::Error> {
3010 let _result = self.send_raw(result);
3011 self.drop_without_shutdown();
3012 _result
3013 }
3014
3015 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
3016 self.control_handle.inner.send::<fidl::encoding::ResultType<
3017 ResourceProviderGetDeviceTreeResponse,
3018 i32,
3019 >>(
3020 result.map(|devicetree| (devicetree,)),
3021 self.tx_id,
3022 0x28fafebf621fdb07,
3023 fidl::encoding::DynamicFlags::empty(),
3024 )
3025 }
3026}
3027
3028mod internal {
3029 use super::*;
3030
3031 impl fidl::encoding::ResourceTypeMarker for InternalGetBootDirectoryResponse {
3032 type Borrowed<'a> = &'a mut Self;
3033 fn take_or_borrow<'a>(
3034 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3035 ) -> Self::Borrowed<'a> {
3036 value
3037 }
3038 }
3039
3040 unsafe impl fidl::encoding::TypeMarker for InternalGetBootDirectoryResponse {
3041 type Owned = Self;
3042
3043 #[inline(always)]
3044 fn inline_align(_context: fidl::encoding::Context) -> usize {
3045 4
3046 }
3047
3048 #[inline(always)]
3049 fn inline_size(_context: fidl::encoding::Context) -> usize {
3050 4
3051 }
3052 }
3053
3054 unsafe impl
3055 fidl::encoding::Encode<
3056 InternalGetBootDirectoryResponse,
3057 fidl::encoding::DefaultFuchsiaResourceDialect,
3058 > for &mut InternalGetBootDirectoryResponse
3059 {
3060 #[inline]
3061 unsafe fn encode(
3062 self,
3063 encoder: &mut fidl::encoding::Encoder<
3064 '_,
3065 fidl::encoding::DefaultFuchsiaResourceDialect,
3066 >,
3067 offset: usize,
3068 _depth: fidl::encoding::Depth,
3069 ) -> fidl::Result<()> {
3070 encoder.debug_check_bounds::<InternalGetBootDirectoryResponse>(offset);
3071 fidl::encoding::Encode::<
3073 InternalGetBootDirectoryResponse,
3074 fidl::encoding::DefaultFuchsiaResourceDialect,
3075 >::encode(
3076 (<fidl::encoding::Optional<
3077 fidl::encoding::Endpoint<
3078 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3079 >,
3080 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3081 &mut self.boot_dir
3082 ),),
3083 encoder,
3084 offset,
3085 _depth,
3086 )
3087 }
3088 }
3089 unsafe impl<
3090 T0: fidl::encoding::Encode<
3091 fidl::encoding::Optional<
3092 fidl::encoding::Endpoint<
3093 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3094 >,
3095 >,
3096 fidl::encoding::DefaultFuchsiaResourceDialect,
3097 >,
3098 >
3099 fidl::encoding::Encode<
3100 InternalGetBootDirectoryResponse,
3101 fidl::encoding::DefaultFuchsiaResourceDialect,
3102 > for (T0,)
3103 {
3104 #[inline]
3105 unsafe fn encode(
3106 self,
3107 encoder: &mut fidl::encoding::Encoder<
3108 '_,
3109 fidl::encoding::DefaultFuchsiaResourceDialect,
3110 >,
3111 offset: usize,
3112 depth: fidl::encoding::Depth,
3113 ) -> fidl::Result<()> {
3114 encoder.debug_check_bounds::<InternalGetBootDirectoryResponse>(offset);
3115 self.0.encode(encoder, offset + 0, depth)?;
3119 Ok(())
3120 }
3121 }
3122
3123 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3124 for InternalGetBootDirectoryResponse
3125 {
3126 #[inline(always)]
3127 fn new_empty() -> Self {
3128 Self {
3129 boot_dir: fidl::new_empty!(
3130 fidl::encoding::Optional<
3131 fidl::encoding::Endpoint<
3132 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3133 >,
3134 >,
3135 fidl::encoding::DefaultFuchsiaResourceDialect
3136 ),
3137 }
3138 }
3139
3140 #[inline]
3141 unsafe fn decode(
3142 &mut self,
3143 decoder: &mut fidl::encoding::Decoder<
3144 '_,
3145 fidl::encoding::DefaultFuchsiaResourceDialect,
3146 >,
3147 offset: usize,
3148 _depth: fidl::encoding::Depth,
3149 ) -> fidl::Result<()> {
3150 decoder.debug_check_bounds::<Self>(offset);
3151 fidl::decode!(
3153 fidl::encoding::Optional<
3154 fidl::encoding::Endpoint<
3155 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3156 >,
3157 >,
3158 fidl::encoding::DefaultFuchsiaResourceDialect,
3159 &mut self.boot_dir,
3160 decoder,
3161 offset + 0,
3162 _depth
3163 )?;
3164 Ok(())
3165 }
3166 }
3167
3168 impl fidl::encoding::ResourceTypeMarker for InternalGetTestPackageResponse {
3169 type Borrowed<'a> = &'a mut Self;
3170 fn take_or_borrow<'a>(
3171 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3172 ) -> Self::Borrowed<'a> {
3173 value
3174 }
3175 }
3176
3177 unsafe impl fidl::encoding::TypeMarker for InternalGetTestPackageResponse {
3178 type Owned = Self;
3179
3180 #[inline(always)]
3181 fn inline_align(_context: fidl::encoding::Context) -> usize {
3182 4
3183 }
3184
3185 #[inline(always)]
3186 fn inline_size(_context: fidl::encoding::Context) -> usize {
3187 4
3188 }
3189 }
3190
3191 unsafe impl
3192 fidl::encoding::Encode<
3193 InternalGetTestPackageResponse,
3194 fidl::encoding::DefaultFuchsiaResourceDialect,
3195 > for &mut InternalGetTestPackageResponse
3196 {
3197 #[inline]
3198 unsafe fn encode(
3199 self,
3200 encoder: &mut fidl::encoding::Encoder<
3201 '_,
3202 fidl::encoding::DefaultFuchsiaResourceDialect,
3203 >,
3204 offset: usize,
3205 _depth: fidl::encoding::Depth,
3206 ) -> fidl::Result<()> {
3207 encoder.debug_check_bounds::<InternalGetTestPackageResponse>(offset);
3208 fidl::encoding::Encode::<
3210 InternalGetTestPackageResponse,
3211 fidl::encoding::DefaultFuchsiaResourceDialect,
3212 >::encode(
3213 (<fidl::encoding::Optional<
3214 fidl::encoding::Endpoint<
3215 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3216 >,
3217 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3218 &mut self.test_pkg_dir
3219 ),),
3220 encoder,
3221 offset,
3222 _depth,
3223 )
3224 }
3225 }
3226 unsafe impl<
3227 T0: fidl::encoding::Encode<
3228 fidl::encoding::Optional<
3229 fidl::encoding::Endpoint<
3230 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3231 >,
3232 >,
3233 fidl::encoding::DefaultFuchsiaResourceDialect,
3234 >,
3235 >
3236 fidl::encoding::Encode<
3237 InternalGetTestPackageResponse,
3238 fidl::encoding::DefaultFuchsiaResourceDialect,
3239 > for (T0,)
3240 {
3241 #[inline]
3242 unsafe fn encode(
3243 self,
3244 encoder: &mut fidl::encoding::Encoder<
3245 '_,
3246 fidl::encoding::DefaultFuchsiaResourceDialect,
3247 >,
3248 offset: usize,
3249 depth: fidl::encoding::Depth,
3250 ) -> fidl::Result<()> {
3251 encoder.debug_check_bounds::<InternalGetTestPackageResponse>(offset);
3252 self.0.encode(encoder, offset + 0, depth)?;
3256 Ok(())
3257 }
3258 }
3259
3260 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3261 for InternalGetTestPackageResponse
3262 {
3263 #[inline(always)]
3264 fn new_empty() -> Self {
3265 Self {
3266 test_pkg_dir: fidl::new_empty!(
3267 fidl::encoding::Optional<
3268 fidl::encoding::Endpoint<
3269 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3270 >,
3271 >,
3272 fidl::encoding::DefaultFuchsiaResourceDialect
3273 ),
3274 }
3275 }
3276
3277 #[inline]
3278 unsafe fn decode(
3279 &mut self,
3280 decoder: &mut fidl::encoding::Decoder<
3281 '_,
3282 fidl::encoding::DefaultFuchsiaResourceDialect,
3283 >,
3284 offset: usize,
3285 _depth: fidl::encoding::Depth,
3286 ) -> fidl::Result<()> {
3287 decoder.debug_check_bounds::<Self>(offset);
3288 fidl::decode!(
3290 fidl::encoding::Optional<
3291 fidl::encoding::Endpoint<
3292 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3293 >,
3294 >,
3295 fidl::encoding::DefaultFuchsiaResourceDialect,
3296 &mut self.test_pkg_dir,
3297 decoder,
3298 offset + 0,
3299 _depth
3300 )?;
3301 Ok(())
3302 }
3303 }
3304
3305 impl fidl::encoding::ResourceTypeMarker for ManifestProviderGetManifestResponse {
3306 type Borrowed<'a> = &'a mut Self;
3307 fn take_or_borrow<'a>(
3308 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3309 ) -> Self::Borrowed<'a> {
3310 value
3311 }
3312 }
3313
3314 unsafe impl fidl::encoding::TypeMarker for ManifestProviderGetManifestResponse {
3315 type Owned = Self;
3316
3317 #[inline(always)]
3318 fn inline_align(_context: fidl::encoding::Context) -> usize {
3319 4
3320 }
3321
3322 #[inline(always)]
3323 fn inline_size(_context: fidl::encoding::Context) -> usize {
3324 4
3325 }
3326 }
3327
3328 unsafe impl
3329 fidl::encoding::Encode<
3330 ManifestProviderGetManifestResponse,
3331 fidl::encoding::DefaultFuchsiaResourceDialect,
3332 > for &mut ManifestProviderGetManifestResponse
3333 {
3334 #[inline]
3335 unsafe fn encode(
3336 self,
3337 encoder: &mut fidl::encoding::Encoder<
3338 '_,
3339 fidl::encoding::DefaultFuchsiaResourceDialect,
3340 >,
3341 offset: usize,
3342 _depth: fidl::encoding::Depth,
3343 ) -> fidl::Result<()> {
3344 encoder.debug_check_bounds::<ManifestProviderGetManifestResponse>(offset);
3345 fidl::encoding::Encode::<
3347 ManifestProviderGetManifestResponse,
3348 fidl::encoding::DefaultFuchsiaResourceDialect,
3349 >::encode(
3350 (<fidl::encoding::HandleType<
3351 fidl::Stream,
3352 { fidl::ObjectType::STREAM.into_raw() },
3353 2147483648,
3354 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3355 &mut self.manifest
3356 ),),
3357 encoder,
3358 offset,
3359 _depth,
3360 )
3361 }
3362 }
3363 unsafe impl<
3364 T0: fidl::encoding::Encode<
3365 fidl::encoding::HandleType<
3366 fidl::Stream,
3367 { fidl::ObjectType::STREAM.into_raw() },
3368 2147483648,
3369 >,
3370 fidl::encoding::DefaultFuchsiaResourceDialect,
3371 >,
3372 >
3373 fidl::encoding::Encode<
3374 ManifestProviderGetManifestResponse,
3375 fidl::encoding::DefaultFuchsiaResourceDialect,
3376 > for (T0,)
3377 {
3378 #[inline]
3379 unsafe fn encode(
3380 self,
3381 encoder: &mut fidl::encoding::Encoder<
3382 '_,
3383 fidl::encoding::DefaultFuchsiaResourceDialect,
3384 >,
3385 offset: usize,
3386 depth: fidl::encoding::Depth,
3387 ) -> fidl::Result<()> {
3388 encoder.debug_check_bounds::<ManifestProviderGetManifestResponse>(offset);
3389 self.0.encode(encoder, offset + 0, depth)?;
3393 Ok(())
3394 }
3395 }
3396
3397 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3398 for ManifestProviderGetManifestResponse
3399 {
3400 #[inline(always)]
3401 fn new_empty() -> Self {
3402 Self {
3403 manifest: fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3404 }
3405 }
3406
3407 #[inline]
3408 unsafe fn decode(
3409 &mut self,
3410 decoder: &mut fidl::encoding::Decoder<
3411 '_,
3412 fidl::encoding::DefaultFuchsiaResourceDialect,
3413 >,
3414 offset: usize,
3415 _depth: fidl::encoding::Depth,
3416 ) -> fidl::Result<()> {
3417 decoder.debug_check_bounds::<Self>(offset);
3418 fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.manifest, decoder, offset + 0, _depth)?;
3420 Ok(())
3421 }
3422 }
3423
3424 impl fidl::encoding::ResourceTypeMarker for RealmStartRequest {
3425 type Borrowed<'a> = &'a mut Self;
3426 fn take_or_borrow<'a>(
3427 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3428 ) -> Self::Borrowed<'a> {
3429 value
3430 }
3431 }
3432
3433 unsafe impl fidl::encoding::TypeMarker for RealmStartRequest {
3434 type Owned = Self;
3435
3436 #[inline(always)]
3437 fn inline_align(_context: fidl::encoding::Context) -> usize {
3438 8
3439 }
3440
3441 #[inline(always)]
3442 fn inline_size(_context: fidl::encoding::Context) -> usize {
3443 16
3444 }
3445 }
3446
3447 unsafe impl
3448 fidl::encoding::Encode<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3449 for &mut RealmStartRequest
3450 {
3451 #[inline]
3452 unsafe fn encode(
3453 self,
3454 encoder: &mut fidl::encoding::Encoder<
3455 '_,
3456 fidl::encoding::DefaultFuchsiaResourceDialect,
3457 >,
3458 offset: usize,
3459 _depth: fidl::encoding::Depth,
3460 ) -> fidl::Result<()> {
3461 encoder.debug_check_bounds::<RealmStartRequest>(offset);
3462 fidl::encoding::Encode::<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3464 (
3465 <RealmArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
3466 ),
3467 encoder, offset, _depth
3468 )
3469 }
3470 }
3471 unsafe impl<
3472 T0: fidl::encoding::Encode<RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
3473 > fidl::encoding::Encode<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3474 for (T0,)
3475 {
3476 #[inline]
3477 unsafe fn encode(
3478 self,
3479 encoder: &mut fidl::encoding::Encoder<
3480 '_,
3481 fidl::encoding::DefaultFuchsiaResourceDialect,
3482 >,
3483 offset: usize,
3484 depth: fidl::encoding::Depth,
3485 ) -> fidl::Result<()> {
3486 encoder.debug_check_bounds::<RealmStartRequest>(offset);
3487 self.0.encode(encoder, offset + 0, depth)?;
3491 Ok(())
3492 }
3493 }
3494
3495 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3496 for RealmStartRequest
3497 {
3498 #[inline(always)]
3499 fn new_empty() -> Self {
3500 Self {
3501 args: fidl::new_empty!(RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect),
3502 }
3503 }
3504
3505 #[inline]
3506 unsafe fn decode(
3507 &mut self,
3508 decoder: &mut fidl::encoding::Decoder<
3509 '_,
3510 fidl::encoding::DefaultFuchsiaResourceDialect,
3511 >,
3512 offset: usize,
3513 _depth: fidl::encoding::Depth,
3514 ) -> fidl::Result<()> {
3515 decoder.debug_check_bounds::<Self>(offset);
3516 fidl::decode!(
3518 RealmArgs,
3519 fidl::encoding::DefaultFuchsiaResourceDialect,
3520 &mut self.args,
3521 decoder,
3522 offset + 0,
3523 _depth
3524 )?;
3525 Ok(())
3526 }
3527 }
3528
3529 impl fidl::encoding::ResourceTypeMarker for ResourceProviderGetDeviceTreeResponse {
3530 type Borrowed<'a> = &'a mut Self;
3531 fn take_or_borrow<'a>(
3532 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3533 ) -> Self::Borrowed<'a> {
3534 value
3535 }
3536 }
3537
3538 unsafe impl fidl::encoding::TypeMarker for ResourceProviderGetDeviceTreeResponse {
3539 type Owned = Self;
3540
3541 #[inline(always)]
3542 fn inline_align(_context: fidl::encoding::Context) -> usize {
3543 4
3544 }
3545
3546 #[inline(always)]
3547 fn inline_size(_context: fidl::encoding::Context) -> usize {
3548 4
3549 }
3550 }
3551
3552 unsafe impl
3553 fidl::encoding::Encode<
3554 ResourceProviderGetDeviceTreeResponse,
3555 fidl::encoding::DefaultFuchsiaResourceDialect,
3556 > for &mut ResourceProviderGetDeviceTreeResponse
3557 {
3558 #[inline]
3559 unsafe fn encode(
3560 self,
3561 encoder: &mut fidl::encoding::Encoder<
3562 '_,
3563 fidl::encoding::DefaultFuchsiaResourceDialect,
3564 >,
3565 offset: usize,
3566 _depth: fidl::encoding::Depth,
3567 ) -> fidl::Result<()> {
3568 encoder.debug_check_bounds::<ResourceProviderGetDeviceTreeResponse>(offset);
3569 fidl::encoding::Encode::<
3571 ResourceProviderGetDeviceTreeResponse,
3572 fidl::encoding::DefaultFuchsiaResourceDialect,
3573 >::encode(
3574 (<fidl::encoding::HandleType<
3575 fidl::Vmo,
3576 { fidl::ObjectType::VMO.into_raw() },
3577 2147483648,
3578 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3579 &mut self.devicetree
3580 ),),
3581 encoder,
3582 offset,
3583 _depth,
3584 )
3585 }
3586 }
3587 unsafe impl<
3588 T0: fidl::encoding::Encode<
3589 fidl::encoding::HandleType<
3590 fidl::Vmo,
3591 { fidl::ObjectType::VMO.into_raw() },
3592 2147483648,
3593 >,
3594 fidl::encoding::DefaultFuchsiaResourceDialect,
3595 >,
3596 >
3597 fidl::encoding::Encode<
3598 ResourceProviderGetDeviceTreeResponse,
3599 fidl::encoding::DefaultFuchsiaResourceDialect,
3600 > for (T0,)
3601 {
3602 #[inline]
3603 unsafe fn encode(
3604 self,
3605 encoder: &mut fidl::encoding::Encoder<
3606 '_,
3607 fidl::encoding::DefaultFuchsiaResourceDialect,
3608 >,
3609 offset: usize,
3610 depth: fidl::encoding::Depth,
3611 ) -> fidl::Result<()> {
3612 encoder.debug_check_bounds::<ResourceProviderGetDeviceTreeResponse>(offset);
3613 self.0.encode(encoder, offset + 0, depth)?;
3617 Ok(())
3618 }
3619 }
3620
3621 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3622 for ResourceProviderGetDeviceTreeResponse
3623 {
3624 #[inline(always)]
3625 fn new_empty() -> Self {
3626 Self {
3627 devicetree: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3628 }
3629 }
3630
3631 #[inline]
3632 unsafe fn decode(
3633 &mut self,
3634 decoder: &mut fidl::encoding::Decoder<
3635 '_,
3636 fidl::encoding::DefaultFuchsiaResourceDialect,
3637 >,
3638 offset: usize,
3639 _depth: fidl::encoding::Depth,
3640 ) -> fidl::Result<()> {
3641 decoder.debug_check_bounds::<Self>(offset);
3642 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.devicetree, decoder, offset + 0, _depth)?;
3644 Ok(())
3645 }
3646 }
3647
3648 impl RealmArgs {
3649 #[inline(always)]
3650 fn max_ordinal_present(&self) -> u64 {
3651 if let Some(_) = self.platform_pid {
3652 return 22;
3653 }
3654 if let Some(_) = self.platform_vid {
3655 return 21;
3656 }
3657 if let Some(_) = self.devicetree {
3658 return 20;
3659 }
3660 if let Some(_) = self.boot_driver_components {
3661 return 19;
3662 }
3663 if let Some(_) = self.software_devices {
3664 return 18;
3665 }
3666 if let Some(_) = self.driver_index_stop_timeout_millis {
3667 return 17;
3668 }
3669 if let Some(_) = self.test_component {
3670 return 16;
3671 }
3672 if let Some(_) = self.dtr_exposes {
3673 return 15;
3674 }
3675 if let Some(_) = self.dtr_offers {
3676 return 14;
3677 }
3678 if let Some(_) = self.pkg {
3679 return 13;
3680 }
3681 if let Some(_) = self.exposes {
3682 return 12;
3683 }
3684 if let Some(_) = self.offers {
3685 return 11;
3686 }
3687 if let Some(_) = self.board_name {
3688 return 10;
3689 }
3690 if let Some(_) = self.driver_bind_eager {
3691 return 9;
3692 }
3693 if let Some(_) = self.driver_disable {
3694 return 8;
3695 }
3696 if let Some(_) = self.driver_log_level {
3697 return 7;
3698 }
3699 if let Some(_) = self.driver_tests_disable {
3700 return 6;
3701 }
3702 if let Some(_) = self.driver_tests_enable {
3703 return 5;
3704 }
3705 if let Some(_) = self.driver_tests_enable_all {
3706 return 4;
3707 }
3708 if let Some(_) = self.root_driver {
3709 return 2;
3710 }
3711 if let Some(_) = self.boot {
3712 return 1;
3713 }
3714 0
3715 }
3716 }
3717
3718 impl fidl::encoding::ResourceTypeMarker for RealmArgs {
3719 type Borrowed<'a> = &'a mut Self;
3720 fn take_or_borrow<'a>(
3721 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3722 ) -> Self::Borrowed<'a> {
3723 value
3724 }
3725 }
3726
3727 unsafe impl fidl::encoding::TypeMarker for RealmArgs {
3728 type Owned = Self;
3729
3730 #[inline(always)]
3731 fn inline_align(_context: fidl::encoding::Context) -> usize {
3732 8
3733 }
3734
3735 #[inline(always)]
3736 fn inline_size(_context: fidl::encoding::Context) -> usize {
3737 16
3738 }
3739 }
3740
3741 unsafe impl fidl::encoding::Encode<RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
3742 for &mut RealmArgs
3743 {
3744 unsafe fn encode(
3745 self,
3746 encoder: &mut fidl::encoding::Encoder<
3747 '_,
3748 fidl::encoding::DefaultFuchsiaResourceDialect,
3749 >,
3750 offset: usize,
3751 mut depth: fidl::encoding::Depth,
3752 ) -> fidl::Result<()> {
3753 encoder.debug_check_bounds::<RealmArgs>(offset);
3754 let max_ordinal: u64 = self.max_ordinal_present();
3756 encoder.write_num(max_ordinal, offset);
3757 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3758 if max_ordinal == 0 {
3760 return Ok(());
3761 }
3762 depth.increment()?;
3763 let envelope_size = 8;
3764 let bytes_len = max_ordinal as usize * envelope_size;
3765 #[allow(unused_variables)]
3766 let offset = encoder.out_of_line_offset(bytes_len);
3767 let mut _prev_end_offset: usize = 0;
3768 if 1 > max_ordinal {
3769 return Ok(());
3770 }
3771
3772 let cur_offset: usize = (1 - 1) * envelope_size;
3775
3776 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3778
3779 fidl::encoding::encode_in_envelope_optional::<
3784 fidl::encoding::Endpoint<
3785 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3786 >,
3787 fidl::encoding::DefaultFuchsiaResourceDialect,
3788 >(
3789 self.boot.as_mut().map(
3790 <fidl::encoding::Endpoint<
3791 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3792 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3793 ),
3794 encoder,
3795 offset + cur_offset,
3796 depth,
3797 )?;
3798
3799 _prev_end_offset = cur_offset + envelope_size;
3800 if 2 > max_ordinal {
3801 return Ok(());
3802 }
3803
3804 let cur_offset: usize = (2 - 1) * envelope_size;
3807
3808 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3810
3811 fidl::encoding::encode_in_envelope_optional::<
3816 fidl::encoding::UnboundedString,
3817 fidl::encoding::DefaultFuchsiaResourceDialect,
3818 >(
3819 self.root_driver.as_ref().map(
3820 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3821 ),
3822 encoder,
3823 offset + cur_offset,
3824 depth,
3825 )?;
3826
3827 _prev_end_offset = cur_offset + envelope_size;
3828 if 4 > max_ordinal {
3829 return Ok(());
3830 }
3831
3832 let cur_offset: usize = (4 - 1) * envelope_size;
3835
3836 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3838
3839 fidl::encoding::encode_in_envelope_optional::<
3844 bool,
3845 fidl::encoding::DefaultFuchsiaResourceDialect,
3846 >(
3847 self.driver_tests_enable_all
3848 .as_ref()
3849 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3850 encoder,
3851 offset + cur_offset,
3852 depth,
3853 )?;
3854
3855 _prev_end_offset = cur_offset + envelope_size;
3856 if 5 > max_ordinal {
3857 return Ok(());
3858 }
3859
3860 let cur_offset: usize = (5 - 1) * envelope_size;
3863
3864 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3866
3867 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3872 self.driver_tests_enable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
3873 encoder, offset + cur_offset, depth
3874 )?;
3875
3876 _prev_end_offset = cur_offset + envelope_size;
3877 if 6 > max_ordinal {
3878 return Ok(());
3879 }
3880
3881 let cur_offset: usize = (6 - 1) * envelope_size;
3884
3885 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3887
3888 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3893 self.driver_tests_disable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
3894 encoder, offset + cur_offset, depth
3895 )?;
3896
3897 _prev_end_offset = cur_offset + envelope_size;
3898 if 7 > max_ordinal {
3899 return Ok(());
3900 }
3901
3902 let cur_offset: usize = (7 - 1) * envelope_size;
3905
3906 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3908
3909 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<DriverLog>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3914 self.driver_log_level.as_ref().map(<fidl::encoding::UnboundedVector<DriverLog> as fidl::encoding::ValueTypeMarker>::borrow),
3915 encoder, offset + cur_offset, depth
3916 )?;
3917
3918 _prev_end_offset = cur_offset + envelope_size;
3919 if 8 > max_ordinal {
3920 return Ok(());
3921 }
3922
3923 let cur_offset: usize = (8 - 1) * envelope_size;
3926
3927 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3929
3930 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3935 self.driver_disable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
3936 encoder, offset + cur_offset, depth
3937 )?;
3938
3939 _prev_end_offset = cur_offset + envelope_size;
3940 if 9 > max_ordinal {
3941 return Ok(());
3942 }
3943
3944 let cur_offset: usize = (9 - 1) * envelope_size;
3947
3948 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3950
3951 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3956 self.driver_bind_eager.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
3957 encoder, offset + cur_offset, depth
3958 )?;
3959
3960 _prev_end_offset = cur_offset + envelope_size;
3961 if 10 > max_ordinal {
3962 return Ok(());
3963 }
3964
3965 let cur_offset: usize = (10 - 1) * envelope_size;
3968
3969 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3971
3972 fidl::encoding::encode_in_envelope_optional::<
3977 fidl::encoding::UnboundedString,
3978 fidl::encoding::DefaultFuchsiaResourceDialect,
3979 >(
3980 self.board_name.as_ref().map(
3981 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3982 ),
3983 encoder,
3984 offset + cur_offset,
3985 depth,
3986 )?;
3987
3988 _prev_end_offset = cur_offset + envelope_size;
3989 if 11 > max_ordinal {
3990 return Ok(());
3991 }
3992
3993 let cur_offset: usize = (11 - 1) * envelope_size;
3996
3997 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3999
4000 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Offer>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4005 self.offers.as_ref().map(<fidl::encoding::UnboundedVector<Offer> as fidl::encoding::ValueTypeMarker>::borrow),
4006 encoder, offset + cur_offset, depth
4007 )?;
4008
4009 _prev_end_offset = cur_offset + envelope_size;
4010 if 12 > max_ordinal {
4011 return Ok(());
4012 }
4013
4014 let cur_offset: usize = (12 - 1) * envelope_size;
4017
4018 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4020
4021 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Expose>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4026 self.exposes.as_ref().map(<fidl::encoding::UnboundedVector<Expose> as fidl::encoding::ValueTypeMarker>::borrow),
4027 encoder, offset + cur_offset, depth
4028 )?;
4029
4030 _prev_end_offset = cur_offset + envelope_size;
4031 if 13 > max_ordinal {
4032 return Ok(());
4033 }
4034
4035 let cur_offset: usize = (13 - 1) * envelope_size;
4038
4039 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4041
4042 fidl::encoding::encode_in_envelope_optional::<
4047 fidl::encoding::Endpoint<
4048 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4049 >,
4050 fidl::encoding::DefaultFuchsiaResourceDialect,
4051 >(
4052 self.pkg.as_mut().map(
4053 <fidl::encoding::Endpoint<
4054 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4055 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
4056 ),
4057 encoder,
4058 offset + cur_offset,
4059 depth,
4060 )?;
4061
4062 _prev_end_offset = cur_offset + envelope_size;
4063 if 14 > max_ordinal {
4064 return Ok(());
4065 }
4066
4067 let cur_offset: usize = (14 - 1) * envelope_size;
4070
4071 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4073
4074 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4079 self.dtr_offers.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability> as fidl::encoding::ValueTypeMarker>::borrow),
4080 encoder, offset + cur_offset, depth
4081 )?;
4082
4083 _prev_end_offset = cur_offset + envelope_size;
4084 if 15 > max_ordinal {
4085 return Ok(());
4086 }
4087
4088 let cur_offset: usize = (15 - 1) * envelope_size;
4091
4092 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4094
4095 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4100 self.dtr_exposes.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability> as fidl::encoding::ValueTypeMarker>::borrow),
4101 encoder, offset + cur_offset, depth
4102 )?;
4103
4104 _prev_end_offset = cur_offset + envelope_size;
4105 if 16 > max_ordinal {
4106 return Ok(());
4107 }
4108
4109 let cur_offset: usize = (16 - 1) * envelope_size;
4112
4113 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4115
4116 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_resolution::Component, fidl::encoding::DefaultFuchsiaResourceDialect>(
4121 self.test_component.as_mut().map(<fidl_fuchsia_component_resolution::Component as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4122 encoder, offset + cur_offset, depth
4123 )?;
4124
4125 _prev_end_offset = cur_offset + envelope_size;
4126 if 17 > max_ordinal {
4127 return Ok(());
4128 }
4129
4130 let cur_offset: usize = (17 - 1) * envelope_size;
4133
4134 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4136
4137 fidl::encoding::encode_in_envelope_optional::<
4142 i64,
4143 fidl::encoding::DefaultFuchsiaResourceDialect,
4144 >(
4145 self.driver_index_stop_timeout_millis
4146 .as_ref()
4147 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
4148 encoder,
4149 offset + cur_offset,
4150 depth,
4151 )?;
4152
4153 _prev_end_offset = cur_offset + envelope_size;
4154 if 18 > max_ordinal {
4155 return Ok(());
4156 }
4157
4158 let cur_offset: usize = (18 - 1) * envelope_size;
4161
4162 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4164
4165 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4170 self.software_devices.as_ref().map(<fidl::encoding::Vector<SoftwareDevice, 20> as fidl::encoding::ValueTypeMarker>::borrow),
4171 encoder, offset + cur_offset, depth
4172 )?;
4173
4174 _prev_end_offset = cur_offset + envelope_size;
4175 if 19 > max_ordinal {
4176 return Ok(());
4177 }
4178
4179 let cur_offset: usize = (19 - 1) * envelope_size;
4182
4183 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4185
4186 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4191 self.boot_driver_components.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
4192 encoder, offset + cur_offset, depth
4193 )?;
4194
4195 _prev_end_offset = cur_offset + envelope_size;
4196 if 20 > max_ordinal {
4197 return Ok(());
4198 }
4199
4200 let cur_offset: usize = (20 - 1) * envelope_size;
4203
4204 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4206
4207 fidl::encoding::encode_in_envelope_optional::<
4212 fidl::encoding::HandleType<
4213 fidl::Vmo,
4214 { fidl::ObjectType::VMO.into_raw() },
4215 2147483648,
4216 >,
4217 fidl::encoding::DefaultFuchsiaResourceDialect,
4218 >(
4219 self.devicetree.as_mut().map(
4220 <fidl::encoding::HandleType<
4221 fidl::Vmo,
4222 { fidl::ObjectType::VMO.into_raw() },
4223 2147483648,
4224 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
4225 ),
4226 encoder,
4227 offset + cur_offset,
4228 depth,
4229 )?;
4230
4231 _prev_end_offset = cur_offset + envelope_size;
4232 if 21 > max_ordinal {
4233 return Ok(());
4234 }
4235
4236 let cur_offset: usize = (21 - 1) * envelope_size;
4239
4240 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4242
4243 fidl::encoding::encode_in_envelope_optional::<
4248 u32,
4249 fidl::encoding::DefaultFuchsiaResourceDialect,
4250 >(
4251 self.platform_vid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4252 encoder,
4253 offset + cur_offset,
4254 depth,
4255 )?;
4256
4257 _prev_end_offset = cur_offset + envelope_size;
4258 if 22 > max_ordinal {
4259 return Ok(());
4260 }
4261
4262 let cur_offset: usize = (22 - 1) * envelope_size;
4265
4266 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4268
4269 fidl::encoding::encode_in_envelope_optional::<
4274 u32,
4275 fidl::encoding::DefaultFuchsiaResourceDialect,
4276 >(
4277 self.platform_pid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4278 encoder,
4279 offset + cur_offset,
4280 depth,
4281 )?;
4282
4283 _prev_end_offset = cur_offset + envelope_size;
4284
4285 Ok(())
4286 }
4287 }
4288
4289 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RealmArgs {
4290 #[inline(always)]
4291 fn new_empty() -> Self {
4292 Self::default()
4293 }
4294
4295 unsafe fn decode(
4296 &mut self,
4297 decoder: &mut fidl::encoding::Decoder<
4298 '_,
4299 fidl::encoding::DefaultFuchsiaResourceDialect,
4300 >,
4301 offset: usize,
4302 mut depth: fidl::encoding::Depth,
4303 ) -> fidl::Result<()> {
4304 decoder.debug_check_bounds::<Self>(offset);
4305 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4306 None => return Err(fidl::Error::NotNullable),
4307 Some(len) => len,
4308 };
4309 if len == 0 {
4311 return Ok(());
4312 };
4313 depth.increment()?;
4314 let envelope_size = 8;
4315 let bytes_len = len * envelope_size;
4316 let offset = decoder.out_of_line_offset(bytes_len)?;
4317 let mut _next_ordinal_to_read = 0;
4319 let mut next_offset = offset;
4320 let end_offset = offset + bytes_len;
4321 _next_ordinal_to_read += 1;
4322 if next_offset >= end_offset {
4323 return Ok(());
4324 }
4325
4326 while _next_ordinal_to_read < 1 {
4328 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4329 _next_ordinal_to_read += 1;
4330 next_offset += envelope_size;
4331 }
4332
4333 let next_out_of_line = decoder.next_out_of_line();
4334 let handles_before = decoder.remaining_handles();
4335 if let Some((inlined, num_bytes, num_handles)) =
4336 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4337 {
4338 let member_inline_size = <fidl::encoding::Endpoint<
4339 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4340 > as fidl::encoding::TypeMarker>::inline_size(
4341 decoder.context
4342 );
4343 if inlined != (member_inline_size <= 4) {
4344 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4345 }
4346 let inner_offset;
4347 let mut inner_depth = depth.clone();
4348 if inlined {
4349 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4350 inner_offset = next_offset;
4351 } else {
4352 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4353 inner_depth.increment()?;
4354 }
4355 let val_ref = self.boot.get_or_insert_with(|| {
4356 fidl::new_empty!(
4357 fidl::encoding::Endpoint<
4358 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4359 >,
4360 fidl::encoding::DefaultFuchsiaResourceDialect
4361 )
4362 });
4363 fidl::decode!(
4364 fidl::encoding::Endpoint<
4365 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4366 >,
4367 fidl::encoding::DefaultFuchsiaResourceDialect,
4368 val_ref,
4369 decoder,
4370 inner_offset,
4371 inner_depth
4372 )?;
4373 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4374 {
4375 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4376 }
4377 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4378 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4379 }
4380 }
4381
4382 next_offset += envelope_size;
4383 _next_ordinal_to_read += 1;
4384 if next_offset >= end_offset {
4385 return Ok(());
4386 }
4387
4388 while _next_ordinal_to_read < 2 {
4390 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4391 _next_ordinal_to_read += 1;
4392 next_offset += envelope_size;
4393 }
4394
4395 let next_out_of_line = decoder.next_out_of_line();
4396 let handles_before = decoder.remaining_handles();
4397 if let Some((inlined, num_bytes, num_handles)) =
4398 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4399 {
4400 let member_inline_size =
4401 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4402 decoder.context,
4403 );
4404 if inlined != (member_inline_size <= 4) {
4405 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4406 }
4407 let inner_offset;
4408 let mut inner_depth = depth.clone();
4409 if inlined {
4410 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4411 inner_offset = next_offset;
4412 } else {
4413 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4414 inner_depth.increment()?;
4415 }
4416 let val_ref = self.root_driver.get_or_insert_with(|| {
4417 fidl::new_empty!(
4418 fidl::encoding::UnboundedString,
4419 fidl::encoding::DefaultFuchsiaResourceDialect
4420 )
4421 });
4422 fidl::decode!(
4423 fidl::encoding::UnboundedString,
4424 fidl::encoding::DefaultFuchsiaResourceDialect,
4425 val_ref,
4426 decoder,
4427 inner_offset,
4428 inner_depth
4429 )?;
4430 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4431 {
4432 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4433 }
4434 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4435 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4436 }
4437 }
4438
4439 next_offset += envelope_size;
4440 _next_ordinal_to_read += 1;
4441 if next_offset >= end_offset {
4442 return Ok(());
4443 }
4444
4445 while _next_ordinal_to_read < 4 {
4447 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4448 _next_ordinal_to_read += 1;
4449 next_offset += envelope_size;
4450 }
4451
4452 let next_out_of_line = decoder.next_out_of_line();
4453 let handles_before = decoder.remaining_handles();
4454 if let Some((inlined, num_bytes, num_handles)) =
4455 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4456 {
4457 let member_inline_size =
4458 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4459 if inlined != (member_inline_size <= 4) {
4460 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4461 }
4462 let inner_offset;
4463 let mut inner_depth = depth.clone();
4464 if inlined {
4465 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4466 inner_offset = next_offset;
4467 } else {
4468 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4469 inner_depth.increment()?;
4470 }
4471 let val_ref = self.driver_tests_enable_all.get_or_insert_with(|| {
4472 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
4473 });
4474 fidl::decode!(
4475 bool,
4476 fidl::encoding::DefaultFuchsiaResourceDialect,
4477 val_ref,
4478 decoder,
4479 inner_offset,
4480 inner_depth
4481 )?;
4482 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4483 {
4484 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4485 }
4486 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4487 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4488 }
4489 }
4490
4491 next_offset += envelope_size;
4492 _next_ordinal_to_read += 1;
4493 if next_offset >= end_offset {
4494 return Ok(());
4495 }
4496
4497 while _next_ordinal_to_read < 5 {
4499 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4500 _next_ordinal_to_read += 1;
4501 next_offset += envelope_size;
4502 }
4503
4504 let next_out_of_line = decoder.next_out_of_line();
4505 let handles_before = decoder.remaining_handles();
4506 if let Some((inlined, num_bytes, num_handles)) =
4507 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4508 {
4509 let member_inline_size = <fidl::encoding::UnboundedVector<
4510 fidl::encoding::UnboundedString,
4511 > as fidl::encoding::TypeMarker>::inline_size(
4512 decoder.context
4513 );
4514 if inlined != (member_inline_size <= 4) {
4515 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4516 }
4517 let inner_offset;
4518 let mut inner_depth = depth.clone();
4519 if inlined {
4520 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4521 inner_offset = next_offset;
4522 } else {
4523 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4524 inner_depth.increment()?;
4525 }
4526 let val_ref = self.driver_tests_enable.get_or_insert_with(|| {
4527 fidl::new_empty!(
4528 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4529 fidl::encoding::DefaultFuchsiaResourceDialect
4530 )
4531 });
4532 fidl::decode!(
4533 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4534 fidl::encoding::DefaultFuchsiaResourceDialect,
4535 val_ref,
4536 decoder,
4537 inner_offset,
4538 inner_depth
4539 )?;
4540 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4541 {
4542 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4543 }
4544 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4545 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4546 }
4547 }
4548
4549 next_offset += envelope_size;
4550 _next_ordinal_to_read += 1;
4551 if next_offset >= end_offset {
4552 return Ok(());
4553 }
4554
4555 while _next_ordinal_to_read < 6 {
4557 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4558 _next_ordinal_to_read += 1;
4559 next_offset += envelope_size;
4560 }
4561
4562 let next_out_of_line = decoder.next_out_of_line();
4563 let handles_before = decoder.remaining_handles();
4564 if let Some((inlined, num_bytes, num_handles)) =
4565 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4566 {
4567 let member_inline_size = <fidl::encoding::UnboundedVector<
4568 fidl::encoding::UnboundedString,
4569 > as fidl::encoding::TypeMarker>::inline_size(
4570 decoder.context
4571 );
4572 if inlined != (member_inline_size <= 4) {
4573 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4574 }
4575 let inner_offset;
4576 let mut inner_depth = depth.clone();
4577 if inlined {
4578 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4579 inner_offset = next_offset;
4580 } else {
4581 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4582 inner_depth.increment()?;
4583 }
4584 let val_ref = self.driver_tests_disable.get_or_insert_with(|| {
4585 fidl::new_empty!(
4586 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4587 fidl::encoding::DefaultFuchsiaResourceDialect
4588 )
4589 });
4590 fidl::decode!(
4591 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4592 fidl::encoding::DefaultFuchsiaResourceDialect,
4593 val_ref,
4594 decoder,
4595 inner_offset,
4596 inner_depth
4597 )?;
4598 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4599 {
4600 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4601 }
4602 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4603 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4604 }
4605 }
4606
4607 next_offset += envelope_size;
4608 _next_ordinal_to_read += 1;
4609 if next_offset >= end_offset {
4610 return Ok(());
4611 }
4612
4613 while _next_ordinal_to_read < 7 {
4615 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4616 _next_ordinal_to_read += 1;
4617 next_offset += envelope_size;
4618 }
4619
4620 let next_out_of_line = decoder.next_out_of_line();
4621 let handles_before = decoder.remaining_handles();
4622 if let Some((inlined, num_bytes, num_handles)) =
4623 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4624 {
4625 let member_inline_size = <fidl::encoding::UnboundedVector<DriverLog> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4626 if inlined != (member_inline_size <= 4) {
4627 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4628 }
4629 let inner_offset;
4630 let mut inner_depth = depth.clone();
4631 if inlined {
4632 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4633 inner_offset = next_offset;
4634 } else {
4635 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4636 inner_depth.increment()?;
4637 }
4638 let val_ref = self.driver_log_level.get_or_insert_with(|| {
4639 fidl::new_empty!(
4640 fidl::encoding::UnboundedVector<DriverLog>,
4641 fidl::encoding::DefaultFuchsiaResourceDialect
4642 )
4643 });
4644 fidl::decode!(
4645 fidl::encoding::UnboundedVector<DriverLog>,
4646 fidl::encoding::DefaultFuchsiaResourceDialect,
4647 val_ref,
4648 decoder,
4649 inner_offset,
4650 inner_depth
4651 )?;
4652 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4653 {
4654 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4655 }
4656 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4657 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4658 }
4659 }
4660
4661 next_offset += envelope_size;
4662 _next_ordinal_to_read += 1;
4663 if next_offset >= end_offset {
4664 return Ok(());
4665 }
4666
4667 while _next_ordinal_to_read < 8 {
4669 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4670 _next_ordinal_to_read += 1;
4671 next_offset += envelope_size;
4672 }
4673
4674 let next_out_of_line = decoder.next_out_of_line();
4675 let handles_before = decoder.remaining_handles();
4676 if let Some((inlined, num_bytes, num_handles)) =
4677 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4678 {
4679 let member_inline_size = <fidl::encoding::UnboundedVector<
4680 fidl::encoding::UnboundedString,
4681 > as fidl::encoding::TypeMarker>::inline_size(
4682 decoder.context
4683 );
4684 if inlined != (member_inline_size <= 4) {
4685 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4686 }
4687 let inner_offset;
4688 let mut inner_depth = depth.clone();
4689 if inlined {
4690 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4691 inner_offset = next_offset;
4692 } else {
4693 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4694 inner_depth.increment()?;
4695 }
4696 let val_ref = self.driver_disable.get_or_insert_with(|| {
4697 fidl::new_empty!(
4698 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4699 fidl::encoding::DefaultFuchsiaResourceDialect
4700 )
4701 });
4702 fidl::decode!(
4703 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4704 fidl::encoding::DefaultFuchsiaResourceDialect,
4705 val_ref,
4706 decoder,
4707 inner_offset,
4708 inner_depth
4709 )?;
4710 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4711 {
4712 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4713 }
4714 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4715 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4716 }
4717 }
4718
4719 next_offset += envelope_size;
4720 _next_ordinal_to_read += 1;
4721 if next_offset >= end_offset {
4722 return Ok(());
4723 }
4724
4725 while _next_ordinal_to_read < 9 {
4727 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4728 _next_ordinal_to_read += 1;
4729 next_offset += envelope_size;
4730 }
4731
4732 let next_out_of_line = decoder.next_out_of_line();
4733 let handles_before = decoder.remaining_handles();
4734 if let Some((inlined, num_bytes, num_handles)) =
4735 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4736 {
4737 let member_inline_size = <fidl::encoding::UnboundedVector<
4738 fidl::encoding::UnboundedString,
4739 > as fidl::encoding::TypeMarker>::inline_size(
4740 decoder.context
4741 );
4742 if inlined != (member_inline_size <= 4) {
4743 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4744 }
4745 let inner_offset;
4746 let mut inner_depth = depth.clone();
4747 if inlined {
4748 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4749 inner_offset = next_offset;
4750 } else {
4751 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4752 inner_depth.increment()?;
4753 }
4754 let val_ref = self.driver_bind_eager.get_or_insert_with(|| {
4755 fidl::new_empty!(
4756 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4757 fidl::encoding::DefaultFuchsiaResourceDialect
4758 )
4759 });
4760 fidl::decode!(
4761 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4762 fidl::encoding::DefaultFuchsiaResourceDialect,
4763 val_ref,
4764 decoder,
4765 inner_offset,
4766 inner_depth
4767 )?;
4768 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4769 {
4770 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4771 }
4772 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4773 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4774 }
4775 }
4776
4777 next_offset += envelope_size;
4778 _next_ordinal_to_read += 1;
4779 if next_offset >= end_offset {
4780 return Ok(());
4781 }
4782
4783 while _next_ordinal_to_read < 10 {
4785 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4786 _next_ordinal_to_read += 1;
4787 next_offset += envelope_size;
4788 }
4789
4790 let next_out_of_line = decoder.next_out_of_line();
4791 let handles_before = decoder.remaining_handles();
4792 if let Some((inlined, num_bytes, num_handles)) =
4793 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4794 {
4795 let member_inline_size =
4796 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4797 decoder.context,
4798 );
4799 if inlined != (member_inline_size <= 4) {
4800 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4801 }
4802 let inner_offset;
4803 let mut inner_depth = depth.clone();
4804 if inlined {
4805 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4806 inner_offset = next_offset;
4807 } else {
4808 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4809 inner_depth.increment()?;
4810 }
4811 let val_ref = self.board_name.get_or_insert_with(|| {
4812 fidl::new_empty!(
4813 fidl::encoding::UnboundedString,
4814 fidl::encoding::DefaultFuchsiaResourceDialect
4815 )
4816 });
4817 fidl::decode!(
4818 fidl::encoding::UnboundedString,
4819 fidl::encoding::DefaultFuchsiaResourceDialect,
4820 val_ref,
4821 decoder,
4822 inner_offset,
4823 inner_depth
4824 )?;
4825 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4826 {
4827 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4828 }
4829 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4830 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4831 }
4832 }
4833
4834 next_offset += envelope_size;
4835 _next_ordinal_to_read += 1;
4836 if next_offset >= end_offset {
4837 return Ok(());
4838 }
4839
4840 while _next_ordinal_to_read < 11 {
4842 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4843 _next_ordinal_to_read += 1;
4844 next_offset += envelope_size;
4845 }
4846
4847 let next_out_of_line = decoder.next_out_of_line();
4848 let handles_before = decoder.remaining_handles();
4849 if let Some((inlined, num_bytes, num_handles)) =
4850 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4851 {
4852 let member_inline_size = <fidl::encoding::UnboundedVector<Offer> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4853 if inlined != (member_inline_size <= 4) {
4854 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4855 }
4856 let inner_offset;
4857 let mut inner_depth = depth.clone();
4858 if inlined {
4859 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4860 inner_offset = next_offset;
4861 } else {
4862 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4863 inner_depth.increment()?;
4864 }
4865 let val_ref = self.offers.get_or_insert_with(|| {
4866 fidl::new_empty!(
4867 fidl::encoding::UnboundedVector<Offer>,
4868 fidl::encoding::DefaultFuchsiaResourceDialect
4869 )
4870 });
4871 fidl::decode!(
4872 fidl::encoding::UnboundedVector<Offer>,
4873 fidl::encoding::DefaultFuchsiaResourceDialect,
4874 val_ref,
4875 decoder,
4876 inner_offset,
4877 inner_depth
4878 )?;
4879 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4880 {
4881 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4882 }
4883 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4884 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4885 }
4886 }
4887
4888 next_offset += envelope_size;
4889 _next_ordinal_to_read += 1;
4890 if next_offset >= end_offset {
4891 return Ok(());
4892 }
4893
4894 while _next_ordinal_to_read < 12 {
4896 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4897 _next_ordinal_to_read += 1;
4898 next_offset += envelope_size;
4899 }
4900
4901 let next_out_of_line = decoder.next_out_of_line();
4902 let handles_before = decoder.remaining_handles();
4903 if let Some((inlined, num_bytes, num_handles)) =
4904 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4905 {
4906 let member_inline_size = <fidl::encoding::UnboundedVector<Expose> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4907 if inlined != (member_inline_size <= 4) {
4908 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4909 }
4910 let inner_offset;
4911 let mut inner_depth = depth.clone();
4912 if inlined {
4913 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4914 inner_offset = next_offset;
4915 } else {
4916 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4917 inner_depth.increment()?;
4918 }
4919 let val_ref = self.exposes.get_or_insert_with(|| {
4920 fidl::new_empty!(
4921 fidl::encoding::UnboundedVector<Expose>,
4922 fidl::encoding::DefaultFuchsiaResourceDialect
4923 )
4924 });
4925 fidl::decode!(
4926 fidl::encoding::UnboundedVector<Expose>,
4927 fidl::encoding::DefaultFuchsiaResourceDialect,
4928 val_ref,
4929 decoder,
4930 inner_offset,
4931 inner_depth
4932 )?;
4933 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4934 {
4935 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4936 }
4937 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4938 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4939 }
4940 }
4941
4942 next_offset += envelope_size;
4943 _next_ordinal_to_read += 1;
4944 if next_offset >= end_offset {
4945 return Ok(());
4946 }
4947
4948 while _next_ordinal_to_read < 13 {
4950 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4951 _next_ordinal_to_read += 1;
4952 next_offset += envelope_size;
4953 }
4954
4955 let next_out_of_line = decoder.next_out_of_line();
4956 let handles_before = decoder.remaining_handles();
4957 if let Some((inlined, num_bytes, num_handles)) =
4958 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4959 {
4960 let member_inline_size = <fidl::encoding::Endpoint<
4961 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4962 > as fidl::encoding::TypeMarker>::inline_size(
4963 decoder.context
4964 );
4965 if inlined != (member_inline_size <= 4) {
4966 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4967 }
4968 let inner_offset;
4969 let mut inner_depth = depth.clone();
4970 if inlined {
4971 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4972 inner_offset = next_offset;
4973 } else {
4974 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4975 inner_depth.increment()?;
4976 }
4977 let val_ref = self.pkg.get_or_insert_with(|| {
4978 fidl::new_empty!(
4979 fidl::encoding::Endpoint<
4980 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4981 >,
4982 fidl::encoding::DefaultFuchsiaResourceDialect
4983 )
4984 });
4985 fidl::decode!(
4986 fidl::encoding::Endpoint<
4987 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4988 >,
4989 fidl::encoding::DefaultFuchsiaResourceDialect,
4990 val_ref,
4991 decoder,
4992 inner_offset,
4993 inner_depth
4994 )?;
4995 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4996 {
4997 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4998 }
4999 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5000 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5001 }
5002 }
5003
5004 next_offset += envelope_size;
5005 _next_ordinal_to_read += 1;
5006 if next_offset >= end_offset {
5007 return Ok(());
5008 }
5009
5010 while _next_ordinal_to_read < 14 {
5012 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5013 _next_ordinal_to_read += 1;
5014 next_offset += envelope_size;
5015 }
5016
5017 let next_out_of_line = decoder.next_out_of_line();
5018 let handles_before = decoder.remaining_handles();
5019 if let Some((inlined, num_bytes, num_handles)) =
5020 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5021 {
5022 let member_inline_size = <fidl::encoding::UnboundedVector<
5023 fidl_fuchsia_component_test::Capability,
5024 > as fidl::encoding::TypeMarker>::inline_size(
5025 decoder.context
5026 );
5027 if inlined != (member_inline_size <= 4) {
5028 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5029 }
5030 let inner_offset;
5031 let mut inner_depth = depth.clone();
5032 if inlined {
5033 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5034 inner_offset = next_offset;
5035 } else {
5036 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5037 inner_depth.increment()?;
5038 }
5039 let val_ref = self.dtr_offers.get_or_insert_with(|| {
5040 fidl::new_empty!(
5041 fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
5042 fidl::encoding::DefaultFuchsiaResourceDialect
5043 )
5044 });
5045 fidl::decode!(
5046 fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
5047 fidl::encoding::DefaultFuchsiaResourceDialect,
5048 val_ref,
5049 decoder,
5050 inner_offset,
5051 inner_depth
5052 )?;
5053 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5054 {
5055 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5056 }
5057 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5058 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5059 }
5060 }
5061
5062 next_offset += envelope_size;
5063 _next_ordinal_to_read += 1;
5064 if next_offset >= end_offset {
5065 return Ok(());
5066 }
5067
5068 while _next_ordinal_to_read < 15 {
5070 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5071 _next_ordinal_to_read += 1;
5072 next_offset += envelope_size;
5073 }
5074
5075 let next_out_of_line = decoder.next_out_of_line();
5076 let handles_before = decoder.remaining_handles();
5077 if let Some((inlined, num_bytes, num_handles)) =
5078 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5079 {
5080 let member_inline_size = <fidl::encoding::UnboundedVector<
5081 fidl_fuchsia_component_test::Capability,
5082 > as fidl::encoding::TypeMarker>::inline_size(
5083 decoder.context
5084 );
5085 if inlined != (member_inline_size <= 4) {
5086 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5087 }
5088 let inner_offset;
5089 let mut inner_depth = depth.clone();
5090 if inlined {
5091 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5092 inner_offset = next_offset;
5093 } else {
5094 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5095 inner_depth.increment()?;
5096 }
5097 let val_ref = self.dtr_exposes.get_or_insert_with(|| {
5098 fidl::new_empty!(
5099 fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
5100 fidl::encoding::DefaultFuchsiaResourceDialect
5101 )
5102 });
5103 fidl::decode!(
5104 fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
5105 fidl::encoding::DefaultFuchsiaResourceDialect,
5106 val_ref,
5107 decoder,
5108 inner_offset,
5109 inner_depth
5110 )?;
5111 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5112 {
5113 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5114 }
5115 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5116 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5117 }
5118 }
5119
5120 next_offset += envelope_size;
5121 _next_ordinal_to_read += 1;
5122 if next_offset >= end_offset {
5123 return Ok(());
5124 }
5125
5126 while _next_ordinal_to_read < 16 {
5128 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5129 _next_ordinal_to_read += 1;
5130 next_offset += envelope_size;
5131 }
5132
5133 let next_out_of_line = decoder.next_out_of_line();
5134 let handles_before = decoder.remaining_handles();
5135 if let Some((inlined, num_bytes, num_handles)) =
5136 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5137 {
5138 let member_inline_size = <fidl_fuchsia_component_resolution::Component as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5139 if inlined != (member_inline_size <= 4) {
5140 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5141 }
5142 let inner_offset;
5143 let mut inner_depth = depth.clone();
5144 if inlined {
5145 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5146 inner_offset = next_offset;
5147 } else {
5148 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5149 inner_depth.increment()?;
5150 }
5151 let val_ref = self.test_component.get_or_insert_with(|| {
5152 fidl::new_empty!(
5153 fidl_fuchsia_component_resolution::Component,
5154 fidl::encoding::DefaultFuchsiaResourceDialect
5155 )
5156 });
5157 fidl::decode!(
5158 fidl_fuchsia_component_resolution::Component,
5159 fidl::encoding::DefaultFuchsiaResourceDialect,
5160 val_ref,
5161 decoder,
5162 inner_offset,
5163 inner_depth
5164 )?;
5165 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5166 {
5167 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5168 }
5169 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5170 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5171 }
5172 }
5173
5174 next_offset += envelope_size;
5175 _next_ordinal_to_read += 1;
5176 if next_offset >= end_offset {
5177 return Ok(());
5178 }
5179
5180 while _next_ordinal_to_read < 17 {
5182 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5183 _next_ordinal_to_read += 1;
5184 next_offset += envelope_size;
5185 }
5186
5187 let next_out_of_line = decoder.next_out_of_line();
5188 let handles_before = decoder.remaining_handles();
5189 if let Some((inlined, num_bytes, num_handles)) =
5190 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5191 {
5192 let member_inline_size =
5193 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5194 if inlined != (member_inline_size <= 4) {
5195 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5196 }
5197 let inner_offset;
5198 let mut inner_depth = depth.clone();
5199 if inlined {
5200 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5201 inner_offset = next_offset;
5202 } else {
5203 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5204 inner_depth.increment()?;
5205 }
5206 let val_ref = self.driver_index_stop_timeout_millis.get_or_insert_with(|| {
5207 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
5208 });
5209 fidl::decode!(
5210 i64,
5211 fidl::encoding::DefaultFuchsiaResourceDialect,
5212 val_ref,
5213 decoder,
5214 inner_offset,
5215 inner_depth
5216 )?;
5217 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5218 {
5219 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5220 }
5221 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5222 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5223 }
5224 }
5225
5226 next_offset += envelope_size;
5227 _next_ordinal_to_read += 1;
5228 if next_offset >= end_offset {
5229 return Ok(());
5230 }
5231
5232 while _next_ordinal_to_read < 18 {
5234 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5235 _next_ordinal_to_read += 1;
5236 next_offset += envelope_size;
5237 }
5238
5239 let next_out_of_line = decoder.next_out_of_line();
5240 let handles_before = decoder.remaining_handles();
5241 if let Some((inlined, num_bytes, num_handles)) =
5242 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5243 {
5244 let member_inline_size = <fidl::encoding::Vector<SoftwareDevice, 20> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5245 if inlined != (member_inline_size <= 4) {
5246 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5247 }
5248 let inner_offset;
5249 let mut inner_depth = depth.clone();
5250 if inlined {
5251 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5252 inner_offset = next_offset;
5253 } else {
5254 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5255 inner_depth.increment()?;
5256 }
5257 let val_ref =
5258 self.software_devices.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect));
5259 fidl::decode!(fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5260 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5261 {
5262 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5263 }
5264 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5265 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5266 }
5267 }
5268
5269 next_offset += envelope_size;
5270 _next_ordinal_to_read += 1;
5271 if next_offset >= end_offset {
5272 return Ok(());
5273 }
5274
5275 while _next_ordinal_to_read < 19 {
5277 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5278 _next_ordinal_to_read += 1;
5279 next_offset += envelope_size;
5280 }
5281
5282 let next_out_of_line = decoder.next_out_of_line();
5283 let handles_before = decoder.remaining_handles();
5284 if let Some((inlined, num_bytes, num_handles)) =
5285 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5286 {
5287 let member_inline_size = <fidl::encoding::UnboundedVector<
5288 fidl::encoding::UnboundedString,
5289 > as fidl::encoding::TypeMarker>::inline_size(
5290 decoder.context
5291 );
5292 if inlined != (member_inline_size <= 4) {
5293 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5294 }
5295 let inner_offset;
5296 let mut inner_depth = depth.clone();
5297 if inlined {
5298 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5299 inner_offset = next_offset;
5300 } else {
5301 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5302 inner_depth.increment()?;
5303 }
5304 let val_ref = self.boot_driver_components.get_or_insert_with(|| {
5305 fidl::new_empty!(
5306 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
5307 fidl::encoding::DefaultFuchsiaResourceDialect
5308 )
5309 });
5310 fidl::decode!(
5311 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
5312 fidl::encoding::DefaultFuchsiaResourceDialect,
5313 val_ref,
5314 decoder,
5315 inner_offset,
5316 inner_depth
5317 )?;
5318 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5319 {
5320 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5321 }
5322 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5323 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5324 }
5325 }
5326
5327 next_offset += envelope_size;
5328 _next_ordinal_to_read += 1;
5329 if next_offset >= end_offset {
5330 return Ok(());
5331 }
5332
5333 while _next_ordinal_to_read < 20 {
5335 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5336 _next_ordinal_to_read += 1;
5337 next_offset += envelope_size;
5338 }
5339
5340 let next_out_of_line = decoder.next_out_of_line();
5341 let handles_before = decoder.remaining_handles();
5342 if let Some((inlined, num_bytes, num_handles)) =
5343 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5344 {
5345 let member_inline_size = <fidl::encoding::HandleType<
5346 fidl::Vmo,
5347 { fidl::ObjectType::VMO.into_raw() },
5348 2147483648,
5349 > as fidl::encoding::TypeMarker>::inline_size(
5350 decoder.context
5351 );
5352 if inlined != (member_inline_size <= 4) {
5353 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5354 }
5355 let inner_offset;
5356 let mut inner_depth = depth.clone();
5357 if inlined {
5358 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5359 inner_offset = next_offset;
5360 } else {
5361 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5362 inner_depth.increment()?;
5363 }
5364 let val_ref =
5365 self.devicetree.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
5366 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5367 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5368 {
5369 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5370 }
5371 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5372 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5373 }
5374 }
5375
5376 next_offset += envelope_size;
5377 _next_ordinal_to_read += 1;
5378 if next_offset >= end_offset {
5379 return Ok(());
5380 }
5381
5382 while _next_ordinal_to_read < 21 {
5384 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5385 _next_ordinal_to_read += 1;
5386 next_offset += envelope_size;
5387 }
5388
5389 let next_out_of_line = decoder.next_out_of_line();
5390 let handles_before = decoder.remaining_handles();
5391 if let Some((inlined, num_bytes, num_handles)) =
5392 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5393 {
5394 let member_inline_size =
5395 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5396 if inlined != (member_inline_size <= 4) {
5397 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5398 }
5399 let inner_offset;
5400 let mut inner_depth = depth.clone();
5401 if inlined {
5402 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5403 inner_offset = next_offset;
5404 } else {
5405 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5406 inner_depth.increment()?;
5407 }
5408 let val_ref = self.platform_vid.get_or_insert_with(|| {
5409 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
5410 });
5411 fidl::decode!(
5412 u32,
5413 fidl::encoding::DefaultFuchsiaResourceDialect,
5414 val_ref,
5415 decoder,
5416 inner_offset,
5417 inner_depth
5418 )?;
5419 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5420 {
5421 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5422 }
5423 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5424 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5425 }
5426 }
5427
5428 next_offset += envelope_size;
5429 _next_ordinal_to_read += 1;
5430 if next_offset >= end_offset {
5431 return Ok(());
5432 }
5433
5434 while _next_ordinal_to_read < 22 {
5436 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5437 _next_ordinal_to_read += 1;
5438 next_offset += envelope_size;
5439 }
5440
5441 let next_out_of_line = decoder.next_out_of_line();
5442 let handles_before = decoder.remaining_handles();
5443 if let Some((inlined, num_bytes, num_handles)) =
5444 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5445 {
5446 let member_inline_size =
5447 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5448 if inlined != (member_inline_size <= 4) {
5449 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5450 }
5451 let inner_offset;
5452 let mut inner_depth = depth.clone();
5453 if inlined {
5454 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5455 inner_offset = next_offset;
5456 } else {
5457 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5458 inner_depth.increment()?;
5459 }
5460 let val_ref = self.platform_pid.get_or_insert_with(|| {
5461 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
5462 });
5463 fidl::decode!(
5464 u32,
5465 fidl::encoding::DefaultFuchsiaResourceDialect,
5466 val_ref,
5467 decoder,
5468 inner_offset,
5469 inner_depth
5470 )?;
5471 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5472 {
5473 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5474 }
5475 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5476 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5477 }
5478 }
5479
5480 next_offset += envelope_size;
5481
5482 while next_offset < end_offset {
5484 _next_ordinal_to_read += 1;
5485 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5486 next_offset += envelope_size;
5487 }
5488
5489 Ok(())
5490 }
5491 }
5492}