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")]
22unsafe impl NSCoding for MXAppRunTimeMetric {}
23
24#[cfg(feature = "MXMetric")]
25unsafe impl NSObjectProtocol for MXAppRunTimeMetric {}
26
27#[cfg(feature = "MXMetric")]
28unsafe impl NSSecureCoding for MXAppRunTimeMetric {}
29
30#[cfg(feature = "MXMetric")]
31impl MXAppRunTimeMetric {
32    extern_methods!(
33        /// Cumulative application foreground time.
34        ///
35        /// Time spent on screen and visible to the user.
36        ///
37        /// Dimensioned as NSUnitDuration.
38        #[unsafe(method(cumulativeForegroundTime))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn cumulativeForegroundTime(&self) -> Retained<NSMeasurement<NSUnitDuration>>;
41
42        /// Cumulative application background time.
43        ///
44        /// Time spent off screen and in the background, invisible to the user.
45        ///
46        /// Dimensioned as NSUnitDuration.
47        #[unsafe(method(cumulativeBackgroundTime))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn cumulativeBackgroundTime(&self) -> Retained<NSMeasurement<NSUnitDuration>>;
50
51        /// Cumulative time the application spent running in the background to play audio
52        ///
53        /// Dimensioned as NSUnitDuration.
54        #[unsafe(method(cumulativeBackgroundAudioTime))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn cumulativeBackgroundAudioTime(
57            &self,
58        ) -> Retained<NSMeasurement<NSUnitDuration>>;
59
60        /// Cumulative time the application spent running in the background to acquire or process location.
61        ///
62        /// Dimensioned as NSUnitDuration.
63        #[unsafe(method(cumulativeBackgroundLocationTime))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn cumulativeBackgroundLocationTime(
66            &self,
67        ) -> Retained<NSMeasurement<NSUnitDuration>>;
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72#[cfg(feature = "MXMetric")]
73impl MXAppRunTimeMetric {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}