objc2_metric_kit/generated/
MXHistogram.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    /// A class that represents a bucket within an MXHistogram
11    ///
12    /// Histogram buckets are sorted in ascending order.
13    ///
14    /// Histogram bucket start and end values are exclusive.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxhistogrambucket?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct MXHistogramBucket<UnitType: ?Sized = AnyObject>;
20);
21
22unsafe impl<UnitType: ?Sized + NSCoding> NSCoding for MXHistogramBucket<UnitType> {}
23
24unsafe impl<UnitType: ?Sized> NSObjectProtocol for MXHistogramBucket<UnitType> {}
25
26unsafe impl<UnitType: ?Sized + NSSecureCoding> NSSecureCoding for MXHistogramBucket<UnitType> {}
27
28impl<UnitType: Message> MXHistogramBucket<UnitType> {
29    extern_methods!(
30        /// An NSMeasurement representing the start of a histogram bucket.
31        #[unsafe(method(bucketStart))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn bucketStart(&self) -> Retained<NSMeasurement<UnitType>>;
34
35        /// An NSMeasurement representing the end of a histogram bucket.
36        #[unsafe(method(bucketEnd))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn bucketEnd(&self) -> Retained<NSMeasurement<UnitType>>;
39
40        /// An NSUInteger representing the number of samples in this histogram bucket.
41        #[unsafe(method(bucketCount))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn bucketCount(&self) -> NSUInteger;
44    );
45}
46
47/// Methods declared on superclass `NSObject`.
48impl<UnitType: Message> MXHistogramBucket<UnitType> {
49    extern_methods!(
50        #[unsafe(method(init))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53
54        #[unsafe(method(new))]
55        #[unsafe(method_family = new)]
56        pub unsafe fn new() -> Retained<Self>;
57    );
58}
59
60extern_class!(
61    /// A class representing bucketized histogram data.
62    ///
63    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxhistogram?language=objc)
64    #[unsafe(super(NSObject))]
65    #[derive(Debug, PartialEq, Eq, Hash)]
66    pub struct MXHistogram<UnitType: ?Sized = AnyObject>;
67);
68
69unsafe impl<UnitType: ?Sized + NSCoding> NSCoding for MXHistogram<UnitType> {}
70
71unsafe impl<UnitType: ?Sized> NSObjectProtocol for MXHistogram<UnitType> {}
72
73unsafe impl<UnitType: ?Sized + NSSecureCoding> NSSecureCoding for MXHistogram<UnitType> {}
74
75impl<UnitType: Message> MXHistogram<UnitType> {
76    extern_methods!(
77        /// The number of buckets contained within this histogram.
78        ///
79        /// This value can never be negative.
80        #[unsafe(method(totalBucketCount))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn totalBucketCount(&self) -> NSUInteger;
83
84        /// An NSEnumerator that can be used to enumerate the buckets of this histogram.
85        #[unsafe(method(bucketEnumerator))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn bucketEnumerator(
88            &self,
89        ) -> Retained<NSEnumerator<MXHistogramBucket<UnitType>>>;
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl<UnitType: Message> MXHistogram<UnitType> {
95    extern_methods!(
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub unsafe fn new() -> Retained<Self>;
103    );
104}