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
19extern_conformance!(
20    unsafe impl<UnitType: ?Sized + NSCoding> NSCoding for MXAverage<UnitType> {}
21);
22
23extern_conformance!(
24    unsafe impl<UnitType: ?Sized> NSObjectProtocol for MXAverage<UnitType> {}
25);
26
27extern_conformance!(
28    unsafe impl<UnitType: ?Sized + NSSecureCoding> NSSecureCoding for MXAverage<UnitType> {}
29);
30
31impl<UnitType: Message> MXAverage<UnitType> {
32    extern_methods!(
33        /// An NSMeasurement that contains the average measurement.
34        #[unsafe(method(averageMeasurement))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn averageMeasurement(&self) -> Retained<NSMeasurement<UnitType>>;
37
38        /// An NSInteger representation of the number of samples in the distribution used to formulate the average.
39        ///
40        /// This value is negative if an unknown number of samples was used to compute the average.
41        #[unsafe(method(sampleCount))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn sampleCount(&self) -> NSInteger;
44
45        /// An double representation of the standard deviation of the distribution.
46        ///
47        /// This value is negative an unknown number of samples was used to compute the standard deviation.
48        #[unsafe(method(standardDeviation))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn standardDeviation(&self) -> c_double;
51    );
52}
53
54/// Methods declared on superclass `NSObject`.
55impl<UnitType: Message> MXAverage<UnitType> {
56    extern_methods!(
57        #[unsafe(method(init))]
58        #[unsafe(method_family = init)]
59        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
60
61        #[unsafe(method(new))]
62        #[unsafe(method_family = new)]
63        pub unsafe fn new() -> Retained<Self>;
64    );
65}