objc2_metric_kit/generated/
MXCrashDiagnostic.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// An MXDiagnostic subclass that encapsulates crash reports.
11    ///
12    /// See "Analyzing a Crash Report" for more information on crash diagnostics.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxcrashdiagnostic?language=objc)
15    #[unsafe(super(MXDiagnostic, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "MXDiagnostic")]
18    pub struct MXCrashDiagnostic;
19);
20
21#[cfg(feature = "MXDiagnostic")]
22extern_conformance!(
23    unsafe impl NSCoding for MXCrashDiagnostic {}
24);
25
26#[cfg(feature = "MXDiagnostic")]
27extern_conformance!(
28    unsafe impl NSObjectProtocol for MXCrashDiagnostic {}
29);
30
31#[cfg(feature = "MXDiagnostic")]
32extern_conformance!(
33    unsafe impl NSSecureCoding for MXCrashDiagnostic {}
34);
35
36#[cfg(feature = "MXDiagnostic")]
37impl MXCrashDiagnostic {
38    extern_methods!(
39        #[cfg(feature = "MXCallStackTree")]
40        /// The application call stack tree associated with this crash.
41        ///
42        /// This call stack tree includes those stack frames present at the time of the crash.
43        #[unsafe(method(callStackTree))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn callStackTree(&self) -> Retained<MXCallStackTree>;
46
47        /// The termination reason associated with this crash.
48        ///
49        /// Exit reason information specified when a process is terminated. Key system components, both inside and outside of a process, will terminate the process upon encountering a fatal error (e.g. a bad code signature, a missing dependent library, or accessing privacy sensitive information without the proper entitlement).
50        #[unsafe(method(terminationReason))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn terminationReason(&self) -> Option<Retained<NSString>>;
53
54        /// Details about memory that the app incorrectly accessed in relation to other sections of the app’s virtual memory address space.
55        ///
56        /// This property is set when a bad memory access crash occurs.
57        #[unsafe(method(virtualMemoryRegionInfo))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn virtualMemoryRegionInfo(&self) -> Option<Retained<NSString>>;
60
61        /// The name of the Mach exception that terminated the app.
62        ///
63        /// See: sys/exception_types.h
64        #[unsafe(method(exceptionType))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn exceptionType(&self) -> Option<Retained<NSNumber>>;
67
68        /// Processor specific information about the exception encoded into one or more 64-bit hexadecimal numbers
69        ///
70        /// See: sys/exception_types.h
71        #[unsafe(method(exceptionCode))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn exceptionCode(&self) -> Option<Retained<NSNumber>>;
74
75        /// The signal associated with this crash.
76        ///
77        /// See: sys/signal.h
78        #[unsafe(method(signal))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn signal(&self) -> Option<Retained<NSNumber>>;
81
82        #[cfg(feature = "MXCrashDiagnosticObjectiveCExceptionReason")]
83        /// The MXCrashDiagnosticObjectiveCExceptionReason object associated with this crash.
84        ///
85        /// See: <MetricKit
86        /// /MXCrashDiagnosticObjectiveCExceptionReason.h>
87        #[unsafe(method(exceptionReason))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn exceptionReason(
90            &self,
91        ) -> Option<Retained<MXCrashDiagnosticObjectiveCExceptionReason>>;
92    );
93}
94
95/// Methods declared on superclass `NSObject`.
96#[cfg(feature = "MXDiagnostic")]
97impl MXCrashDiagnostic {
98    extern_methods!(
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub unsafe fn new() -> Retained<Self>;
106    );
107}