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::NullableHandle {
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::NullableHandle {
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, payload: &GetManifestRequest) -> 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 mut payload: &GetManifestRequest,
1661 ___deadline: zx::MonotonicInstant,
1662 ) -> Result<ManifestProviderGetManifestResult, fidl::Error> {
1663 let _response = self.client.send_query::<GetManifestRequest, fidl::encoding::ResultType<
1664 ManifestProviderGetManifestResponse,
1665 i32,
1666 >>(
1667 payload,
1668 0x44eaae3b45e860d,
1669 fidl::encoding::DynamicFlags::empty(),
1670 ___deadline,
1671 )?;
1672 Ok(_response.map(|x| x.manifest))
1673 }
1674}
1675
1676#[cfg(target_os = "fuchsia")]
1677impl From<ManifestProviderSynchronousProxy> for zx::NullableHandle {
1678 fn from(value: ManifestProviderSynchronousProxy) -> Self {
1679 value.into_channel().into()
1680 }
1681}
1682
1683#[cfg(target_os = "fuchsia")]
1684impl From<fidl::Channel> for ManifestProviderSynchronousProxy {
1685 fn from(value: fidl::Channel) -> Self {
1686 Self::new(value)
1687 }
1688}
1689
1690#[cfg(target_os = "fuchsia")]
1691impl fidl::endpoints::FromClient for ManifestProviderSynchronousProxy {
1692 type Protocol = ManifestProviderMarker;
1693
1694 fn from_client(value: fidl::endpoints::ClientEnd<ManifestProviderMarker>) -> Self {
1695 Self::new(value.into_channel())
1696 }
1697}
1698
1699#[derive(Debug, Clone)]
1700pub struct ManifestProviderProxy {
1701 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1702}
1703
1704impl fidl::endpoints::Proxy for ManifestProviderProxy {
1705 type Protocol = ManifestProviderMarker;
1706
1707 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1708 Self::new(inner)
1709 }
1710
1711 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1712 self.client.into_channel().map_err(|client| Self { client })
1713 }
1714
1715 fn as_channel(&self) -> &::fidl::AsyncChannel {
1716 self.client.as_channel()
1717 }
1718}
1719
1720impl ManifestProviderProxy {
1721 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1723 let protocol_name = <ManifestProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1724 Self { client: fidl::client::Client::new(channel, protocol_name) }
1725 }
1726
1727 pub fn take_event_stream(&self) -> ManifestProviderEventStream {
1733 ManifestProviderEventStream { event_receiver: self.client.take_event_receiver() }
1734 }
1735
1736 pub fn r#get_manifest(
1737 &self,
1738 mut payload: &GetManifestRequest,
1739 ) -> fidl::client::QueryResponseFut<
1740 ManifestProviderGetManifestResult,
1741 fidl::encoding::DefaultFuchsiaResourceDialect,
1742 > {
1743 ManifestProviderProxyInterface::r#get_manifest(self, payload)
1744 }
1745}
1746
1747impl ManifestProviderProxyInterface for ManifestProviderProxy {
1748 type GetManifestResponseFut = fidl::client::QueryResponseFut<
1749 ManifestProviderGetManifestResult,
1750 fidl::encoding::DefaultFuchsiaResourceDialect,
1751 >;
1752 fn r#get_manifest(&self, mut payload: &GetManifestRequest) -> Self::GetManifestResponseFut {
1753 fn _decode(
1754 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1755 ) -> Result<ManifestProviderGetManifestResult, fidl::Error> {
1756 let _response = fidl::client::decode_transaction_body::<
1757 fidl::encoding::ResultType<ManifestProviderGetManifestResponse, i32>,
1758 fidl::encoding::DefaultFuchsiaResourceDialect,
1759 0x44eaae3b45e860d,
1760 >(_buf?)?;
1761 Ok(_response.map(|x| x.manifest))
1762 }
1763 self.client.send_query_and_decode::<GetManifestRequest, ManifestProviderGetManifestResult>(
1764 payload,
1765 0x44eaae3b45e860d,
1766 fidl::encoding::DynamicFlags::empty(),
1767 _decode,
1768 )
1769 }
1770}
1771
1772pub struct ManifestProviderEventStream {
1773 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1774}
1775
1776impl std::marker::Unpin for ManifestProviderEventStream {}
1777
1778impl futures::stream::FusedStream for ManifestProviderEventStream {
1779 fn is_terminated(&self) -> bool {
1780 self.event_receiver.is_terminated()
1781 }
1782}
1783
1784impl futures::Stream for ManifestProviderEventStream {
1785 type Item = Result<ManifestProviderEvent, fidl::Error>;
1786
1787 fn poll_next(
1788 mut self: std::pin::Pin<&mut Self>,
1789 cx: &mut std::task::Context<'_>,
1790 ) -> std::task::Poll<Option<Self::Item>> {
1791 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1792 &mut self.event_receiver,
1793 cx
1794 )?) {
1795 Some(buf) => std::task::Poll::Ready(Some(ManifestProviderEvent::decode(buf))),
1796 None => std::task::Poll::Ready(None),
1797 }
1798 }
1799}
1800
1801#[derive(Debug)]
1802pub enum ManifestProviderEvent {}
1803
1804impl ManifestProviderEvent {
1805 fn decode(
1807 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1808 ) -> Result<ManifestProviderEvent, fidl::Error> {
1809 let (bytes, _handles) = buf.split_mut();
1810 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1811 debug_assert_eq!(tx_header.tx_id, 0);
1812 match tx_header.ordinal {
1813 _ => Err(fidl::Error::UnknownOrdinal {
1814 ordinal: tx_header.ordinal,
1815 protocol_name:
1816 <ManifestProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1817 }),
1818 }
1819 }
1820}
1821
1822pub struct ManifestProviderRequestStream {
1824 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1825 is_terminated: bool,
1826}
1827
1828impl std::marker::Unpin for ManifestProviderRequestStream {}
1829
1830impl futures::stream::FusedStream for ManifestProviderRequestStream {
1831 fn is_terminated(&self) -> bool {
1832 self.is_terminated
1833 }
1834}
1835
1836impl fidl::endpoints::RequestStream for ManifestProviderRequestStream {
1837 type Protocol = ManifestProviderMarker;
1838 type ControlHandle = ManifestProviderControlHandle;
1839
1840 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1841 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1842 }
1843
1844 fn control_handle(&self) -> Self::ControlHandle {
1845 ManifestProviderControlHandle { inner: self.inner.clone() }
1846 }
1847
1848 fn into_inner(
1849 self,
1850 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1851 {
1852 (self.inner, self.is_terminated)
1853 }
1854
1855 fn from_inner(
1856 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1857 is_terminated: bool,
1858 ) -> Self {
1859 Self { inner, is_terminated }
1860 }
1861}
1862
1863impl futures::Stream for ManifestProviderRequestStream {
1864 type Item = Result<ManifestProviderRequest, fidl::Error>;
1865
1866 fn poll_next(
1867 mut self: std::pin::Pin<&mut Self>,
1868 cx: &mut std::task::Context<'_>,
1869 ) -> std::task::Poll<Option<Self::Item>> {
1870 let this = &mut *self;
1871 if this.inner.check_shutdown(cx) {
1872 this.is_terminated = true;
1873 return std::task::Poll::Ready(None);
1874 }
1875 if this.is_terminated {
1876 panic!("polled ManifestProviderRequestStream after completion");
1877 }
1878 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1879 |bytes, handles| {
1880 match this.inner.channel().read_etc(cx, bytes, handles) {
1881 std::task::Poll::Ready(Ok(())) => {}
1882 std::task::Poll::Pending => return std::task::Poll::Pending,
1883 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1884 this.is_terminated = true;
1885 return std::task::Poll::Ready(None);
1886 }
1887 std::task::Poll::Ready(Err(e)) => {
1888 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1889 e.into(),
1890 ))));
1891 }
1892 }
1893
1894 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1896
1897 std::task::Poll::Ready(Some(match header.ordinal {
1898 0x44eaae3b45e860d => {
1899 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1900 let mut req = fidl::new_empty!(
1901 GetManifestRequest,
1902 fidl::encoding::DefaultFuchsiaResourceDialect
1903 );
1904 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GetManifestRequest>(&header, _body_bytes, handles, &mut req)?;
1905 let control_handle =
1906 ManifestProviderControlHandle { inner: this.inner.clone() };
1907 Ok(ManifestProviderRequest::GetManifest {
1908 payload: req,
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 { payload: GetManifestRequest, responder: ManifestProviderGetManifestResponder },
1929}
1930
1931impl ManifestProviderRequest {
1932 #[allow(irrefutable_let_patterns)]
1933 pub fn into_get_manifest(
1934 self,
1935 ) -> Option<(GetManifestRequest, ManifestProviderGetManifestResponder)> {
1936 if let ManifestProviderRequest::GetManifest { payload, responder } = self {
1937 Some((payload, responder))
1938 } else {
1939 None
1940 }
1941 }
1942
1943 pub fn method_name(&self) -> &'static str {
1945 match *self {
1946 ManifestProviderRequest::GetManifest { .. } => "get_manifest",
1947 }
1948 }
1949}
1950
1951#[derive(Debug, Clone)]
1952pub struct ManifestProviderControlHandle {
1953 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1954}
1955
1956impl fidl::endpoints::ControlHandle for ManifestProviderControlHandle {
1957 fn shutdown(&self) {
1958 self.inner.shutdown()
1959 }
1960 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1961 self.inner.shutdown_with_epitaph(status)
1962 }
1963
1964 fn is_closed(&self) -> bool {
1965 self.inner.channel().is_closed()
1966 }
1967 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1968 self.inner.channel().on_closed()
1969 }
1970
1971 #[cfg(target_os = "fuchsia")]
1972 fn signal_peer(
1973 &self,
1974 clear_mask: zx::Signals,
1975 set_mask: zx::Signals,
1976 ) -> Result<(), zx_status::Status> {
1977 use fidl::Peered;
1978 self.inner.channel().signal_peer(clear_mask, set_mask)
1979 }
1980}
1981
1982impl ManifestProviderControlHandle {}
1983
1984#[must_use = "FIDL methods require a response to be sent"]
1985#[derive(Debug)]
1986pub struct ManifestProviderGetManifestResponder {
1987 control_handle: std::mem::ManuallyDrop<ManifestProviderControlHandle>,
1988 tx_id: u32,
1989}
1990
1991impl std::ops::Drop for ManifestProviderGetManifestResponder {
1995 fn drop(&mut self) {
1996 self.control_handle.shutdown();
1997 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1999 }
2000}
2001
2002impl fidl::endpoints::Responder for ManifestProviderGetManifestResponder {
2003 type ControlHandle = ManifestProviderControlHandle;
2004
2005 fn control_handle(&self) -> &ManifestProviderControlHandle {
2006 &self.control_handle
2007 }
2008
2009 fn drop_without_shutdown(mut self) {
2010 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2012 std::mem::forget(self);
2014 }
2015}
2016
2017impl ManifestProviderGetManifestResponder {
2018 pub fn send(self, mut result: Result<fidl::Stream, i32>) -> Result<(), fidl::Error> {
2022 let _result = self.send_raw(result);
2023 if _result.is_err() {
2024 self.control_handle.shutdown();
2025 }
2026 self.drop_without_shutdown();
2027 _result
2028 }
2029
2030 pub fn send_no_shutdown_on_err(
2032 self,
2033 mut result: Result<fidl::Stream, i32>,
2034 ) -> Result<(), fidl::Error> {
2035 let _result = self.send_raw(result);
2036 self.drop_without_shutdown();
2037 _result
2038 }
2039
2040 fn send_raw(&self, mut result: Result<fidl::Stream, i32>) -> Result<(), fidl::Error> {
2041 self.control_handle.inner.send::<fidl::encoding::ResultType<
2042 ManifestProviderGetManifestResponse,
2043 i32,
2044 >>(
2045 result.map(|manifest| (manifest,)),
2046 self.tx_id,
2047 0x44eaae3b45e860d,
2048 fidl::encoding::DynamicFlags::empty(),
2049 )
2050 }
2051}
2052
2053#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2054pub struct RealmMarker;
2055
2056impl fidl::endpoints::ProtocolMarker for RealmMarker {
2057 type Proxy = RealmProxy;
2058 type RequestStream = RealmRequestStream;
2059 #[cfg(target_os = "fuchsia")]
2060 type SynchronousProxy = RealmSynchronousProxy;
2061
2062 const DEBUG_NAME: &'static str = "fuchsia.driver.test.Realm";
2063}
2064impl fidl::endpoints::DiscoverableProtocolMarker for RealmMarker {}
2065pub type RealmStartResult = Result<(), i32>;
2066
2067pub trait RealmProxyInterface: Send + Sync {
2068 type StartResponseFut: std::future::Future<Output = Result<RealmStartResult, fidl::Error>>
2069 + Send;
2070 fn r#start(&self, args: RealmArgs) -> Self::StartResponseFut;
2071}
2072#[derive(Debug)]
2073#[cfg(target_os = "fuchsia")]
2074pub struct RealmSynchronousProxy {
2075 client: fidl::client::sync::Client,
2076}
2077
2078#[cfg(target_os = "fuchsia")]
2079impl fidl::endpoints::SynchronousProxy for RealmSynchronousProxy {
2080 type Proxy = RealmProxy;
2081 type Protocol = RealmMarker;
2082
2083 fn from_channel(inner: fidl::Channel) -> Self {
2084 Self::new(inner)
2085 }
2086
2087 fn into_channel(self) -> fidl::Channel {
2088 self.client.into_channel()
2089 }
2090
2091 fn as_channel(&self) -> &fidl::Channel {
2092 self.client.as_channel()
2093 }
2094}
2095
2096#[cfg(target_os = "fuchsia")]
2097impl RealmSynchronousProxy {
2098 pub fn new(channel: fidl::Channel) -> Self {
2099 let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2100 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2101 }
2102
2103 pub fn into_channel(self) -> fidl::Channel {
2104 self.client.into_channel()
2105 }
2106
2107 pub fn wait_for_event(
2110 &self,
2111 deadline: zx::MonotonicInstant,
2112 ) -> Result<RealmEvent, fidl::Error> {
2113 RealmEvent::decode(self.client.wait_for_event(deadline)?)
2114 }
2115
2116 pub fn r#start(
2122 &self,
2123 mut args: RealmArgs,
2124 ___deadline: zx::MonotonicInstant,
2125 ) -> Result<RealmStartResult, fidl::Error> {
2126 let _response = self.client.send_query::<
2127 RealmStartRequest,
2128 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2129 >(
2130 (&mut args,),
2131 0x3dc6949d581e96fa,
2132 fidl::encoding::DynamicFlags::FLEXIBLE,
2133 ___deadline,
2134 )?
2135 .into_result::<RealmMarker>("start")?;
2136 Ok(_response.map(|x| x))
2137 }
2138}
2139
2140#[cfg(target_os = "fuchsia")]
2141impl From<RealmSynchronousProxy> for zx::NullableHandle {
2142 fn from(value: RealmSynchronousProxy) -> Self {
2143 value.into_channel().into()
2144 }
2145}
2146
2147#[cfg(target_os = "fuchsia")]
2148impl From<fidl::Channel> for RealmSynchronousProxy {
2149 fn from(value: fidl::Channel) -> Self {
2150 Self::new(value)
2151 }
2152}
2153
2154#[cfg(target_os = "fuchsia")]
2155impl fidl::endpoints::FromClient for RealmSynchronousProxy {
2156 type Protocol = RealmMarker;
2157
2158 fn from_client(value: fidl::endpoints::ClientEnd<RealmMarker>) -> Self {
2159 Self::new(value.into_channel())
2160 }
2161}
2162
2163#[derive(Debug, Clone)]
2164pub struct RealmProxy {
2165 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2166}
2167
2168impl fidl::endpoints::Proxy for RealmProxy {
2169 type Protocol = RealmMarker;
2170
2171 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2172 Self::new(inner)
2173 }
2174
2175 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2176 self.client.into_channel().map_err(|client| Self { client })
2177 }
2178
2179 fn as_channel(&self) -> &::fidl::AsyncChannel {
2180 self.client.as_channel()
2181 }
2182}
2183
2184impl RealmProxy {
2185 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2187 let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2188 Self { client: fidl::client::Client::new(channel, protocol_name) }
2189 }
2190
2191 pub fn take_event_stream(&self) -> RealmEventStream {
2197 RealmEventStream { event_receiver: self.client.take_event_receiver() }
2198 }
2199
2200 pub fn r#start(
2206 &self,
2207 mut args: RealmArgs,
2208 ) -> fidl::client::QueryResponseFut<
2209 RealmStartResult,
2210 fidl::encoding::DefaultFuchsiaResourceDialect,
2211 > {
2212 RealmProxyInterface::r#start(self, args)
2213 }
2214}
2215
2216impl RealmProxyInterface for RealmProxy {
2217 type StartResponseFut = fidl::client::QueryResponseFut<
2218 RealmStartResult,
2219 fidl::encoding::DefaultFuchsiaResourceDialect,
2220 >;
2221 fn r#start(&self, mut args: RealmArgs) -> Self::StartResponseFut {
2222 fn _decode(
2223 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2224 ) -> Result<RealmStartResult, fidl::Error> {
2225 let _response = fidl::client::decode_transaction_body::<
2226 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2227 fidl::encoding::DefaultFuchsiaResourceDialect,
2228 0x3dc6949d581e96fa,
2229 >(_buf?)?
2230 .into_result::<RealmMarker>("start")?;
2231 Ok(_response.map(|x| x))
2232 }
2233 self.client.send_query_and_decode::<RealmStartRequest, RealmStartResult>(
2234 (&mut args,),
2235 0x3dc6949d581e96fa,
2236 fidl::encoding::DynamicFlags::FLEXIBLE,
2237 _decode,
2238 )
2239 }
2240}
2241
2242pub struct RealmEventStream {
2243 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2244}
2245
2246impl std::marker::Unpin for RealmEventStream {}
2247
2248impl futures::stream::FusedStream for RealmEventStream {
2249 fn is_terminated(&self) -> bool {
2250 self.event_receiver.is_terminated()
2251 }
2252}
2253
2254impl futures::Stream for RealmEventStream {
2255 type Item = Result<RealmEvent, fidl::Error>;
2256
2257 fn poll_next(
2258 mut self: std::pin::Pin<&mut Self>,
2259 cx: &mut std::task::Context<'_>,
2260 ) -> std::task::Poll<Option<Self::Item>> {
2261 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2262 &mut self.event_receiver,
2263 cx
2264 )?) {
2265 Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
2266 None => std::task::Poll::Ready(None),
2267 }
2268 }
2269}
2270
2271#[derive(Debug)]
2272pub enum RealmEvent {
2273 #[non_exhaustive]
2274 _UnknownEvent {
2275 ordinal: u64,
2277 },
2278}
2279
2280impl RealmEvent {
2281 fn decode(
2283 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2284 ) -> Result<RealmEvent, fidl::Error> {
2285 let (bytes, _handles) = buf.split_mut();
2286 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2287 debug_assert_eq!(tx_header.tx_id, 0);
2288 match tx_header.ordinal {
2289 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2290 Ok(RealmEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2291 }
2292 _ => Err(fidl::Error::UnknownOrdinal {
2293 ordinal: tx_header.ordinal,
2294 protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2295 }),
2296 }
2297 }
2298}
2299
2300pub struct RealmRequestStream {
2302 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2303 is_terminated: bool,
2304}
2305
2306impl std::marker::Unpin for RealmRequestStream {}
2307
2308impl futures::stream::FusedStream for RealmRequestStream {
2309 fn is_terminated(&self) -> bool {
2310 self.is_terminated
2311 }
2312}
2313
2314impl fidl::endpoints::RequestStream for RealmRequestStream {
2315 type Protocol = RealmMarker;
2316 type ControlHandle = RealmControlHandle;
2317
2318 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2319 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2320 }
2321
2322 fn control_handle(&self) -> Self::ControlHandle {
2323 RealmControlHandle { inner: self.inner.clone() }
2324 }
2325
2326 fn into_inner(
2327 self,
2328 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2329 {
2330 (self.inner, self.is_terminated)
2331 }
2332
2333 fn from_inner(
2334 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2335 is_terminated: bool,
2336 ) -> Self {
2337 Self { inner, is_terminated }
2338 }
2339}
2340
2341impl futures::Stream for RealmRequestStream {
2342 type Item = Result<RealmRequest, fidl::Error>;
2343
2344 fn poll_next(
2345 mut self: std::pin::Pin<&mut Self>,
2346 cx: &mut std::task::Context<'_>,
2347 ) -> std::task::Poll<Option<Self::Item>> {
2348 let this = &mut *self;
2349 if this.inner.check_shutdown(cx) {
2350 this.is_terminated = true;
2351 return std::task::Poll::Ready(None);
2352 }
2353 if this.is_terminated {
2354 panic!("polled RealmRequestStream after completion");
2355 }
2356 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2357 |bytes, handles| {
2358 match this.inner.channel().read_etc(cx, bytes, handles) {
2359 std::task::Poll::Ready(Ok(())) => {}
2360 std::task::Poll::Pending => return std::task::Poll::Pending,
2361 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2362 this.is_terminated = true;
2363 return std::task::Poll::Ready(None);
2364 }
2365 std::task::Poll::Ready(Err(e)) => {
2366 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2367 e.into(),
2368 ))));
2369 }
2370 }
2371
2372 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2374
2375 std::task::Poll::Ready(Some(match header.ordinal {
2376 0x3dc6949d581e96fa => {
2377 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2378 let mut req = fidl::new_empty!(
2379 RealmStartRequest,
2380 fidl::encoding::DefaultFuchsiaResourceDialect
2381 );
2382 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmStartRequest>(&header, _body_bytes, handles, &mut req)?;
2383 let control_handle = RealmControlHandle { inner: this.inner.clone() };
2384 Ok(RealmRequest::Start {
2385 args: req.args,
2386
2387 responder: RealmStartResponder {
2388 control_handle: std::mem::ManuallyDrop::new(control_handle),
2389 tx_id: header.tx_id,
2390 },
2391 })
2392 }
2393 _ if header.tx_id == 0
2394 && header
2395 .dynamic_flags()
2396 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2397 {
2398 Ok(RealmRequest::_UnknownMethod {
2399 ordinal: header.ordinal,
2400 control_handle: RealmControlHandle { inner: this.inner.clone() },
2401 method_type: fidl::MethodType::OneWay,
2402 })
2403 }
2404 _ if header
2405 .dynamic_flags()
2406 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2407 {
2408 this.inner.send_framework_err(
2409 fidl::encoding::FrameworkErr::UnknownMethod,
2410 header.tx_id,
2411 header.ordinal,
2412 header.dynamic_flags(),
2413 (bytes, handles),
2414 )?;
2415 Ok(RealmRequest::_UnknownMethod {
2416 ordinal: header.ordinal,
2417 control_handle: RealmControlHandle { inner: this.inner.clone() },
2418 method_type: fidl::MethodType::TwoWay,
2419 })
2420 }
2421 _ => Err(fidl::Error::UnknownOrdinal {
2422 ordinal: header.ordinal,
2423 protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2424 }),
2425 }))
2426 },
2427 )
2428 }
2429}
2430
2431#[derive(Debug)]
2434pub enum RealmRequest {
2435 Start { args: RealmArgs, responder: RealmStartResponder },
2441 #[non_exhaustive]
2443 _UnknownMethod {
2444 ordinal: u64,
2446 control_handle: RealmControlHandle,
2447 method_type: fidl::MethodType,
2448 },
2449}
2450
2451impl RealmRequest {
2452 #[allow(irrefutable_let_patterns)]
2453 pub fn into_start(self) -> Option<(RealmArgs, RealmStartResponder)> {
2454 if let RealmRequest::Start { args, responder } = self {
2455 Some((args, responder))
2456 } else {
2457 None
2458 }
2459 }
2460
2461 pub fn method_name(&self) -> &'static str {
2463 match *self {
2464 RealmRequest::Start { .. } => "start",
2465 RealmRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
2466 "unknown one-way method"
2467 }
2468 RealmRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
2469 "unknown two-way method"
2470 }
2471 }
2472 }
2473}
2474
2475#[derive(Debug, Clone)]
2476pub struct RealmControlHandle {
2477 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2478}
2479
2480impl fidl::endpoints::ControlHandle for RealmControlHandle {
2481 fn shutdown(&self) {
2482 self.inner.shutdown()
2483 }
2484 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2485 self.inner.shutdown_with_epitaph(status)
2486 }
2487
2488 fn is_closed(&self) -> bool {
2489 self.inner.channel().is_closed()
2490 }
2491 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2492 self.inner.channel().on_closed()
2493 }
2494
2495 #[cfg(target_os = "fuchsia")]
2496 fn signal_peer(
2497 &self,
2498 clear_mask: zx::Signals,
2499 set_mask: zx::Signals,
2500 ) -> Result<(), zx_status::Status> {
2501 use fidl::Peered;
2502 self.inner.channel().signal_peer(clear_mask, set_mask)
2503 }
2504}
2505
2506impl RealmControlHandle {}
2507
2508#[must_use = "FIDL methods require a response to be sent"]
2509#[derive(Debug)]
2510pub struct RealmStartResponder {
2511 control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
2512 tx_id: u32,
2513}
2514
2515impl std::ops::Drop for RealmStartResponder {
2519 fn drop(&mut self) {
2520 self.control_handle.shutdown();
2521 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2523 }
2524}
2525
2526impl fidl::endpoints::Responder for RealmStartResponder {
2527 type ControlHandle = RealmControlHandle;
2528
2529 fn control_handle(&self) -> &RealmControlHandle {
2530 &self.control_handle
2531 }
2532
2533 fn drop_without_shutdown(mut self) {
2534 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2536 std::mem::forget(self);
2538 }
2539}
2540
2541impl RealmStartResponder {
2542 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2546 let _result = self.send_raw(result);
2547 if _result.is_err() {
2548 self.control_handle.shutdown();
2549 }
2550 self.drop_without_shutdown();
2551 _result
2552 }
2553
2554 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2556 let _result = self.send_raw(result);
2557 self.drop_without_shutdown();
2558 _result
2559 }
2560
2561 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2562 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2563 fidl::encoding::EmptyStruct,
2564 i32,
2565 >>(
2566 fidl::encoding::FlexibleResult::new(result),
2567 self.tx_id,
2568 0x3dc6949d581e96fa,
2569 fidl::encoding::DynamicFlags::FLEXIBLE,
2570 )
2571 }
2572}
2573
2574#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2575pub struct ResourceProviderMarker;
2576
2577impl fidl::endpoints::ProtocolMarker for ResourceProviderMarker {
2578 type Proxy = ResourceProviderProxy;
2579 type RequestStream = ResourceProviderRequestStream;
2580 #[cfg(target_os = "fuchsia")]
2581 type SynchronousProxy = ResourceProviderSynchronousProxy;
2582
2583 const DEBUG_NAME: &'static str = "fuchsia.driver.test.ResourceProvider";
2584}
2585impl fidl::endpoints::DiscoverableProtocolMarker for ResourceProviderMarker {}
2586pub type ResourceProviderGetDeviceTreeResult = Result<fidl::Vmo, i32>;
2587
2588pub trait ResourceProviderProxyInterface: Send + Sync {
2589 type GetDeviceTreeResponseFut: std::future::Future<Output = Result<ResourceProviderGetDeviceTreeResult, fidl::Error>>
2590 + Send;
2591 fn r#get_device_tree(&self) -> Self::GetDeviceTreeResponseFut;
2592}
2593#[derive(Debug)]
2594#[cfg(target_os = "fuchsia")]
2595pub struct ResourceProviderSynchronousProxy {
2596 client: fidl::client::sync::Client,
2597}
2598
2599#[cfg(target_os = "fuchsia")]
2600impl fidl::endpoints::SynchronousProxy for ResourceProviderSynchronousProxy {
2601 type Proxy = ResourceProviderProxy;
2602 type Protocol = ResourceProviderMarker;
2603
2604 fn from_channel(inner: fidl::Channel) -> Self {
2605 Self::new(inner)
2606 }
2607
2608 fn into_channel(self) -> fidl::Channel {
2609 self.client.into_channel()
2610 }
2611
2612 fn as_channel(&self) -> &fidl::Channel {
2613 self.client.as_channel()
2614 }
2615}
2616
2617#[cfg(target_os = "fuchsia")]
2618impl ResourceProviderSynchronousProxy {
2619 pub fn new(channel: fidl::Channel) -> Self {
2620 let protocol_name = <ResourceProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2621 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2622 }
2623
2624 pub fn into_channel(self) -> fidl::Channel {
2625 self.client.into_channel()
2626 }
2627
2628 pub fn wait_for_event(
2631 &self,
2632 deadline: zx::MonotonicInstant,
2633 ) -> Result<ResourceProviderEvent, fidl::Error> {
2634 ResourceProviderEvent::decode(self.client.wait_for_event(deadline)?)
2635 }
2636
2637 pub fn r#get_device_tree(
2638 &self,
2639 ___deadline: zx::MonotonicInstant,
2640 ) -> Result<ResourceProviderGetDeviceTreeResult, fidl::Error> {
2641 let _response = self.client.send_query::<
2642 fidl::encoding::EmptyPayload,
2643 fidl::encoding::ResultType<ResourceProviderGetDeviceTreeResponse, i32>,
2644 >(
2645 (),
2646 0x28fafebf621fdb07,
2647 fidl::encoding::DynamicFlags::empty(),
2648 ___deadline,
2649 )?;
2650 Ok(_response.map(|x| x.devicetree))
2651 }
2652}
2653
2654#[cfg(target_os = "fuchsia")]
2655impl From<ResourceProviderSynchronousProxy> for zx::NullableHandle {
2656 fn from(value: ResourceProviderSynchronousProxy) -> Self {
2657 value.into_channel().into()
2658 }
2659}
2660
2661#[cfg(target_os = "fuchsia")]
2662impl From<fidl::Channel> for ResourceProviderSynchronousProxy {
2663 fn from(value: fidl::Channel) -> Self {
2664 Self::new(value)
2665 }
2666}
2667
2668#[cfg(target_os = "fuchsia")]
2669impl fidl::endpoints::FromClient for ResourceProviderSynchronousProxy {
2670 type Protocol = ResourceProviderMarker;
2671
2672 fn from_client(value: fidl::endpoints::ClientEnd<ResourceProviderMarker>) -> Self {
2673 Self::new(value.into_channel())
2674 }
2675}
2676
2677#[derive(Debug, Clone)]
2678pub struct ResourceProviderProxy {
2679 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2680}
2681
2682impl fidl::endpoints::Proxy for ResourceProviderProxy {
2683 type Protocol = ResourceProviderMarker;
2684
2685 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2686 Self::new(inner)
2687 }
2688
2689 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2690 self.client.into_channel().map_err(|client| Self { client })
2691 }
2692
2693 fn as_channel(&self) -> &::fidl::AsyncChannel {
2694 self.client.as_channel()
2695 }
2696}
2697
2698impl ResourceProviderProxy {
2699 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2701 let protocol_name = <ResourceProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2702 Self { client: fidl::client::Client::new(channel, protocol_name) }
2703 }
2704
2705 pub fn take_event_stream(&self) -> ResourceProviderEventStream {
2711 ResourceProviderEventStream { event_receiver: self.client.take_event_receiver() }
2712 }
2713
2714 pub fn r#get_device_tree(
2715 &self,
2716 ) -> fidl::client::QueryResponseFut<
2717 ResourceProviderGetDeviceTreeResult,
2718 fidl::encoding::DefaultFuchsiaResourceDialect,
2719 > {
2720 ResourceProviderProxyInterface::r#get_device_tree(self)
2721 }
2722}
2723
2724impl ResourceProviderProxyInterface for ResourceProviderProxy {
2725 type GetDeviceTreeResponseFut = fidl::client::QueryResponseFut<
2726 ResourceProviderGetDeviceTreeResult,
2727 fidl::encoding::DefaultFuchsiaResourceDialect,
2728 >;
2729 fn r#get_device_tree(&self) -> Self::GetDeviceTreeResponseFut {
2730 fn _decode(
2731 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2732 ) -> Result<ResourceProviderGetDeviceTreeResult, fidl::Error> {
2733 let _response = fidl::client::decode_transaction_body::<
2734 fidl::encoding::ResultType<ResourceProviderGetDeviceTreeResponse, i32>,
2735 fidl::encoding::DefaultFuchsiaResourceDialect,
2736 0x28fafebf621fdb07,
2737 >(_buf?)?;
2738 Ok(_response.map(|x| x.devicetree))
2739 }
2740 self.client.send_query_and_decode::<
2741 fidl::encoding::EmptyPayload,
2742 ResourceProviderGetDeviceTreeResult,
2743 >(
2744 (),
2745 0x28fafebf621fdb07,
2746 fidl::encoding::DynamicFlags::empty(),
2747 _decode,
2748 )
2749 }
2750}
2751
2752pub struct ResourceProviderEventStream {
2753 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2754}
2755
2756impl std::marker::Unpin for ResourceProviderEventStream {}
2757
2758impl futures::stream::FusedStream for ResourceProviderEventStream {
2759 fn is_terminated(&self) -> bool {
2760 self.event_receiver.is_terminated()
2761 }
2762}
2763
2764impl futures::Stream for ResourceProviderEventStream {
2765 type Item = Result<ResourceProviderEvent, fidl::Error>;
2766
2767 fn poll_next(
2768 mut self: std::pin::Pin<&mut Self>,
2769 cx: &mut std::task::Context<'_>,
2770 ) -> std::task::Poll<Option<Self::Item>> {
2771 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2772 &mut self.event_receiver,
2773 cx
2774 )?) {
2775 Some(buf) => std::task::Poll::Ready(Some(ResourceProviderEvent::decode(buf))),
2776 None => std::task::Poll::Ready(None),
2777 }
2778 }
2779}
2780
2781#[derive(Debug)]
2782pub enum ResourceProviderEvent {}
2783
2784impl ResourceProviderEvent {
2785 fn decode(
2787 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2788 ) -> Result<ResourceProviderEvent, fidl::Error> {
2789 let (bytes, _handles) = buf.split_mut();
2790 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2791 debug_assert_eq!(tx_header.tx_id, 0);
2792 match tx_header.ordinal {
2793 _ => Err(fidl::Error::UnknownOrdinal {
2794 ordinal: tx_header.ordinal,
2795 protocol_name:
2796 <ResourceProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2797 }),
2798 }
2799 }
2800}
2801
2802pub struct ResourceProviderRequestStream {
2804 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2805 is_terminated: bool,
2806}
2807
2808impl std::marker::Unpin for ResourceProviderRequestStream {}
2809
2810impl futures::stream::FusedStream for ResourceProviderRequestStream {
2811 fn is_terminated(&self) -> bool {
2812 self.is_terminated
2813 }
2814}
2815
2816impl fidl::endpoints::RequestStream for ResourceProviderRequestStream {
2817 type Protocol = ResourceProviderMarker;
2818 type ControlHandle = ResourceProviderControlHandle;
2819
2820 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2821 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2822 }
2823
2824 fn control_handle(&self) -> Self::ControlHandle {
2825 ResourceProviderControlHandle { inner: self.inner.clone() }
2826 }
2827
2828 fn into_inner(
2829 self,
2830 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2831 {
2832 (self.inner, self.is_terminated)
2833 }
2834
2835 fn from_inner(
2836 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2837 is_terminated: bool,
2838 ) -> Self {
2839 Self { inner, is_terminated }
2840 }
2841}
2842
2843impl futures::Stream for ResourceProviderRequestStream {
2844 type Item = Result<ResourceProviderRequest, fidl::Error>;
2845
2846 fn poll_next(
2847 mut self: std::pin::Pin<&mut Self>,
2848 cx: &mut std::task::Context<'_>,
2849 ) -> std::task::Poll<Option<Self::Item>> {
2850 let this = &mut *self;
2851 if this.inner.check_shutdown(cx) {
2852 this.is_terminated = true;
2853 return std::task::Poll::Ready(None);
2854 }
2855 if this.is_terminated {
2856 panic!("polled ResourceProviderRequestStream after completion");
2857 }
2858 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2859 |bytes, handles| {
2860 match this.inner.channel().read_etc(cx, bytes, handles) {
2861 std::task::Poll::Ready(Ok(())) => {}
2862 std::task::Poll::Pending => return std::task::Poll::Pending,
2863 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2864 this.is_terminated = true;
2865 return std::task::Poll::Ready(None);
2866 }
2867 std::task::Poll::Ready(Err(e)) => {
2868 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2869 e.into(),
2870 ))));
2871 }
2872 }
2873
2874 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2876
2877 std::task::Poll::Ready(Some(match header.ordinal {
2878 0x28fafebf621fdb07 => {
2879 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2880 let mut req = fidl::new_empty!(
2881 fidl::encoding::EmptyPayload,
2882 fidl::encoding::DefaultFuchsiaResourceDialect
2883 );
2884 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2885 let control_handle =
2886 ResourceProviderControlHandle { inner: this.inner.clone() };
2887 Ok(ResourceProviderRequest::GetDeviceTree {
2888 responder: ResourceProviderGetDeviceTreeResponder {
2889 control_handle: std::mem::ManuallyDrop::new(control_handle),
2890 tx_id: header.tx_id,
2891 },
2892 })
2893 }
2894 _ => Err(fidl::Error::UnknownOrdinal {
2895 ordinal: header.ordinal,
2896 protocol_name:
2897 <ResourceProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2898 }),
2899 }))
2900 },
2901 )
2902 }
2903}
2904
2905#[derive(Debug)]
2906pub enum ResourceProviderRequest {
2907 GetDeviceTree { responder: ResourceProviderGetDeviceTreeResponder },
2908}
2909
2910impl ResourceProviderRequest {
2911 #[allow(irrefutable_let_patterns)]
2912 pub fn into_get_device_tree(self) -> Option<(ResourceProviderGetDeviceTreeResponder)> {
2913 if let ResourceProviderRequest::GetDeviceTree { responder } = self {
2914 Some((responder))
2915 } else {
2916 None
2917 }
2918 }
2919
2920 pub fn method_name(&self) -> &'static str {
2922 match *self {
2923 ResourceProviderRequest::GetDeviceTree { .. } => "get_device_tree",
2924 }
2925 }
2926}
2927
2928#[derive(Debug, Clone)]
2929pub struct ResourceProviderControlHandle {
2930 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2931}
2932
2933impl fidl::endpoints::ControlHandle for ResourceProviderControlHandle {
2934 fn shutdown(&self) {
2935 self.inner.shutdown()
2936 }
2937 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2938 self.inner.shutdown_with_epitaph(status)
2939 }
2940
2941 fn is_closed(&self) -> bool {
2942 self.inner.channel().is_closed()
2943 }
2944 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2945 self.inner.channel().on_closed()
2946 }
2947
2948 #[cfg(target_os = "fuchsia")]
2949 fn signal_peer(
2950 &self,
2951 clear_mask: zx::Signals,
2952 set_mask: zx::Signals,
2953 ) -> Result<(), zx_status::Status> {
2954 use fidl::Peered;
2955 self.inner.channel().signal_peer(clear_mask, set_mask)
2956 }
2957}
2958
2959impl ResourceProviderControlHandle {}
2960
2961#[must_use = "FIDL methods require a response to be sent"]
2962#[derive(Debug)]
2963pub struct ResourceProviderGetDeviceTreeResponder {
2964 control_handle: std::mem::ManuallyDrop<ResourceProviderControlHandle>,
2965 tx_id: u32,
2966}
2967
2968impl std::ops::Drop for ResourceProviderGetDeviceTreeResponder {
2972 fn drop(&mut self) {
2973 self.control_handle.shutdown();
2974 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2976 }
2977}
2978
2979impl fidl::endpoints::Responder for ResourceProviderGetDeviceTreeResponder {
2980 type ControlHandle = ResourceProviderControlHandle;
2981
2982 fn control_handle(&self) -> &ResourceProviderControlHandle {
2983 &self.control_handle
2984 }
2985
2986 fn drop_without_shutdown(mut self) {
2987 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2989 std::mem::forget(self);
2991 }
2992}
2993
2994impl ResourceProviderGetDeviceTreeResponder {
2995 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
2999 let _result = self.send_raw(result);
3000 if _result.is_err() {
3001 self.control_handle.shutdown();
3002 }
3003 self.drop_without_shutdown();
3004 _result
3005 }
3006
3007 pub fn send_no_shutdown_on_err(
3009 self,
3010 mut result: Result<fidl::Vmo, i32>,
3011 ) -> Result<(), fidl::Error> {
3012 let _result = self.send_raw(result);
3013 self.drop_without_shutdown();
3014 _result
3015 }
3016
3017 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
3018 self.control_handle.inner.send::<fidl::encoding::ResultType<
3019 ResourceProviderGetDeviceTreeResponse,
3020 i32,
3021 >>(
3022 result.map(|devicetree| (devicetree,)),
3023 self.tx_id,
3024 0x28fafebf621fdb07,
3025 fidl::encoding::DynamicFlags::empty(),
3026 )
3027 }
3028}
3029
3030mod internal {
3031 use super::*;
3032
3033 impl fidl::encoding::ResourceTypeMarker for InternalGetBootDirectoryResponse {
3034 type Borrowed<'a> = &'a mut Self;
3035 fn take_or_borrow<'a>(
3036 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3037 ) -> Self::Borrowed<'a> {
3038 value
3039 }
3040 }
3041
3042 unsafe impl fidl::encoding::TypeMarker for InternalGetBootDirectoryResponse {
3043 type Owned = Self;
3044
3045 #[inline(always)]
3046 fn inline_align(_context: fidl::encoding::Context) -> usize {
3047 4
3048 }
3049
3050 #[inline(always)]
3051 fn inline_size(_context: fidl::encoding::Context) -> usize {
3052 4
3053 }
3054 }
3055
3056 unsafe impl
3057 fidl::encoding::Encode<
3058 InternalGetBootDirectoryResponse,
3059 fidl::encoding::DefaultFuchsiaResourceDialect,
3060 > for &mut InternalGetBootDirectoryResponse
3061 {
3062 #[inline]
3063 unsafe fn encode(
3064 self,
3065 encoder: &mut fidl::encoding::Encoder<
3066 '_,
3067 fidl::encoding::DefaultFuchsiaResourceDialect,
3068 >,
3069 offset: usize,
3070 _depth: fidl::encoding::Depth,
3071 ) -> fidl::Result<()> {
3072 encoder.debug_check_bounds::<InternalGetBootDirectoryResponse>(offset);
3073 fidl::encoding::Encode::<
3075 InternalGetBootDirectoryResponse,
3076 fidl::encoding::DefaultFuchsiaResourceDialect,
3077 >::encode(
3078 (<fidl::encoding::Optional<
3079 fidl::encoding::Endpoint<
3080 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3081 >,
3082 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3083 &mut self.boot_dir
3084 ),),
3085 encoder,
3086 offset,
3087 _depth,
3088 )
3089 }
3090 }
3091 unsafe impl<
3092 T0: fidl::encoding::Encode<
3093 fidl::encoding::Optional<
3094 fidl::encoding::Endpoint<
3095 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3096 >,
3097 >,
3098 fidl::encoding::DefaultFuchsiaResourceDialect,
3099 >,
3100 >
3101 fidl::encoding::Encode<
3102 InternalGetBootDirectoryResponse,
3103 fidl::encoding::DefaultFuchsiaResourceDialect,
3104 > for (T0,)
3105 {
3106 #[inline]
3107 unsafe fn encode(
3108 self,
3109 encoder: &mut fidl::encoding::Encoder<
3110 '_,
3111 fidl::encoding::DefaultFuchsiaResourceDialect,
3112 >,
3113 offset: usize,
3114 depth: fidl::encoding::Depth,
3115 ) -> fidl::Result<()> {
3116 encoder.debug_check_bounds::<InternalGetBootDirectoryResponse>(offset);
3117 self.0.encode(encoder, offset + 0, depth)?;
3121 Ok(())
3122 }
3123 }
3124
3125 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3126 for InternalGetBootDirectoryResponse
3127 {
3128 #[inline(always)]
3129 fn new_empty() -> Self {
3130 Self {
3131 boot_dir: fidl::new_empty!(
3132 fidl::encoding::Optional<
3133 fidl::encoding::Endpoint<
3134 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3135 >,
3136 >,
3137 fidl::encoding::DefaultFuchsiaResourceDialect
3138 ),
3139 }
3140 }
3141
3142 #[inline]
3143 unsafe fn decode(
3144 &mut self,
3145 decoder: &mut fidl::encoding::Decoder<
3146 '_,
3147 fidl::encoding::DefaultFuchsiaResourceDialect,
3148 >,
3149 offset: usize,
3150 _depth: fidl::encoding::Depth,
3151 ) -> fidl::Result<()> {
3152 decoder.debug_check_bounds::<Self>(offset);
3153 fidl::decode!(
3155 fidl::encoding::Optional<
3156 fidl::encoding::Endpoint<
3157 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3158 >,
3159 >,
3160 fidl::encoding::DefaultFuchsiaResourceDialect,
3161 &mut self.boot_dir,
3162 decoder,
3163 offset + 0,
3164 _depth
3165 )?;
3166 Ok(())
3167 }
3168 }
3169
3170 impl fidl::encoding::ResourceTypeMarker for InternalGetTestPackageResponse {
3171 type Borrowed<'a> = &'a mut Self;
3172 fn take_or_borrow<'a>(
3173 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3174 ) -> Self::Borrowed<'a> {
3175 value
3176 }
3177 }
3178
3179 unsafe impl fidl::encoding::TypeMarker for InternalGetTestPackageResponse {
3180 type Owned = Self;
3181
3182 #[inline(always)]
3183 fn inline_align(_context: fidl::encoding::Context) -> usize {
3184 4
3185 }
3186
3187 #[inline(always)]
3188 fn inline_size(_context: fidl::encoding::Context) -> usize {
3189 4
3190 }
3191 }
3192
3193 unsafe impl
3194 fidl::encoding::Encode<
3195 InternalGetTestPackageResponse,
3196 fidl::encoding::DefaultFuchsiaResourceDialect,
3197 > for &mut InternalGetTestPackageResponse
3198 {
3199 #[inline]
3200 unsafe fn encode(
3201 self,
3202 encoder: &mut fidl::encoding::Encoder<
3203 '_,
3204 fidl::encoding::DefaultFuchsiaResourceDialect,
3205 >,
3206 offset: usize,
3207 _depth: fidl::encoding::Depth,
3208 ) -> fidl::Result<()> {
3209 encoder.debug_check_bounds::<InternalGetTestPackageResponse>(offset);
3210 fidl::encoding::Encode::<
3212 InternalGetTestPackageResponse,
3213 fidl::encoding::DefaultFuchsiaResourceDialect,
3214 >::encode(
3215 (<fidl::encoding::Optional<
3216 fidl::encoding::Endpoint<
3217 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3218 >,
3219 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3220 &mut self.test_pkg_dir
3221 ),),
3222 encoder,
3223 offset,
3224 _depth,
3225 )
3226 }
3227 }
3228 unsafe impl<
3229 T0: fidl::encoding::Encode<
3230 fidl::encoding::Optional<
3231 fidl::encoding::Endpoint<
3232 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3233 >,
3234 >,
3235 fidl::encoding::DefaultFuchsiaResourceDialect,
3236 >,
3237 >
3238 fidl::encoding::Encode<
3239 InternalGetTestPackageResponse,
3240 fidl::encoding::DefaultFuchsiaResourceDialect,
3241 > for (T0,)
3242 {
3243 #[inline]
3244 unsafe fn encode(
3245 self,
3246 encoder: &mut fidl::encoding::Encoder<
3247 '_,
3248 fidl::encoding::DefaultFuchsiaResourceDialect,
3249 >,
3250 offset: usize,
3251 depth: fidl::encoding::Depth,
3252 ) -> fidl::Result<()> {
3253 encoder.debug_check_bounds::<InternalGetTestPackageResponse>(offset);
3254 self.0.encode(encoder, offset + 0, depth)?;
3258 Ok(())
3259 }
3260 }
3261
3262 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3263 for InternalGetTestPackageResponse
3264 {
3265 #[inline(always)]
3266 fn new_empty() -> Self {
3267 Self {
3268 test_pkg_dir: fidl::new_empty!(
3269 fidl::encoding::Optional<
3270 fidl::encoding::Endpoint<
3271 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3272 >,
3273 >,
3274 fidl::encoding::DefaultFuchsiaResourceDialect
3275 ),
3276 }
3277 }
3278
3279 #[inline]
3280 unsafe fn decode(
3281 &mut self,
3282 decoder: &mut fidl::encoding::Decoder<
3283 '_,
3284 fidl::encoding::DefaultFuchsiaResourceDialect,
3285 >,
3286 offset: usize,
3287 _depth: fidl::encoding::Depth,
3288 ) -> fidl::Result<()> {
3289 decoder.debug_check_bounds::<Self>(offset);
3290 fidl::decode!(
3292 fidl::encoding::Optional<
3293 fidl::encoding::Endpoint<
3294 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3295 >,
3296 >,
3297 fidl::encoding::DefaultFuchsiaResourceDialect,
3298 &mut self.test_pkg_dir,
3299 decoder,
3300 offset + 0,
3301 _depth
3302 )?;
3303 Ok(())
3304 }
3305 }
3306
3307 impl fidl::encoding::ResourceTypeMarker for ManifestProviderGetManifestResponse {
3308 type Borrowed<'a> = &'a mut Self;
3309 fn take_or_borrow<'a>(
3310 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3311 ) -> Self::Borrowed<'a> {
3312 value
3313 }
3314 }
3315
3316 unsafe impl fidl::encoding::TypeMarker for ManifestProviderGetManifestResponse {
3317 type Owned = Self;
3318
3319 #[inline(always)]
3320 fn inline_align(_context: fidl::encoding::Context) -> usize {
3321 4
3322 }
3323
3324 #[inline(always)]
3325 fn inline_size(_context: fidl::encoding::Context) -> usize {
3326 4
3327 }
3328 }
3329
3330 unsafe impl
3331 fidl::encoding::Encode<
3332 ManifestProviderGetManifestResponse,
3333 fidl::encoding::DefaultFuchsiaResourceDialect,
3334 > for &mut ManifestProviderGetManifestResponse
3335 {
3336 #[inline]
3337 unsafe fn encode(
3338 self,
3339 encoder: &mut fidl::encoding::Encoder<
3340 '_,
3341 fidl::encoding::DefaultFuchsiaResourceDialect,
3342 >,
3343 offset: usize,
3344 _depth: fidl::encoding::Depth,
3345 ) -> fidl::Result<()> {
3346 encoder.debug_check_bounds::<ManifestProviderGetManifestResponse>(offset);
3347 fidl::encoding::Encode::<
3349 ManifestProviderGetManifestResponse,
3350 fidl::encoding::DefaultFuchsiaResourceDialect,
3351 >::encode(
3352 (<fidl::encoding::HandleType<
3353 fidl::Stream,
3354 { fidl::ObjectType::STREAM.into_raw() },
3355 2147483648,
3356 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3357 &mut self.manifest
3358 ),),
3359 encoder,
3360 offset,
3361 _depth,
3362 )
3363 }
3364 }
3365 unsafe impl<
3366 T0: fidl::encoding::Encode<
3367 fidl::encoding::HandleType<
3368 fidl::Stream,
3369 { fidl::ObjectType::STREAM.into_raw() },
3370 2147483648,
3371 >,
3372 fidl::encoding::DefaultFuchsiaResourceDialect,
3373 >,
3374 >
3375 fidl::encoding::Encode<
3376 ManifestProviderGetManifestResponse,
3377 fidl::encoding::DefaultFuchsiaResourceDialect,
3378 > for (T0,)
3379 {
3380 #[inline]
3381 unsafe fn encode(
3382 self,
3383 encoder: &mut fidl::encoding::Encoder<
3384 '_,
3385 fidl::encoding::DefaultFuchsiaResourceDialect,
3386 >,
3387 offset: usize,
3388 depth: fidl::encoding::Depth,
3389 ) -> fidl::Result<()> {
3390 encoder.debug_check_bounds::<ManifestProviderGetManifestResponse>(offset);
3391 self.0.encode(encoder, offset + 0, depth)?;
3395 Ok(())
3396 }
3397 }
3398
3399 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3400 for ManifestProviderGetManifestResponse
3401 {
3402 #[inline(always)]
3403 fn new_empty() -> Self {
3404 Self {
3405 manifest: fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3406 }
3407 }
3408
3409 #[inline]
3410 unsafe fn decode(
3411 &mut self,
3412 decoder: &mut fidl::encoding::Decoder<
3413 '_,
3414 fidl::encoding::DefaultFuchsiaResourceDialect,
3415 >,
3416 offset: usize,
3417 _depth: fidl::encoding::Depth,
3418 ) -> fidl::Result<()> {
3419 decoder.debug_check_bounds::<Self>(offset);
3420 fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.manifest, decoder, offset + 0, _depth)?;
3422 Ok(())
3423 }
3424 }
3425
3426 impl fidl::encoding::ResourceTypeMarker for RealmStartRequest {
3427 type Borrowed<'a> = &'a mut Self;
3428 fn take_or_borrow<'a>(
3429 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3430 ) -> Self::Borrowed<'a> {
3431 value
3432 }
3433 }
3434
3435 unsafe impl fidl::encoding::TypeMarker for RealmStartRequest {
3436 type Owned = Self;
3437
3438 #[inline(always)]
3439 fn inline_align(_context: fidl::encoding::Context) -> usize {
3440 8
3441 }
3442
3443 #[inline(always)]
3444 fn inline_size(_context: fidl::encoding::Context) -> usize {
3445 16
3446 }
3447 }
3448
3449 unsafe impl
3450 fidl::encoding::Encode<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3451 for &mut RealmStartRequest
3452 {
3453 #[inline]
3454 unsafe fn encode(
3455 self,
3456 encoder: &mut fidl::encoding::Encoder<
3457 '_,
3458 fidl::encoding::DefaultFuchsiaResourceDialect,
3459 >,
3460 offset: usize,
3461 _depth: fidl::encoding::Depth,
3462 ) -> fidl::Result<()> {
3463 encoder.debug_check_bounds::<RealmStartRequest>(offset);
3464 fidl::encoding::Encode::<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3466 (
3467 <RealmArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
3468 ),
3469 encoder, offset, _depth
3470 )
3471 }
3472 }
3473 unsafe impl<
3474 T0: fidl::encoding::Encode<RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
3475 > fidl::encoding::Encode<RealmStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3476 for (T0,)
3477 {
3478 #[inline]
3479 unsafe fn encode(
3480 self,
3481 encoder: &mut fidl::encoding::Encoder<
3482 '_,
3483 fidl::encoding::DefaultFuchsiaResourceDialect,
3484 >,
3485 offset: usize,
3486 depth: fidl::encoding::Depth,
3487 ) -> fidl::Result<()> {
3488 encoder.debug_check_bounds::<RealmStartRequest>(offset);
3489 self.0.encode(encoder, offset + 0, depth)?;
3493 Ok(())
3494 }
3495 }
3496
3497 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3498 for RealmStartRequest
3499 {
3500 #[inline(always)]
3501 fn new_empty() -> Self {
3502 Self {
3503 args: fidl::new_empty!(RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect),
3504 }
3505 }
3506
3507 #[inline]
3508 unsafe fn decode(
3509 &mut self,
3510 decoder: &mut fidl::encoding::Decoder<
3511 '_,
3512 fidl::encoding::DefaultFuchsiaResourceDialect,
3513 >,
3514 offset: usize,
3515 _depth: fidl::encoding::Depth,
3516 ) -> fidl::Result<()> {
3517 decoder.debug_check_bounds::<Self>(offset);
3518 fidl::decode!(
3520 RealmArgs,
3521 fidl::encoding::DefaultFuchsiaResourceDialect,
3522 &mut self.args,
3523 decoder,
3524 offset + 0,
3525 _depth
3526 )?;
3527 Ok(())
3528 }
3529 }
3530
3531 impl fidl::encoding::ResourceTypeMarker for ResourceProviderGetDeviceTreeResponse {
3532 type Borrowed<'a> = &'a mut Self;
3533 fn take_or_borrow<'a>(
3534 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3535 ) -> Self::Borrowed<'a> {
3536 value
3537 }
3538 }
3539
3540 unsafe impl fidl::encoding::TypeMarker for ResourceProviderGetDeviceTreeResponse {
3541 type Owned = Self;
3542
3543 #[inline(always)]
3544 fn inline_align(_context: fidl::encoding::Context) -> usize {
3545 4
3546 }
3547
3548 #[inline(always)]
3549 fn inline_size(_context: fidl::encoding::Context) -> usize {
3550 4
3551 }
3552 }
3553
3554 unsafe impl
3555 fidl::encoding::Encode<
3556 ResourceProviderGetDeviceTreeResponse,
3557 fidl::encoding::DefaultFuchsiaResourceDialect,
3558 > for &mut ResourceProviderGetDeviceTreeResponse
3559 {
3560 #[inline]
3561 unsafe fn encode(
3562 self,
3563 encoder: &mut fidl::encoding::Encoder<
3564 '_,
3565 fidl::encoding::DefaultFuchsiaResourceDialect,
3566 >,
3567 offset: usize,
3568 _depth: fidl::encoding::Depth,
3569 ) -> fidl::Result<()> {
3570 encoder.debug_check_bounds::<ResourceProviderGetDeviceTreeResponse>(offset);
3571 fidl::encoding::Encode::<
3573 ResourceProviderGetDeviceTreeResponse,
3574 fidl::encoding::DefaultFuchsiaResourceDialect,
3575 >::encode(
3576 (<fidl::encoding::HandleType<
3577 fidl::Vmo,
3578 { fidl::ObjectType::VMO.into_raw() },
3579 2147483648,
3580 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3581 &mut self.devicetree
3582 ),),
3583 encoder,
3584 offset,
3585 _depth,
3586 )
3587 }
3588 }
3589 unsafe impl<
3590 T0: fidl::encoding::Encode<
3591 fidl::encoding::HandleType<
3592 fidl::Vmo,
3593 { fidl::ObjectType::VMO.into_raw() },
3594 2147483648,
3595 >,
3596 fidl::encoding::DefaultFuchsiaResourceDialect,
3597 >,
3598 >
3599 fidl::encoding::Encode<
3600 ResourceProviderGetDeviceTreeResponse,
3601 fidl::encoding::DefaultFuchsiaResourceDialect,
3602 > for (T0,)
3603 {
3604 #[inline]
3605 unsafe fn encode(
3606 self,
3607 encoder: &mut fidl::encoding::Encoder<
3608 '_,
3609 fidl::encoding::DefaultFuchsiaResourceDialect,
3610 >,
3611 offset: usize,
3612 depth: fidl::encoding::Depth,
3613 ) -> fidl::Result<()> {
3614 encoder.debug_check_bounds::<ResourceProviderGetDeviceTreeResponse>(offset);
3615 self.0.encode(encoder, offset + 0, depth)?;
3619 Ok(())
3620 }
3621 }
3622
3623 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3624 for ResourceProviderGetDeviceTreeResponse
3625 {
3626 #[inline(always)]
3627 fn new_empty() -> Self {
3628 Self {
3629 devicetree: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
3630 }
3631 }
3632
3633 #[inline]
3634 unsafe fn decode(
3635 &mut self,
3636 decoder: &mut fidl::encoding::Decoder<
3637 '_,
3638 fidl::encoding::DefaultFuchsiaResourceDialect,
3639 >,
3640 offset: usize,
3641 _depth: fidl::encoding::Depth,
3642 ) -> fidl::Result<()> {
3643 decoder.debug_check_bounds::<Self>(offset);
3644 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.devicetree, decoder, offset + 0, _depth)?;
3646 Ok(())
3647 }
3648 }
3649
3650 impl RealmArgs {
3651 #[inline(always)]
3652 fn max_ordinal_present(&self) -> u64 {
3653 if let Some(_) = self.platform_pid {
3654 return 22;
3655 }
3656 if let Some(_) = self.platform_vid {
3657 return 21;
3658 }
3659 if let Some(_) = self.devicetree {
3660 return 20;
3661 }
3662 if let Some(_) = self.boot_driver_components {
3663 return 19;
3664 }
3665 if let Some(_) = self.software_devices {
3666 return 18;
3667 }
3668 if let Some(_) = self.driver_index_stop_timeout_millis {
3669 return 17;
3670 }
3671 if let Some(_) = self.test_component {
3672 return 16;
3673 }
3674 if let Some(_) = self.dtr_exposes {
3675 return 15;
3676 }
3677 if let Some(_) = self.dtr_offers {
3678 return 14;
3679 }
3680 if let Some(_) = self.pkg {
3681 return 13;
3682 }
3683 if let Some(_) = self.exposes {
3684 return 12;
3685 }
3686 if let Some(_) = self.offers {
3687 return 11;
3688 }
3689 if let Some(_) = self.board_name {
3690 return 10;
3691 }
3692 if let Some(_) = self.driver_bind_eager {
3693 return 9;
3694 }
3695 if let Some(_) = self.driver_disable {
3696 return 8;
3697 }
3698 if let Some(_) = self.driver_log_level {
3699 return 7;
3700 }
3701 if let Some(_) = self.driver_tests_disable {
3702 return 6;
3703 }
3704 if let Some(_) = self.driver_tests_enable {
3705 return 5;
3706 }
3707 if let Some(_) = self.driver_tests_enable_all {
3708 return 4;
3709 }
3710 if let Some(_) = self.root_driver {
3711 return 2;
3712 }
3713 if let Some(_) = self.boot {
3714 return 1;
3715 }
3716 0
3717 }
3718 }
3719
3720 impl fidl::encoding::ResourceTypeMarker for RealmArgs {
3721 type Borrowed<'a> = &'a mut Self;
3722 fn take_or_borrow<'a>(
3723 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3724 ) -> Self::Borrowed<'a> {
3725 value
3726 }
3727 }
3728
3729 unsafe impl fidl::encoding::TypeMarker for RealmArgs {
3730 type Owned = Self;
3731
3732 #[inline(always)]
3733 fn inline_align(_context: fidl::encoding::Context) -> usize {
3734 8
3735 }
3736
3737 #[inline(always)]
3738 fn inline_size(_context: fidl::encoding::Context) -> usize {
3739 16
3740 }
3741 }
3742
3743 unsafe impl fidl::encoding::Encode<RealmArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
3744 for &mut RealmArgs
3745 {
3746 unsafe fn encode(
3747 self,
3748 encoder: &mut fidl::encoding::Encoder<
3749 '_,
3750 fidl::encoding::DefaultFuchsiaResourceDialect,
3751 >,
3752 offset: usize,
3753 mut depth: fidl::encoding::Depth,
3754 ) -> fidl::Result<()> {
3755 encoder.debug_check_bounds::<RealmArgs>(offset);
3756 let max_ordinal: u64 = self.max_ordinal_present();
3758 encoder.write_num(max_ordinal, offset);
3759 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3760 if max_ordinal == 0 {
3762 return Ok(());
3763 }
3764 depth.increment()?;
3765 let envelope_size = 8;
3766 let bytes_len = max_ordinal as usize * envelope_size;
3767 #[allow(unused_variables)]
3768 let offset = encoder.out_of_line_offset(bytes_len);
3769 let mut _prev_end_offset: usize = 0;
3770 if 1 > max_ordinal {
3771 return Ok(());
3772 }
3773
3774 let cur_offset: usize = (1 - 1) * envelope_size;
3777
3778 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3780
3781 fidl::encoding::encode_in_envelope_optional::<
3786 fidl::encoding::Endpoint<
3787 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3788 >,
3789 fidl::encoding::DefaultFuchsiaResourceDialect,
3790 >(
3791 self.boot.as_mut().map(
3792 <fidl::encoding::Endpoint<
3793 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3794 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3795 ),
3796 encoder,
3797 offset + cur_offset,
3798 depth,
3799 )?;
3800
3801 _prev_end_offset = cur_offset + envelope_size;
3802 if 2 > max_ordinal {
3803 return Ok(());
3804 }
3805
3806 let cur_offset: usize = (2 - 1) * envelope_size;
3809
3810 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3812
3813 fidl::encoding::encode_in_envelope_optional::<
3818 fidl::encoding::UnboundedString,
3819 fidl::encoding::DefaultFuchsiaResourceDialect,
3820 >(
3821 self.root_driver.as_ref().map(
3822 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3823 ),
3824 encoder,
3825 offset + cur_offset,
3826 depth,
3827 )?;
3828
3829 _prev_end_offset = cur_offset + envelope_size;
3830 if 4 > max_ordinal {
3831 return Ok(());
3832 }
3833
3834 let cur_offset: usize = (4 - 1) * envelope_size;
3837
3838 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3840
3841 fidl::encoding::encode_in_envelope_optional::<
3846 bool,
3847 fidl::encoding::DefaultFuchsiaResourceDialect,
3848 >(
3849 self.driver_tests_enable_all
3850 .as_ref()
3851 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3852 encoder,
3853 offset + cur_offset,
3854 depth,
3855 )?;
3856
3857 _prev_end_offset = cur_offset + envelope_size;
3858 if 5 > max_ordinal {
3859 return Ok(());
3860 }
3861
3862 let cur_offset: usize = (5 - 1) * envelope_size;
3865
3866 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3868
3869 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3874 self.driver_tests_enable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
3875 encoder, offset + cur_offset, depth
3876 )?;
3877
3878 _prev_end_offset = cur_offset + envelope_size;
3879 if 6 > max_ordinal {
3880 return Ok(());
3881 }
3882
3883 let cur_offset: usize = (6 - 1) * envelope_size;
3886
3887 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3889
3890 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3895 self.driver_tests_disable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
3896 encoder, offset + cur_offset, depth
3897 )?;
3898
3899 _prev_end_offset = cur_offset + envelope_size;
3900 if 7 > max_ordinal {
3901 return Ok(());
3902 }
3903
3904 let cur_offset: usize = (7 - 1) * envelope_size;
3907
3908 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3910
3911 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<DriverLog>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3916 self.driver_log_level.as_ref().map(<fidl::encoding::UnboundedVector<DriverLog> as fidl::encoding::ValueTypeMarker>::borrow),
3917 encoder, offset + cur_offset, depth
3918 )?;
3919
3920 _prev_end_offset = cur_offset + envelope_size;
3921 if 8 > max_ordinal {
3922 return Ok(());
3923 }
3924
3925 let cur_offset: usize = (8 - 1) * envelope_size;
3928
3929 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3931
3932 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3937 self.driver_disable.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
3938 encoder, offset + cur_offset, depth
3939 )?;
3940
3941 _prev_end_offset = cur_offset + envelope_size;
3942 if 9 > max_ordinal {
3943 return Ok(());
3944 }
3945
3946 let cur_offset: usize = (9 - 1) * envelope_size;
3949
3950 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3952
3953 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
3958 self.driver_bind_eager.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
3959 encoder, offset + cur_offset, depth
3960 )?;
3961
3962 _prev_end_offset = cur_offset + envelope_size;
3963 if 10 > max_ordinal {
3964 return Ok(());
3965 }
3966
3967 let cur_offset: usize = (10 - 1) * envelope_size;
3970
3971 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3973
3974 fidl::encoding::encode_in_envelope_optional::<
3979 fidl::encoding::UnboundedString,
3980 fidl::encoding::DefaultFuchsiaResourceDialect,
3981 >(
3982 self.board_name.as_ref().map(
3983 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3984 ),
3985 encoder,
3986 offset + cur_offset,
3987 depth,
3988 )?;
3989
3990 _prev_end_offset = cur_offset + envelope_size;
3991 if 11 > max_ordinal {
3992 return Ok(());
3993 }
3994
3995 let cur_offset: usize = (11 - 1) * envelope_size;
3998
3999 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4001
4002 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Offer>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4007 self.offers.as_ref().map(<fidl::encoding::UnboundedVector<Offer> as fidl::encoding::ValueTypeMarker>::borrow),
4008 encoder, offset + cur_offset, depth
4009 )?;
4010
4011 _prev_end_offset = cur_offset + envelope_size;
4012 if 12 > max_ordinal {
4013 return Ok(());
4014 }
4015
4016 let cur_offset: usize = (12 - 1) * envelope_size;
4019
4020 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4022
4023 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Expose>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4028 self.exposes.as_ref().map(<fidl::encoding::UnboundedVector<Expose> as fidl::encoding::ValueTypeMarker>::borrow),
4029 encoder, offset + cur_offset, depth
4030 )?;
4031
4032 _prev_end_offset = cur_offset + envelope_size;
4033 if 13 > max_ordinal {
4034 return Ok(());
4035 }
4036
4037 let cur_offset: usize = (13 - 1) * envelope_size;
4040
4041 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4043
4044 fidl::encoding::encode_in_envelope_optional::<
4049 fidl::encoding::Endpoint<
4050 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4051 >,
4052 fidl::encoding::DefaultFuchsiaResourceDialect,
4053 >(
4054 self.pkg.as_mut().map(
4055 <fidl::encoding::Endpoint<
4056 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4057 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
4058 ),
4059 encoder,
4060 offset + cur_offset,
4061 depth,
4062 )?;
4063
4064 _prev_end_offset = cur_offset + envelope_size;
4065 if 14 > max_ordinal {
4066 return Ok(());
4067 }
4068
4069 let cur_offset: usize = (14 - 1) * envelope_size;
4072
4073 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4075
4076 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4081 self.dtr_offers.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability> as fidl::encoding::ValueTypeMarker>::borrow),
4082 encoder, offset + cur_offset, depth
4083 )?;
4084
4085 _prev_end_offset = cur_offset + envelope_size;
4086 if 15 > max_ordinal {
4087 return Ok(());
4088 }
4089
4090 let cur_offset: usize = (15 - 1) * envelope_size;
4093
4094 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4096
4097 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4102 self.dtr_exposes.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability> as fidl::encoding::ValueTypeMarker>::borrow),
4103 encoder, offset + cur_offset, depth
4104 )?;
4105
4106 _prev_end_offset = cur_offset + envelope_size;
4107 if 16 > max_ordinal {
4108 return Ok(());
4109 }
4110
4111 let cur_offset: usize = (16 - 1) * envelope_size;
4114
4115 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4117
4118 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_resolution::Component, fidl::encoding::DefaultFuchsiaResourceDialect>(
4123 self.test_component.as_mut().map(<fidl_fuchsia_component_resolution::Component as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4124 encoder, offset + cur_offset, depth
4125 )?;
4126
4127 _prev_end_offset = cur_offset + envelope_size;
4128 if 17 > max_ordinal {
4129 return Ok(());
4130 }
4131
4132 let cur_offset: usize = (17 - 1) * envelope_size;
4135
4136 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4138
4139 fidl::encoding::encode_in_envelope_optional::<
4144 i64,
4145 fidl::encoding::DefaultFuchsiaResourceDialect,
4146 >(
4147 self.driver_index_stop_timeout_millis
4148 .as_ref()
4149 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
4150 encoder,
4151 offset + cur_offset,
4152 depth,
4153 )?;
4154
4155 _prev_end_offset = cur_offset + envelope_size;
4156 if 18 > max_ordinal {
4157 return Ok(());
4158 }
4159
4160 let cur_offset: usize = (18 - 1) * envelope_size;
4163
4164 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4166
4167 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4172 self.software_devices.as_ref().map(<fidl::encoding::Vector<SoftwareDevice, 20> as fidl::encoding::ValueTypeMarker>::borrow),
4173 encoder, offset + cur_offset, depth
4174 )?;
4175
4176 _prev_end_offset = cur_offset + envelope_size;
4177 if 19 > max_ordinal {
4178 return Ok(());
4179 }
4180
4181 let cur_offset: usize = (19 - 1) * envelope_size;
4184
4185 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4187
4188 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4193 self.boot_driver_components.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow),
4194 encoder, offset + cur_offset, depth
4195 )?;
4196
4197 _prev_end_offset = cur_offset + envelope_size;
4198 if 20 > max_ordinal {
4199 return Ok(());
4200 }
4201
4202 let cur_offset: usize = (20 - 1) * envelope_size;
4205
4206 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4208
4209 fidl::encoding::encode_in_envelope_optional::<
4214 fidl::encoding::HandleType<
4215 fidl::Vmo,
4216 { fidl::ObjectType::VMO.into_raw() },
4217 2147483648,
4218 >,
4219 fidl::encoding::DefaultFuchsiaResourceDialect,
4220 >(
4221 self.devicetree.as_mut().map(
4222 <fidl::encoding::HandleType<
4223 fidl::Vmo,
4224 { fidl::ObjectType::VMO.into_raw() },
4225 2147483648,
4226 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
4227 ),
4228 encoder,
4229 offset + cur_offset,
4230 depth,
4231 )?;
4232
4233 _prev_end_offset = cur_offset + envelope_size;
4234 if 21 > max_ordinal {
4235 return Ok(());
4236 }
4237
4238 let cur_offset: usize = (21 - 1) * envelope_size;
4241
4242 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4244
4245 fidl::encoding::encode_in_envelope_optional::<
4250 u32,
4251 fidl::encoding::DefaultFuchsiaResourceDialect,
4252 >(
4253 self.platform_vid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4254 encoder,
4255 offset + cur_offset,
4256 depth,
4257 )?;
4258
4259 _prev_end_offset = cur_offset + envelope_size;
4260 if 22 > max_ordinal {
4261 return Ok(());
4262 }
4263
4264 let cur_offset: usize = (22 - 1) * envelope_size;
4267
4268 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4270
4271 fidl::encoding::encode_in_envelope_optional::<
4276 u32,
4277 fidl::encoding::DefaultFuchsiaResourceDialect,
4278 >(
4279 self.platform_pid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4280 encoder,
4281 offset + cur_offset,
4282 depth,
4283 )?;
4284
4285 _prev_end_offset = cur_offset + envelope_size;
4286
4287 Ok(())
4288 }
4289 }
4290
4291 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RealmArgs {
4292 #[inline(always)]
4293 fn new_empty() -> Self {
4294 Self::default()
4295 }
4296
4297 unsafe fn decode(
4298 &mut self,
4299 decoder: &mut fidl::encoding::Decoder<
4300 '_,
4301 fidl::encoding::DefaultFuchsiaResourceDialect,
4302 >,
4303 offset: usize,
4304 mut depth: fidl::encoding::Depth,
4305 ) -> fidl::Result<()> {
4306 decoder.debug_check_bounds::<Self>(offset);
4307 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4308 None => return Err(fidl::Error::NotNullable),
4309 Some(len) => len,
4310 };
4311 if len == 0 {
4313 return Ok(());
4314 };
4315 depth.increment()?;
4316 let envelope_size = 8;
4317 let bytes_len = len * envelope_size;
4318 let offset = decoder.out_of_line_offset(bytes_len)?;
4319 let mut _next_ordinal_to_read = 0;
4321 let mut next_offset = offset;
4322 let end_offset = offset + bytes_len;
4323 _next_ordinal_to_read += 1;
4324 if next_offset >= end_offset {
4325 return Ok(());
4326 }
4327
4328 while _next_ordinal_to_read < 1 {
4330 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4331 _next_ordinal_to_read += 1;
4332 next_offset += envelope_size;
4333 }
4334
4335 let next_out_of_line = decoder.next_out_of_line();
4336 let handles_before = decoder.remaining_handles();
4337 if let Some((inlined, num_bytes, num_handles)) =
4338 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4339 {
4340 let member_inline_size = <fidl::encoding::Endpoint<
4341 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4342 > as fidl::encoding::TypeMarker>::inline_size(
4343 decoder.context
4344 );
4345 if inlined != (member_inline_size <= 4) {
4346 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4347 }
4348 let inner_offset;
4349 let mut inner_depth = depth.clone();
4350 if inlined {
4351 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4352 inner_offset = next_offset;
4353 } else {
4354 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4355 inner_depth.increment()?;
4356 }
4357 let val_ref = self.boot.get_or_insert_with(|| {
4358 fidl::new_empty!(
4359 fidl::encoding::Endpoint<
4360 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4361 >,
4362 fidl::encoding::DefaultFuchsiaResourceDialect
4363 )
4364 });
4365 fidl::decode!(
4366 fidl::encoding::Endpoint<
4367 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4368 >,
4369 fidl::encoding::DefaultFuchsiaResourceDialect,
4370 val_ref,
4371 decoder,
4372 inner_offset,
4373 inner_depth
4374 )?;
4375 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4376 {
4377 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4378 }
4379 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4380 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4381 }
4382 }
4383
4384 next_offset += envelope_size;
4385 _next_ordinal_to_read += 1;
4386 if next_offset >= end_offset {
4387 return Ok(());
4388 }
4389
4390 while _next_ordinal_to_read < 2 {
4392 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4393 _next_ordinal_to_read += 1;
4394 next_offset += envelope_size;
4395 }
4396
4397 let next_out_of_line = decoder.next_out_of_line();
4398 let handles_before = decoder.remaining_handles();
4399 if let Some((inlined, num_bytes, num_handles)) =
4400 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4401 {
4402 let member_inline_size =
4403 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4404 decoder.context,
4405 );
4406 if inlined != (member_inline_size <= 4) {
4407 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4408 }
4409 let inner_offset;
4410 let mut inner_depth = depth.clone();
4411 if inlined {
4412 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4413 inner_offset = next_offset;
4414 } else {
4415 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4416 inner_depth.increment()?;
4417 }
4418 let val_ref = self.root_driver.get_or_insert_with(|| {
4419 fidl::new_empty!(
4420 fidl::encoding::UnboundedString,
4421 fidl::encoding::DefaultFuchsiaResourceDialect
4422 )
4423 });
4424 fidl::decode!(
4425 fidl::encoding::UnboundedString,
4426 fidl::encoding::DefaultFuchsiaResourceDialect,
4427 val_ref,
4428 decoder,
4429 inner_offset,
4430 inner_depth
4431 )?;
4432 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4433 {
4434 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4435 }
4436 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4437 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4438 }
4439 }
4440
4441 next_offset += envelope_size;
4442 _next_ordinal_to_read += 1;
4443 if next_offset >= end_offset {
4444 return Ok(());
4445 }
4446
4447 while _next_ordinal_to_read < 4 {
4449 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4450 _next_ordinal_to_read += 1;
4451 next_offset += envelope_size;
4452 }
4453
4454 let next_out_of_line = decoder.next_out_of_line();
4455 let handles_before = decoder.remaining_handles();
4456 if let Some((inlined, num_bytes, num_handles)) =
4457 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4458 {
4459 let member_inline_size =
4460 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4461 if inlined != (member_inline_size <= 4) {
4462 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4463 }
4464 let inner_offset;
4465 let mut inner_depth = depth.clone();
4466 if inlined {
4467 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4468 inner_offset = next_offset;
4469 } else {
4470 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4471 inner_depth.increment()?;
4472 }
4473 let val_ref = self.driver_tests_enable_all.get_or_insert_with(|| {
4474 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
4475 });
4476 fidl::decode!(
4477 bool,
4478 fidl::encoding::DefaultFuchsiaResourceDialect,
4479 val_ref,
4480 decoder,
4481 inner_offset,
4482 inner_depth
4483 )?;
4484 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4485 {
4486 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4487 }
4488 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4489 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4490 }
4491 }
4492
4493 next_offset += envelope_size;
4494 _next_ordinal_to_read += 1;
4495 if next_offset >= end_offset {
4496 return Ok(());
4497 }
4498
4499 while _next_ordinal_to_read < 5 {
4501 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4502 _next_ordinal_to_read += 1;
4503 next_offset += envelope_size;
4504 }
4505
4506 let next_out_of_line = decoder.next_out_of_line();
4507 let handles_before = decoder.remaining_handles();
4508 if let Some((inlined, num_bytes, num_handles)) =
4509 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4510 {
4511 let member_inline_size = <fidl::encoding::UnboundedVector<
4512 fidl::encoding::UnboundedString,
4513 > as fidl::encoding::TypeMarker>::inline_size(
4514 decoder.context
4515 );
4516 if inlined != (member_inline_size <= 4) {
4517 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4518 }
4519 let inner_offset;
4520 let mut inner_depth = depth.clone();
4521 if inlined {
4522 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4523 inner_offset = next_offset;
4524 } else {
4525 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4526 inner_depth.increment()?;
4527 }
4528 let val_ref = self.driver_tests_enable.get_or_insert_with(|| {
4529 fidl::new_empty!(
4530 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4531 fidl::encoding::DefaultFuchsiaResourceDialect
4532 )
4533 });
4534 fidl::decode!(
4535 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4536 fidl::encoding::DefaultFuchsiaResourceDialect,
4537 val_ref,
4538 decoder,
4539 inner_offset,
4540 inner_depth
4541 )?;
4542 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4543 {
4544 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4545 }
4546 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4547 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4548 }
4549 }
4550
4551 next_offset += envelope_size;
4552 _next_ordinal_to_read += 1;
4553 if next_offset >= end_offset {
4554 return Ok(());
4555 }
4556
4557 while _next_ordinal_to_read < 6 {
4559 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4560 _next_ordinal_to_read += 1;
4561 next_offset += envelope_size;
4562 }
4563
4564 let next_out_of_line = decoder.next_out_of_line();
4565 let handles_before = decoder.remaining_handles();
4566 if let Some((inlined, num_bytes, num_handles)) =
4567 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4568 {
4569 let member_inline_size = <fidl::encoding::UnboundedVector<
4570 fidl::encoding::UnboundedString,
4571 > as fidl::encoding::TypeMarker>::inline_size(
4572 decoder.context
4573 );
4574 if inlined != (member_inline_size <= 4) {
4575 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4576 }
4577 let inner_offset;
4578 let mut inner_depth = depth.clone();
4579 if inlined {
4580 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4581 inner_offset = next_offset;
4582 } else {
4583 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4584 inner_depth.increment()?;
4585 }
4586 let val_ref = self.driver_tests_disable.get_or_insert_with(|| {
4587 fidl::new_empty!(
4588 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4589 fidl::encoding::DefaultFuchsiaResourceDialect
4590 )
4591 });
4592 fidl::decode!(
4593 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4594 fidl::encoding::DefaultFuchsiaResourceDialect,
4595 val_ref,
4596 decoder,
4597 inner_offset,
4598 inner_depth
4599 )?;
4600 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4601 {
4602 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4603 }
4604 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4605 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4606 }
4607 }
4608
4609 next_offset += envelope_size;
4610 _next_ordinal_to_read += 1;
4611 if next_offset >= end_offset {
4612 return Ok(());
4613 }
4614
4615 while _next_ordinal_to_read < 7 {
4617 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4618 _next_ordinal_to_read += 1;
4619 next_offset += envelope_size;
4620 }
4621
4622 let next_out_of_line = decoder.next_out_of_line();
4623 let handles_before = decoder.remaining_handles();
4624 if let Some((inlined, num_bytes, num_handles)) =
4625 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4626 {
4627 let member_inline_size = <fidl::encoding::UnboundedVector<DriverLog> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4628 if inlined != (member_inline_size <= 4) {
4629 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4630 }
4631 let inner_offset;
4632 let mut inner_depth = depth.clone();
4633 if inlined {
4634 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4635 inner_offset = next_offset;
4636 } else {
4637 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4638 inner_depth.increment()?;
4639 }
4640 let val_ref = self.driver_log_level.get_or_insert_with(|| {
4641 fidl::new_empty!(
4642 fidl::encoding::UnboundedVector<DriverLog>,
4643 fidl::encoding::DefaultFuchsiaResourceDialect
4644 )
4645 });
4646 fidl::decode!(
4647 fidl::encoding::UnboundedVector<DriverLog>,
4648 fidl::encoding::DefaultFuchsiaResourceDialect,
4649 val_ref,
4650 decoder,
4651 inner_offset,
4652 inner_depth
4653 )?;
4654 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4655 {
4656 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4657 }
4658 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4659 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4660 }
4661 }
4662
4663 next_offset += envelope_size;
4664 _next_ordinal_to_read += 1;
4665 if next_offset >= end_offset {
4666 return Ok(());
4667 }
4668
4669 while _next_ordinal_to_read < 8 {
4671 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4672 _next_ordinal_to_read += 1;
4673 next_offset += envelope_size;
4674 }
4675
4676 let next_out_of_line = decoder.next_out_of_line();
4677 let handles_before = decoder.remaining_handles();
4678 if let Some((inlined, num_bytes, num_handles)) =
4679 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4680 {
4681 let member_inline_size = <fidl::encoding::UnboundedVector<
4682 fidl::encoding::UnboundedString,
4683 > as fidl::encoding::TypeMarker>::inline_size(
4684 decoder.context
4685 );
4686 if inlined != (member_inline_size <= 4) {
4687 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4688 }
4689 let inner_offset;
4690 let mut inner_depth = depth.clone();
4691 if inlined {
4692 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4693 inner_offset = next_offset;
4694 } else {
4695 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4696 inner_depth.increment()?;
4697 }
4698 let val_ref = self.driver_disable.get_or_insert_with(|| {
4699 fidl::new_empty!(
4700 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4701 fidl::encoding::DefaultFuchsiaResourceDialect
4702 )
4703 });
4704 fidl::decode!(
4705 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4706 fidl::encoding::DefaultFuchsiaResourceDialect,
4707 val_ref,
4708 decoder,
4709 inner_offset,
4710 inner_depth
4711 )?;
4712 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4713 {
4714 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4715 }
4716 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4717 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4718 }
4719 }
4720
4721 next_offset += envelope_size;
4722 _next_ordinal_to_read += 1;
4723 if next_offset >= end_offset {
4724 return Ok(());
4725 }
4726
4727 while _next_ordinal_to_read < 9 {
4729 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4730 _next_ordinal_to_read += 1;
4731 next_offset += envelope_size;
4732 }
4733
4734 let next_out_of_line = decoder.next_out_of_line();
4735 let handles_before = decoder.remaining_handles();
4736 if let Some((inlined, num_bytes, num_handles)) =
4737 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4738 {
4739 let member_inline_size = <fidl::encoding::UnboundedVector<
4740 fidl::encoding::UnboundedString,
4741 > as fidl::encoding::TypeMarker>::inline_size(
4742 decoder.context
4743 );
4744 if inlined != (member_inline_size <= 4) {
4745 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4746 }
4747 let inner_offset;
4748 let mut inner_depth = depth.clone();
4749 if inlined {
4750 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4751 inner_offset = next_offset;
4752 } else {
4753 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4754 inner_depth.increment()?;
4755 }
4756 let val_ref = self.driver_bind_eager.get_or_insert_with(|| {
4757 fidl::new_empty!(
4758 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4759 fidl::encoding::DefaultFuchsiaResourceDialect
4760 )
4761 });
4762 fidl::decode!(
4763 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
4764 fidl::encoding::DefaultFuchsiaResourceDialect,
4765 val_ref,
4766 decoder,
4767 inner_offset,
4768 inner_depth
4769 )?;
4770 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4771 {
4772 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4773 }
4774 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4775 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4776 }
4777 }
4778
4779 next_offset += envelope_size;
4780 _next_ordinal_to_read += 1;
4781 if next_offset >= end_offset {
4782 return Ok(());
4783 }
4784
4785 while _next_ordinal_to_read < 10 {
4787 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4788 _next_ordinal_to_read += 1;
4789 next_offset += envelope_size;
4790 }
4791
4792 let next_out_of_line = decoder.next_out_of_line();
4793 let handles_before = decoder.remaining_handles();
4794 if let Some((inlined, num_bytes, num_handles)) =
4795 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4796 {
4797 let member_inline_size =
4798 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4799 decoder.context,
4800 );
4801 if inlined != (member_inline_size <= 4) {
4802 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4803 }
4804 let inner_offset;
4805 let mut inner_depth = depth.clone();
4806 if inlined {
4807 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4808 inner_offset = next_offset;
4809 } else {
4810 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4811 inner_depth.increment()?;
4812 }
4813 let val_ref = self.board_name.get_or_insert_with(|| {
4814 fidl::new_empty!(
4815 fidl::encoding::UnboundedString,
4816 fidl::encoding::DefaultFuchsiaResourceDialect
4817 )
4818 });
4819 fidl::decode!(
4820 fidl::encoding::UnboundedString,
4821 fidl::encoding::DefaultFuchsiaResourceDialect,
4822 val_ref,
4823 decoder,
4824 inner_offset,
4825 inner_depth
4826 )?;
4827 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4828 {
4829 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4830 }
4831 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4832 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4833 }
4834 }
4835
4836 next_offset += envelope_size;
4837 _next_ordinal_to_read += 1;
4838 if next_offset >= end_offset {
4839 return Ok(());
4840 }
4841
4842 while _next_ordinal_to_read < 11 {
4844 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4845 _next_ordinal_to_read += 1;
4846 next_offset += envelope_size;
4847 }
4848
4849 let next_out_of_line = decoder.next_out_of_line();
4850 let handles_before = decoder.remaining_handles();
4851 if let Some((inlined, num_bytes, num_handles)) =
4852 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4853 {
4854 let member_inline_size = <fidl::encoding::UnboundedVector<Offer> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4855 if inlined != (member_inline_size <= 4) {
4856 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4857 }
4858 let inner_offset;
4859 let mut inner_depth = depth.clone();
4860 if inlined {
4861 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4862 inner_offset = next_offset;
4863 } else {
4864 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4865 inner_depth.increment()?;
4866 }
4867 let val_ref = self.offers.get_or_insert_with(|| {
4868 fidl::new_empty!(
4869 fidl::encoding::UnboundedVector<Offer>,
4870 fidl::encoding::DefaultFuchsiaResourceDialect
4871 )
4872 });
4873 fidl::decode!(
4874 fidl::encoding::UnboundedVector<Offer>,
4875 fidl::encoding::DefaultFuchsiaResourceDialect,
4876 val_ref,
4877 decoder,
4878 inner_offset,
4879 inner_depth
4880 )?;
4881 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4882 {
4883 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4884 }
4885 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4886 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4887 }
4888 }
4889
4890 next_offset += envelope_size;
4891 _next_ordinal_to_read += 1;
4892 if next_offset >= end_offset {
4893 return Ok(());
4894 }
4895
4896 while _next_ordinal_to_read < 12 {
4898 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4899 _next_ordinal_to_read += 1;
4900 next_offset += envelope_size;
4901 }
4902
4903 let next_out_of_line = decoder.next_out_of_line();
4904 let handles_before = decoder.remaining_handles();
4905 if let Some((inlined, num_bytes, num_handles)) =
4906 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4907 {
4908 let member_inline_size = <fidl::encoding::UnboundedVector<Expose> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4909 if inlined != (member_inline_size <= 4) {
4910 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4911 }
4912 let inner_offset;
4913 let mut inner_depth = depth.clone();
4914 if inlined {
4915 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4916 inner_offset = next_offset;
4917 } else {
4918 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4919 inner_depth.increment()?;
4920 }
4921 let val_ref = self.exposes.get_or_insert_with(|| {
4922 fidl::new_empty!(
4923 fidl::encoding::UnboundedVector<Expose>,
4924 fidl::encoding::DefaultFuchsiaResourceDialect
4925 )
4926 });
4927 fidl::decode!(
4928 fidl::encoding::UnboundedVector<Expose>,
4929 fidl::encoding::DefaultFuchsiaResourceDialect,
4930 val_ref,
4931 decoder,
4932 inner_offset,
4933 inner_depth
4934 )?;
4935 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4936 {
4937 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4938 }
4939 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4940 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4941 }
4942 }
4943
4944 next_offset += envelope_size;
4945 _next_ordinal_to_read += 1;
4946 if next_offset >= end_offset {
4947 return Ok(());
4948 }
4949
4950 while _next_ordinal_to_read < 13 {
4952 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4953 _next_ordinal_to_read += 1;
4954 next_offset += envelope_size;
4955 }
4956
4957 let next_out_of_line = decoder.next_out_of_line();
4958 let handles_before = decoder.remaining_handles();
4959 if let Some((inlined, num_bytes, num_handles)) =
4960 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4961 {
4962 let member_inline_size = <fidl::encoding::Endpoint<
4963 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4964 > as fidl::encoding::TypeMarker>::inline_size(
4965 decoder.context
4966 );
4967 if inlined != (member_inline_size <= 4) {
4968 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4969 }
4970 let inner_offset;
4971 let mut inner_depth = depth.clone();
4972 if inlined {
4973 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4974 inner_offset = next_offset;
4975 } else {
4976 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4977 inner_depth.increment()?;
4978 }
4979 let val_ref = self.pkg.get_or_insert_with(|| {
4980 fidl::new_empty!(
4981 fidl::encoding::Endpoint<
4982 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4983 >,
4984 fidl::encoding::DefaultFuchsiaResourceDialect
4985 )
4986 });
4987 fidl::decode!(
4988 fidl::encoding::Endpoint<
4989 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4990 >,
4991 fidl::encoding::DefaultFuchsiaResourceDialect,
4992 val_ref,
4993 decoder,
4994 inner_offset,
4995 inner_depth
4996 )?;
4997 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4998 {
4999 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5000 }
5001 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5002 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5003 }
5004 }
5005
5006 next_offset += envelope_size;
5007 _next_ordinal_to_read += 1;
5008 if next_offset >= end_offset {
5009 return Ok(());
5010 }
5011
5012 while _next_ordinal_to_read < 14 {
5014 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5015 _next_ordinal_to_read += 1;
5016 next_offset += envelope_size;
5017 }
5018
5019 let next_out_of_line = decoder.next_out_of_line();
5020 let handles_before = decoder.remaining_handles();
5021 if let Some((inlined, num_bytes, num_handles)) =
5022 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5023 {
5024 let member_inline_size = <fidl::encoding::UnboundedVector<
5025 fidl_fuchsia_component_test::Capability,
5026 > as fidl::encoding::TypeMarker>::inline_size(
5027 decoder.context
5028 );
5029 if inlined != (member_inline_size <= 4) {
5030 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5031 }
5032 let inner_offset;
5033 let mut inner_depth = depth.clone();
5034 if inlined {
5035 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5036 inner_offset = next_offset;
5037 } else {
5038 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5039 inner_depth.increment()?;
5040 }
5041 let val_ref = self.dtr_offers.get_or_insert_with(|| {
5042 fidl::new_empty!(
5043 fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
5044 fidl::encoding::DefaultFuchsiaResourceDialect
5045 )
5046 });
5047 fidl::decode!(
5048 fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
5049 fidl::encoding::DefaultFuchsiaResourceDialect,
5050 val_ref,
5051 decoder,
5052 inner_offset,
5053 inner_depth
5054 )?;
5055 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5056 {
5057 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5058 }
5059 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5060 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5061 }
5062 }
5063
5064 next_offset += envelope_size;
5065 _next_ordinal_to_read += 1;
5066 if next_offset >= end_offset {
5067 return Ok(());
5068 }
5069
5070 while _next_ordinal_to_read < 15 {
5072 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5073 _next_ordinal_to_read += 1;
5074 next_offset += envelope_size;
5075 }
5076
5077 let next_out_of_line = decoder.next_out_of_line();
5078 let handles_before = decoder.remaining_handles();
5079 if let Some((inlined, num_bytes, num_handles)) =
5080 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5081 {
5082 let member_inline_size = <fidl::encoding::UnboundedVector<
5083 fidl_fuchsia_component_test::Capability,
5084 > as fidl::encoding::TypeMarker>::inline_size(
5085 decoder.context
5086 );
5087 if inlined != (member_inline_size <= 4) {
5088 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5089 }
5090 let inner_offset;
5091 let mut inner_depth = depth.clone();
5092 if inlined {
5093 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5094 inner_offset = next_offset;
5095 } else {
5096 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5097 inner_depth.increment()?;
5098 }
5099 let val_ref = self.dtr_exposes.get_or_insert_with(|| {
5100 fidl::new_empty!(
5101 fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
5102 fidl::encoding::DefaultFuchsiaResourceDialect
5103 )
5104 });
5105 fidl::decode!(
5106 fidl::encoding::UnboundedVector<fidl_fuchsia_component_test::Capability>,
5107 fidl::encoding::DefaultFuchsiaResourceDialect,
5108 val_ref,
5109 decoder,
5110 inner_offset,
5111 inner_depth
5112 )?;
5113 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5114 {
5115 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5116 }
5117 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5118 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5119 }
5120 }
5121
5122 next_offset += envelope_size;
5123 _next_ordinal_to_read += 1;
5124 if next_offset >= end_offset {
5125 return Ok(());
5126 }
5127
5128 while _next_ordinal_to_read < 16 {
5130 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5131 _next_ordinal_to_read += 1;
5132 next_offset += envelope_size;
5133 }
5134
5135 let next_out_of_line = decoder.next_out_of_line();
5136 let handles_before = decoder.remaining_handles();
5137 if let Some((inlined, num_bytes, num_handles)) =
5138 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5139 {
5140 let member_inline_size = <fidl_fuchsia_component_resolution::Component as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5141 if inlined != (member_inline_size <= 4) {
5142 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5143 }
5144 let inner_offset;
5145 let mut inner_depth = depth.clone();
5146 if inlined {
5147 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5148 inner_offset = next_offset;
5149 } else {
5150 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5151 inner_depth.increment()?;
5152 }
5153 let val_ref = self.test_component.get_or_insert_with(|| {
5154 fidl::new_empty!(
5155 fidl_fuchsia_component_resolution::Component,
5156 fidl::encoding::DefaultFuchsiaResourceDialect
5157 )
5158 });
5159 fidl::decode!(
5160 fidl_fuchsia_component_resolution::Component,
5161 fidl::encoding::DefaultFuchsiaResourceDialect,
5162 val_ref,
5163 decoder,
5164 inner_offset,
5165 inner_depth
5166 )?;
5167 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5168 {
5169 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5170 }
5171 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5172 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5173 }
5174 }
5175
5176 next_offset += envelope_size;
5177 _next_ordinal_to_read += 1;
5178 if next_offset >= end_offset {
5179 return Ok(());
5180 }
5181
5182 while _next_ordinal_to_read < 17 {
5184 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5185 _next_ordinal_to_read += 1;
5186 next_offset += envelope_size;
5187 }
5188
5189 let next_out_of_line = decoder.next_out_of_line();
5190 let handles_before = decoder.remaining_handles();
5191 if let Some((inlined, num_bytes, num_handles)) =
5192 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5193 {
5194 let member_inline_size =
5195 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5196 if inlined != (member_inline_size <= 4) {
5197 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5198 }
5199 let inner_offset;
5200 let mut inner_depth = depth.clone();
5201 if inlined {
5202 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5203 inner_offset = next_offset;
5204 } else {
5205 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5206 inner_depth.increment()?;
5207 }
5208 let val_ref = self.driver_index_stop_timeout_millis.get_or_insert_with(|| {
5209 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
5210 });
5211 fidl::decode!(
5212 i64,
5213 fidl::encoding::DefaultFuchsiaResourceDialect,
5214 val_ref,
5215 decoder,
5216 inner_offset,
5217 inner_depth
5218 )?;
5219 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5220 {
5221 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5222 }
5223 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5224 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5225 }
5226 }
5227
5228 next_offset += envelope_size;
5229 _next_ordinal_to_read += 1;
5230 if next_offset >= end_offset {
5231 return Ok(());
5232 }
5233
5234 while _next_ordinal_to_read < 18 {
5236 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5237 _next_ordinal_to_read += 1;
5238 next_offset += envelope_size;
5239 }
5240
5241 let next_out_of_line = decoder.next_out_of_line();
5242 let handles_before = decoder.remaining_handles();
5243 if let Some((inlined, num_bytes, num_handles)) =
5244 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5245 {
5246 let member_inline_size = <fidl::encoding::Vector<SoftwareDevice, 20> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5247 if inlined != (member_inline_size <= 4) {
5248 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5249 }
5250 let inner_offset;
5251 let mut inner_depth = depth.clone();
5252 if inlined {
5253 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5254 inner_offset = next_offset;
5255 } else {
5256 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5257 inner_depth.increment()?;
5258 }
5259 let val_ref =
5260 self.software_devices.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect));
5261 fidl::decode!(fidl::encoding::Vector<SoftwareDevice, 20>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5262 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5263 {
5264 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5265 }
5266 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5267 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5268 }
5269 }
5270
5271 next_offset += envelope_size;
5272 _next_ordinal_to_read += 1;
5273 if next_offset >= end_offset {
5274 return Ok(());
5275 }
5276
5277 while _next_ordinal_to_read < 19 {
5279 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5280 _next_ordinal_to_read += 1;
5281 next_offset += envelope_size;
5282 }
5283
5284 let next_out_of_line = decoder.next_out_of_line();
5285 let handles_before = decoder.remaining_handles();
5286 if let Some((inlined, num_bytes, num_handles)) =
5287 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5288 {
5289 let member_inline_size = <fidl::encoding::UnboundedVector<
5290 fidl::encoding::UnboundedString,
5291 > as fidl::encoding::TypeMarker>::inline_size(
5292 decoder.context
5293 );
5294 if inlined != (member_inline_size <= 4) {
5295 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5296 }
5297 let inner_offset;
5298 let mut inner_depth = depth.clone();
5299 if inlined {
5300 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5301 inner_offset = next_offset;
5302 } else {
5303 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5304 inner_depth.increment()?;
5305 }
5306 let val_ref = self.boot_driver_components.get_or_insert_with(|| {
5307 fidl::new_empty!(
5308 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
5309 fidl::encoding::DefaultFuchsiaResourceDialect
5310 )
5311 });
5312 fidl::decode!(
5313 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
5314 fidl::encoding::DefaultFuchsiaResourceDialect,
5315 val_ref,
5316 decoder,
5317 inner_offset,
5318 inner_depth
5319 )?;
5320 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5321 {
5322 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5323 }
5324 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5325 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5326 }
5327 }
5328
5329 next_offset += envelope_size;
5330 _next_ordinal_to_read += 1;
5331 if next_offset >= end_offset {
5332 return Ok(());
5333 }
5334
5335 while _next_ordinal_to_read < 20 {
5337 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5338 _next_ordinal_to_read += 1;
5339 next_offset += envelope_size;
5340 }
5341
5342 let next_out_of_line = decoder.next_out_of_line();
5343 let handles_before = decoder.remaining_handles();
5344 if let Some((inlined, num_bytes, num_handles)) =
5345 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5346 {
5347 let member_inline_size = <fidl::encoding::HandleType<
5348 fidl::Vmo,
5349 { fidl::ObjectType::VMO.into_raw() },
5350 2147483648,
5351 > as fidl::encoding::TypeMarker>::inline_size(
5352 decoder.context
5353 );
5354 if inlined != (member_inline_size <= 4) {
5355 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5356 }
5357 let inner_offset;
5358 let mut inner_depth = depth.clone();
5359 if inlined {
5360 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5361 inner_offset = next_offset;
5362 } else {
5363 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5364 inner_depth.increment()?;
5365 }
5366 let val_ref =
5367 self.devicetree.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
5368 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5369 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5370 {
5371 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5372 }
5373 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5374 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5375 }
5376 }
5377
5378 next_offset += envelope_size;
5379 _next_ordinal_to_read += 1;
5380 if next_offset >= end_offset {
5381 return Ok(());
5382 }
5383
5384 while _next_ordinal_to_read < 21 {
5386 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5387 _next_ordinal_to_read += 1;
5388 next_offset += envelope_size;
5389 }
5390
5391 let next_out_of_line = decoder.next_out_of_line();
5392 let handles_before = decoder.remaining_handles();
5393 if let Some((inlined, num_bytes, num_handles)) =
5394 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5395 {
5396 let member_inline_size =
5397 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5398 if inlined != (member_inline_size <= 4) {
5399 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5400 }
5401 let inner_offset;
5402 let mut inner_depth = depth.clone();
5403 if inlined {
5404 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5405 inner_offset = next_offset;
5406 } else {
5407 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5408 inner_depth.increment()?;
5409 }
5410 let val_ref = self.platform_vid.get_or_insert_with(|| {
5411 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
5412 });
5413 fidl::decode!(
5414 u32,
5415 fidl::encoding::DefaultFuchsiaResourceDialect,
5416 val_ref,
5417 decoder,
5418 inner_offset,
5419 inner_depth
5420 )?;
5421 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5422 {
5423 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5424 }
5425 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5426 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5427 }
5428 }
5429
5430 next_offset += envelope_size;
5431 _next_ordinal_to_read += 1;
5432 if next_offset >= end_offset {
5433 return Ok(());
5434 }
5435
5436 while _next_ordinal_to_read < 22 {
5438 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5439 _next_ordinal_to_read += 1;
5440 next_offset += envelope_size;
5441 }
5442
5443 let next_out_of_line = decoder.next_out_of_line();
5444 let handles_before = decoder.remaining_handles();
5445 if let Some((inlined, num_bytes, num_handles)) =
5446 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5447 {
5448 let member_inline_size =
5449 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5450 if inlined != (member_inline_size <= 4) {
5451 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5452 }
5453 let inner_offset;
5454 let mut inner_depth = depth.clone();
5455 if inlined {
5456 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5457 inner_offset = next_offset;
5458 } else {
5459 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5460 inner_depth.increment()?;
5461 }
5462 let val_ref = self.platform_pid.get_or_insert_with(|| {
5463 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
5464 });
5465 fidl::decode!(
5466 u32,
5467 fidl::encoding::DefaultFuchsiaResourceDialect,
5468 val_ref,
5469 decoder,
5470 inner_offset,
5471 inner_depth
5472 )?;
5473 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5474 {
5475 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5476 }
5477 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5478 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5479 }
5480 }
5481
5482 next_offset += envelope_size;
5483
5484 while next_offset < end_offset {
5486 _next_ordinal_to_read += 1;
5487 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5488 next_offset += envelope_size;
5489 }
5490
5491 Ok(())
5492 }
5493 }
5494}