objc2_metric_kit/generated/
MXAppRunTimeMetric.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 MXMetric subclass that encapsulates app runtime metrics.
11    ///
12    /// Runtime metrics describe application time spent running in different modes, such as audio, location, etc.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxappruntimemetric?language=objc)
15    #[unsafe(super(MXMetric, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "MXMetric")]
18    pub struct MXAppRunTimeMetric;
19);
20
21#[cfg(feature = "MXMetric")]
22extern_conformance!(
23    unsafe impl NSCoding for MXAppRunTimeMetric {}
24);
25
26#[cfg(feature = "MXMetric")]
27extern_conformance!(
28    unsafe impl NSObjectProtocol for MXAppRunTimeMetric {}
29);
30
31#[cfg(feature = "MXMetric")]
32extern_conformance!(
33    unsafe impl NSSecureCoding for MXAppRunTimeMetric {}
34);
35
36#[cfg(feature = "MXMetric")]
37impl MXAppRunTimeMetric {
38    extern_methods!(
39        /// Cumulative application foreground time.
40        ///
41        /// Time spent on screen and visible to the user.
42        ///
43        /// Dimensioned as NSUnitDuration.
44        #[unsafe(method(cumulativeForegroundTime))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn cumulativeForegroundTime(&self) -> Retained<NSMeasurement<NSUnitDuration>>;
47
48        /// Cumulative application background time.
49        ///
50        /// Time spent off screen and in the background, invisible to the user.
51        ///
52        /// Dimensioned as NSUnitDuration.
53        #[unsafe(method(cumulativeBackgroundTime))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn cumulativeBackgroundTime(&self) -> Retained<NSMeasurement<NSUnitDuration>>;
56
57        /// Cumulative time the application spent running in the background to play audio
58        ///
59        /// Dimensioned as NSUnitDuration.
60        #[unsafe(method(cumulativeBackgroundAudioTime))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn cumulativeBackgroundAudioTime(
63            &self,
64        ) -> Retained<NSMeasurement<NSUnitDuration>>;
65
66        /// Cumulative time the application spent running in the background to acquire or process location.
67        ///
68        /// Dimensioned as NSUnitDuration.
69        #[unsafe(method(cumulativeBackgroundLocationTime))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn cumulativeBackgroundLocationTime(
72            &self,
73        ) -> Retained<NSMeasurement<NSUnitDuration>>;
74    );
75}
76
77/// Methods declared on superclass `NSObject`.
78#[cfg(feature = "MXMetric")]
79impl MXAppRunTimeMetric {
80    extern_methods!(
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new() -> Retained<Self>;
88    );
89}