objc2_metric_kit/generated/
MXAverage.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// A class representing metric data that is averaged.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxaverage?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct MXAverage<UnitType: ?Sized = AnyObject>;
17);
18
19unsafe impl<UnitType: ?Sized + NSCoding> NSCoding for MXAverage<UnitType> {}
20
21unsafe impl<UnitType: ?Sized> NSObjectProtocol for MXAverage<UnitType> {}
22
23unsafe impl<UnitType: ?Sized + NSSecureCoding> NSSecureCoding for MXAverage<UnitType> {}
24
25impl<UnitType: Message> MXAverage<UnitType> {
26    extern_methods!(
27        /// An NSMeasurement that contains the average measurement.
28        #[unsafe(method(averageMeasurement))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn averageMeasurement(&self) -> Retained<NSMeasurement<UnitType>>;
31
32        /// An NSInteger representation of the number of samples in the distribution used to formulate the average.
33        ///
34        /// This value is negative if an unknown number of samples was used to compute the average.
35        #[unsafe(method(sampleCount))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn sampleCount(&self) -> NSInteger;
38
39        /// An double representation of the standard deviation of the distribution.
40        ///
41        /// This value is negative an unknown number of samples was used to compute the standard deviation.
42        #[unsafe(method(standardDeviation))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn standardDeviation(&self) -> c_double;
45    );
46}
47
48/// Methods declared on superclass `NSObject`.
49impl<UnitType: Message> MXAverage<UnitType> {
50    extern_methods!(
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        #[unsafe(method(new))]
56        #[unsafe(method_family = new)]
57        pub unsafe fn new() -> Retained<Self>;
58    );
59}