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