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_feedback_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
17pub struct Attachment {
18 pub key: String,
19 pub value: fidl_fuchsia_mem::Buffer,
20}
21
22impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Attachment {}
23
24#[derive(Debug, PartialEq)]
25pub struct CrashReporterFileReportRequest {
26 pub report: CrashReport,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for CrashReporterFileReportRequest
31{
32}
33
34#[derive(Debug, PartialEq)]
35pub struct DataProviderGetScreenshotResponse {
36 pub screenshot: Option<Box<Screenshot>>,
37}
38
39impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
40 for DataProviderGetScreenshotResponse
41{
42}
43
44#[derive(Debug, PartialEq)]
45pub struct DataProviderGetSnapshotRequest {
46 pub params: GetSnapshotParameters,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
50 for DataProviderGetSnapshotRequest
51{
52}
53
54#[derive(Debug, PartialEq)]
55pub struct DataProviderGetSnapshotResponse {
56 pub snapshot: Snapshot,
57}
58
59impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
60 for DataProviderGetSnapshotResponse
61{
62}
63
64#[derive(Debug, PartialEq)]
66pub struct Screenshot {
67 pub image: fidl_fuchsia_mem::Buffer,
68 pub dimensions_in_px: fidl_fuchsia_math::Size,
69}
70
71impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Screenshot {}
72
73#[derive(Debug, Default, PartialEq)]
75pub struct CrashReport {
76 pub program_name: Option<String>,
78 pub specific_report: Option<SpecificCrashReport>,
83 pub annotations: Option<Vec<Annotation>>,
89 pub attachments: Option<Vec<Attachment>>,
95 pub event_id: Option<String>,
102 pub program_uptime: Option<i64>,
104 pub crash_signature: Option<String>,
115 pub is_fatal: Option<bool>,
134 #[doc(hidden)]
135 pub __source_breaking: fidl::marker::SourceBreaking,
136}
137
138impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CrashReport {}
139
140#[derive(Debug, Default, PartialEq)]
142pub struct GetSnapshotParameters {
143 pub collection_timeout_per_data: Option<i64>,
154 pub response_channel: Option<fidl::Channel>,
158 #[doc(hidden)]
159 pub __source_breaking: fidl::marker::SourceBreaking,
160}
161
162impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GetSnapshotParameters {}
163
164#[derive(Debug, Default, PartialEq)]
166pub struct NativeCrashReport {
167 pub minidump: Option<fidl_fuchsia_mem::Buffer>,
169 pub process_name: Option<String>,
171 pub process_koid: Option<u64>,
173 pub thread_name: Option<String>,
175 pub thread_koid: Option<u64>,
177 #[doc(hidden)]
178 pub __source_breaking: fidl::marker::SourceBreaking,
179}
180
181impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NativeCrashReport {}
182
183#[derive(Debug, Default, PartialEq)]
185pub struct RuntimeCrashReport {
186 pub exception_type: Option<String>,
188 pub exception_message: Option<String>,
190 pub exception_stack_trace: Option<fidl_fuchsia_mem::Buffer>,
192 #[doc(hidden)]
193 pub __source_breaking: fidl::marker::SourceBreaking,
194}
195
196impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RuntimeCrashReport {}
197
198#[derive(Debug, Default, PartialEq)]
203pub struct Snapshot {
204 pub archive: Option<Attachment>,
212 pub annotations: Option<Vec<Annotation>>,
223 pub annotations2: Option<Vec<Annotation>>,
228 #[doc(hidden)]
229 pub __source_breaking: fidl::marker::SourceBreaking,
230}
231
232impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Snapshot {}
233
234#[derive(Debug)]
239pub enum SpecificCrashReport {
240 Native(NativeCrashReport),
242 Dart(RuntimeCrashReport),
244 #[doc(hidden)]
245 __SourceBreaking { unknown_ordinal: u64 },
246}
247
248#[macro_export]
250macro_rules! SpecificCrashReportUnknown {
251 () => {
252 _
253 };
254}
255
256impl PartialEq for SpecificCrashReport {
258 fn eq(&self, other: &Self) -> bool {
259 match (self, other) {
260 (Self::Native(x), Self::Native(y)) => *x == *y,
261 (Self::Dart(x), Self::Dart(y)) => *x == *y,
262 _ => false,
263 }
264 }
265}
266
267impl SpecificCrashReport {
268 #[inline]
269 pub fn ordinal(&self) -> u64 {
270 match *self {
271 Self::Native(_) => 2,
272 Self::Dart(_) => 3,
273 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
274 }
275 }
276
277 #[inline]
278 pub fn unknown_variant_for_testing() -> Self {
279 Self::__SourceBreaking { unknown_ordinal: 0 }
280 }
281
282 #[inline]
283 pub fn is_unknown(&self) -> bool {
284 match self {
285 Self::__SourceBreaking { .. } => true,
286 _ => false,
287 }
288 }
289}
290
291impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SpecificCrashReport {}
292
293#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
294pub struct ComponentDataRegisterMarker;
295
296impl fidl::endpoints::ProtocolMarker for ComponentDataRegisterMarker {
297 type Proxy = ComponentDataRegisterProxy;
298 type RequestStream = ComponentDataRegisterRequestStream;
299 #[cfg(target_os = "fuchsia")]
300 type SynchronousProxy = ComponentDataRegisterSynchronousProxy;
301
302 const DEBUG_NAME: &'static str = "fuchsia.feedback.ComponentDataRegister";
303}
304impl fidl::endpoints::DiscoverableProtocolMarker for ComponentDataRegisterMarker {}
305
306pub trait ComponentDataRegisterProxyInterface: Send + Sync {
307 type UpsertResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
308 fn r#upsert(&self, data: &ComponentData) -> Self::UpsertResponseFut;
309}
310#[derive(Debug)]
311#[cfg(target_os = "fuchsia")]
312pub struct ComponentDataRegisterSynchronousProxy {
313 client: fidl::client::sync::Client,
314}
315
316#[cfg(target_os = "fuchsia")]
317impl fidl::endpoints::SynchronousProxy for ComponentDataRegisterSynchronousProxy {
318 type Proxy = ComponentDataRegisterProxy;
319 type Protocol = ComponentDataRegisterMarker;
320
321 fn from_channel(inner: fidl::Channel) -> Self {
322 Self::new(inner)
323 }
324
325 fn into_channel(self) -> fidl::Channel {
326 self.client.into_channel()
327 }
328
329 fn as_channel(&self) -> &fidl::Channel {
330 self.client.as_channel()
331 }
332}
333
334#[cfg(target_os = "fuchsia")]
335impl ComponentDataRegisterSynchronousProxy {
336 pub fn new(channel: fidl::Channel) -> Self {
337 let protocol_name =
338 <ComponentDataRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
339 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
340 }
341
342 pub fn into_channel(self) -> fidl::Channel {
343 self.client.into_channel()
344 }
345
346 pub fn wait_for_event(
349 &self,
350 deadline: zx::MonotonicInstant,
351 ) -> Result<ComponentDataRegisterEvent, fidl::Error> {
352 ComponentDataRegisterEvent::decode(self.client.wait_for_event(deadline)?)
353 }
354
355 pub fn r#upsert(
399 &self,
400 mut data: &ComponentData,
401 ___deadline: zx::MonotonicInstant,
402 ) -> Result<(), fidl::Error> {
403 let _response = self
404 .client
405 .send_query::<ComponentDataRegisterUpsertRequest, fidl::encoding::EmptyPayload>(
406 (data,),
407 0xa25b7c4e125c0a1,
408 fidl::encoding::DynamicFlags::empty(),
409 ___deadline,
410 )?;
411 Ok(_response)
412 }
413}
414
415#[cfg(target_os = "fuchsia")]
416impl From<ComponentDataRegisterSynchronousProxy> for zx::Handle {
417 fn from(value: ComponentDataRegisterSynchronousProxy) -> Self {
418 value.into_channel().into()
419 }
420}
421
422#[cfg(target_os = "fuchsia")]
423impl From<fidl::Channel> for ComponentDataRegisterSynchronousProxy {
424 fn from(value: fidl::Channel) -> Self {
425 Self::new(value)
426 }
427}
428
429#[derive(Debug, Clone)]
430pub struct ComponentDataRegisterProxy {
431 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
432}
433
434impl fidl::endpoints::Proxy for ComponentDataRegisterProxy {
435 type Protocol = ComponentDataRegisterMarker;
436
437 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
438 Self::new(inner)
439 }
440
441 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
442 self.client.into_channel().map_err(|client| Self { client })
443 }
444
445 fn as_channel(&self) -> &::fidl::AsyncChannel {
446 self.client.as_channel()
447 }
448}
449
450impl ComponentDataRegisterProxy {
451 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
453 let protocol_name =
454 <ComponentDataRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
455 Self { client: fidl::client::Client::new(channel, protocol_name) }
456 }
457
458 pub fn take_event_stream(&self) -> ComponentDataRegisterEventStream {
464 ComponentDataRegisterEventStream { event_receiver: self.client.take_event_receiver() }
465 }
466
467 pub fn r#upsert(
511 &self,
512 mut data: &ComponentData,
513 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
514 ComponentDataRegisterProxyInterface::r#upsert(self, data)
515 }
516}
517
518impl ComponentDataRegisterProxyInterface for ComponentDataRegisterProxy {
519 type UpsertResponseFut =
520 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
521 fn r#upsert(&self, mut data: &ComponentData) -> Self::UpsertResponseFut {
522 fn _decode(
523 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
524 ) -> Result<(), fidl::Error> {
525 let _response = fidl::client::decode_transaction_body::<
526 fidl::encoding::EmptyPayload,
527 fidl::encoding::DefaultFuchsiaResourceDialect,
528 0xa25b7c4e125c0a1,
529 >(_buf?)?;
530 Ok(_response)
531 }
532 self.client.send_query_and_decode::<ComponentDataRegisterUpsertRequest, ()>(
533 (data,),
534 0xa25b7c4e125c0a1,
535 fidl::encoding::DynamicFlags::empty(),
536 _decode,
537 )
538 }
539}
540
541pub struct ComponentDataRegisterEventStream {
542 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
543}
544
545impl std::marker::Unpin for ComponentDataRegisterEventStream {}
546
547impl futures::stream::FusedStream for ComponentDataRegisterEventStream {
548 fn is_terminated(&self) -> bool {
549 self.event_receiver.is_terminated()
550 }
551}
552
553impl futures::Stream for ComponentDataRegisterEventStream {
554 type Item = Result<ComponentDataRegisterEvent, fidl::Error>;
555
556 fn poll_next(
557 mut self: std::pin::Pin<&mut Self>,
558 cx: &mut std::task::Context<'_>,
559 ) -> std::task::Poll<Option<Self::Item>> {
560 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
561 &mut self.event_receiver,
562 cx
563 )?) {
564 Some(buf) => std::task::Poll::Ready(Some(ComponentDataRegisterEvent::decode(buf))),
565 None => std::task::Poll::Ready(None),
566 }
567 }
568}
569
570#[derive(Debug)]
571pub enum ComponentDataRegisterEvent {}
572
573impl ComponentDataRegisterEvent {
574 fn decode(
576 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
577 ) -> Result<ComponentDataRegisterEvent, fidl::Error> {
578 let (bytes, _handles) = buf.split_mut();
579 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
580 debug_assert_eq!(tx_header.tx_id, 0);
581 match tx_header.ordinal {
582 _ => Err(fidl::Error::UnknownOrdinal {
583 ordinal: tx_header.ordinal,
584 protocol_name:
585 <ComponentDataRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
586 }),
587 }
588 }
589}
590
591pub struct ComponentDataRegisterRequestStream {
593 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
594 is_terminated: bool,
595}
596
597impl std::marker::Unpin for ComponentDataRegisterRequestStream {}
598
599impl futures::stream::FusedStream for ComponentDataRegisterRequestStream {
600 fn is_terminated(&self) -> bool {
601 self.is_terminated
602 }
603}
604
605impl fidl::endpoints::RequestStream for ComponentDataRegisterRequestStream {
606 type Protocol = ComponentDataRegisterMarker;
607 type ControlHandle = ComponentDataRegisterControlHandle;
608
609 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
610 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
611 }
612
613 fn control_handle(&self) -> Self::ControlHandle {
614 ComponentDataRegisterControlHandle { inner: self.inner.clone() }
615 }
616
617 fn into_inner(
618 self,
619 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
620 {
621 (self.inner, self.is_terminated)
622 }
623
624 fn from_inner(
625 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
626 is_terminated: bool,
627 ) -> Self {
628 Self { inner, is_terminated }
629 }
630}
631
632impl futures::Stream for ComponentDataRegisterRequestStream {
633 type Item = Result<ComponentDataRegisterRequest, fidl::Error>;
634
635 fn poll_next(
636 mut self: std::pin::Pin<&mut Self>,
637 cx: &mut std::task::Context<'_>,
638 ) -> std::task::Poll<Option<Self::Item>> {
639 let this = &mut *self;
640 if this.inner.check_shutdown(cx) {
641 this.is_terminated = true;
642 return std::task::Poll::Ready(None);
643 }
644 if this.is_terminated {
645 panic!("polled ComponentDataRegisterRequestStream after completion");
646 }
647 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
648 |bytes, handles| {
649 match this.inner.channel().read_etc(cx, bytes, handles) {
650 std::task::Poll::Ready(Ok(())) => {}
651 std::task::Poll::Pending => return std::task::Poll::Pending,
652 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
653 this.is_terminated = true;
654 return std::task::Poll::Ready(None);
655 }
656 std::task::Poll::Ready(Err(e)) => {
657 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
658 e.into(),
659 ))))
660 }
661 }
662
663 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
665
666 std::task::Poll::Ready(Some(match header.ordinal {
667 0xa25b7c4e125c0a1 => {
668 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
669 let mut req = fidl::new_empty!(ComponentDataRegisterUpsertRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
670 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ComponentDataRegisterUpsertRequest>(&header, _body_bytes, handles, &mut req)?;
671 let control_handle = ComponentDataRegisterControlHandle {
672 inner: this.inner.clone(),
673 };
674 Ok(ComponentDataRegisterRequest::Upsert {data: req.data,
675
676 responder: ComponentDataRegisterUpsertResponder {
677 control_handle: std::mem::ManuallyDrop::new(control_handle),
678 tx_id: header.tx_id,
679 },
680 })
681 }
682 _ => Err(fidl::Error::UnknownOrdinal {
683 ordinal: header.ordinal,
684 protocol_name: <ComponentDataRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
685 }),
686 }))
687 },
688 )
689 }
690}
691
692#[derive(Debug)]
704pub enum ComponentDataRegisterRequest {
705 Upsert { data: ComponentData, responder: ComponentDataRegisterUpsertResponder },
749}
750
751impl ComponentDataRegisterRequest {
752 #[allow(irrefutable_let_patterns)]
753 pub fn into_upsert(self) -> Option<(ComponentData, ComponentDataRegisterUpsertResponder)> {
754 if let ComponentDataRegisterRequest::Upsert { data, responder } = self {
755 Some((data, responder))
756 } else {
757 None
758 }
759 }
760
761 pub fn method_name(&self) -> &'static str {
763 match *self {
764 ComponentDataRegisterRequest::Upsert { .. } => "upsert",
765 }
766 }
767}
768
769#[derive(Debug, Clone)]
770pub struct ComponentDataRegisterControlHandle {
771 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
772}
773
774impl fidl::endpoints::ControlHandle for ComponentDataRegisterControlHandle {
775 fn shutdown(&self) {
776 self.inner.shutdown()
777 }
778 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
779 self.inner.shutdown_with_epitaph(status)
780 }
781
782 fn is_closed(&self) -> bool {
783 self.inner.channel().is_closed()
784 }
785 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
786 self.inner.channel().on_closed()
787 }
788
789 #[cfg(target_os = "fuchsia")]
790 fn signal_peer(
791 &self,
792 clear_mask: zx::Signals,
793 set_mask: zx::Signals,
794 ) -> Result<(), zx_status::Status> {
795 use fidl::Peered;
796 self.inner.channel().signal_peer(clear_mask, set_mask)
797 }
798}
799
800impl ComponentDataRegisterControlHandle {}
801
802#[must_use = "FIDL methods require a response to be sent"]
803#[derive(Debug)]
804pub struct ComponentDataRegisterUpsertResponder {
805 control_handle: std::mem::ManuallyDrop<ComponentDataRegisterControlHandle>,
806 tx_id: u32,
807}
808
809impl std::ops::Drop for ComponentDataRegisterUpsertResponder {
813 fn drop(&mut self) {
814 self.control_handle.shutdown();
815 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
817 }
818}
819
820impl fidl::endpoints::Responder for ComponentDataRegisterUpsertResponder {
821 type ControlHandle = ComponentDataRegisterControlHandle;
822
823 fn control_handle(&self) -> &ComponentDataRegisterControlHandle {
824 &self.control_handle
825 }
826
827 fn drop_without_shutdown(mut self) {
828 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
830 std::mem::forget(self);
832 }
833}
834
835impl ComponentDataRegisterUpsertResponder {
836 pub fn send(self) -> Result<(), fidl::Error> {
840 let _result = self.send_raw();
841 if _result.is_err() {
842 self.control_handle.shutdown();
843 }
844 self.drop_without_shutdown();
845 _result
846 }
847
848 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
850 let _result = self.send_raw();
851 self.drop_without_shutdown();
852 _result
853 }
854
855 fn send_raw(&self) -> Result<(), fidl::Error> {
856 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
857 (),
858 self.tx_id,
859 0xa25b7c4e125c0a1,
860 fidl::encoding::DynamicFlags::empty(),
861 )
862 }
863}
864
865#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
866pub struct CrashReporterMarker;
867
868impl fidl::endpoints::ProtocolMarker for CrashReporterMarker {
869 type Proxy = CrashReporterProxy;
870 type RequestStream = CrashReporterRequestStream;
871 #[cfg(target_os = "fuchsia")]
872 type SynchronousProxy = CrashReporterSynchronousProxy;
873
874 const DEBUG_NAME: &'static str = "fuchsia.feedback.CrashReporter";
875}
876impl fidl::endpoints::DiscoverableProtocolMarker for CrashReporterMarker {}
877pub type CrashReporterFileReportResult = Result<FileReportResults, FilingError>;
878
879pub trait CrashReporterProxyInterface: Send + Sync {
880 type FileReportResponseFut: std::future::Future<Output = Result<CrashReporterFileReportResult, fidl::Error>>
881 + Send;
882 fn r#file_report(&self, report: CrashReport) -> Self::FileReportResponseFut;
883}
884#[derive(Debug)]
885#[cfg(target_os = "fuchsia")]
886pub struct CrashReporterSynchronousProxy {
887 client: fidl::client::sync::Client,
888}
889
890#[cfg(target_os = "fuchsia")]
891impl fidl::endpoints::SynchronousProxy for CrashReporterSynchronousProxy {
892 type Proxy = CrashReporterProxy;
893 type Protocol = CrashReporterMarker;
894
895 fn from_channel(inner: fidl::Channel) -> Self {
896 Self::new(inner)
897 }
898
899 fn into_channel(self) -> fidl::Channel {
900 self.client.into_channel()
901 }
902
903 fn as_channel(&self) -> &fidl::Channel {
904 self.client.as_channel()
905 }
906}
907
908#[cfg(target_os = "fuchsia")]
909impl CrashReporterSynchronousProxy {
910 pub fn new(channel: fidl::Channel) -> Self {
911 let protocol_name = <CrashReporterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
912 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
913 }
914
915 pub fn into_channel(self) -> fidl::Channel {
916 self.client.into_channel()
917 }
918
919 pub fn wait_for_event(
922 &self,
923 deadline: zx::MonotonicInstant,
924 ) -> Result<CrashReporterEvent, fidl::Error> {
925 CrashReporterEvent::decode(self.client.wait_for_event(deadline)?)
926 }
927
928 pub fn r#file_report(
937 &self,
938 mut report: CrashReport,
939 ___deadline: zx::MonotonicInstant,
940 ) -> Result<CrashReporterFileReportResult, fidl::Error> {
941 let _response = self.client.send_query::<
942 CrashReporterFileReportRequest,
943 fidl::encoding::ResultType<CrashReporterFileReportResponse, FilingError>,
944 >(
945 (&mut report,),
946 0x6f660f55b3160dd4,
947 fidl::encoding::DynamicFlags::empty(),
948 ___deadline,
949 )?;
950 Ok(_response.map(|x| x.results))
951 }
952}
953
954#[cfg(target_os = "fuchsia")]
955impl From<CrashReporterSynchronousProxy> for zx::Handle {
956 fn from(value: CrashReporterSynchronousProxy) -> Self {
957 value.into_channel().into()
958 }
959}
960
961#[cfg(target_os = "fuchsia")]
962impl From<fidl::Channel> for CrashReporterSynchronousProxy {
963 fn from(value: fidl::Channel) -> Self {
964 Self::new(value)
965 }
966}
967
968#[derive(Debug, Clone)]
969pub struct CrashReporterProxy {
970 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
971}
972
973impl fidl::endpoints::Proxy for CrashReporterProxy {
974 type Protocol = CrashReporterMarker;
975
976 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
977 Self::new(inner)
978 }
979
980 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
981 self.client.into_channel().map_err(|client| Self { client })
982 }
983
984 fn as_channel(&self) -> &::fidl::AsyncChannel {
985 self.client.as_channel()
986 }
987}
988
989impl CrashReporterProxy {
990 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
992 let protocol_name = <CrashReporterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
993 Self { client: fidl::client::Client::new(channel, protocol_name) }
994 }
995
996 pub fn take_event_stream(&self) -> CrashReporterEventStream {
1002 CrashReporterEventStream { event_receiver: self.client.take_event_receiver() }
1003 }
1004
1005 pub fn r#file_report(
1014 &self,
1015 mut report: CrashReport,
1016 ) -> fidl::client::QueryResponseFut<
1017 CrashReporterFileReportResult,
1018 fidl::encoding::DefaultFuchsiaResourceDialect,
1019 > {
1020 CrashReporterProxyInterface::r#file_report(self, report)
1021 }
1022}
1023
1024impl CrashReporterProxyInterface for CrashReporterProxy {
1025 type FileReportResponseFut = fidl::client::QueryResponseFut<
1026 CrashReporterFileReportResult,
1027 fidl::encoding::DefaultFuchsiaResourceDialect,
1028 >;
1029 fn r#file_report(&self, mut report: CrashReport) -> Self::FileReportResponseFut {
1030 fn _decode(
1031 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1032 ) -> Result<CrashReporterFileReportResult, fidl::Error> {
1033 let _response = fidl::client::decode_transaction_body::<
1034 fidl::encoding::ResultType<CrashReporterFileReportResponse, FilingError>,
1035 fidl::encoding::DefaultFuchsiaResourceDialect,
1036 0x6f660f55b3160dd4,
1037 >(_buf?)?;
1038 Ok(_response.map(|x| x.results))
1039 }
1040 self.client
1041 .send_query_and_decode::<CrashReporterFileReportRequest, CrashReporterFileReportResult>(
1042 (&mut report,),
1043 0x6f660f55b3160dd4,
1044 fidl::encoding::DynamicFlags::empty(),
1045 _decode,
1046 )
1047 }
1048}
1049
1050pub struct CrashReporterEventStream {
1051 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1052}
1053
1054impl std::marker::Unpin for CrashReporterEventStream {}
1055
1056impl futures::stream::FusedStream for CrashReporterEventStream {
1057 fn is_terminated(&self) -> bool {
1058 self.event_receiver.is_terminated()
1059 }
1060}
1061
1062impl futures::Stream for CrashReporterEventStream {
1063 type Item = Result<CrashReporterEvent, fidl::Error>;
1064
1065 fn poll_next(
1066 mut self: std::pin::Pin<&mut Self>,
1067 cx: &mut std::task::Context<'_>,
1068 ) -> std::task::Poll<Option<Self::Item>> {
1069 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1070 &mut self.event_receiver,
1071 cx
1072 )?) {
1073 Some(buf) => std::task::Poll::Ready(Some(CrashReporterEvent::decode(buf))),
1074 None => std::task::Poll::Ready(None),
1075 }
1076 }
1077}
1078
1079#[derive(Debug)]
1080pub enum CrashReporterEvent {}
1081
1082impl CrashReporterEvent {
1083 fn decode(
1085 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1086 ) -> Result<CrashReporterEvent, fidl::Error> {
1087 let (bytes, _handles) = buf.split_mut();
1088 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1089 debug_assert_eq!(tx_header.tx_id, 0);
1090 match tx_header.ordinal {
1091 _ => Err(fidl::Error::UnknownOrdinal {
1092 ordinal: tx_header.ordinal,
1093 protocol_name: <CrashReporterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1094 }),
1095 }
1096 }
1097}
1098
1099pub struct CrashReporterRequestStream {
1101 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1102 is_terminated: bool,
1103}
1104
1105impl std::marker::Unpin for CrashReporterRequestStream {}
1106
1107impl futures::stream::FusedStream for CrashReporterRequestStream {
1108 fn is_terminated(&self) -> bool {
1109 self.is_terminated
1110 }
1111}
1112
1113impl fidl::endpoints::RequestStream for CrashReporterRequestStream {
1114 type Protocol = CrashReporterMarker;
1115 type ControlHandle = CrashReporterControlHandle;
1116
1117 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1118 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1119 }
1120
1121 fn control_handle(&self) -> Self::ControlHandle {
1122 CrashReporterControlHandle { inner: self.inner.clone() }
1123 }
1124
1125 fn into_inner(
1126 self,
1127 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1128 {
1129 (self.inner, self.is_terminated)
1130 }
1131
1132 fn from_inner(
1133 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1134 is_terminated: bool,
1135 ) -> Self {
1136 Self { inner, is_terminated }
1137 }
1138}
1139
1140impl futures::Stream for CrashReporterRequestStream {
1141 type Item = Result<CrashReporterRequest, fidl::Error>;
1142
1143 fn poll_next(
1144 mut self: std::pin::Pin<&mut Self>,
1145 cx: &mut std::task::Context<'_>,
1146 ) -> std::task::Poll<Option<Self::Item>> {
1147 let this = &mut *self;
1148 if this.inner.check_shutdown(cx) {
1149 this.is_terminated = true;
1150 return std::task::Poll::Ready(None);
1151 }
1152 if this.is_terminated {
1153 panic!("polled CrashReporterRequestStream after completion");
1154 }
1155 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1156 |bytes, handles| {
1157 match this.inner.channel().read_etc(cx, bytes, handles) {
1158 std::task::Poll::Ready(Ok(())) => {}
1159 std::task::Poll::Pending => return std::task::Poll::Pending,
1160 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1161 this.is_terminated = true;
1162 return std::task::Poll::Ready(None);
1163 }
1164 std::task::Poll::Ready(Err(e)) => {
1165 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1166 e.into(),
1167 ))))
1168 }
1169 }
1170
1171 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1173
1174 std::task::Poll::Ready(Some(match header.ordinal {
1175 0x6f660f55b3160dd4 => {
1176 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1177 let mut req = fidl::new_empty!(
1178 CrashReporterFileReportRequest,
1179 fidl::encoding::DefaultFuchsiaResourceDialect
1180 );
1181 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CrashReporterFileReportRequest>(&header, _body_bytes, handles, &mut req)?;
1182 let control_handle =
1183 CrashReporterControlHandle { inner: this.inner.clone() };
1184 Ok(CrashReporterRequest::FileReport {
1185 report: req.report,
1186
1187 responder: CrashReporterFileReportResponder {
1188 control_handle: std::mem::ManuallyDrop::new(control_handle),
1189 tx_id: header.tx_id,
1190 },
1191 })
1192 }
1193 _ => Err(fidl::Error::UnknownOrdinal {
1194 ordinal: header.ordinal,
1195 protocol_name:
1196 <CrashReporterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1197 }),
1198 }))
1199 },
1200 )
1201 }
1202}
1203
1204#[derive(Debug)]
1206pub enum CrashReporterRequest {
1207 FileReport { report: CrashReport, responder: CrashReporterFileReportResponder },
1216}
1217
1218impl CrashReporterRequest {
1219 #[allow(irrefutable_let_patterns)]
1220 pub fn into_file_report(self) -> Option<(CrashReport, CrashReporterFileReportResponder)> {
1221 if let CrashReporterRequest::FileReport { report, responder } = self {
1222 Some((report, responder))
1223 } else {
1224 None
1225 }
1226 }
1227
1228 pub fn method_name(&self) -> &'static str {
1230 match *self {
1231 CrashReporterRequest::FileReport { .. } => "file_report",
1232 }
1233 }
1234}
1235
1236#[derive(Debug, Clone)]
1237pub struct CrashReporterControlHandle {
1238 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1239}
1240
1241impl fidl::endpoints::ControlHandle for CrashReporterControlHandle {
1242 fn shutdown(&self) {
1243 self.inner.shutdown()
1244 }
1245 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1246 self.inner.shutdown_with_epitaph(status)
1247 }
1248
1249 fn is_closed(&self) -> bool {
1250 self.inner.channel().is_closed()
1251 }
1252 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1253 self.inner.channel().on_closed()
1254 }
1255
1256 #[cfg(target_os = "fuchsia")]
1257 fn signal_peer(
1258 &self,
1259 clear_mask: zx::Signals,
1260 set_mask: zx::Signals,
1261 ) -> Result<(), zx_status::Status> {
1262 use fidl::Peered;
1263 self.inner.channel().signal_peer(clear_mask, set_mask)
1264 }
1265}
1266
1267impl CrashReporterControlHandle {}
1268
1269#[must_use = "FIDL methods require a response to be sent"]
1270#[derive(Debug)]
1271pub struct CrashReporterFileReportResponder {
1272 control_handle: std::mem::ManuallyDrop<CrashReporterControlHandle>,
1273 tx_id: u32,
1274}
1275
1276impl std::ops::Drop for CrashReporterFileReportResponder {
1280 fn drop(&mut self) {
1281 self.control_handle.shutdown();
1282 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1284 }
1285}
1286
1287impl fidl::endpoints::Responder for CrashReporterFileReportResponder {
1288 type ControlHandle = CrashReporterControlHandle;
1289
1290 fn control_handle(&self) -> &CrashReporterControlHandle {
1291 &self.control_handle
1292 }
1293
1294 fn drop_without_shutdown(mut self) {
1295 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1297 std::mem::forget(self);
1299 }
1300}
1301
1302impl CrashReporterFileReportResponder {
1303 pub fn send(
1307 self,
1308 mut result: Result<&FileReportResults, FilingError>,
1309 ) -> Result<(), fidl::Error> {
1310 let _result = self.send_raw(result);
1311 if _result.is_err() {
1312 self.control_handle.shutdown();
1313 }
1314 self.drop_without_shutdown();
1315 _result
1316 }
1317
1318 pub fn send_no_shutdown_on_err(
1320 self,
1321 mut result: Result<&FileReportResults, FilingError>,
1322 ) -> Result<(), fidl::Error> {
1323 let _result = self.send_raw(result);
1324 self.drop_without_shutdown();
1325 _result
1326 }
1327
1328 fn send_raw(
1329 &self,
1330 mut result: Result<&FileReportResults, FilingError>,
1331 ) -> Result<(), fidl::Error> {
1332 self.control_handle.inner.send::<fidl::encoding::ResultType<
1333 CrashReporterFileReportResponse,
1334 FilingError,
1335 >>(
1336 result.map(|results| (results,)),
1337 self.tx_id,
1338 0x6f660f55b3160dd4,
1339 fidl::encoding::DynamicFlags::empty(),
1340 )
1341 }
1342}
1343
1344#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1345pub struct CrashReportingProductRegisterMarker;
1346
1347impl fidl::endpoints::ProtocolMarker for CrashReportingProductRegisterMarker {
1348 type Proxy = CrashReportingProductRegisterProxy;
1349 type RequestStream = CrashReportingProductRegisterRequestStream;
1350 #[cfg(target_os = "fuchsia")]
1351 type SynchronousProxy = CrashReportingProductRegisterSynchronousProxy;
1352
1353 const DEBUG_NAME: &'static str = "fuchsia.feedback.CrashReportingProductRegister";
1354}
1355impl fidl::endpoints::DiscoverableProtocolMarker for CrashReportingProductRegisterMarker {}
1356
1357pub trait CrashReportingProductRegisterProxyInterface: Send + Sync {
1358 fn r#upsert(
1359 &self,
1360 component_url: &str,
1361 product: &CrashReportingProduct,
1362 ) -> Result<(), fidl::Error>;
1363 type UpsertWithAckResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1364 fn r#upsert_with_ack(
1365 &self,
1366 component_url: &str,
1367 product: &CrashReportingProduct,
1368 ) -> Self::UpsertWithAckResponseFut;
1369}
1370#[derive(Debug)]
1371#[cfg(target_os = "fuchsia")]
1372pub struct CrashReportingProductRegisterSynchronousProxy {
1373 client: fidl::client::sync::Client,
1374}
1375
1376#[cfg(target_os = "fuchsia")]
1377impl fidl::endpoints::SynchronousProxy for CrashReportingProductRegisterSynchronousProxy {
1378 type Proxy = CrashReportingProductRegisterProxy;
1379 type Protocol = CrashReportingProductRegisterMarker;
1380
1381 fn from_channel(inner: fidl::Channel) -> Self {
1382 Self::new(inner)
1383 }
1384
1385 fn into_channel(self) -> fidl::Channel {
1386 self.client.into_channel()
1387 }
1388
1389 fn as_channel(&self) -> &fidl::Channel {
1390 self.client.as_channel()
1391 }
1392}
1393
1394#[cfg(target_os = "fuchsia")]
1395impl CrashReportingProductRegisterSynchronousProxy {
1396 pub fn new(channel: fidl::Channel) -> Self {
1397 let protocol_name =
1398 <CrashReportingProductRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1399 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1400 }
1401
1402 pub fn into_channel(self) -> fidl::Channel {
1403 self.client.into_channel()
1404 }
1405
1406 pub fn wait_for_event(
1409 &self,
1410 deadline: zx::MonotonicInstant,
1411 ) -> Result<CrashReportingProductRegisterEvent, fidl::Error> {
1412 CrashReportingProductRegisterEvent::decode(self.client.wait_for_event(deadline)?)
1413 }
1414
1415 pub fn r#upsert(
1423 &self,
1424 mut component_url: &str,
1425 mut product: &CrashReportingProduct,
1426 ) -> Result<(), fidl::Error> {
1427 self.client.send::<CrashReportingProductRegisterUpsertRequest>(
1428 (component_url, product),
1429 0x668cdc9615c91d7f,
1430 fidl::encoding::DynamicFlags::empty(),
1431 )
1432 }
1433
1434 pub fn r#upsert_with_ack(
1440 &self,
1441 mut component_url: &str,
1442 mut product: &CrashReportingProduct,
1443 ___deadline: zx::MonotonicInstant,
1444 ) -> Result<(), fidl::Error> {
1445 let _response = self.client.send_query::<
1446 CrashReportingProductRegisterUpsertWithAckRequest,
1447 fidl::encoding::EmptyPayload,
1448 >(
1449 (component_url, product,),
1450 0x4a4f1279b3439c9d,
1451 fidl::encoding::DynamicFlags::empty(),
1452 ___deadline,
1453 )?;
1454 Ok(_response)
1455 }
1456}
1457
1458#[cfg(target_os = "fuchsia")]
1459impl From<CrashReportingProductRegisterSynchronousProxy> for zx::Handle {
1460 fn from(value: CrashReportingProductRegisterSynchronousProxy) -> Self {
1461 value.into_channel().into()
1462 }
1463}
1464
1465#[cfg(target_os = "fuchsia")]
1466impl From<fidl::Channel> for CrashReportingProductRegisterSynchronousProxy {
1467 fn from(value: fidl::Channel) -> Self {
1468 Self::new(value)
1469 }
1470}
1471
1472#[derive(Debug, Clone)]
1473pub struct CrashReportingProductRegisterProxy {
1474 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1475}
1476
1477impl fidl::endpoints::Proxy for CrashReportingProductRegisterProxy {
1478 type Protocol = CrashReportingProductRegisterMarker;
1479
1480 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1481 Self::new(inner)
1482 }
1483
1484 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1485 self.client.into_channel().map_err(|client| Self { client })
1486 }
1487
1488 fn as_channel(&self) -> &::fidl::AsyncChannel {
1489 self.client.as_channel()
1490 }
1491}
1492
1493impl CrashReportingProductRegisterProxy {
1494 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1496 let protocol_name =
1497 <CrashReportingProductRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1498 Self { client: fidl::client::Client::new(channel, protocol_name) }
1499 }
1500
1501 pub fn take_event_stream(&self) -> CrashReportingProductRegisterEventStream {
1507 CrashReportingProductRegisterEventStream {
1508 event_receiver: self.client.take_event_receiver(),
1509 }
1510 }
1511
1512 pub fn r#upsert(
1520 &self,
1521 mut component_url: &str,
1522 mut product: &CrashReportingProduct,
1523 ) -> Result<(), fidl::Error> {
1524 CrashReportingProductRegisterProxyInterface::r#upsert(self, component_url, product)
1525 }
1526
1527 pub fn r#upsert_with_ack(
1533 &self,
1534 mut component_url: &str,
1535 mut product: &CrashReportingProduct,
1536 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1537 CrashReportingProductRegisterProxyInterface::r#upsert_with_ack(self, component_url, product)
1538 }
1539}
1540
1541impl CrashReportingProductRegisterProxyInterface for CrashReportingProductRegisterProxy {
1542 fn r#upsert(
1543 &self,
1544 mut component_url: &str,
1545 mut product: &CrashReportingProduct,
1546 ) -> Result<(), fidl::Error> {
1547 self.client.send::<CrashReportingProductRegisterUpsertRequest>(
1548 (component_url, product),
1549 0x668cdc9615c91d7f,
1550 fidl::encoding::DynamicFlags::empty(),
1551 )
1552 }
1553
1554 type UpsertWithAckResponseFut =
1555 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1556 fn r#upsert_with_ack(
1557 &self,
1558 mut component_url: &str,
1559 mut product: &CrashReportingProduct,
1560 ) -> Self::UpsertWithAckResponseFut {
1561 fn _decode(
1562 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1563 ) -> Result<(), fidl::Error> {
1564 let _response = fidl::client::decode_transaction_body::<
1565 fidl::encoding::EmptyPayload,
1566 fidl::encoding::DefaultFuchsiaResourceDialect,
1567 0x4a4f1279b3439c9d,
1568 >(_buf?)?;
1569 Ok(_response)
1570 }
1571 self.client.send_query_and_decode::<CrashReportingProductRegisterUpsertWithAckRequest, ()>(
1572 (component_url, product),
1573 0x4a4f1279b3439c9d,
1574 fidl::encoding::DynamicFlags::empty(),
1575 _decode,
1576 )
1577 }
1578}
1579
1580pub struct CrashReportingProductRegisterEventStream {
1581 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1582}
1583
1584impl std::marker::Unpin for CrashReportingProductRegisterEventStream {}
1585
1586impl futures::stream::FusedStream for CrashReportingProductRegisterEventStream {
1587 fn is_terminated(&self) -> bool {
1588 self.event_receiver.is_terminated()
1589 }
1590}
1591
1592impl futures::Stream for CrashReportingProductRegisterEventStream {
1593 type Item = Result<CrashReportingProductRegisterEvent, fidl::Error>;
1594
1595 fn poll_next(
1596 mut self: std::pin::Pin<&mut Self>,
1597 cx: &mut std::task::Context<'_>,
1598 ) -> std::task::Poll<Option<Self::Item>> {
1599 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1600 &mut self.event_receiver,
1601 cx
1602 )?) {
1603 Some(buf) => {
1604 std::task::Poll::Ready(Some(CrashReportingProductRegisterEvent::decode(buf)))
1605 }
1606 None => std::task::Poll::Ready(None),
1607 }
1608 }
1609}
1610
1611#[derive(Debug)]
1612pub enum CrashReportingProductRegisterEvent {}
1613
1614impl CrashReportingProductRegisterEvent {
1615 fn decode(
1617 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1618 ) -> Result<CrashReportingProductRegisterEvent, fidl::Error> {
1619 let (bytes, _handles) = buf.split_mut();
1620 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1621 debug_assert_eq!(tx_header.tx_id, 0);
1622 match tx_header.ordinal {
1623 _ => Err(fidl::Error::UnknownOrdinal {
1624 ordinal: tx_header.ordinal,
1625 protocol_name: <CrashReportingProductRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1626 })
1627 }
1628 }
1629}
1630
1631pub struct CrashReportingProductRegisterRequestStream {
1633 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1634 is_terminated: bool,
1635}
1636
1637impl std::marker::Unpin for CrashReportingProductRegisterRequestStream {}
1638
1639impl futures::stream::FusedStream for CrashReportingProductRegisterRequestStream {
1640 fn is_terminated(&self) -> bool {
1641 self.is_terminated
1642 }
1643}
1644
1645impl fidl::endpoints::RequestStream for CrashReportingProductRegisterRequestStream {
1646 type Protocol = CrashReportingProductRegisterMarker;
1647 type ControlHandle = CrashReportingProductRegisterControlHandle;
1648
1649 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1650 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1651 }
1652
1653 fn control_handle(&self) -> Self::ControlHandle {
1654 CrashReportingProductRegisterControlHandle { inner: self.inner.clone() }
1655 }
1656
1657 fn into_inner(
1658 self,
1659 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1660 {
1661 (self.inner, self.is_terminated)
1662 }
1663
1664 fn from_inner(
1665 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1666 is_terminated: bool,
1667 ) -> Self {
1668 Self { inner, is_terminated }
1669 }
1670}
1671
1672impl futures::Stream for CrashReportingProductRegisterRequestStream {
1673 type Item = Result<CrashReportingProductRegisterRequest, fidl::Error>;
1674
1675 fn poll_next(
1676 mut self: std::pin::Pin<&mut Self>,
1677 cx: &mut std::task::Context<'_>,
1678 ) -> std::task::Poll<Option<Self::Item>> {
1679 let this = &mut *self;
1680 if this.inner.check_shutdown(cx) {
1681 this.is_terminated = true;
1682 return std::task::Poll::Ready(None);
1683 }
1684 if this.is_terminated {
1685 panic!("polled CrashReportingProductRegisterRequestStream after completion");
1686 }
1687 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1688 |bytes, handles| {
1689 match this.inner.channel().read_etc(cx, bytes, handles) {
1690 std::task::Poll::Ready(Ok(())) => {}
1691 std::task::Poll::Pending => return std::task::Poll::Pending,
1692 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1693 this.is_terminated = true;
1694 return std::task::Poll::Ready(None);
1695 }
1696 std::task::Poll::Ready(Err(e)) => {
1697 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1698 e.into(),
1699 ))))
1700 }
1701 }
1702
1703 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1705
1706 std::task::Poll::Ready(Some(match header.ordinal {
1707 0x668cdc9615c91d7f => {
1708 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1709 let mut req = fidl::new_empty!(CrashReportingProductRegisterUpsertRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1710 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CrashReportingProductRegisterUpsertRequest>(&header, _body_bytes, handles, &mut req)?;
1711 let control_handle = CrashReportingProductRegisterControlHandle {
1712 inner: this.inner.clone(),
1713 };
1714 Ok(CrashReportingProductRegisterRequest::Upsert {component_url: req.component_url,
1715product: req.product,
1716
1717 control_handle,
1718 })
1719 }
1720 0x4a4f1279b3439c9d => {
1721 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1722 let mut req = fidl::new_empty!(CrashReportingProductRegisterUpsertWithAckRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1723 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CrashReportingProductRegisterUpsertWithAckRequest>(&header, _body_bytes, handles, &mut req)?;
1724 let control_handle = CrashReportingProductRegisterControlHandle {
1725 inner: this.inner.clone(),
1726 };
1727 Ok(CrashReportingProductRegisterRequest::UpsertWithAck {component_url: req.component_url,
1728product: req.product,
1729
1730 responder: CrashReportingProductRegisterUpsertWithAckResponder {
1731 control_handle: std::mem::ManuallyDrop::new(control_handle),
1732 tx_id: header.tx_id,
1733 },
1734 })
1735 }
1736 _ => Err(fidl::Error::UnknownOrdinal {
1737 ordinal: header.ordinal,
1738 protocol_name: <CrashReportingProductRegisterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1739 }),
1740 }))
1741 },
1742 )
1743 }
1744}
1745
1746#[derive(Debug)]
1753pub enum CrashReportingProductRegisterRequest {
1754 Upsert {
1762 component_url: String,
1763 product: CrashReportingProduct,
1764 control_handle: CrashReportingProductRegisterControlHandle,
1765 },
1766 UpsertWithAck {
1772 component_url: String,
1773 product: CrashReportingProduct,
1774 responder: CrashReportingProductRegisterUpsertWithAckResponder,
1775 },
1776}
1777
1778impl CrashReportingProductRegisterRequest {
1779 #[allow(irrefutable_let_patterns)]
1780 pub fn into_upsert(
1781 self,
1782 ) -> Option<(String, CrashReportingProduct, CrashReportingProductRegisterControlHandle)> {
1783 if let CrashReportingProductRegisterRequest::Upsert {
1784 component_url,
1785 product,
1786 control_handle,
1787 } = self
1788 {
1789 Some((component_url, product, control_handle))
1790 } else {
1791 None
1792 }
1793 }
1794
1795 #[allow(irrefutable_let_patterns)]
1796 pub fn into_upsert_with_ack(
1797 self,
1798 ) -> Option<(String, CrashReportingProduct, CrashReportingProductRegisterUpsertWithAckResponder)>
1799 {
1800 if let CrashReportingProductRegisterRequest::UpsertWithAck {
1801 component_url,
1802 product,
1803 responder,
1804 } = self
1805 {
1806 Some((component_url, product, responder))
1807 } else {
1808 None
1809 }
1810 }
1811
1812 pub fn method_name(&self) -> &'static str {
1814 match *self {
1815 CrashReportingProductRegisterRequest::Upsert { .. } => "upsert",
1816 CrashReportingProductRegisterRequest::UpsertWithAck { .. } => "upsert_with_ack",
1817 }
1818 }
1819}
1820
1821#[derive(Debug, Clone)]
1822pub struct CrashReportingProductRegisterControlHandle {
1823 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1824}
1825
1826impl fidl::endpoints::ControlHandle for CrashReportingProductRegisterControlHandle {
1827 fn shutdown(&self) {
1828 self.inner.shutdown()
1829 }
1830 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1831 self.inner.shutdown_with_epitaph(status)
1832 }
1833
1834 fn is_closed(&self) -> bool {
1835 self.inner.channel().is_closed()
1836 }
1837 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1838 self.inner.channel().on_closed()
1839 }
1840
1841 #[cfg(target_os = "fuchsia")]
1842 fn signal_peer(
1843 &self,
1844 clear_mask: zx::Signals,
1845 set_mask: zx::Signals,
1846 ) -> Result<(), zx_status::Status> {
1847 use fidl::Peered;
1848 self.inner.channel().signal_peer(clear_mask, set_mask)
1849 }
1850}
1851
1852impl CrashReportingProductRegisterControlHandle {}
1853
1854#[must_use = "FIDL methods require a response to be sent"]
1855#[derive(Debug)]
1856pub struct CrashReportingProductRegisterUpsertWithAckResponder {
1857 control_handle: std::mem::ManuallyDrop<CrashReportingProductRegisterControlHandle>,
1858 tx_id: u32,
1859}
1860
1861impl std::ops::Drop for CrashReportingProductRegisterUpsertWithAckResponder {
1865 fn drop(&mut self) {
1866 self.control_handle.shutdown();
1867 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1869 }
1870}
1871
1872impl fidl::endpoints::Responder for CrashReportingProductRegisterUpsertWithAckResponder {
1873 type ControlHandle = CrashReportingProductRegisterControlHandle;
1874
1875 fn control_handle(&self) -> &CrashReportingProductRegisterControlHandle {
1876 &self.control_handle
1877 }
1878
1879 fn drop_without_shutdown(mut self) {
1880 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1882 std::mem::forget(self);
1884 }
1885}
1886
1887impl CrashReportingProductRegisterUpsertWithAckResponder {
1888 pub fn send(self) -> Result<(), fidl::Error> {
1892 let _result = self.send_raw();
1893 if _result.is_err() {
1894 self.control_handle.shutdown();
1895 }
1896 self.drop_without_shutdown();
1897 _result
1898 }
1899
1900 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1902 let _result = self.send_raw();
1903 self.drop_without_shutdown();
1904 _result
1905 }
1906
1907 fn send_raw(&self) -> Result<(), fidl::Error> {
1908 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1909 (),
1910 self.tx_id,
1911 0x4a4f1279b3439c9d,
1912 fidl::encoding::DynamicFlags::empty(),
1913 )
1914 }
1915}
1916
1917#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1918pub struct DataProviderMarker;
1919
1920impl fidl::endpoints::ProtocolMarker for DataProviderMarker {
1921 type Proxy = DataProviderProxy;
1922 type RequestStream = DataProviderRequestStream;
1923 #[cfg(target_os = "fuchsia")]
1924 type SynchronousProxy = DataProviderSynchronousProxy;
1925
1926 const DEBUG_NAME: &'static str = "fuchsia.feedback.DataProvider";
1927}
1928impl fidl::endpoints::DiscoverableProtocolMarker for DataProviderMarker {}
1929
1930pub trait DataProviderProxyInterface: Send + Sync {
1931 type GetSnapshotResponseFut: std::future::Future<Output = Result<Snapshot, fidl::Error>> + Send;
1932 fn r#get_snapshot(&self, params: GetSnapshotParameters) -> Self::GetSnapshotResponseFut;
1933 type GetScreenshotResponseFut: std::future::Future<Output = Result<Option<Box<Screenshot>>, fidl::Error>>
1934 + Send;
1935 fn r#get_screenshot(&self, encoding: ImageEncoding) -> Self::GetScreenshotResponseFut;
1936 type GetAnnotationsResponseFut: std::future::Future<Output = Result<Annotations, fidl::Error>>
1937 + Send;
1938 fn r#get_annotations(
1939 &self,
1940 params: &GetAnnotationsParameters,
1941 ) -> Self::GetAnnotationsResponseFut;
1942}
1943#[derive(Debug)]
1944#[cfg(target_os = "fuchsia")]
1945pub struct DataProviderSynchronousProxy {
1946 client: fidl::client::sync::Client,
1947}
1948
1949#[cfg(target_os = "fuchsia")]
1950impl fidl::endpoints::SynchronousProxy for DataProviderSynchronousProxy {
1951 type Proxy = DataProviderProxy;
1952 type Protocol = DataProviderMarker;
1953
1954 fn from_channel(inner: fidl::Channel) -> Self {
1955 Self::new(inner)
1956 }
1957
1958 fn into_channel(self) -> fidl::Channel {
1959 self.client.into_channel()
1960 }
1961
1962 fn as_channel(&self) -> &fidl::Channel {
1963 self.client.as_channel()
1964 }
1965}
1966
1967#[cfg(target_os = "fuchsia")]
1968impl DataProviderSynchronousProxy {
1969 pub fn new(channel: fidl::Channel) -> Self {
1970 let protocol_name = <DataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1971 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1972 }
1973
1974 pub fn into_channel(self) -> fidl::Channel {
1975 self.client.into_channel()
1976 }
1977
1978 pub fn wait_for_event(
1981 &self,
1982 deadline: zx::MonotonicInstant,
1983 ) -> Result<DataProviderEvent, fidl::Error> {
1984 DataProviderEvent::decode(self.client.wait_for_event(deadline)?)
1985 }
1986
1987 pub fn r#get_snapshot(
1991 &self,
1992 mut params: GetSnapshotParameters,
1993 ___deadline: zx::MonotonicInstant,
1994 ) -> Result<Snapshot, fidl::Error> {
1995 let _response = self
1996 .client
1997 .send_query::<DataProviderGetSnapshotRequest, DataProviderGetSnapshotResponse>(
1998 (&mut params,),
1999 0x753649a04e5d0bc0,
2000 fidl::encoding::DynamicFlags::empty(),
2001 ___deadline,
2002 )?;
2003 Ok(_response.snapshot)
2004 }
2005
2006 pub fn r#get_screenshot(
2015 &self,
2016 mut encoding: ImageEncoding,
2017 ___deadline: zx::MonotonicInstant,
2018 ) -> Result<Option<Box<Screenshot>>, fidl::Error> {
2019 let _response = self
2020 .client
2021 .send_query::<DataProviderGetScreenshotRequest, DataProviderGetScreenshotResponse>(
2022 (encoding,),
2023 0x438c858494d1781,
2024 fidl::encoding::DynamicFlags::empty(),
2025 ___deadline,
2026 )?;
2027 Ok(_response.screenshot)
2028 }
2029
2030 pub fn r#get_annotations(
2039 &self,
2040 mut params: &GetAnnotationsParameters,
2041 ___deadline: zx::MonotonicInstant,
2042 ) -> Result<Annotations, fidl::Error> {
2043 let _response = self
2044 .client
2045 .send_query::<DataProviderGetAnnotationsRequest, DataProviderGetAnnotationsResponse>(
2046 (params,),
2047 0x367b4b6afe4345d8,
2048 fidl::encoding::DynamicFlags::empty(),
2049 ___deadline,
2050 )?;
2051 Ok(_response.annotations)
2052 }
2053}
2054
2055#[cfg(target_os = "fuchsia")]
2056impl From<DataProviderSynchronousProxy> for zx::Handle {
2057 fn from(value: DataProviderSynchronousProxy) -> Self {
2058 value.into_channel().into()
2059 }
2060}
2061
2062#[cfg(target_os = "fuchsia")]
2063impl From<fidl::Channel> for DataProviderSynchronousProxy {
2064 fn from(value: fidl::Channel) -> Self {
2065 Self::new(value)
2066 }
2067}
2068
2069#[derive(Debug, Clone)]
2070pub struct DataProviderProxy {
2071 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2072}
2073
2074impl fidl::endpoints::Proxy for DataProviderProxy {
2075 type Protocol = DataProviderMarker;
2076
2077 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2078 Self::new(inner)
2079 }
2080
2081 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2082 self.client.into_channel().map_err(|client| Self { client })
2083 }
2084
2085 fn as_channel(&self) -> &::fidl::AsyncChannel {
2086 self.client.as_channel()
2087 }
2088}
2089
2090impl DataProviderProxy {
2091 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2093 let protocol_name = <DataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2094 Self { client: fidl::client::Client::new(channel, protocol_name) }
2095 }
2096
2097 pub fn take_event_stream(&self) -> DataProviderEventStream {
2103 DataProviderEventStream { event_receiver: self.client.take_event_receiver() }
2104 }
2105
2106 pub fn r#get_snapshot(
2110 &self,
2111 mut params: GetSnapshotParameters,
2112 ) -> fidl::client::QueryResponseFut<Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect>
2113 {
2114 DataProviderProxyInterface::r#get_snapshot(self, params)
2115 }
2116
2117 pub fn r#get_screenshot(
2126 &self,
2127 mut encoding: ImageEncoding,
2128 ) -> fidl::client::QueryResponseFut<
2129 Option<Box<Screenshot>>,
2130 fidl::encoding::DefaultFuchsiaResourceDialect,
2131 > {
2132 DataProviderProxyInterface::r#get_screenshot(self, encoding)
2133 }
2134
2135 pub fn r#get_annotations(
2144 &self,
2145 mut params: &GetAnnotationsParameters,
2146 ) -> fidl::client::QueryResponseFut<Annotations, fidl::encoding::DefaultFuchsiaResourceDialect>
2147 {
2148 DataProviderProxyInterface::r#get_annotations(self, params)
2149 }
2150}
2151
2152impl DataProviderProxyInterface for DataProviderProxy {
2153 type GetSnapshotResponseFut =
2154 fidl::client::QueryResponseFut<Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect>;
2155 fn r#get_snapshot(&self, mut params: GetSnapshotParameters) -> Self::GetSnapshotResponseFut {
2156 fn _decode(
2157 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2158 ) -> Result<Snapshot, fidl::Error> {
2159 let _response = fidl::client::decode_transaction_body::<
2160 DataProviderGetSnapshotResponse,
2161 fidl::encoding::DefaultFuchsiaResourceDialect,
2162 0x753649a04e5d0bc0,
2163 >(_buf?)?;
2164 Ok(_response.snapshot)
2165 }
2166 self.client.send_query_and_decode::<DataProviderGetSnapshotRequest, Snapshot>(
2167 (&mut params,),
2168 0x753649a04e5d0bc0,
2169 fidl::encoding::DynamicFlags::empty(),
2170 _decode,
2171 )
2172 }
2173
2174 type GetScreenshotResponseFut = fidl::client::QueryResponseFut<
2175 Option<Box<Screenshot>>,
2176 fidl::encoding::DefaultFuchsiaResourceDialect,
2177 >;
2178 fn r#get_screenshot(&self, mut encoding: ImageEncoding) -> Self::GetScreenshotResponseFut {
2179 fn _decode(
2180 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2181 ) -> Result<Option<Box<Screenshot>>, fidl::Error> {
2182 let _response = fidl::client::decode_transaction_body::<
2183 DataProviderGetScreenshotResponse,
2184 fidl::encoding::DefaultFuchsiaResourceDialect,
2185 0x438c858494d1781,
2186 >(_buf?)?;
2187 Ok(_response.screenshot)
2188 }
2189 self.client
2190 .send_query_and_decode::<DataProviderGetScreenshotRequest, Option<Box<Screenshot>>>(
2191 (encoding,),
2192 0x438c858494d1781,
2193 fidl::encoding::DynamicFlags::empty(),
2194 _decode,
2195 )
2196 }
2197
2198 type GetAnnotationsResponseFut =
2199 fidl::client::QueryResponseFut<Annotations, fidl::encoding::DefaultFuchsiaResourceDialect>;
2200 fn r#get_annotations(
2201 &self,
2202 mut params: &GetAnnotationsParameters,
2203 ) -> Self::GetAnnotationsResponseFut {
2204 fn _decode(
2205 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2206 ) -> Result<Annotations, fidl::Error> {
2207 let _response = fidl::client::decode_transaction_body::<
2208 DataProviderGetAnnotationsResponse,
2209 fidl::encoding::DefaultFuchsiaResourceDialect,
2210 0x367b4b6afe4345d8,
2211 >(_buf?)?;
2212 Ok(_response.annotations)
2213 }
2214 self.client.send_query_and_decode::<DataProviderGetAnnotationsRequest, Annotations>(
2215 (params,),
2216 0x367b4b6afe4345d8,
2217 fidl::encoding::DynamicFlags::empty(),
2218 _decode,
2219 )
2220 }
2221}
2222
2223pub struct DataProviderEventStream {
2224 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2225}
2226
2227impl std::marker::Unpin for DataProviderEventStream {}
2228
2229impl futures::stream::FusedStream for DataProviderEventStream {
2230 fn is_terminated(&self) -> bool {
2231 self.event_receiver.is_terminated()
2232 }
2233}
2234
2235impl futures::Stream for DataProviderEventStream {
2236 type Item = Result<DataProviderEvent, fidl::Error>;
2237
2238 fn poll_next(
2239 mut self: std::pin::Pin<&mut Self>,
2240 cx: &mut std::task::Context<'_>,
2241 ) -> std::task::Poll<Option<Self::Item>> {
2242 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2243 &mut self.event_receiver,
2244 cx
2245 )?) {
2246 Some(buf) => std::task::Poll::Ready(Some(DataProviderEvent::decode(buf))),
2247 None => std::task::Poll::Ready(None),
2248 }
2249 }
2250}
2251
2252#[derive(Debug)]
2253pub enum DataProviderEvent {}
2254
2255impl DataProviderEvent {
2256 fn decode(
2258 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2259 ) -> Result<DataProviderEvent, fidl::Error> {
2260 let (bytes, _handles) = buf.split_mut();
2261 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2262 debug_assert_eq!(tx_header.tx_id, 0);
2263 match tx_header.ordinal {
2264 _ => Err(fidl::Error::UnknownOrdinal {
2265 ordinal: tx_header.ordinal,
2266 protocol_name: <DataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2267 }),
2268 }
2269 }
2270}
2271
2272pub struct DataProviderRequestStream {
2274 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2275 is_terminated: bool,
2276}
2277
2278impl std::marker::Unpin for DataProviderRequestStream {}
2279
2280impl futures::stream::FusedStream for DataProviderRequestStream {
2281 fn is_terminated(&self) -> bool {
2282 self.is_terminated
2283 }
2284}
2285
2286impl fidl::endpoints::RequestStream for DataProviderRequestStream {
2287 type Protocol = DataProviderMarker;
2288 type ControlHandle = DataProviderControlHandle;
2289
2290 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2291 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2292 }
2293
2294 fn control_handle(&self) -> Self::ControlHandle {
2295 DataProviderControlHandle { inner: self.inner.clone() }
2296 }
2297
2298 fn into_inner(
2299 self,
2300 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2301 {
2302 (self.inner, self.is_terminated)
2303 }
2304
2305 fn from_inner(
2306 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2307 is_terminated: bool,
2308 ) -> Self {
2309 Self { inner, is_terminated }
2310 }
2311}
2312
2313impl futures::Stream for DataProviderRequestStream {
2314 type Item = Result<DataProviderRequest, fidl::Error>;
2315
2316 fn poll_next(
2317 mut self: std::pin::Pin<&mut Self>,
2318 cx: &mut std::task::Context<'_>,
2319 ) -> std::task::Poll<Option<Self::Item>> {
2320 let this = &mut *self;
2321 if this.inner.check_shutdown(cx) {
2322 this.is_terminated = true;
2323 return std::task::Poll::Ready(None);
2324 }
2325 if this.is_terminated {
2326 panic!("polled DataProviderRequestStream after completion");
2327 }
2328 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2329 |bytes, handles| {
2330 match this.inner.channel().read_etc(cx, bytes, handles) {
2331 std::task::Poll::Ready(Ok(())) => {}
2332 std::task::Poll::Pending => return std::task::Poll::Pending,
2333 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2334 this.is_terminated = true;
2335 return std::task::Poll::Ready(None);
2336 }
2337 std::task::Poll::Ready(Err(e)) => {
2338 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2339 e.into(),
2340 ))))
2341 }
2342 }
2343
2344 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2346
2347 std::task::Poll::Ready(Some(match header.ordinal {
2348 0x753649a04e5d0bc0 => {
2349 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2350 let mut req = fidl::new_empty!(
2351 DataProviderGetSnapshotRequest,
2352 fidl::encoding::DefaultFuchsiaResourceDialect
2353 );
2354 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataProviderGetSnapshotRequest>(&header, _body_bytes, handles, &mut req)?;
2355 let control_handle =
2356 DataProviderControlHandle { inner: this.inner.clone() };
2357 Ok(DataProviderRequest::GetSnapshot {
2358 params: req.params,
2359
2360 responder: DataProviderGetSnapshotResponder {
2361 control_handle: std::mem::ManuallyDrop::new(control_handle),
2362 tx_id: header.tx_id,
2363 },
2364 })
2365 }
2366 0x438c858494d1781 => {
2367 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2368 let mut req = fidl::new_empty!(
2369 DataProviderGetScreenshotRequest,
2370 fidl::encoding::DefaultFuchsiaResourceDialect
2371 );
2372 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataProviderGetScreenshotRequest>(&header, _body_bytes, handles, &mut req)?;
2373 let control_handle =
2374 DataProviderControlHandle { inner: this.inner.clone() };
2375 Ok(DataProviderRequest::GetScreenshot {
2376 encoding: req.encoding,
2377
2378 responder: DataProviderGetScreenshotResponder {
2379 control_handle: std::mem::ManuallyDrop::new(control_handle),
2380 tx_id: header.tx_id,
2381 },
2382 })
2383 }
2384 0x367b4b6afe4345d8 => {
2385 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2386 let mut req = fidl::new_empty!(
2387 DataProviderGetAnnotationsRequest,
2388 fidl::encoding::DefaultFuchsiaResourceDialect
2389 );
2390 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataProviderGetAnnotationsRequest>(&header, _body_bytes, handles, &mut req)?;
2391 let control_handle =
2392 DataProviderControlHandle { inner: this.inner.clone() };
2393 Ok(DataProviderRequest::GetAnnotations {
2394 params: req.params,
2395
2396 responder: DataProviderGetAnnotationsResponder {
2397 control_handle: std::mem::ManuallyDrop::new(control_handle),
2398 tx_id: header.tx_id,
2399 },
2400 })
2401 }
2402 _ => Err(fidl::Error::UnknownOrdinal {
2403 ordinal: header.ordinal,
2404 protocol_name:
2405 <DataProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2406 }),
2407 }))
2408 },
2409 )
2410 }
2411}
2412
2413#[derive(Debug)]
2416pub enum DataProviderRequest {
2417 GetSnapshot { params: GetSnapshotParameters, responder: DataProviderGetSnapshotResponder },
2421 GetScreenshot { encoding: ImageEncoding, responder: DataProviderGetScreenshotResponder },
2430 GetAnnotations {
2439 params: GetAnnotationsParameters,
2440 responder: DataProviderGetAnnotationsResponder,
2441 },
2442}
2443
2444impl DataProviderRequest {
2445 #[allow(irrefutable_let_patterns)]
2446 pub fn into_get_snapshot(
2447 self,
2448 ) -> Option<(GetSnapshotParameters, DataProviderGetSnapshotResponder)> {
2449 if let DataProviderRequest::GetSnapshot { params, responder } = self {
2450 Some((params, responder))
2451 } else {
2452 None
2453 }
2454 }
2455
2456 #[allow(irrefutable_let_patterns)]
2457 pub fn into_get_screenshot(
2458 self,
2459 ) -> Option<(ImageEncoding, DataProviderGetScreenshotResponder)> {
2460 if let DataProviderRequest::GetScreenshot { encoding, responder } = self {
2461 Some((encoding, responder))
2462 } else {
2463 None
2464 }
2465 }
2466
2467 #[allow(irrefutable_let_patterns)]
2468 pub fn into_get_annotations(
2469 self,
2470 ) -> Option<(GetAnnotationsParameters, DataProviderGetAnnotationsResponder)> {
2471 if let DataProviderRequest::GetAnnotations { params, responder } = self {
2472 Some((params, responder))
2473 } else {
2474 None
2475 }
2476 }
2477
2478 pub fn method_name(&self) -> &'static str {
2480 match *self {
2481 DataProviderRequest::GetSnapshot { .. } => "get_snapshot",
2482 DataProviderRequest::GetScreenshot { .. } => "get_screenshot",
2483 DataProviderRequest::GetAnnotations { .. } => "get_annotations",
2484 }
2485 }
2486}
2487
2488#[derive(Debug, Clone)]
2489pub struct DataProviderControlHandle {
2490 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2491}
2492
2493impl fidl::endpoints::ControlHandle for DataProviderControlHandle {
2494 fn shutdown(&self) {
2495 self.inner.shutdown()
2496 }
2497 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2498 self.inner.shutdown_with_epitaph(status)
2499 }
2500
2501 fn is_closed(&self) -> bool {
2502 self.inner.channel().is_closed()
2503 }
2504 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2505 self.inner.channel().on_closed()
2506 }
2507
2508 #[cfg(target_os = "fuchsia")]
2509 fn signal_peer(
2510 &self,
2511 clear_mask: zx::Signals,
2512 set_mask: zx::Signals,
2513 ) -> Result<(), zx_status::Status> {
2514 use fidl::Peered;
2515 self.inner.channel().signal_peer(clear_mask, set_mask)
2516 }
2517}
2518
2519impl DataProviderControlHandle {}
2520
2521#[must_use = "FIDL methods require a response to be sent"]
2522#[derive(Debug)]
2523pub struct DataProviderGetSnapshotResponder {
2524 control_handle: std::mem::ManuallyDrop<DataProviderControlHandle>,
2525 tx_id: u32,
2526}
2527
2528impl std::ops::Drop for DataProviderGetSnapshotResponder {
2532 fn drop(&mut self) {
2533 self.control_handle.shutdown();
2534 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2536 }
2537}
2538
2539impl fidl::endpoints::Responder for DataProviderGetSnapshotResponder {
2540 type ControlHandle = DataProviderControlHandle;
2541
2542 fn control_handle(&self) -> &DataProviderControlHandle {
2543 &self.control_handle
2544 }
2545
2546 fn drop_without_shutdown(mut self) {
2547 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2549 std::mem::forget(self);
2551 }
2552}
2553
2554impl DataProviderGetSnapshotResponder {
2555 pub fn send(self, mut snapshot: Snapshot) -> Result<(), fidl::Error> {
2559 let _result = self.send_raw(snapshot);
2560 if _result.is_err() {
2561 self.control_handle.shutdown();
2562 }
2563 self.drop_without_shutdown();
2564 _result
2565 }
2566
2567 pub fn send_no_shutdown_on_err(self, mut snapshot: Snapshot) -> Result<(), fidl::Error> {
2569 let _result = self.send_raw(snapshot);
2570 self.drop_without_shutdown();
2571 _result
2572 }
2573
2574 fn send_raw(&self, mut snapshot: Snapshot) -> Result<(), fidl::Error> {
2575 self.control_handle.inner.send::<DataProviderGetSnapshotResponse>(
2576 (&mut snapshot,),
2577 self.tx_id,
2578 0x753649a04e5d0bc0,
2579 fidl::encoding::DynamicFlags::empty(),
2580 )
2581 }
2582}
2583
2584#[must_use = "FIDL methods require a response to be sent"]
2585#[derive(Debug)]
2586pub struct DataProviderGetScreenshotResponder {
2587 control_handle: std::mem::ManuallyDrop<DataProviderControlHandle>,
2588 tx_id: u32,
2589}
2590
2591impl std::ops::Drop for DataProviderGetScreenshotResponder {
2595 fn drop(&mut self) {
2596 self.control_handle.shutdown();
2597 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2599 }
2600}
2601
2602impl fidl::endpoints::Responder for DataProviderGetScreenshotResponder {
2603 type ControlHandle = DataProviderControlHandle;
2604
2605 fn control_handle(&self) -> &DataProviderControlHandle {
2606 &self.control_handle
2607 }
2608
2609 fn drop_without_shutdown(mut self) {
2610 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2612 std::mem::forget(self);
2614 }
2615}
2616
2617impl DataProviderGetScreenshotResponder {
2618 pub fn send(self, mut screenshot: Option<Screenshot>) -> Result<(), fidl::Error> {
2622 let _result = self.send_raw(screenshot);
2623 if _result.is_err() {
2624 self.control_handle.shutdown();
2625 }
2626 self.drop_without_shutdown();
2627 _result
2628 }
2629
2630 pub fn send_no_shutdown_on_err(
2632 self,
2633 mut screenshot: Option<Screenshot>,
2634 ) -> Result<(), fidl::Error> {
2635 let _result = self.send_raw(screenshot);
2636 self.drop_without_shutdown();
2637 _result
2638 }
2639
2640 fn send_raw(&self, mut screenshot: Option<Screenshot>) -> Result<(), fidl::Error> {
2641 self.control_handle.inner.send::<DataProviderGetScreenshotResponse>(
2642 (screenshot.as_mut(),),
2643 self.tx_id,
2644 0x438c858494d1781,
2645 fidl::encoding::DynamicFlags::empty(),
2646 )
2647 }
2648}
2649
2650#[must_use = "FIDL methods require a response to be sent"]
2651#[derive(Debug)]
2652pub struct DataProviderGetAnnotationsResponder {
2653 control_handle: std::mem::ManuallyDrop<DataProviderControlHandle>,
2654 tx_id: u32,
2655}
2656
2657impl std::ops::Drop for DataProviderGetAnnotationsResponder {
2661 fn drop(&mut self) {
2662 self.control_handle.shutdown();
2663 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2665 }
2666}
2667
2668impl fidl::endpoints::Responder for DataProviderGetAnnotationsResponder {
2669 type ControlHandle = DataProviderControlHandle;
2670
2671 fn control_handle(&self) -> &DataProviderControlHandle {
2672 &self.control_handle
2673 }
2674
2675 fn drop_without_shutdown(mut self) {
2676 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2678 std::mem::forget(self);
2680 }
2681}
2682
2683impl DataProviderGetAnnotationsResponder {
2684 pub fn send(self, mut annotations: &Annotations) -> Result<(), fidl::Error> {
2688 let _result = self.send_raw(annotations);
2689 if _result.is_err() {
2690 self.control_handle.shutdown();
2691 }
2692 self.drop_without_shutdown();
2693 _result
2694 }
2695
2696 pub fn send_no_shutdown_on_err(self, mut annotations: &Annotations) -> Result<(), fidl::Error> {
2698 let _result = self.send_raw(annotations);
2699 self.drop_without_shutdown();
2700 _result
2701 }
2702
2703 fn send_raw(&self, mut annotations: &Annotations) -> Result<(), fidl::Error> {
2704 self.control_handle.inner.send::<DataProviderGetAnnotationsResponse>(
2705 (annotations,),
2706 self.tx_id,
2707 0x367b4b6afe4345d8,
2708 fidl::encoding::DynamicFlags::empty(),
2709 )
2710 }
2711}
2712
2713#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2714pub struct DeviceIdProviderMarker;
2715
2716impl fidl::endpoints::ProtocolMarker for DeviceIdProviderMarker {
2717 type Proxy = DeviceIdProviderProxy;
2718 type RequestStream = DeviceIdProviderRequestStream;
2719 #[cfg(target_os = "fuchsia")]
2720 type SynchronousProxy = DeviceIdProviderSynchronousProxy;
2721
2722 const DEBUG_NAME: &'static str = "fuchsia.feedback.DeviceIdProvider";
2723}
2724impl fidl::endpoints::DiscoverableProtocolMarker for DeviceIdProviderMarker {}
2725
2726pub trait DeviceIdProviderProxyInterface: Send + Sync {
2727 type GetIdResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
2728 fn r#get_id(&self) -> Self::GetIdResponseFut;
2729}
2730#[derive(Debug)]
2731#[cfg(target_os = "fuchsia")]
2732pub struct DeviceIdProviderSynchronousProxy {
2733 client: fidl::client::sync::Client,
2734}
2735
2736#[cfg(target_os = "fuchsia")]
2737impl fidl::endpoints::SynchronousProxy for DeviceIdProviderSynchronousProxy {
2738 type Proxy = DeviceIdProviderProxy;
2739 type Protocol = DeviceIdProviderMarker;
2740
2741 fn from_channel(inner: fidl::Channel) -> Self {
2742 Self::new(inner)
2743 }
2744
2745 fn into_channel(self) -> fidl::Channel {
2746 self.client.into_channel()
2747 }
2748
2749 fn as_channel(&self) -> &fidl::Channel {
2750 self.client.as_channel()
2751 }
2752}
2753
2754#[cfg(target_os = "fuchsia")]
2755impl DeviceIdProviderSynchronousProxy {
2756 pub fn new(channel: fidl::Channel) -> Self {
2757 let protocol_name = <DeviceIdProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2758 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2759 }
2760
2761 pub fn into_channel(self) -> fidl::Channel {
2762 self.client.into_channel()
2763 }
2764
2765 pub fn wait_for_event(
2768 &self,
2769 deadline: zx::MonotonicInstant,
2770 ) -> Result<DeviceIdProviderEvent, fidl::Error> {
2771 DeviceIdProviderEvent::decode(self.client.wait_for_event(deadline)?)
2772 }
2773
2774 pub fn r#get_id(&self, ___deadline: zx::MonotonicInstant) -> Result<String, fidl::Error> {
2779 let _response =
2780 self.client.send_query::<fidl::encoding::EmptyPayload, DeviceIdProviderGetIdResponse>(
2781 (),
2782 0xea7f28a243488dc,
2783 fidl::encoding::DynamicFlags::empty(),
2784 ___deadline,
2785 )?;
2786 Ok(_response.feedback_id)
2787 }
2788}
2789
2790#[cfg(target_os = "fuchsia")]
2791impl From<DeviceIdProviderSynchronousProxy> for zx::Handle {
2792 fn from(value: DeviceIdProviderSynchronousProxy) -> Self {
2793 value.into_channel().into()
2794 }
2795}
2796
2797#[cfg(target_os = "fuchsia")]
2798impl From<fidl::Channel> for DeviceIdProviderSynchronousProxy {
2799 fn from(value: fidl::Channel) -> Self {
2800 Self::new(value)
2801 }
2802}
2803
2804#[derive(Debug, Clone)]
2805pub struct DeviceIdProviderProxy {
2806 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2807}
2808
2809impl fidl::endpoints::Proxy for DeviceIdProviderProxy {
2810 type Protocol = DeviceIdProviderMarker;
2811
2812 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2813 Self::new(inner)
2814 }
2815
2816 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2817 self.client.into_channel().map_err(|client| Self { client })
2818 }
2819
2820 fn as_channel(&self) -> &::fidl::AsyncChannel {
2821 self.client.as_channel()
2822 }
2823}
2824
2825impl DeviceIdProviderProxy {
2826 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2828 let protocol_name = <DeviceIdProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2829 Self { client: fidl::client::Client::new(channel, protocol_name) }
2830 }
2831
2832 pub fn take_event_stream(&self) -> DeviceIdProviderEventStream {
2838 DeviceIdProviderEventStream { event_receiver: self.client.take_event_receiver() }
2839 }
2840
2841 pub fn r#get_id(
2846 &self,
2847 ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
2848 DeviceIdProviderProxyInterface::r#get_id(self)
2849 }
2850}
2851
2852impl DeviceIdProviderProxyInterface for DeviceIdProviderProxy {
2853 type GetIdResponseFut =
2854 fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
2855 fn r#get_id(&self) -> Self::GetIdResponseFut {
2856 fn _decode(
2857 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2858 ) -> Result<String, fidl::Error> {
2859 let _response = fidl::client::decode_transaction_body::<
2860 DeviceIdProviderGetIdResponse,
2861 fidl::encoding::DefaultFuchsiaResourceDialect,
2862 0xea7f28a243488dc,
2863 >(_buf?)?;
2864 Ok(_response.feedback_id)
2865 }
2866 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, String>(
2867 (),
2868 0xea7f28a243488dc,
2869 fidl::encoding::DynamicFlags::empty(),
2870 _decode,
2871 )
2872 }
2873}
2874
2875pub struct DeviceIdProviderEventStream {
2876 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2877}
2878
2879impl std::marker::Unpin for DeviceIdProviderEventStream {}
2880
2881impl futures::stream::FusedStream for DeviceIdProviderEventStream {
2882 fn is_terminated(&self) -> bool {
2883 self.event_receiver.is_terminated()
2884 }
2885}
2886
2887impl futures::Stream for DeviceIdProviderEventStream {
2888 type Item = Result<DeviceIdProviderEvent, fidl::Error>;
2889
2890 fn poll_next(
2891 mut self: std::pin::Pin<&mut Self>,
2892 cx: &mut std::task::Context<'_>,
2893 ) -> std::task::Poll<Option<Self::Item>> {
2894 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2895 &mut self.event_receiver,
2896 cx
2897 )?) {
2898 Some(buf) => std::task::Poll::Ready(Some(DeviceIdProviderEvent::decode(buf))),
2899 None => std::task::Poll::Ready(None),
2900 }
2901 }
2902}
2903
2904#[derive(Debug)]
2905pub enum DeviceIdProviderEvent {}
2906
2907impl DeviceIdProviderEvent {
2908 fn decode(
2910 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2911 ) -> Result<DeviceIdProviderEvent, fidl::Error> {
2912 let (bytes, _handles) = buf.split_mut();
2913 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2914 debug_assert_eq!(tx_header.tx_id, 0);
2915 match tx_header.ordinal {
2916 _ => Err(fidl::Error::UnknownOrdinal {
2917 ordinal: tx_header.ordinal,
2918 protocol_name:
2919 <DeviceIdProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2920 }),
2921 }
2922 }
2923}
2924
2925pub struct DeviceIdProviderRequestStream {
2927 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2928 is_terminated: bool,
2929}
2930
2931impl std::marker::Unpin for DeviceIdProviderRequestStream {}
2932
2933impl futures::stream::FusedStream for DeviceIdProviderRequestStream {
2934 fn is_terminated(&self) -> bool {
2935 self.is_terminated
2936 }
2937}
2938
2939impl fidl::endpoints::RequestStream for DeviceIdProviderRequestStream {
2940 type Protocol = DeviceIdProviderMarker;
2941 type ControlHandle = DeviceIdProviderControlHandle;
2942
2943 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2944 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2945 }
2946
2947 fn control_handle(&self) -> Self::ControlHandle {
2948 DeviceIdProviderControlHandle { inner: self.inner.clone() }
2949 }
2950
2951 fn into_inner(
2952 self,
2953 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2954 {
2955 (self.inner, self.is_terminated)
2956 }
2957
2958 fn from_inner(
2959 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2960 is_terminated: bool,
2961 ) -> Self {
2962 Self { inner, is_terminated }
2963 }
2964}
2965
2966impl futures::Stream for DeviceIdProviderRequestStream {
2967 type Item = Result<DeviceIdProviderRequest, fidl::Error>;
2968
2969 fn poll_next(
2970 mut self: std::pin::Pin<&mut Self>,
2971 cx: &mut std::task::Context<'_>,
2972 ) -> std::task::Poll<Option<Self::Item>> {
2973 let this = &mut *self;
2974 if this.inner.check_shutdown(cx) {
2975 this.is_terminated = true;
2976 return std::task::Poll::Ready(None);
2977 }
2978 if this.is_terminated {
2979 panic!("polled DeviceIdProviderRequestStream after completion");
2980 }
2981 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2982 |bytes, handles| {
2983 match this.inner.channel().read_etc(cx, bytes, handles) {
2984 std::task::Poll::Ready(Ok(())) => {}
2985 std::task::Poll::Pending => return std::task::Poll::Pending,
2986 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2987 this.is_terminated = true;
2988 return std::task::Poll::Ready(None);
2989 }
2990 std::task::Poll::Ready(Err(e)) => {
2991 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2992 e.into(),
2993 ))))
2994 }
2995 }
2996
2997 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2999
3000 std::task::Poll::Ready(Some(match header.ordinal {
3001 0xea7f28a243488dc => {
3002 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3003 let mut req = fidl::new_empty!(
3004 fidl::encoding::EmptyPayload,
3005 fidl::encoding::DefaultFuchsiaResourceDialect
3006 );
3007 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3008 let control_handle =
3009 DeviceIdProviderControlHandle { inner: this.inner.clone() };
3010 Ok(DeviceIdProviderRequest::GetId {
3011 responder: DeviceIdProviderGetIdResponder {
3012 control_handle: std::mem::ManuallyDrop::new(control_handle),
3013 tx_id: header.tx_id,
3014 },
3015 })
3016 }
3017 _ => Err(fidl::Error::UnknownOrdinal {
3018 ordinal: header.ordinal,
3019 protocol_name:
3020 <DeviceIdProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3021 }),
3022 }))
3023 },
3024 )
3025 }
3026}
3027
3028#[derive(Debug)]
3034pub enum DeviceIdProviderRequest {
3035 GetId { responder: DeviceIdProviderGetIdResponder },
3040}
3041
3042impl DeviceIdProviderRequest {
3043 #[allow(irrefutable_let_patterns)]
3044 pub fn into_get_id(self) -> Option<(DeviceIdProviderGetIdResponder)> {
3045 if let DeviceIdProviderRequest::GetId { responder } = self {
3046 Some((responder))
3047 } else {
3048 None
3049 }
3050 }
3051
3052 pub fn method_name(&self) -> &'static str {
3054 match *self {
3055 DeviceIdProviderRequest::GetId { .. } => "get_id",
3056 }
3057 }
3058}
3059
3060#[derive(Debug, Clone)]
3061pub struct DeviceIdProviderControlHandle {
3062 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3063}
3064
3065impl fidl::endpoints::ControlHandle for DeviceIdProviderControlHandle {
3066 fn shutdown(&self) {
3067 self.inner.shutdown()
3068 }
3069 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3070 self.inner.shutdown_with_epitaph(status)
3071 }
3072
3073 fn is_closed(&self) -> bool {
3074 self.inner.channel().is_closed()
3075 }
3076 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3077 self.inner.channel().on_closed()
3078 }
3079
3080 #[cfg(target_os = "fuchsia")]
3081 fn signal_peer(
3082 &self,
3083 clear_mask: zx::Signals,
3084 set_mask: zx::Signals,
3085 ) -> Result<(), zx_status::Status> {
3086 use fidl::Peered;
3087 self.inner.channel().signal_peer(clear_mask, set_mask)
3088 }
3089}
3090
3091impl DeviceIdProviderControlHandle {}
3092
3093#[must_use = "FIDL methods require a response to be sent"]
3094#[derive(Debug)]
3095pub struct DeviceIdProviderGetIdResponder {
3096 control_handle: std::mem::ManuallyDrop<DeviceIdProviderControlHandle>,
3097 tx_id: u32,
3098}
3099
3100impl std::ops::Drop for DeviceIdProviderGetIdResponder {
3104 fn drop(&mut self) {
3105 self.control_handle.shutdown();
3106 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3108 }
3109}
3110
3111impl fidl::endpoints::Responder for DeviceIdProviderGetIdResponder {
3112 type ControlHandle = DeviceIdProviderControlHandle;
3113
3114 fn control_handle(&self) -> &DeviceIdProviderControlHandle {
3115 &self.control_handle
3116 }
3117
3118 fn drop_without_shutdown(mut self) {
3119 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3121 std::mem::forget(self);
3123 }
3124}
3125
3126impl DeviceIdProviderGetIdResponder {
3127 pub fn send(self, mut feedback_id: &str) -> Result<(), fidl::Error> {
3131 let _result = self.send_raw(feedback_id);
3132 if _result.is_err() {
3133 self.control_handle.shutdown();
3134 }
3135 self.drop_without_shutdown();
3136 _result
3137 }
3138
3139 pub fn send_no_shutdown_on_err(self, mut feedback_id: &str) -> Result<(), fidl::Error> {
3141 let _result = self.send_raw(feedback_id);
3142 self.drop_without_shutdown();
3143 _result
3144 }
3145
3146 fn send_raw(&self, mut feedback_id: &str) -> Result<(), fidl::Error> {
3147 self.control_handle.inner.send::<DeviceIdProviderGetIdResponse>(
3148 (feedback_id,),
3149 self.tx_id,
3150 0xea7f28a243488dc,
3151 fidl::encoding::DynamicFlags::empty(),
3152 )
3153 }
3154}
3155
3156#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3157pub struct LastRebootInfoProviderMarker;
3158
3159impl fidl::endpoints::ProtocolMarker for LastRebootInfoProviderMarker {
3160 type Proxy = LastRebootInfoProviderProxy;
3161 type RequestStream = LastRebootInfoProviderRequestStream;
3162 #[cfg(target_os = "fuchsia")]
3163 type SynchronousProxy = LastRebootInfoProviderSynchronousProxy;
3164
3165 const DEBUG_NAME: &'static str = "fuchsia.feedback.LastRebootInfoProvider";
3166}
3167impl fidl::endpoints::DiscoverableProtocolMarker for LastRebootInfoProviderMarker {}
3168
3169pub trait LastRebootInfoProviderProxyInterface: Send + Sync {
3170 type GetResponseFut: std::future::Future<Output = Result<LastReboot, fidl::Error>> + Send;
3171 fn r#get(&self) -> Self::GetResponseFut;
3172}
3173#[derive(Debug)]
3174#[cfg(target_os = "fuchsia")]
3175pub struct LastRebootInfoProviderSynchronousProxy {
3176 client: fidl::client::sync::Client,
3177}
3178
3179#[cfg(target_os = "fuchsia")]
3180impl fidl::endpoints::SynchronousProxy for LastRebootInfoProviderSynchronousProxy {
3181 type Proxy = LastRebootInfoProviderProxy;
3182 type Protocol = LastRebootInfoProviderMarker;
3183
3184 fn from_channel(inner: fidl::Channel) -> Self {
3185 Self::new(inner)
3186 }
3187
3188 fn into_channel(self) -> fidl::Channel {
3189 self.client.into_channel()
3190 }
3191
3192 fn as_channel(&self) -> &fidl::Channel {
3193 self.client.as_channel()
3194 }
3195}
3196
3197#[cfg(target_os = "fuchsia")]
3198impl LastRebootInfoProviderSynchronousProxy {
3199 pub fn new(channel: fidl::Channel) -> Self {
3200 let protocol_name =
3201 <LastRebootInfoProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3202 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3203 }
3204
3205 pub fn into_channel(self) -> fidl::Channel {
3206 self.client.into_channel()
3207 }
3208
3209 pub fn wait_for_event(
3212 &self,
3213 deadline: zx::MonotonicInstant,
3214 ) -> Result<LastRebootInfoProviderEvent, fidl::Error> {
3215 LastRebootInfoProviderEvent::decode(self.client.wait_for_event(deadline)?)
3216 }
3217
3218 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<LastReboot, fidl::Error> {
3219 let _response = self
3220 .client
3221 .send_query::<fidl::encoding::EmptyPayload, LastRebootInfoProviderGetResponse>(
3222 (),
3223 0xbc32d10e081ffac,
3224 fidl::encoding::DynamicFlags::empty(),
3225 ___deadline,
3226 )?;
3227 Ok(_response.last_reboot)
3228 }
3229}
3230
3231#[cfg(target_os = "fuchsia")]
3232impl From<LastRebootInfoProviderSynchronousProxy> for zx::Handle {
3233 fn from(value: LastRebootInfoProviderSynchronousProxy) -> Self {
3234 value.into_channel().into()
3235 }
3236}
3237
3238#[cfg(target_os = "fuchsia")]
3239impl From<fidl::Channel> for LastRebootInfoProviderSynchronousProxy {
3240 fn from(value: fidl::Channel) -> Self {
3241 Self::new(value)
3242 }
3243}
3244
3245#[derive(Debug, Clone)]
3246pub struct LastRebootInfoProviderProxy {
3247 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3248}
3249
3250impl fidl::endpoints::Proxy for LastRebootInfoProviderProxy {
3251 type Protocol = LastRebootInfoProviderMarker;
3252
3253 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3254 Self::new(inner)
3255 }
3256
3257 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3258 self.client.into_channel().map_err(|client| Self { client })
3259 }
3260
3261 fn as_channel(&self) -> &::fidl::AsyncChannel {
3262 self.client.as_channel()
3263 }
3264}
3265
3266impl LastRebootInfoProviderProxy {
3267 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3269 let protocol_name =
3270 <LastRebootInfoProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3271 Self { client: fidl::client::Client::new(channel, protocol_name) }
3272 }
3273
3274 pub fn take_event_stream(&self) -> LastRebootInfoProviderEventStream {
3280 LastRebootInfoProviderEventStream { event_receiver: self.client.take_event_receiver() }
3281 }
3282
3283 pub fn r#get(
3284 &self,
3285 ) -> fidl::client::QueryResponseFut<LastReboot, fidl::encoding::DefaultFuchsiaResourceDialect>
3286 {
3287 LastRebootInfoProviderProxyInterface::r#get(self)
3288 }
3289}
3290
3291impl LastRebootInfoProviderProxyInterface for LastRebootInfoProviderProxy {
3292 type GetResponseFut =
3293 fidl::client::QueryResponseFut<LastReboot, fidl::encoding::DefaultFuchsiaResourceDialect>;
3294 fn r#get(&self) -> Self::GetResponseFut {
3295 fn _decode(
3296 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3297 ) -> Result<LastReboot, fidl::Error> {
3298 let _response = fidl::client::decode_transaction_body::<
3299 LastRebootInfoProviderGetResponse,
3300 fidl::encoding::DefaultFuchsiaResourceDialect,
3301 0xbc32d10e081ffac,
3302 >(_buf?)?;
3303 Ok(_response.last_reboot)
3304 }
3305 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, LastReboot>(
3306 (),
3307 0xbc32d10e081ffac,
3308 fidl::encoding::DynamicFlags::empty(),
3309 _decode,
3310 )
3311 }
3312}
3313
3314pub struct LastRebootInfoProviderEventStream {
3315 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3316}
3317
3318impl std::marker::Unpin for LastRebootInfoProviderEventStream {}
3319
3320impl futures::stream::FusedStream for LastRebootInfoProviderEventStream {
3321 fn is_terminated(&self) -> bool {
3322 self.event_receiver.is_terminated()
3323 }
3324}
3325
3326impl futures::Stream for LastRebootInfoProviderEventStream {
3327 type Item = Result<LastRebootInfoProviderEvent, fidl::Error>;
3328
3329 fn poll_next(
3330 mut self: std::pin::Pin<&mut Self>,
3331 cx: &mut std::task::Context<'_>,
3332 ) -> std::task::Poll<Option<Self::Item>> {
3333 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3334 &mut self.event_receiver,
3335 cx
3336 )?) {
3337 Some(buf) => std::task::Poll::Ready(Some(LastRebootInfoProviderEvent::decode(buf))),
3338 None => std::task::Poll::Ready(None),
3339 }
3340 }
3341}
3342
3343#[derive(Debug)]
3344pub enum LastRebootInfoProviderEvent {}
3345
3346impl LastRebootInfoProviderEvent {
3347 fn decode(
3349 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3350 ) -> Result<LastRebootInfoProviderEvent, fidl::Error> {
3351 let (bytes, _handles) = buf.split_mut();
3352 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3353 debug_assert_eq!(tx_header.tx_id, 0);
3354 match tx_header.ordinal {
3355 _ => Err(fidl::Error::UnknownOrdinal {
3356 ordinal: tx_header.ordinal,
3357 protocol_name:
3358 <LastRebootInfoProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3359 }),
3360 }
3361 }
3362}
3363
3364pub struct LastRebootInfoProviderRequestStream {
3366 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3367 is_terminated: bool,
3368}
3369
3370impl std::marker::Unpin for LastRebootInfoProviderRequestStream {}
3371
3372impl futures::stream::FusedStream for LastRebootInfoProviderRequestStream {
3373 fn is_terminated(&self) -> bool {
3374 self.is_terminated
3375 }
3376}
3377
3378impl fidl::endpoints::RequestStream for LastRebootInfoProviderRequestStream {
3379 type Protocol = LastRebootInfoProviderMarker;
3380 type ControlHandle = LastRebootInfoProviderControlHandle;
3381
3382 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3383 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3384 }
3385
3386 fn control_handle(&self) -> Self::ControlHandle {
3387 LastRebootInfoProviderControlHandle { inner: self.inner.clone() }
3388 }
3389
3390 fn into_inner(
3391 self,
3392 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3393 {
3394 (self.inner, self.is_terminated)
3395 }
3396
3397 fn from_inner(
3398 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3399 is_terminated: bool,
3400 ) -> Self {
3401 Self { inner, is_terminated }
3402 }
3403}
3404
3405impl futures::Stream for LastRebootInfoProviderRequestStream {
3406 type Item = Result<LastRebootInfoProviderRequest, fidl::Error>;
3407
3408 fn poll_next(
3409 mut self: std::pin::Pin<&mut Self>,
3410 cx: &mut std::task::Context<'_>,
3411 ) -> std::task::Poll<Option<Self::Item>> {
3412 let this = &mut *self;
3413 if this.inner.check_shutdown(cx) {
3414 this.is_terminated = true;
3415 return std::task::Poll::Ready(None);
3416 }
3417 if this.is_terminated {
3418 panic!("polled LastRebootInfoProviderRequestStream after completion");
3419 }
3420 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3421 |bytes, handles| {
3422 match this.inner.channel().read_etc(cx, bytes, handles) {
3423 std::task::Poll::Ready(Ok(())) => {}
3424 std::task::Poll::Pending => return std::task::Poll::Pending,
3425 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3426 this.is_terminated = true;
3427 return std::task::Poll::Ready(None);
3428 }
3429 std::task::Poll::Ready(Err(e)) => {
3430 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3431 e.into(),
3432 ))))
3433 }
3434 }
3435
3436 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3438
3439 std::task::Poll::Ready(Some(match header.ordinal {
3440 0xbc32d10e081ffac => {
3441 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3442 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3443 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3444 let control_handle = LastRebootInfoProviderControlHandle {
3445 inner: this.inner.clone(),
3446 };
3447 Ok(LastRebootInfoProviderRequest::Get {
3448 responder: LastRebootInfoProviderGetResponder {
3449 control_handle: std::mem::ManuallyDrop::new(control_handle),
3450 tx_id: header.tx_id,
3451 },
3452 })
3453 }
3454 _ => Err(fidl::Error::UnknownOrdinal {
3455 ordinal: header.ordinal,
3456 protocol_name: <LastRebootInfoProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3457 }),
3458 }))
3459 },
3460 )
3461 }
3462}
3463
3464#[derive(Debug)]
3468pub enum LastRebootInfoProviderRequest {
3469 Get { responder: LastRebootInfoProviderGetResponder },
3470}
3471
3472impl LastRebootInfoProviderRequest {
3473 #[allow(irrefutable_let_patterns)]
3474 pub fn into_get(self) -> Option<(LastRebootInfoProviderGetResponder)> {
3475 if let LastRebootInfoProviderRequest::Get { responder } = self {
3476 Some((responder))
3477 } else {
3478 None
3479 }
3480 }
3481
3482 pub fn method_name(&self) -> &'static str {
3484 match *self {
3485 LastRebootInfoProviderRequest::Get { .. } => "get",
3486 }
3487 }
3488}
3489
3490#[derive(Debug, Clone)]
3491pub struct LastRebootInfoProviderControlHandle {
3492 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3493}
3494
3495impl fidl::endpoints::ControlHandle for LastRebootInfoProviderControlHandle {
3496 fn shutdown(&self) {
3497 self.inner.shutdown()
3498 }
3499 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3500 self.inner.shutdown_with_epitaph(status)
3501 }
3502
3503 fn is_closed(&self) -> bool {
3504 self.inner.channel().is_closed()
3505 }
3506 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3507 self.inner.channel().on_closed()
3508 }
3509
3510 #[cfg(target_os = "fuchsia")]
3511 fn signal_peer(
3512 &self,
3513 clear_mask: zx::Signals,
3514 set_mask: zx::Signals,
3515 ) -> Result<(), zx_status::Status> {
3516 use fidl::Peered;
3517 self.inner.channel().signal_peer(clear_mask, set_mask)
3518 }
3519}
3520
3521impl LastRebootInfoProviderControlHandle {}
3522
3523#[must_use = "FIDL methods require a response to be sent"]
3524#[derive(Debug)]
3525pub struct LastRebootInfoProviderGetResponder {
3526 control_handle: std::mem::ManuallyDrop<LastRebootInfoProviderControlHandle>,
3527 tx_id: u32,
3528}
3529
3530impl std::ops::Drop for LastRebootInfoProviderGetResponder {
3534 fn drop(&mut self) {
3535 self.control_handle.shutdown();
3536 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3538 }
3539}
3540
3541impl fidl::endpoints::Responder for LastRebootInfoProviderGetResponder {
3542 type ControlHandle = LastRebootInfoProviderControlHandle;
3543
3544 fn control_handle(&self) -> &LastRebootInfoProviderControlHandle {
3545 &self.control_handle
3546 }
3547
3548 fn drop_without_shutdown(mut self) {
3549 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3551 std::mem::forget(self);
3553 }
3554}
3555
3556impl LastRebootInfoProviderGetResponder {
3557 pub fn send(self, mut last_reboot: &LastReboot) -> Result<(), fidl::Error> {
3561 let _result = self.send_raw(last_reboot);
3562 if _result.is_err() {
3563 self.control_handle.shutdown();
3564 }
3565 self.drop_without_shutdown();
3566 _result
3567 }
3568
3569 pub fn send_no_shutdown_on_err(self, mut last_reboot: &LastReboot) -> Result<(), fidl::Error> {
3571 let _result = self.send_raw(last_reboot);
3572 self.drop_without_shutdown();
3573 _result
3574 }
3575
3576 fn send_raw(&self, mut last_reboot: &LastReboot) -> Result<(), fidl::Error> {
3577 self.control_handle.inner.send::<LastRebootInfoProviderGetResponse>(
3578 (last_reboot,),
3579 self.tx_id,
3580 0xbc32d10e081ffac,
3581 fidl::encoding::DynamicFlags::empty(),
3582 )
3583 }
3584}
3585
3586mod internal {
3587 use super::*;
3588
3589 impl fidl::encoding::ResourceTypeMarker for Attachment {
3590 type Borrowed<'a> = &'a mut Self;
3591 fn take_or_borrow<'a>(
3592 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3593 ) -> Self::Borrowed<'a> {
3594 value
3595 }
3596 }
3597
3598 unsafe impl fidl::encoding::TypeMarker for Attachment {
3599 type Owned = Self;
3600
3601 #[inline(always)]
3602 fn inline_align(_context: fidl::encoding::Context) -> usize {
3603 8
3604 }
3605
3606 #[inline(always)]
3607 fn inline_size(_context: fidl::encoding::Context) -> usize {
3608 32
3609 }
3610 }
3611
3612 unsafe impl fidl::encoding::Encode<Attachment, fidl::encoding::DefaultFuchsiaResourceDialect>
3613 for &mut Attachment
3614 {
3615 #[inline]
3616 unsafe fn encode(
3617 self,
3618 encoder: &mut fidl::encoding::Encoder<
3619 '_,
3620 fidl::encoding::DefaultFuchsiaResourceDialect,
3621 >,
3622 offset: usize,
3623 _depth: fidl::encoding::Depth,
3624 ) -> fidl::Result<()> {
3625 encoder.debug_check_bounds::<Attachment>(offset);
3626 fidl::encoding::Encode::<Attachment, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3628 (
3629 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
3630 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.value),
3631 ),
3632 encoder, offset, _depth
3633 )
3634 }
3635 }
3636 unsafe impl<
3637 T0: fidl::encoding::Encode<
3638 fidl::encoding::BoundedString<128>,
3639 fidl::encoding::DefaultFuchsiaResourceDialect,
3640 >,
3641 T1: fidl::encoding::Encode<
3642 fidl_fuchsia_mem::Buffer,
3643 fidl::encoding::DefaultFuchsiaResourceDialect,
3644 >,
3645 > fidl::encoding::Encode<Attachment, fidl::encoding::DefaultFuchsiaResourceDialect>
3646 for (T0, T1)
3647 {
3648 #[inline]
3649 unsafe fn encode(
3650 self,
3651 encoder: &mut fidl::encoding::Encoder<
3652 '_,
3653 fidl::encoding::DefaultFuchsiaResourceDialect,
3654 >,
3655 offset: usize,
3656 depth: fidl::encoding::Depth,
3657 ) -> fidl::Result<()> {
3658 encoder.debug_check_bounds::<Attachment>(offset);
3659 self.0.encode(encoder, offset + 0, depth)?;
3663 self.1.encode(encoder, offset + 16, depth)?;
3664 Ok(())
3665 }
3666 }
3667
3668 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Attachment {
3669 #[inline(always)]
3670 fn new_empty() -> Self {
3671 Self {
3672 key: fidl::new_empty!(
3673 fidl::encoding::BoundedString<128>,
3674 fidl::encoding::DefaultFuchsiaResourceDialect
3675 ),
3676 value: fidl::new_empty!(
3677 fidl_fuchsia_mem::Buffer,
3678 fidl::encoding::DefaultFuchsiaResourceDialect
3679 ),
3680 }
3681 }
3682
3683 #[inline]
3684 unsafe fn decode(
3685 &mut self,
3686 decoder: &mut fidl::encoding::Decoder<
3687 '_,
3688 fidl::encoding::DefaultFuchsiaResourceDialect,
3689 >,
3690 offset: usize,
3691 _depth: fidl::encoding::Depth,
3692 ) -> fidl::Result<()> {
3693 decoder.debug_check_bounds::<Self>(offset);
3694 fidl::decode!(
3696 fidl::encoding::BoundedString<128>,
3697 fidl::encoding::DefaultFuchsiaResourceDialect,
3698 &mut self.key,
3699 decoder,
3700 offset + 0,
3701 _depth
3702 )?;
3703 fidl::decode!(
3704 fidl_fuchsia_mem::Buffer,
3705 fidl::encoding::DefaultFuchsiaResourceDialect,
3706 &mut self.value,
3707 decoder,
3708 offset + 16,
3709 _depth
3710 )?;
3711 Ok(())
3712 }
3713 }
3714
3715 impl fidl::encoding::ResourceTypeMarker for CrashReporterFileReportRequest {
3716 type Borrowed<'a> = &'a mut Self;
3717 fn take_or_borrow<'a>(
3718 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3719 ) -> Self::Borrowed<'a> {
3720 value
3721 }
3722 }
3723
3724 unsafe impl fidl::encoding::TypeMarker for CrashReporterFileReportRequest {
3725 type Owned = Self;
3726
3727 #[inline(always)]
3728 fn inline_align(_context: fidl::encoding::Context) -> usize {
3729 8
3730 }
3731
3732 #[inline(always)]
3733 fn inline_size(_context: fidl::encoding::Context) -> usize {
3734 16
3735 }
3736 }
3737
3738 unsafe impl
3739 fidl::encoding::Encode<
3740 CrashReporterFileReportRequest,
3741 fidl::encoding::DefaultFuchsiaResourceDialect,
3742 > for &mut CrashReporterFileReportRequest
3743 {
3744 #[inline]
3745 unsafe fn encode(
3746 self,
3747 encoder: &mut fidl::encoding::Encoder<
3748 '_,
3749 fidl::encoding::DefaultFuchsiaResourceDialect,
3750 >,
3751 offset: usize,
3752 _depth: fidl::encoding::Depth,
3753 ) -> fidl::Result<()> {
3754 encoder.debug_check_bounds::<CrashReporterFileReportRequest>(offset);
3755 fidl::encoding::Encode::<
3757 CrashReporterFileReportRequest,
3758 fidl::encoding::DefaultFuchsiaResourceDialect,
3759 >::encode(
3760 (<CrashReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3761 &mut self.report,
3762 ),),
3763 encoder,
3764 offset,
3765 _depth,
3766 )
3767 }
3768 }
3769 unsafe impl<
3770 T0: fidl::encoding::Encode<CrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>,
3771 >
3772 fidl::encoding::Encode<
3773 CrashReporterFileReportRequest,
3774 fidl::encoding::DefaultFuchsiaResourceDialect,
3775 > for (T0,)
3776 {
3777 #[inline]
3778 unsafe fn encode(
3779 self,
3780 encoder: &mut fidl::encoding::Encoder<
3781 '_,
3782 fidl::encoding::DefaultFuchsiaResourceDialect,
3783 >,
3784 offset: usize,
3785 depth: fidl::encoding::Depth,
3786 ) -> fidl::Result<()> {
3787 encoder.debug_check_bounds::<CrashReporterFileReportRequest>(offset);
3788 self.0.encode(encoder, offset + 0, depth)?;
3792 Ok(())
3793 }
3794 }
3795
3796 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3797 for CrashReporterFileReportRequest
3798 {
3799 #[inline(always)]
3800 fn new_empty() -> Self {
3801 Self {
3802 report: fidl::new_empty!(
3803 CrashReport,
3804 fidl::encoding::DefaultFuchsiaResourceDialect
3805 ),
3806 }
3807 }
3808
3809 #[inline]
3810 unsafe fn decode(
3811 &mut self,
3812 decoder: &mut fidl::encoding::Decoder<
3813 '_,
3814 fidl::encoding::DefaultFuchsiaResourceDialect,
3815 >,
3816 offset: usize,
3817 _depth: fidl::encoding::Depth,
3818 ) -> fidl::Result<()> {
3819 decoder.debug_check_bounds::<Self>(offset);
3820 fidl::decode!(
3822 CrashReport,
3823 fidl::encoding::DefaultFuchsiaResourceDialect,
3824 &mut self.report,
3825 decoder,
3826 offset + 0,
3827 _depth
3828 )?;
3829 Ok(())
3830 }
3831 }
3832
3833 impl fidl::encoding::ResourceTypeMarker for DataProviderGetScreenshotResponse {
3834 type Borrowed<'a> = &'a mut Self;
3835 fn take_or_borrow<'a>(
3836 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3837 ) -> Self::Borrowed<'a> {
3838 value
3839 }
3840 }
3841
3842 unsafe impl fidl::encoding::TypeMarker for DataProviderGetScreenshotResponse {
3843 type Owned = Self;
3844
3845 #[inline(always)]
3846 fn inline_align(_context: fidl::encoding::Context) -> usize {
3847 8
3848 }
3849
3850 #[inline(always)]
3851 fn inline_size(_context: fidl::encoding::Context) -> usize {
3852 8
3853 }
3854 }
3855
3856 unsafe impl
3857 fidl::encoding::Encode<
3858 DataProviderGetScreenshotResponse,
3859 fidl::encoding::DefaultFuchsiaResourceDialect,
3860 > for &mut DataProviderGetScreenshotResponse
3861 {
3862 #[inline]
3863 unsafe fn encode(
3864 self,
3865 encoder: &mut fidl::encoding::Encoder<
3866 '_,
3867 fidl::encoding::DefaultFuchsiaResourceDialect,
3868 >,
3869 offset: usize,
3870 _depth: fidl::encoding::Depth,
3871 ) -> fidl::Result<()> {
3872 encoder.debug_check_bounds::<DataProviderGetScreenshotResponse>(offset);
3873 fidl::encoding::Encode::<DataProviderGetScreenshotResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3875 (
3876 <fidl::encoding::Boxed<Screenshot> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.screenshot),
3877 ),
3878 encoder, offset, _depth
3879 )
3880 }
3881 }
3882 unsafe impl<
3883 T0: fidl::encoding::Encode<
3884 fidl::encoding::Boxed<Screenshot>,
3885 fidl::encoding::DefaultFuchsiaResourceDialect,
3886 >,
3887 >
3888 fidl::encoding::Encode<
3889 DataProviderGetScreenshotResponse,
3890 fidl::encoding::DefaultFuchsiaResourceDialect,
3891 > for (T0,)
3892 {
3893 #[inline]
3894 unsafe fn encode(
3895 self,
3896 encoder: &mut fidl::encoding::Encoder<
3897 '_,
3898 fidl::encoding::DefaultFuchsiaResourceDialect,
3899 >,
3900 offset: usize,
3901 depth: fidl::encoding::Depth,
3902 ) -> fidl::Result<()> {
3903 encoder.debug_check_bounds::<DataProviderGetScreenshotResponse>(offset);
3904 self.0.encode(encoder, offset + 0, depth)?;
3908 Ok(())
3909 }
3910 }
3911
3912 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3913 for DataProviderGetScreenshotResponse
3914 {
3915 #[inline(always)]
3916 fn new_empty() -> Self {
3917 Self {
3918 screenshot: fidl::new_empty!(
3919 fidl::encoding::Boxed<Screenshot>,
3920 fidl::encoding::DefaultFuchsiaResourceDialect
3921 ),
3922 }
3923 }
3924
3925 #[inline]
3926 unsafe fn decode(
3927 &mut self,
3928 decoder: &mut fidl::encoding::Decoder<
3929 '_,
3930 fidl::encoding::DefaultFuchsiaResourceDialect,
3931 >,
3932 offset: usize,
3933 _depth: fidl::encoding::Depth,
3934 ) -> fidl::Result<()> {
3935 decoder.debug_check_bounds::<Self>(offset);
3936 fidl::decode!(
3938 fidl::encoding::Boxed<Screenshot>,
3939 fidl::encoding::DefaultFuchsiaResourceDialect,
3940 &mut self.screenshot,
3941 decoder,
3942 offset + 0,
3943 _depth
3944 )?;
3945 Ok(())
3946 }
3947 }
3948
3949 impl fidl::encoding::ResourceTypeMarker for DataProviderGetSnapshotRequest {
3950 type Borrowed<'a> = &'a mut Self;
3951 fn take_or_borrow<'a>(
3952 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3953 ) -> Self::Borrowed<'a> {
3954 value
3955 }
3956 }
3957
3958 unsafe impl fidl::encoding::TypeMarker for DataProviderGetSnapshotRequest {
3959 type Owned = Self;
3960
3961 #[inline(always)]
3962 fn inline_align(_context: fidl::encoding::Context) -> usize {
3963 8
3964 }
3965
3966 #[inline(always)]
3967 fn inline_size(_context: fidl::encoding::Context) -> usize {
3968 16
3969 }
3970 }
3971
3972 unsafe impl
3973 fidl::encoding::Encode<
3974 DataProviderGetSnapshotRequest,
3975 fidl::encoding::DefaultFuchsiaResourceDialect,
3976 > for &mut DataProviderGetSnapshotRequest
3977 {
3978 #[inline]
3979 unsafe fn encode(
3980 self,
3981 encoder: &mut fidl::encoding::Encoder<
3982 '_,
3983 fidl::encoding::DefaultFuchsiaResourceDialect,
3984 >,
3985 offset: usize,
3986 _depth: fidl::encoding::Depth,
3987 ) -> fidl::Result<()> {
3988 encoder.debug_check_bounds::<DataProviderGetSnapshotRequest>(offset);
3989 fidl::encoding::Encode::<
3991 DataProviderGetSnapshotRequest,
3992 fidl::encoding::DefaultFuchsiaResourceDialect,
3993 >::encode(
3994 (<GetSnapshotParameters as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3995 &mut self.params,
3996 ),),
3997 encoder,
3998 offset,
3999 _depth,
4000 )
4001 }
4002 }
4003 unsafe impl<
4004 T0: fidl::encoding::Encode<
4005 GetSnapshotParameters,
4006 fidl::encoding::DefaultFuchsiaResourceDialect,
4007 >,
4008 >
4009 fidl::encoding::Encode<
4010 DataProviderGetSnapshotRequest,
4011 fidl::encoding::DefaultFuchsiaResourceDialect,
4012 > for (T0,)
4013 {
4014 #[inline]
4015 unsafe fn encode(
4016 self,
4017 encoder: &mut fidl::encoding::Encoder<
4018 '_,
4019 fidl::encoding::DefaultFuchsiaResourceDialect,
4020 >,
4021 offset: usize,
4022 depth: fidl::encoding::Depth,
4023 ) -> fidl::Result<()> {
4024 encoder.debug_check_bounds::<DataProviderGetSnapshotRequest>(offset);
4025 self.0.encode(encoder, offset + 0, depth)?;
4029 Ok(())
4030 }
4031 }
4032
4033 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4034 for DataProviderGetSnapshotRequest
4035 {
4036 #[inline(always)]
4037 fn new_empty() -> Self {
4038 Self {
4039 params: fidl::new_empty!(
4040 GetSnapshotParameters,
4041 fidl::encoding::DefaultFuchsiaResourceDialect
4042 ),
4043 }
4044 }
4045
4046 #[inline]
4047 unsafe fn decode(
4048 &mut self,
4049 decoder: &mut fidl::encoding::Decoder<
4050 '_,
4051 fidl::encoding::DefaultFuchsiaResourceDialect,
4052 >,
4053 offset: usize,
4054 _depth: fidl::encoding::Depth,
4055 ) -> fidl::Result<()> {
4056 decoder.debug_check_bounds::<Self>(offset);
4057 fidl::decode!(
4059 GetSnapshotParameters,
4060 fidl::encoding::DefaultFuchsiaResourceDialect,
4061 &mut self.params,
4062 decoder,
4063 offset + 0,
4064 _depth
4065 )?;
4066 Ok(())
4067 }
4068 }
4069
4070 impl fidl::encoding::ResourceTypeMarker for DataProviderGetSnapshotResponse {
4071 type Borrowed<'a> = &'a mut Self;
4072 fn take_or_borrow<'a>(
4073 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4074 ) -> Self::Borrowed<'a> {
4075 value
4076 }
4077 }
4078
4079 unsafe impl fidl::encoding::TypeMarker for DataProviderGetSnapshotResponse {
4080 type Owned = Self;
4081
4082 #[inline(always)]
4083 fn inline_align(_context: fidl::encoding::Context) -> usize {
4084 8
4085 }
4086
4087 #[inline(always)]
4088 fn inline_size(_context: fidl::encoding::Context) -> usize {
4089 16
4090 }
4091 }
4092
4093 unsafe impl
4094 fidl::encoding::Encode<
4095 DataProviderGetSnapshotResponse,
4096 fidl::encoding::DefaultFuchsiaResourceDialect,
4097 > for &mut DataProviderGetSnapshotResponse
4098 {
4099 #[inline]
4100 unsafe fn encode(
4101 self,
4102 encoder: &mut fidl::encoding::Encoder<
4103 '_,
4104 fidl::encoding::DefaultFuchsiaResourceDialect,
4105 >,
4106 offset: usize,
4107 _depth: fidl::encoding::Depth,
4108 ) -> fidl::Result<()> {
4109 encoder.debug_check_bounds::<DataProviderGetSnapshotResponse>(offset);
4110 fidl::encoding::Encode::<
4112 DataProviderGetSnapshotResponse,
4113 fidl::encoding::DefaultFuchsiaResourceDialect,
4114 >::encode(
4115 (<Snapshot as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4116 &mut self.snapshot,
4117 ),),
4118 encoder,
4119 offset,
4120 _depth,
4121 )
4122 }
4123 }
4124 unsafe impl<T0: fidl::encoding::Encode<Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect>>
4125 fidl::encoding::Encode<
4126 DataProviderGetSnapshotResponse,
4127 fidl::encoding::DefaultFuchsiaResourceDialect,
4128 > for (T0,)
4129 {
4130 #[inline]
4131 unsafe fn encode(
4132 self,
4133 encoder: &mut fidl::encoding::Encoder<
4134 '_,
4135 fidl::encoding::DefaultFuchsiaResourceDialect,
4136 >,
4137 offset: usize,
4138 depth: fidl::encoding::Depth,
4139 ) -> fidl::Result<()> {
4140 encoder.debug_check_bounds::<DataProviderGetSnapshotResponse>(offset);
4141 self.0.encode(encoder, offset + 0, depth)?;
4145 Ok(())
4146 }
4147 }
4148
4149 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4150 for DataProviderGetSnapshotResponse
4151 {
4152 #[inline(always)]
4153 fn new_empty() -> Self {
4154 Self {
4155 snapshot: fidl::new_empty!(Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect),
4156 }
4157 }
4158
4159 #[inline]
4160 unsafe fn decode(
4161 &mut self,
4162 decoder: &mut fidl::encoding::Decoder<
4163 '_,
4164 fidl::encoding::DefaultFuchsiaResourceDialect,
4165 >,
4166 offset: usize,
4167 _depth: fidl::encoding::Depth,
4168 ) -> fidl::Result<()> {
4169 decoder.debug_check_bounds::<Self>(offset);
4170 fidl::decode!(
4172 Snapshot,
4173 fidl::encoding::DefaultFuchsiaResourceDialect,
4174 &mut self.snapshot,
4175 decoder,
4176 offset + 0,
4177 _depth
4178 )?;
4179 Ok(())
4180 }
4181 }
4182
4183 impl fidl::encoding::ResourceTypeMarker for Screenshot {
4184 type Borrowed<'a> = &'a mut Self;
4185 fn take_or_borrow<'a>(
4186 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4187 ) -> Self::Borrowed<'a> {
4188 value
4189 }
4190 }
4191
4192 unsafe impl fidl::encoding::TypeMarker for Screenshot {
4193 type Owned = Self;
4194
4195 #[inline(always)]
4196 fn inline_align(_context: fidl::encoding::Context) -> usize {
4197 8
4198 }
4199
4200 #[inline(always)]
4201 fn inline_size(_context: fidl::encoding::Context) -> usize {
4202 24
4203 }
4204 }
4205
4206 unsafe impl fidl::encoding::Encode<Screenshot, fidl::encoding::DefaultFuchsiaResourceDialect>
4207 for &mut Screenshot
4208 {
4209 #[inline]
4210 unsafe fn encode(
4211 self,
4212 encoder: &mut fidl::encoding::Encoder<
4213 '_,
4214 fidl::encoding::DefaultFuchsiaResourceDialect,
4215 >,
4216 offset: usize,
4217 _depth: fidl::encoding::Depth,
4218 ) -> fidl::Result<()> {
4219 encoder.debug_check_bounds::<Screenshot>(offset);
4220 fidl::encoding::Encode::<Screenshot, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4222 (
4223 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.image),
4224 <fidl_fuchsia_math::Size as fidl::encoding::ValueTypeMarker>::borrow(&self.dimensions_in_px),
4225 ),
4226 encoder, offset, _depth
4227 )
4228 }
4229 }
4230 unsafe impl<
4231 T0: fidl::encoding::Encode<
4232 fidl_fuchsia_mem::Buffer,
4233 fidl::encoding::DefaultFuchsiaResourceDialect,
4234 >,
4235 T1: fidl::encoding::Encode<
4236 fidl_fuchsia_math::Size,
4237 fidl::encoding::DefaultFuchsiaResourceDialect,
4238 >,
4239 > fidl::encoding::Encode<Screenshot, fidl::encoding::DefaultFuchsiaResourceDialect>
4240 for (T0, T1)
4241 {
4242 #[inline]
4243 unsafe fn encode(
4244 self,
4245 encoder: &mut fidl::encoding::Encoder<
4246 '_,
4247 fidl::encoding::DefaultFuchsiaResourceDialect,
4248 >,
4249 offset: usize,
4250 depth: fidl::encoding::Depth,
4251 ) -> fidl::Result<()> {
4252 encoder.debug_check_bounds::<Screenshot>(offset);
4253 self.0.encode(encoder, offset + 0, depth)?;
4257 self.1.encode(encoder, offset + 16, depth)?;
4258 Ok(())
4259 }
4260 }
4261
4262 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Screenshot {
4263 #[inline(always)]
4264 fn new_empty() -> Self {
4265 Self {
4266 image: fidl::new_empty!(
4267 fidl_fuchsia_mem::Buffer,
4268 fidl::encoding::DefaultFuchsiaResourceDialect
4269 ),
4270 dimensions_in_px: fidl::new_empty!(
4271 fidl_fuchsia_math::Size,
4272 fidl::encoding::DefaultFuchsiaResourceDialect
4273 ),
4274 }
4275 }
4276
4277 #[inline]
4278 unsafe fn decode(
4279 &mut self,
4280 decoder: &mut fidl::encoding::Decoder<
4281 '_,
4282 fidl::encoding::DefaultFuchsiaResourceDialect,
4283 >,
4284 offset: usize,
4285 _depth: fidl::encoding::Depth,
4286 ) -> fidl::Result<()> {
4287 decoder.debug_check_bounds::<Self>(offset);
4288 fidl::decode!(
4290 fidl_fuchsia_mem::Buffer,
4291 fidl::encoding::DefaultFuchsiaResourceDialect,
4292 &mut self.image,
4293 decoder,
4294 offset + 0,
4295 _depth
4296 )?;
4297 fidl::decode!(
4298 fidl_fuchsia_math::Size,
4299 fidl::encoding::DefaultFuchsiaResourceDialect,
4300 &mut self.dimensions_in_px,
4301 decoder,
4302 offset + 16,
4303 _depth
4304 )?;
4305 Ok(())
4306 }
4307 }
4308
4309 impl CrashReport {
4310 #[inline(always)]
4311 fn max_ordinal_present(&self) -> u64 {
4312 if let Some(_) = self.is_fatal {
4313 return 8;
4314 }
4315 if let Some(_) = self.crash_signature {
4316 return 7;
4317 }
4318 if let Some(_) = self.program_uptime {
4319 return 6;
4320 }
4321 if let Some(_) = self.event_id {
4322 return 5;
4323 }
4324 if let Some(_) = self.attachments {
4325 return 4;
4326 }
4327 if let Some(_) = self.annotations {
4328 return 3;
4329 }
4330 if let Some(_) = self.specific_report {
4331 return 2;
4332 }
4333 if let Some(_) = self.program_name {
4334 return 1;
4335 }
4336 0
4337 }
4338 }
4339
4340 impl fidl::encoding::ResourceTypeMarker for CrashReport {
4341 type Borrowed<'a> = &'a mut Self;
4342 fn take_or_borrow<'a>(
4343 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4344 ) -> Self::Borrowed<'a> {
4345 value
4346 }
4347 }
4348
4349 unsafe impl fidl::encoding::TypeMarker for CrashReport {
4350 type Owned = Self;
4351
4352 #[inline(always)]
4353 fn inline_align(_context: fidl::encoding::Context) -> usize {
4354 8
4355 }
4356
4357 #[inline(always)]
4358 fn inline_size(_context: fidl::encoding::Context) -> usize {
4359 16
4360 }
4361 }
4362
4363 unsafe impl fidl::encoding::Encode<CrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>
4364 for &mut CrashReport
4365 {
4366 unsafe fn encode(
4367 self,
4368 encoder: &mut fidl::encoding::Encoder<
4369 '_,
4370 fidl::encoding::DefaultFuchsiaResourceDialect,
4371 >,
4372 offset: usize,
4373 mut depth: fidl::encoding::Depth,
4374 ) -> fidl::Result<()> {
4375 encoder.debug_check_bounds::<CrashReport>(offset);
4376 let max_ordinal: u64 = self.max_ordinal_present();
4378 encoder.write_num(max_ordinal, offset);
4379 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4380 if max_ordinal == 0 {
4382 return Ok(());
4383 }
4384 depth.increment()?;
4385 let envelope_size = 8;
4386 let bytes_len = max_ordinal as usize * envelope_size;
4387 #[allow(unused_variables)]
4388 let offset = encoder.out_of_line_offset(bytes_len);
4389 let mut _prev_end_offset: usize = 0;
4390 if 1 > max_ordinal {
4391 return Ok(());
4392 }
4393
4394 let cur_offset: usize = (1 - 1) * envelope_size;
4397
4398 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4400
4401 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4406 self.program_name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
4407 encoder, offset + cur_offset, depth
4408 )?;
4409
4410 _prev_end_offset = cur_offset + envelope_size;
4411 if 2 > max_ordinal {
4412 return Ok(());
4413 }
4414
4415 let cur_offset: usize = (2 - 1) * envelope_size;
4418
4419 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4421
4422 fidl::encoding::encode_in_envelope_optional::<
4427 SpecificCrashReport,
4428 fidl::encoding::DefaultFuchsiaResourceDialect,
4429 >(
4430 self.specific_report.as_mut().map(
4431 <SpecificCrashReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
4432 ),
4433 encoder,
4434 offset + cur_offset,
4435 depth,
4436 )?;
4437
4438 _prev_end_offset = cur_offset + envelope_size;
4439 if 3 > max_ordinal {
4440 return Ok(());
4441 }
4442
4443 let cur_offset: usize = (3 - 1) * envelope_size;
4446
4447 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4449
4450 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4455 self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 32> as fidl::encoding::ValueTypeMarker>::borrow),
4456 encoder, offset + cur_offset, depth
4457 )?;
4458
4459 _prev_end_offset = cur_offset + envelope_size;
4460 if 4 > max_ordinal {
4461 return Ok(());
4462 }
4463
4464 let cur_offset: usize = (4 - 1) * envelope_size;
4467
4468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4470
4471 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Attachment, 16>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4476 self.attachments.as_mut().map(<fidl::encoding::Vector<Attachment, 16> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4477 encoder, offset + cur_offset, depth
4478 )?;
4479
4480 _prev_end_offset = cur_offset + envelope_size;
4481 if 5 > max_ordinal {
4482 return Ok(());
4483 }
4484
4485 let cur_offset: usize = (5 - 1) * envelope_size;
4488
4489 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4491
4492 fidl::encoding::encode_in_envelope_optional::<
4497 fidl::encoding::BoundedString<128>,
4498 fidl::encoding::DefaultFuchsiaResourceDialect,
4499 >(
4500 self.event_id.as_ref().map(
4501 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
4502 ),
4503 encoder,
4504 offset + cur_offset,
4505 depth,
4506 )?;
4507
4508 _prev_end_offset = cur_offset + envelope_size;
4509 if 6 > max_ordinal {
4510 return Ok(());
4511 }
4512
4513 let cur_offset: usize = (6 - 1) * envelope_size;
4516
4517 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4519
4520 fidl::encoding::encode_in_envelope_optional::<
4525 i64,
4526 fidl::encoding::DefaultFuchsiaResourceDialect,
4527 >(
4528 self.program_uptime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
4529 encoder,
4530 offset + cur_offset,
4531 depth,
4532 )?;
4533
4534 _prev_end_offset = cur_offset + envelope_size;
4535 if 7 > max_ordinal {
4536 return Ok(());
4537 }
4538
4539 let cur_offset: usize = (7 - 1) * envelope_size;
4542
4543 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4545
4546 fidl::encoding::encode_in_envelope_optional::<
4551 fidl::encoding::BoundedString<128>,
4552 fidl::encoding::DefaultFuchsiaResourceDialect,
4553 >(
4554 self.crash_signature.as_ref().map(
4555 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
4556 ),
4557 encoder,
4558 offset + cur_offset,
4559 depth,
4560 )?;
4561
4562 _prev_end_offset = cur_offset + envelope_size;
4563 if 8 > max_ordinal {
4564 return Ok(());
4565 }
4566
4567 let cur_offset: usize = (8 - 1) * envelope_size;
4570
4571 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4573
4574 fidl::encoding::encode_in_envelope_optional::<
4579 bool,
4580 fidl::encoding::DefaultFuchsiaResourceDialect,
4581 >(
4582 self.is_fatal.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4583 encoder,
4584 offset + cur_offset,
4585 depth,
4586 )?;
4587
4588 _prev_end_offset = cur_offset + envelope_size;
4589
4590 Ok(())
4591 }
4592 }
4593
4594 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for CrashReport {
4595 #[inline(always)]
4596 fn new_empty() -> Self {
4597 Self::default()
4598 }
4599
4600 unsafe fn decode(
4601 &mut self,
4602 decoder: &mut fidl::encoding::Decoder<
4603 '_,
4604 fidl::encoding::DefaultFuchsiaResourceDialect,
4605 >,
4606 offset: usize,
4607 mut depth: fidl::encoding::Depth,
4608 ) -> fidl::Result<()> {
4609 decoder.debug_check_bounds::<Self>(offset);
4610 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4611 None => return Err(fidl::Error::NotNullable),
4612 Some(len) => len,
4613 };
4614 if len == 0 {
4616 return Ok(());
4617 };
4618 depth.increment()?;
4619 let envelope_size = 8;
4620 let bytes_len = len * envelope_size;
4621 let offset = decoder.out_of_line_offset(bytes_len)?;
4622 let mut _next_ordinal_to_read = 0;
4624 let mut next_offset = offset;
4625 let end_offset = offset + bytes_len;
4626 _next_ordinal_to_read += 1;
4627 if next_offset >= end_offset {
4628 return Ok(());
4629 }
4630
4631 while _next_ordinal_to_read < 1 {
4633 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4634 _next_ordinal_to_read += 1;
4635 next_offset += envelope_size;
4636 }
4637
4638 let next_out_of_line = decoder.next_out_of_line();
4639 let handles_before = decoder.remaining_handles();
4640 if let Some((inlined, num_bytes, num_handles)) =
4641 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4642 {
4643 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4644 if inlined != (member_inline_size <= 4) {
4645 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4646 }
4647 let inner_offset;
4648 let mut inner_depth = depth.clone();
4649 if inlined {
4650 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4651 inner_offset = next_offset;
4652 } else {
4653 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4654 inner_depth.increment()?;
4655 }
4656 let val_ref = self.program_name.get_or_insert_with(|| {
4657 fidl::new_empty!(
4658 fidl::encoding::BoundedString<1024>,
4659 fidl::encoding::DefaultFuchsiaResourceDialect
4660 )
4661 });
4662 fidl::decode!(
4663 fidl::encoding::BoundedString<1024>,
4664 fidl::encoding::DefaultFuchsiaResourceDialect,
4665 val_ref,
4666 decoder,
4667 inner_offset,
4668 inner_depth
4669 )?;
4670 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4671 {
4672 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4673 }
4674 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4675 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4676 }
4677 }
4678
4679 next_offset += envelope_size;
4680 _next_ordinal_to_read += 1;
4681 if next_offset >= end_offset {
4682 return Ok(());
4683 }
4684
4685 while _next_ordinal_to_read < 2 {
4687 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4688 _next_ordinal_to_read += 1;
4689 next_offset += envelope_size;
4690 }
4691
4692 let next_out_of_line = decoder.next_out_of_line();
4693 let handles_before = decoder.remaining_handles();
4694 if let Some((inlined, num_bytes, num_handles)) =
4695 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4696 {
4697 let member_inline_size =
4698 <SpecificCrashReport as fidl::encoding::TypeMarker>::inline_size(
4699 decoder.context,
4700 );
4701 if inlined != (member_inline_size <= 4) {
4702 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4703 }
4704 let inner_offset;
4705 let mut inner_depth = depth.clone();
4706 if inlined {
4707 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4708 inner_offset = next_offset;
4709 } else {
4710 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4711 inner_depth.increment()?;
4712 }
4713 let val_ref = self.specific_report.get_or_insert_with(|| {
4714 fidl::new_empty!(
4715 SpecificCrashReport,
4716 fidl::encoding::DefaultFuchsiaResourceDialect
4717 )
4718 });
4719 fidl::decode!(
4720 SpecificCrashReport,
4721 fidl::encoding::DefaultFuchsiaResourceDialect,
4722 val_ref,
4723 decoder,
4724 inner_offset,
4725 inner_depth
4726 )?;
4727 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4728 {
4729 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4730 }
4731 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4732 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4733 }
4734 }
4735
4736 next_offset += envelope_size;
4737 _next_ordinal_to_read += 1;
4738 if next_offset >= end_offset {
4739 return Ok(());
4740 }
4741
4742 while _next_ordinal_to_read < 3 {
4744 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4745 _next_ordinal_to_read += 1;
4746 next_offset += envelope_size;
4747 }
4748
4749 let next_out_of_line = decoder.next_out_of_line();
4750 let handles_before = decoder.remaining_handles();
4751 if let Some((inlined, num_bytes, num_handles)) =
4752 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4753 {
4754 let member_inline_size = <fidl::encoding::Vector<Annotation, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4755 if inlined != (member_inline_size <= 4) {
4756 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4757 }
4758 let inner_offset;
4759 let mut inner_depth = depth.clone();
4760 if inlined {
4761 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4762 inner_offset = next_offset;
4763 } else {
4764 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4765 inner_depth.increment()?;
4766 }
4767 let val_ref =
4768 self.annotations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Annotation, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
4769 fidl::decode!(fidl::encoding::Vector<Annotation, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4770 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4771 {
4772 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4773 }
4774 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4775 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4776 }
4777 }
4778
4779 next_offset += envelope_size;
4780 _next_ordinal_to_read += 1;
4781 if next_offset >= end_offset {
4782 return Ok(());
4783 }
4784
4785 while _next_ordinal_to_read < 4 {
4787 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4788 _next_ordinal_to_read += 1;
4789 next_offset += envelope_size;
4790 }
4791
4792 let next_out_of_line = decoder.next_out_of_line();
4793 let handles_before = decoder.remaining_handles();
4794 if let Some((inlined, num_bytes, num_handles)) =
4795 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4796 {
4797 let member_inline_size = <fidl::encoding::Vector<Attachment, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4798 if inlined != (member_inline_size <= 4) {
4799 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4800 }
4801 let inner_offset;
4802 let mut inner_depth = depth.clone();
4803 if inlined {
4804 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4805 inner_offset = next_offset;
4806 } else {
4807 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4808 inner_depth.increment()?;
4809 }
4810 let val_ref =
4811 self.attachments.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Attachment, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
4812 fidl::decode!(fidl::encoding::Vector<Attachment, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4813 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4814 {
4815 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4816 }
4817 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4818 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4819 }
4820 }
4821
4822 next_offset += envelope_size;
4823 _next_ordinal_to_read += 1;
4824 if next_offset >= end_offset {
4825 return Ok(());
4826 }
4827
4828 while _next_ordinal_to_read < 5 {
4830 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4831 _next_ordinal_to_read += 1;
4832 next_offset += envelope_size;
4833 }
4834
4835 let next_out_of_line = decoder.next_out_of_line();
4836 let handles_before = decoder.remaining_handles();
4837 if let Some((inlined, num_bytes, num_handles)) =
4838 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4839 {
4840 let member_inline_size =
4841 <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
4842 decoder.context,
4843 );
4844 if inlined != (member_inline_size <= 4) {
4845 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4846 }
4847 let inner_offset;
4848 let mut inner_depth = depth.clone();
4849 if inlined {
4850 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4851 inner_offset = next_offset;
4852 } else {
4853 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4854 inner_depth.increment()?;
4855 }
4856 let val_ref = self.event_id.get_or_insert_with(|| {
4857 fidl::new_empty!(
4858 fidl::encoding::BoundedString<128>,
4859 fidl::encoding::DefaultFuchsiaResourceDialect
4860 )
4861 });
4862 fidl::decode!(
4863 fidl::encoding::BoundedString<128>,
4864 fidl::encoding::DefaultFuchsiaResourceDialect,
4865 val_ref,
4866 decoder,
4867 inner_offset,
4868 inner_depth
4869 )?;
4870 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4871 {
4872 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4873 }
4874 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4875 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4876 }
4877 }
4878
4879 next_offset += envelope_size;
4880 _next_ordinal_to_read += 1;
4881 if next_offset >= end_offset {
4882 return Ok(());
4883 }
4884
4885 while _next_ordinal_to_read < 6 {
4887 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4888 _next_ordinal_to_read += 1;
4889 next_offset += envelope_size;
4890 }
4891
4892 let next_out_of_line = decoder.next_out_of_line();
4893 let handles_before = decoder.remaining_handles();
4894 if let Some((inlined, num_bytes, num_handles)) =
4895 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4896 {
4897 let member_inline_size =
4898 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4899 if inlined != (member_inline_size <= 4) {
4900 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4901 }
4902 let inner_offset;
4903 let mut inner_depth = depth.clone();
4904 if inlined {
4905 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4906 inner_offset = next_offset;
4907 } else {
4908 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4909 inner_depth.increment()?;
4910 }
4911 let val_ref = self.program_uptime.get_or_insert_with(|| {
4912 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
4913 });
4914 fidl::decode!(
4915 i64,
4916 fidl::encoding::DefaultFuchsiaResourceDialect,
4917 val_ref,
4918 decoder,
4919 inner_offset,
4920 inner_depth
4921 )?;
4922 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4923 {
4924 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4925 }
4926 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4927 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4928 }
4929 }
4930
4931 next_offset += envelope_size;
4932 _next_ordinal_to_read += 1;
4933 if next_offset >= end_offset {
4934 return Ok(());
4935 }
4936
4937 while _next_ordinal_to_read < 7 {
4939 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4940 _next_ordinal_to_read += 1;
4941 next_offset += envelope_size;
4942 }
4943
4944 let next_out_of_line = decoder.next_out_of_line();
4945 let handles_before = decoder.remaining_handles();
4946 if let Some((inlined, num_bytes, num_handles)) =
4947 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4948 {
4949 let member_inline_size =
4950 <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
4951 decoder.context,
4952 );
4953 if inlined != (member_inline_size <= 4) {
4954 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4955 }
4956 let inner_offset;
4957 let mut inner_depth = depth.clone();
4958 if inlined {
4959 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4960 inner_offset = next_offset;
4961 } else {
4962 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4963 inner_depth.increment()?;
4964 }
4965 let val_ref = self.crash_signature.get_or_insert_with(|| {
4966 fidl::new_empty!(
4967 fidl::encoding::BoundedString<128>,
4968 fidl::encoding::DefaultFuchsiaResourceDialect
4969 )
4970 });
4971 fidl::decode!(
4972 fidl::encoding::BoundedString<128>,
4973 fidl::encoding::DefaultFuchsiaResourceDialect,
4974 val_ref,
4975 decoder,
4976 inner_offset,
4977 inner_depth
4978 )?;
4979 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4980 {
4981 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4982 }
4983 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4984 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4985 }
4986 }
4987
4988 next_offset += envelope_size;
4989 _next_ordinal_to_read += 1;
4990 if next_offset >= end_offset {
4991 return Ok(());
4992 }
4993
4994 while _next_ordinal_to_read < 8 {
4996 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4997 _next_ordinal_to_read += 1;
4998 next_offset += envelope_size;
4999 }
5000
5001 let next_out_of_line = decoder.next_out_of_line();
5002 let handles_before = decoder.remaining_handles();
5003 if let Some((inlined, num_bytes, num_handles)) =
5004 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5005 {
5006 let member_inline_size =
5007 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5008 if inlined != (member_inline_size <= 4) {
5009 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5010 }
5011 let inner_offset;
5012 let mut inner_depth = depth.clone();
5013 if inlined {
5014 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5015 inner_offset = next_offset;
5016 } else {
5017 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5018 inner_depth.increment()?;
5019 }
5020 let val_ref = self.is_fatal.get_or_insert_with(|| {
5021 fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
5022 });
5023 fidl::decode!(
5024 bool,
5025 fidl::encoding::DefaultFuchsiaResourceDialect,
5026 val_ref,
5027 decoder,
5028 inner_offset,
5029 inner_depth
5030 )?;
5031 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5032 {
5033 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5034 }
5035 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5036 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5037 }
5038 }
5039
5040 next_offset += envelope_size;
5041
5042 while next_offset < end_offset {
5044 _next_ordinal_to_read += 1;
5045 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5046 next_offset += envelope_size;
5047 }
5048
5049 Ok(())
5050 }
5051 }
5052
5053 impl GetSnapshotParameters {
5054 #[inline(always)]
5055 fn max_ordinal_present(&self) -> u64 {
5056 if let Some(_) = self.response_channel {
5057 return 2;
5058 }
5059 if let Some(_) = self.collection_timeout_per_data {
5060 return 1;
5061 }
5062 0
5063 }
5064 }
5065
5066 impl fidl::encoding::ResourceTypeMarker for GetSnapshotParameters {
5067 type Borrowed<'a> = &'a mut Self;
5068 fn take_or_borrow<'a>(
5069 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5070 ) -> Self::Borrowed<'a> {
5071 value
5072 }
5073 }
5074
5075 unsafe impl fidl::encoding::TypeMarker for GetSnapshotParameters {
5076 type Owned = Self;
5077
5078 #[inline(always)]
5079 fn inline_align(_context: fidl::encoding::Context) -> usize {
5080 8
5081 }
5082
5083 #[inline(always)]
5084 fn inline_size(_context: fidl::encoding::Context) -> usize {
5085 16
5086 }
5087 }
5088
5089 unsafe impl
5090 fidl::encoding::Encode<GetSnapshotParameters, fidl::encoding::DefaultFuchsiaResourceDialect>
5091 for &mut GetSnapshotParameters
5092 {
5093 unsafe fn encode(
5094 self,
5095 encoder: &mut fidl::encoding::Encoder<
5096 '_,
5097 fidl::encoding::DefaultFuchsiaResourceDialect,
5098 >,
5099 offset: usize,
5100 mut depth: fidl::encoding::Depth,
5101 ) -> fidl::Result<()> {
5102 encoder.debug_check_bounds::<GetSnapshotParameters>(offset);
5103 let max_ordinal: u64 = self.max_ordinal_present();
5105 encoder.write_num(max_ordinal, offset);
5106 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5107 if max_ordinal == 0 {
5109 return Ok(());
5110 }
5111 depth.increment()?;
5112 let envelope_size = 8;
5113 let bytes_len = max_ordinal as usize * envelope_size;
5114 #[allow(unused_variables)]
5115 let offset = encoder.out_of_line_offset(bytes_len);
5116 let mut _prev_end_offset: usize = 0;
5117 if 1 > max_ordinal {
5118 return Ok(());
5119 }
5120
5121 let cur_offset: usize = (1 - 1) * envelope_size;
5124
5125 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5127
5128 fidl::encoding::encode_in_envelope_optional::<
5133 i64,
5134 fidl::encoding::DefaultFuchsiaResourceDialect,
5135 >(
5136 self.collection_timeout_per_data
5137 .as_ref()
5138 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5139 encoder,
5140 offset + cur_offset,
5141 depth,
5142 )?;
5143
5144 _prev_end_offset = cur_offset + envelope_size;
5145 if 2 > max_ordinal {
5146 return Ok(());
5147 }
5148
5149 let cur_offset: usize = (2 - 1) * envelope_size;
5152
5153 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5155
5156 fidl::encoding::encode_in_envelope_optional::<
5161 fidl::encoding::HandleType<
5162 fidl::Channel,
5163 { fidl::ObjectType::CHANNEL.into_raw() },
5164 2147483648,
5165 >,
5166 fidl::encoding::DefaultFuchsiaResourceDialect,
5167 >(
5168 self.response_channel.as_mut().map(
5169 <fidl::encoding::HandleType<
5170 fidl::Channel,
5171 { fidl::ObjectType::CHANNEL.into_raw() },
5172 2147483648,
5173 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5174 ),
5175 encoder,
5176 offset + cur_offset,
5177 depth,
5178 )?;
5179
5180 _prev_end_offset = cur_offset + envelope_size;
5181
5182 Ok(())
5183 }
5184 }
5185
5186 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5187 for GetSnapshotParameters
5188 {
5189 #[inline(always)]
5190 fn new_empty() -> Self {
5191 Self::default()
5192 }
5193
5194 unsafe fn decode(
5195 &mut self,
5196 decoder: &mut fidl::encoding::Decoder<
5197 '_,
5198 fidl::encoding::DefaultFuchsiaResourceDialect,
5199 >,
5200 offset: usize,
5201 mut depth: fidl::encoding::Depth,
5202 ) -> fidl::Result<()> {
5203 decoder.debug_check_bounds::<Self>(offset);
5204 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5205 None => return Err(fidl::Error::NotNullable),
5206 Some(len) => len,
5207 };
5208 if len == 0 {
5210 return Ok(());
5211 };
5212 depth.increment()?;
5213 let envelope_size = 8;
5214 let bytes_len = len * envelope_size;
5215 let offset = decoder.out_of_line_offset(bytes_len)?;
5216 let mut _next_ordinal_to_read = 0;
5218 let mut next_offset = offset;
5219 let end_offset = offset + bytes_len;
5220 _next_ordinal_to_read += 1;
5221 if next_offset >= end_offset {
5222 return Ok(());
5223 }
5224
5225 while _next_ordinal_to_read < 1 {
5227 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5228 _next_ordinal_to_read += 1;
5229 next_offset += envelope_size;
5230 }
5231
5232 let next_out_of_line = decoder.next_out_of_line();
5233 let handles_before = decoder.remaining_handles();
5234 if let Some((inlined, num_bytes, num_handles)) =
5235 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5236 {
5237 let member_inline_size =
5238 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5239 if inlined != (member_inline_size <= 4) {
5240 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5241 }
5242 let inner_offset;
5243 let mut inner_depth = depth.clone();
5244 if inlined {
5245 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5246 inner_offset = next_offset;
5247 } else {
5248 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5249 inner_depth.increment()?;
5250 }
5251 let val_ref = self.collection_timeout_per_data.get_or_insert_with(|| {
5252 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
5253 });
5254 fidl::decode!(
5255 i64,
5256 fidl::encoding::DefaultFuchsiaResourceDialect,
5257 val_ref,
5258 decoder,
5259 inner_offset,
5260 inner_depth
5261 )?;
5262 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5263 {
5264 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5265 }
5266 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5267 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5268 }
5269 }
5270
5271 next_offset += envelope_size;
5272 _next_ordinal_to_read += 1;
5273 if next_offset >= end_offset {
5274 return Ok(());
5275 }
5276
5277 while _next_ordinal_to_read < 2 {
5279 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5280 _next_ordinal_to_read += 1;
5281 next_offset += envelope_size;
5282 }
5283
5284 let next_out_of_line = decoder.next_out_of_line();
5285 let handles_before = decoder.remaining_handles();
5286 if let Some((inlined, num_bytes, num_handles)) =
5287 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5288 {
5289 let member_inline_size = <fidl::encoding::HandleType<
5290 fidl::Channel,
5291 { fidl::ObjectType::CHANNEL.into_raw() },
5292 2147483648,
5293 > as fidl::encoding::TypeMarker>::inline_size(
5294 decoder.context
5295 );
5296 if inlined != (member_inline_size <= 4) {
5297 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5298 }
5299 let inner_offset;
5300 let mut inner_depth = depth.clone();
5301 if inlined {
5302 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5303 inner_offset = next_offset;
5304 } else {
5305 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5306 inner_depth.increment()?;
5307 }
5308 let val_ref =
5309 self.response_channel.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
5310 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
5311 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5312 {
5313 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5314 }
5315 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5316 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5317 }
5318 }
5319
5320 next_offset += envelope_size;
5321
5322 while next_offset < end_offset {
5324 _next_ordinal_to_read += 1;
5325 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5326 next_offset += envelope_size;
5327 }
5328
5329 Ok(())
5330 }
5331 }
5332
5333 impl NativeCrashReport {
5334 #[inline(always)]
5335 fn max_ordinal_present(&self) -> u64 {
5336 if let Some(_) = self.thread_koid {
5337 return 5;
5338 }
5339 if let Some(_) = self.thread_name {
5340 return 4;
5341 }
5342 if let Some(_) = self.process_koid {
5343 return 3;
5344 }
5345 if let Some(_) = self.process_name {
5346 return 2;
5347 }
5348 if let Some(_) = self.minidump {
5349 return 1;
5350 }
5351 0
5352 }
5353 }
5354
5355 impl fidl::encoding::ResourceTypeMarker for NativeCrashReport {
5356 type Borrowed<'a> = &'a mut Self;
5357 fn take_or_borrow<'a>(
5358 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5359 ) -> Self::Borrowed<'a> {
5360 value
5361 }
5362 }
5363
5364 unsafe impl fidl::encoding::TypeMarker for NativeCrashReport {
5365 type Owned = Self;
5366
5367 #[inline(always)]
5368 fn inline_align(_context: fidl::encoding::Context) -> usize {
5369 8
5370 }
5371
5372 #[inline(always)]
5373 fn inline_size(_context: fidl::encoding::Context) -> usize {
5374 16
5375 }
5376 }
5377
5378 unsafe impl
5379 fidl::encoding::Encode<NativeCrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>
5380 for &mut NativeCrashReport
5381 {
5382 unsafe fn encode(
5383 self,
5384 encoder: &mut fidl::encoding::Encoder<
5385 '_,
5386 fidl::encoding::DefaultFuchsiaResourceDialect,
5387 >,
5388 offset: usize,
5389 mut depth: fidl::encoding::Depth,
5390 ) -> fidl::Result<()> {
5391 encoder.debug_check_bounds::<NativeCrashReport>(offset);
5392 let max_ordinal: u64 = self.max_ordinal_present();
5394 encoder.write_num(max_ordinal, offset);
5395 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5396 if max_ordinal == 0 {
5398 return Ok(());
5399 }
5400 depth.increment()?;
5401 let envelope_size = 8;
5402 let bytes_len = max_ordinal as usize * envelope_size;
5403 #[allow(unused_variables)]
5404 let offset = encoder.out_of_line_offset(bytes_len);
5405 let mut _prev_end_offset: usize = 0;
5406 if 1 > max_ordinal {
5407 return Ok(());
5408 }
5409
5410 let cur_offset: usize = (1 - 1) * envelope_size;
5413
5414 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5416
5417 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
5422 self.minidump.as_mut().map(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5423 encoder, offset + cur_offset, depth
5424 )?;
5425
5426 _prev_end_offset = cur_offset + envelope_size;
5427 if 2 > max_ordinal {
5428 return Ok(());
5429 }
5430
5431 let cur_offset: usize = (2 - 1) * envelope_size;
5434
5435 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5437
5438 fidl::encoding::encode_in_envelope_optional::<
5443 fidl::encoding::BoundedString<64>,
5444 fidl::encoding::DefaultFuchsiaResourceDialect,
5445 >(
5446 self.process_name.as_ref().map(
5447 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
5448 ),
5449 encoder,
5450 offset + cur_offset,
5451 depth,
5452 )?;
5453
5454 _prev_end_offset = cur_offset + envelope_size;
5455 if 3 > max_ordinal {
5456 return Ok(());
5457 }
5458
5459 let cur_offset: usize = (3 - 1) * envelope_size;
5462
5463 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5465
5466 fidl::encoding::encode_in_envelope_optional::<
5471 u64,
5472 fidl::encoding::DefaultFuchsiaResourceDialect,
5473 >(
5474 self.process_koid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5475 encoder,
5476 offset + cur_offset,
5477 depth,
5478 )?;
5479
5480 _prev_end_offset = cur_offset + envelope_size;
5481 if 4 > max_ordinal {
5482 return Ok(());
5483 }
5484
5485 let cur_offset: usize = (4 - 1) * envelope_size;
5488
5489 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5491
5492 fidl::encoding::encode_in_envelope_optional::<
5497 fidl::encoding::BoundedString<64>,
5498 fidl::encoding::DefaultFuchsiaResourceDialect,
5499 >(
5500 self.thread_name.as_ref().map(
5501 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
5502 ),
5503 encoder,
5504 offset + cur_offset,
5505 depth,
5506 )?;
5507
5508 _prev_end_offset = cur_offset + envelope_size;
5509 if 5 > max_ordinal {
5510 return Ok(());
5511 }
5512
5513 let cur_offset: usize = (5 - 1) * envelope_size;
5516
5517 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5519
5520 fidl::encoding::encode_in_envelope_optional::<
5525 u64,
5526 fidl::encoding::DefaultFuchsiaResourceDialect,
5527 >(
5528 self.thread_koid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5529 encoder,
5530 offset + cur_offset,
5531 depth,
5532 )?;
5533
5534 _prev_end_offset = cur_offset + envelope_size;
5535
5536 Ok(())
5537 }
5538 }
5539
5540 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5541 for NativeCrashReport
5542 {
5543 #[inline(always)]
5544 fn new_empty() -> Self {
5545 Self::default()
5546 }
5547
5548 unsafe fn decode(
5549 &mut self,
5550 decoder: &mut fidl::encoding::Decoder<
5551 '_,
5552 fidl::encoding::DefaultFuchsiaResourceDialect,
5553 >,
5554 offset: usize,
5555 mut depth: fidl::encoding::Depth,
5556 ) -> fidl::Result<()> {
5557 decoder.debug_check_bounds::<Self>(offset);
5558 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5559 None => return Err(fidl::Error::NotNullable),
5560 Some(len) => len,
5561 };
5562 if len == 0 {
5564 return Ok(());
5565 };
5566 depth.increment()?;
5567 let envelope_size = 8;
5568 let bytes_len = len * envelope_size;
5569 let offset = decoder.out_of_line_offset(bytes_len)?;
5570 let mut _next_ordinal_to_read = 0;
5572 let mut next_offset = offset;
5573 let end_offset = offset + bytes_len;
5574 _next_ordinal_to_read += 1;
5575 if next_offset >= end_offset {
5576 return Ok(());
5577 }
5578
5579 while _next_ordinal_to_read < 1 {
5581 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5582 _next_ordinal_to_read += 1;
5583 next_offset += envelope_size;
5584 }
5585
5586 let next_out_of_line = decoder.next_out_of_line();
5587 let handles_before = decoder.remaining_handles();
5588 if let Some((inlined, num_bytes, num_handles)) =
5589 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5590 {
5591 let member_inline_size =
5592 <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
5593 decoder.context,
5594 );
5595 if inlined != (member_inline_size <= 4) {
5596 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5597 }
5598 let inner_offset;
5599 let mut inner_depth = depth.clone();
5600 if inlined {
5601 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5602 inner_offset = next_offset;
5603 } else {
5604 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5605 inner_depth.increment()?;
5606 }
5607 let val_ref = self.minidump.get_or_insert_with(|| {
5608 fidl::new_empty!(
5609 fidl_fuchsia_mem::Buffer,
5610 fidl::encoding::DefaultFuchsiaResourceDialect
5611 )
5612 });
5613 fidl::decode!(
5614 fidl_fuchsia_mem::Buffer,
5615 fidl::encoding::DefaultFuchsiaResourceDialect,
5616 val_ref,
5617 decoder,
5618 inner_offset,
5619 inner_depth
5620 )?;
5621 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5622 {
5623 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5624 }
5625 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5626 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5627 }
5628 }
5629
5630 next_offset += envelope_size;
5631 _next_ordinal_to_read += 1;
5632 if next_offset >= end_offset {
5633 return Ok(());
5634 }
5635
5636 while _next_ordinal_to_read < 2 {
5638 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5639 _next_ordinal_to_read += 1;
5640 next_offset += envelope_size;
5641 }
5642
5643 let next_out_of_line = decoder.next_out_of_line();
5644 let handles_before = decoder.remaining_handles();
5645 if let Some((inlined, num_bytes, num_handles)) =
5646 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5647 {
5648 let member_inline_size =
5649 <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
5650 decoder.context,
5651 );
5652 if inlined != (member_inline_size <= 4) {
5653 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5654 }
5655 let inner_offset;
5656 let mut inner_depth = depth.clone();
5657 if inlined {
5658 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5659 inner_offset = next_offset;
5660 } else {
5661 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5662 inner_depth.increment()?;
5663 }
5664 let val_ref = self.process_name.get_or_insert_with(|| {
5665 fidl::new_empty!(
5666 fidl::encoding::BoundedString<64>,
5667 fidl::encoding::DefaultFuchsiaResourceDialect
5668 )
5669 });
5670 fidl::decode!(
5671 fidl::encoding::BoundedString<64>,
5672 fidl::encoding::DefaultFuchsiaResourceDialect,
5673 val_ref,
5674 decoder,
5675 inner_offset,
5676 inner_depth
5677 )?;
5678 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5679 {
5680 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5681 }
5682 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5683 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5684 }
5685 }
5686
5687 next_offset += envelope_size;
5688 _next_ordinal_to_read += 1;
5689 if next_offset >= end_offset {
5690 return Ok(());
5691 }
5692
5693 while _next_ordinal_to_read < 3 {
5695 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5696 _next_ordinal_to_read += 1;
5697 next_offset += envelope_size;
5698 }
5699
5700 let next_out_of_line = decoder.next_out_of_line();
5701 let handles_before = decoder.remaining_handles();
5702 if let Some((inlined, num_bytes, num_handles)) =
5703 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5704 {
5705 let member_inline_size =
5706 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5707 if inlined != (member_inline_size <= 4) {
5708 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5709 }
5710 let inner_offset;
5711 let mut inner_depth = depth.clone();
5712 if inlined {
5713 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5714 inner_offset = next_offset;
5715 } else {
5716 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5717 inner_depth.increment()?;
5718 }
5719 let val_ref = self.process_koid.get_or_insert_with(|| {
5720 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
5721 });
5722 fidl::decode!(
5723 u64,
5724 fidl::encoding::DefaultFuchsiaResourceDialect,
5725 val_ref,
5726 decoder,
5727 inner_offset,
5728 inner_depth
5729 )?;
5730 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5731 {
5732 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5733 }
5734 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5735 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5736 }
5737 }
5738
5739 next_offset += envelope_size;
5740 _next_ordinal_to_read += 1;
5741 if next_offset >= end_offset {
5742 return Ok(());
5743 }
5744
5745 while _next_ordinal_to_read < 4 {
5747 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5748 _next_ordinal_to_read += 1;
5749 next_offset += envelope_size;
5750 }
5751
5752 let next_out_of_line = decoder.next_out_of_line();
5753 let handles_before = decoder.remaining_handles();
5754 if let Some((inlined, num_bytes, num_handles)) =
5755 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5756 {
5757 let member_inline_size =
5758 <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
5759 decoder.context,
5760 );
5761 if inlined != (member_inline_size <= 4) {
5762 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5763 }
5764 let inner_offset;
5765 let mut inner_depth = depth.clone();
5766 if inlined {
5767 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5768 inner_offset = next_offset;
5769 } else {
5770 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5771 inner_depth.increment()?;
5772 }
5773 let val_ref = self.thread_name.get_or_insert_with(|| {
5774 fidl::new_empty!(
5775 fidl::encoding::BoundedString<64>,
5776 fidl::encoding::DefaultFuchsiaResourceDialect
5777 )
5778 });
5779 fidl::decode!(
5780 fidl::encoding::BoundedString<64>,
5781 fidl::encoding::DefaultFuchsiaResourceDialect,
5782 val_ref,
5783 decoder,
5784 inner_offset,
5785 inner_depth
5786 )?;
5787 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5788 {
5789 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5790 }
5791 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5792 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5793 }
5794 }
5795
5796 next_offset += envelope_size;
5797 _next_ordinal_to_read += 1;
5798 if next_offset >= end_offset {
5799 return Ok(());
5800 }
5801
5802 while _next_ordinal_to_read < 5 {
5804 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5805 _next_ordinal_to_read += 1;
5806 next_offset += envelope_size;
5807 }
5808
5809 let next_out_of_line = decoder.next_out_of_line();
5810 let handles_before = decoder.remaining_handles();
5811 if let Some((inlined, num_bytes, num_handles)) =
5812 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5813 {
5814 let member_inline_size =
5815 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5816 if inlined != (member_inline_size <= 4) {
5817 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5818 }
5819 let inner_offset;
5820 let mut inner_depth = depth.clone();
5821 if inlined {
5822 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5823 inner_offset = next_offset;
5824 } else {
5825 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5826 inner_depth.increment()?;
5827 }
5828 let val_ref = self.thread_koid.get_or_insert_with(|| {
5829 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
5830 });
5831 fidl::decode!(
5832 u64,
5833 fidl::encoding::DefaultFuchsiaResourceDialect,
5834 val_ref,
5835 decoder,
5836 inner_offset,
5837 inner_depth
5838 )?;
5839 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5840 {
5841 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5842 }
5843 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5844 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5845 }
5846 }
5847
5848 next_offset += envelope_size;
5849
5850 while next_offset < end_offset {
5852 _next_ordinal_to_read += 1;
5853 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5854 next_offset += envelope_size;
5855 }
5856
5857 Ok(())
5858 }
5859 }
5860
5861 impl RuntimeCrashReport {
5862 #[inline(always)]
5863 fn max_ordinal_present(&self) -> u64 {
5864 if let Some(_) = self.exception_stack_trace {
5865 return 3;
5866 }
5867 if let Some(_) = self.exception_message {
5868 return 2;
5869 }
5870 if let Some(_) = self.exception_type {
5871 return 1;
5872 }
5873 0
5874 }
5875 }
5876
5877 impl fidl::encoding::ResourceTypeMarker for RuntimeCrashReport {
5878 type Borrowed<'a> = &'a mut Self;
5879 fn take_or_borrow<'a>(
5880 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5881 ) -> Self::Borrowed<'a> {
5882 value
5883 }
5884 }
5885
5886 unsafe impl fidl::encoding::TypeMarker for RuntimeCrashReport {
5887 type Owned = Self;
5888
5889 #[inline(always)]
5890 fn inline_align(_context: fidl::encoding::Context) -> usize {
5891 8
5892 }
5893
5894 #[inline(always)]
5895 fn inline_size(_context: fidl::encoding::Context) -> usize {
5896 16
5897 }
5898 }
5899
5900 unsafe impl
5901 fidl::encoding::Encode<RuntimeCrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>
5902 for &mut RuntimeCrashReport
5903 {
5904 unsafe fn encode(
5905 self,
5906 encoder: &mut fidl::encoding::Encoder<
5907 '_,
5908 fidl::encoding::DefaultFuchsiaResourceDialect,
5909 >,
5910 offset: usize,
5911 mut depth: fidl::encoding::Depth,
5912 ) -> fidl::Result<()> {
5913 encoder.debug_check_bounds::<RuntimeCrashReport>(offset);
5914 let max_ordinal: u64 = self.max_ordinal_present();
5916 encoder.write_num(max_ordinal, offset);
5917 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5918 if max_ordinal == 0 {
5920 return Ok(());
5921 }
5922 depth.increment()?;
5923 let envelope_size = 8;
5924 let bytes_len = max_ordinal as usize * envelope_size;
5925 #[allow(unused_variables)]
5926 let offset = encoder.out_of_line_offset(bytes_len);
5927 let mut _prev_end_offset: usize = 0;
5928 if 1 > max_ordinal {
5929 return Ok(());
5930 }
5931
5932 let cur_offset: usize = (1 - 1) * envelope_size;
5935
5936 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5938
5939 fidl::encoding::encode_in_envelope_optional::<
5944 fidl::encoding::BoundedString<128>,
5945 fidl::encoding::DefaultFuchsiaResourceDialect,
5946 >(
5947 self.exception_type.as_ref().map(
5948 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
5949 ),
5950 encoder,
5951 offset + cur_offset,
5952 depth,
5953 )?;
5954
5955 _prev_end_offset = cur_offset + envelope_size;
5956 if 2 > max_ordinal {
5957 return Ok(());
5958 }
5959
5960 let cur_offset: usize = (2 - 1) * envelope_size;
5963
5964 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5966
5967 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5972 self.exception_message.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
5973 encoder, offset + cur_offset, depth
5974 )?;
5975
5976 _prev_end_offset = cur_offset + envelope_size;
5977 if 3 > max_ordinal {
5978 return Ok(());
5979 }
5980
5981 let cur_offset: usize = (3 - 1) * envelope_size;
5984
5985 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5987
5988 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
5993 self.exception_stack_trace.as_mut().map(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5994 encoder, offset + cur_offset, depth
5995 )?;
5996
5997 _prev_end_offset = cur_offset + envelope_size;
5998
5999 Ok(())
6000 }
6001 }
6002
6003 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6004 for RuntimeCrashReport
6005 {
6006 #[inline(always)]
6007 fn new_empty() -> Self {
6008 Self::default()
6009 }
6010
6011 unsafe fn decode(
6012 &mut self,
6013 decoder: &mut fidl::encoding::Decoder<
6014 '_,
6015 fidl::encoding::DefaultFuchsiaResourceDialect,
6016 >,
6017 offset: usize,
6018 mut depth: fidl::encoding::Depth,
6019 ) -> fidl::Result<()> {
6020 decoder.debug_check_bounds::<Self>(offset);
6021 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6022 None => return Err(fidl::Error::NotNullable),
6023 Some(len) => len,
6024 };
6025 if len == 0 {
6027 return Ok(());
6028 };
6029 depth.increment()?;
6030 let envelope_size = 8;
6031 let bytes_len = len * envelope_size;
6032 let offset = decoder.out_of_line_offset(bytes_len)?;
6033 let mut _next_ordinal_to_read = 0;
6035 let mut next_offset = offset;
6036 let end_offset = offset + bytes_len;
6037 _next_ordinal_to_read += 1;
6038 if next_offset >= end_offset {
6039 return Ok(());
6040 }
6041
6042 while _next_ordinal_to_read < 1 {
6044 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6045 _next_ordinal_to_read += 1;
6046 next_offset += envelope_size;
6047 }
6048
6049 let next_out_of_line = decoder.next_out_of_line();
6050 let handles_before = decoder.remaining_handles();
6051 if let Some((inlined, num_bytes, num_handles)) =
6052 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6053 {
6054 let member_inline_size =
6055 <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
6056 decoder.context,
6057 );
6058 if inlined != (member_inline_size <= 4) {
6059 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6060 }
6061 let inner_offset;
6062 let mut inner_depth = depth.clone();
6063 if inlined {
6064 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6065 inner_offset = next_offset;
6066 } else {
6067 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6068 inner_depth.increment()?;
6069 }
6070 let val_ref = self.exception_type.get_or_insert_with(|| {
6071 fidl::new_empty!(
6072 fidl::encoding::BoundedString<128>,
6073 fidl::encoding::DefaultFuchsiaResourceDialect
6074 )
6075 });
6076 fidl::decode!(
6077 fidl::encoding::BoundedString<128>,
6078 fidl::encoding::DefaultFuchsiaResourceDialect,
6079 val_ref,
6080 decoder,
6081 inner_offset,
6082 inner_depth
6083 )?;
6084 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6085 {
6086 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6087 }
6088 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6089 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6090 }
6091 }
6092
6093 next_offset += envelope_size;
6094 _next_ordinal_to_read += 1;
6095 if next_offset >= end_offset {
6096 return Ok(());
6097 }
6098
6099 while _next_ordinal_to_read < 2 {
6101 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6102 _next_ordinal_to_read += 1;
6103 next_offset += envelope_size;
6104 }
6105
6106 let next_out_of_line = decoder.next_out_of_line();
6107 let handles_before = decoder.remaining_handles();
6108 if let Some((inlined, num_bytes, num_handles)) =
6109 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6110 {
6111 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6112 if inlined != (member_inline_size <= 4) {
6113 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6114 }
6115 let inner_offset;
6116 let mut inner_depth = depth.clone();
6117 if inlined {
6118 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6119 inner_offset = next_offset;
6120 } else {
6121 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6122 inner_depth.increment()?;
6123 }
6124 let val_ref = self.exception_message.get_or_insert_with(|| {
6125 fidl::new_empty!(
6126 fidl::encoding::BoundedString<4096>,
6127 fidl::encoding::DefaultFuchsiaResourceDialect
6128 )
6129 });
6130 fidl::decode!(
6131 fidl::encoding::BoundedString<4096>,
6132 fidl::encoding::DefaultFuchsiaResourceDialect,
6133 val_ref,
6134 decoder,
6135 inner_offset,
6136 inner_depth
6137 )?;
6138 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6139 {
6140 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6141 }
6142 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6143 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6144 }
6145 }
6146
6147 next_offset += envelope_size;
6148 _next_ordinal_to_read += 1;
6149 if next_offset >= end_offset {
6150 return Ok(());
6151 }
6152
6153 while _next_ordinal_to_read < 3 {
6155 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6156 _next_ordinal_to_read += 1;
6157 next_offset += envelope_size;
6158 }
6159
6160 let next_out_of_line = decoder.next_out_of_line();
6161 let handles_before = decoder.remaining_handles();
6162 if let Some((inlined, num_bytes, num_handles)) =
6163 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6164 {
6165 let member_inline_size =
6166 <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
6167 decoder.context,
6168 );
6169 if inlined != (member_inline_size <= 4) {
6170 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6171 }
6172 let inner_offset;
6173 let mut inner_depth = depth.clone();
6174 if inlined {
6175 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6176 inner_offset = next_offset;
6177 } else {
6178 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6179 inner_depth.increment()?;
6180 }
6181 let val_ref = self.exception_stack_trace.get_or_insert_with(|| {
6182 fidl::new_empty!(
6183 fidl_fuchsia_mem::Buffer,
6184 fidl::encoding::DefaultFuchsiaResourceDialect
6185 )
6186 });
6187 fidl::decode!(
6188 fidl_fuchsia_mem::Buffer,
6189 fidl::encoding::DefaultFuchsiaResourceDialect,
6190 val_ref,
6191 decoder,
6192 inner_offset,
6193 inner_depth
6194 )?;
6195 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6196 {
6197 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6198 }
6199 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6200 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6201 }
6202 }
6203
6204 next_offset += envelope_size;
6205
6206 while next_offset < end_offset {
6208 _next_ordinal_to_read += 1;
6209 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6210 next_offset += envelope_size;
6211 }
6212
6213 Ok(())
6214 }
6215 }
6216
6217 impl Snapshot {
6218 #[inline(always)]
6219 fn max_ordinal_present(&self) -> u64 {
6220 if let Some(_) = self.annotations2 {
6221 return 3;
6222 }
6223 if let Some(_) = self.annotations {
6224 return 2;
6225 }
6226 if let Some(_) = self.archive {
6227 return 1;
6228 }
6229 0
6230 }
6231 }
6232
6233 impl fidl::encoding::ResourceTypeMarker for Snapshot {
6234 type Borrowed<'a> = &'a mut Self;
6235 fn take_or_borrow<'a>(
6236 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6237 ) -> Self::Borrowed<'a> {
6238 value
6239 }
6240 }
6241
6242 unsafe impl fidl::encoding::TypeMarker for Snapshot {
6243 type Owned = Self;
6244
6245 #[inline(always)]
6246 fn inline_align(_context: fidl::encoding::Context) -> usize {
6247 8
6248 }
6249
6250 #[inline(always)]
6251 fn inline_size(_context: fidl::encoding::Context) -> usize {
6252 16
6253 }
6254 }
6255
6256 unsafe impl fidl::encoding::Encode<Snapshot, fidl::encoding::DefaultFuchsiaResourceDialect>
6257 for &mut Snapshot
6258 {
6259 unsafe fn encode(
6260 self,
6261 encoder: &mut fidl::encoding::Encoder<
6262 '_,
6263 fidl::encoding::DefaultFuchsiaResourceDialect,
6264 >,
6265 offset: usize,
6266 mut depth: fidl::encoding::Depth,
6267 ) -> fidl::Result<()> {
6268 encoder.debug_check_bounds::<Snapshot>(offset);
6269 let max_ordinal: u64 = self.max_ordinal_present();
6271 encoder.write_num(max_ordinal, offset);
6272 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6273 if max_ordinal == 0 {
6275 return Ok(());
6276 }
6277 depth.increment()?;
6278 let envelope_size = 8;
6279 let bytes_len = max_ordinal as usize * envelope_size;
6280 #[allow(unused_variables)]
6281 let offset = encoder.out_of_line_offset(bytes_len);
6282 let mut _prev_end_offset: usize = 0;
6283 if 1 > max_ordinal {
6284 return Ok(());
6285 }
6286
6287 let cur_offset: usize = (1 - 1) * envelope_size;
6290
6291 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6293
6294 fidl::encoding::encode_in_envelope_optional::<
6299 Attachment,
6300 fidl::encoding::DefaultFuchsiaResourceDialect,
6301 >(
6302 self.archive
6303 .as_mut()
6304 .map(<Attachment as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6305 encoder,
6306 offset + cur_offset,
6307 depth,
6308 )?;
6309
6310 _prev_end_offset = cur_offset + envelope_size;
6311 if 2 > max_ordinal {
6312 return Ok(());
6313 }
6314
6315 let cur_offset: usize = (2 - 1) * envelope_size;
6318
6319 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6321
6322 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6327 self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 64> as fidl::encoding::ValueTypeMarker>::borrow),
6328 encoder, offset + cur_offset, depth
6329 )?;
6330
6331 _prev_end_offset = cur_offset + envelope_size;
6332 if 3 > max_ordinal {
6333 return Ok(());
6334 }
6335
6336 let cur_offset: usize = (3 - 1) * envelope_size;
6339
6340 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6342
6343 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 512>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6348 self.annotations2.as_ref().map(<fidl::encoding::Vector<Annotation, 512> as fidl::encoding::ValueTypeMarker>::borrow),
6349 encoder, offset + cur_offset, depth
6350 )?;
6351
6352 _prev_end_offset = cur_offset + envelope_size;
6353
6354 Ok(())
6355 }
6356 }
6357
6358 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Snapshot {
6359 #[inline(always)]
6360 fn new_empty() -> Self {
6361 Self::default()
6362 }
6363
6364 unsafe fn decode(
6365 &mut self,
6366 decoder: &mut fidl::encoding::Decoder<
6367 '_,
6368 fidl::encoding::DefaultFuchsiaResourceDialect,
6369 >,
6370 offset: usize,
6371 mut depth: fidl::encoding::Depth,
6372 ) -> fidl::Result<()> {
6373 decoder.debug_check_bounds::<Self>(offset);
6374 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6375 None => return Err(fidl::Error::NotNullable),
6376 Some(len) => len,
6377 };
6378 if len == 0 {
6380 return Ok(());
6381 };
6382 depth.increment()?;
6383 let envelope_size = 8;
6384 let bytes_len = len * envelope_size;
6385 let offset = decoder.out_of_line_offset(bytes_len)?;
6386 let mut _next_ordinal_to_read = 0;
6388 let mut next_offset = offset;
6389 let end_offset = offset + bytes_len;
6390 _next_ordinal_to_read += 1;
6391 if next_offset >= end_offset {
6392 return Ok(());
6393 }
6394
6395 while _next_ordinal_to_read < 1 {
6397 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6398 _next_ordinal_to_read += 1;
6399 next_offset += envelope_size;
6400 }
6401
6402 let next_out_of_line = decoder.next_out_of_line();
6403 let handles_before = decoder.remaining_handles();
6404 if let Some((inlined, num_bytes, num_handles)) =
6405 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6406 {
6407 let member_inline_size =
6408 <Attachment as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6409 if inlined != (member_inline_size <= 4) {
6410 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6411 }
6412 let inner_offset;
6413 let mut inner_depth = depth.clone();
6414 if inlined {
6415 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6416 inner_offset = next_offset;
6417 } else {
6418 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6419 inner_depth.increment()?;
6420 }
6421 let val_ref = self.archive.get_or_insert_with(|| {
6422 fidl::new_empty!(Attachment, fidl::encoding::DefaultFuchsiaResourceDialect)
6423 });
6424 fidl::decode!(
6425 Attachment,
6426 fidl::encoding::DefaultFuchsiaResourceDialect,
6427 val_ref,
6428 decoder,
6429 inner_offset,
6430 inner_depth
6431 )?;
6432 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6433 {
6434 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6435 }
6436 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6437 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6438 }
6439 }
6440
6441 next_offset += envelope_size;
6442 _next_ordinal_to_read += 1;
6443 if next_offset >= end_offset {
6444 return Ok(());
6445 }
6446
6447 while _next_ordinal_to_read < 2 {
6449 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6450 _next_ordinal_to_read += 1;
6451 next_offset += envelope_size;
6452 }
6453
6454 let next_out_of_line = decoder.next_out_of_line();
6455 let handles_before = decoder.remaining_handles();
6456 if let Some((inlined, num_bytes, num_handles)) =
6457 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6458 {
6459 let member_inline_size = <fidl::encoding::Vector<Annotation, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6460 if inlined != (member_inline_size <= 4) {
6461 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6462 }
6463 let inner_offset;
6464 let mut inner_depth = depth.clone();
6465 if inlined {
6466 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6467 inner_offset = next_offset;
6468 } else {
6469 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6470 inner_depth.increment()?;
6471 }
6472 let val_ref =
6473 self.annotations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Annotation, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
6474 fidl::decode!(fidl::encoding::Vector<Annotation, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6475 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6476 {
6477 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6478 }
6479 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6480 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6481 }
6482 }
6483
6484 next_offset += envelope_size;
6485 _next_ordinal_to_read += 1;
6486 if next_offset >= end_offset {
6487 return Ok(());
6488 }
6489
6490 while _next_ordinal_to_read < 3 {
6492 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6493 _next_ordinal_to_read += 1;
6494 next_offset += envelope_size;
6495 }
6496
6497 let next_out_of_line = decoder.next_out_of_line();
6498 let handles_before = decoder.remaining_handles();
6499 if let Some((inlined, num_bytes, num_handles)) =
6500 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6501 {
6502 let member_inline_size = <fidl::encoding::Vector<Annotation, 512> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6503 if inlined != (member_inline_size <= 4) {
6504 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6505 }
6506 let inner_offset;
6507 let mut inner_depth = depth.clone();
6508 if inlined {
6509 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6510 inner_offset = next_offset;
6511 } else {
6512 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6513 inner_depth.increment()?;
6514 }
6515 let val_ref =
6516 self.annotations2.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Annotation, 512>, fidl::encoding::DefaultFuchsiaResourceDialect));
6517 fidl::decode!(fidl::encoding::Vector<Annotation, 512>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
6518 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6519 {
6520 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6521 }
6522 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6523 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6524 }
6525 }
6526
6527 next_offset += envelope_size;
6528
6529 while next_offset < end_offset {
6531 _next_ordinal_to_read += 1;
6532 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6533 next_offset += envelope_size;
6534 }
6535
6536 Ok(())
6537 }
6538 }
6539
6540 impl fidl::encoding::ResourceTypeMarker for SpecificCrashReport {
6541 type Borrowed<'a> = &'a mut Self;
6542 fn take_or_borrow<'a>(
6543 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6544 ) -> Self::Borrowed<'a> {
6545 value
6546 }
6547 }
6548
6549 unsafe impl fidl::encoding::TypeMarker for SpecificCrashReport {
6550 type Owned = Self;
6551
6552 #[inline(always)]
6553 fn inline_align(_context: fidl::encoding::Context) -> usize {
6554 8
6555 }
6556
6557 #[inline(always)]
6558 fn inline_size(_context: fidl::encoding::Context) -> usize {
6559 16
6560 }
6561 }
6562
6563 unsafe impl
6564 fidl::encoding::Encode<SpecificCrashReport, fidl::encoding::DefaultFuchsiaResourceDialect>
6565 for &mut SpecificCrashReport
6566 {
6567 #[inline]
6568 unsafe fn encode(
6569 self,
6570 encoder: &mut fidl::encoding::Encoder<
6571 '_,
6572 fidl::encoding::DefaultFuchsiaResourceDialect,
6573 >,
6574 offset: usize,
6575 _depth: fidl::encoding::Depth,
6576 ) -> fidl::Result<()> {
6577 encoder.debug_check_bounds::<SpecificCrashReport>(offset);
6578 encoder.write_num::<u64>(self.ordinal(), offset);
6579 match self {
6580 SpecificCrashReport::Native(ref mut val) => fidl::encoding::encode_in_envelope::<
6581 NativeCrashReport,
6582 fidl::encoding::DefaultFuchsiaResourceDialect,
6583 >(
6584 <NativeCrashReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
6585 encoder,
6586 offset + 8,
6587 _depth,
6588 ),
6589 SpecificCrashReport::Dart(ref mut val) => fidl::encoding::encode_in_envelope::<
6590 RuntimeCrashReport,
6591 fidl::encoding::DefaultFuchsiaResourceDialect,
6592 >(
6593 <RuntimeCrashReport as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
6594 encoder,
6595 offset + 8,
6596 _depth,
6597 ),
6598 SpecificCrashReport::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
6599 }
6600 }
6601 }
6602
6603 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6604 for SpecificCrashReport
6605 {
6606 #[inline(always)]
6607 fn new_empty() -> Self {
6608 Self::__SourceBreaking { unknown_ordinal: 0 }
6609 }
6610
6611 #[inline]
6612 unsafe fn decode(
6613 &mut self,
6614 decoder: &mut fidl::encoding::Decoder<
6615 '_,
6616 fidl::encoding::DefaultFuchsiaResourceDialect,
6617 >,
6618 offset: usize,
6619 mut depth: fidl::encoding::Depth,
6620 ) -> fidl::Result<()> {
6621 decoder.debug_check_bounds::<Self>(offset);
6622 #[allow(unused_variables)]
6623 let next_out_of_line = decoder.next_out_of_line();
6624 let handles_before = decoder.remaining_handles();
6625 let (ordinal, inlined, num_bytes, num_handles) =
6626 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6627
6628 let member_inline_size = match ordinal {
6629 2 => {
6630 <NativeCrashReport as fidl::encoding::TypeMarker>::inline_size(decoder.context)
6631 }
6632 3 => {
6633 <RuntimeCrashReport as fidl::encoding::TypeMarker>::inline_size(decoder.context)
6634 }
6635 0 => return Err(fidl::Error::UnknownUnionTag),
6636 _ => num_bytes as usize,
6637 };
6638
6639 if inlined != (member_inline_size <= 4) {
6640 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6641 }
6642 let _inner_offset;
6643 if inlined {
6644 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6645 _inner_offset = offset + 8;
6646 } else {
6647 depth.increment()?;
6648 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6649 }
6650 match ordinal {
6651 2 => {
6652 #[allow(irrefutable_let_patterns)]
6653 if let SpecificCrashReport::Native(_) = self {
6654 } else {
6656 *self = SpecificCrashReport::Native(fidl::new_empty!(
6658 NativeCrashReport,
6659 fidl::encoding::DefaultFuchsiaResourceDialect
6660 ));
6661 }
6662 #[allow(irrefutable_let_patterns)]
6663 if let SpecificCrashReport::Native(ref mut val) = self {
6664 fidl::decode!(
6665 NativeCrashReport,
6666 fidl::encoding::DefaultFuchsiaResourceDialect,
6667 val,
6668 decoder,
6669 _inner_offset,
6670 depth
6671 )?;
6672 } else {
6673 unreachable!()
6674 }
6675 }
6676 3 => {
6677 #[allow(irrefutable_let_patterns)]
6678 if let SpecificCrashReport::Dart(_) = self {
6679 } else {
6681 *self = SpecificCrashReport::Dart(fidl::new_empty!(
6683 RuntimeCrashReport,
6684 fidl::encoding::DefaultFuchsiaResourceDialect
6685 ));
6686 }
6687 #[allow(irrefutable_let_patterns)]
6688 if let SpecificCrashReport::Dart(ref mut val) = self {
6689 fidl::decode!(
6690 RuntimeCrashReport,
6691 fidl::encoding::DefaultFuchsiaResourceDialect,
6692 val,
6693 decoder,
6694 _inner_offset,
6695 depth
6696 )?;
6697 } else {
6698 unreachable!()
6699 }
6700 }
6701 #[allow(deprecated)]
6702 ordinal => {
6703 for _ in 0..num_handles {
6704 decoder.drop_next_handle()?;
6705 }
6706 *self = SpecificCrashReport::__SourceBreaking { unknown_ordinal: ordinal };
6707 }
6708 }
6709 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6710 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6711 }
6712 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6713 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6714 }
6715 Ok(())
6716 }
6717 }
6718}