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_test_manager_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct DebugDataIteratorGetNextCompressedResponse {
16 pub data: Vec<DebugData>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for DebugDataIteratorGetNextCompressedResponse
21{
22}
23
24#[derive(Debug, PartialEq)]
25pub struct DebugDataIteratorGetNextResponse {
26 pub data: Vec<DebugData>,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for DebugDataIteratorGetNextResponse
31{
32}
33
34#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
40pub struct DirectoryAndToken {
41 pub directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
44 pub token: fidl::EventPair,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryAndToken {}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct EarlyBootProfileRegisterWatcherRequest {
53 pub iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
54}
55
56impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
57 for EarlyBootProfileRegisterWatcherRequest
58{
59}
60
61#[derive(Debug, PartialEq)]
62pub struct SuiteControllerWatchEventsResponse {
63 pub events: Vec<Event>,
64}
65
66impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
67 for SuiteControllerWatchEventsResponse
68{
69}
70
71#[derive(Debug, PartialEq)]
72pub struct SuiteRunnerRunRequest {
73 pub test_suite_url: String,
75 pub options: RunSuiteOptions,
77 pub controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
80}
81
82impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SuiteRunnerRunRequest {}
83
84#[derive(Debug, PartialEq)]
85pub struct TestCaseEnumeratorEnumerateRequest {
86 pub test_suite_url: String,
88 pub options: EnumerateTestCasesOptions,
90 pub iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
92}
93
94impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
95 for TestCaseEnumeratorEnumerateRequest
96{
97}
98
99#[derive(Debug, Default, PartialEq)]
101pub struct CustomArtifact {
102 pub component_moniker: Option<String>,
105 pub directory_and_token: Option<DirectoryAndToken>,
107 #[doc(hidden)]
108 pub __source_breaking: fidl::marker::SourceBreaking,
109}
110
111impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CustomArtifact {}
112
113#[derive(Debug, Default, PartialEq)]
115pub struct DebugData {
116 pub name: Option<String>,
118 pub socket: Option<fidl::Socket>,
120 #[doc(hidden)]
121 pub __source_breaking: fidl::marker::SourceBreaking,
122}
123
124impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DebugData {}
125
126#[derive(Debug, Default, PartialEq)]
128pub struct EnumerateTestCasesOptions {
129 pub realm_options: Option<RealmOptions>,
133 #[doc(hidden)]
134 pub __source_breaking: fidl::marker::SourceBreaking,
135}
136
137impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EnumerateTestCasesOptions {}
138
139#[derive(Debug, Default, PartialEq)]
141pub struct Event {
142 pub timestamp: Option<i64>,
144 pub details: Option<EventDetails>,
146 #[doc(hidden)]
147 pub __source_breaking: fidl::marker::SourceBreaking,
148}
149
150impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Event {}
151
152#[derive(Debug, Default, PartialEq)]
158pub struct RealmOptions {
159 pub realm: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>>,
161 pub offers: Option<Vec<fidl_fuchsia_component_decl::Offer>>,
163 pub test_collection: Option<String>,
165 #[doc(hidden)]
166 pub __source_breaking: fidl::marker::SourceBreaking,
167}
168
169impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmOptions {}
170
171#[derive(Debug, Default, PartialEq)]
173pub struct RunSuiteOptions {
174 pub realm_options: Option<RealmOptions>,
178 pub run_disabled_tests: Option<bool>,
181 pub max_concurrent_test_case_runs: Option<u16>,
184 pub arguments: Option<Vec<String>>,
187 pub timeout: Option<i64>,
190 pub test_case_filters: Option<Vec<String>>,
204 pub logs_iterator_type: Option<LogsIteratorType>,
207 pub log_interest: Option<Vec<fidl_fuchsia_diagnostics::LogInterestSelector>>,
210 pub accumulate_debug_data: Option<bool>,
217 pub no_exception_channel: Option<bool>,
221 pub break_on_failure: Option<bool>,
226 #[doc(hidden)]
227 pub __source_breaking: fidl::marker::SourceBreaking,
228}
229
230impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RunSuiteOptions {}
231
232#[derive(Debug, Default, PartialEq)]
234pub struct SuiteArtifactGeneratedEventDetails {
235 pub artifact: Option<Artifact>,
237 #[doc(hidden)]
238 pub __source_breaking: fidl::marker::SourceBreaking,
239}
240
241impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
242 for SuiteArtifactGeneratedEventDetails
243{
244}
245
246#[derive(Debug, Default, PartialEq)]
248pub struct TestCaseArtifactGeneratedEventDetails {
249 pub test_case_id: Option<u32>,
252 pub artifact: Option<Artifact>,
254 #[doc(hidden)]
255 pub __source_breaking: fidl::marker::SourceBreaking,
256}
257
258impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
259 for TestCaseArtifactGeneratedEventDetails
260{
261}
262
263#[derive(Debug)]
265pub enum Artifact {
266 Stdout(fidl::Socket),
269 Stderr(fidl::Socket),
272 Log(Syslog),
275 Custom(CustomArtifact),
277 DebugData(fidl::endpoints::ClientEnd<DebugDataIteratorMarker>),
279 #[doc(hidden)]
280 __SourceBreaking { unknown_ordinal: u64 },
281}
282
283#[macro_export]
285macro_rules! ArtifactUnknown {
286 () => {
287 _
288 };
289}
290
291impl PartialEq for Artifact {
293 fn eq(&self, other: &Self) -> bool {
294 match (self, other) {
295 (Self::Stdout(x), Self::Stdout(y)) => *x == *y,
296 (Self::Stderr(x), Self::Stderr(y)) => *x == *y,
297 (Self::Log(x), Self::Log(y)) => *x == *y,
298 (Self::Custom(x), Self::Custom(y)) => *x == *y,
299 (Self::DebugData(x), Self::DebugData(y)) => *x == *y,
300 _ => false,
301 }
302 }
303}
304
305impl Artifact {
306 #[inline]
307 pub fn ordinal(&self) -> u64 {
308 match *self {
309 Self::Stdout(_) => 1,
310 Self::Stderr(_) => 2,
311 Self::Log(_) => 3,
312 Self::Custom(_) => 4,
313 Self::DebugData(_) => 5,
314 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
315 }
316 }
317
318 #[inline]
319 pub fn unknown_variant_for_testing() -> Self {
320 Self::__SourceBreaking { unknown_ordinal: 0 }
321 }
322
323 #[inline]
324 pub fn is_unknown(&self) -> bool {
325 match self {
326 Self::__SourceBreaking { .. } => true,
327 _ => false,
328 }
329 }
330}
331
332impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Artifact {}
333
334#[derive(Debug)]
357pub enum EventDetails {
358 SuiteStarted(SuiteStartedEventDetails),
360 TestCaseFound(TestCaseFoundEventDetails),
362 TestCaseStarted(TestCaseStartedEventDetails),
366 TestCaseArtifactGenerated(TestCaseArtifactGeneratedEventDetails),
369 TestCaseStopped(TestCaseStoppedEventDetails),
372 TestCaseFinished(TestCaseFinishedEventDetails),
375 SuiteArtifactGenerated(SuiteArtifactGeneratedEventDetails),
377 SuiteStopped(SuiteStoppedEventDetails),
380 #[doc(hidden)]
381 __SourceBreaking { unknown_ordinal: u64 },
382}
383
384#[macro_export]
386macro_rules! EventDetailsUnknown {
387 () => {
388 _
389 };
390}
391
392impl PartialEq for EventDetails {
394 fn eq(&self, other: &Self) -> bool {
395 match (self, other) {
396 (Self::SuiteStarted(x), Self::SuiteStarted(y)) => *x == *y,
397 (Self::TestCaseFound(x), Self::TestCaseFound(y)) => *x == *y,
398 (Self::TestCaseStarted(x), Self::TestCaseStarted(y)) => *x == *y,
399 (Self::TestCaseArtifactGenerated(x), Self::TestCaseArtifactGenerated(y)) => *x == *y,
400 (Self::TestCaseStopped(x), Self::TestCaseStopped(y)) => *x == *y,
401 (Self::TestCaseFinished(x), Self::TestCaseFinished(y)) => *x == *y,
402 (Self::SuiteArtifactGenerated(x), Self::SuiteArtifactGenerated(y)) => *x == *y,
403 (Self::SuiteStopped(x), Self::SuiteStopped(y)) => *x == *y,
404 _ => false,
405 }
406 }
407}
408
409impl EventDetails {
410 #[inline]
411 pub fn ordinal(&self) -> u64 {
412 match *self {
413 Self::SuiteStarted(_) => 1,
414 Self::TestCaseFound(_) => 2,
415 Self::TestCaseStarted(_) => 3,
416 Self::TestCaseArtifactGenerated(_) => 4,
417 Self::TestCaseStopped(_) => 5,
418 Self::TestCaseFinished(_) => 6,
419 Self::SuiteArtifactGenerated(_) => 7,
420 Self::SuiteStopped(_) => 8,
421 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
422 }
423 }
424
425 #[inline]
426 pub fn unknown_variant_for_testing() -> Self {
427 Self::__SourceBreaking { unknown_ordinal: 0 }
428 }
429
430 #[inline]
431 pub fn is_unknown(&self) -> bool {
432 match self {
433 Self::__SourceBreaking { .. } => true,
434 _ => false,
435 }
436 }
437}
438
439impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EventDetails {}
440
441#[derive(Debug)]
443pub enum LogsIterator {
444 Batch(fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>),
446 Stream(fidl::Socket),
449 #[doc(hidden)]
450 __SourceBreaking { unknown_ordinal: u64 },
451}
452
453#[macro_export]
455macro_rules! LogsIteratorUnknown {
456 () => {
457 _
458 };
459}
460
461impl PartialEq for LogsIterator {
463 fn eq(&self, other: &Self) -> bool {
464 match (self, other) {
465 (Self::Batch(x), Self::Batch(y)) => *x == *y,
466 (Self::Stream(x), Self::Stream(y)) => *x == *y,
467 _ => false,
468 }
469 }
470}
471
472impl LogsIterator {
473 #[inline]
474 pub fn ordinal(&self) -> u64 {
475 match *self {
476 Self::Batch(_) => 2,
477 Self::Stream(_) => 3,
478 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
479 }
480 }
481
482 #[inline]
483 pub fn unknown_variant_for_testing() -> Self {
484 Self::__SourceBreaking { unknown_ordinal: 0 }
485 }
486
487 #[inline]
488 pub fn is_unknown(&self) -> bool {
489 match self {
490 Self::__SourceBreaking { .. } => true,
491 _ => false,
492 }
493 }
494}
495
496impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LogsIterator {}
497
498#[derive(Debug)]
500pub enum Syslog {
501 Batch(fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>),
503 Stream(fidl::Socket),
505 #[doc(hidden)]
506 __SourceBreaking { unknown_ordinal: u64 },
507}
508
509#[macro_export]
511macro_rules! SyslogUnknown {
512 () => {
513 _
514 };
515}
516
517impl PartialEq for Syslog {
519 fn eq(&self, other: &Self) -> bool {
520 match (self, other) {
521 (Self::Batch(x), Self::Batch(y)) => *x == *y,
522 (Self::Stream(x), Self::Stream(y)) => *x == *y,
523 _ => false,
524 }
525 }
526}
527
528impl Syslog {
529 #[inline]
530 pub fn ordinal(&self) -> u64 {
531 match *self {
532 Self::Batch(_) => 2,
533 Self::Stream(_) => 3,
534 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
535 }
536 }
537
538 #[inline]
539 pub fn unknown_variant_for_testing() -> Self {
540 Self::__SourceBreaking { unknown_ordinal: 0 }
541 }
542
543 #[inline]
544 pub fn is_unknown(&self) -> bool {
545 match self {
546 Self::__SourceBreaking { .. } => true,
547 _ => false,
548 }
549 }
550}
551
552impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Syslog {}
553
554#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
555pub struct DebugDataIteratorMarker;
556
557impl fidl::endpoints::ProtocolMarker for DebugDataIteratorMarker {
558 type Proxy = DebugDataIteratorProxy;
559 type RequestStream = DebugDataIteratorRequestStream;
560 #[cfg(target_os = "fuchsia")]
561 type SynchronousProxy = DebugDataIteratorSynchronousProxy;
562
563 const DEBUG_NAME: &'static str = "(anonymous) DebugDataIterator";
564}
565
566pub trait DebugDataIteratorProxyInterface: Send + Sync {
567 type GetNextResponseFut: std::future::Future<Output = Result<Vec<DebugData>, fidl::Error>>
568 + Send;
569 fn r#get_next(&self) -> Self::GetNextResponseFut;
570 type GetNextCompressedResponseFut: std::future::Future<Output = Result<Vec<DebugData>, fidl::Error>>
571 + Send;
572 fn r#get_next_compressed(&self) -> Self::GetNextCompressedResponseFut;
573}
574#[derive(Debug)]
575#[cfg(target_os = "fuchsia")]
576pub struct DebugDataIteratorSynchronousProxy {
577 client: fidl::client::sync::Client,
578}
579
580#[cfg(target_os = "fuchsia")]
581impl fidl::endpoints::SynchronousProxy for DebugDataIteratorSynchronousProxy {
582 type Proxy = DebugDataIteratorProxy;
583 type Protocol = DebugDataIteratorMarker;
584
585 fn from_channel(inner: fidl::Channel) -> Self {
586 Self::new(inner)
587 }
588
589 fn into_channel(self) -> fidl::Channel {
590 self.client.into_channel()
591 }
592
593 fn as_channel(&self) -> &fidl::Channel {
594 self.client.as_channel()
595 }
596}
597
598#[cfg(target_os = "fuchsia")]
599impl DebugDataIteratorSynchronousProxy {
600 pub fn new(channel: fidl::Channel) -> Self {
601 Self { client: fidl::client::sync::Client::new(channel) }
602 }
603
604 pub fn into_channel(self) -> fidl::Channel {
605 self.client.into_channel()
606 }
607
608 pub fn wait_for_event(
611 &self,
612 deadline: zx::MonotonicInstant,
613 ) -> Result<DebugDataIteratorEvent, fidl::Error> {
614 DebugDataIteratorEvent::decode(
615 self.client.wait_for_event::<DebugDataIteratorMarker>(deadline)?,
616 )
617 }
618
619 pub fn r#get_next(
623 &self,
624 ___deadline: zx::MonotonicInstant,
625 ) -> Result<Vec<DebugData>, fidl::Error> {
626 let _response = self.client.send_query::<
627 fidl::encoding::EmptyPayload,
628 DebugDataIteratorGetNextResponse,
629 DebugDataIteratorMarker,
630 >(
631 (),
632 0x9ef24c823f5ad60,
633 fidl::encoding::DynamicFlags::empty(),
634 ___deadline,
635 )?;
636 Ok(_response.data)
637 }
638
639 pub fn r#get_next_compressed(
643 &self,
644 ___deadline: zx::MonotonicInstant,
645 ) -> Result<Vec<DebugData>, fidl::Error> {
646 let _response = self.client.send_query::<
647 fidl::encoding::EmptyPayload,
648 DebugDataIteratorGetNextCompressedResponse,
649 DebugDataIteratorMarker,
650 >(
651 (),
652 0x6765e9cb918301f4,
653 fidl::encoding::DynamicFlags::empty(),
654 ___deadline,
655 )?;
656 Ok(_response.data)
657 }
658}
659
660#[cfg(target_os = "fuchsia")]
661impl From<DebugDataIteratorSynchronousProxy> for zx::NullableHandle {
662 fn from(value: DebugDataIteratorSynchronousProxy) -> Self {
663 value.into_channel().into()
664 }
665}
666
667#[cfg(target_os = "fuchsia")]
668impl From<fidl::Channel> for DebugDataIteratorSynchronousProxy {
669 fn from(value: fidl::Channel) -> Self {
670 Self::new(value)
671 }
672}
673
674#[cfg(target_os = "fuchsia")]
675impl fidl::endpoints::FromClient for DebugDataIteratorSynchronousProxy {
676 type Protocol = DebugDataIteratorMarker;
677
678 fn from_client(value: fidl::endpoints::ClientEnd<DebugDataIteratorMarker>) -> Self {
679 Self::new(value.into_channel())
680 }
681}
682
683#[derive(Debug, Clone)]
684pub struct DebugDataIteratorProxy {
685 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
686}
687
688impl fidl::endpoints::Proxy for DebugDataIteratorProxy {
689 type Protocol = DebugDataIteratorMarker;
690
691 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
692 Self::new(inner)
693 }
694
695 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
696 self.client.into_channel().map_err(|client| Self { client })
697 }
698
699 fn as_channel(&self) -> &::fidl::AsyncChannel {
700 self.client.as_channel()
701 }
702}
703
704impl DebugDataIteratorProxy {
705 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
707 let protocol_name =
708 <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
709 Self { client: fidl::client::Client::new(channel, protocol_name) }
710 }
711
712 pub fn take_event_stream(&self) -> DebugDataIteratorEventStream {
718 DebugDataIteratorEventStream { event_receiver: self.client.take_event_receiver() }
719 }
720
721 pub fn r#get_next(
725 &self,
726 ) -> fidl::client::QueryResponseFut<Vec<DebugData>, fidl::encoding::DefaultFuchsiaResourceDialect>
727 {
728 DebugDataIteratorProxyInterface::r#get_next(self)
729 }
730
731 pub fn r#get_next_compressed(
735 &self,
736 ) -> fidl::client::QueryResponseFut<Vec<DebugData>, fidl::encoding::DefaultFuchsiaResourceDialect>
737 {
738 DebugDataIteratorProxyInterface::r#get_next_compressed(self)
739 }
740}
741
742impl DebugDataIteratorProxyInterface for DebugDataIteratorProxy {
743 type GetNextResponseFut = fidl::client::QueryResponseFut<
744 Vec<DebugData>,
745 fidl::encoding::DefaultFuchsiaResourceDialect,
746 >;
747 fn r#get_next(&self) -> Self::GetNextResponseFut {
748 fn _decode(
749 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
750 ) -> Result<Vec<DebugData>, fidl::Error> {
751 let _response = fidl::client::decode_transaction_body::<
752 DebugDataIteratorGetNextResponse,
753 fidl::encoding::DefaultFuchsiaResourceDialect,
754 0x9ef24c823f5ad60,
755 >(_buf?)?;
756 Ok(_response.data)
757 }
758 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<DebugData>>(
759 (),
760 0x9ef24c823f5ad60,
761 fidl::encoding::DynamicFlags::empty(),
762 _decode,
763 )
764 }
765
766 type GetNextCompressedResponseFut = fidl::client::QueryResponseFut<
767 Vec<DebugData>,
768 fidl::encoding::DefaultFuchsiaResourceDialect,
769 >;
770 fn r#get_next_compressed(&self) -> Self::GetNextCompressedResponseFut {
771 fn _decode(
772 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
773 ) -> Result<Vec<DebugData>, fidl::Error> {
774 let _response = fidl::client::decode_transaction_body::<
775 DebugDataIteratorGetNextCompressedResponse,
776 fidl::encoding::DefaultFuchsiaResourceDialect,
777 0x6765e9cb918301f4,
778 >(_buf?)?;
779 Ok(_response.data)
780 }
781 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<DebugData>>(
782 (),
783 0x6765e9cb918301f4,
784 fidl::encoding::DynamicFlags::empty(),
785 _decode,
786 )
787 }
788}
789
790pub struct DebugDataIteratorEventStream {
791 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
792}
793
794impl std::marker::Unpin for DebugDataIteratorEventStream {}
795
796impl futures::stream::FusedStream for DebugDataIteratorEventStream {
797 fn is_terminated(&self) -> bool {
798 self.event_receiver.is_terminated()
799 }
800}
801
802impl futures::Stream for DebugDataIteratorEventStream {
803 type Item = Result<DebugDataIteratorEvent, fidl::Error>;
804
805 fn poll_next(
806 mut self: std::pin::Pin<&mut Self>,
807 cx: &mut std::task::Context<'_>,
808 ) -> std::task::Poll<Option<Self::Item>> {
809 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
810 &mut self.event_receiver,
811 cx
812 )?) {
813 Some(buf) => std::task::Poll::Ready(Some(DebugDataIteratorEvent::decode(buf))),
814 None => std::task::Poll::Ready(None),
815 }
816 }
817}
818
819#[derive(Debug)]
820pub enum DebugDataIteratorEvent {}
821
822impl DebugDataIteratorEvent {
823 fn decode(
825 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
826 ) -> Result<DebugDataIteratorEvent, fidl::Error> {
827 let (bytes, _handles) = buf.split_mut();
828 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
829 debug_assert_eq!(tx_header.tx_id, 0);
830 match tx_header.ordinal {
831 _ => Err(fidl::Error::UnknownOrdinal {
832 ordinal: tx_header.ordinal,
833 protocol_name:
834 <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
835 }),
836 }
837 }
838}
839
840pub struct DebugDataIteratorRequestStream {
842 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
843 is_terminated: bool,
844}
845
846impl std::marker::Unpin for DebugDataIteratorRequestStream {}
847
848impl futures::stream::FusedStream for DebugDataIteratorRequestStream {
849 fn is_terminated(&self) -> bool {
850 self.is_terminated
851 }
852}
853
854impl fidl::endpoints::RequestStream for DebugDataIteratorRequestStream {
855 type Protocol = DebugDataIteratorMarker;
856 type ControlHandle = DebugDataIteratorControlHandle;
857
858 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
859 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
860 }
861
862 fn control_handle(&self) -> Self::ControlHandle {
863 DebugDataIteratorControlHandle { inner: self.inner.clone() }
864 }
865
866 fn into_inner(
867 self,
868 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
869 {
870 (self.inner, self.is_terminated)
871 }
872
873 fn from_inner(
874 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
875 is_terminated: bool,
876 ) -> Self {
877 Self { inner, is_terminated }
878 }
879}
880
881impl futures::Stream for DebugDataIteratorRequestStream {
882 type Item = Result<DebugDataIteratorRequest, fidl::Error>;
883
884 fn poll_next(
885 mut self: std::pin::Pin<&mut Self>,
886 cx: &mut std::task::Context<'_>,
887 ) -> std::task::Poll<Option<Self::Item>> {
888 let this = &mut *self;
889 if this.inner.check_shutdown(cx) {
890 this.is_terminated = true;
891 return std::task::Poll::Ready(None);
892 }
893 if this.is_terminated {
894 panic!("polled DebugDataIteratorRequestStream after completion");
895 }
896 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
897 |bytes, handles| {
898 match this.inner.channel().read_etc(cx, bytes, handles) {
899 std::task::Poll::Ready(Ok(())) => {}
900 std::task::Poll::Pending => return std::task::Poll::Pending,
901 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
902 this.is_terminated = true;
903 return std::task::Poll::Ready(None);
904 }
905 std::task::Poll::Ready(Err(e)) => {
906 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
907 e.into(),
908 ))));
909 }
910 }
911
912 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
914
915 std::task::Poll::Ready(Some(match header.ordinal {
916 0x9ef24c823f5ad60 => {
917 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
918 let mut req = fidl::new_empty!(
919 fidl::encoding::EmptyPayload,
920 fidl::encoding::DefaultFuchsiaResourceDialect
921 );
922 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
923 let control_handle =
924 DebugDataIteratorControlHandle { inner: this.inner.clone() };
925 Ok(DebugDataIteratorRequest::GetNext {
926 responder: DebugDataIteratorGetNextResponder {
927 control_handle: std::mem::ManuallyDrop::new(control_handle),
928 tx_id: header.tx_id,
929 },
930 })
931 }
932 0x6765e9cb918301f4 => {
933 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
934 let mut req = fidl::new_empty!(
935 fidl::encoding::EmptyPayload,
936 fidl::encoding::DefaultFuchsiaResourceDialect
937 );
938 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
939 let control_handle =
940 DebugDataIteratorControlHandle { inner: this.inner.clone() };
941 Ok(DebugDataIteratorRequest::GetNextCompressed {
942 responder: DebugDataIteratorGetNextCompressedResponder {
943 control_handle: std::mem::ManuallyDrop::new(control_handle),
944 tx_id: header.tx_id,
945 },
946 })
947 }
948 _ => Err(fidl::Error::UnknownOrdinal {
949 ordinal: header.ordinal,
950 protocol_name:
951 <DebugDataIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
952 }),
953 }))
954 },
955 )
956 }
957}
958
959#[derive(Debug)]
961pub enum DebugDataIteratorRequest {
962 GetNext { responder: DebugDataIteratorGetNextResponder },
966 GetNextCompressed { responder: DebugDataIteratorGetNextCompressedResponder },
970}
971
972impl DebugDataIteratorRequest {
973 #[allow(irrefutable_let_patterns)]
974 pub fn into_get_next(self) -> Option<(DebugDataIteratorGetNextResponder)> {
975 if let DebugDataIteratorRequest::GetNext { responder } = self {
976 Some((responder))
977 } else {
978 None
979 }
980 }
981
982 #[allow(irrefutable_let_patterns)]
983 pub fn into_get_next_compressed(self) -> Option<(DebugDataIteratorGetNextCompressedResponder)> {
984 if let DebugDataIteratorRequest::GetNextCompressed { responder } = self {
985 Some((responder))
986 } else {
987 None
988 }
989 }
990
991 pub fn method_name(&self) -> &'static str {
993 match *self {
994 DebugDataIteratorRequest::GetNext { .. } => "get_next",
995 DebugDataIteratorRequest::GetNextCompressed { .. } => "get_next_compressed",
996 }
997 }
998}
999
1000#[derive(Debug, Clone)]
1001pub struct DebugDataIteratorControlHandle {
1002 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1003}
1004
1005impl DebugDataIteratorControlHandle {
1006 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1007 self.inner.shutdown_with_epitaph(status.into())
1008 }
1009}
1010
1011impl fidl::endpoints::ControlHandle for DebugDataIteratorControlHandle {
1012 fn shutdown(&self) {
1013 self.inner.shutdown()
1014 }
1015
1016 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1017 self.inner.shutdown_with_epitaph(status)
1018 }
1019
1020 fn is_closed(&self) -> bool {
1021 self.inner.channel().is_closed()
1022 }
1023 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1024 self.inner.channel().on_closed()
1025 }
1026
1027 #[cfg(target_os = "fuchsia")]
1028 fn signal_peer(
1029 &self,
1030 clear_mask: zx::Signals,
1031 set_mask: zx::Signals,
1032 ) -> Result<(), zx_status::Status> {
1033 use fidl::Peered;
1034 self.inner.channel().signal_peer(clear_mask, set_mask)
1035 }
1036}
1037
1038impl DebugDataIteratorControlHandle {}
1039
1040#[must_use = "FIDL methods require a response to be sent"]
1041#[derive(Debug)]
1042pub struct DebugDataIteratorGetNextResponder {
1043 control_handle: std::mem::ManuallyDrop<DebugDataIteratorControlHandle>,
1044 tx_id: u32,
1045}
1046
1047impl std::ops::Drop for DebugDataIteratorGetNextResponder {
1051 fn drop(&mut self) {
1052 self.control_handle.shutdown();
1053 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1055 }
1056}
1057
1058impl fidl::endpoints::Responder for DebugDataIteratorGetNextResponder {
1059 type ControlHandle = DebugDataIteratorControlHandle;
1060
1061 fn control_handle(&self) -> &DebugDataIteratorControlHandle {
1062 &self.control_handle
1063 }
1064
1065 fn drop_without_shutdown(mut self) {
1066 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1068 std::mem::forget(self);
1070 }
1071}
1072
1073impl DebugDataIteratorGetNextResponder {
1074 pub fn send(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1078 let _result = self.send_raw(data);
1079 if _result.is_err() {
1080 self.control_handle.shutdown();
1081 }
1082 self.drop_without_shutdown();
1083 _result
1084 }
1085
1086 pub fn send_no_shutdown_on_err(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1088 let _result = self.send_raw(data);
1089 self.drop_without_shutdown();
1090 _result
1091 }
1092
1093 fn send_raw(&self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1094 self.control_handle.inner.send::<DebugDataIteratorGetNextResponse>(
1095 (data.as_mut(),),
1096 self.tx_id,
1097 0x9ef24c823f5ad60,
1098 fidl::encoding::DynamicFlags::empty(),
1099 )
1100 }
1101}
1102
1103#[must_use = "FIDL methods require a response to be sent"]
1104#[derive(Debug)]
1105pub struct DebugDataIteratorGetNextCompressedResponder {
1106 control_handle: std::mem::ManuallyDrop<DebugDataIteratorControlHandle>,
1107 tx_id: u32,
1108}
1109
1110impl std::ops::Drop for DebugDataIteratorGetNextCompressedResponder {
1114 fn drop(&mut self) {
1115 self.control_handle.shutdown();
1116 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1118 }
1119}
1120
1121impl fidl::endpoints::Responder for DebugDataIteratorGetNextCompressedResponder {
1122 type ControlHandle = DebugDataIteratorControlHandle;
1123
1124 fn control_handle(&self) -> &DebugDataIteratorControlHandle {
1125 &self.control_handle
1126 }
1127
1128 fn drop_without_shutdown(mut self) {
1129 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1131 std::mem::forget(self);
1133 }
1134}
1135
1136impl DebugDataIteratorGetNextCompressedResponder {
1137 pub fn send(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1141 let _result = self.send_raw(data);
1142 if _result.is_err() {
1143 self.control_handle.shutdown();
1144 }
1145 self.drop_without_shutdown();
1146 _result
1147 }
1148
1149 pub fn send_no_shutdown_on_err(self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1151 let _result = self.send_raw(data);
1152 self.drop_without_shutdown();
1153 _result
1154 }
1155
1156 fn send_raw(&self, mut data: Vec<DebugData>) -> Result<(), fidl::Error> {
1157 self.control_handle.inner.send::<DebugDataIteratorGetNextCompressedResponse>(
1158 (data.as_mut(),),
1159 self.tx_id,
1160 0x6765e9cb918301f4,
1161 fidl::encoding::DynamicFlags::empty(),
1162 )
1163 }
1164}
1165
1166#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1167pub struct EarlyBootProfileMarker;
1168
1169impl fidl::endpoints::ProtocolMarker for EarlyBootProfileMarker {
1170 type Proxy = EarlyBootProfileProxy;
1171 type RequestStream = EarlyBootProfileRequestStream;
1172 #[cfg(target_os = "fuchsia")]
1173 type SynchronousProxy = EarlyBootProfileSynchronousProxy;
1174
1175 const DEBUG_NAME: &'static str = "fuchsia.test.manager.EarlyBootProfile";
1176}
1177impl fidl::endpoints::DiscoverableProtocolMarker for EarlyBootProfileMarker {}
1178
1179pub trait EarlyBootProfileProxyInterface: Send + Sync {
1180 fn r#register_watcher(
1181 &self,
1182 iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1183 ) -> Result<(), fidl::Error>;
1184}
1185#[derive(Debug)]
1186#[cfg(target_os = "fuchsia")]
1187pub struct EarlyBootProfileSynchronousProxy {
1188 client: fidl::client::sync::Client,
1189}
1190
1191#[cfg(target_os = "fuchsia")]
1192impl fidl::endpoints::SynchronousProxy for EarlyBootProfileSynchronousProxy {
1193 type Proxy = EarlyBootProfileProxy;
1194 type Protocol = EarlyBootProfileMarker;
1195
1196 fn from_channel(inner: fidl::Channel) -> Self {
1197 Self::new(inner)
1198 }
1199
1200 fn into_channel(self) -> fidl::Channel {
1201 self.client.into_channel()
1202 }
1203
1204 fn as_channel(&self) -> &fidl::Channel {
1205 self.client.as_channel()
1206 }
1207}
1208
1209#[cfg(target_os = "fuchsia")]
1210impl EarlyBootProfileSynchronousProxy {
1211 pub fn new(channel: fidl::Channel) -> Self {
1212 Self { client: fidl::client::sync::Client::new(channel) }
1213 }
1214
1215 pub fn into_channel(self) -> fidl::Channel {
1216 self.client.into_channel()
1217 }
1218
1219 pub fn wait_for_event(
1222 &self,
1223 deadline: zx::MonotonicInstant,
1224 ) -> Result<EarlyBootProfileEvent, fidl::Error> {
1225 EarlyBootProfileEvent::decode(
1226 self.client.wait_for_event::<EarlyBootProfileMarker>(deadline)?,
1227 )
1228 }
1229
1230 pub fn r#register_watcher(
1232 &self,
1233 mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1234 ) -> Result<(), fidl::Error> {
1235 self.client.send::<EarlyBootProfileRegisterWatcherRequest>(
1236 (iterator,),
1237 0x6bd6b03803b93715,
1238 fidl::encoding::DynamicFlags::empty(),
1239 )
1240 }
1241}
1242
1243#[cfg(target_os = "fuchsia")]
1244impl From<EarlyBootProfileSynchronousProxy> for zx::NullableHandle {
1245 fn from(value: EarlyBootProfileSynchronousProxy) -> Self {
1246 value.into_channel().into()
1247 }
1248}
1249
1250#[cfg(target_os = "fuchsia")]
1251impl From<fidl::Channel> for EarlyBootProfileSynchronousProxy {
1252 fn from(value: fidl::Channel) -> Self {
1253 Self::new(value)
1254 }
1255}
1256
1257#[cfg(target_os = "fuchsia")]
1258impl fidl::endpoints::FromClient for EarlyBootProfileSynchronousProxy {
1259 type Protocol = EarlyBootProfileMarker;
1260
1261 fn from_client(value: fidl::endpoints::ClientEnd<EarlyBootProfileMarker>) -> Self {
1262 Self::new(value.into_channel())
1263 }
1264}
1265
1266#[derive(Debug, Clone)]
1267pub struct EarlyBootProfileProxy {
1268 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1269}
1270
1271impl fidl::endpoints::Proxy for EarlyBootProfileProxy {
1272 type Protocol = EarlyBootProfileMarker;
1273
1274 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1275 Self::new(inner)
1276 }
1277
1278 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1279 self.client.into_channel().map_err(|client| Self { client })
1280 }
1281
1282 fn as_channel(&self) -> &::fidl::AsyncChannel {
1283 self.client.as_channel()
1284 }
1285}
1286
1287impl EarlyBootProfileProxy {
1288 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1290 let protocol_name = <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1291 Self { client: fidl::client::Client::new(channel, protocol_name) }
1292 }
1293
1294 pub fn take_event_stream(&self) -> EarlyBootProfileEventStream {
1300 EarlyBootProfileEventStream { event_receiver: self.client.take_event_receiver() }
1301 }
1302
1303 pub fn r#register_watcher(
1305 &self,
1306 mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1307 ) -> Result<(), fidl::Error> {
1308 EarlyBootProfileProxyInterface::r#register_watcher(self, iterator)
1309 }
1310}
1311
1312impl EarlyBootProfileProxyInterface for EarlyBootProfileProxy {
1313 fn r#register_watcher(
1314 &self,
1315 mut iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1316 ) -> Result<(), fidl::Error> {
1317 self.client.send::<EarlyBootProfileRegisterWatcherRequest>(
1318 (iterator,),
1319 0x6bd6b03803b93715,
1320 fidl::encoding::DynamicFlags::empty(),
1321 )
1322 }
1323}
1324
1325pub struct EarlyBootProfileEventStream {
1326 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1327}
1328
1329impl std::marker::Unpin for EarlyBootProfileEventStream {}
1330
1331impl futures::stream::FusedStream for EarlyBootProfileEventStream {
1332 fn is_terminated(&self) -> bool {
1333 self.event_receiver.is_terminated()
1334 }
1335}
1336
1337impl futures::Stream for EarlyBootProfileEventStream {
1338 type Item = Result<EarlyBootProfileEvent, fidl::Error>;
1339
1340 fn poll_next(
1341 mut self: std::pin::Pin<&mut Self>,
1342 cx: &mut std::task::Context<'_>,
1343 ) -> std::task::Poll<Option<Self::Item>> {
1344 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1345 &mut self.event_receiver,
1346 cx
1347 )?) {
1348 Some(buf) => std::task::Poll::Ready(Some(EarlyBootProfileEvent::decode(buf))),
1349 None => std::task::Poll::Ready(None),
1350 }
1351 }
1352}
1353
1354#[derive(Debug)]
1355pub enum EarlyBootProfileEvent {
1356 #[non_exhaustive]
1357 _UnknownEvent {
1358 ordinal: u64,
1360 },
1361}
1362
1363impl EarlyBootProfileEvent {
1364 fn decode(
1366 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1367 ) -> Result<EarlyBootProfileEvent, fidl::Error> {
1368 let (bytes, _handles) = buf.split_mut();
1369 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1370 debug_assert_eq!(tx_header.tx_id, 0);
1371 match tx_header.ordinal {
1372 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1373 Ok(EarlyBootProfileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1374 }
1375 _ => Err(fidl::Error::UnknownOrdinal {
1376 ordinal: tx_header.ordinal,
1377 protocol_name:
1378 <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1379 }),
1380 }
1381 }
1382}
1383
1384pub struct EarlyBootProfileRequestStream {
1386 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1387 is_terminated: bool,
1388}
1389
1390impl std::marker::Unpin for EarlyBootProfileRequestStream {}
1391
1392impl futures::stream::FusedStream for EarlyBootProfileRequestStream {
1393 fn is_terminated(&self) -> bool {
1394 self.is_terminated
1395 }
1396}
1397
1398impl fidl::endpoints::RequestStream for EarlyBootProfileRequestStream {
1399 type Protocol = EarlyBootProfileMarker;
1400 type ControlHandle = EarlyBootProfileControlHandle;
1401
1402 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1403 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1404 }
1405
1406 fn control_handle(&self) -> Self::ControlHandle {
1407 EarlyBootProfileControlHandle { inner: self.inner.clone() }
1408 }
1409
1410 fn into_inner(
1411 self,
1412 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1413 {
1414 (self.inner, self.is_terminated)
1415 }
1416
1417 fn from_inner(
1418 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1419 is_terminated: bool,
1420 ) -> Self {
1421 Self { inner, is_terminated }
1422 }
1423}
1424
1425impl futures::Stream for EarlyBootProfileRequestStream {
1426 type Item = Result<EarlyBootProfileRequest, fidl::Error>;
1427
1428 fn poll_next(
1429 mut self: std::pin::Pin<&mut Self>,
1430 cx: &mut std::task::Context<'_>,
1431 ) -> std::task::Poll<Option<Self::Item>> {
1432 let this = &mut *self;
1433 if this.inner.check_shutdown(cx) {
1434 this.is_terminated = true;
1435 return std::task::Poll::Ready(None);
1436 }
1437 if this.is_terminated {
1438 panic!("polled EarlyBootProfileRequestStream after completion");
1439 }
1440 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1441 |bytes, handles| {
1442 match this.inner.channel().read_etc(cx, bytes, handles) {
1443 std::task::Poll::Ready(Ok(())) => {}
1444 std::task::Poll::Pending => return std::task::Poll::Pending,
1445 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1446 this.is_terminated = true;
1447 return std::task::Poll::Ready(None);
1448 }
1449 std::task::Poll::Ready(Err(e)) => {
1450 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1451 e.into(),
1452 ))));
1453 }
1454 }
1455
1456 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1458
1459 std::task::Poll::Ready(Some(match header.ordinal {
1460 0x6bd6b03803b93715 => {
1461 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1462 let mut req = fidl::new_empty!(
1463 EarlyBootProfileRegisterWatcherRequest,
1464 fidl::encoding::DefaultFuchsiaResourceDialect
1465 );
1466 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EarlyBootProfileRegisterWatcherRequest>(&header, _body_bytes, handles, &mut req)?;
1467 let control_handle =
1468 EarlyBootProfileControlHandle { inner: this.inner.clone() };
1469 Ok(EarlyBootProfileRequest::RegisterWatcher {
1470 iterator: req.iterator,
1471
1472 control_handle,
1473 })
1474 }
1475 _ if header.tx_id == 0
1476 && header
1477 .dynamic_flags()
1478 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1479 {
1480 Ok(EarlyBootProfileRequest::_UnknownMethod {
1481 ordinal: header.ordinal,
1482 control_handle: EarlyBootProfileControlHandle {
1483 inner: this.inner.clone(),
1484 },
1485 method_type: fidl::MethodType::OneWay,
1486 })
1487 }
1488 _ if header
1489 .dynamic_flags()
1490 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1491 {
1492 this.inner.send_framework_err(
1493 fidl::encoding::FrameworkErr::UnknownMethod,
1494 header.tx_id,
1495 header.ordinal,
1496 header.dynamic_flags(),
1497 (bytes, handles),
1498 )?;
1499 Ok(EarlyBootProfileRequest::_UnknownMethod {
1500 ordinal: header.ordinal,
1501 control_handle: EarlyBootProfileControlHandle {
1502 inner: this.inner.clone(),
1503 },
1504 method_type: fidl::MethodType::TwoWay,
1505 })
1506 }
1507 _ => Err(fidl::Error::UnknownOrdinal {
1508 ordinal: header.ordinal,
1509 protocol_name:
1510 <EarlyBootProfileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1511 }),
1512 }))
1513 },
1514 )
1515 }
1516}
1517
1518#[derive(Debug)]
1521pub enum EarlyBootProfileRequest {
1522 RegisterWatcher {
1524 iterator: fidl::endpoints::ServerEnd<DebugDataIteratorMarker>,
1525 control_handle: EarlyBootProfileControlHandle,
1526 },
1527 #[non_exhaustive]
1529 _UnknownMethod {
1530 ordinal: u64,
1532 control_handle: EarlyBootProfileControlHandle,
1533 method_type: fidl::MethodType,
1534 },
1535}
1536
1537impl EarlyBootProfileRequest {
1538 #[allow(irrefutable_let_patterns)]
1539 pub fn into_register_watcher(
1540 self,
1541 ) -> Option<(fidl::endpoints::ServerEnd<DebugDataIteratorMarker>, EarlyBootProfileControlHandle)>
1542 {
1543 if let EarlyBootProfileRequest::RegisterWatcher { iterator, control_handle } = self {
1544 Some((iterator, control_handle))
1545 } else {
1546 None
1547 }
1548 }
1549
1550 pub fn method_name(&self) -> &'static str {
1552 match *self {
1553 EarlyBootProfileRequest::RegisterWatcher { .. } => "register_watcher",
1554 EarlyBootProfileRequest::_UnknownMethod {
1555 method_type: fidl::MethodType::OneWay,
1556 ..
1557 } => "unknown one-way method",
1558 EarlyBootProfileRequest::_UnknownMethod {
1559 method_type: fidl::MethodType::TwoWay,
1560 ..
1561 } => "unknown two-way method",
1562 }
1563 }
1564}
1565
1566#[derive(Debug, Clone)]
1567pub struct EarlyBootProfileControlHandle {
1568 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1569}
1570
1571impl EarlyBootProfileControlHandle {
1572 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1573 self.inner.shutdown_with_epitaph(status.into())
1574 }
1575}
1576
1577impl fidl::endpoints::ControlHandle for EarlyBootProfileControlHandle {
1578 fn shutdown(&self) {
1579 self.inner.shutdown()
1580 }
1581
1582 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1583 self.inner.shutdown_with_epitaph(status)
1584 }
1585
1586 fn is_closed(&self) -> bool {
1587 self.inner.channel().is_closed()
1588 }
1589 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1590 self.inner.channel().on_closed()
1591 }
1592
1593 #[cfg(target_os = "fuchsia")]
1594 fn signal_peer(
1595 &self,
1596 clear_mask: zx::Signals,
1597 set_mask: zx::Signals,
1598 ) -> Result<(), zx_status::Status> {
1599 use fidl::Peered;
1600 self.inner.channel().signal_peer(clear_mask, set_mask)
1601 }
1602}
1603
1604impl EarlyBootProfileControlHandle {}
1605
1606#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1607pub struct SuiteControllerMarker;
1608
1609impl fidl::endpoints::ProtocolMarker for SuiteControllerMarker {
1610 type Proxy = SuiteControllerProxy;
1611 type RequestStream = SuiteControllerRequestStream;
1612 #[cfg(target_os = "fuchsia")]
1613 type SynchronousProxy = SuiteControllerSynchronousProxy;
1614
1615 const DEBUG_NAME: &'static str = "(anonymous) SuiteController";
1616}
1617pub type SuiteControllerWatchEventsResult = Result<Vec<Event>, LaunchError>;
1618
1619pub trait SuiteControllerProxyInterface: Send + Sync {
1620 fn r#stop(&self) -> Result<(), fidl::Error>;
1621 fn r#kill(&self) -> Result<(), fidl::Error>;
1622 type WatchEventsResponseFut: std::future::Future<Output = Result<SuiteControllerWatchEventsResult, fidl::Error>>
1623 + Send;
1624 fn r#watch_events(&self) -> Self::WatchEventsResponseFut;
1625}
1626#[derive(Debug)]
1627#[cfg(target_os = "fuchsia")]
1628pub struct SuiteControllerSynchronousProxy {
1629 client: fidl::client::sync::Client,
1630}
1631
1632#[cfg(target_os = "fuchsia")]
1633impl fidl::endpoints::SynchronousProxy for SuiteControllerSynchronousProxy {
1634 type Proxy = SuiteControllerProxy;
1635 type Protocol = SuiteControllerMarker;
1636
1637 fn from_channel(inner: fidl::Channel) -> Self {
1638 Self::new(inner)
1639 }
1640
1641 fn into_channel(self) -> fidl::Channel {
1642 self.client.into_channel()
1643 }
1644
1645 fn as_channel(&self) -> &fidl::Channel {
1646 self.client.as_channel()
1647 }
1648}
1649
1650#[cfg(target_os = "fuchsia")]
1651impl SuiteControllerSynchronousProxy {
1652 pub fn new(channel: fidl::Channel) -> Self {
1653 Self { client: fidl::client::sync::Client::new(channel) }
1654 }
1655
1656 pub fn into_channel(self) -> fidl::Channel {
1657 self.client.into_channel()
1658 }
1659
1660 pub fn wait_for_event(
1663 &self,
1664 deadline: zx::MonotonicInstant,
1665 ) -> Result<SuiteControllerEvent, fidl::Error> {
1666 SuiteControllerEvent::decode(self.client.wait_for_event::<SuiteControllerMarker>(deadline)?)
1667 }
1668
1669 pub fn r#stop(&self) -> Result<(), fidl::Error> {
1672 self.client.send::<fidl::encoding::EmptyPayload>(
1673 (),
1674 0x4675fc6c8f404fef,
1675 fidl::encoding::DynamicFlags::FLEXIBLE,
1676 )
1677 }
1678
1679 pub fn r#kill(&self) -> Result<(), fidl::Error> {
1683 self.client.send::<fidl::encoding::EmptyPayload>(
1684 (),
1685 0x5f813fb72887fc17,
1686 fidl::encoding::DynamicFlags::FLEXIBLE,
1687 )
1688 }
1689
1690 pub fn r#watch_events(
1693 &self,
1694 ___deadline: zx::MonotonicInstant,
1695 ) -> Result<SuiteControllerWatchEventsResult, fidl::Error> {
1696 let _response =
1697 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1698 SuiteControllerWatchEventsResponse,
1699 LaunchError,
1700 >, SuiteControllerMarker>(
1701 (),
1702 0x5d1a75b1d06839b4,
1703 fidl::encoding::DynamicFlags::empty(),
1704 ___deadline,
1705 )?;
1706 Ok(_response.map(|x| x.events))
1707 }
1708}
1709
1710#[cfg(target_os = "fuchsia")]
1711impl From<SuiteControllerSynchronousProxy> for zx::NullableHandle {
1712 fn from(value: SuiteControllerSynchronousProxy) -> Self {
1713 value.into_channel().into()
1714 }
1715}
1716
1717#[cfg(target_os = "fuchsia")]
1718impl From<fidl::Channel> for SuiteControllerSynchronousProxy {
1719 fn from(value: fidl::Channel) -> Self {
1720 Self::new(value)
1721 }
1722}
1723
1724#[cfg(target_os = "fuchsia")]
1725impl fidl::endpoints::FromClient for SuiteControllerSynchronousProxy {
1726 type Protocol = SuiteControllerMarker;
1727
1728 fn from_client(value: fidl::endpoints::ClientEnd<SuiteControllerMarker>) -> Self {
1729 Self::new(value.into_channel())
1730 }
1731}
1732
1733#[derive(Debug, Clone)]
1734pub struct SuiteControllerProxy {
1735 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1736}
1737
1738impl fidl::endpoints::Proxy for SuiteControllerProxy {
1739 type Protocol = SuiteControllerMarker;
1740
1741 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1742 Self::new(inner)
1743 }
1744
1745 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1746 self.client.into_channel().map_err(|client| Self { client })
1747 }
1748
1749 fn as_channel(&self) -> &::fidl::AsyncChannel {
1750 self.client.as_channel()
1751 }
1752}
1753
1754impl SuiteControllerProxy {
1755 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1757 let protocol_name = <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1758 Self { client: fidl::client::Client::new(channel, protocol_name) }
1759 }
1760
1761 pub fn take_event_stream(&self) -> SuiteControllerEventStream {
1767 SuiteControllerEventStream { event_receiver: self.client.take_event_receiver() }
1768 }
1769
1770 pub fn r#stop(&self) -> Result<(), fidl::Error> {
1773 SuiteControllerProxyInterface::r#stop(self)
1774 }
1775
1776 pub fn r#kill(&self) -> Result<(), fidl::Error> {
1780 SuiteControllerProxyInterface::r#kill(self)
1781 }
1782
1783 pub fn r#watch_events(
1786 &self,
1787 ) -> fidl::client::QueryResponseFut<
1788 SuiteControllerWatchEventsResult,
1789 fidl::encoding::DefaultFuchsiaResourceDialect,
1790 > {
1791 SuiteControllerProxyInterface::r#watch_events(self)
1792 }
1793}
1794
1795impl SuiteControllerProxyInterface for SuiteControllerProxy {
1796 fn r#stop(&self) -> Result<(), fidl::Error> {
1797 self.client.send::<fidl::encoding::EmptyPayload>(
1798 (),
1799 0x4675fc6c8f404fef,
1800 fidl::encoding::DynamicFlags::FLEXIBLE,
1801 )
1802 }
1803
1804 fn r#kill(&self) -> Result<(), fidl::Error> {
1805 self.client.send::<fidl::encoding::EmptyPayload>(
1806 (),
1807 0x5f813fb72887fc17,
1808 fidl::encoding::DynamicFlags::FLEXIBLE,
1809 )
1810 }
1811
1812 type WatchEventsResponseFut = fidl::client::QueryResponseFut<
1813 SuiteControllerWatchEventsResult,
1814 fidl::encoding::DefaultFuchsiaResourceDialect,
1815 >;
1816 fn r#watch_events(&self) -> Self::WatchEventsResponseFut {
1817 fn _decode(
1818 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1819 ) -> Result<SuiteControllerWatchEventsResult, fidl::Error> {
1820 let _response = fidl::client::decode_transaction_body::<
1821 fidl::encoding::ResultType<SuiteControllerWatchEventsResponse, LaunchError>,
1822 fidl::encoding::DefaultFuchsiaResourceDialect,
1823 0x5d1a75b1d06839b4,
1824 >(_buf?)?;
1825 Ok(_response.map(|x| x.events))
1826 }
1827 self.client.send_query_and_decode::<
1828 fidl::encoding::EmptyPayload,
1829 SuiteControllerWatchEventsResult,
1830 >(
1831 (),
1832 0x5d1a75b1d06839b4,
1833 fidl::encoding::DynamicFlags::empty(),
1834 _decode,
1835 )
1836 }
1837}
1838
1839pub struct SuiteControllerEventStream {
1840 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1841}
1842
1843impl std::marker::Unpin for SuiteControllerEventStream {}
1844
1845impl futures::stream::FusedStream for SuiteControllerEventStream {
1846 fn is_terminated(&self) -> bool {
1847 self.event_receiver.is_terminated()
1848 }
1849}
1850
1851impl futures::Stream for SuiteControllerEventStream {
1852 type Item = Result<SuiteControllerEvent, fidl::Error>;
1853
1854 fn poll_next(
1855 mut self: std::pin::Pin<&mut Self>,
1856 cx: &mut std::task::Context<'_>,
1857 ) -> std::task::Poll<Option<Self::Item>> {
1858 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1859 &mut self.event_receiver,
1860 cx
1861 )?) {
1862 Some(buf) => std::task::Poll::Ready(Some(SuiteControllerEvent::decode(buf))),
1863 None => std::task::Poll::Ready(None),
1864 }
1865 }
1866}
1867
1868#[derive(Debug)]
1869pub enum SuiteControllerEvent {
1870 #[non_exhaustive]
1871 _UnknownEvent {
1872 ordinal: u64,
1874 },
1875}
1876
1877impl SuiteControllerEvent {
1878 fn decode(
1880 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1881 ) -> Result<SuiteControllerEvent, fidl::Error> {
1882 let (bytes, _handles) = buf.split_mut();
1883 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1884 debug_assert_eq!(tx_header.tx_id, 0);
1885 match tx_header.ordinal {
1886 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1887 Ok(SuiteControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1888 }
1889 _ => Err(fidl::Error::UnknownOrdinal {
1890 ordinal: tx_header.ordinal,
1891 protocol_name:
1892 <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1893 }),
1894 }
1895 }
1896}
1897
1898pub struct SuiteControllerRequestStream {
1900 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1901 is_terminated: bool,
1902}
1903
1904impl std::marker::Unpin for SuiteControllerRequestStream {}
1905
1906impl futures::stream::FusedStream for SuiteControllerRequestStream {
1907 fn is_terminated(&self) -> bool {
1908 self.is_terminated
1909 }
1910}
1911
1912impl fidl::endpoints::RequestStream for SuiteControllerRequestStream {
1913 type Protocol = SuiteControllerMarker;
1914 type ControlHandle = SuiteControllerControlHandle;
1915
1916 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1917 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1918 }
1919
1920 fn control_handle(&self) -> Self::ControlHandle {
1921 SuiteControllerControlHandle { inner: self.inner.clone() }
1922 }
1923
1924 fn into_inner(
1925 self,
1926 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1927 {
1928 (self.inner, self.is_terminated)
1929 }
1930
1931 fn from_inner(
1932 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1933 is_terminated: bool,
1934 ) -> Self {
1935 Self { inner, is_terminated }
1936 }
1937}
1938
1939impl futures::Stream for SuiteControllerRequestStream {
1940 type Item = Result<SuiteControllerRequest, fidl::Error>;
1941
1942 fn poll_next(
1943 mut self: std::pin::Pin<&mut Self>,
1944 cx: &mut std::task::Context<'_>,
1945 ) -> std::task::Poll<Option<Self::Item>> {
1946 let this = &mut *self;
1947 if this.inner.check_shutdown(cx) {
1948 this.is_terminated = true;
1949 return std::task::Poll::Ready(None);
1950 }
1951 if this.is_terminated {
1952 panic!("polled SuiteControllerRequestStream after completion");
1953 }
1954 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1955 |bytes, handles| {
1956 match this.inner.channel().read_etc(cx, bytes, handles) {
1957 std::task::Poll::Ready(Ok(())) => {}
1958 std::task::Poll::Pending => return std::task::Poll::Pending,
1959 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1960 this.is_terminated = true;
1961 return std::task::Poll::Ready(None);
1962 }
1963 std::task::Poll::Ready(Err(e)) => {
1964 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1965 e.into(),
1966 ))));
1967 }
1968 }
1969
1970 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1972
1973 std::task::Poll::Ready(Some(match header.ordinal {
1974 0x4675fc6c8f404fef => {
1975 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1976 let mut req = fidl::new_empty!(
1977 fidl::encoding::EmptyPayload,
1978 fidl::encoding::DefaultFuchsiaResourceDialect
1979 );
1980 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1981 let control_handle =
1982 SuiteControllerControlHandle { inner: this.inner.clone() };
1983 Ok(SuiteControllerRequest::Stop { control_handle })
1984 }
1985 0x5f813fb72887fc17 => {
1986 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1987 let mut req = fidl::new_empty!(
1988 fidl::encoding::EmptyPayload,
1989 fidl::encoding::DefaultFuchsiaResourceDialect
1990 );
1991 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1992 let control_handle =
1993 SuiteControllerControlHandle { inner: this.inner.clone() };
1994 Ok(SuiteControllerRequest::Kill { control_handle })
1995 }
1996 0x5d1a75b1d06839b4 => {
1997 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1998 let mut req = fidl::new_empty!(
1999 fidl::encoding::EmptyPayload,
2000 fidl::encoding::DefaultFuchsiaResourceDialect
2001 );
2002 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2003 let control_handle =
2004 SuiteControllerControlHandle { inner: this.inner.clone() };
2005 Ok(SuiteControllerRequest::WatchEvents {
2006 responder: SuiteControllerWatchEventsResponder {
2007 control_handle: std::mem::ManuallyDrop::new(control_handle),
2008 tx_id: header.tx_id,
2009 },
2010 })
2011 }
2012 _ if header.tx_id == 0
2013 && header
2014 .dynamic_flags()
2015 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2016 {
2017 Ok(SuiteControllerRequest::_UnknownMethod {
2018 ordinal: header.ordinal,
2019 control_handle: SuiteControllerControlHandle {
2020 inner: this.inner.clone(),
2021 },
2022 method_type: fidl::MethodType::OneWay,
2023 })
2024 }
2025 _ if header
2026 .dynamic_flags()
2027 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2028 {
2029 this.inner.send_framework_err(
2030 fidl::encoding::FrameworkErr::UnknownMethod,
2031 header.tx_id,
2032 header.ordinal,
2033 header.dynamic_flags(),
2034 (bytes, handles),
2035 )?;
2036 Ok(SuiteControllerRequest::_UnknownMethod {
2037 ordinal: header.ordinal,
2038 control_handle: SuiteControllerControlHandle {
2039 inner: this.inner.clone(),
2040 },
2041 method_type: fidl::MethodType::TwoWay,
2042 })
2043 }
2044 _ => Err(fidl::Error::UnknownOrdinal {
2045 ordinal: header.ordinal,
2046 protocol_name:
2047 <SuiteControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2048 }),
2049 }))
2050 },
2051 )
2052 }
2053}
2054
2055#[derive(Debug)]
2061pub enum SuiteControllerRequest {
2062 Stop { control_handle: SuiteControllerControlHandle },
2065 Kill { control_handle: SuiteControllerControlHandle },
2069 WatchEvents { responder: SuiteControllerWatchEventsResponder },
2072 #[non_exhaustive]
2074 _UnknownMethod {
2075 ordinal: u64,
2077 control_handle: SuiteControllerControlHandle,
2078 method_type: fidl::MethodType,
2079 },
2080}
2081
2082impl SuiteControllerRequest {
2083 #[allow(irrefutable_let_patterns)]
2084 pub fn into_stop(self) -> Option<(SuiteControllerControlHandle)> {
2085 if let SuiteControllerRequest::Stop { control_handle } = self {
2086 Some((control_handle))
2087 } else {
2088 None
2089 }
2090 }
2091
2092 #[allow(irrefutable_let_patterns)]
2093 pub fn into_kill(self) -> Option<(SuiteControllerControlHandle)> {
2094 if let SuiteControllerRequest::Kill { control_handle } = self {
2095 Some((control_handle))
2096 } else {
2097 None
2098 }
2099 }
2100
2101 #[allow(irrefutable_let_patterns)]
2102 pub fn into_watch_events(self) -> Option<(SuiteControllerWatchEventsResponder)> {
2103 if let SuiteControllerRequest::WatchEvents { responder } = self {
2104 Some((responder))
2105 } else {
2106 None
2107 }
2108 }
2109
2110 pub fn method_name(&self) -> &'static str {
2112 match *self {
2113 SuiteControllerRequest::Stop { .. } => "stop",
2114 SuiteControllerRequest::Kill { .. } => "kill",
2115 SuiteControllerRequest::WatchEvents { .. } => "watch_events",
2116 SuiteControllerRequest::_UnknownMethod {
2117 method_type: fidl::MethodType::OneWay,
2118 ..
2119 } => "unknown one-way method",
2120 SuiteControllerRequest::_UnknownMethod {
2121 method_type: fidl::MethodType::TwoWay,
2122 ..
2123 } => "unknown two-way method",
2124 }
2125 }
2126}
2127
2128#[derive(Debug, Clone)]
2129pub struct SuiteControllerControlHandle {
2130 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2131}
2132
2133impl SuiteControllerControlHandle {
2134 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2135 self.inner.shutdown_with_epitaph(status.into())
2136 }
2137}
2138
2139impl fidl::endpoints::ControlHandle for SuiteControllerControlHandle {
2140 fn shutdown(&self) {
2141 self.inner.shutdown()
2142 }
2143
2144 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2145 self.inner.shutdown_with_epitaph(status)
2146 }
2147
2148 fn is_closed(&self) -> bool {
2149 self.inner.channel().is_closed()
2150 }
2151 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2152 self.inner.channel().on_closed()
2153 }
2154
2155 #[cfg(target_os = "fuchsia")]
2156 fn signal_peer(
2157 &self,
2158 clear_mask: zx::Signals,
2159 set_mask: zx::Signals,
2160 ) -> Result<(), zx_status::Status> {
2161 use fidl::Peered;
2162 self.inner.channel().signal_peer(clear_mask, set_mask)
2163 }
2164}
2165
2166impl SuiteControllerControlHandle {}
2167
2168#[must_use = "FIDL methods require a response to be sent"]
2169#[derive(Debug)]
2170pub struct SuiteControllerWatchEventsResponder {
2171 control_handle: std::mem::ManuallyDrop<SuiteControllerControlHandle>,
2172 tx_id: u32,
2173}
2174
2175impl std::ops::Drop for SuiteControllerWatchEventsResponder {
2179 fn drop(&mut self) {
2180 self.control_handle.shutdown();
2181 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2183 }
2184}
2185
2186impl fidl::endpoints::Responder for SuiteControllerWatchEventsResponder {
2187 type ControlHandle = SuiteControllerControlHandle;
2188
2189 fn control_handle(&self) -> &SuiteControllerControlHandle {
2190 &self.control_handle
2191 }
2192
2193 fn drop_without_shutdown(mut self) {
2194 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2196 std::mem::forget(self);
2198 }
2199}
2200
2201impl SuiteControllerWatchEventsResponder {
2202 pub fn send(self, mut result: Result<Vec<Event>, LaunchError>) -> Result<(), fidl::Error> {
2206 let _result = self.send_raw(result);
2207 if _result.is_err() {
2208 self.control_handle.shutdown();
2209 }
2210 self.drop_without_shutdown();
2211 _result
2212 }
2213
2214 pub fn send_no_shutdown_on_err(
2216 self,
2217 mut result: Result<Vec<Event>, LaunchError>,
2218 ) -> Result<(), fidl::Error> {
2219 let _result = self.send_raw(result);
2220 self.drop_without_shutdown();
2221 _result
2222 }
2223
2224 fn send_raw(&self, mut result: Result<Vec<Event>, LaunchError>) -> Result<(), fidl::Error> {
2225 self.control_handle.inner.send::<fidl::encoding::ResultType<
2226 SuiteControllerWatchEventsResponse,
2227 LaunchError,
2228 >>(
2229 result.as_mut().map_err(|e| *e).map(|events| (events.as_mut_slice(),)),
2230 self.tx_id,
2231 0x5d1a75b1d06839b4,
2232 fidl::encoding::DynamicFlags::empty(),
2233 )
2234 }
2235}
2236
2237#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2238pub struct SuiteRunnerMarker;
2239
2240impl fidl::endpoints::ProtocolMarker for SuiteRunnerMarker {
2241 type Proxy = SuiteRunnerProxy;
2242 type RequestStream = SuiteRunnerRequestStream;
2243 #[cfg(target_os = "fuchsia")]
2244 type SynchronousProxy = SuiteRunnerSynchronousProxy;
2245
2246 const DEBUG_NAME: &'static str = "fuchsia.test.manager.SuiteRunner";
2247}
2248impl fidl::endpoints::DiscoverableProtocolMarker for SuiteRunnerMarker {}
2249
2250pub trait SuiteRunnerProxyInterface: Send + Sync {
2251 fn r#run(
2252 &self,
2253 test_suite_url: &str,
2254 options: RunSuiteOptions,
2255 controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
2256 ) -> Result<(), fidl::Error>;
2257}
2258#[derive(Debug)]
2259#[cfg(target_os = "fuchsia")]
2260pub struct SuiteRunnerSynchronousProxy {
2261 client: fidl::client::sync::Client,
2262}
2263
2264#[cfg(target_os = "fuchsia")]
2265impl fidl::endpoints::SynchronousProxy for SuiteRunnerSynchronousProxy {
2266 type Proxy = SuiteRunnerProxy;
2267 type Protocol = SuiteRunnerMarker;
2268
2269 fn from_channel(inner: fidl::Channel) -> Self {
2270 Self::new(inner)
2271 }
2272
2273 fn into_channel(self) -> fidl::Channel {
2274 self.client.into_channel()
2275 }
2276
2277 fn as_channel(&self) -> &fidl::Channel {
2278 self.client.as_channel()
2279 }
2280}
2281
2282#[cfg(target_os = "fuchsia")]
2283impl SuiteRunnerSynchronousProxy {
2284 pub fn new(channel: fidl::Channel) -> Self {
2285 Self { client: fidl::client::sync::Client::new(channel) }
2286 }
2287
2288 pub fn into_channel(self) -> fidl::Channel {
2289 self.client.into_channel()
2290 }
2291
2292 pub fn wait_for_event(
2295 &self,
2296 deadline: zx::MonotonicInstant,
2297 ) -> Result<SuiteRunnerEvent, fidl::Error> {
2298 SuiteRunnerEvent::decode(self.client.wait_for_event::<SuiteRunnerMarker>(deadline)?)
2299 }
2300
2301 pub fn r#run(
2303 &self,
2304 mut test_suite_url: &str,
2305 mut options: RunSuiteOptions,
2306 mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
2307 ) -> Result<(), fidl::Error> {
2308 self.client.send::<SuiteRunnerRunRequest>(
2309 (test_suite_url, &mut options, controller),
2310 0x16f5ec6a46c223f0,
2311 fidl::encoding::DynamicFlags::FLEXIBLE,
2312 )
2313 }
2314}
2315
2316#[cfg(target_os = "fuchsia")]
2317impl From<SuiteRunnerSynchronousProxy> for zx::NullableHandle {
2318 fn from(value: SuiteRunnerSynchronousProxy) -> Self {
2319 value.into_channel().into()
2320 }
2321}
2322
2323#[cfg(target_os = "fuchsia")]
2324impl From<fidl::Channel> for SuiteRunnerSynchronousProxy {
2325 fn from(value: fidl::Channel) -> Self {
2326 Self::new(value)
2327 }
2328}
2329
2330#[cfg(target_os = "fuchsia")]
2331impl fidl::endpoints::FromClient for SuiteRunnerSynchronousProxy {
2332 type Protocol = SuiteRunnerMarker;
2333
2334 fn from_client(value: fidl::endpoints::ClientEnd<SuiteRunnerMarker>) -> Self {
2335 Self::new(value.into_channel())
2336 }
2337}
2338
2339#[derive(Debug, Clone)]
2340pub struct SuiteRunnerProxy {
2341 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2342}
2343
2344impl fidl::endpoints::Proxy for SuiteRunnerProxy {
2345 type Protocol = SuiteRunnerMarker;
2346
2347 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2348 Self::new(inner)
2349 }
2350
2351 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2352 self.client.into_channel().map_err(|client| Self { client })
2353 }
2354
2355 fn as_channel(&self) -> &::fidl::AsyncChannel {
2356 self.client.as_channel()
2357 }
2358}
2359
2360impl SuiteRunnerProxy {
2361 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2363 let protocol_name = <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2364 Self { client: fidl::client::Client::new(channel, protocol_name) }
2365 }
2366
2367 pub fn take_event_stream(&self) -> SuiteRunnerEventStream {
2373 SuiteRunnerEventStream { event_receiver: self.client.take_event_receiver() }
2374 }
2375
2376 pub fn r#run(
2378 &self,
2379 mut test_suite_url: &str,
2380 mut options: RunSuiteOptions,
2381 mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
2382 ) -> Result<(), fidl::Error> {
2383 SuiteRunnerProxyInterface::r#run(self, test_suite_url, options, controller)
2384 }
2385}
2386
2387impl SuiteRunnerProxyInterface for SuiteRunnerProxy {
2388 fn r#run(
2389 &self,
2390 mut test_suite_url: &str,
2391 mut options: RunSuiteOptions,
2392 mut controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
2393 ) -> Result<(), fidl::Error> {
2394 self.client.send::<SuiteRunnerRunRequest>(
2395 (test_suite_url, &mut options, controller),
2396 0x16f5ec6a46c223f0,
2397 fidl::encoding::DynamicFlags::FLEXIBLE,
2398 )
2399 }
2400}
2401
2402pub struct SuiteRunnerEventStream {
2403 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2404}
2405
2406impl std::marker::Unpin for SuiteRunnerEventStream {}
2407
2408impl futures::stream::FusedStream for SuiteRunnerEventStream {
2409 fn is_terminated(&self) -> bool {
2410 self.event_receiver.is_terminated()
2411 }
2412}
2413
2414impl futures::Stream for SuiteRunnerEventStream {
2415 type Item = Result<SuiteRunnerEvent, fidl::Error>;
2416
2417 fn poll_next(
2418 mut self: std::pin::Pin<&mut Self>,
2419 cx: &mut std::task::Context<'_>,
2420 ) -> std::task::Poll<Option<Self::Item>> {
2421 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2422 &mut self.event_receiver,
2423 cx
2424 )?) {
2425 Some(buf) => std::task::Poll::Ready(Some(SuiteRunnerEvent::decode(buf))),
2426 None => std::task::Poll::Ready(None),
2427 }
2428 }
2429}
2430
2431#[derive(Debug)]
2432pub enum SuiteRunnerEvent {
2433 #[non_exhaustive]
2434 _UnknownEvent {
2435 ordinal: u64,
2437 },
2438}
2439
2440impl SuiteRunnerEvent {
2441 fn decode(
2443 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2444 ) -> Result<SuiteRunnerEvent, fidl::Error> {
2445 let (bytes, _handles) = buf.split_mut();
2446 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2447 debug_assert_eq!(tx_header.tx_id, 0);
2448 match tx_header.ordinal {
2449 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2450 Ok(SuiteRunnerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2451 }
2452 _ => Err(fidl::Error::UnknownOrdinal {
2453 ordinal: tx_header.ordinal,
2454 protocol_name: <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2455 }),
2456 }
2457 }
2458}
2459
2460pub struct SuiteRunnerRequestStream {
2462 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2463 is_terminated: bool,
2464}
2465
2466impl std::marker::Unpin for SuiteRunnerRequestStream {}
2467
2468impl futures::stream::FusedStream for SuiteRunnerRequestStream {
2469 fn is_terminated(&self) -> bool {
2470 self.is_terminated
2471 }
2472}
2473
2474impl fidl::endpoints::RequestStream for SuiteRunnerRequestStream {
2475 type Protocol = SuiteRunnerMarker;
2476 type ControlHandle = SuiteRunnerControlHandle;
2477
2478 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2479 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2480 }
2481
2482 fn control_handle(&self) -> Self::ControlHandle {
2483 SuiteRunnerControlHandle { inner: self.inner.clone() }
2484 }
2485
2486 fn into_inner(
2487 self,
2488 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2489 {
2490 (self.inner, self.is_terminated)
2491 }
2492
2493 fn from_inner(
2494 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2495 is_terminated: bool,
2496 ) -> Self {
2497 Self { inner, is_terminated }
2498 }
2499}
2500
2501impl futures::Stream for SuiteRunnerRequestStream {
2502 type Item = Result<SuiteRunnerRequest, fidl::Error>;
2503
2504 fn poll_next(
2505 mut self: std::pin::Pin<&mut Self>,
2506 cx: &mut std::task::Context<'_>,
2507 ) -> std::task::Poll<Option<Self::Item>> {
2508 let this = &mut *self;
2509 if this.inner.check_shutdown(cx) {
2510 this.is_terminated = true;
2511 return std::task::Poll::Ready(None);
2512 }
2513 if this.is_terminated {
2514 panic!("polled SuiteRunnerRequestStream after completion");
2515 }
2516 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2517 |bytes, handles| {
2518 match this.inner.channel().read_etc(cx, bytes, handles) {
2519 std::task::Poll::Ready(Ok(())) => {}
2520 std::task::Poll::Pending => return std::task::Poll::Pending,
2521 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2522 this.is_terminated = true;
2523 return std::task::Poll::Ready(None);
2524 }
2525 std::task::Poll::Ready(Err(e)) => {
2526 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2527 e.into(),
2528 ))));
2529 }
2530 }
2531
2532 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2534
2535 std::task::Poll::Ready(Some(match header.ordinal {
2536 0x16f5ec6a46c223f0 => {
2537 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2538 let mut req = fidl::new_empty!(
2539 SuiteRunnerRunRequest,
2540 fidl::encoding::DefaultFuchsiaResourceDialect
2541 );
2542 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SuiteRunnerRunRequest>(&header, _body_bytes, handles, &mut req)?;
2543 let control_handle = SuiteRunnerControlHandle { inner: this.inner.clone() };
2544 Ok(SuiteRunnerRequest::Run {
2545 test_suite_url: req.test_suite_url,
2546 options: req.options,
2547 controller: req.controller,
2548
2549 control_handle,
2550 })
2551 }
2552 _ if header.tx_id == 0
2553 && header
2554 .dynamic_flags()
2555 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2556 {
2557 Ok(SuiteRunnerRequest::_UnknownMethod {
2558 ordinal: header.ordinal,
2559 control_handle: SuiteRunnerControlHandle { inner: this.inner.clone() },
2560 method_type: fidl::MethodType::OneWay,
2561 })
2562 }
2563 _ if header
2564 .dynamic_flags()
2565 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2566 {
2567 this.inner.send_framework_err(
2568 fidl::encoding::FrameworkErr::UnknownMethod,
2569 header.tx_id,
2570 header.ordinal,
2571 header.dynamic_flags(),
2572 (bytes, handles),
2573 )?;
2574 Ok(SuiteRunnerRequest::_UnknownMethod {
2575 ordinal: header.ordinal,
2576 control_handle: SuiteRunnerControlHandle { inner: this.inner.clone() },
2577 method_type: fidl::MethodType::TwoWay,
2578 })
2579 }
2580 _ => Err(fidl::Error::UnknownOrdinal {
2581 ordinal: header.ordinal,
2582 protocol_name:
2583 <SuiteRunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2584 }),
2585 }))
2586 },
2587 )
2588 }
2589}
2590
2591#[derive(Debug)]
2593pub enum SuiteRunnerRequest {
2594 Run {
2596 test_suite_url: String,
2597 options: RunSuiteOptions,
2598 controller: fidl::endpoints::ServerEnd<SuiteControllerMarker>,
2599 control_handle: SuiteRunnerControlHandle,
2600 },
2601 #[non_exhaustive]
2603 _UnknownMethod {
2604 ordinal: u64,
2606 control_handle: SuiteRunnerControlHandle,
2607 method_type: fidl::MethodType,
2608 },
2609}
2610
2611impl SuiteRunnerRequest {
2612 #[allow(irrefutable_let_patterns)]
2613 pub fn into_run(
2614 self,
2615 ) -> Option<(
2616 String,
2617 RunSuiteOptions,
2618 fidl::endpoints::ServerEnd<SuiteControllerMarker>,
2619 SuiteRunnerControlHandle,
2620 )> {
2621 if let SuiteRunnerRequest::Run { test_suite_url, options, controller, control_handle } =
2622 self
2623 {
2624 Some((test_suite_url, options, controller, control_handle))
2625 } else {
2626 None
2627 }
2628 }
2629
2630 pub fn method_name(&self) -> &'static str {
2632 match *self {
2633 SuiteRunnerRequest::Run { .. } => "run",
2634 SuiteRunnerRequest::_UnknownMethod {
2635 method_type: fidl::MethodType::OneWay, ..
2636 } => "unknown one-way method",
2637 SuiteRunnerRequest::_UnknownMethod {
2638 method_type: fidl::MethodType::TwoWay, ..
2639 } => "unknown two-way method",
2640 }
2641 }
2642}
2643
2644#[derive(Debug, Clone)]
2645pub struct SuiteRunnerControlHandle {
2646 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2647}
2648
2649impl SuiteRunnerControlHandle {
2650 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2651 self.inner.shutdown_with_epitaph(status.into())
2652 }
2653}
2654
2655impl fidl::endpoints::ControlHandle for SuiteRunnerControlHandle {
2656 fn shutdown(&self) {
2657 self.inner.shutdown()
2658 }
2659
2660 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2661 self.inner.shutdown_with_epitaph(status)
2662 }
2663
2664 fn is_closed(&self) -> bool {
2665 self.inner.channel().is_closed()
2666 }
2667 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2668 self.inner.channel().on_closed()
2669 }
2670
2671 #[cfg(target_os = "fuchsia")]
2672 fn signal_peer(
2673 &self,
2674 clear_mask: zx::Signals,
2675 set_mask: zx::Signals,
2676 ) -> Result<(), zx_status::Status> {
2677 use fidl::Peered;
2678 self.inner.channel().signal_peer(clear_mask, set_mask)
2679 }
2680}
2681
2682impl SuiteRunnerControlHandle {}
2683
2684#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2685pub struct TestCaseEnumeratorMarker;
2686
2687impl fidl::endpoints::ProtocolMarker for TestCaseEnumeratorMarker {
2688 type Proxy = TestCaseEnumeratorProxy;
2689 type RequestStream = TestCaseEnumeratorRequestStream;
2690 #[cfg(target_os = "fuchsia")]
2691 type SynchronousProxy = TestCaseEnumeratorSynchronousProxy;
2692
2693 const DEBUG_NAME: &'static str = "fuchsia.test.manager.TestCaseEnumerator";
2694}
2695impl fidl::endpoints::DiscoverableProtocolMarker for TestCaseEnumeratorMarker {}
2696pub type TestCaseEnumeratorEnumerateResult = Result<(), LaunchError>;
2697
2698pub trait TestCaseEnumeratorProxyInterface: Send + Sync {
2699 type EnumerateResponseFut: std::future::Future<Output = Result<TestCaseEnumeratorEnumerateResult, fidl::Error>>
2700 + Send;
2701 fn r#enumerate(
2702 &self,
2703 test_suite_url: &str,
2704 options: EnumerateTestCasesOptions,
2705 iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
2706 ) -> Self::EnumerateResponseFut;
2707}
2708#[derive(Debug)]
2709#[cfg(target_os = "fuchsia")]
2710pub struct TestCaseEnumeratorSynchronousProxy {
2711 client: fidl::client::sync::Client,
2712}
2713
2714#[cfg(target_os = "fuchsia")]
2715impl fidl::endpoints::SynchronousProxy for TestCaseEnumeratorSynchronousProxy {
2716 type Proxy = TestCaseEnumeratorProxy;
2717 type Protocol = TestCaseEnumeratorMarker;
2718
2719 fn from_channel(inner: fidl::Channel) -> Self {
2720 Self::new(inner)
2721 }
2722
2723 fn into_channel(self) -> fidl::Channel {
2724 self.client.into_channel()
2725 }
2726
2727 fn as_channel(&self) -> &fidl::Channel {
2728 self.client.as_channel()
2729 }
2730}
2731
2732#[cfg(target_os = "fuchsia")]
2733impl TestCaseEnumeratorSynchronousProxy {
2734 pub fn new(channel: fidl::Channel) -> Self {
2735 Self { client: fidl::client::sync::Client::new(channel) }
2736 }
2737
2738 pub fn into_channel(self) -> fidl::Channel {
2739 self.client.into_channel()
2740 }
2741
2742 pub fn wait_for_event(
2745 &self,
2746 deadline: zx::MonotonicInstant,
2747 ) -> Result<TestCaseEnumeratorEvent, fidl::Error> {
2748 TestCaseEnumeratorEvent::decode(
2749 self.client.wait_for_event::<TestCaseEnumeratorMarker>(deadline)?,
2750 )
2751 }
2752
2753 pub fn r#enumerate(
2755 &self,
2756 mut test_suite_url: &str,
2757 mut options: EnumerateTestCasesOptions,
2758 mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
2759 ___deadline: zx::MonotonicInstant,
2760 ) -> Result<TestCaseEnumeratorEnumerateResult, fidl::Error> {
2761 let _response = self.client.send_query::<
2762 TestCaseEnumeratorEnumerateRequest,
2763 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, LaunchError>,
2764 TestCaseEnumeratorMarker,
2765 >(
2766 (test_suite_url, &mut options, iterator,),
2767 0x24f8a91d96134492,
2768 fidl::encoding::DynamicFlags::FLEXIBLE,
2769 ___deadline,
2770 )?
2771 .into_result::<TestCaseEnumeratorMarker>("enumerate")?;
2772 Ok(_response.map(|x| x))
2773 }
2774}
2775
2776#[cfg(target_os = "fuchsia")]
2777impl From<TestCaseEnumeratorSynchronousProxy> for zx::NullableHandle {
2778 fn from(value: TestCaseEnumeratorSynchronousProxy) -> Self {
2779 value.into_channel().into()
2780 }
2781}
2782
2783#[cfg(target_os = "fuchsia")]
2784impl From<fidl::Channel> for TestCaseEnumeratorSynchronousProxy {
2785 fn from(value: fidl::Channel) -> Self {
2786 Self::new(value)
2787 }
2788}
2789
2790#[cfg(target_os = "fuchsia")]
2791impl fidl::endpoints::FromClient for TestCaseEnumeratorSynchronousProxy {
2792 type Protocol = TestCaseEnumeratorMarker;
2793
2794 fn from_client(value: fidl::endpoints::ClientEnd<TestCaseEnumeratorMarker>) -> Self {
2795 Self::new(value.into_channel())
2796 }
2797}
2798
2799#[derive(Debug, Clone)]
2800pub struct TestCaseEnumeratorProxy {
2801 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2802}
2803
2804impl fidl::endpoints::Proxy for TestCaseEnumeratorProxy {
2805 type Protocol = TestCaseEnumeratorMarker;
2806
2807 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2808 Self::new(inner)
2809 }
2810
2811 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2812 self.client.into_channel().map_err(|client| Self { client })
2813 }
2814
2815 fn as_channel(&self) -> &::fidl::AsyncChannel {
2816 self.client.as_channel()
2817 }
2818}
2819
2820impl TestCaseEnumeratorProxy {
2821 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2823 let protocol_name =
2824 <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2825 Self { client: fidl::client::Client::new(channel, protocol_name) }
2826 }
2827
2828 pub fn take_event_stream(&self) -> TestCaseEnumeratorEventStream {
2834 TestCaseEnumeratorEventStream { event_receiver: self.client.take_event_receiver() }
2835 }
2836
2837 pub fn r#enumerate(
2839 &self,
2840 mut test_suite_url: &str,
2841 mut options: EnumerateTestCasesOptions,
2842 mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
2843 ) -> fidl::client::QueryResponseFut<
2844 TestCaseEnumeratorEnumerateResult,
2845 fidl::encoding::DefaultFuchsiaResourceDialect,
2846 > {
2847 TestCaseEnumeratorProxyInterface::r#enumerate(self, test_suite_url, options, iterator)
2848 }
2849}
2850
2851impl TestCaseEnumeratorProxyInterface for TestCaseEnumeratorProxy {
2852 type EnumerateResponseFut = fidl::client::QueryResponseFut<
2853 TestCaseEnumeratorEnumerateResult,
2854 fidl::encoding::DefaultFuchsiaResourceDialect,
2855 >;
2856 fn r#enumerate(
2857 &self,
2858 mut test_suite_url: &str,
2859 mut options: EnumerateTestCasesOptions,
2860 mut iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
2861 ) -> Self::EnumerateResponseFut {
2862 fn _decode(
2863 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2864 ) -> Result<TestCaseEnumeratorEnumerateResult, fidl::Error> {
2865 let _response = fidl::client::decode_transaction_body::<
2866 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, LaunchError>,
2867 fidl::encoding::DefaultFuchsiaResourceDialect,
2868 0x24f8a91d96134492,
2869 >(_buf?)?
2870 .into_result::<TestCaseEnumeratorMarker>("enumerate")?;
2871 Ok(_response.map(|x| x))
2872 }
2873 self.client.send_query_and_decode::<
2874 TestCaseEnumeratorEnumerateRequest,
2875 TestCaseEnumeratorEnumerateResult,
2876 >(
2877 (test_suite_url, &mut options, iterator,),
2878 0x24f8a91d96134492,
2879 fidl::encoding::DynamicFlags::FLEXIBLE,
2880 _decode,
2881 )
2882 }
2883}
2884
2885pub struct TestCaseEnumeratorEventStream {
2886 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2887}
2888
2889impl std::marker::Unpin for TestCaseEnumeratorEventStream {}
2890
2891impl futures::stream::FusedStream for TestCaseEnumeratorEventStream {
2892 fn is_terminated(&self) -> bool {
2893 self.event_receiver.is_terminated()
2894 }
2895}
2896
2897impl futures::Stream for TestCaseEnumeratorEventStream {
2898 type Item = Result<TestCaseEnumeratorEvent, fidl::Error>;
2899
2900 fn poll_next(
2901 mut self: std::pin::Pin<&mut Self>,
2902 cx: &mut std::task::Context<'_>,
2903 ) -> std::task::Poll<Option<Self::Item>> {
2904 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2905 &mut self.event_receiver,
2906 cx
2907 )?) {
2908 Some(buf) => std::task::Poll::Ready(Some(TestCaseEnumeratorEvent::decode(buf))),
2909 None => std::task::Poll::Ready(None),
2910 }
2911 }
2912}
2913
2914#[derive(Debug)]
2915pub enum TestCaseEnumeratorEvent {
2916 #[non_exhaustive]
2917 _UnknownEvent {
2918 ordinal: u64,
2920 },
2921}
2922
2923impl TestCaseEnumeratorEvent {
2924 fn decode(
2926 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2927 ) -> Result<TestCaseEnumeratorEvent, fidl::Error> {
2928 let (bytes, _handles) = buf.split_mut();
2929 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2930 debug_assert_eq!(tx_header.tx_id, 0);
2931 match tx_header.ordinal {
2932 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2933 Ok(TestCaseEnumeratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2934 }
2935 _ => Err(fidl::Error::UnknownOrdinal {
2936 ordinal: tx_header.ordinal,
2937 protocol_name:
2938 <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2939 }),
2940 }
2941 }
2942}
2943
2944pub struct TestCaseEnumeratorRequestStream {
2946 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2947 is_terminated: bool,
2948}
2949
2950impl std::marker::Unpin for TestCaseEnumeratorRequestStream {}
2951
2952impl futures::stream::FusedStream for TestCaseEnumeratorRequestStream {
2953 fn is_terminated(&self) -> bool {
2954 self.is_terminated
2955 }
2956}
2957
2958impl fidl::endpoints::RequestStream for TestCaseEnumeratorRequestStream {
2959 type Protocol = TestCaseEnumeratorMarker;
2960 type ControlHandle = TestCaseEnumeratorControlHandle;
2961
2962 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2963 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2964 }
2965
2966 fn control_handle(&self) -> Self::ControlHandle {
2967 TestCaseEnumeratorControlHandle { inner: self.inner.clone() }
2968 }
2969
2970 fn into_inner(
2971 self,
2972 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2973 {
2974 (self.inner, self.is_terminated)
2975 }
2976
2977 fn from_inner(
2978 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2979 is_terminated: bool,
2980 ) -> Self {
2981 Self { inner, is_terminated }
2982 }
2983}
2984
2985impl futures::Stream for TestCaseEnumeratorRequestStream {
2986 type Item = Result<TestCaseEnumeratorRequest, fidl::Error>;
2987
2988 fn poll_next(
2989 mut self: std::pin::Pin<&mut Self>,
2990 cx: &mut std::task::Context<'_>,
2991 ) -> std::task::Poll<Option<Self::Item>> {
2992 let this = &mut *self;
2993 if this.inner.check_shutdown(cx) {
2994 this.is_terminated = true;
2995 return std::task::Poll::Ready(None);
2996 }
2997 if this.is_terminated {
2998 panic!("polled TestCaseEnumeratorRequestStream after completion");
2999 }
3000 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3001 |bytes, handles| {
3002 match this.inner.channel().read_etc(cx, bytes, handles) {
3003 std::task::Poll::Ready(Ok(())) => {}
3004 std::task::Poll::Pending => return std::task::Poll::Pending,
3005 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3006 this.is_terminated = true;
3007 return std::task::Poll::Ready(None);
3008 }
3009 std::task::Poll::Ready(Err(e)) => {
3010 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3011 e.into(),
3012 ))));
3013 }
3014 }
3015
3016 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3018
3019 std::task::Poll::Ready(Some(match header.ordinal {
3020 0x24f8a91d96134492 => {
3021 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3022 let mut req = fidl::new_empty!(TestCaseEnumeratorEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3023 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TestCaseEnumeratorEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
3024 let control_handle = TestCaseEnumeratorControlHandle {
3025 inner: this.inner.clone(),
3026 };
3027 Ok(TestCaseEnumeratorRequest::Enumerate {test_suite_url: req.test_suite_url,
3028options: req.options,
3029iterator: req.iterator,
3030
3031 responder: TestCaseEnumeratorEnumerateResponder {
3032 control_handle: std::mem::ManuallyDrop::new(control_handle),
3033 tx_id: header.tx_id,
3034 },
3035 })
3036 }
3037 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3038 Ok(TestCaseEnumeratorRequest::_UnknownMethod {
3039 ordinal: header.ordinal,
3040 control_handle: TestCaseEnumeratorControlHandle { inner: this.inner.clone() },
3041 method_type: fidl::MethodType::OneWay,
3042 })
3043 }
3044 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3045 this.inner.send_framework_err(
3046 fidl::encoding::FrameworkErr::UnknownMethod,
3047 header.tx_id,
3048 header.ordinal,
3049 header.dynamic_flags(),
3050 (bytes, handles),
3051 )?;
3052 Ok(TestCaseEnumeratorRequest::_UnknownMethod {
3053 ordinal: header.ordinal,
3054 control_handle: TestCaseEnumeratorControlHandle { inner: this.inner.clone() },
3055 method_type: fidl::MethodType::TwoWay,
3056 })
3057 }
3058 _ => Err(fidl::Error::UnknownOrdinal {
3059 ordinal: header.ordinal,
3060 protocol_name: <TestCaseEnumeratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3061 }),
3062 }))
3063 },
3064 )
3065 }
3066}
3067
3068#[derive(Debug)]
3070pub enum TestCaseEnumeratorRequest {
3071 Enumerate {
3073 test_suite_url: String,
3074 options: EnumerateTestCasesOptions,
3075 iterator: fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
3076 responder: TestCaseEnumeratorEnumerateResponder,
3077 },
3078 #[non_exhaustive]
3080 _UnknownMethod {
3081 ordinal: u64,
3083 control_handle: TestCaseEnumeratorControlHandle,
3084 method_type: fidl::MethodType,
3085 },
3086}
3087
3088impl TestCaseEnumeratorRequest {
3089 #[allow(irrefutable_let_patterns)]
3090 pub fn into_enumerate(
3091 self,
3092 ) -> Option<(
3093 String,
3094 EnumerateTestCasesOptions,
3095 fidl::endpoints::ServerEnd<TestCaseIteratorMarker>,
3096 TestCaseEnumeratorEnumerateResponder,
3097 )> {
3098 if let TestCaseEnumeratorRequest::Enumerate {
3099 test_suite_url,
3100 options,
3101 iterator,
3102 responder,
3103 } = self
3104 {
3105 Some((test_suite_url, options, iterator, responder))
3106 } else {
3107 None
3108 }
3109 }
3110
3111 pub fn method_name(&self) -> &'static str {
3113 match *self {
3114 TestCaseEnumeratorRequest::Enumerate { .. } => "enumerate",
3115 TestCaseEnumeratorRequest::_UnknownMethod {
3116 method_type: fidl::MethodType::OneWay,
3117 ..
3118 } => "unknown one-way method",
3119 TestCaseEnumeratorRequest::_UnknownMethod {
3120 method_type: fidl::MethodType::TwoWay,
3121 ..
3122 } => "unknown two-way method",
3123 }
3124 }
3125}
3126
3127#[derive(Debug, Clone)]
3128pub struct TestCaseEnumeratorControlHandle {
3129 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3130}
3131
3132impl TestCaseEnumeratorControlHandle {
3133 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3134 self.inner.shutdown_with_epitaph(status.into())
3135 }
3136}
3137
3138impl fidl::endpoints::ControlHandle for TestCaseEnumeratorControlHandle {
3139 fn shutdown(&self) {
3140 self.inner.shutdown()
3141 }
3142
3143 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3144 self.inner.shutdown_with_epitaph(status)
3145 }
3146
3147 fn is_closed(&self) -> bool {
3148 self.inner.channel().is_closed()
3149 }
3150 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3151 self.inner.channel().on_closed()
3152 }
3153
3154 #[cfg(target_os = "fuchsia")]
3155 fn signal_peer(
3156 &self,
3157 clear_mask: zx::Signals,
3158 set_mask: zx::Signals,
3159 ) -> Result<(), zx_status::Status> {
3160 use fidl::Peered;
3161 self.inner.channel().signal_peer(clear_mask, set_mask)
3162 }
3163}
3164
3165impl TestCaseEnumeratorControlHandle {}
3166
3167#[must_use = "FIDL methods require a response to be sent"]
3168#[derive(Debug)]
3169pub struct TestCaseEnumeratorEnumerateResponder {
3170 control_handle: std::mem::ManuallyDrop<TestCaseEnumeratorControlHandle>,
3171 tx_id: u32,
3172}
3173
3174impl std::ops::Drop for TestCaseEnumeratorEnumerateResponder {
3178 fn drop(&mut self) {
3179 self.control_handle.shutdown();
3180 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3182 }
3183}
3184
3185impl fidl::endpoints::Responder for TestCaseEnumeratorEnumerateResponder {
3186 type ControlHandle = TestCaseEnumeratorControlHandle;
3187
3188 fn control_handle(&self) -> &TestCaseEnumeratorControlHandle {
3189 &self.control_handle
3190 }
3191
3192 fn drop_without_shutdown(mut self) {
3193 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3195 std::mem::forget(self);
3197 }
3198}
3199
3200impl TestCaseEnumeratorEnumerateResponder {
3201 pub fn send(self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
3205 let _result = self.send_raw(result);
3206 if _result.is_err() {
3207 self.control_handle.shutdown();
3208 }
3209 self.drop_without_shutdown();
3210 _result
3211 }
3212
3213 pub fn send_no_shutdown_on_err(
3215 self,
3216 mut result: Result<(), LaunchError>,
3217 ) -> Result<(), fidl::Error> {
3218 let _result = self.send_raw(result);
3219 self.drop_without_shutdown();
3220 _result
3221 }
3222
3223 fn send_raw(&self, mut result: Result<(), LaunchError>) -> Result<(), fidl::Error> {
3224 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3225 fidl::encoding::EmptyStruct,
3226 LaunchError,
3227 >>(
3228 fidl::encoding::FlexibleResult::new(result),
3229 self.tx_id,
3230 0x24f8a91d96134492,
3231 fidl::encoding::DynamicFlags::FLEXIBLE,
3232 )
3233 }
3234}
3235
3236#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3237pub struct TestCaseIteratorMarker;
3238
3239impl fidl::endpoints::ProtocolMarker for TestCaseIteratorMarker {
3240 type Proxy = TestCaseIteratorProxy;
3241 type RequestStream = TestCaseIteratorRequestStream;
3242 #[cfg(target_os = "fuchsia")]
3243 type SynchronousProxy = TestCaseIteratorSynchronousProxy;
3244
3245 const DEBUG_NAME: &'static str = "(anonymous) TestCaseIterator";
3246}
3247
3248pub trait TestCaseIteratorProxyInterface: Send + Sync {
3249 type GetNextResponseFut: std::future::Future<Output = Result<Vec<TestCase>, fidl::Error>> + Send;
3250 fn r#get_next(&self) -> Self::GetNextResponseFut;
3251}
3252#[derive(Debug)]
3253#[cfg(target_os = "fuchsia")]
3254pub struct TestCaseIteratorSynchronousProxy {
3255 client: fidl::client::sync::Client,
3256}
3257
3258#[cfg(target_os = "fuchsia")]
3259impl fidl::endpoints::SynchronousProxy for TestCaseIteratorSynchronousProxy {
3260 type Proxy = TestCaseIteratorProxy;
3261 type Protocol = TestCaseIteratorMarker;
3262
3263 fn from_channel(inner: fidl::Channel) -> Self {
3264 Self::new(inner)
3265 }
3266
3267 fn into_channel(self) -> fidl::Channel {
3268 self.client.into_channel()
3269 }
3270
3271 fn as_channel(&self) -> &fidl::Channel {
3272 self.client.as_channel()
3273 }
3274}
3275
3276#[cfg(target_os = "fuchsia")]
3277impl TestCaseIteratorSynchronousProxy {
3278 pub fn new(channel: fidl::Channel) -> Self {
3279 Self { client: fidl::client::sync::Client::new(channel) }
3280 }
3281
3282 pub fn into_channel(self) -> fidl::Channel {
3283 self.client.into_channel()
3284 }
3285
3286 pub fn wait_for_event(
3289 &self,
3290 deadline: zx::MonotonicInstant,
3291 ) -> Result<TestCaseIteratorEvent, fidl::Error> {
3292 TestCaseIteratorEvent::decode(
3293 self.client.wait_for_event::<TestCaseIteratorMarker>(deadline)?,
3294 )
3295 }
3296
3297 pub fn r#get_next(
3300 &self,
3301 ___deadline: zx::MonotonicInstant,
3302 ) -> Result<Vec<TestCase>, fidl::Error> {
3303 let _response = self.client.send_query::<
3304 fidl::encoding::EmptyPayload,
3305 TestCaseIteratorGetNextResponse,
3306 TestCaseIteratorMarker,
3307 >(
3308 (),
3309 0x37abec519b2ac1be,
3310 fidl::encoding::DynamicFlags::empty(),
3311 ___deadline,
3312 )?;
3313 Ok(_response.test_cases)
3314 }
3315}
3316
3317#[cfg(target_os = "fuchsia")]
3318impl From<TestCaseIteratorSynchronousProxy> for zx::NullableHandle {
3319 fn from(value: TestCaseIteratorSynchronousProxy) -> Self {
3320 value.into_channel().into()
3321 }
3322}
3323
3324#[cfg(target_os = "fuchsia")]
3325impl From<fidl::Channel> for TestCaseIteratorSynchronousProxy {
3326 fn from(value: fidl::Channel) -> Self {
3327 Self::new(value)
3328 }
3329}
3330
3331#[cfg(target_os = "fuchsia")]
3332impl fidl::endpoints::FromClient for TestCaseIteratorSynchronousProxy {
3333 type Protocol = TestCaseIteratorMarker;
3334
3335 fn from_client(value: fidl::endpoints::ClientEnd<TestCaseIteratorMarker>) -> Self {
3336 Self::new(value.into_channel())
3337 }
3338}
3339
3340#[derive(Debug, Clone)]
3341pub struct TestCaseIteratorProxy {
3342 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3343}
3344
3345impl fidl::endpoints::Proxy for TestCaseIteratorProxy {
3346 type Protocol = TestCaseIteratorMarker;
3347
3348 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3349 Self::new(inner)
3350 }
3351
3352 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3353 self.client.into_channel().map_err(|client| Self { client })
3354 }
3355
3356 fn as_channel(&self) -> &::fidl::AsyncChannel {
3357 self.client.as_channel()
3358 }
3359}
3360
3361impl TestCaseIteratorProxy {
3362 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3364 let protocol_name = <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3365 Self { client: fidl::client::Client::new(channel, protocol_name) }
3366 }
3367
3368 pub fn take_event_stream(&self) -> TestCaseIteratorEventStream {
3374 TestCaseIteratorEventStream { event_receiver: self.client.take_event_receiver() }
3375 }
3376
3377 pub fn r#get_next(
3380 &self,
3381 ) -> fidl::client::QueryResponseFut<Vec<TestCase>, fidl::encoding::DefaultFuchsiaResourceDialect>
3382 {
3383 TestCaseIteratorProxyInterface::r#get_next(self)
3384 }
3385}
3386
3387impl TestCaseIteratorProxyInterface for TestCaseIteratorProxy {
3388 type GetNextResponseFut = fidl::client::QueryResponseFut<
3389 Vec<TestCase>,
3390 fidl::encoding::DefaultFuchsiaResourceDialect,
3391 >;
3392 fn r#get_next(&self) -> Self::GetNextResponseFut {
3393 fn _decode(
3394 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3395 ) -> Result<Vec<TestCase>, fidl::Error> {
3396 let _response = fidl::client::decode_transaction_body::<
3397 TestCaseIteratorGetNextResponse,
3398 fidl::encoding::DefaultFuchsiaResourceDialect,
3399 0x37abec519b2ac1be,
3400 >(_buf?)?;
3401 Ok(_response.test_cases)
3402 }
3403 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<TestCase>>(
3404 (),
3405 0x37abec519b2ac1be,
3406 fidl::encoding::DynamicFlags::empty(),
3407 _decode,
3408 )
3409 }
3410}
3411
3412pub struct TestCaseIteratorEventStream {
3413 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3414}
3415
3416impl std::marker::Unpin for TestCaseIteratorEventStream {}
3417
3418impl futures::stream::FusedStream for TestCaseIteratorEventStream {
3419 fn is_terminated(&self) -> bool {
3420 self.event_receiver.is_terminated()
3421 }
3422}
3423
3424impl futures::Stream for TestCaseIteratorEventStream {
3425 type Item = Result<TestCaseIteratorEvent, fidl::Error>;
3426
3427 fn poll_next(
3428 mut self: std::pin::Pin<&mut Self>,
3429 cx: &mut std::task::Context<'_>,
3430 ) -> std::task::Poll<Option<Self::Item>> {
3431 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3432 &mut self.event_receiver,
3433 cx
3434 )?) {
3435 Some(buf) => std::task::Poll::Ready(Some(TestCaseIteratorEvent::decode(buf))),
3436 None => std::task::Poll::Ready(None),
3437 }
3438 }
3439}
3440
3441#[derive(Debug)]
3442pub enum TestCaseIteratorEvent {}
3443
3444impl TestCaseIteratorEvent {
3445 fn decode(
3447 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3448 ) -> Result<TestCaseIteratorEvent, fidl::Error> {
3449 let (bytes, _handles) = buf.split_mut();
3450 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3451 debug_assert_eq!(tx_header.tx_id, 0);
3452 match tx_header.ordinal {
3453 _ => Err(fidl::Error::UnknownOrdinal {
3454 ordinal: tx_header.ordinal,
3455 protocol_name:
3456 <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3457 }),
3458 }
3459 }
3460}
3461
3462pub struct TestCaseIteratorRequestStream {
3464 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3465 is_terminated: bool,
3466}
3467
3468impl std::marker::Unpin for TestCaseIteratorRequestStream {}
3469
3470impl futures::stream::FusedStream for TestCaseIteratorRequestStream {
3471 fn is_terminated(&self) -> bool {
3472 self.is_terminated
3473 }
3474}
3475
3476impl fidl::endpoints::RequestStream for TestCaseIteratorRequestStream {
3477 type Protocol = TestCaseIteratorMarker;
3478 type ControlHandle = TestCaseIteratorControlHandle;
3479
3480 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3481 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3482 }
3483
3484 fn control_handle(&self) -> Self::ControlHandle {
3485 TestCaseIteratorControlHandle { inner: self.inner.clone() }
3486 }
3487
3488 fn into_inner(
3489 self,
3490 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3491 {
3492 (self.inner, self.is_terminated)
3493 }
3494
3495 fn from_inner(
3496 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3497 is_terminated: bool,
3498 ) -> Self {
3499 Self { inner, is_terminated }
3500 }
3501}
3502
3503impl futures::Stream for TestCaseIteratorRequestStream {
3504 type Item = Result<TestCaseIteratorRequest, fidl::Error>;
3505
3506 fn poll_next(
3507 mut self: std::pin::Pin<&mut Self>,
3508 cx: &mut std::task::Context<'_>,
3509 ) -> std::task::Poll<Option<Self::Item>> {
3510 let this = &mut *self;
3511 if this.inner.check_shutdown(cx) {
3512 this.is_terminated = true;
3513 return std::task::Poll::Ready(None);
3514 }
3515 if this.is_terminated {
3516 panic!("polled TestCaseIteratorRequestStream after completion");
3517 }
3518 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3519 |bytes, handles| {
3520 match this.inner.channel().read_etc(cx, bytes, handles) {
3521 std::task::Poll::Ready(Ok(())) => {}
3522 std::task::Poll::Pending => return std::task::Poll::Pending,
3523 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3524 this.is_terminated = true;
3525 return std::task::Poll::Ready(None);
3526 }
3527 std::task::Poll::Ready(Err(e)) => {
3528 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3529 e.into(),
3530 ))));
3531 }
3532 }
3533
3534 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3536
3537 std::task::Poll::Ready(Some(match header.ordinal {
3538 0x37abec519b2ac1be => {
3539 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3540 let mut req = fidl::new_empty!(
3541 fidl::encoding::EmptyPayload,
3542 fidl::encoding::DefaultFuchsiaResourceDialect
3543 );
3544 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3545 let control_handle =
3546 TestCaseIteratorControlHandle { inner: this.inner.clone() };
3547 Ok(TestCaseIteratorRequest::GetNext {
3548 responder: TestCaseIteratorGetNextResponder {
3549 control_handle: std::mem::ManuallyDrop::new(control_handle),
3550 tx_id: header.tx_id,
3551 },
3552 })
3553 }
3554 _ => Err(fidl::Error::UnknownOrdinal {
3555 ordinal: header.ordinal,
3556 protocol_name:
3557 <TestCaseIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3558 }),
3559 }))
3560 },
3561 )
3562 }
3563}
3564
3565#[derive(Debug)]
3567pub enum TestCaseIteratorRequest {
3568 GetNext { responder: TestCaseIteratorGetNextResponder },
3571}
3572
3573impl TestCaseIteratorRequest {
3574 #[allow(irrefutable_let_patterns)]
3575 pub fn into_get_next(self) -> Option<(TestCaseIteratorGetNextResponder)> {
3576 if let TestCaseIteratorRequest::GetNext { responder } = self {
3577 Some((responder))
3578 } else {
3579 None
3580 }
3581 }
3582
3583 pub fn method_name(&self) -> &'static str {
3585 match *self {
3586 TestCaseIteratorRequest::GetNext { .. } => "get_next",
3587 }
3588 }
3589}
3590
3591#[derive(Debug, Clone)]
3592pub struct TestCaseIteratorControlHandle {
3593 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3594}
3595
3596impl TestCaseIteratorControlHandle {
3597 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3598 self.inner.shutdown_with_epitaph(status.into())
3599 }
3600}
3601
3602impl fidl::endpoints::ControlHandle for TestCaseIteratorControlHandle {
3603 fn shutdown(&self) {
3604 self.inner.shutdown()
3605 }
3606
3607 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3608 self.inner.shutdown_with_epitaph(status)
3609 }
3610
3611 fn is_closed(&self) -> bool {
3612 self.inner.channel().is_closed()
3613 }
3614 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3615 self.inner.channel().on_closed()
3616 }
3617
3618 #[cfg(target_os = "fuchsia")]
3619 fn signal_peer(
3620 &self,
3621 clear_mask: zx::Signals,
3622 set_mask: zx::Signals,
3623 ) -> Result<(), zx_status::Status> {
3624 use fidl::Peered;
3625 self.inner.channel().signal_peer(clear_mask, set_mask)
3626 }
3627}
3628
3629impl TestCaseIteratorControlHandle {}
3630
3631#[must_use = "FIDL methods require a response to be sent"]
3632#[derive(Debug)]
3633pub struct TestCaseIteratorGetNextResponder {
3634 control_handle: std::mem::ManuallyDrop<TestCaseIteratorControlHandle>,
3635 tx_id: u32,
3636}
3637
3638impl std::ops::Drop for TestCaseIteratorGetNextResponder {
3642 fn drop(&mut self) {
3643 self.control_handle.shutdown();
3644 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3646 }
3647}
3648
3649impl fidl::endpoints::Responder for TestCaseIteratorGetNextResponder {
3650 type ControlHandle = TestCaseIteratorControlHandle;
3651
3652 fn control_handle(&self) -> &TestCaseIteratorControlHandle {
3653 &self.control_handle
3654 }
3655
3656 fn drop_without_shutdown(mut self) {
3657 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3659 std::mem::forget(self);
3661 }
3662}
3663
3664impl TestCaseIteratorGetNextResponder {
3665 pub fn send(self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
3669 let _result = self.send_raw(test_cases);
3670 if _result.is_err() {
3671 self.control_handle.shutdown();
3672 }
3673 self.drop_without_shutdown();
3674 _result
3675 }
3676
3677 pub fn send_no_shutdown_on_err(self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
3679 let _result = self.send_raw(test_cases);
3680 self.drop_without_shutdown();
3681 _result
3682 }
3683
3684 fn send_raw(&self, mut test_cases: &[TestCase]) -> Result<(), fidl::Error> {
3685 self.control_handle.inner.send::<TestCaseIteratorGetNextResponse>(
3686 (test_cases,),
3687 self.tx_id,
3688 0x37abec519b2ac1be,
3689 fidl::encoding::DynamicFlags::empty(),
3690 )
3691 }
3692}
3693
3694mod internal {
3695 use super::*;
3696
3697 impl fidl::encoding::ResourceTypeMarker for DebugDataIteratorGetNextCompressedResponse {
3698 type Borrowed<'a> = &'a mut Self;
3699 fn take_or_borrow<'a>(
3700 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3701 ) -> Self::Borrowed<'a> {
3702 value
3703 }
3704 }
3705
3706 unsafe impl fidl::encoding::TypeMarker for DebugDataIteratorGetNextCompressedResponse {
3707 type Owned = Self;
3708
3709 #[inline(always)]
3710 fn inline_align(_context: fidl::encoding::Context) -> usize {
3711 8
3712 }
3713
3714 #[inline(always)]
3715 fn inline_size(_context: fidl::encoding::Context) -> usize {
3716 16
3717 }
3718 }
3719
3720 unsafe impl
3721 fidl::encoding::Encode<
3722 DebugDataIteratorGetNextCompressedResponse,
3723 fidl::encoding::DefaultFuchsiaResourceDialect,
3724 > for &mut DebugDataIteratorGetNextCompressedResponse
3725 {
3726 #[inline]
3727 unsafe fn encode(
3728 self,
3729 encoder: &mut fidl::encoding::Encoder<
3730 '_,
3731 fidl::encoding::DefaultFuchsiaResourceDialect,
3732 >,
3733 offset: usize,
3734 _depth: fidl::encoding::Depth,
3735 ) -> fidl::Result<()> {
3736 encoder.debug_check_bounds::<DebugDataIteratorGetNextCompressedResponse>(offset);
3737 fidl::encoding::Encode::<DebugDataIteratorGetNextCompressedResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3739 (
3740 <fidl::encoding::UnboundedVector<DebugData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
3741 ),
3742 encoder, offset, _depth
3743 )
3744 }
3745 }
3746 unsafe impl<
3747 T0: fidl::encoding::Encode<
3748 fidl::encoding::UnboundedVector<DebugData>,
3749 fidl::encoding::DefaultFuchsiaResourceDialect,
3750 >,
3751 >
3752 fidl::encoding::Encode<
3753 DebugDataIteratorGetNextCompressedResponse,
3754 fidl::encoding::DefaultFuchsiaResourceDialect,
3755 > for (T0,)
3756 {
3757 #[inline]
3758 unsafe fn encode(
3759 self,
3760 encoder: &mut fidl::encoding::Encoder<
3761 '_,
3762 fidl::encoding::DefaultFuchsiaResourceDialect,
3763 >,
3764 offset: usize,
3765 depth: fidl::encoding::Depth,
3766 ) -> fidl::Result<()> {
3767 encoder.debug_check_bounds::<DebugDataIteratorGetNextCompressedResponse>(offset);
3768 self.0.encode(encoder, offset + 0, depth)?;
3772 Ok(())
3773 }
3774 }
3775
3776 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3777 for DebugDataIteratorGetNextCompressedResponse
3778 {
3779 #[inline(always)]
3780 fn new_empty() -> Self {
3781 Self {
3782 data: fidl::new_empty!(
3783 fidl::encoding::UnboundedVector<DebugData>,
3784 fidl::encoding::DefaultFuchsiaResourceDialect
3785 ),
3786 }
3787 }
3788
3789 #[inline]
3790 unsafe fn decode(
3791 &mut self,
3792 decoder: &mut fidl::encoding::Decoder<
3793 '_,
3794 fidl::encoding::DefaultFuchsiaResourceDialect,
3795 >,
3796 offset: usize,
3797 _depth: fidl::encoding::Depth,
3798 ) -> fidl::Result<()> {
3799 decoder.debug_check_bounds::<Self>(offset);
3800 fidl::decode!(
3802 fidl::encoding::UnboundedVector<DebugData>,
3803 fidl::encoding::DefaultFuchsiaResourceDialect,
3804 &mut self.data,
3805 decoder,
3806 offset + 0,
3807 _depth
3808 )?;
3809 Ok(())
3810 }
3811 }
3812
3813 impl fidl::encoding::ResourceTypeMarker for DebugDataIteratorGetNextResponse {
3814 type Borrowed<'a> = &'a mut Self;
3815 fn take_or_borrow<'a>(
3816 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3817 ) -> Self::Borrowed<'a> {
3818 value
3819 }
3820 }
3821
3822 unsafe impl fidl::encoding::TypeMarker for DebugDataIteratorGetNextResponse {
3823 type Owned = Self;
3824
3825 #[inline(always)]
3826 fn inline_align(_context: fidl::encoding::Context) -> usize {
3827 8
3828 }
3829
3830 #[inline(always)]
3831 fn inline_size(_context: fidl::encoding::Context) -> usize {
3832 16
3833 }
3834 }
3835
3836 unsafe impl
3837 fidl::encoding::Encode<
3838 DebugDataIteratorGetNextResponse,
3839 fidl::encoding::DefaultFuchsiaResourceDialect,
3840 > for &mut DebugDataIteratorGetNextResponse
3841 {
3842 #[inline]
3843 unsafe fn encode(
3844 self,
3845 encoder: &mut fidl::encoding::Encoder<
3846 '_,
3847 fidl::encoding::DefaultFuchsiaResourceDialect,
3848 >,
3849 offset: usize,
3850 _depth: fidl::encoding::Depth,
3851 ) -> fidl::Result<()> {
3852 encoder.debug_check_bounds::<DebugDataIteratorGetNextResponse>(offset);
3853 fidl::encoding::Encode::<DebugDataIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3855 (
3856 <fidl::encoding::UnboundedVector<DebugData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
3857 ),
3858 encoder, offset, _depth
3859 )
3860 }
3861 }
3862 unsafe impl<
3863 T0: fidl::encoding::Encode<
3864 fidl::encoding::UnboundedVector<DebugData>,
3865 fidl::encoding::DefaultFuchsiaResourceDialect,
3866 >,
3867 >
3868 fidl::encoding::Encode<
3869 DebugDataIteratorGetNextResponse,
3870 fidl::encoding::DefaultFuchsiaResourceDialect,
3871 > for (T0,)
3872 {
3873 #[inline]
3874 unsafe fn encode(
3875 self,
3876 encoder: &mut fidl::encoding::Encoder<
3877 '_,
3878 fidl::encoding::DefaultFuchsiaResourceDialect,
3879 >,
3880 offset: usize,
3881 depth: fidl::encoding::Depth,
3882 ) -> fidl::Result<()> {
3883 encoder.debug_check_bounds::<DebugDataIteratorGetNextResponse>(offset);
3884 self.0.encode(encoder, offset + 0, depth)?;
3888 Ok(())
3889 }
3890 }
3891
3892 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3893 for DebugDataIteratorGetNextResponse
3894 {
3895 #[inline(always)]
3896 fn new_empty() -> Self {
3897 Self {
3898 data: fidl::new_empty!(
3899 fidl::encoding::UnboundedVector<DebugData>,
3900 fidl::encoding::DefaultFuchsiaResourceDialect
3901 ),
3902 }
3903 }
3904
3905 #[inline]
3906 unsafe fn decode(
3907 &mut self,
3908 decoder: &mut fidl::encoding::Decoder<
3909 '_,
3910 fidl::encoding::DefaultFuchsiaResourceDialect,
3911 >,
3912 offset: usize,
3913 _depth: fidl::encoding::Depth,
3914 ) -> fidl::Result<()> {
3915 decoder.debug_check_bounds::<Self>(offset);
3916 fidl::decode!(
3918 fidl::encoding::UnboundedVector<DebugData>,
3919 fidl::encoding::DefaultFuchsiaResourceDialect,
3920 &mut self.data,
3921 decoder,
3922 offset + 0,
3923 _depth
3924 )?;
3925 Ok(())
3926 }
3927 }
3928
3929 impl fidl::encoding::ResourceTypeMarker for DirectoryAndToken {
3930 type Borrowed<'a> = &'a mut Self;
3931 fn take_or_borrow<'a>(
3932 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3933 ) -> Self::Borrowed<'a> {
3934 value
3935 }
3936 }
3937
3938 unsafe impl fidl::encoding::TypeMarker for DirectoryAndToken {
3939 type Owned = Self;
3940
3941 #[inline(always)]
3942 fn inline_align(_context: fidl::encoding::Context) -> usize {
3943 4
3944 }
3945
3946 #[inline(always)]
3947 fn inline_size(_context: fidl::encoding::Context) -> usize {
3948 8
3949 }
3950 }
3951
3952 unsafe impl
3953 fidl::encoding::Encode<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>
3954 for &mut DirectoryAndToken
3955 {
3956 #[inline]
3957 unsafe fn encode(
3958 self,
3959 encoder: &mut fidl::encoding::Encoder<
3960 '_,
3961 fidl::encoding::DefaultFuchsiaResourceDialect,
3962 >,
3963 offset: usize,
3964 _depth: fidl::encoding::Depth,
3965 ) -> fidl::Result<()> {
3966 encoder.debug_check_bounds::<DirectoryAndToken>(offset);
3967 fidl::encoding::Encode::<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3969 (
3970 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.directory),
3971 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
3972 ),
3973 encoder, offset, _depth
3974 )
3975 }
3976 }
3977 unsafe impl<
3978 T0: fidl::encoding::Encode<
3979 fidl::encoding::Endpoint<
3980 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
3981 >,
3982 fidl::encoding::DefaultFuchsiaResourceDialect,
3983 >,
3984 T1: fidl::encoding::Encode<
3985 fidl::encoding::HandleType<
3986 fidl::EventPair,
3987 { fidl::ObjectType::EVENTPAIR.into_raw() },
3988 2147483648,
3989 >,
3990 fidl::encoding::DefaultFuchsiaResourceDialect,
3991 >,
3992 > fidl::encoding::Encode<DirectoryAndToken, fidl::encoding::DefaultFuchsiaResourceDialect>
3993 for (T0, T1)
3994 {
3995 #[inline]
3996 unsafe fn encode(
3997 self,
3998 encoder: &mut fidl::encoding::Encoder<
3999 '_,
4000 fidl::encoding::DefaultFuchsiaResourceDialect,
4001 >,
4002 offset: usize,
4003 depth: fidl::encoding::Depth,
4004 ) -> fidl::Result<()> {
4005 encoder.debug_check_bounds::<DirectoryAndToken>(offset);
4006 self.0.encode(encoder, offset + 0, depth)?;
4010 self.1.encode(encoder, offset + 4, depth)?;
4011 Ok(())
4012 }
4013 }
4014
4015 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4016 for DirectoryAndToken
4017 {
4018 #[inline(always)]
4019 fn new_empty() -> Self {
4020 Self {
4021 directory: fidl::new_empty!(
4022 fidl::encoding::Endpoint<
4023 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4024 >,
4025 fidl::encoding::DefaultFuchsiaResourceDialect
4026 ),
4027 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4028 }
4029 }
4030
4031 #[inline]
4032 unsafe fn decode(
4033 &mut self,
4034 decoder: &mut fidl::encoding::Decoder<
4035 '_,
4036 fidl::encoding::DefaultFuchsiaResourceDialect,
4037 >,
4038 offset: usize,
4039 _depth: fidl::encoding::Depth,
4040 ) -> fidl::Result<()> {
4041 decoder.debug_check_bounds::<Self>(offset);
4042 fidl::decode!(
4044 fidl::encoding::Endpoint<
4045 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
4046 >,
4047 fidl::encoding::DefaultFuchsiaResourceDialect,
4048 &mut self.directory,
4049 decoder,
4050 offset + 0,
4051 _depth
4052 )?;
4053 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 4, _depth)?;
4054 Ok(())
4055 }
4056 }
4057
4058 impl fidl::encoding::ResourceTypeMarker for EarlyBootProfileRegisterWatcherRequest {
4059 type Borrowed<'a> = &'a mut Self;
4060 fn take_or_borrow<'a>(
4061 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4062 ) -> Self::Borrowed<'a> {
4063 value
4064 }
4065 }
4066
4067 unsafe impl fidl::encoding::TypeMarker for EarlyBootProfileRegisterWatcherRequest {
4068 type Owned = Self;
4069
4070 #[inline(always)]
4071 fn inline_align(_context: fidl::encoding::Context) -> usize {
4072 4
4073 }
4074
4075 #[inline(always)]
4076 fn inline_size(_context: fidl::encoding::Context) -> usize {
4077 4
4078 }
4079 }
4080
4081 unsafe impl
4082 fidl::encoding::Encode<
4083 EarlyBootProfileRegisterWatcherRequest,
4084 fidl::encoding::DefaultFuchsiaResourceDialect,
4085 > for &mut EarlyBootProfileRegisterWatcherRequest
4086 {
4087 #[inline]
4088 unsafe fn encode(
4089 self,
4090 encoder: &mut fidl::encoding::Encoder<
4091 '_,
4092 fidl::encoding::DefaultFuchsiaResourceDialect,
4093 >,
4094 offset: usize,
4095 _depth: fidl::encoding::Depth,
4096 ) -> fidl::Result<()> {
4097 encoder.debug_check_bounds::<EarlyBootProfileRegisterWatcherRequest>(offset);
4098 fidl::encoding::Encode::<EarlyBootProfileRegisterWatcherRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4100 (
4101 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
4102 ),
4103 encoder, offset, _depth
4104 )
4105 }
4106 }
4107 unsafe impl<
4108 T0: fidl::encoding::Encode<
4109 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
4110 fidl::encoding::DefaultFuchsiaResourceDialect,
4111 >,
4112 >
4113 fidl::encoding::Encode<
4114 EarlyBootProfileRegisterWatcherRequest,
4115 fidl::encoding::DefaultFuchsiaResourceDialect,
4116 > for (T0,)
4117 {
4118 #[inline]
4119 unsafe fn encode(
4120 self,
4121 encoder: &mut fidl::encoding::Encoder<
4122 '_,
4123 fidl::encoding::DefaultFuchsiaResourceDialect,
4124 >,
4125 offset: usize,
4126 depth: fidl::encoding::Depth,
4127 ) -> fidl::Result<()> {
4128 encoder.debug_check_bounds::<EarlyBootProfileRegisterWatcherRequest>(offset);
4129 self.0.encode(encoder, offset + 0, depth)?;
4133 Ok(())
4134 }
4135 }
4136
4137 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4138 for EarlyBootProfileRegisterWatcherRequest
4139 {
4140 #[inline(always)]
4141 fn new_empty() -> Self {
4142 Self {
4143 iterator: fidl::new_empty!(
4144 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
4145 fidl::encoding::DefaultFuchsiaResourceDialect
4146 ),
4147 }
4148 }
4149
4150 #[inline]
4151 unsafe fn decode(
4152 &mut self,
4153 decoder: &mut fidl::encoding::Decoder<
4154 '_,
4155 fidl::encoding::DefaultFuchsiaResourceDialect,
4156 >,
4157 offset: usize,
4158 _depth: fidl::encoding::Depth,
4159 ) -> fidl::Result<()> {
4160 decoder.debug_check_bounds::<Self>(offset);
4161 fidl::decode!(
4163 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DebugDataIteratorMarker>>,
4164 fidl::encoding::DefaultFuchsiaResourceDialect,
4165 &mut self.iterator,
4166 decoder,
4167 offset + 0,
4168 _depth
4169 )?;
4170 Ok(())
4171 }
4172 }
4173
4174 impl fidl::encoding::ResourceTypeMarker for SuiteControllerWatchEventsResponse {
4175 type Borrowed<'a> = &'a mut Self;
4176 fn take_or_borrow<'a>(
4177 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4178 ) -> Self::Borrowed<'a> {
4179 value
4180 }
4181 }
4182
4183 unsafe impl fidl::encoding::TypeMarker for SuiteControllerWatchEventsResponse {
4184 type Owned = Self;
4185
4186 #[inline(always)]
4187 fn inline_align(_context: fidl::encoding::Context) -> usize {
4188 8
4189 }
4190
4191 #[inline(always)]
4192 fn inline_size(_context: fidl::encoding::Context) -> usize {
4193 16
4194 }
4195 }
4196
4197 unsafe impl
4198 fidl::encoding::Encode<
4199 SuiteControllerWatchEventsResponse,
4200 fidl::encoding::DefaultFuchsiaResourceDialect,
4201 > for &mut SuiteControllerWatchEventsResponse
4202 {
4203 #[inline]
4204 unsafe fn encode(
4205 self,
4206 encoder: &mut fidl::encoding::Encoder<
4207 '_,
4208 fidl::encoding::DefaultFuchsiaResourceDialect,
4209 >,
4210 offset: usize,
4211 _depth: fidl::encoding::Depth,
4212 ) -> fidl::Result<()> {
4213 encoder.debug_check_bounds::<SuiteControllerWatchEventsResponse>(offset);
4214 fidl::encoding::Encode::<SuiteControllerWatchEventsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4216 (
4217 <fidl::encoding::Vector<Event, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
4218 ),
4219 encoder, offset, _depth
4220 )
4221 }
4222 }
4223 unsafe impl<
4224 T0: fidl::encoding::Encode<
4225 fidl::encoding::Vector<Event, 1024>,
4226 fidl::encoding::DefaultFuchsiaResourceDialect,
4227 >,
4228 >
4229 fidl::encoding::Encode<
4230 SuiteControllerWatchEventsResponse,
4231 fidl::encoding::DefaultFuchsiaResourceDialect,
4232 > for (T0,)
4233 {
4234 #[inline]
4235 unsafe fn encode(
4236 self,
4237 encoder: &mut fidl::encoding::Encoder<
4238 '_,
4239 fidl::encoding::DefaultFuchsiaResourceDialect,
4240 >,
4241 offset: usize,
4242 depth: fidl::encoding::Depth,
4243 ) -> fidl::Result<()> {
4244 encoder.debug_check_bounds::<SuiteControllerWatchEventsResponse>(offset);
4245 self.0.encode(encoder, offset + 0, depth)?;
4249 Ok(())
4250 }
4251 }
4252
4253 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4254 for SuiteControllerWatchEventsResponse
4255 {
4256 #[inline(always)]
4257 fn new_empty() -> Self {
4258 Self {
4259 events: fidl::new_empty!(fidl::encoding::Vector<Event, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
4260 }
4261 }
4262
4263 #[inline]
4264 unsafe fn decode(
4265 &mut self,
4266 decoder: &mut fidl::encoding::Decoder<
4267 '_,
4268 fidl::encoding::DefaultFuchsiaResourceDialect,
4269 >,
4270 offset: usize,
4271 _depth: fidl::encoding::Depth,
4272 ) -> fidl::Result<()> {
4273 decoder.debug_check_bounds::<Self>(offset);
4274 fidl::decode!(fidl::encoding::Vector<Event, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.events, decoder, offset + 0, _depth)?;
4276 Ok(())
4277 }
4278 }
4279
4280 impl fidl::encoding::ResourceTypeMarker for SuiteRunnerRunRequest {
4281 type Borrowed<'a> = &'a mut Self;
4282 fn take_or_borrow<'a>(
4283 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4284 ) -> Self::Borrowed<'a> {
4285 value
4286 }
4287 }
4288
4289 unsafe impl fidl::encoding::TypeMarker for SuiteRunnerRunRequest {
4290 type Owned = Self;
4291
4292 #[inline(always)]
4293 fn inline_align(_context: fidl::encoding::Context) -> usize {
4294 8
4295 }
4296
4297 #[inline(always)]
4298 fn inline_size(_context: fidl::encoding::Context) -> usize {
4299 40
4300 }
4301 }
4302
4303 unsafe impl
4304 fidl::encoding::Encode<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4305 for &mut SuiteRunnerRunRequest
4306 {
4307 #[inline]
4308 unsafe fn encode(
4309 self,
4310 encoder: &mut fidl::encoding::Encoder<
4311 '_,
4312 fidl::encoding::DefaultFuchsiaResourceDialect,
4313 >,
4314 offset: usize,
4315 _depth: fidl::encoding::Depth,
4316 ) -> fidl::Result<()> {
4317 encoder.debug_check_bounds::<SuiteRunnerRunRequest>(offset);
4318 fidl::encoding::Encode::<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4320 (
4321 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_suite_url),
4322 <RunSuiteOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
4323 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
4324 ),
4325 encoder, offset, _depth
4326 )
4327 }
4328 }
4329 unsafe impl<
4330 T0: fidl::encoding::Encode<
4331 fidl::encoding::BoundedString<4096>,
4332 fidl::encoding::DefaultFuchsiaResourceDialect,
4333 >,
4334 T1: fidl::encoding::Encode<RunSuiteOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
4335 T2: fidl::encoding::Encode<
4336 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
4337 fidl::encoding::DefaultFuchsiaResourceDialect,
4338 >,
4339 >
4340 fidl::encoding::Encode<SuiteRunnerRunRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4341 for (T0, T1, T2)
4342 {
4343 #[inline]
4344 unsafe fn encode(
4345 self,
4346 encoder: &mut fidl::encoding::Encoder<
4347 '_,
4348 fidl::encoding::DefaultFuchsiaResourceDialect,
4349 >,
4350 offset: usize,
4351 depth: fidl::encoding::Depth,
4352 ) -> fidl::Result<()> {
4353 encoder.debug_check_bounds::<SuiteRunnerRunRequest>(offset);
4354 unsafe {
4357 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
4358 (ptr as *mut u64).write_unaligned(0);
4359 }
4360 self.0.encode(encoder, offset + 0, depth)?;
4362 self.1.encode(encoder, offset + 16, depth)?;
4363 self.2.encode(encoder, offset + 32, depth)?;
4364 Ok(())
4365 }
4366 }
4367
4368 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4369 for SuiteRunnerRunRequest
4370 {
4371 #[inline(always)]
4372 fn new_empty() -> Self {
4373 Self {
4374 test_suite_url: fidl::new_empty!(
4375 fidl::encoding::BoundedString<4096>,
4376 fidl::encoding::DefaultFuchsiaResourceDialect
4377 ),
4378 options: fidl::new_empty!(
4379 RunSuiteOptions,
4380 fidl::encoding::DefaultFuchsiaResourceDialect
4381 ),
4382 controller: fidl::new_empty!(
4383 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
4384 fidl::encoding::DefaultFuchsiaResourceDialect
4385 ),
4386 }
4387 }
4388
4389 #[inline]
4390 unsafe fn decode(
4391 &mut self,
4392 decoder: &mut fidl::encoding::Decoder<
4393 '_,
4394 fidl::encoding::DefaultFuchsiaResourceDialect,
4395 >,
4396 offset: usize,
4397 _depth: fidl::encoding::Depth,
4398 ) -> fidl::Result<()> {
4399 decoder.debug_check_bounds::<Self>(offset);
4400 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
4402 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4403 let mask = 0xffffffff00000000u64;
4404 let maskedval = padval & mask;
4405 if maskedval != 0 {
4406 return Err(fidl::Error::NonZeroPadding {
4407 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
4408 });
4409 }
4410 fidl::decode!(
4411 fidl::encoding::BoundedString<4096>,
4412 fidl::encoding::DefaultFuchsiaResourceDialect,
4413 &mut self.test_suite_url,
4414 decoder,
4415 offset + 0,
4416 _depth
4417 )?;
4418 fidl::decode!(
4419 RunSuiteOptions,
4420 fidl::encoding::DefaultFuchsiaResourceDialect,
4421 &mut self.options,
4422 decoder,
4423 offset + 16,
4424 _depth
4425 )?;
4426 fidl::decode!(
4427 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SuiteControllerMarker>>,
4428 fidl::encoding::DefaultFuchsiaResourceDialect,
4429 &mut self.controller,
4430 decoder,
4431 offset + 32,
4432 _depth
4433 )?;
4434 Ok(())
4435 }
4436 }
4437
4438 impl fidl::encoding::ResourceTypeMarker for TestCaseEnumeratorEnumerateRequest {
4439 type Borrowed<'a> = &'a mut Self;
4440 fn take_or_borrow<'a>(
4441 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4442 ) -> Self::Borrowed<'a> {
4443 value
4444 }
4445 }
4446
4447 unsafe impl fidl::encoding::TypeMarker for TestCaseEnumeratorEnumerateRequest {
4448 type Owned = Self;
4449
4450 #[inline(always)]
4451 fn inline_align(_context: fidl::encoding::Context) -> usize {
4452 8
4453 }
4454
4455 #[inline(always)]
4456 fn inline_size(_context: fidl::encoding::Context) -> usize {
4457 40
4458 }
4459 }
4460
4461 unsafe impl
4462 fidl::encoding::Encode<
4463 TestCaseEnumeratorEnumerateRequest,
4464 fidl::encoding::DefaultFuchsiaResourceDialect,
4465 > for &mut TestCaseEnumeratorEnumerateRequest
4466 {
4467 #[inline]
4468 unsafe fn encode(
4469 self,
4470 encoder: &mut fidl::encoding::Encoder<
4471 '_,
4472 fidl::encoding::DefaultFuchsiaResourceDialect,
4473 >,
4474 offset: usize,
4475 _depth: fidl::encoding::Depth,
4476 ) -> fidl::Result<()> {
4477 encoder.debug_check_bounds::<TestCaseEnumeratorEnumerateRequest>(offset);
4478 fidl::encoding::Encode::<TestCaseEnumeratorEnumerateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4480 (
4481 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.test_suite_url),
4482 <EnumerateTestCasesOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.options),
4483 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
4484 ),
4485 encoder, offset, _depth
4486 )
4487 }
4488 }
4489 unsafe impl<
4490 T0: fidl::encoding::Encode<
4491 fidl::encoding::BoundedString<4096>,
4492 fidl::encoding::DefaultFuchsiaResourceDialect,
4493 >,
4494 T1: fidl::encoding::Encode<
4495 EnumerateTestCasesOptions,
4496 fidl::encoding::DefaultFuchsiaResourceDialect,
4497 >,
4498 T2: fidl::encoding::Encode<
4499 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
4500 fidl::encoding::DefaultFuchsiaResourceDialect,
4501 >,
4502 >
4503 fidl::encoding::Encode<
4504 TestCaseEnumeratorEnumerateRequest,
4505 fidl::encoding::DefaultFuchsiaResourceDialect,
4506 > for (T0, T1, T2)
4507 {
4508 #[inline]
4509 unsafe fn encode(
4510 self,
4511 encoder: &mut fidl::encoding::Encoder<
4512 '_,
4513 fidl::encoding::DefaultFuchsiaResourceDialect,
4514 >,
4515 offset: usize,
4516 depth: fidl::encoding::Depth,
4517 ) -> fidl::Result<()> {
4518 encoder.debug_check_bounds::<TestCaseEnumeratorEnumerateRequest>(offset);
4519 unsafe {
4522 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
4523 (ptr as *mut u64).write_unaligned(0);
4524 }
4525 self.0.encode(encoder, offset + 0, depth)?;
4527 self.1.encode(encoder, offset + 16, depth)?;
4528 self.2.encode(encoder, offset + 32, depth)?;
4529 Ok(())
4530 }
4531 }
4532
4533 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4534 for TestCaseEnumeratorEnumerateRequest
4535 {
4536 #[inline(always)]
4537 fn new_empty() -> Self {
4538 Self {
4539 test_suite_url: fidl::new_empty!(
4540 fidl::encoding::BoundedString<4096>,
4541 fidl::encoding::DefaultFuchsiaResourceDialect
4542 ),
4543 options: fidl::new_empty!(
4544 EnumerateTestCasesOptions,
4545 fidl::encoding::DefaultFuchsiaResourceDialect
4546 ),
4547 iterator: fidl::new_empty!(
4548 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
4549 fidl::encoding::DefaultFuchsiaResourceDialect
4550 ),
4551 }
4552 }
4553
4554 #[inline]
4555 unsafe fn decode(
4556 &mut self,
4557 decoder: &mut fidl::encoding::Decoder<
4558 '_,
4559 fidl::encoding::DefaultFuchsiaResourceDialect,
4560 >,
4561 offset: usize,
4562 _depth: fidl::encoding::Depth,
4563 ) -> fidl::Result<()> {
4564 decoder.debug_check_bounds::<Self>(offset);
4565 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
4567 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4568 let mask = 0xffffffff00000000u64;
4569 let maskedval = padval & mask;
4570 if maskedval != 0 {
4571 return Err(fidl::Error::NonZeroPadding {
4572 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
4573 });
4574 }
4575 fidl::decode!(
4576 fidl::encoding::BoundedString<4096>,
4577 fidl::encoding::DefaultFuchsiaResourceDialect,
4578 &mut self.test_suite_url,
4579 decoder,
4580 offset + 0,
4581 _depth
4582 )?;
4583 fidl::decode!(
4584 EnumerateTestCasesOptions,
4585 fidl::encoding::DefaultFuchsiaResourceDialect,
4586 &mut self.options,
4587 decoder,
4588 offset + 16,
4589 _depth
4590 )?;
4591 fidl::decode!(
4592 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TestCaseIteratorMarker>>,
4593 fidl::encoding::DefaultFuchsiaResourceDialect,
4594 &mut self.iterator,
4595 decoder,
4596 offset + 32,
4597 _depth
4598 )?;
4599 Ok(())
4600 }
4601 }
4602
4603 impl CustomArtifact {
4604 #[inline(always)]
4605 fn max_ordinal_present(&self) -> u64 {
4606 if let Some(_) = self.directory_and_token {
4607 return 2;
4608 }
4609 if let Some(_) = self.component_moniker {
4610 return 1;
4611 }
4612 0
4613 }
4614 }
4615
4616 impl fidl::encoding::ResourceTypeMarker for CustomArtifact {
4617 type Borrowed<'a> = &'a mut Self;
4618 fn take_or_borrow<'a>(
4619 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4620 ) -> Self::Borrowed<'a> {
4621 value
4622 }
4623 }
4624
4625 unsafe impl fidl::encoding::TypeMarker for CustomArtifact {
4626 type Owned = Self;
4627
4628 #[inline(always)]
4629 fn inline_align(_context: fidl::encoding::Context) -> usize {
4630 8
4631 }
4632
4633 #[inline(always)]
4634 fn inline_size(_context: fidl::encoding::Context) -> usize {
4635 16
4636 }
4637 }
4638
4639 unsafe impl
4640 fidl::encoding::Encode<CustomArtifact, fidl::encoding::DefaultFuchsiaResourceDialect>
4641 for &mut CustomArtifact
4642 {
4643 unsafe fn encode(
4644 self,
4645 encoder: &mut fidl::encoding::Encoder<
4646 '_,
4647 fidl::encoding::DefaultFuchsiaResourceDialect,
4648 >,
4649 offset: usize,
4650 mut depth: fidl::encoding::Depth,
4651 ) -> fidl::Result<()> {
4652 encoder.debug_check_bounds::<CustomArtifact>(offset);
4653 let max_ordinal: u64 = self.max_ordinal_present();
4655 encoder.write_num(max_ordinal, offset);
4656 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4657 if max_ordinal == 0 {
4659 return Ok(());
4660 }
4661 depth.increment()?;
4662 let envelope_size = 8;
4663 let bytes_len = max_ordinal as usize * envelope_size;
4664 #[allow(unused_variables)]
4665 let offset = encoder.out_of_line_offset(bytes_len);
4666 let mut _prev_end_offset: usize = 0;
4667 if 1 > max_ordinal {
4668 return Ok(());
4669 }
4670
4671 let cur_offset: usize = (1 - 1) * envelope_size;
4674
4675 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4677
4678 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4683 self.component_moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
4684 encoder, offset + cur_offset, depth
4685 )?;
4686
4687 _prev_end_offset = cur_offset + envelope_size;
4688 if 2 > max_ordinal {
4689 return Ok(());
4690 }
4691
4692 let cur_offset: usize = (2 - 1) * envelope_size;
4695
4696 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4698
4699 fidl::encoding::encode_in_envelope_optional::<
4704 DirectoryAndToken,
4705 fidl::encoding::DefaultFuchsiaResourceDialect,
4706 >(
4707 self.directory_and_token
4708 .as_mut()
4709 .map(<DirectoryAndToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4710 encoder,
4711 offset + cur_offset,
4712 depth,
4713 )?;
4714
4715 _prev_end_offset = cur_offset + envelope_size;
4716
4717 Ok(())
4718 }
4719 }
4720
4721 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4722 for CustomArtifact
4723 {
4724 #[inline(always)]
4725 fn new_empty() -> Self {
4726 Self::default()
4727 }
4728
4729 unsafe fn decode(
4730 &mut self,
4731 decoder: &mut fidl::encoding::Decoder<
4732 '_,
4733 fidl::encoding::DefaultFuchsiaResourceDialect,
4734 >,
4735 offset: usize,
4736 mut depth: fidl::encoding::Depth,
4737 ) -> fidl::Result<()> {
4738 decoder.debug_check_bounds::<Self>(offset);
4739 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4740 None => return Err(fidl::Error::NotNullable),
4741 Some(len) => len,
4742 };
4743 if len == 0 {
4745 return Ok(());
4746 };
4747 depth.increment()?;
4748 let envelope_size = 8;
4749 let bytes_len = len * envelope_size;
4750 let offset = decoder.out_of_line_offset(bytes_len)?;
4751 let mut _next_ordinal_to_read = 0;
4753 let mut next_offset = offset;
4754 let end_offset = offset + bytes_len;
4755 _next_ordinal_to_read += 1;
4756 if next_offset >= end_offset {
4757 return Ok(());
4758 }
4759
4760 while _next_ordinal_to_read < 1 {
4762 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4763 _next_ordinal_to_read += 1;
4764 next_offset += envelope_size;
4765 }
4766
4767 let next_out_of_line = decoder.next_out_of_line();
4768 let handles_before = decoder.remaining_handles();
4769 if let Some((inlined, num_bytes, num_handles)) =
4770 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4771 {
4772 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4773 if inlined != (member_inline_size <= 4) {
4774 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4775 }
4776 let inner_offset;
4777 let mut inner_depth = depth.clone();
4778 if inlined {
4779 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4780 inner_offset = next_offset;
4781 } else {
4782 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4783 inner_depth.increment()?;
4784 }
4785 let val_ref = self.component_moniker.get_or_insert_with(|| {
4786 fidl::new_empty!(
4787 fidl::encoding::BoundedString<4096>,
4788 fidl::encoding::DefaultFuchsiaResourceDialect
4789 )
4790 });
4791 fidl::decode!(
4792 fidl::encoding::BoundedString<4096>,
4793 fidl::encoding::DefaultFuchsiaResourceDialect,
4794 val_ref,
4795 decoder,
4796 inner_offset,
4797 inner_depth
4798 )?;
4799 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4800 {
4801 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4802 }
4803 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4804 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4805 }
4806 }
4807
4808 next_offset += envelope_size;
4809 _next_ordinal_to_read += 1;
4810 if next_offset >= end_offset {
4811 return Ok(());
4812 }
4813
4814 while _next_ordinal_to_read < 2 {
4816 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4817 _next_ordinal_to_read += 1;
4818 next_offset += envelope_size;
4819 }
4820
4821 let next_out_of_line = decoder.next_out_of_line();
4822 let handles_before = decoder.remaining_handles();
4823 if let Some((inlined, num_bytes, num_handles)) =
4824 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4825 {
4826 let member_inline_size =
4827 <DirectoryAndToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4828 if inlined != (member_inline_size <= 4) {
4829 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4830 }
4831 let inner_offset;
4832 let mut inner_depth = depth.clone();
4833 if inlined {
4834 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4835 inner_offset = next_offset;
4836 } else {
4837 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4838 inner_depth.increment()?;
4839 }
4840 let val_ref = self.directory_and_token.get_or_insert_with(|| {
4841 fidl::new_empty!(
4842 DirectoryAndToken,
4843 fidl::encoding::DefaultFuchsiaResourceDialect
4844 )
4845 });
4846 fidl::decode!(
4847 DirectoryAndToken,
4848 fidl::encoding::DefaultFuchsiaResourceDialect,
4849 val_ref,
4850 decoder,
4851 inner_offset,
4852 inner_depth
4853 )?;
4854 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4855 {
4856 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4857 }
4858 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4859 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4860 }
4861 }
4862
4863 next_offset += envelope_size;
4864
4865 while next_offset < end_offset {
4867 _next_ordinal_to_read += 1;
4868 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4869 next_offset += envelope_size;
4870 }
4871
4872 Ok(())
4873 }
4874 }
4875
4876 impl DebugData {
4877 #[inline(always)]
4878 fn max_ordinal_present(&self) -> u64 {
4879 if let Some(_) = self.socket {
4880 return 2;
4881 }
4882 if let Some(_) = self.name {
4883 return 1;
4884 }
4885 0
4886 }
4887 }
4888
4889 impl fidl::encoding::ResourceTypeMarker for DebugData {
4890 type Borrowed<'a> = &'a mut Self;
4891 fn take_or_borrow<'a>(
4892 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4893 ) -> Self::Borrowed<'a> {
4894 value
4895 }
4896 }
4897
4898 unsafe impl fidl::encoding::TypeMarker for DebugData {
4899 type Owned = Self;
4900
4901 #[inline(always)]
4902 fn inline_align(_context: fidl::encoding::Context) -> usize {
4903 8
4904 }
4905
4906 #[inline(always)]
4907 fn inline_size(_context: fidl::encoding::Context) -> usize {
4908 16
4909 }
4910 }
4911
4912 unsafe impl fidl::encoding::Encode<DebugData, fidl::encoding::DefaultFuchsiaResourceDialect>
4913 for &mut DebugData
4914 {
4915 unsafe fn encode(
4916 self,
4917 encoder: &mut fidl::encoding::Encoder<
4918 '_,
4919 fidl::encoding::DefaultFuchsiaResourceDialect,
4920 >,
4921 offset: usize,
4922 mut depth: fidl::encoding::Depth,
4923 ) -> fidl::Result<()> {
4924 encoder.debug_check_bounds::<DebugData>(offset);
4925 let max_ordinal: u64 = self.max_ordinal_present();
4927 encoder.write_num(max_ordinal, offset);
4928 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4929 if max_ordinal == 0 {
4931 return Ok(());
4932 }
4933 depth.increment()?;
4934 let envelope_size = 8;
4935 let bytes_len = max_ordinal as usize * envelope_size;
4936 #[allow(unused_variables)]
4937 let offset = encoder.out_of_line_offset(bytes_len);
4938 let mut _prev_end_offset: usize = 0;
4939 if 1 > max_ordinal {
4940 return Ok(());
4941 }
4942
4943 let cur_offset: usize = (1 - 1) * envelope_size;
4946
4947 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4949
4950 fidl::encoding::encode_in_envelope_optional::<
4955 fidl::encoding::BoundedString<512>,
4956 fidl::encoding::DefaultFuchsiaResourceDialect,
4957 >(
4958 self.name.as_ref().map(
4959 <fidl::encoding::BoundedString<512> as fidl::encoding::ValueTypeMarker>::borrow,
4960 ),
4961 encoder,
4962 offset + cur_offset,
4963 depth,
4964 )?;
4965
4966 _prev_end_offset = cur_offset + envelope_size;
4967 if 2 > max_ordinal {
4968 return Ok(());
4969 }
4970
4971 let cur_offset: usize = (2 - 1) * envelope_size;
4974
4975 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4977
4978 fidl::encoding::encode_in_envelope_optional::<
4983 fidl::encoding::HandleType<
4984 fidl::Socket,
4985 { fidl::ObjectType::SOCKET.into_raw() },
4986 2147483648,
4987 >,
4988 fidl::encoding::DefaultFuchsiaResourceDialect,
4989 >(
4990 self.socket.as_mut().map(
4991 <fidl::encoding::HandleType<
4992 fidl::Socket,
4993 { fidl::ObjectType::SOCKET.into_raw() },
4994 2147483648,
4995 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
4996 ),
4997 encoder,
4998 offset + cur_offset,
4999 depth,
5000 )?;
5001
5002 _prev_end_offset = cur_offset + envelope_size;
5003
5004 Ok(())
5005 }
5006 }
5007
5008 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DebugData {
5009 #[inline(always)]
5010 fn new_empty() -> Self {
5011 Self::default()
5012 }
5013
5014 unsafe fn decode(
5015 &mut self,
5016 decoder: &mut fidl::encoding::Decoder<
5017 '_,
5018 fidl::encoding::DefaultFuchsiaResourceDialect,
5019 >,
5020 offset: usize,
5021 mut depth: fidl::encoding::Depth,
5022 ) -> fidl::Result<()> {
5023 decoder.debug_check_bounds::<Self>(offset);
5024 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5025 None => return Err(fidl::Error::NotNullable),
5026 Some(len) => len,
5027 };
5028 if len == 0 {
5030 return Ok(());
5031 };
5032 depth.increment()?;
5033 let envelope_size = 8;
5034 let bytes_len = len * envelope_size;
5035 let offset = decoder.out_of_line_offset(bytes_len)?;
5036 let mut _next_ordinal_to_read = 0;
5038 let mut next_offset = offset;
5039 let end_offset = offset + bytes_len;
5040 _next_ordinal_to_read += 1;
5041 if next_offset >= end_offset {
5042 return Ok(());
5043 }
5044
5045 while _next_ordinal_to_read < 1 {
5047 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5048 _next_ordinal_to_read += 1;
5049 next_offset += envelope_size;
5050 }
5051
5052 let next_out_of_line = decoder.next_out_of_line();
5053 let handles_before = decoder.remaining_handles();
5054 if let Some((inlined, num_bytes, num_handles)) =
5055 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5056 {
5057 let member_inline_size =
5058 <fidl::encoding::BoundedString<512> as fidl::encoding::TypeMarker>::inline_size(
5059 decoder.context,
5060 );
5061 if inlined != (member_inline_size <= 4) {
5062 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5063 }
5064 let inner_offset;
5065 let mut inner_depth = depth.clone();
5066 if inlined {
5067 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5068 inner_offset = next_offset;
5069 } else {
5070 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5071 inner_depth.increment()?;
5072 }
5073 let val_ref = self.name.get_or_insert_with(|| {
5074 fidl::new_empty!(
5075 fidl::encoding::BoundedString<512>,
5076 fidl::encoding::DefaultFuchsiaResourceDialect
5077 )
5078 });
5079 fidl::decode!(
5080 fidl::encoding::BoundedString<512>,
5081 fidl::encoding::DefaultFuchsiaResourceDialect,
5082 val_ref,
5083 decoder,
5084 inner_offset,
5085 inner_depth
5086 )?;
5087 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5088 {
5089 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5090 }
5091 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5092 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5093 }
5094 }
5095
5096 next_offset += envelope_size;
5097 _next_ordinal_to_read += 1;
5098 if next_offset >= end_offset {
5099 return Ok(());
5100 }
5101
5102 while _next_ordinal_to_read < 2 {
5104 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5105 _next_ordinal_to_read += 1;
5106 next_offset += envelope_size;
5107 }
5108
5109 let next_out_of_line = decoder.next_out_of_line();
5110 let handles_before = decoder.remaining_handles();
5111 if let Some((inlined, num_bytes, num_handles)) =
5112 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5113 {
5114 let member_inline_size = <fidl::encoding::HandleType<
5115 fidl::Socket,
5116 { fidl::ObjectType::SOCKET.into_raw() },
5117 2147483648,
5118 > as fidl::encoding::TypeMarker>::inline_size(
5119 decoder.context
5120 );
5121 if inlined != (member_inline_size <= 4) {
5122 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5123 }
5124 let inner_offset;
5125 let mut inner_depth = depth.clone();
5126 if inlined {
5127 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5128 inner_offset = next_offset;
5129 } else {
5130 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5131 inner_depth.increment()?;
5132 }
5133 let val_ref =
5134 self.socket.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
5135 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5136 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5137 {
5138 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5139 }
5140 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5141 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5142 }
5143 }
5144
5145 next_offset += envelope_size;
5146
5147 while next_offset < end_offset {
5149 _next_ordinal_to_read += 1;
5150 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5151 next_offset += envelope_size;
5152 }
5153
5154 Ok(())
5155 }
5156 }
5157
5158 impl EnumerateTestCasesOptions {
5159 #[inline(always)]
5160 fn max_ordinal_present(&self) -> u64 {
5161 if let Some(_) = self.realm_options {
5162 return 1;
5163 }
5164 0
5165 }
5166 }
5167
5168 impl fidl::encoding::ResourceTypeMarker for EnumerateTestCasesOptions {
5169 type Borrowed<'a> = &'a mut Self;
5170 fn take_or_borrow<'a>(
5171 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5172 ) -> Self::Borrowed<'a> {
5173 value
5174 }
5175 }
5176
5177 unsafe impl fidl::encoding::TypeMarker for EnumerateTestCasesOptions {
5178 type Owned = Self;
5179
5180 #[inline(always)]
5181 fn inline_align(_context: fidl::encoding::Context) -> usize {
5182 8
5183 }
5184
5185 #[inline(always)]
5186 fn inline_size(_context: fidl::encoding::Context) -> usize {
5187 16
5188 }
5189 }
5190
5191 unsafe impl
5192 fidl::encoding::Encode<
5193 EnumerateTestCasesOptions,
5194 fidl::encoding::DefaultFuchsiaResourceDialect,
5195 > for &mut EnumerateTestCasesOptions
5196 {
5197 unsafe fn encode(
5198 self,
5199 encoder: &mut fidl::encoding::Encoder<
5200 '_,
5201 fidl::encoding::DefaultFuchsiaResourceDialect,
5202 >,
5203 offset: usize,
5204 mut depth: fidl::encoding::Depth,
5205 ) -> fidl::Result<()> {
5206 encoder.debug_check_bounds::<EnumerateTestCasesOptions>(offset);
5207 let max_ordinal: u64 = self.max_ordinal_present();
5209 encoder.write_num(max_ordinal, offset);
5210 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5211 if max_ordinal == 0 {
5213 return Ok(());
5214 }
5215 depth.increment()?;
5216 let envelope_size = 8;
5217 let bytes_len = max_ordinal as usize * envelope_size;
5218 #[allow(unused_variables)]
5219 let offset = encoder.out_of_line_offset(bytes_len);
5220 let mut _prev_end_offset: usize = 0;
5221 if 1 > max_ordinal {
5222 return Ok(());
5223 }
5224
5225 let cur_offset: usize = (1 - 1) * envelope_size;
5228
5229 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5231
5232 fidl::encoding::encode_in_envelope_optional::<
5237 RealmOptions,
5238 fidl::encoding::DefaultFuchsiaResourceDialect,
5239 >(
5240 self.realm_options
5241 .as_mut()
5242 .map(<RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5243 encoder,
5244 offset + cur_offset,
5245 depth,
5246 )?;
5247
5248 _prev_end_offset = cur_offset + envelope_size;
5249
5250 Ok(())
5251 }
5252 }
5253
5254 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5255 for EnumerateTestCasesOptions
5256 {
5257 #[inline(always)]
5258 fn new_empty() -> Self {
5259 Self::default()
5260 }
5261
5262 unsafe fn decode(
5263 &mut self,
5264 decoder: &mut fidl::encoding::Decoder<
5265 '_,
5266 fidl::encoding::DefaultFuchsiaResourceDialect,
5267 >,
5268 offset: usize,
5269 mut depth: fidl::encoding::Depth,
5270 ) -> fidl::Result<()> {
5271 decoder.debug_check_bounds::<Self>(offset);
5272 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5273 None => return Err(fidl::Error::NotNullable),
5274 Some(len) => len,
5275 };
5276 if len == 0 {
5278 return Ok(());
5279 };
5280 depth.increment()?;
5281 let envelope_size = 8;
5282 let bytes_len = len * envelope_size;
5283 let offset = decoder.out_of_line_offset(bytes_len)?;
5284 let mut _next_ordinal_to_read = 0;
5286 let mut next_offset = offset;
5287 let end_offset = offset + bytes_len;
5288 _next_ordinal_to_read += 1;
5289 if next_offset >= end_offset {
5290 return Ok(());
5291 }
5292
5293 while _next_ordinal_to_read < 1 {
5295 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5296 _next_ordinal_to_read += 1;
5297 next_offset += envelope_size;
5298 }
5299
5300 let next_out_of_line = decoder.next_out_of_line();
5301 let handles_before = decoder.remaining_handles();
5302 if let Some((inlined, num_bytes, num_handles)) =
5303 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5304 {
5305 let member_inline_size =
5306 <RealmOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5307 if inlined != (member_inline_size <= 4) {
5308 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5309 }
5310 let inner_offset;
5311 let mut inner_depth = depth.clone();
5312 if inlined {
5313 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5314 inner_offset = next_offset;
5315 } else {
5316 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5317 inner_depth.increment()?;
5318 }
5319 let val_ref = self.realm_options.get_or_insert_with(|| {
5320 fidl::new_empty!(RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect)
5321 });
5322 fidl::decode!(
5323 RealmOptions,
5324 fidl::encoding::DefaultFuchsiaResourceDialect,
5325 val_ref,
5326 decoder,
5327 inner_offset,
5328 inner_depth
5329 )?;
5330 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5331 {
5332 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5333 }
5334 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5335 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5336 }
5337 }
5338
5339 next_offset += envelope_size;
5340
5341 while next_offset < end_offset {
5343 _next_ordinal_to_read += 1;
5344 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5345 next_offset += envelope_size;
5346 }
5347
5348 Ok(())
5349 }
5350 }
5351
5352 impl Event {
5353 #[inline(always)]
5354 fn max_ordinal_present(&self) -> u64 {
5355 if let Some(_) = self.details {
5356 return 2;
5357 }
5358 if let Some(_) = self.timestamp {
5359 return 1;
5360 }
5361 0
5362 }
5363 }
5364
5365 impl fidl::encoding::ResourceTypeMarker for Event {
5366 type Borrowed<'a> = &'a mut Self;
5367 fn take_or_borrow<'a>(
5368 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5369 ) -> Self::Borrowed<'a> {
5370 value
5371 }
5372 }
5373
5374 unsafe impl fidl::encoding::TypeMarker for Event {
5375 type Owned = Self;
5376
5377 #[inline(always)]
5378 fn inline_align(_context: fidl::encoding::Context) -> usize {
5379 8
5380 }
5381
5382 #[inline(always)]
5383 fn inline_size(_context: fidl::encoding::Context) -> usize {
5384 16
5385 }
5386 }
5387
5388 unsafe impl fidl::encoding::Encode<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
5389 for &mut Event
5390 {
5391 unsafe fn encode(
5392 self,
5393 encoder: &mut fidl::encoding::Encoder<
5394 '_,
5395 fidl::encoding::DefaultFuchsiaResourceDialect,
5396 >,
5397 offset: usize,
5398 mut depth: fidl::encoding::Depth,
5399 ) -> fidl::Result<()> {
5400 encoder.debug_check_bounds::<Event>(offset);
5401 let max_ordinal: u64 = self.max_ordinal_present();
5403 encoder.write_num(max_ordinal, offset);
5404 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5405 if max_ordinal == 0 {
5407 return Ok(());
5408 }
5409 depth.increment()?;
5410 let envelope_size = 8;
5411 let bytes_len = max_ordinal as usize * envelope_size;
5412 #[allow(unused_variables)]
5413 let offset = encoder.out_of_line_offset(bytes_len);
5414 let mut _prev_end_offset: usize = 0;
5415 if 1 > max_ordinal {
5416 return Ok(());
5417 }
5418
5419 let cur_offset: usize = (1 - 1) * envelope_size;
5422
5423 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5425
5426 fidl::encoding::encode_in_envelope_optional::<
5431 i64,
5432 fidl::encoding::DefaultFuchsiaResourceDialect,
5433 >(
5434 self.timestamp.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5435 encoder,
5436 offset + cur_offset,
5437 depth,
5438 )?;
5439
5440 _prev_end_offset = cur_offset + envelope_size;
5441 if 2 > max_ordinal {
5442 return Ok(());
5443 }
5444
5445 let cur_offset: usize = (2 - 1) * envelope_size;
5448
5449 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5451
5452 fidl::encoding::encode_in_envelope_optional::<
5457 EventDetails,
5458 fidl::encoding::DefaultFuchsiaResourceDialect,
5459 >(
5460 self.details
5461 .as_mut()
5462 .map(<EventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5463 encoder,
5464 offset + cur_offset,
5465 depth,
5466 )?;
5467
5468 _prev_end_offset = cur_offset + envelope_size;
5469
5470 Ok(())
5471 }
5472 }
5473
5474 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
5475 #[inline(always)]
5476 fn new_empty() -> Self {
5477 Self::default()
5478 }
5479
5480 unsafe fn decode(
5481 &mut self,
5482 decoder: &mut fidl::encoding::Decoder<
5483 '_,
5484 fidl::encoding::DefaultFuchsiaResourceDialect,
5485 >,
5486 offset: usize,
5487 mut depth: fidl::encoding::Depth,
5488 ) -> fidl::Result<()> {
5489 decoder.debug_check_bounds::<Self>(offset);
5490 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5491 None => return Err(fidl::Error::NotNullable),
5492 Some(len) => len,
5493 };
5494 if len == 0 {
5496 return Ok(());
5497 };
5498 depth.increment()?;
5499 let envelope_size = 8;
5500 let bytes_len = len * envelope_size;
5501 let offset = decoder.out_of_line_offset(bytes_len)?;
5502 let mut _next_ordinal_to_read = 0;
5504 let mut next_offset = offset;
5505 let end_offset = offset + bytes_len;
5506 _next_ordinal_to_read += 1;
5507 if next_offset >= end_offset {
5508 return Ok(());
5509 }
5510
5511 while _next_ordinal_to_read < 1 {
5513 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5514 _next_ordinal_to_read += 1;
5515 next_offset += envelope_size;
5516 }
5517
5518 let next_out_of_line = decoder.next_out_of_line();
5519 let handles_before = decoder.remaining_handles();
5520 if let Some((inlined, num_bytes, num_handles)) =
5521 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5522 {
5523 let member_inline_size =
5524 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5525 if inlined != (member_inline_size <= 4) {
5526 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5527 }
5528 let inner_offset;
5529 let mut inner_depth = depth.clone();
5530 if inlined {
5531 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5532 inner_offset = next_offset;
5533 } else {
5534 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5535 inner_depth.increment()?;
5536 }
5537 let val_ref = self.timestamp.get_or_insert_with(|| {
5538 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
5539 });
5540 fidl::decode!(
5541 i64,
5542 fidl::encoding::DefaultFuchsiaResourceDialect,
5543 val_ref,
5544 decoder,
5545 inner_offset,
5546 inner_depth
5547 )?;
5548 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5549 {
5550 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5551 }
5552 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5553 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5554 }
5555 }
5556
5557 next_offset += envelope_size;
5558 _next_ordinal_to_read += 1;
5559 if next_offset >= end_offset {
5560 return Ok(());
5561 }
5562
5563 while _next_ordinal_to_read < 2 {
5565 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5566 _next_ordinal_to_read += 1;
5567 next_offset += envelope_size;
5568 }
5569
5570 let next_out_of_line = decoder.next_out_of_line();
5571 let handles_before = decoder.remaining_handles();
5572 if let Some((inlined, num_bytes, num_handles)) =
5573 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5574 {
5575 let member_inline_size =
5576 <EventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5577 if inlined != (member_inline_size <= 4) {
5578 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5579 }
5580 let inner_offset;
5581 let mut inner_depth = depth.clone();
5582 if inlined {
5583 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5584 inner_offset = next_offset;
5585 } else {
5586 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5587 inner_depth.increment()?;
5588 }
5589 let val_ref = self.details.get_or_insert_with(|| {
5590 fidl::new_empty!(EventDetails, fidl::encoding::DefaultFuchsiaResourceDialect)
5591 });
5592 fidl::decode!(
5593 EventDetails,
5594 fidl::encoding::DefaultFuchsiaResourceDialect,
5595 val_ref,
5596 decoder,
5597 inner_offset,
5598 inner_depth
5599 )?;
5600 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5601 {
5602 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5603 }
5604 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5605 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5606 }
5607 }
5608
5609 next_offset += envelope_size;
5610
5611 while next_offset < end_offset {
5613 _next_ordinal_to_read += 1;
5614 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5615 next_offset += envelope_size;
5616 }
5617
5618 Ok(())
5619 }
5620 }
5621
5622 impl RealmOptions {
5623 #[inline(always)]
5624 fn max_ordinal_present(&self) -> u64 {
5625 if let Some(_) = self.test_collection {
5626 return 3;
5627 }
5628 if let Some(_) = self.offers {
5629 return 2;
5630 }
5631 if let Some(_) = self.realm {
5632 return 1;
5633 }
5634 0
5635 }
5636 }
5637
5638 impl fidl::encoding::ResourceTypeMarker for RealmOptions {
5639 type Borrowed<'a> = &'a mut Self;
5640 fn take_or_borrow<'a>(
5641 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5642 ) -> Self::Borrowed<'a> {
5643 value
5644 }
5645 }
5646
5647 unsafe impl fidl::encoding::TypeMarker for RealmOptions {
5648 type Owned = Self;
5649
5650 #[inline(always)]
5651 fn inline_align(_context: fidl::encoding::Context) -> usize {
5652 8
5653 }
5654
5655 #[inline(always)]
5656 fn inline_size(_context: fidl::encoding::Context) -> usize {
5657 16
5658 }
5659 }
5660
5661 unsafe impl fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
5662 for &mut RealmOptions
5663 {
5664 unsafe fn encode(
5665 self,
5666 encoder: &mut fidl::encoding::Encoder<
5667 '_,
5668 fidl::encoding::DefaultFuchsiaResourceDialect,
5669 >,
5670 offset: usize,
5671 mut depth: fidl::encoding::Depth,
5672 ) -> fidl::Result<()> {
5673 encoder.debug_check_bounds::<RealmOptions>(offset);
5674 let max_ordinal: u64 = self.max_ordinal_present();
5676 encoder.write_num(max_ordinal, offset);
5677 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5678 if max_ordinal == 0 {
5680 return Ok(());
5681 }
5682 depth.increment()?;
5683 let envelope_size = 8;
5684 let bytes_len = max_ordinal as usize * envelope_size;
5685 #[allow(unused_variables)]
5686 let offset = encoder.out_of_line_offset(bytes_len);
5687 let mut _prev_end_offset: usize = 0;
5688 if 1 > max_ordinal {
5689 return Ok(());
5690 }
5691
5692 let cur_offset: usize = (1 - 1) * envelope_size;
5695
5696 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5698
5699 fidl::encoding::encode_in_envelope_optional::<
5704 fidl::encoding::Endpoint<
5705 fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
5706 >,
5707 fidl::encoding::DefaultFuchsiaResourceDialect,
5708 >(
5709 self.realm.as_mut().map(
5710 <fidl::encoding::Endpoint<
5711 fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
5712 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5713 ),
5714 encoder,
5715 offset + cur_offset,
5716 depth,
5717 )?;
5718
5719 _prev_end_offset = cur_offset + envelope_size;
5720 if 2 > max_ordinal {
5721 return Ok(());
5722 }
5723
5724 let cur_offset: usize = (2 - 1) * envelope_size;
5727
5728 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5730
5731 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5736 self.offers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
5737 encoder, offset + cur_offset, depth
5738 )?;
5739
5740 _prev_end_offset = cur_offset + envelope_size;
5741 if 3 > max_ordinal {
5742 return Ok(());
5743 }
5744
5745 let cur_offset: usize = (3 - 1) * envelope_size;
5748
5749 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5751
5752 fidl::encoding::encode_in_envelope_optional::<
5757 fidl::encoding::BoundedString<255>,
5758 fidl::encoding::DefaultFuchsiaResourceDialect,
5759 >(
5760 self.test_collection.as_ref().map(
5761 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
5762 ),
5763 encoder,
5764 offset + cur_offset,
5765 depth,
5766 )?;
5767
5768 _prev_end_offset = cur_offset + envelope_size;
5769
5770 Ok(())
5771 }
5772 }
5773
5774 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RealmOptions {
5775 #[inline(always)]
5776 fn new_empty() -> Self {
5777 Self::default()
5778 }
5779
5780 unsafe fn decode(
5781 &mut self,
5782 decoder: &mut fidl::encoding::Decoder<
5783 '_,
5784 fidl::encoding::DefaultFuchsiaResourceDialect,
5785 >,
5786 offset: usize,
5787 mut depth: fidl::encoding::Depth,
5788 ) -> fidl::Result<()> {
5789 decoder.debug_check_bounds::<Self>(offset);
5790 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5791 None => return Err(fidl::Error::NotNullable),
5792 Some(len) => len,
5793 };
5794 if len == 0 {
5796 return Ok(());
5797 };
5798 depth.increment()?;
5799 let envelope_size = 8;
5800 let bytes_len = len * envelope_size;
5801 let offset = decoder.out_of_line_offset(bytes_len)?;
5802 let mut _next_ordinal_to_read = 0;
5804 let mut next_offset = offset;
5805 let end_offset = offset + bytes_len;
5806 _next_ordinal_to_read += 1;
5807 if next_offset >= end_offset {
5808 return Ok(());
5809 }
5810
5811 while _next_ordinal_to_read < 1 {
5813 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5814 _next_ordinal_to_read += 1;
5815 next_offset += envelope_size;
5816 }
5817
5818 let next_out_of_line = decoder.next_out_of_line();
5819 let handles_before = decoder.remaining_handles();
5820 if let Some((inlined, num_bytes, num_handles)) =
5821 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5822 {
5823 let member_inline_size = <fidl::encoding::Endpoint<
5824 fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
5825 > as fidl::encoding::TypeMarker>::inline_size(
5826 decoder.context
5827 );
5828 if inlined != (member_inline_size <= 4) {
5829 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5830 }
5831 let inner_offset;
5832 let mut inner_depth = depth.clone();
5833 if inlined {
5834 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5835 inner_offset = next_offset;
5836 } else {
5837 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5838 inner_depth.increment()?;
5839 }
5840 let val_ref = self.realm.get_or_insert_with(|| {
5841 fidl::new_empty!(
5842 fidl::encoding::Endpoint<
5843 fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
5844 >,
5845 fidl::encoding::DefaultFuchsiaResourceDialect
5846 )
5847 });
5848 fidl::decode!(
5849 fidl::encoding::Endpoint<
5850 fidl::endpoints::ClientEnd<fidl_fuchsia_component::RealmMarker>,
5851 >,
5852 fidl::encoding::DefaultFuchsiaResourceDialect,
5853 val_ref,
5854 decoder,
5855 inner_offset,
5856 inner_depth
5857 )?;
5858 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5859 {
5860 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5861 }
5862 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5863 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5864 }
5865 }
5866
5867 next_offset += envelope_size;
5868 _next_ordinal_to_read += 1;
5869 if next_offset >= end_offset {
5870 return Ok(());
5871 }
5872
5873 while _next_ordinal_to_read < 2 {
5875 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5876 _next_ordinal_to_read += 1;
5877 next_offset += envelope_size;
5878 }
5879
5880 let next_out_of_line = decoder.next_out_of_line();
5881 let handles_before = decoder.remaining_handles();
5882 if let Some((inlined, num_bytes, num_handles)) =
5883 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5884 {
5885 let member_inline_size = <fidl::encoding::Vector<
5886 fidl_fuchsia_component_decl::Offer,
5887 1024,
5888 > as fidl::encoding::TypeMarker>::inline_size(
5889 decoder.context
5890 );
5891 if inlined != (member_inline_size <= 4) {
5892 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5893 }
5894 let inner_offset;
5895 let mut inner_depth = depth.clone();
5896 if inlined {
5897 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5898 inner_offset = next_offset;
5899 } else {
5900 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5901 inner_depth.increment()?;
5902 }
5903 let val_ref =
5904 self.offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect));
5905 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5906 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5907 {
5908 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5909 }
5910 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5911 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5912 }
5913 }
5914
5915 next_offset += envelope_size;
5916 _next_ordinal_to_read += 1;
5917 if next_offset >= end_offset {
5918 return Ok(());
5919 }
5920
5921 while _next_ordinal_to_read < 3 {
5923 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5924 _next_ordinal_to_read += 1;
5925 next_offset += envelope_size;
5926 }
5927
5928 let next_out_of_line = decoder.next_out_of_line();
5929 let handles_before = decoder.remaining_handles();
5930 if let Some((inlined, num_bytes, num_handles)) =
5931 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5932 {
5933 let member_inline_size =
5934 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
5935 decoder.context,
5936 );
5937 if inlined != (member_inline_size <= 4) {
5938 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5939 }
5940 let inner_offset;
5941 let mut inner_depth = depth.clone();
5942 if inlined {
5943 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5944 inner_offset = next_offset;
5945 } else {
5946 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5947 inner_depth.increment()?;
5948 }
5949 let val_ref = self.test_collection.get_or_insert_with(|| {
5950 fidl::new_empty!(
5951 fidl::encoding::BoundedString<255>,
5952 fidl::encoding::DefaultFuchsiaResourceDialect
5953 )
5954 });
5955 fidl::decode!(
5956 fidl::encoding::BoundedString<255>,
5957 fidl::encoding::DefaultFuchsiaResourceDialect,
5958 val_ref,
5959 decoder,
5960 inner_offset,
5961 inner_depth
5962 )?;
5963 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5964 {
5965 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5966 }
5967 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5968 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5969 }
5970 }
5971
5972 next_offset += envelope_size;
5973
5974 while next_offset < end_offset {
5976 _next_ordinal_to_read += 1;
5977 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5978 next_offset += envelope_size;
5979 }
5980
5981 Ok(())
5982 }
5983 }
5984
5985 impl RunSuiteOptions {
5986 #[inline(always)]
5987 fn max_ordinal_present(&self) -> u64 {
5988 if let Some(_) = self.break_on_failure {
5989 return 11;
5990 }
5991 if let Some(_) = self.no_exception_channel {
5992 return 10;
5993 }
5994 if let Some(_) = self.accumulate_debug_data {
5995 return 9;
5996 }
5997 if let Some(_) = self.log_interest {
5998 return 8;
5999 }
6000 if let Some(_) = self.logs_iterator_type {
6001 return 7;
6002 }
6003 if let Some(_) = self.test_case_filters {
6004 return 6;
6005 }
6006 if let Some(_) = self.timeout {
6007 return 5;
6008 }
6009 if let Some(_) = self.arguments {
6010 return 4;
6011 }
6012 if let Some(_) = self.max_concurrent_test_case_runs {
6013 return 3;
6014 }
6015 if let Some(_) = self.run_disabled_tests {
6016 return 2;
6017 }
6018 if let Some(_) = self.realm_options {
6019 return 1;
6020 }
6021 0
6022 }
6023 }
6024
6025 impl fidl::encoding::ResourceTypeMarker for RunSuiteOptions {
6026 type Borrowed<'a> = &'a mut Self;
6027 fn take_or_borrow<'a>(
6028 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6029 ) -> Self::Borrowed<'a> {
6030 value
6031 }
6032 }
6033
6034 unsafe impl fidl::encoding::TypeMarker for RunSuiteOptions {
6035 type Owned = Self;
6036
6037 #[inline(always)]
6038 fn inline_align(_context: fidl::encoding::Context) -> usize {
6039 8
6040 }
6041
6042 #[inline(always)]
6043 fn inline_size(_context: fidl::encoding::Context) -> usize {
6044 16
6045 }
6046 }
6047
6048 unsafe impl
6049 fidl::encoding::Encode<RunSuiteOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
6050 for &mut RunSuiteOptions
6051 {
6052 unsafe fn encode(
6053 self,
6054 encoder: &mut fidl::encoding::Encoder<
6055 '_,
6056 fidl::encoding::DefaultFuchsiaResourceDialect,
6057 >,
6058 offset: usize,
6059 mut depth: fidl::encoding::Depth,
6060 ) -> fidl::Result<()> {
6061 encoder.debug_check_bounds::<RunSuiteOptions>(offset);
6062 let max_ordinal: u64 = self.max_ordinal_present();
6064 encoder.write_num(max_ordinal, offset);
6065 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6066 if max_ordinal == 0 {
6068 return Ok(());
6069 }
6070 depth.increment()?;
6071 let envelope_size = 8;
6072 let bytes_len = max_ordinal as usize * envelope_size;
6073 #[allow(unused_variables)]
6074 let offset = encoder.out_of_line_offset(bytes_len);
6075 let mut _prev_end_offset: usize = 0;
6076 if 1 > max_ordinal {
6077 return Ok(());
6078 }
6079
6080 let cur_offset: usize = (1 - 1) * envelope_size;
6083
6084 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6086
6087 fidl::encoding::encode_in_envelope_optional::<
6092 RealmOptions,
6093 fidl::encoding::DefaultFuchsiaResourceDialect,
6094 >(
6095 self.realm_options
6096 .as_mut()
6097 .map(<RealmOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6098 encoder,
6099 offset + cur_offset,
6100 depth,
6101 )?;
6102
6103 _prev_end_offset = cur_offset + envelope_size;
6104 if 2 > max_ordinal {
6105 return Ok(());
6106 }
6107
6108 let cur_offset: usize = (2 - 1) * envelope_size;
6111
6112 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6114
6115 fidl::encoding::encode_in_envelope_optional::<
6120 bool,
6121 fidl::encoding::DefaultFuchsiaResourceDialect,
6122 >(
6123 self.run_disabled_tests
6124 .as_ref()
6125 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6126 encoder,
6127 offset + cur_offset,
6128 depth,
6129 )?;
6130
6131 _prev_end_offset = cur_offset + envelope_size;
6132 if 3 > max_ordinal {
6133 return Ok(());
6134 }
6135
6136 let cur_offset: usize = (3 - 1) * envelope_size;
6139
6140 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6142
6143 fidl::encoding::encode_in_envelope_optional::<
6148 u16,
6149 fidl::encoding::DefaultFuchsiaResourceDialect,
6150 >(
6151 self.max_concurrent_test_case_runs
6152 .as_ref()
6153 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
6154 encoder,
6155 offset + cur_offset,
6156 depth,
6157 )?;
6158
6159 _prev_end_offset = cur_offset + envelope_size;
6160 if 4 > max_ordinal {
6161 return Ok(());
6162 }
6163
6164 let cur_offset: usize = (4 - 1) * envelope_size;
6167
6168 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6170
6171 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6176 self.arguments.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095> as fidl::encoding::ValueTypeMarker>::borrow),
6177 encoder, offset + cur_offset, depth
6178 )?;
6179
6180 _prev_end_offset = cur_offset + envelope_size;
6181 if 5 > max_ordinal {
6182 return Ok(());
6183 }
6184
6185 let cur_offset: usize = (5 - 1) * envelope_size;
6188
6189 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6191
6192 fidl::encoding::encode_in_envelope_optional::<
6197 i64,
6198 fidl::encoding::DefaultFuchsiaResourceDialect,
6199 >(
6200 self.timeout.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
6201 encoder,
6202 offset + cur_offset,
6203 depth,
6204 )?;
6205
6206 _prev_end_offset = cur_offset + envelope_size;
6207 if 6 > max_ordinal {
6208 return Ok(());
6209 }
6210
6211 let cur_offset: usize = (6 - 1) * envelope_size;
6214
6215 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6217
6218 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6223 self.test_case_filters.as_ref().map(<fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
6224 encoder, offset + cur_offset, depth
6225 )?;
6226
6227 _prev_end_offset = cur_offset + envelope_size;
6228 if 7 > max_ordinal {
6229 return Ok(());
6230 }
6231
6232 let cur_offset: usize = (7 - 1) * envelope_size;
6235
6236 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6238
6239 fidl::encoding::encode_in_envelope_optional::<
6244 LogsIteratorType,
6245 fidl::encoding::DefaultFuchsiaResourceDialect,
6246 >(
6247 self.logs_iterator_type
6248 .as_ref()
6249 .map(<LogsIteratorType as fidl::encoding::ValueTypeMarker>::borrow),
6250 encoder,
6251 offset + cur_offset,
6252 depth,
6253 )?;
6254
6255 _prev_end_offset = cur_offset + envelope_size;
6256 if 8 > max_ordinal {
6257 return Ok(());
6258 }
6259
6260 let cur_offset: usize = (8 - 1) * envelope_size;
6263
6264 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6266
6267 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6272 self.log_interest.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64> as fidl::encoding::ValueTypeMarker>::borrow),
6273 encoder, offset + cur_offset, depth
6274 )?;
6275
6276 _prev_end_offset = cur_offset + envelope_size;
6277 if 9 > max_ordinal {
6278 return Ok(());
6279 }
6280
6281 let cur_offset: usize = (9 - 1) * envelope_size;
6284
6285 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6287
6288 fidl::encoding::encode_in_envelope_optional::<
6293 bool,
6294 fidl::encoding::DefaultFuchsiaResourceDialect,
6295 >(
6296 self.accumulate_debug_data
6297 .as_ref()
6298 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6299 encoder,
6300 offset + cur_offset,
6301 depth,
6302 )?;
6303
6304 _prev_end_offset = cur_offset + envelope_size;
6305 if 10 > max_ordinal {
6306 return Ok(());
6307 }
6308
6309 let cur_offset: usize = (10 - 1) * envelope_size;
6312
6313 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6315
6316 fidl::encoding::encode_in_envelope_optional::<
6321 bool,
6322 fidl::encoding::DefaultFuchsiaResourceDialect,
6323 >(
6324 self.no_exception_channel
6325 .as_ref()
6326 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6327 encoder,
6328 offset + cur_offset,
6329 depth,
6330 )?;
6331
6332 _prev_end_offset = cur_offset + envelope_size;
6333 if 11 > max_ordinal {
6334 return Ok(());
6335 }
6336
6337 let cur_offset: usize = (11 - 1) * envelope_size;
6340
6341 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6343
6344 fidl::encoding::encode_in_envelope_optional::<
6349 bool,
6350 fidl::encoding::DefaultFuchsiaResourceDialect,
6351 >(
6352 self.break_on_failure
6353 .as_ref()
6354 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6355 encoder,
6356 offset + cur_offset,
6357 depth,
6358 )?;
6359
6360 _prev_end_offset = cur_offset + envelope_size;
6361
6362 Ok(())
6363 }
6364 }
6365
6366 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6367 for RunSuiteOptions
6368 {
6369 #[inline(always)]
6370 fn new_empty() -> Self {
6371 Self::default()
6372 }
6373
6374 unsafe fn decode(
6375 &mut self,
6376 decoder: &mut fidl::encoding::Decoder<
6377 '_,
6378 fidl::encoding::DefaultFuchsiaResourceDialect,
6379 >,
6380 offset: usize,
6381 mut depth: fidl::encoding::Depth,
6382 ) -> fidl::Result<()> {
6383 decoder.debug_check_bounds::<Self>(offset);
6384 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6385 None => return Err(fidl::Error::NotNullable),
6386 Some(len) => len,
6387 };
6388 if len == 0 {
6390 return Ok(());
6391 };
6392 depth.increment()?;
6393 let envelope_size = 8;
6394 let bytes_len = len * envelope_size;
6395 let offset = decoder.out_of_line_offset(bytes_len)?;
6396 let mut _next_ordinal_to_read = 0;
6398 let mut next_offset = offset;
6399 let end_offset = offset + bytes_len;
6400 _next_ordinal_to_read += 1;
6401 if next_offset >= end_offset {
6402 return Ok(());
6403 }
6404
6405 while _next_ordinal_to_read < 1 {
6407 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6408 _next_ordinal_to_read += 1;
6409 next_offset += envelope_size;
6410 }
6411
6412 let next_out_of_line = decoder.next_out_of_line();
6413 let handles_before = decoder.remaining_handles();
6414 if let Some((inlined, num_bytes, num_handles)) =
6415 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6416 {
6417 let member_inline_size =
6418 <RealmOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6419 if inlined != (member_inline_size <= 4) {
6420 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6421 }
6422 let inner_offset;
6423 let mut inner_depth = depth.clone();
6424 if inlined {
6425 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6426 inner_offset = next_offset;
6427 } else {
6428 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6429 inner_depth.increment()?;
6430 }
6431 let val_ref = self.realm_options.get_or_insert_with(|| {
6432 fidl::new_empty!(RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect)
6433 });
6434 fidl::decode!(
6435 RealmOptions,
6436 fidl::encoding::DefaultFuchsiaResourceDialect,
6437 val_ref,
6438 decoder,
6439 inner_offset,
6440 inner_depth
6441 )?;
6442 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6443 {
6444 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6445 }
6446 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6447 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6448 }
6449 }
6450
6451 next_offset += envelope_size;
6452 _next_ordinal_to_read += 1;
6453 if next_offset >= end_offset {
6454 return Ok(());
6455 }
6456
6457 while _next_ordinal_to_read < 2 {
6459 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6460 _next_ordinal_to_read += 1;
6461 next_offset += envelope_size;
6462 }
6463
6464 let next_out_of_line = decoder.next_out_of_line();
6465 let handles_before = decoder.remaining_handles();
6466 if let Some((inlined, num_bytes, num_handles)) =
6467 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6468 {
6469 let member_inline_size =
6470 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6471 if inlined != (member_inline_size <= 4) {
6472 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6473 }
6474 let inner_offset;
6475 let mut inner_depth = depth.clone();
6476 if inlined {
6477 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6478 inner_offset = next_offset;
6479 } else {
6480 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6481 inner_depth.increment()?;
6482 }
6483 let val_ref = self.run_disabled_tests.get_or_insert_with(|| {
6484 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
6485 });
6486 fidl::decode!(
6487 bool,
6488 fidl::encoding::DefaultFuchsiaResourceDialect,
6489 val_ref,
6490 decoder,
6491 inner_offset,
6492 inner_depth
6493 )?;
6494 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6495 {
6496 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6497 }
6498 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6499 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6500 }
6501 }
6502
6503 next_offset += envelope_size;
6504 _next_ordinal_to_read += 1;
6505 if next_offset >= end_offset {
6506 return Ok(());
6507 }
6508
6509 while _next_ordinal_to_read < 3 {
6511 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6512 _next_ordinal_to_read += 1;
6513 next_offset += envelope_size;
6514 }
6515
6516 let next_out_of_line = decoder.next_out_of_line();
6517 let handles_before = decoder.remaining_handles();
6518 if let Some((inlined, num_bytes, num_handles)) =
6519 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6520 {
6521 let member_inline_size =
6522 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6523 if inlined != (member_inline_size <= 4) {
6524 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6525 }
6526 let inner_offset;
6527 let mut inner_depth = depth.clone();
6528 if inlined {
6529 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6530 inner_offset = next_offset;
6531 } else {
6532 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6533 inner_depth.increment()?;
6534 }
6535 let val_ref = self.max_concurrent_test_case_runs.get_or_insert_with(|| {
6536 fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect)
6537 });
6538 fidl::decode!(
6539 u16,
6540 fidl::encoding::DefaultFuchsiaResourceDialect,
6541 val_ref,
6542 decoder,
6543 inner_offset,
6544 inner_depth
6545 )?;
6546 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6547 {
6548 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6549 }
6550 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6551 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6552 }
6553 }
6554
6555 next_offset += envelope_size;
6556 _next_ordinal_to_read += 1;
6557 if next_offset >= end_offset {
6558 return Ok(());
6559 }
6560
6561 while _next_ordinal_to_read < 4 {
6563 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6564 _next_ordinal_to_read += 1;
6565 next_offset += envelope_size;
6566 }
6567
6568 let next_out_of_line = decoder.next_out_of_line();
6569 let handles_before = decoder.remaining_handles();
6570 if let Some((inlined, num_bytes, num_handles)) =
6571 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6572 {
6573 let member_inline_size = <fidl::encoding::Vector<
6574 fidl::encoding::BoundedString<16384>,
6575 4095,
6576 > as fidl::encoding::TypeMarker>::inline_size(
6577 decoder.context
6578 );
6579 if inlined != (member_inline_size <= 4) {
6580 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6581 }
6582 let inner_offset;
6583 let mut inner_depth = depth.clone();
6584 if inlined {
6585 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6586 inner_offset = next_offset;
6587 } else {
6588 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6589 inner_depth.increment()?;
6590 }
6591 let val_ref = self.arguments.get_or_insert_with(|| {
6592 fidl::new_empty!(
6593 fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>,
6594 fidl::encoding::DefaultFuchsiaResourceDialect
6595 )
6596 });
6597 fidl::decode!(
6598 fidl::encoding::Vector<fidl::encoding::BoundedString<16384>, 4095>,
6599 fidl::encoding::DefaultFuchsiaResourceDialect,
6600 val_ref,
6601 decoder,
6602 inner_offset,
6603 inner_depth
6604 )?;
6605 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6606 {
6607 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6608 }
6609 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6610 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6611 }
6612 }
6613
6614 next_offset += envelope_size;
6615 _next_ordinal_to_read += 1;
6616 if next_offset >= end_offset {
6617 return Ok(());
6618 }
6619
6620 while _next_ordinal_to_read < 5 {
6622 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6623 _next_ordinal_to_read += 1;
6624 next_offset += envelope_size;
6625 }
6626
6627 let next_out_of_line = decoder.next_out_of_line();
6628 let handles_before = decoder.remaining_handles();
6629 if let Some((inlined, num_bytes, num_handles)) =
6630 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6631 {
6632 let member_inline_size =
6633 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6634 if inlined != (member_inline_size <= 4) {
6635 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6636 }
6637 let inner_offset;
6638 let mut inner_depth = depth.clone();
6639 if inlined {
6640 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6641 inner_offset = next_offset;
6642 } else {
6643 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6644 inner_depth.increment()?;
6645 }
6646 let val_ref = self.timeout.get_or_insert_with(|| {
6647 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
6648 });
6649 fidl::decode!(
6650 i64,
6651 fidl::encoding::DefaultFuchsiaResourceDialect,
6652 val_ref,
6653 decoder,
6654 inner_offset,
6655 inner_depth
6656 )?;
6657 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6658 {
6659 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6660 }
6661 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6662 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6663 }
6664 }
6665
6666 next_offset += envelope_size;
6667 _next_ordinal_to_read += 1;
6668 if next_offset >= end_offset {
6669 return Ok(());
6670 }
6671
6672 while _next_ordinal_to_read < 6 {
6674 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6675 _next_ordinal_to_read += 1;
6676 next_offset += envelope_size;
6677 }
6678
6679 let next_out_of_line = decoder.next_out_of_line();
6680 let handles_before = decoder.remaining_handles();
6681 if let Some((inlined, num_bytes, num_handles)) =
6682 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6683 {
6684 let member_inline_size = <fidl::encoding::Vector<
6685 fidl::encoding::BoundedString<4096>,
6686 1024,
6687 > as fidl::encoding::TypeMarker>::inline_size(
6688 decoder.context
6689 );
6690 if inlined != (member_inline_size <= 4) {
6691 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6692 }
6693 let inner_offset;
6694 let mut inner_depth = depth.clone();
6695 if inlined {
6696 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6697 inner_offset = next_offset;
6698 } else {
6699 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6700 inner_depth.increment()?;
6701 }
6702 let val_ref = self.test_case_filters.get_or_insert_with(|| {
6703 fidl::new_empty!(
6704 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>,
6705 fidl::encoding::DefaultFuchsiaResourceDialect
6706 )
6707 });
6708 fidl::decode!(
6709 fidl::encoding::Vector<fidl::encoding::BoundedString<4096>, 1024>,
6710 fidl::encoding::DefaultFuchsiaResourceDialect,
6711 val_ref,
6712 decoder,
6713 inner_offset,
6714 inner_depth
6715 )?;
6716 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6717 {
6718 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6719 }
6720 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6721 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6722 }
6723 }
6724
6725 next_offset += envelope_size;
6726 _next_ordinal_to_read += 1;
6727 if next_offset >= end_offset {
6728 return Ok(());
6729 }
6730
6731 while _next_ordinal_to_read < 7 {
6733 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6734 _next_ordinal_to_read += 1;
6735 next_offset += envelope_size;
6736 }
6737
6738 let next_out_of_line = decoder.next_out_of_line();
6739 let handles_before = decoder.remaining_handles();
6740 if let Some((inlined, num_bytes, num_handles)) =
6741 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6742 {
6743 let member_inline_size =
6744 <LogsIteratorType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6745 if inlined != (member_inline_size <= 4) {
6746 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6747 }
6748 let inner_offset;
6749 let mut inner_depth = depth.clone();
6750 if inlined {
6751 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6752 inner_offset = next_offset;
6753 } else {
6754 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6755 inner_depth.increment()?;
6756 }
6757 let val_ref = self.logs_iterator_type.get_or_insert_with(|| {
6758 fidl::new_empty!(
6759 LogsIteratorType,
6760 fidl::encoding::DefaultFuchsiaResourceDialect
6761 )
6762 });
6763 fidl::decode!(
6764 LogsIteratorType,
6765 fidl::encoding::DefaultFuchsiaResourceDialect,
6766 val_ref,
6767 decoder,
6768 inner_offset,
6769 inner_depth
6770 )?;
6771 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6772 {
6773 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6774 }
6775 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6776 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6777 }
6778 }
6779
6780 next_offset += envelope_size;
6781 _next_ordinal_to_read += 1;
6782 if next_offset >= end_offset {
6783 return Ok(());
6784 }
6785
6786 while _next_ordinal_to_read < 8 {
6788 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6789 _next_ordinal_to_read += 1;
6790 next_offset += envelope_size;
6791 }
6792
6793 let next_out_of_line = decoder.next_out_of_line();
6794 let handles_before = decoder.remaining_handles();
6795 if let Some((inlined, num_bytes, num_handles)) =
6796 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6797 {
6798 let member_inline_size = <fidl::encoding::Vector<
6799 fidl_fuchsia_diagnostics::LogInterestSelector,
6800 64,
6801 > as fidl::encoding::TypeMarker>::inline_size(
6802 decoder.context
6803 );
6804 if inlined != (member_inline_size <= 4) {
6805 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6806 }
6807 let inner_offset;
6808 let mut inner_depth = depth.clone();
6809 if inlined {
6810 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6811 inner_offset = next_offset;
6812 } else {
6813 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6814 inner_depth.increment()?;
6815 }
6816 let val_ref =
6817 self.log_interest.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
6818 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6819 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6820 {
6821 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6822 }
6823 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6824 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6825 }
6826 }
6827
6828 next_offset += envelope_size;
6829 _next_ordinal_to_read += 1;
6830 if next_offset >= end_offset {
6831 return Ok(());
6832 }
6833
6834 while _next_ordinal_to_read < 9 {
6836 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6837 _next_ordinal_to_read += 1;
6838 next_offset += envelope_size;
6839 }
6840
6841 let next_out_of_line = decoder.next_out_of_line();
6842 let handles_before = decoder.remaining_handles();
6843 if let Some((inlined, num_bytes, num_handles)) =
6844 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6845 {
6846 let member_inline_size =
6847 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6848 if inlined != (member_inline_size <= 4) {
6849 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6850 }
6851 let inner_offset;
6852 let mut inner_depth = depth.clone();
6853 if inlined {
6854 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6855 inner_offset = next_offset;
6856 } else {
6857 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6858 inner_depth.increment()?;
6859 }
6860 let val_ref = self.accumulate_debug_data.get_or_insert_with(|| {
6861 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
6862 });
6863 fidl::decode!(
6864 bool,
6865 fidl::encoding::DefaultFuchsiaResourceDialect,
6866 val_ref,
6867 decoder,
6868 inner_offset,
6869 inner_depth
6870 )?;
6871 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6872 {
6873 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6874 }
6875 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6876 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6877 }
6878 }
6879
6880 next_offset += envelope_size;
6881 _next_ordinal_to_read += 1;
6882 if next_offset >= end_offset {
6883 return Ok(());
6884 }
6885
6886 while _next_ordinal_to_read < 10 {
6888 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6889 _next_ordinal_to_read += 1;
6890 next_offset += envelope_size;
6891 }
6892
6893 let next_out_of_line = decoder.next_out_of_line();
6894 let handles_before = decoder.remaining_handles();
6895 if let Some((inlined, num_bytes, num_handles)) =
6896 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6897 {
6898 let member_inline_size =
6899 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6900 if inlined != (member_inline_size <= 4) {
6901 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6902 }
6903 let inner_offset;
6904 let mut inner_depth = depth.clone();
6905 if inlined {
6906 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6907 inner_offset = next_offset;
6908 } else {
6909 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6910 inner_depth.increment()?;
6911 }
6912 let val_ref = self.no_exception_channel.get_or_insert_with(|| {
6913 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
6914 });
6915 fidl::decode!(
6916 bool,
6917 fidl::encoding::DefaultFuchsiaResourceDialect,
6918 val_ref,
6919 decoder,
6920 inner_offset,
6921 inner_depth
6922 )?;
6923 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6924 {
6925 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6926 }
6927 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6928 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6929 }
6930 }
6931
6932 next_offset += envelope_size;
6933 _next_ordinal_to_read += 1;
6934 if next_offset >= end_offset {
6935 return Ok(());
6936 }
6937
6938 while _next_ordinal_to_read < 11 {
6940 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6941 _next_ordinal_to_read += 1;
6942 next_offset += envelope_size;
6943 }
6944
6945 let next_out_of_line = decoder.next_out_of_line();
6946 let handles_before = decoder.remaining_handles();
6947 if let Some((inlined, num_bytes, num_handles)) =
6948 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6949 {
6950 let member_inline_size =
6951 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6952 if inlined != (member_inline_size <= 4) {
6953 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6954 }
6955 let inner_offset;
6956 let mut inner_depth = depth.clone();
6957 if inlined {
6958 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6959 inner_offset = next_offset;
6960 } else {
6961 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6962 inner_depth.increment()?;
6963 }
6964 let val_ref = self.break_on_failure.get_or_insert_with(|| {
6965 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
6966 });
6967 fidl::decode!(
6968 bool,
6969 fidl::encoding::DefaultFuchsiaResourceDialect,
6970 val_ref,
6971 decoder,
6972 inner_offset,
6973 inner_depth
6974 )?;
6975 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6976 {
6977 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6978 }
6979 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6980 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6981 }
6982 }
6983
6984 next_offset += envelope_size;
6985
6986 while next_offset < end_offset {
6988 _next_ordinal_to_read += 1;
6989 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6990 next_offset += envelope_size;
6991 }
6992
6993 Ok(())
6994 }
6995 }
6996
6997 impl SuiteArtifactGeneratedEventDetails {
6998 #[inline(always)]
6999 fn max_ordinal_present(&self) -> u64 {
7000 if let Some(_) = self.artifact {
7001 return 1;
7002 }
7003 0
7004 }
7005 }
7006
7007 impl fidl::encoding::ResourceTypeMarker for SuiteArtifactGeneratedEventDetails {
7008 type Borrowed<'a> = &'a mut Self;
7009 fn take_or_borrow<'a>(
7010 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7011 ) -> Self::Borrowed<'a> {
7012 value
7013 }
7014 }
7015
7016 unsafe impl fidl::encoding::TypeMarker for SuiteArtifactGeneratedEventDetails {
7017 type Owned = Self;
7018
7019 #[inline(always)]
7020 fn inline_align(_context: fidl::encoding::Context) -> usize {
7021 8
7022 }
7023
7024 #[inline(always)]
7025 fn inline_size(_context: fidl::encoding::Context) -> usize {
7026 16
7027 }
7028 }
7029
7030 unsafe impl
7031 fidl::encoding::Encode<
7032 SuiteArtifactGeneratedEventDetails,
7033 fidl::encoding::DefaultFuchsiaResourceDialect,
7034 > for &mut SuiteArtifactGeneratedEventDetails
7035 {
7036 unsafe fn encode(
7037 self,
7038 encoder: &mut fidl::encoding::Encoder<
7039 '_,
7040 fidl::encoding::DefaultFuchsiaResourceDialect,
7041 >,
7042 offset: usize,
7043 mut depth: fidl::encoding::Depth,
7044 ) -> fidl::Result<()> {
7045 encoder.debug_check_bounds::<SuiteArtifactGeneratedEventDetails>(offset);
7046 let max_ordinal: u64 = self.max_ordinal_present();
7048 encoder.write_num(max_ordinal, offset);
7049 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7050 if max_ordinal == 0 {
7052 return Ok(());
7053 }
7054 depth.increment()?;
7055 let envelope_size = 8;
7056 let bytes_len = max_ordinal as usize * envelope_size;
7057 #[allow(unused_variables)]
7058 let offset = encoder.out_of_line_offset(bytes_len);
7059 let mut _prev_end_offset: usize = 0;
7060 if 1 > max_ordinal {
7061 return Ok(());
7062 }
7063
7064 let cur_offset: usize = (1 - 1) * envelope_size;
7067
7068 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7070
7071 fidl::encoding::encode_in_envelope_optional::<
7076 Artifact,
7077 fidl::encoding::DefaultFuchsiaResourceDialect,
7078 >(
7079 self.artifact
7080 .as_mut()
7081 .map(<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7082 encoder,
7083 offset + cur_offset,
7084 depth,
7085 )?;
7086
7087 _prev_end_offset = cur_offset + envelope_size;
7088
7089 Ok(())
7090 }
7091 }
7092
7093 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7094 for SuiteArtifactGeneratedEventDetails
7095 {
7096 #[inline(always)]
7097 fn new_empty() -> Self {
7098 Self::default()
7099 }
7100
7101 unsafe fn decode(
7102 &mut self,
7103 decoder: &mut fidl::encoding::Decoder<
7104 '_,
7105 fidl::encoding::DefaultFuchsiaResourceDialect,
7106 >,
7107 offset: usize,
7108 mut depth: fidl::encoding::Depth,
7109 ) -> fidl::Result<()> {
7110 decoder.debug_check_bounds::<Self>(offset);
7111 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7112 None => return Err(fidl::Error::NotNullable),
7113 Some(len) => len,
7114 };
7115 if len == 0 {
7117 return Ok(());
7118 };
7119 depth.increment()?;
7120 let envelope_size = 8;
7121 let bytes_len = len * envelope_size;
7122 let offset = decoder.out_of_line_offset(bytes_len)?;
7123 let mut _next_ordinal_to_read = 0;
7125 let mut next_offset = offset;
7126 let end_offset = offset + bytes_len;
7127 _next_ordinal_to_read += 1;
7128 if next_offset >= end_offset {
7129 return Ok(());
7130 }
7131
7132 while _next_ordinal_to_read < 1 {
7134 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7135 _next_ordinal_to_read += 1;
7136 next_offset += envelope_size;
7137 }
7138
7139 let next_out_of_line = decoder.next_out_of_line();
7140 let handles_before = decoder.remaining_handles();
7141 if let Some((inlined, num_bytes, num_handles)) =
7142 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7143 {
7144 let member_inline_size =
7145 <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7146 if inlined != (member_inline_size <= 4) {
7147 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7148 }
7149 let inner_offset;
7150 let mut inner_depth = depth.clone();
7151 if inlined {
7152 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7153 inner_offset = next_offset;
7154 } else {
7155 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7156 inner_depth.increment()?;
7157 }
7158 let val_ref = self.artifact.get_or_insert_with(|| {
7159 fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect)
7160 });
7161 fidl::decode!(
7162 Artifact,
7163 fidl::encoding::DefaultFuchsiaResourceDialect,
7164 val_ref,
7165 decoder,
7166 inner_offset,
7167 inner_depth
7168 )?;
7169 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7170 {
7171 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7172 }
7173 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7174 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7175 }
7176 }
7177
7178 next_offset += envelope_size;
7179
7180 while next_offset < end_offset {
7182 _next_ordinal_to_read += 1;
7183 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7184 next_offset += envelope_size;
7185 }
7186
7187 Ok(())
7188 }
7189 }
7190
7191 impl TestCaseArtifactGeneratedEventDetails {
7192 #[inline(always)]
7193 fn max_ordinal_present(&self) -> u64 {
7194 if let Some(_) = self.artifact {
7195 return 2;
7196 }
7197 if let Some(_) = self.test_case_id {
7198 return 1;
7199 }
7200 0
7201 }
7202 }
7203
7204 impl fidl::encoding::ResourceTypeMarker for TestCaseArtifactGeneratedEventDetails {
7205 type Borrowed<'a> = &'a mut Self;
7206 fn take_or_borrow<'a>(
7207 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7208 ) -> Self::Borrowed<'a> {
7209 value
7210 }
7211 }
7212
7213 unsafe impl fidl::encoding::TypeMarker for TestCaseArtifactGeneratedEventDetails {
7214 type Owned = Self;
7215
7216 #[inline(always)]
7217 fn inline_align(_context: fidl::encoding::Context) -> usize {
7218 8
7219 }
7220
7221 #[inline(always)]
7222 fn inline_size(_context: fidl::encoding::Context) -> usize {
7223 16
7224 }
7225 }
7226
7227 unsafe impl
7228 fidl::encoding::Encode<
7229 TestCaseArtifactGeneratedEventDetails,
7230 fidl::encoding::DefaultFuchsiaResourceDialect,
7231 > for &mut TestCaseArtifactGeneratedEventDetails
7232 {
7233 unsafe fn encode(
7234 self,
7235 encoder: &mut fidl::encoding::Encoder<
7236 '_,
7237 fidl::encoding::DefaultFuchsiaResourceDialect,
7238 >,
7239 offset: usize,
7240 mut depth: fidl::encoding::Depth,
7241 ) -> fidl::Result<()> {
7242 encoder.debug_check_bounds::<TestCaseArtifactGeneratedEventDetails>(offset);
7243 let max_ordinal: u64 = self.max_ordinal_present();
7245 encoder.write_num(max_ordinal, offset);
7246 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7247 if max_ordinal == 0 {
7249 return Ok(());
7250 }
7251 depth.increment()?;
7252 let envelope_size = 8;
7253 let bytes_len = max_ordinal as usize * envelope_size;
7254 #[allow(unused_variables)]
7255 let offset = encoder.out_of_line_offset(bytes_len);
7256 let mut _prev_end_offset: usize = 0;
7257 if 1 > max_ordinal {
7258 return Ok(());
7259 }
7260
7261 let cur_offset: usize = (1 - 1) * envelope_size;
7264
7265 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7267
7268 fidl::encoding::encode_in_envelope_optional::<
7273 u32,
7274 fidl::encoding::DefaultFuchsiaResourceDialect,
7275 >(
7276 self.test_case_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
7277 encoder,
7278 offset + cur_offset,
7279 depth,
7280 )?;
7281
7282 _prev_end_offset = cur_offset + envelope_size;
7283 if 2 > max_ordinal {
7284 return Ok(());
7285 }
7286
7287 let cur_offset: usize = (2 - 1) * envelope_size;
7290
7291 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7293
7294 fidl::encoding::encode_in_envelope_optional::<
7299 Artifact,
7300 fidl::encoding::DefaultFuchsiaResourceDialect,
7301 >(
7302 self.artifact
7303 .as_mut()
7304 .map(<Artifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7305 encoder,
7306 offset + cur_offset,
7307 depth,
7308 )?;
7309
7310 _prev_end_offset = cur_offset + envelope_size;
7311
7312 Ok(())
7313 }
7314 }
7315
7316 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7317 for TestCaseArtifactGeneratedEventDetails
7318 {
7319 #[inline(always)]
7320 fn new_empty() -> Self {
7321 Self::default()
7322 }
7323
7324 unsafe fn decode(
7325 &mut self,
7326 decoder: &mut fidl::encoding::Decoder<
7327 '_,
7328 fidl::encoding::DefaultFuchsiaResourceDialect,
7329 >,
7330 offset: usize,
7331 mut depth: fidl::encoding::Depth,
7332 ) -> fidl::Result<()> {
7333 decoder.debug_check_bounds::<Self>(offset);
7334 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7335 None => return Err(fidl::Error::NotNullable),
7336 Some(len) => len,
7337 };
7338 if len == 0 {
7340 return Ok(());
7341 };
7342 depth.increment()?;
7343 let envelope_size = 8;
7344 let bytes_len = len * envelope_size;
7345 let offset = decoder.out_of_line_offset(bytes_len)?;
7346 let mut _next_ordinal_to_read = 0;
7348 let mut next_offset = offset;
7349 let end_offset = offset + bytes_len;
7350 _next_ordinal_to_read += 1;
7351 if next_offset >= end_offset {
7352 return Ok(());
7353 }
7354
7355 while _next_ordinal_to_read < 1 {
7357 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7358 _next_ordinal_to_read += 1;
7359 next_offset += envelope_size;
7360 }
7361
7362 let next_out_of_line = decoder.next_out_of_line();
7363 let handles_before = decoder.remaining_handles();
7364 if let Some((inlined, num_bytes, num_handles)) =
7365 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7366 {
7367 let member_inline_size =
7368 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7369 if inlined != (member_inline_size <= 4) {
7370 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7371 }
7372 let inner_offset;
7373 let mut inner_depth = depth.clone();
7374 if inlined {
7375 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7376 inner_offset = next_offset;
7377 } else {
7378 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7379 inner_depth.increment()?;
7380 }
7381 let val_ref = self.test_case_id.get_or_insert_with(|| {
7382 fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
7383 });
7384 fidl::decode!(
7385 u32,
7386 fidl::encoding::DefaultFuchsiaResourceDialect,
7387 val_ref,
7388 decoder,
7389 inner_offset,
7390 inner_depth
7391 )?;
7392 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7393 {
7394 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7395 }
7396 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7397 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7398 }
7399 }
7400
7401 next_offset += envelope_size;
7402 _next_ordinal_to_read += 1;
7403 if next_offset >= end_offset {
7404 return Ok(());
7405 }
7406
7407 while _next_ordinal_to_read < 2 {
7409 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7410 _next_ordinal_to_read += 1;
7411 next_offset += envelope_size;
7412 }
7413
7414 let next_out_of_line = decoder.next_out_of_line();
7415 let handles_before = decoder.remaining_handles();
7416 if let Some((inlined, num_bytes, num_handles)) =
7417 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7418 {
7419 let member_inline_size =
7420 <Artifact as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7421 if inlined != (member_inline_size <= 4) {
7422 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7423 }
7424 let inner_offset;
7425 let mut inner_depth = depth.clone();
7426 if inlined {
7427 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7428 inner_offset = next_offset;
7429 } else {
7430 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7431 inner_depth.increment()?;
7432 }
7433 let val_ref = self.artifact.get_or_insert_with(|| {
7434 fidl::new_empty!(Artifact, fidl::encoding::DefaultFuchsiaResourceDialect)
7435 });
7436 fidl::decode!(
7437 Artifact,
7438 fidl::encoding::DefaultFuchsiaResourceDialect,
7439 val_ref,
7440 decoder,
7441 inner_offset,
7442 inner_depth
7443 )?;
7444 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7445 {
7446 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7447 }
7448 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7449 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7450 }
7451 }
7452
7453 next_offset += envelope_size;
7454
7455 while next_offset < end_offset {
7457 _next_ordinal_to_read += 1;
7458 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7459 next_offset += envelope_size;
7460 }
7461
7462 Ok(())
7463 }
7464 }
7465
7466 impl fidl::encoding::ResourceTypeMarker for Artifact {
7467 type Borrowed<'a> = &'a mut Self;
7468 fn take_or_borrow<'a>(
7469 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7470 ) -> Self::Borrowed<'a> {
7471 value
7472 }
7473 }
7474
7475 unsafe impl fidl::encoding::TypeMarker for Artifact {
7476 type Owned = Self;
7477
7478 #[inline(always)]
7479 fn inline_align(_context: fidl::encoding::Context) -> usize {
7480 8
7481 }
7482
7483 #[inline(always)]
7484 fn inline_size(_context: fidl::encoding::Context) -> usize {
7485 16
7486 }
7487 }
7488
7489 unsafe impl fidl::encoding::Encode<Artifact, fidl::encoding::DefaultFuchsiaResourceDialect>
7490 for &mut Artifact
7491 {
7492 #[inline]
7493 unsafe fn encode(
7494 self,
7495 encoder: &mut fidl::encoding::Encoder<
7496 '_,
7497 fidl::encoding::DefaultFuchsiaResourceDialect,
7498 >,
7499 offset: usize,
7500 _depth: fidl::encoding::Depth,
7501 ) -> fidl::Result<()> {
7502 encoder.debug_check_bounds::<Artifact>(offset);
7503 encoder.write_num::<u64>(self.ordinal(), offset);
7504 match self {
7505 Artifact::Stdout(ref mut val) => fidl::encoding::encode_in_envelope::<
7506 fidl::encoding::HandleType<
7507 fidl::Socket,
7508 { fidl::ObjectType::SOCKET.into_raw() },
7509 2147483648,
7510 >,
7511 fidl::encoding::DefaultFuchsiaResourceDialect,
7512 >(
7513 <fidl::encoding::HandleType<
7514 fidl::Socket,
7515 { fidl::ObjectType::SOCKET.into_raw() },
7516 2147483648,
7517 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7518 val
7519 ),
7520 encoder,
7521 offset + 8,
7522 _depth,
7523 ),
7524 Artifact::Stderr(ref mut val) => fidl::encoding::encode_in_envelope::<
7525 fidl::encoding::HandleType<
7526 fidl::Socket,
7527 { fidl::ObjectType::SOCKET.into_raw() },
7528 2147483648,
7529 >,
7530 fidl::encoding::DefaultFuchsiaResourceDialect,
7531 >(
7532 <fidl::encoding::HandleType<
7533 fidl::Socket,
7534 { fidl::ObjectType::SOCKET.into_raw() },
7535 2147483648,
7536 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7537 val
7538 ),
7539 encoder,
7540 offset + 8,
7541 _depth,
7542 ),
7543 Artifact::Log(ref mut val) => fidl::encoding::encode_in_envelope::<
7544 Syslog,
7545 fidl::encoding::DefaultFuchsiaResourceDialect,
7546 >(
7547 <Syslog as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
7548 encoder,
7549 offset + 8,
7550 _depth,
7551 ),
7552 Artifact::Custom(ref mut val) => fidl::encoding::encode_in_envelope::<
7553 CustomArtifact,
7554 fidl::encoding::DefaultFuchsiaResourceDialect,
7555 >(
7556 <CustomArtifact as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
7557 encoder,
7558 offset + 8,
7559 _depth,
7560 ),
7561 Artifact::DebugData(ref mut val) => {
7562 fidl::encoding::encode_in_envelope::<
7563 fidl::encoding::Endpoint<
7564 fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
7565 >,
7566 fidl::encoding::DefaultFuchsiaResourceDialect,
7567 >(
7568 <fidl::encoding::Endpoint<
7569 fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
7570 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7571 val
7572 ),
7573 encoder,
7574 offset + 8,
7575 _depth,
7576 )
7577 }
7578 Artifact::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7579 }
7580 }
7581 }
7582
7583 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Artifact {
7584 #[inline(always)]
7585 fn new_empty() -> Self {
7586 Self::__SourceBreaking { unknown_ordinal: 0 }
7587 }
7588
7589 #[inline]
7590 unsafe fn decode(
7591 &mut self,
7592 decoder: &mut fidl::encoding::Decoder<
7593 '_,
7594 fidl::encoding::DefaultFuchsiaResourceDialect,
7595 >,
7596 offset: usize,
7597 mut depth: fidl::encoding::Depth,
7598 ) -> fidl::Result<()> {
7599 decoder.debug_check_bounds::<Self>(offset);
7600 #[allow(unused_variables)]
7601 let next_out_of_line = decoder.next_out_of_line();
7602 let handles_before = decoder.remaining_handles();
7603 let (ordinal, inlined, num_bytes, num_handles) =
7604 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7605
7606 let member_inline_size =
7607 match ordinal {
7608 1 => <fidl::encoding::HandleType<
7609 fidl::Socket,
7610 { fidl::ObjectType::SOCKET.into_raw() },
7611 2147483648,
7612 > as fidl::encoding::TypeMarker>::inline_size(
7613 decoder.context
7614 ),
7615 2 => <fidl::encoding::HandleType<
7616 fidl::Socket,
7617 { fidl::ObjectType::SOCKET.into_raw() },
7618 2147483648,
7619 > as fidl::encoding::TypeMarker>::inline_size(
7620 decoder.context
7621 ),
7622 3 => <Syslog as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7623 4 => {
7624 <CustomArtifact as fidl::encoding::TypeMarker>::inline_size(decoder.context)
7625 }
7626 5 => <fidl::encoding::Endpoint<
7627 fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
7628 > as fidl::encoding::TypeMarker>::inline_size(
7629 decoder.context
7630 ),
7631 0 => return Err(fidl::Error::UnknownUnionTag),
7632 _ => num_bytes as usize,
7633 };
7634
7635 if inlined != (member_inline_size <= 4) {
7636 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7637 }
7638 let _inner_offset;
7639 if inlined {
7640 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7641 _inner_offset = offset + 8;
7642 } else {
7643 depth.increment()?;
7644 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7645 }
7646 match ordinal {
7647 1 => {
7648 #[allow(irrefutable_let_patterns)]
7649 if let Artifact::Stdout(_) = self {
7650 } else {
7652 *self = Artifact::Stdout(
7654 fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7655 );
7656 }
7657 #[allow(irrefutable_let_patterns)]
7658 if let Artifact::Stdout(ref mut val) = self {
7659 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
7660 } else {
7661 unreachable!()
7662 }
7663 }
7664 2 => {
7665 #[allow(irrefutable_let_patterns)]
7666 if let Artifact::Stderr(_) = self {
7667 } else {
7669 *self = Artifact::Stderr(
7671 fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7672 );
7673 }
7674 #[allow(irrefutable_let_patterns)]
7675 if let Artifact::Stderr(ref mut val) = self {
7676 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
7677 } else {
7678 unreachable!()
7679 }
7680 }
7681 3 => {
7682 #[allow(irrefutable_let_patterns)]
7683 if let Artifact::Log(_) = self {
7684 } else {
7686 *self = Artifact::Log(fidl::new_empty!(
7688 Syslog,
7689 fidl::encoding::DefaultFuchsiaResourceDialect
7690 ));
7691 }
7692 #[allow(irrefutable_let_patterns)]
7693 if let Artifact::Log(ref mut val) = self {
7694 fidl::decode!(
7695 Syslog,
7696 fidl::encoding::DefaultFuchsiaResourceDialect,
7697 val,
7698 decoder,
7699 _inner_offset,
7700 depth
7701 )?;
7702 } else {
7703 unreachable!()
7704 }
7705 }
7706 4 => {
7707 #[allow(irrefutable_let_patterns)]
7708 if let Artifact::Custom(_) = self {
7709 } else {
7711 *self = Artifact::Custom(fidl::new_empty!(
7713 CustomArtifact,
7714 fidl::encoding::DefaultFuchsiaResourceDialect
7715 ));
7716 }
7717 #[allow(irrefutable_let_patterns)]
7718 if let Artifact::Custom(ref mut val) = self {
7719 fidl::decode!(
7720 CustomArtifact,
7721 fidl::encoding::DefaultFuchsiaResourceDialect,
7722 val,
7723 decoder,
7724 _inner_offset,
7725 depth
7726 )?;
7727 } else {
7728 unreachable!()
7729 }
7730 }
7731 5 => {
7732 #[allow(irrefutable_let_patterns)]
7733 if let Artifact::DebugData(_) = self {
7734 } else {
7736 *self = Artifact::DebugData(fidl::new_empty!(
7738 fidl::encoding::Endpoint<
7739 fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
7740 >,
7741 fidl::encoding::DefaultFuchsiaResourceDialect
7742 ));
7743 }
7744 #[allow(irrefutable_let_patterns)]
7745 if let Artifact::DebugData(ref mut val) = self {
7746 fidl::decode!(
7747 fidl::encoding::Endpoint<
7748 fidl::endpoints::ClientEnd<DebugDataIteratorMarker>,
7749 >,
7750 fidl::encoding::DefaultFuchsiaResourceDialect,
7751 val,
7752 decoder,
7753 _inner_offset,
7754 depth
7755 )?;
7756 } else {
7757 unreachable!()
7758 }
7759 }
7760 #[allow(deprecated)]
7761 ordinal => {
7762 for _ in 0..num_handles {
7763 decoder.drop_next_handle()?;
7764 }
7765 *self = Artifact::__SourceBreaking { unknown_ordinal: ordinal };
7766 }
7767 }
7768 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7769 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7770 }
7771 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7772 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7773 }
7774 Ok(())
7775 }
7776 }
7777
7778 impl fidl::encoding::ResourceTypeMarker for EventDetails {
7779 type Borrowed<'a> = &'a mut Self;
7780 fn take_or_borrow<'a>(
7781 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7782 ) -> Self::Borrowed<'a> {
7783 value
7784 }
7785 }
7786
7787 unsafe impl fidl::encoding::TypeMarker for EventDetails {
7788 type Owned = Self;
7789
7790 #[inline(always)]
7791 fn inline_align(_context: fidl::encoding::Context) -> usize {
7792 8
7793 }
7794
7795 #[inline(always)]
7796 fn inline_size(_context: fidl::encoding::Context) -> usize {
7797 16
7798 }
7799 }
7800
7801 unsafe impl fidl::encoding::Encode<EventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>
7802 for &mut EventDetails
7803 {
7804 #[inline]
7805 unsafe fn encode(
7806 self,
7807 encoder: &mut fidl::encoding::Encoder<
7808 '_,
7809 fidl::encoding::DefaultFuchsiaResourceDialect,
7810 >,
7811 offset: usize,
7812 _depth: fidl::encoding::Depth,
7813 ) -> fidl::Result<()> {
7814 encoder.debug_check_bounds::<EventDetails>(offset);
7815 encoder.write_num::<u64>(self.ordinal(), offset);
7816 match self {
7817 EventDetails::SuiteStarted(ref val) => {
7818 fidl::encoding::encode_in_envelope::<SuiteStartedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
7819 <SuiteStartedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
7820 encoder, offset + 8, _depth
7821 )
7822 }
7823 EventDetails::TestCaseFound(ref val) => {
7824 fidl::encoding::encode_in_envelope::<TestCaseFoundEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
7825 <TestCaseFoundEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
7826 encoder, offset + 8, _depth
7827 )
7828 }
7829 EventDetails::TestCaseStarted(ref val) => {
7830 fidl::encoding::encode_in_envelope::<TestCaseStartedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
7831 <TestCaseStartedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
7832 encoder, offset + 8, _depth
7833 )
7834 }
7835 EventDetails::TestCaseArtifactGenerated(ref mut val) => {
7836 fidl::encoding::encode_in_envelope::<TestCaseArtifactGeneratedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
7837 <TestCaseArtifactGeneratedEventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
7838 encoder, offset + 8, _depth
7839 )
7840 }
7841 EventDetails::TestCaseStopped(ref val) => {
7842 fidl::encoding::encode_in_envelope::<TestCaseStoppedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
7843 <TestCaseStoppedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
7844 encoder, offset + 8, _depth
7845 )
7846 }
7847 EventDetails::TestCaseFinished(ref val) => {
7848 fidl::encoding::encode_in_envelope::<TestCaseFinishedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
7849 <TestCaseFinishedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
7850 encoder, offset + 8, _depth
7851 )
7852 }
7853 EventDetails::SuiteArtifactGenerated(ref mut val) => {
7854 fidl::encoding::encode_in_envelope::<SuiteArtifactGeneratedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
7855 <SuiteArtifactGeneratedEventDetails as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
7856 encoder, offset + 8, _depth
7857 )
7858 }
7859 EventDetails::SuiteStopped(ref val) => {
7860 fidl::encoding::encode_in_envelope::<SuiteStoppedEventDetails, fidl::encoding::DefaultFuchsiaResourceDialect>(
7861 <SuiteStoppedEventDetails as fidl::encoding::ValueTypeMarker>::borrow(val),
7862 encoder, offset + 8, _depth
7863 )
7864 }
7865 EventDetails::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7866 }
7867 }
7868 }
7869
7870 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for EventDetails {
7871 #[inline(always)]
7872 fn new_empty() -> Self {
7873 Self::__SourceBreaking { unknown_ordinal: 0 }
7874 }
7875
7876 #[inline]
7877 unsafe fn decode(
7878 &mut self,
7879 decoder: &mut fidl::encoding::Decoder<
7880 '_,
7881 fidl::encoding::DefaultFuchsiaResourceDialect,
7882 >,
7883 offset: usize,
7884 mut depth: fidl::encoding::Depth,
7885 ) -> fidl::Result<()> {
7886 decoder.debug_check_bounds::<Self>(offset);
7887 #[allow(unused_variables)]
7888 let next_out_of_line = decoder.next_out_of_line();
7889 let handles_before = decoder.remaining_handles();
7890 let (ordinal, inlined, num_bytes, num_handles) =
7891 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7892
7893 let member_inline_size = match ordinal {
7894 1 => <SuiteStartedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7895 2 => <TestCaseFoundEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7896 3 => <TestCaseStartedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7897 4 => <TestCaseArtifactGeneratedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7898 5 => <TestCaseStoppedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7899 6 => <TestCaseFinishedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7900 7 => <SuiteArtifactGeneratedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7901 8 => <SuiteStoppedEventDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7902 0 => return Err(fidl::Error::UnknownUnionTag),
7903 _ => num_bytes as usize,
7904 };
7905
7906 if inlined != (member_inline_size <= 4) {
7907 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7908 }
7909 let _inner_offset;
7910 if inlined {
7911 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7912 _inner_offset = offset + 8;
7913 } else {
7914 depth.increment()?;
7915 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7916 }
7917 match ordinal {
7918 1 => {
7919 #[allow(irrefutable_let_patterns)]
7920 if let EventDetails::SuiteStarted(_) = self {
7921 } else {
7923 *self = EventDetails::SuiteStarted(fidl::new_empty!(
7925 SuiteStartedEventDetails,
7926 fidl::encoding::DefaultFuchsiaResourceDialect
7927 ));
7928 }
7929 #[allow(irrefutable_let_patterns)]
7930 if let EventDetails::SuiteStarted(ref mut val) = self {
7931 fidl::decode!(
7932 SuiteStartedEventDetails,
7933 fidl::encoding::DefaultFuchsiaResourceDialect,
7934 val,
7935 decoder,
7936 _inner_offset,
7937 depth
7938 )?;
7939 } else {
7940 unreachable!()
7941 }
7942 }
7943 2 => {
7944 #[allow(irrefutable_let_patterns)]
7945 if let EventDetails::TestCaseFound(_) = self {
7946 } else {
7948 *self = EventDetails::TestCaseFound(fidl::new_empty!(
7950 TestCaseFoundEventDetails,
7951 fidl::encoding::DefaultFuchsiaResourceDialect
7952 ));
7953 }
7954 #[allow(irrefutable_let_patterns)]
7955 if let EventDetails::TestCaseFound(ref mut val) = self {
7956 fidl::decode!(
7957 TestCaseFoundEventDetails,
7958 fidl::encoding::DefaultFuchsiaResourceDialect,
7959 val,
7960 decoder,
7961 _inner_offset,
7962 depth
7963 )?;
7964 } else {
7965 unreachable!()
7966 }
7967 }
7968 3 => {
7969 #[allow(irrefutable_let_patterns)]
7970 if let EventDetails::TestCaseStarted(_) = self {
7971 } else {
7973 *self = EventDetails::TestCaseStarted(fidl::new_empty!(
7975 TestCaseStartedEventDetails,
7976 fidl::encoding::DefaultFuchsiaResourceDialect
7977 ));
7978 }
7979 #[allow(irrefutable_let_patterns)]
7980 if let EventDetails::TestCaseStarted(ref mut val) = self {
7981 fidl::decode!(
7982 TestCaseStartedEventDetails,
7983 fidl::encoding::DefaultFuchsiaResourceDialect,
7984 val,
7985 decoder,
7986 _inner_offset,
7987 depth
7988 )?;
7989 } else {
7990 unreachable!()
7991 }
7992 }
7993 4 => {
7994 #[allow(irrefutable_let_patterns)]
7995 if let EventDetails::TestCaseArtifactGenerated(_) = self {
7996 } else {
7998 *self = EventDetails::TestCaseArtifactGenerated(fidl::new_empty!(
8000 TestCaseArtifactGeneratedEventDetails,
8001 fidl::encoding::DefaultFuchsiaResourceDialect
8002 ));
8003 }
8004 #[allow(irrefutable_let_patterns)]
8005 if let EventDetails::TestCaseArtifactGenerated(ref mut val) = self {
8006 fidl::decode!(
8007 TestCaseArtifactGeneratedEventDetails,
8008 fidl::encoding::DefaultFuchsiaResourceDialect,
8009 val,
8010 decoder,
8011 _inner_offset,
8012 depth
8013 )?;
8014 } else {
8015 unreachable!()
8016 }
8017 }
8018 5 => {
8019 #[allow(irrefutable_let_patterns)]
8020 if let EventDetails::TestCaseStopped(_) = self {
8021 } else {
8023 *self = EventDetails::TestCaseStopped(fidl::new_empty!(
8025 TestCaseStoppedEventDetails,
8026 fidl::encoding::DefaultFuchsiaResourceDialect
8027 ));
8028 }
8029 #[allow(irrefutable_let_patterns)]
8030 if let EventDetails::TestCaseStopped(ref mut val) = self {
8031 fidl::decode!(
8032 TestCaseStoppedEventDetails,
8033 fidl::encoding::DefaultFuchsiaResourceDialect,
8034 val,
8035 decoder,
8036 _inner_offset,
8037 depth
8038 )?;
8039 } else {
8040 unreachable!()
8041 }
8042 }
8043 6 => {
8044 #[allow(irrefutable_let_patterns)]
8045 if let EventDetails::TestCaseFinished(_) = self {
8046 } else {
8048 *self = EventDetails::TestCaseFinished(fidl::new_empty!(
8050 TestCaseFinishedEventDetails,
8051 fidl::encoding::DefaultFuchsiaResourceDialect
8052 ));
8053 }
8054 #[allow(irrefutable_let_patterns)]
8055 if let EventDetails::TestCaseFinished(ref mut val) = self {
8056 fidl::decode!(
8057 TestCaseFinishedEventDetails,
8058 fidl::encoding::DefaultFuchsiaResourceDialect,
8059 val,
8060 decoder,
8061 _inner_offset,
8062 depth
8063 )?;
8064 } else {
8065 unreachable!()
8066 }
8067 }
8068 7 => {
8069 #[allow(irrefutable_let_patterns)]
8070 if let EventDetails::SuiteArtifactGenerated(_) = self {
8071 } else {
8073 *self = EventDetails::SuiteArtifactGenerated(fidl::new_empty!(
8075 SuiteArtifactGeneratedEventDetails,
8076 fidl::encoding::DefaultFuchsiaResourceDialect
8077 ));
8078 }
8079 #[allow(irrefutable_let_patterns)]
8080 if let EventDetails::SuiteArtifactGenerated(ref mut val) = self {
8081 fidl::decode!(
8082 SuiteArtifactGeneratedEventDetails,
8083 fidl::encoding::DefaultFuchsiaResourceDialect,
8084 val,
8085 decoder,
8086 _inner_offset,
8087 depth
8088 )?;
8089 } else {
8090 unreachable!()
8091 }
8092 }
8093 8 => {
8094 #[allow(irrefutable_let_patterns)]
8095 if let EventDetails::SuiteStopped(_) = self {
8096 } else {
8098 *self = EventDetails::SuiteStopped(fidl::new_empty!(
8100 SuiteStoppedEventDetails,
8101 fidl::encoding::DefaultFuchsiaResourceDialect
8102 ));
8103 }
8104 #[allow(irrefutable_let_patterns)]
8105 if let EventDetails::SuiteStopped(ref mut val) = self {
8106 fidl::decode!(
8107 SuiteStoppedEventDetails,
8108 fidl::encoding::DefaultFuchsiaResourceDialect,
8109 val,
8110 decoder,
8111 _inner_offset,
8112 depth
8113 )?;
8114 } else {
8115 unreachable!()
8116 }
8117 }
8118 #[allow(deprecated)]
8119 ordinal => {
8120 for _ in 0..num_handles {
8121 decoder.drop_next_handle()?;
8122 }
8123 *self = EventDetails::__SourceBreaking { unknown_ordinal: ordinal };
8124 }
8125 }
8126 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8127 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8128 }
8129 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8130 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8131 }
8132 Ok(())
8133 }
8134 }
8135
8136 impl fidl::encoding::ResourceTypeMarker for LogsIterator {
8137 type Borrowed<'a> = &'a mut Self;
8138 fn take_or_borrow<'a>(
8139 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8140 ) -> Self::Borrowed<'a> {
8141 value
8142 }
8143 }
8144
8145 unsafe impl fidl::encoding::TypeMarker for LogsIterator {
8146 type Owned = Self;
8147
8148 #[inline(always)]
8149 fn inline_align(_context: fidl::encoding::Context) -> usize {
8150 8
8151 }
8152
8153 #[inline(always)]
8154 fn inline_size(_context: fidl::encoding::Context) -> usize {
8155 16
8156 }
8157 }
8158
8159 unsafe impl fidl::encoding::Encode<LogsIterator, fidl::encoding::DefaultFuchsiaResourceDialect>
8160 for &mut LogsIterator
8161 {
8162 #[inline]
8163 unsafe fn encode(
8164 self,
8165 encoder: &mut fidl::encoding::Encoder<
8166 '_,
8167 fidl::encoding::DefaultFuchsiaResourceDialect,
8168 >,
8169 offset: usize,
8170 _depth: fidl::encoding::Depth,
8171 ) -> fidl::Result<()> {
8172 encoder.debug_check_bounds::<LogsIterator>(offset);
8173 encoder.write_num::<u64>(self.ordinal(), offset);
8174 match self {
8175 LogsIterator::Batch(ref mut val) => fidl::encoding::encode_in_envelope::<
8176 fidl::encoding::Endpoint<
8177 fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
8178 >,
8179 fidl::encoding::DefaultFuchsiaResourceDialect,
8180 >(
8181 <fidl::encoding::Endpoint<
8182 fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
8183 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8184 val
8185 ),
8186 encoder,
8187 offset + 8,
8188 _depth,
8189 ),
8190 LogsIterator::Stream(ref mut val) => fidl::encoding::encode_in_envelope::<
8191 fidl::encoding::HandleType<
8192 fidl::Socket,
8193 { fidl::ObjectType::SOCKET.into_raw() },
8194 16392,
8195 >,
8196 fidl::encoding::DefaultFuchsiaResourceDialect,
8197 >(
8198 <fidl::encoding::HandleType<
8199 fidl::Socket,
8200 { fidl::ObjectType::SOCKET.into_raw() },
8201 16392,
8202 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8203 val
8204 ),
8205 encoder,
8206 offset + 8,
8207 _depth,
8208 ),
8209 LogsIterator::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
8210 }
8211 }
8212 }
8213
8214 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for LogsIterator {
8215 #[inline(always)]
8216 fn new_empty() -> Self {
8217 Self::__SourceBreaking { unknown_ordinal: 0 }
8218 }
8219
8220 #[inline]
8221 unsafe fn decode(
8222 &mut self,
8223 decoder: &mut fidl::encoding::Decoder<
8224 '_,
8225 fidl::encoding::DefaultFuchsiaResourceDialect,
8226 >,
8227 offset: usize,
8228 mut depth: fidl::encoding::Depth,
8229 ) -> fidl::Result<()> {
8230 decoder.debug_check_bounds::<Self>(offset);
8231 #[allow(unused_variables)]
8232 let next_out_of_line = decoder.next_out_of_line();
8233 let handles_before = decoder.remaining_handles();
8234 let (ordinal, inlined, num_bytes, num_handles) =
8235 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8236
8237 let member_inline_size = match ordinal {
8238 2 => <fidl::encoding::Endpoint<
8239 fidl::endpoints::ServerEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
8240 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8241 3 => <fidl::encoding::HandleType<
8242 fidl::Socket,
8243 { fidl::ObjectType::SOCKET.into_raw() },
8244 16392,
8245 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8246 0 => return Err(fidl::Error::UnknownUnionTag),
8247 _ => num_bytes as usize,
8248 };
8249
8250 if inlined != (member_inline_size <= 4) {
8251 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8252 }
8253 let _inner_offset;
8254 if inlined {
8255 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8256 _inner_offset = offset + 8;
8257 } else {
8258 depth.increment()?;
8259 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8260 }
8261 match ordinal {
8262 2 => {
8263 #[allow(irrefutable_let_patterns)]
8264 if let LogsIterator::Batch(_) = self {
8265 } else {
8267 *self = LogsIterator::Batch(fidl::new_empty!(
8269 fidl::encoding::Endpoint<
8270 fidl::endpoints::ServerEnd<
8271 fidl_fuchsia_diagnostics::BatchIteratorMarker,
8272 >,
8273 >,
8274 fidl::encoding::DefaultFuchsiaResourceDialect
8275 ));
8276 }
8277 #[allow(irrefutable_let_patterns)]
8278 if let LogsIterator::Batch(ref mut val) = self {
8279 fidl::decode!(
8280 fidl::encoding::Endpoint<
8281 fidl::endpoints::ServerEnd<
8282 fidl_fuchsia_diagnostics::BatchIteratorMarker,
8283 >,
8284 >,
8285 fidl::encoding::DefaultFuchsiaResourceDialect,
8286 val,
8287 decoder,
8288 _inner_offset,
8289 depth
8290 )?;
8291 } else {
8292 unreachable!()
8293 }
8294 }
8295 3 => {
8296 #[allow(irrefutable_let_patterns)]
8297 if let LogsIterator::Stream(_) = self {
8298 } else {
8300 *self = LogsIterator::Stream(
8302 fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect),
8303 );
8304 }
8305 #[allow(irrefutable_let_patterns)]
8306 if let LogsIterator::Stream(ref mut val) = self {
8307 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 16392>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
8308 } else {
8309 unreachable!()
8310 }
8311 }
8312 #[allow(deprecated)]
8313 ordinal => {
8314 for _ in 0..num_handles {
8315 decoder.drop_next_handle()?;
8316 }
8317 *self = LogsIterator::__SourceBreaking { unknown_ordinal: ordinal };
8318 }
8319 }
8320 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8321 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8322 }
8323 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8324 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8325 }
8326 Ok(())
8327 }
8328 }
8329
8330 impl fidl::encoding::ResourceTypeMarker for Syslog {
8331 type Borrowed<'a> = &'a mut Self;
8332 fn take_or_borrow<'a>(
8333 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8334 ) -> Self::Borrowed<'a> {
8335 value
8336 }
8337 }
8338
8339 unsafe impl fidl::encoding::TypeMarker for Syslog {
8340 type Owned = Self;
8341
8342 #[inline(always)]
8343 fn inline_align(_context: fidl::encoding::Context) -> usize {
8344 8
8345 }
8346
8347 #[inline(always)]
8348 fn inline_size(_context: fidl::encoding::Context) -> usize {
8349 16
8350 }
8351 }
8352
8353 unsafe impl fidl::encoding::Encode<Syslog, fidl::encoding::DefaultFuchsiaResourceDialect>
8354 for &mut Syslog
8355 {
8356 #[inline]
8357 unsafe fn encode(
8358 self,
8359 encoder: &mut fidl::encoding::Encoder<
8360 '_,
8361 fidl::encoding::DefaultFuchsiaResourceDialect,
8362 >,
8363 offset: usize,
8364 _depth: fidl::encoding::Depth,
8365 ) -> fidl::Result<()> {
8366 encoder.debug_check_bounds::<Syslog>(offset);
8367 encoder.write_num::<u64>(self.ordinal(), offset);
8368 match self {
8369 Syslog::Batch(ref mut val) => fidl::encoding::encode_in_envelope::<
8370 fidl::encoding::Endpoint<
8371 fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
8372 >,
8373 fidl::encoding::DefaultFuchsiaResourceDialect,
8374 >(
8375 <fidl::encoding::Endpoint<
8376 fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
8377 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8378 val
8379 ),
8380 encoder,
8381 offset + 8,
8382 _depth,
8383 ),
8384 Syslog::Stream(ref mut val) => fidl::encoding::encode_in_envelope::<
8385 fidl::encoding::HandleType<
8386 fidl::Socket,
8387 { fidl::ObjectType::SOCKET.into_raw() },
8388 2147483648,
8389 >,
8390 fidl::encoding::DefaultFuchsiaResourceDialect,
8391 >(
8392 <fidl::encoding::HandleType<
8393 fidl::Socket,
8394 { fidl::ObjectType::SOCKET.into_raw() },
8395 2147483648,
8396 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8397 val
8398 ),
8399 encoder,
8400 offset + 8,
8401 _depth,
8402 ),
8403 Syslog::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
8404 }
8405 }
8406 }
8407
8408 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Syslog {
8409 #[inline(always)]
8410 fn new_empty() -> Self {
8411 Self::__SourceBreaking { unknown_ordinal: 0 }
8412 }
8413
8414 #[inline]
8415 unsafe fn decode(
8416 &mut self,
8417 decoder: &mut fidl::encoding::Decoder<
8418 '_,
8419 fidl::encoding::DefaultFuchsiaResourceDialect,
8420 >,
8421 offset: usize,
8422 mut depth: fidl::encoding::Depth,
8423 ) -> fidl::Result<()> {
8424 decoder.debug_check_bounds::<Self>(offset);
8425 #[allow(unused_variables)]
8426 let next_out_of_line = decoder.next_out_of_line();
8427 let handles_before = decoder.remaining_handles();
8428 let (ordinal, inlined, num_bytes, num_handles) =
8429 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8430
8431 let member_inline_size = match ordinal {
8432 2 => <fidl::encoding::Endpoint<
8433 fidl::endpoints::ClientEnd<fidl_fuchsia_diagnostics::BatchIteratorMarker>,
8434 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8435 3 => <fidl::encoding::HandleType<
8436 fidl::Socket,
8437 { fidl::ObjectType::SOCKET.into_raw() },
8438 2147483648,
8439 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8440 0 => return Err(fidl::Error::UnknownUnionTag),
8441 _ => num_bytes as usize,
8442 };
8443
8444 if inlined != (member_inline_size <= 4) {
8445 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8446 }
8447 let _inner_offset;
8448 if inlined {
8449 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8450 _inner_offset = offset + 8;
8451 } else {
8452 depth.increment()?;
8453 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8454 }
8455 match ordinal {
8456 2 => {
8457 #[allow(irrefutable_let_patterns)]
8458 if let Syslog::Batch(_) = self {
8459 } else {
8461 *self = Syslog::Batch(fidl::new_empty!(
8463 fidl::encoding::Endpoint<
8464 fidl::endpoints::ClientEnd<
8465 fidl_fuchsia_diagnostics::BatchIteratorMarker,
8466 >,
8467 >,
8468 fidl::encoding::DefaultFuchsiaResourceDialect
8469 ));
8470 }
8471 #[allow(irrefutable_let_patterns)]
8472 if let Syslog::Batch(ref mut val) = self {
8473 fidl::decode!(
8474 fidl::encoding::Endpoint<
8475 fidl::endpoints::ClientEnd<
8476 fidl_fuchsia_diagnostics::BatchIteratorMarker,
8477 >,
8478 >,
8479 fidl::encoding::DefaultFuchsiaResourceDialect,
8480 val,
8481 decoder,
8482 _inner_offset,
8483 depth
8484 )?;
8485 } else {
8486 unreachable!()
8487 }
8488 }
8489 3 => {
8490 #[allow(irrefutable_let_patterns)]
8491 if let Syslog::Stream(_) = self {
8492 } else {
8494 *self = Syslog::Stream(
8496 fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8497 );
8498 }
8499 #[allow(irrefutable_let_patterns)]
8500 if let Syslog::Stream(ref mut val) = self {
8501 fidl::decode!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
8502 } else {
8503 unreachable!()
8504 }
8505 }
8506 #[allow(deprecated)]
8507 ordinal => {
8508 for _ in 0..num_handles {
8509 decoder.drop_next_handle()?;
8510 }
8511 *self = Syslog::__SourceBreaking { unknown_ordinal: ordinal };
8512 }
8513 }
8514 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8515 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8516 }
8517 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8518 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8519 }
8520 Ok(())
8521 }
8522 }
8523}