objc2_metric_kit/generated/
MXAnimationMetric.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 animation metrics.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxanimationmetric?language=objc)
13    #[unsafe(super(MXMetric, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "MXMetric")]
16    pub struct MXAnimationMetric;
17);
18
19#[cfg(feature = "MXMetric")]
20extern_conformance!(
21    unsafe impl NSCoding for MXAnimationMetric {}
22);
23
24#[cfg(feature = "MXMetric")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for MXAnimationMetric {}
27);
28
29#[cfg(feature = "MXMetric")]
30extern_conformance!(
31    unsafe impl NSSecureCoding for MXAnimationMetric {}
32);
33
34#[cfg(feature = "MXMetric")]
35impl MXAnimationMetric {
36    extern_methods!(
37        /// Ratio of time the application spent hitching while scrolling.
38        ///
39        /// Scroll hitches are user perceptible animation issues that occur during scrolling.
40        ///
41        /// This metric only applies to UIScrollViews.
42        ///
43        /// Dimensionless.
44        #[unsafe(method(scrollHitchTimeRatio))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn scrollHitchTimeRatio(&self) -> Retained<NSMeasurement<NSUnit>>;
47
48        /// Ratio of time the application spent hitching during tracked animations.
49        ///
50        /// Hitches are user perceptible frame delays that can occur during animations and scrolling.
51        ///
52        /// This metric incorporates adjustments that optimize for user perception, and typically will be the most accurate representation of what hitches users experience during app usage.
53        ///
54        /// This metric is normalized against total animation duration.
55        ///
56        /// Many animations are tracked by default. You can track additional animations using the -[NSProcessInfo beginActivityWithOptions:reason:] method with the NSActivityAnimationTrackingEnabled option.
57        ///
58        /// Dimensionless.
59        #[unsafe(method(hitchTimeRatio))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn hitchTimeRatio(&self) -> Retained<NSMeasurement<NSUnit>>;
62    );
63}
64
65/// Methods declared on superclass `NSObject`.
66#[cfg(feature = "MXMetric")]
67impl MXAnimationMetric {
68    extern_methods!(
69        #[unsafe(method(init))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72
73        #[unsafe(method(new))]
74        #[unsafe(method_family = new)]
75        pub unsafe fn new() -> Retained<Self>;
76    );
77}