objc2_metric_kit/generated/
MXHangDiagnostic.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 hang diagnostic reports.
11    ///
12    /// Applications are considered to be "hanging" when they are unable to handle user input responsively.
13    ///
14    /// This generally occurs when your applications main thread is blocked.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxhangdiagnostic?language=objc)
17    #[unsafe(super(MXDiagnostic, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "MXDiagnostic")]
20    pub struct MXHangDiagnostic;
21);
22
23#[cfg(feature = "MXDiagnostic")]
24extern_conformance!(
25    unsafe impl NSCoding for MXHangDiagnostic {}
26);
27
28#[cfg(feature = "MXDiagnostic")]
29extern_conformance!(
30    unsafe impl NSObjectProtocol for MXHangDiagnostic {}
31);
32
33#[cfg(feature = "MXDiagnostic")]
34extern_conformance!(
35    unsafe impl NSSecureCoding for MXHangDiagnostic {}
36);
37
38#[cfg(feature = "MXDiagnostic")]
39impl MXHangDiagnostic {
40    extern_methods!(
41        #[cfg(feature = "MXCallStackTree")]
42        /// The application call stack tree associated with the hang.
43        #[unsafe(method(callStackTree))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn callStackTree(&self) -> Retained<MXCallStackTree>;
46
47        /// Total hang duration for this diagnostic.
48        ///
49        /// Dimensioned as NSUnitDuration.
50        #[unsafe(method(hangDuration))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn hangDuration(&self) -> Retained<NSMeasurement<NSUnitDuration>>;
53    );
54}
55
56/// Methods declared on superclass `NSObject`.
57#[cfg(feature = "MXDiagnostic")]
58impl MXHangDiagnostic {
59    extern_methods!(
60        #[unsafe(method(init))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
63
64        #[unsafe(method(new))]
65        #[unsafe(method_family = new)]
66        pub unsafe fn new() -> Retained<Self>;
67    );
68}