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