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")]
20extern_conformance!(
21    unsafe impl NSCoding for MXCPUMetric {}
22);
23
24#[cfg(feature = "MXMetric")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for MXCPUMetric {}
27);
28
29#[cfg(feature = "MXMetric")]
30extern_conformance!(
31    unsafe impl NSSecureCoding for MXCPUMetric {}
32);
33
34#[cfg(feature = "MXMetric")]
35impl MXCPUMetric {
36    extern_methods!(
37        /// CPU time aggregated cumulatively.
38        ///
39        /// The data here represents the total CPU time an application consumed over the date range of the containing payload.
40        ///
41        /// Dimensioned as NSUnitDuration.
42        #[unsafe(method(cumulativeCPUTime))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn cumulativeCPUTime(&self) -> Retained<NSMeasurement<NSUnitDuration>>;
45
46        /// CPU instructions retired aggregated cumulatively.
47        ///
48        /// The data here represents the total number of CPU instructions an application retired over the date range of the containing payload.
49        ///
50        /// Dimensionless.
51        #[unsafe(method(cumulativeCPUInstructions))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn cumulativeCPUInstructions(&self) -> Retained<NSMeasurement<NSUnit>>;
54    );
55}
56
57/// Methods declared on superclass `NSObject`.
58#[cfg(feature = "MXMetric")]
59impl MXCPUMetric {
60    extern_methods!(
61        #[unsafe(method(init))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
64
65        #[unsafe(method(new))]
66        #[unsafe(method_family = new)]
67        pub unsafe fn new() -> Retained<Self>;
68    );
69}