objc2_metric_kit/generated/
MXCPUMetric.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 CPU metrics.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxcpumetric?language=objc)
13    #[unsafe(super(MXMetric, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "MXMetric")]
16    pub struct MXCPUMetric;
17);
18
19#[cfg(feature = "MXMetric")]
20unsafe impl NSCoding for MXCPUMetric {}
21
22#[cfg(feature = "MXMetric")]
23unsafe impl NSObjectProtocol for MXCPUMetric {}
24
25#[cfg(feature = "MXMetric")]
26unsafe impl NSSecureCoding for MXCPUMetric {}
27
28#[cfg(feature = "MXMetric")]
29impl MXCPUMetric {
30    extern_methods!(
31        /// CPU time aggregated cumulatively.
32        ///
33        /// The data here represents the total CPU time an application consumed over the date range of the containing payload.
34        ///
35        /// Dimensioned as NSUnitDuration.
36        #[unsafe(method(cumulativeCPUTime))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn cumulativeCPUTime(&self) -> Retained<NSMeasurement<NSUnitDuration>>;
39
40        /// CPU instructions retired aggregated cumulatively.
41        ///
42        /// The data here represents the total number of CPU instructions an application retired over the date range of the containing payload.
43        ///
44        /// Dimensionless.
45        #[unsafe(method(cumulativeCPUInstructions))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn cumulativeCPUInstructions(&self) -> Retained<NSMeasurement<NSUnit>>;
48    );
49}
50
51/// Methods declared on superclass `NSObject`.
52#[cfg(feature = "MXMetric")]
53impl MXCPUMetric {
54    extern_methods!(
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58
59        #[unsafe(method(new))]
60        #[unsafe(method_family = new)]
61        pub unsafe fn new() -> Retained<Self>;
62    );
63}