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